diff --git a/specification/ai-foundry/cspell.yaml b/specification/ai-foundry/cspell.yaml
index 9fddc6206754..399997bf61c7 100644
--- a/specification/ai-foundry/cspell.yaml
+++ b/specification/ai-foundry/cspell.yaml
@@ -19,6 +19,44 @@ words:
- logprobs
- dedup
overrides:
+ # OpenAI related terms
+ - filename:
+ - '**/specification/ai-foundry/data-plane/Foundry/src/openai/**'
+ - '**/specification/ai-foundry/data-plane/Foundry/openapi3'
+ - '**/specification/ai-foundry/data-plane/Foundry/stable'
+ - '**/specification/ai-foundry/data-plane/Foundry/preview'
+ words:
+ - acemeco
+ - ahrenheit
+ - Buffett
+ - dall
+ - egroup
+ - erun
+ - FDOC
+ - ftjob
+ - GEICO's
+ - granularities
+ - Hsqc
+ - Jwfo
+ - Liegl
+ - mpga
+ - msid
+ - notificiation
+ - okhttp
+ - ouputs
+ - rtpmap
+ - SAVPF
+ - tcptype
+ - tfmt
+ - ufrag
+ - uhhm
+ - Vbqg
+ - vsfb
+ - webrtc
+ - wuzzy
+ - Xxulc
+ - Zdws
+
# Red-team related terms
- filename:
- '**/specification/ai-foundry/data-plane/Foundry/src/red-teams'
@@ -49,6 +87,15 @@ overrides:
- filename: '**/*client*tsp'
ignoreRegExpList:
- '/@@clientName\([^\"]*\"([^\"]*)/g'
+ # Route documentation checker terminology
+ - filename: '**/data-plane/Foundry/.github/skills/foundry-route-doc-check/references/route-documentation-rules.md'
+ words:
+ - reemits
+ # Windows command script built-ins
+ - filename: '**/data-plane/Foundry/compile_all.cmd'
+ words:
+ - popd
+ - pushd
# Example and output patterns: ignore common false positives in examples and emission outputs
- filename:
- '**/specification/ai-foundry/data-plane/Foundry/examples'
@@ -82,4 +129,4 @@ overrides:
- '**/specification/ai-foundry/data-plane/Foundry/.github/skills'
words:
- fdoc
- - reemits
\ No newline at end of file
+ - reemits
diff --git a/specification/ai-foundry/data-plane/Foundry/.github/skills/foundry-route-doc-check/SKILL.md b/specification/ai-foundry/data-plane/Foundry/.github/skills/foundry-route-doc-check/SKILL.md
index ff5675308675..e9e78923ad6d 100644
--- a/specification/ai-foundry/data-plane/Foundry/.github/skills/foundry-route-doc-check/SKILL.md
+++ b/specification/ai-foundry/data-plane/Foundry/.github/skills/foundry-route-doc-check/SKILL.md
@@ -2,8 +2,8 @@
name: foundry-route-doc-check
license: MIT
metadata:
- version: "1.4.0"
-description: "Validates that all TypeSpec route operations in the AI Foundry data-plane (Foundry) domain have documentation comments and @summary decorators with correct voice. USE FOR: reviewing or authoring routes.tsp files under specification/ai-foundry/data-plane/Foundry/src/. DO NOT USE FOR: files outside the Foundry data-plane area, model-only .tsp files, or SDK client customization files (client.tsp)."
+ version: "1.6.1"
+description: "Validates that all TypeSpec route operations in the AI Foundry data-plane (Foundry) domain have documentation comments and @summary decorators with correct voice, replaces documentation-required suppressions with generated documentation, and uses description override extensions when TypeSpec would concatenate noisy descriptions. USE FOR: reviewing or authoring routes.tsp and routes.generated.tsp files under specification/ai-foundry/data-plane/Foundry/src/, including nested OpenAI routes under src/openai/. DO NOT USE FOR: files outside the Foundry data-plane area, model-only .tsp files, or SDK client customization files (client.tsp)."
---
# Foundry Route Documentation Check
@@ -18,8 +18,11 @@ This skill applies **only** to files matching:
```
specification/ai-foundry/data-plane/Foundry/src/**/routes.tsp
+specification/ai-foundry/data-plane/Foundry/src/**/routes.generated.tsp
```
+OpenAI route files are nested under `specification/ai-foundry/data-plane/Foundry/src/openai//`.
+
It does **not** apply to:
- `models.tsp`, `client.tsp`, `client.*.tsp`, or `main.tsp` files
@@ -41,15 +44,24 @@ operations that have an explicit, significant rule violation:
- Wrong grammatical voice (`@summary` using third-person, or doc comment using imperative) → fix
- Empty or placeholder documentation → fix
- Summary contains unnecessary filler ("all", "by id") that can be removed → fix
+- Summary uses a multiline triple-quoted string, full sentence, or paragraph instead of a concise single-line phrase → fix
- Description is near-identical to the summary with no added detail → fix
- Description uses `@doc()` instead of a TSDoc `/** ... */` comment → fix
+- `#suppress "@azure-tools/typespec-azure-core/documentation-required" ...` hides missing route or parameter documentation → remove the suppression and add documentation
+- Multiple adjacent TSDoc comment blocks apply to the same operation or parameter → merge or remove the redundant block
+- Multiple route variants or content types would cause TypeSpec to concatenate request body or parameter descriptions into noisy OpenAPI text → add the appropriate override extension with the intended final description instead of stacking TSDoc comments
- Minor wording preferences or stylistic differences that do not violate a rule → **leave unchanged**
When in doubt, leave the existing text alone.
+For `routes.generated.tsp` files, it is acceptable to apply this skill's automated
+rewrite directly to the generated file. The intended workflow is to run route
+generation first and then run this rewrite immediately afterward, so the generated
+route documentation changes are consistently reapplied and not lost overall.
+
## Rules
-Every operation defined inside an `interface` block in a `routes.tsp` file must satisfy
+Every operation defined inside an `interface` block in a `routes.tsp` or `routes.generated.tsp` file must satisfy
**all** of the following requirements. See [route-documentation-rules.md](references/route-documentation-rules.md)
for the full rule definitions, examples, and remediation guidance.
@@ -58,19 +70,86 @@ for the full rule definitions, examples, and remediation guidance.
| `FDOC-001` | **Every** operation must have a TSDoc `/** ... */` comment. Prefer TSDoc over `@doc()`. |
| `FDOC-002` | **Every** operation must have a `@summary()` decorator — no exceptions |
| `FDOC-003` | The TSDoc description must use **third-person indicative** voice ("Creates an agent"), must add meaningful detail beyond the summary, and must not be near-identical to the summary. |
-| `FDOC-004` | `@summary()` must be a maximally concise **imperative** phrase ("Create an agent"). No trailing period. No filler ("all", "by ID", "info about"). Must not be truncated. Always include articles. |
+| `FDOC-004` | `@summary()` must be a maximally concise, single-line **imperative** phrase ("Create an agent"). No multiline strings. No trailing period. No filler ("all", "by ID", "info about"). Must not be truncated. Always include articles. |
| `FDOC-005` | Each `@path`, `@query`, `@header`, and `@body` parameter must have a doc comment or `@doc()` |
+| `FDOC-006` | Do not leave multiple adjacent TSDoc comment blocks on the same operation or parameter. TypeSpec concatenates adjacent docs into one OpenAPI `description`, which can produce malformed text. |
+| `FDOC-007` | Remove `documentation-required` suppressions on routes and parameters, including auto-generated import suppressions, and replace them with generated TSDoc documentation. |
+| `FDOC-008` | When TypeSpec would concatenate operation summaries/descriptions, request body descriptions, or parameter descriptions for shared routes, multiple content types, or adjacent imported docs, add the appropriate override extension with the desired final text. |
+
+### `documentation-required` suppressions
+
+When a route file contains a suppression for missing documentation, treat it as a fixable
+documentation violation, not as an accepted exception. This includes suppressions such as:
+
+```typespec
+#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import."
+```
+
+For each matching suppression in a scoped `routes.tsp` or `routes.generated.tsp` file:
+
+1. Remove the `#suppress` directive.
+2. Identify the operation, operation parameter, request body, query/header/path parameter, or
+ route-related declaration the suppression was shielding.
+3. Add or repair the appropriate TSDoc documentation using rules `FDOC-001` through `FDOC-005`.
+4. If the target already has a TSDoc comment or participates in a shared route / multiple-content-type request body where TypeSpec would concatenate descriptions, keep a single TSDoc comment for linter compliance and add the correct override extension.
+
+ For `@path`, `@query`, and real `@header` parameters, apply the parameter-level extension:
+
+ ```typespec
+ @extension("x-ms-description-override", "The intended final OpenAPI description.")
+ ```
+
+ For `@body` and `@multipartBody`, apply an operation-level request-body override because
+ TypeSpec does not emit parameter-level extensions onto the OpenAPI `requestBody` object:
+
+ ```typespec
+ @extension("x-ms-request-body-description-override", "The intended final request body description.")
+ ```
+
+ Put this operation-level extension with the operation decorators (near `@summary`, `@route`,
+ and `@post`). Import and use `TypeSpec.OpenAPI` if the file does not already do so.
+5. Preserve unrelated suppressions and any non-documentation suppressions.
+6. Do not leave the file in a state where `documentation-required` still needs to be suppressed.
+
+### Description override extensions
+
+Use description override extensions when the source must retain documentation for TypeSpec
+linting but the emitted OpenAPI description would otherwise be noisy because TypeSpec
+concatenates multiple source descriptions.
+
+Use:
+
+- `x-ms-summary-override` and `x-ms-description-override` on each shared-route
+ operation variant when TypeSpec would merge multiple operations into one OpenAPI
+ operation and concatenate their summaries/descriptions
+- `x-ms-description-override` on `@path`, `@query`, and real `@header` parameters
+- `x-ms-request-body-description-override` on the operation for `@body` and
+ `@multipartBody` request bodies
+
+Common examples:
+
+- Shared-route operation variants that combine multipart and JSON request bodies into
+ one OpenAPI operation, causing summaries such as
+ `"Create a video edit multipart Create a video edit json"`
+- Shared-route request bodies that combine JSON and multipart content types into one OpenAPI `requestBody`
+- Imported generated parameters where the import already contributed a generic description
+- Any route parameter or request body that would emit repeated text such as `"The request body.The request body."` or `"The file id path parameter.The ID of the file."`
+
+Prefer one concise TSDoc comment for the source declaration and one override extension with
+the exact final OpenAPI text. Do not add adjacent TSDoc comments as a workaround. Do not add
+`x-ms-description-override` directly to `@body` or `@multipartBody` declarations because the
+OpenAPI emitter does not preserve those extensions on `requestBody`.
## Post-Edit Steps
-After applying fixes to any `routes.tsp` file, **always** run the following steps in order:
+After applying fixes to any `routes.tsp` or `routes.generated.tsp` file, **always** run the following steps in order:
### 1. Format
Run `tsp format` on the changed files to ensure consistent formatting:
```shell
-npx tsp format specification/ai-foundry/data-plane/Foundry/src/**/routes.tsp
+npx tsp format specification/ai-foundry/data-plane/Foundry/src/**/routes.tsp specification/ai-foundry/data-plane/Foundry/src/**/routes.generated.tsp
```
### 2. Regenerate OpenAPI artifacts
@@ -87,9 +166,9 @@ Verify that the files under `openapi3/{version}/` are updated for every versione
## Workflow
-1. **Identify** all `routes.tsp` files under `specification/ai-foundry/data-plane/Foundry/src/`
+1. **Identify** all `routes.tsp` and `routes.generated.tsp` files under `specification/ai-foundry/data-plane/Foundry/src/`
2. **Parse** each `interface` block and enumerate its operations
-3. **Check** each operation against rules `FDOC-001` through `FDOC-005`
+3. **Check** each operation against rules `FDOC-001` through `FDOC-008`
4. **Report** findings grouped by file, with rule ID, operation name, and line number
5. **Fix** only operations with explicit, significant rule violations (see Conservative Change Policy)
6. **Run `tsp format`** on all modified files
@@ -103,6 +182,7 @@ Report results as a markdown table:
| File | Operation | Rule | Finding |
| ---- | --------- | ---- | ------- |
| src/connections/routes.tsp | get | FDOC-002 | Missing `@summary()` decorator |
+| src/openai/chat/routes.generated.tsp | createChatCompletion | FDOC-004 | `@summary()` uses third-person voice |
```
If all operations pass, report: ✅ All Foundry route operations are fully documented.
diff --git a/specification/ai-foundry/data-plane/Foundry/.github/skills/foundry-route-doc-check/references/route-documentation-rules.md b/specification/ai-foundry/data-plane/Foundry/.github/skills/foundry-route-doc-check/references/route-documentation-rules.md
index 20ca3c86082c..95ce722846ed 100644
--- a/specification/ai-foundry/data-plane/Foundry/.github/skills/foundry-route-doc-check/references/route-documentation-rules.md
+++ b/specification/ai-foundry/data-plane/Foundry/.github/skills/foundry-route-doc-check/references/route-documentation-rules.md
@@ -185,6 +185,9 @@ Summaries must follow all of these constraints:
- **Always include articles** for grammatical completeness — "Create a response",
not "Create response"; "Get an agent", not "Get agent".
- **Never truncate** — the text must be a complete, self-contained phrase.
+- **Use a single-line string literal** — do not use multiline triple-quoted
+ summaries. If the source summary is a paragraph, move the detail into the
+ TSDoc operation description and replace the summary with a short phrase.
- **Prefer the shortest correct phrasing.** The summary should name the verb and
the resource, plus just enough context to distinguish it from sibling operations.
Move any additional detail into the TSDoc description.
@@ -247,6 +250,19 @@ The verb "Get" already implies retrieving the resource. Do not pad with
@summary("This operation lists all connections that are currently available in the project, including those that are pending and those that are active, and returns them as a paginated list")
```
+### ❌ Bad — multiline paragraph
+
+```typespec
+@summary("""
+ Create a Realtime client secret with an associated session configuration.
+
+ Client secrets are short-lived tokens that can be passed to a client app.
+ """)
+```
+
+Use `@summary("Create a Realtime client secret")` and move the paragraph
+details into the operation TSDoc description.
+
### ❌ Bad — truncated
```typespec
@@ -271,6 +287,7 @@ Do not repeat the verb or splice in the doc-comment text. Use a clean imperative
- Use imperative voice: "Create", "Get", "List", "Delete", "Update" (not "Creates", "Gets", etc.)
- **No trailing period** — summaries are phrases, not sentences
+- Use a single-line string literal, not a multiline triple-quoted string
- Keep under ~60 characters
- Remove filler words ("all", "by ID", "info about") unless needed for disambiguation
- Always include articles ("a", "an", "the") for grammatical completeness
@@ -319,6 +336,247 @@ Add a `/** ... */` comment immediately before the parameter declaration, or add
---
+## FDOC-006 — No Adjacent TSDoc Blocks
+
+**Requirement:** Do not place multiple TSDoc block comments next to each other when
+they apply to the same operation or parameter.
+
+**Why:** TypeSpec concatenates adjacent documentation blocks into a single OpenAPI
+`description`. This can produce malformed output such as:
+
+```json
+"description": "Must not exceed 63 characters.The agent name path parameter."
+```
+
+### ✅ Good
+
+```typespec
+/**
+ * The unique name that identifies the agent.
+ * - Must start and end with alphanumeric characters.
+ * - Can contain hyphens in the middle.
+ */
+@path
+agent_name: string;
+```
+
+### ❌ Bad
+
+```typespec
+/**
+ * The unique name that identifies the agent.
+ * - Must start and end with alphanumeric characters.
+ */
+/** The agent name path parameter. */
+@path
+agent_name: string;
+```
+
+### Remediation
+
+Merge the comments into a single TSDoc block, or remove the redundant generic
+comment when a more specific description already exists. Prefer preserving the
+more specific, customer-facing documentation.
+
+---
+
+## FDOC-007 — Remove Documentation Suppressions
+
+**Requirement:** Do not keep suppressions for
+`@azure-tools/typespec-azure-core/documentation-required` in scoped route files.
+When the skill encounters a suppression for missing documentation, it must
+remove the suppression and add the missing TSDoc documentation instead.
+
+This includes auto-generated import suppressions such as:
+
+```typespec
+#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import."
+```
+
+**Why:** Documentation suppressions hide gaps that flow into generated OpenAPI,
+SDK documentation, and developer portals. Missing route and parameter
+descriptions should be fixed at the TypeSpec source level so downstream
+artifacts remain complete without relying on linter exceptions.
+
+### ✅ Good
+
+```typespec
+/** Retrieves the requested response by its unique identifier. */
+@summary("Get a response")
+@get
+@route("/responses/{response_id}")
+getResponse is FoundryDataPlaneOperation<
+ {
+ /** The unique identifier of the response to retrieve. */
+ @path response_id: string;
+ },
+ ResponseObject
+>;
+```
+
+### ❌ Bad
+
+```typespec
+#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import."
+@get
+@route("/responses/{response_id}")
+getResponse is FoundryDataPlaneOperation<
+ {
+ #suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import."
+ @path response_id: string;
+ },
+ ResponseObject
+>;
+```
+
+### Remediation
+
+Remove each `documentation-required` suppression and add the relevant TSDoc
+comment:
+
+- For operations, add an operation TSDoc comment and `@summary()` per
+ `FDOC-001` through `FDOC-004`.
+- For `@path`, `@query`, `@header`, and `@body` parameters, add a parameter
+ TSDoc comment or `@doc()` per `FDOC-005`.
+- Preserve unrelated suppressions and suppressions for rules other than
+ `documentation-required`.
+
+Do not leave a scoped route file in a state where the
+`documentation-required` warning still needs to be suppressed.
+
+---
+
+## FDOC-008 — Description Override for Concatenated Descriptions
+
+**Requirement:** When TypeSpec would concatenate multiple operation summaries,
+operation descriptions, request body descriptions, or parameter descriptions
+into noisy OpenAPI output, keep concise source documentation and add the
+appropriate override extension with the intended final OpenAPI text.
+
+This commonly happens for shared routes that support multiple content types
+or for imported generated route parameters that already carry a generic
+description. Without an override, OpenAPI can contain descriptions such as:
+
+```yaml
+summary: Create a video edit multipart Create a video edit json
+description: Creates a video edit multipart from the supplied request. Creates a video edit json from the supplied request.
+description: The request body.The request body.
+description: The file id path parameter.The ID of the file.
+```
+
+**Why:** TypeSpec source still needs documentation to satisfy
+`documentation-required`, but adjacent or merged documentation can produce
+repetitive downstream descriptions. The Foundry OpenAPI post-processing
+understands description override extensions, so use them to declare the clean
+final description instead of stacking TSDoc comments.
+
+### ✅ Good — shared route operation summary and description
+
+```typespec
+/** Creates a video edit from the supplied request. */
+@summary("Create a video edit")
+@extension("x-ms-summary-override", "Create a video edit")
+@extension("x-ms-description-override", "Creates a video edit from the supplied request.")
+@sharedRoute
+@route("edits")
+@post
+createVideoEditMultipart is OpenAIOperation<...>;
+
+/** Creates a video edit from the supplied request. */
+@summary("Create a video edit")
+@extension("x-ms-summary-override", "Create a video edit")
+@extension("x-ms-description-override", "Creates a video edit from the supplied request.")
+@sharedRoute
+@route("edits")
+@post
+createVideoEditJson is OpenAIOperation<...>;
+```
+
+Add the same operation-level summary and description overrides to every variant
+that TypeSpec merges into a single OpenAPI operation.
+
+### ✅ Good — shared route request body
+
+```typespec
+@extension("x-ms-request-body-description-override", "The request body.")
+@sharedRoute
+@post
+createContainerFileJson is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateContainerFileBody;
+ },
+ OpenAI.ContainerFileResource
+>;
+```
+
+Use the operation-level `x-ms-request-body-description-override` extension for
+`@body` and `@multipartBody` because TypeSpec does not emit parameter-level
+extensions onto OpenAPI `requestBody`.
+
+### ✅ Good — route parameter
+
+```typespec
+/** The file ID path parameter. */
+@extension("x-ms-description-override", "The ID of the file.")
+@path
+file_id: string;
+```
+
+### ✅ Good — imported/generated parameter with existing generic text
+
+```typespec
+/** The file ID path parameter. */
+@extension("x-ms-description-override", "The ID of the file.")
+@path
+file_id: string;
+```
+
+### ❌ Bad — adjacent TSDoc blocks
+
+```typespec
+/** The file id path parameter. */
+/** The ID of the file. */
+@path
+file_id: string;
+```
+
+### ❌ Bad — repeated request body docs
+
+```typespec
+/** The request body. */
+/** The request body. */
+@body
+body: OpenAI.ModifyAssistantRequest;
+```
+
+### Remediation
+
+1. Remove adjacent duplicate or competing TSDoc blocks.
+2. Keep a single TSDoc comment so the declaration remains documented.
+3. For shared-route operation variants that emit concatenated operation
+ summaries or descriptions, add the same `x-ms-summary-override` and
+ `x-ms-description-override` to each variant.
+4. For `@path`, `@query`, and real `@header` parameters, add
+ `@extension("x-ms-description-override", "...")` immediately before the
+ parameter decorator.
+5. For `@body` and `@multipartBody`, add
+ `@extension("x-ms-request-body-description-override", "...")` to the
+ operation decorators, not to the body declaration.
+6. Use the clean, customer-facing final description as the override value.
+7. If the file does not already import and use OpenAPI decorators, add:
+
+ ```typespec
+ import "@typespec/openapi";
+ using TypeSpec.OpenAPI;
+ ```
+
+Do not use adjacent TSDoc comments to combine generic and specific
+documentation.
+
+---
+
## Post-Edit: Format and Regenerate
After making any documentation fixes, **always** run these two steps:
diff --git a/specification/ai-foundry/data-plane/Foundry/compile_all.cmd b/specification/ai-foundry/data-plane/Foundry/compile_all.cmd
new file mode 100644
index 000000000000..2908ca8d3d54
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/compile_all.cmd
@@ -0,0 +1,34 @@
+:: Script to compile main.tsp at the project root and all client.tsp files in the \src\sdk-* folders
+@echo off
+setlocal
+
+set "ROOT_DIR=%~dp0"
+cd /d "%ROOT_DIR%" || exit /b 1
+
+echo Compiling all sdk-* client TypeSpec files...
+for /d %%D in ("src\sdk-*") do (
+ if exist "%%~fD\client.tsp" (
+ echo.
+ echo [%%~fD] npx tsp compile client.tsp
+ pushd "%%~fD" || exit /b 1
+ call npx tsp compile client.tsp
+ @echo off
+ if errorlevel 1 (
+ popd
+ echo.
+ echo Compile failed in %%~fD
+ exit /b 1
+ )
+ popd
+ )
+)
+
+echo.
+echo [ROOT] npx tsp compile .
+call npx tsp compile .
+@echo off
+if errorlevel 1 exit /b 1
+
+echo.
+echo All compilations completed successfully.
+exit /b 0
diff --git a/specification/ai-foundry/data-plane/Foundry/compile_all.ps1 b/specification/ai-foundry/data-plane/Foundry/compile_all.ps1
new file mode 100644
index 000000000000..556496b98881
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/compile_all.ps1
@@ -0,0 +1,45 @@
+# Script to compile main.tsp at the project root and all client.tsp files in the \src\sdk-* folders
+$ErrorActionPreference = 'Stop'
+
+$rootDir = $PSScriptRoot
+if (-not $rootDir) {
+ $rootDir = Split-Path -Parent $MyInvocation.MyCommand.Path
+}
+
+Set-Location -Path $rootDir
+
+Write-Host 'Compiling all sdk-* client TypeSpec files...'
+
+Get-ChildItem -Path 'src' -Directory -Filter 'sdk-*' | ForEach-Object {
+ $dirPath = $_.FullName
+ $clientTspPath = Join-Path $dirPath 'client.tsp'
+
+ if (Test-Path -Path $clientTspPath) {
+ Write-Host ''
+ Write-Host "[$dirPath] npx tsp compile client.tsp"
+
+ Push-Location -Path $dirPath
+ try {
+ & npx tsp compile client.tsp
+ if ($LASTEXITCODE -ne 0) {
+ Write-Host ''
+ Write-Host "Compile failed in $dirPath"
+ exit 1
+ }
+ }
+ finally {
+ Pop-Location
+ }
+ }
+}
+
+Write-Host ''
+Write-Host '[ROOT] npx tsp compile .'
+& npx tsp compile .
+if ($LASTEXITCODE -ne 0) {
+ exit 1
+}
+
+Write-Host ''
+Write-Host 'All compilations completed successfully.'
+exit 0
diff --git a/specification/ai-foundry/data-plane/Foundry/main.tsp b/specification/ai-foundry/data-plane/Foundry/main.tsp
index f80e510cb311..22a1ce77fcc1 100644
--- a/specification/ai-foundry/data-plane/Foundry/main.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/main.tsp
@@ -18,10 +18,27 @@ import "./src/insights/routes.tsp";
import "./src/managed-blueprints/routes.tsp";
import "./src/models/routes.tsp";
import "./src/memory-stores/routes.tsp";
-import "./src/openai-conversations/routes.tsp";
-import "./src/openai-evaluations/routes.tsp";
-import "./src/openai-finetuning/routes.tsp";
-import "./src/openai-responses/routes.tsp";
+import "./src/openai/assistants/main.tsp";
+import "./src/openai/audio/main.tsp";
+import "./src/openai/batch/main.tsp";
+import "./src/openai/chat/main.tsp";
+import "./src/openai/completions/main.tsp";
+import "./src/openai/containers/main.tsp";
+import "./src/openai/conversations/main.tsp";
+import "./src/openai/embeddings/main.tsp";
+import "./src/openai/evaluations/main.tsp";
+import "./src/openai/files/main.tsp";
+import "./src/openai/finetuning/main.tsp";
+import "./src/openai/graders/main.tsp";
+import "./src/openai/images/main.tsp";
+import "./src/openai/models/main.tsp";
+import "./src/openai/moderations/main.tsp";
+import "./src/openai/realtime/main.tsp";
+import "./src/openai/responses/main.tsp";
+import "./src/openai/threads/main.tsp";
+import "./src/openai/uploads/main.tsp";
+import "./src/openai/vectorstores/main.tsp";
+import "./src/openai/video/main.tsp";
import "./src/red-teams/routes.tsp";
import "./src/routines/routes.tsp";
import "./src/schedules/routes.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/openapi3/v1/microsoft-foundry-openapi3.json b/specification/ai-foundry/data-plane/Foundry/openapi3/v1/microsoft-foundry-openapi3.json
index 64d76a0ac370..ebca32cde5b1 100644
--- a/specification/ai-foundry/data-plane/Foundry/openapi3/v1/microsoft-foundry-openapi3.json
+++ b/specification/ai-foundry/data-plane/Foundry/openapi3/v1/microsoft-foundry-openapi3.json
@@ -5,9 +5,6 @@
"version": "v1"
},
"tags": [
- {
- "name": "Fine-Tuning"
- },
{
"name": "Responses Root",
"description": "Responses"
@@ -181,7 +178,7 @@
},
{
"name": "EvaluatorGenerationJobs",
- "parent": "Platform APIs",
+ "parent": "Evaluations",
"summary": "Evaluator generation jobs"
},
{
@@ -221,8 +218,8 @@
"/agent_optimization_jobs": {
"post": {
"operationId": "AgentOptimizationJobs_create",
- "summary": "Creates an agent optimization job.",
- "description": "Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry.",
+ "summary": "Create an agent optimization job",
+ "description": "Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry.",
"parameters": [
{
"name": "Foundry-Features",
@@ -326,8 +323,8 @@
},
"get": {
"operationId": "AgentOptimizationJobs_list",
- "summary": "Returns a list of agent optimization jobs.",
- "description": "List optimization jobs. Supports cursor pagination and optional status / agent_name filters.",
+ "summary": "List agent optimization jobs",
+ "description": "Lists optimization jobs with cursor pagination and optional status or agent name filters.",
"parameters": [
{
"name": "Foundry-Features",
@@ -485,8 +482,8 @@
"/agent_optimization_jobs/{jobId}": {
"get": {
"operationId": "AgentOptimizationJobs_get",
- "summary": "Get info about an agent optimization job.",
- "description": "Get an optimization job by id.",
+ "summary": "Get an agent optimization job",
+ "description": "Retrieves an optimization job by its identifier.",
"parameters": [
{
"name": "Foundry-Features",
@@ -573,8 +570,8 @@
},
"delete": {
"operationId": "AgentOptimizationJobs_delete",
- "summary": "Deletes an agent optimization job.",
- "description": "Delete the job and its candidate artifacts. Cancels first if non-terminal.",
+ "summary": "Delete an agent optimization job",
+ "description": "Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal.",
"parameters": [
{
"name": "Foundry-Features",
@@ -646,8 +643,8 @@
"/agent_optimization_jobs/{jobId}:cancel": {
"post": {
"operationId": "AgentOptimizationJobs_cancel",
- "summary": "Cancels an agent optimization job.",
- "description": "Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state.",
+ "summary": "Cancel an agent optimization job",
+ "description": "Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state.",
"parameters": [
{
"name": "Foundry-Features",
@@ -830,7 +827,8 @@
}
}
}
- }
+ },
+ "description": "The content multipart request content."
}
},
"get": {
@@ -1124,7 +1122,8 @@
}
}
}
- }
+ },
+ "description": "The content multipart request content."
}
},
"delete": {
@@ -2750,7 +2749,8 @@
}
}
}
- }
+ },
+ "description": "The content multipart request content."
}
},
"get": {
@@ -3069,6 +3069,149 @@
]
}
},
+ "/agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.json": {
+ "get": {
+ "operationId": "AgentInvocations_getAgentInvocationAsyncApiSpecJson",
+ "description": "Retrieves the AsyncAPI (JSON) specification for an agent version's event-driven\ninvocation contract (e.g. the `invocations_ws` WebSocket protocol). AsyncAPI is the\ncompanion to OpenAPI for streaming/bidirectional surfaces that OpenAPI cannot express.\nReturns 404 if the agent does not publish an AsyncAPI specification. Publishing is\noptional; when published, both JSON and YAML representations are available.",
+ "parameters": [
+ {
+ "name": "agent_name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the agent.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "agent_version",
+ "in": "path",
+ "required": true,
+ "description": "The version of the agent.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Agent Invocations"
+ ]
+ }
+ },
+ "/agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.yaml": {
+ "get": {
+ "operationId": "AgentInvocations_getAgentInvocationAsyncApiSpecYaml",
+ "description": "Retrieves the AsyncAPI (YAML) specification for an agent version's event-driven\ninvocation contract. Companion to `getAgentInvocationAsyncApiSpecJson`; the path\nextension is authoritative for the returned content type (no `Accept` negotiation).\nReturns 404 if the agent does not publish an AsyncAPI specification.",
+ "parameters": [
+ {
+ "name": "agent_name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the agent.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "agent_version",
+ "in": "path",
+ "required": true,
+ "description": "The version of the agent.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/yaml": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Agent Invocations"
+ ]
+ }
+ },
"/agents/{agent_name}/versions/{agent_version}/sessions/{session_id}:logstream": {
"get": {
"operationId": "Agents_getSessionLogStream",
@@ -3274,7 +3417,10 @@
}
}
}
- }
+ },
+ "tags": [
+ "Agents"
+ ]
}
},
"/agents/{agent_name}:enable": {
@@ -3327,7 +3473,10 @@
}
}
}
- }
+ },
+ "tags": [
+ "Agents"
+ ]
}
},
"/agents:import": {
@@ -4550,7 +4699,7 @@
"post": {
"operationId": "Datasets_getCredentials",
"summary": "Get dataset credentials",
- "description": "Gets the SAS credential to access the storage account associated with a Dataset version.",
+ "description": "Retrieves the SAS credential to access the storage account associated with a dataset version.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -4834,7 +4983,7 @@
"get": {
"operationId": "Deployments_get",
"summary": "Get a deployment",
- "description": "Gets a deployed model.",
+ "description": "Retrieves a deployed model.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -5622,7 +5771,7 @@
"patch": {
"operationId": "EvaluationTaxonomies_update",
"summary": "Update an evaluation taxonomy",
- "description": "Update an evaluation taxonomy.",
+ "description": "Modifies the specified evaluation taxonomy with the provided changes.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -6204,7 +6353,7 @@
"get": {
"operationId": "Evaluators_listLatestVersions",
"summary": "List latest evaluator versions",
- "description": "Lists the latest version of each evaluator",
+ "description": "Lists the latest version of each evaluator.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -6828,6 +6977,7 @@
"name": "name",
"in": "path",
"required": true,
+ "description": "The name path parameter.",
"schema": {
"type": "string"
}
@@ -6927,6 +7077,7 @@
"name": "name",
"in": "path",
"required": true,
+ "description": "The name path parameter.",
"schema": {
"type": "string"
}
@@ -9463,7 +9614,7 @@
"delete": {
"operationId": "Models_deleteVersion",
"summary": "Delete a model version",
- "description": "Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist.",
+ "description": "Removes the specified model version. Returns 200 whether the version existed or not.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -9554,7 +9705,7 @@
"patch": {
"operationId": "Models_updateVersion",
"summary": "Update a model version",
- "description": "Update an existing ModelVersion with the given version id",
+ "description": "Updates an existing model version identified by its version ID.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -9912,7 +10063,8 @@
"$ref": "#/components/schemas/ModelCredentialRequest"
}
}
- }
+ },
+ "description": "The credential request request body."
},
"x-ms-foundry-meta": {
"required_previews": [
@@ -10022,7 +10174,8 @@
"$ref": "#/components/schemas/ModelPendingUploadRequest"
}
}
- }
+ },
+ "description": "The pending upload request request body."
},
"x-ms-foundry-meta": {
"required_previews": [
@@ -10031,140 +10184,47 @@
}
}
},
- "/openai/v1/conversations": {
- "post": {
- "operationId": "createConversation",
- "summary": "Create a conversation",
- "description": "Creates a new conversation resource.",
- "parameters": [
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- },
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- }
- },
- "tags": [
- "Conversations"
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.CreateConversationBody"
- }
- }
- }
- }
- },
+ "/openai/v1/assistants": {
"get": {
- "operationId": "listConversations",
- "summary": "List conversations",
- "description": "Returns the conversations available in the current project.",
+ "operationId": "Assistants_listAssistants",
+ "summary": "List assistants",
+ "description": "Lists assistants matching the request filters.",
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
"schema": {
- "type": "integer",
- "format": "int32",
+ "$ref": "#/components/schemas/integer",
"default": 20
- },
- "explode": false
+ }
},
{
"name": "order",
"in": "query",
"required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
"schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
},
{
"name": "after",
"in": "query",
"required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "description": "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.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
"name": "before",
"in": "query",
"required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "agent_name",
- "in": "query",
- "required": false,
- "description": "Filter by agent name. If provided, only items associated with the specified agent will be returned.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "agent_id",
- "in": "query",
- "required": false,
- "description": "Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "description": "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.",
"schema": {
"type": "string"
}
@@ -10176,33 +10236,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ListAssistantsResponse"
}
}
}
@@ -10229,42 +10263,39 @@
}
},
"tags": [
- "Conversations"
- ]
- }
- },
- "/openai/v1/conversations/{conversation_id}": {
- "post": {
- "operationId": "updateConversation",
- "summary": "Update a conversation",
- "description": "Modifies the specified conversation's properties.",
- "parameters": [
- {
- "name": "conversation_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation to update.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
- }
+ "Assistants"
],
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "List assistants",
+ "group": "assistants",
+ "examples": {
+ "request": {
+ "curl": "curl \"https://api.openai.com/v1/assistants?order=desc&limit=20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.beta.assistants.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myAssistants = await openai.beta.assistants.list({\n order: \"desc\",\n limit: \"20\",\n });\n\n console.log(myAssistants.data);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const assistant of client.beta.assistants.list()) {\n console.log(assistant.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Beta.Assistants.List(context.TODO(), openai.BetaAssistantListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.assistants.AssistantListPage;\nimport com.openai.models.beta.assistants.AssistantListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n AssistantListPage page = client.beta().assistants().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.beta.assistants.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1698982736,\n \"name\": \"Coding Tutor\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n },\n {\n \"id\": \"asst_abc456\",\n \"object\": \"assistant\",\n \"created_at\": 1698982718,\n \"name\": \"My Assistant\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n },\n {\n \"id\": \"asst_abc789\",\n \"object\": \"assistant\",\n \"created_at\": 1698982643,\n \"name\": null,\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n }\n ],\n \"first_id\": \"asst_abc123\",\n \"last_id\": \"asst_abc789\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Assistants_createAssistant",
+ "summary": "Create an assistant",
+ "description": "Creates an assistant from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
+ "$ref": "#/components/schemas/OpenAI.AssistantObject"
}
}
}
@@ -10291,38 +10322,65 @@
}
},
"tags": [
- "Conversations"
+ "Assistants"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.UpdateConversationBody"
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequest"
}
}
- }
+ },
+ "description": "The request body."
+ },
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "Create assistant",
+ "group": "assistants",
+ "examples": [
+ {
+ "title": "Code Interpreter",
+ "request": {
+ "curl": "curl \"https://api.openai.com/v1/assistants\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"instructions\": \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n \"name\": \"Math Tutor\",\n \"tools\": [{\"type\": \"code_interpreter\"}],\n \"model\": \"gpt-4o\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant = client.beta.assistants.create(\n model=\"gpt-4o\",\n)\nprint(assistant.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myAssistant = await openai.beta.assistants.create({\n instructions:\n \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n name: \"Math Tutor\",\n tools: [{ type: \"code_interpreter\" }],\n model: \"gpt-4o\",\n });\n\n console.log(myAssistant);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistant = await client.beta.assistants.create({ model: 'gpt-4o' });\n\nconsole.log(assistant.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{\n\t\tModel: shared.ChatModelGPT4o,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistant.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.beta.assistants.Assistant;\nimport com.openai.models.beta.assistants.AssistantCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n AssistantCreateParams params = AssistantCreateParams.builder()\n .model(ChatModel.GPT_4O)\n .build();\n Assistant assistant = client.beta().assistants().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant = openai.beta.assistants.create(model: :\"gpt-4o\")\n\nputs(assistant)"
+ },
+ "response": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1698984975,\n \"name\": \"Math Tutor\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
+ },
+ {
+ "title": "Files",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/assistants \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n \"tools\": [{\"type\": \"file_search\"}],\n \"tool_resources\": {\"file_search\": {\"vector_store_ids\": [\"vs_123\"]}},\n \"model\": \"gpt-4o\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant = client.beta.assistants.create(\n model=\"gpt-4o\",\n)\nprint(assistant.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myAssistant = await openai.beta.assistants.create({\n instructions:\n \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n name: \"HR Helper\",\n tools: [{ type: \"file_search\" }],\n tool_resources: {\n file_search: {\n vector_store_ids: [\"vs_123\"]\n }\n },\n model: \"gpt-4o\"\n });\n\n console.log(myAssistant);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistant = await client.beta.assistants.create({ model: 'gpt-4o' });\n\nconsole.log(assistant.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{\n\t\tModel: shared.ChatModelGPT4o,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistant.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.beta.assistants.Assistant;\nimport com.openai.models.beta.assistants.AssistantCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n AssistantCreateParams params = AssistantCreateParams.builder()\n .model(ChatModel.GPT_4O)\n .build();\n Assistant assistant = client.beta().assistants().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant = openai.beta.assistants.create(model: :\"gpt-4o\")\n\nputs(assistant)"
+ },
+ "response": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1699009403,\n \"name\": \"HR Helper\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n \"tools\": [\n {\n \"type\": \"file_search\"\n }\n ],\n \"tool_resources\": {\n \"file_search\": {\n \"vector_store_ids\": [\"vs_123\"]\n }\n },\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
+ }
+ ]
}
- },
- "get": {
- "operationId": "getConversation",
- "summary": "Retrieve a conversation",
- "description": "Retrieves the specified conversation and its metadata.",
+ }
+ },
+ "/openai/v1/assistants/{assistant_id}": {
+ "delete": {
+ "operationId": "Assistants_deleteAssistant",
+ "summary": "Delete an assistant",
+ "description": "Deletes an assistant by its identifier.",
"parameters": [
{
- "name": "conversation_id",
+ "name": "assistant_id",
"in": "path",
"required": true,
- "description": "The id of the conversation to retrieve.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "description": "The ID of the assistant to delete.",
"schema": {
"type": "string"
}
@@ -10334,7 +10392,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
+ "$ref": "#/components/schemas/OpenAI.DeleteAssistantResponse"
}
}
}
@@ -10361,28 +10419,36 @@
}
},
"tags": [
- "Conversations"
- ]
+ "Assistants"
+ ],
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "Delete assistant",
+ "group": "assistants",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/assistants/asst_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant_deleted = client.beta.assistants.delete(\n \"assistant_id\",\n)\nprint(assistant_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const response = await openai.beta.assistants.delete(\"asst_abc123\");\n\n console.log(response);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistantDeleted = await client.beta.assistants.delete('assistant_id');\n\nconsole.log(assistantDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistantDeleted, err := client.Beta.Assistants.Delete(context.TODO(), \"assistant_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistantDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.assistants.AssistantDeleteParams;\nimport com.openai.models.beta.assistants.AssistantDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n AssistantDeleted assistantDeleted = client.beta().assistants().delete(\"assistant_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant_deleted = openai.beta.assistants.delete(\"assistant_id\")\n\nputs(assistant_deleted)"
+ },
+ "response": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
},
- "delete": {
- "operationId": "deleteConversation",
- "summary": "Delete a conversation",
- "description": "Removes the specified conversation resource from the current project.",
+ "get": {
+ "operationId": "Assistants_getAssistant",
+ "summary": "Get an assistant",
+ "description": "Retrieves an assistant by its identifier.",
"parameters": [
{
- "name": "conversation_id",
+ "name": "assistant_id",
"in": "path",
"required": true,
- "description": "The id of the conversation to delete.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "description": "The ID of the assistant to retrieve.",
"schema": {
"type": "string"
}
@@ -10394,7 +10460,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.DeletedConversationResource"
+ "$ref": "#/components/schemas/OpenAI.AssistantObject"
}
}
}
@@ -10421,43 +10487,36 @@
}
},
"tags": [
- "Conversations"
- ]
- }
- },
- "/openai/v1/conversations/{conversation_id}/items": {
+ "Assistants"
+ ],
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "Retrieve assistant",
+ "group": "assistants",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/assistants/asst_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant = client.beta.assistants.retrieve(\n \"assistant_id\",\n)\nprint(assistant.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myAssistant = await openai.beta.assistants.retrieve(\n \"asst_abc123\"\n );\n\n console.log(myAssistant);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistant = await client.beta.assistants.retrieve('assistant_id');\n\nconsole.log(assistant.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistant, err := client.Beta.Assistants.Get(context.TODO(), \"assistant_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistant.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.assistants.Assistant;\nimport com.openai.models.beta.assistants.AssistantRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Assistant assistant = client.beta().assistants().retrieve(\"assistant_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant = openai.beta.assistants.retrieve(\"assistant_id\")\n\nputs(assistant)"
+ },
+ "response": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1699009709,\n \"name\": \"HR Helper\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n \"tools\": [\n {\n \"type\": \"file_search\"\n }\n ],\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
+ }
+ }
+ },
"post": {
- "operationId": "createConversationItems",
- "summary": "Create conversation items",
- "description": "Adds one or more items to the specified conversation.",
+ "operationId": "Assistants_modifyAssistant",
+ "summary": "Update an assistant",
+ "description": "Updates an assistant with the supplied changes.",
"parameters": [
{
- "name": "conversation_id",
+ "name": "assistant_id",
"in": "path",
"required": true,
- "description": "The id of the conversation on which the item needs to be created.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "include",
- "in": "query",
- "required": false,
- "description": "Additional fields to include in the response.\nSee the `include` parameter for listing Conversation items for more information.",
- "schema": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "explode": false
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "description": "The ID of the assistant to modify.",
"schema": {
"type": "string"
}
@@ -10469,7 +10528,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationItemList"
+ "$ref": "#/components/schemas/OpenAI.AssistantObject"
}
}
}
@@ -10496,141 +10555,60 @@
}
},
"tags": [
- "Conversations"
+ "Assistants"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "type": "object",
- "properties": {
- "items": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Item"
- },
- "maxItems": 20,
- "description": "The items to add to the conversation. You may add up to 20 items at a time."
- }
- },
- "required": [
- "items"
- ]
+ "$ref": "#/components/schemas/OpenAI.ModifyAssistantRequest"
}
}
- }
- }
- },
- "get": {
- "operationId": "listConversationItems",
- "summary": "List conversation items",
- "description": "Returns the items belonging to the specified conversation.",
- "parameters": [
- {
- "name": "conversation_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation on which the items needs to be listed.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
- },
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
- },
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
},
- {
- "name": "item_type",
- "in": "query",
- "required": false,
- "description": "Filter by item type. If provided, only items of the specified type will be returned.",
- "schema": {
- "$ref": "#/components/schemas/OpenAI.ItemType"
+ "description": "The request body."
+ },
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "Modify assistant",
+ "group": "assistants",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/assistants/asst_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n \"tools\": [{\"type\": \"file_search\"}],\n \"model\": \"gpt-4o\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant = client.beta.assistants.update(\n assistant_id=\"assistant_id\",\n)\nprint(assistant.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myUpdatedAssistant = await openai.beta.assistants.update(\n \"asst_abc123\",\n {\n instructions:\n \"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n name: \"HR Helper\",\n tools: [{ type: \"file_search\" }],\n model: \"gpt-4o\"\n }\n );\n\n console.log(myUpdatedAssistant);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistant = await client.beta.assistants.update('assistant_id');\n\nconsole.log(assistant.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistant, err := client.Beta.Assistants.Update(\n\t\tcontext.TODO(),\n\t\t\"assistant_id\",\n\t\topenai.BetaAssistantUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistant.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.assistants.Assistant;\nimport com.openai.models.beta.assistants.AssistantUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Assistant assistant = client.beta().assistants().update(\"assistant_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant = openai.beta.assistants.update(\"assistant_id\")\n\nputs(assistant)"
},
- "explode": false
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
+ "response": "{\n \"id\": \"asst_123\",\n \"object\": \"assistant\",\n \"created_at\": 1699009709,\n \"name\": \"HR Helper\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n \"tools\": [\n {\n \"type\": \"file_search\"\n }\n ],\n \"tool_resources\": {\n \"file_search\": {\n \"vector_store_ids\": []\n }\n },\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
}
- ],
+ }
+ }
+ },
+ "/openai/v1/audio/speech": {
+ "post": {
+ "operationId": "Audio_createSpeech",
+ "summary": "Create a speech",
+ "description": "Creates a speech from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
+ "headers": {
+ "Transfer-Encoding": {
+ "required": false,
+ "description": "The TransferEncoding header.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
"content": {
- "application/json": {
+ "application/octet-stream": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "contentMediaType": "application/octet-stream"
}
}
}
@@ -10657,51 +10635,74 @@
}
},
"tags": [
- "Conversations"
- ]
- }
- },
- "/openai/v1/conversations/{conversation_id}/items/{item_id}": {
- "get": {
- "operationId": "getConversationItem",
- "summary": "Get a conversation item",
- "description": "Retrieves a specific item from the specified conversation.",
- "parameters": [
- {
- "name": "conversation_id",
- "in": "path",
- "required": true,
- "description": "The ID of the conversation that contains the item.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "item_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation item to retrieve.",
- "schema": {
- "type": "string"
+ "Audio"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateSpeechRequest"
+ }
}
},
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create speech",
+ "group": "audio",
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/speech \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini-tts\",\n \"input\": \"The quick brown fox jumped over the lazy dog.\",\n \"voice\": \"alloy\"\n }' \\\n --output speech.mp3\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nspeech = client.audio.speech.create(\n input=\"input\",\n model=\"tts-1\",\n voice=\"alloy\",\n)\nprint(speech)\ncontent = speech.read()\nprint(content)",
+ "javascript": "import fs from \"fs\";\nimport path from \"path\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst speechFile = path.resolve(\"./speech.mp3\");\n\nasync function main() {\n const mp3 = await openai.audio.speech.create({\n model: \"gpt-4o-mini-tts\",\n voice: \"alloy\",\n input: \"Today is a wonderful day to build something people love!\",\n });\n console.log(speechFile);\n const buffer = Buffer.from(await mp3.arrayBuffer());\n await fs.promises.writeFile(speechFile, buffer);\n}\nmain();\n",
+ "csharp": "using System;\nusing System.IO;\n\nusing OpenAI.Audio;\n\nAudioClient client = new(\n model: \"gpt-4o-mini-tts\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nBinaryData speech = client.GenerateSpeech(\n text: \"The quick brown fox jumped over the lazy dog.\",\n voice: GeneratedSpeechVoice.Alloy\n);\n\nusing FileStream stream = File.OpenWrite(\"speech.mp3\");\nspeech.ToStream().CopyTo(stream);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst speech = await client.audio.speech.create({\n input: 'input',\n model: 'tts-1',\n voice: 'alloy',\n});\n\nconsole.log(speech);\n\nconst content = await speech.blob();\nconsole.log(content);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tspeech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{\n\t\tInput: \"input\",\n\t\tModel: openai.SpeechModelTTS1,\n\t\tVoice: openai.AudioSpeechNewParamsVoiceUnion{\n\t\t\tOfAudioSpeechNewsVoiceString2: openai.String(\"alloy\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", speech)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.audio.speech.SpeechCreateParams;\nimport com.openai.models.audio.speech.SpeechModel;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n SpeechCreateParams params = SpeechCreateParams.builder()\n .input(\"input\")\n .model(SpeechModel.TTS_1)\n .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)\n .build();\n HttpResponse speech = client.audio().speech().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nspeech = openai.audio.speech.create(input: \"input\", model: :\"tts-1\", voice: :alloy)\n\nputs(speech)"
+ }
+ },
+ {
+ "title": "SSE Stream Format",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/speech \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini-tts\",\n \"input\": \"The quick brown fox jumped over the lazy dog.\",\n \"voice\": \"alloy\",\n \"stream_format\": \"sse\"\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst speech = await client.audio.speech.create({\n input: 'input',\n model: 'tts-1',\n voice: 'alloy',\n});\n\nconsole.log(speech);\n\nconst content = await speech.blob();\nconsole.log(content);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nspeech = client.audio.speech.create(\n input=\"input\",\n model=\"tts-1\",\n voice=\"alloy\",\n)\nprint(speech)\ncontent = speech.read()\nprint(content)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tspeech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{\n\t\tInput: \"input\",\n\t\tModel: openai.SpeechModelTTS1,\n\t\tVoice: openai.AudioSpeechNewParamsVoiceUnion{\n\t\t\tOfAudioSpeechNewsVoiceString2: openai.String(\"alloy\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", speech)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.audio.speech.SpeechCreateParams;\nimport com.openai.models.audio.speech.SpeechModel;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n SpeechCreateParams params = SpeechCreateParams.builder()\n .input(\"input\")\n .model(SpeechModel.TTS_1)\n .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)\n .build();\n HttpResponse speech = client.audio().speech().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nspeech = openai.audio.speech.create(input: \"input\", model: :\"tts-1\", voice: :alloy)\n\nputs(speech)"
+ }
}
- }
- ],
+ ]
+ }
+ }
+ },
+ "/openai/v1/audio/transcriptions": {
+ "post": {
+ "operationId": "Audio_createTranscription",
+ "summary": "Create a transcription",
+ "description": "Creates a transcription from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJson"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseDiarizedJson"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseVerboseJson"
+ }
+ ]
}
}
}
@@ -10728,49 +10729,157 @@
}
},
"tags": [
- "Conversations"
- ]
- },
- "delete": {
- "operationId": "deleteConversationItem",
- "summary": "Delete a conversation item",
- "description": "Removes the specified item from a conversation.",
- "parameters": [
- {
- "name": "conversation_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation on which the item needs to be deleted from.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "item_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation item to delete.",
- "schema": {
- "type": "string"
+ "Audio"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionRequest"
+ },
+ "encoding": {
+ "model": {
+ "contentType": "text/plain"
+ },
+ "response_format": {
+ "contentType": "application/json"
+ },
+ "temperature": {
+ "contentType": "text/plain"
+ },
+ "include": {
+ "contentType": "application/json"
+ },
+ "timestamp_granularities": {
+ "contentType": "application/json"
+ },
+ "stream": {
+ "contentType": "application/json"
+ },
+ "chunking_strategy": {
+ "contentType": "application/json"
+ },
+ "known_speaker_names": {
+ "contentType": "application/json"
+ },
+ "known_speaker_references": {
+ "contentType": "application/json"
+ }
+ }
}
},
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create transcription",
+ "group": "audio",
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F model=\"gpt-4o-transcribe\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"gpt-4o-transcribe\",\n });\n\n console.log(transcription.text);\n}\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Audio;\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"gpt-4o-transcribe\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath);\n\nConsole.WriteLine($\"{transcription.Text}\");\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"text\": \"Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.\",\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \"input_token_details\": {\n \"text_tokens\": 0,\n \"audio_tokens\": 14\n },\n \"output_tokens\": 45,\n \"total_tokens\": 59\n }\n}\n"
+ },
+ {
+ "title": "Diarization",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/meeting.wav\" \\\n -F model=\"gpt-4o-transcribe-diarize\" \\\n -F response_format=\"diarized_json\" \\\n -F chunking_strategy=auto \\\n -F 'known_speaker_names[]=agent' \\\n -F 'known_speaker_references[]=data:audio/wav;base64,AAA...'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst speakerRef = fs.readFileSync(\"agent.wav\").toString(\"base64\");\n\nconst transcript = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"meeting.wav\"),\n model: \"gpt-4o-transcribe-diarize\",\n response_format: \"diarized_json\",\n chunking_strategy: \"auto\",\n extra_body: {\n known_speaker_names: [\"agent\"],\n known_speaker_references: [`data:audio/wav;base64,${speakerRef}`],\n },\n});\n\nconsole.log(transcript.segments);\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"task\": \"transcribe\",\n \"duration\": 27.4,\n \"text\": \"Agent: Thanks for calling OpenAI support.\nA: Hi, I'm trying to enable diarization.\nAgent: Happy to walk you through the steps.\",\n \"segments\": [\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_001\",\n \"start\": 0.0,\n \"end\": 4.7,\n \"text\": \"Thanks for calling OpenAI support.\",\n \"speaker\": \"agent\"\n },\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_002\",\n \"start\": 4.7,\n \"end\": 11.8,\n \"text\": \"Hi, I'm trying to enable diarization.\",\n \"speaker\": \"A\"\n },\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_003\",\n \"start\": 12.1,\n \"end\": 18.5,\n \"text\": \"Happy to walk you through the steps.\",\n \"speaker\": \"agent\"\n }\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 27\n }\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F model=\"gpt-4o-mini-transcribe\" \\\n -F stream=true\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst stream = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"gpt-4o-mini-transcribe\",\n stream: true,\n});\n\nfor await (const event of stream) {\n console.log(event);\n}\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "data: {\"type\":\"transcript.text.delta\",\"delta\":\"I\",\"logprobs\":[{\"token\":\"I\",\"logprob\":-0.00007588794,\"bytes\":[73]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" see\",\"logprobs\":[{\"token\":\" see\",\"logprob\":-3.1281633e-7,\"bytes\":[32,115,101,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" skies\",\"logprobs\":[{\"token\":\" skies\",\"logprob\":-2.3392786e-6,\"bytes\":[32,115,107,105,101,115]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" of\",\"logprobs\":[{\"token\":\" of\",\"logprob\":-3.1281633e-7,\"bytes\":[32,111,102]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" blue\",\"logprobs\":[{\"token\":\" blue\",\"logprob\":-1.0280384e-6,\"bytes\":[32,98,108,117,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" and\",\"logprobs\":[{\"token\":\" and\",\"logprob\":-0.0005108566,\"bytes\":[32,97,110,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" clouds\",\"logprobs\":[{\"token\":\" clouds\",\"logprob\":-1.9361265e-7,\"bytes\":[32,99,108,111,117,100,115]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" of\",\"logprobs\":[{\"token\":\" of\",\"logprob\":-1.9361265e-7,\"bytes\":[32,111,102]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" white\",\"logprobs\":[{\"token\":\" white\",\"logprob\":-7.89631e-7,\"bytes\":[32,119,104,105,116,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\",\",\"logprobs\":[{\"token\":\",\",\"logprob\":-0.0014890312,\"bytes\":[44]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" the\",\"logprobs\":[{\"token\":\" the\",\"logprob\":-0.0110956915,\"bytes\":[32,116,104,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" bright\",\"logprobs\":[{\"token\":\" bright\",\"logprob\":0.0,\"bytes\":[32,98,114,105,103,104,116]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" blessed\",\"logprobs\":[{\"token\":\" blessed\",\"logprob\":-0.000045848617,\"bytes\":[32,98,108,101,115,115,101,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" days\",\"logprobs\":[{\"token\":\" days\",\"logprob\":-0.000010802739,\"bytes\":[32,100,97,121,115]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\",\",\"logprobs\":[{\"token\":\",\",\"logprob\":-0.00001700133,\"bytes\":[44]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" the\",\"logprobs\":[{\"token\":\" the\",\"logprob\":-0.0000118755715,\"bytes\":[32,116,104,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" dark\",\"logprobs\":[{\"token\":\" dark\",\"logprob\":-5.5122365e-7,\"bytes\":[32,100,97,114,107]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" sacred\",\"logprobs\":[{\"token\":\" sacred\",\"logprob\":-5.4385737e-6,\"bytes\":[32,115,97,99,114,101,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" nights\",\"logprobs\":[{\"token\":\" nights\",\"logprob\":-4.00813e-6,\"bytes\":[32,110,105,103,104,116,115]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\",\",\"logprobs\":[{\"token\":\",\",\"logprob\":-0.0036910512,\"bytes\":[44]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" and\",\"logprobs\":[{\"token\":\" and\",\"logprob\":-0.0031903093,\"bytes\":[32,97,110,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" I\",\"logprobs\":[{\"token\":\" I\",\"logprob\":-1.504853e-6,\"bytes\":[32,73]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" think\",\"logprobs\":[{\"token\":\" think\",\"logprob\":-4.3202e-7,\"bytes\":[32,116,104,105,110,107]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" to\",\"logprobs\":[{\"token\":\" to\",\"logprob\":-1.9361265e-7,\"bytes\":[32,116,111]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" myself\",\"logprobs\":[{\"token\":\" myself\",\"logprob\":-1.7432603e-6,\"bytes\":[32,109,121,115,101,108,102]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\",\",\"logprobs\":[{\"token\":\",\",\"logprob\":-0.29254505,\"bytes\":[44]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" what\",\"logprobs\":[{\"token\":\" what\",\"logprob\":-0.016815351,\"bytes\":[32,119,104,97,116]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" a\",\"logprobs\":[{\"token\":\" a\",\"logprob\":-3.1281633e-7,\"bytes\":[32,97]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" wonderful\",\"logprobs\":[{\"token\":\" wonderful\",\"logprob\":-2.1008714e-6,\"bytes\":[32,119,111,110,100,101,114,102,117,108]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" world\",\"logprobs\":[{\"token\":\" world\",\"logprob\":-8.180258e-6,\"bytes\":[32,119,111,114,108,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\".\",\"logprobs\":[{\"token\":\".\",\"logprob\":-0.014231676,\"bytes\":[46]}]}\n\ndata: {\"type\":\"transcript.text.done\",\"text\":\"I see skies of blue and clouds of white, the bright blessed days, the dark sacred nights, and I think to myself, what a wonderful world.\",\"logprobs\":[{\"token\":\"I\",\"logprob\":-0.00007588794,\"bytes\":[73]},{\"token\":\" see\",\"logprob\":-3.1281633e-7,\"bytes\":[32,115,101,101]},{\"token\":\" skies\",\"logprob\":-2.3392786e-6,\"bytes\":[32,115,107,105,101,115]},{\"token\":\" of\",\"logprob\":-3.1281633e-7,\"bytes\":[32,111,102]},{\"token\":\" blue\",\"logprob\":-1.0280384e-6,\"bytes\":[32,98,108,117,101]},{\"token\":\" and\",\"logprob\":-0.0005108566,\"bytes\":[32,97,110,100]},{\"token\":\" clouds\",\"logprob\":-1.9361265e-7,\"bytes\":[32,99,108,111,117,100,115]},{\"token\":\" of\",\"logprob\":-1.9361265e-7,\"bytes\":[32,111,102]},{\"token\":\" white\",\"logprob\":-7.89631e-7,\"bytes\":[32,119,104,105,116,101]},{\"token\":\",\",\"logprob\":-0.0014890312,\"bytes\":[44]},{\"token\":\" the\",\"logprob\":-0.0110956915,\"bytes\":[32,116,104,101]},{\"token\":\" bright\",\"logprob\":0.0,\"bytes\":[32,98,114,105,103,104,116]},{\"token\":\" blessed\",\"logprob\":-0.000045848617,\"bytes\":[32,98,108,101,115,115,101,100]},{\"token\":\" days\",\"logprob\":-0.000010802739,\"bytes\":[32,100,97,121,115]},{\"token\":\",\",\"logprob\":-0.00001700133,\"bytes\":[44]},{\"token\":\" the\",\"logprob\":-0.0000118755715,\"bytes\":[32,116,104,101]},{\"token\":\" dark\",\"logprob\":-5.5122365e-7,\"bytes\":[32,100,97,114,107]},{\"token\":\" sacred\",\"logprob\":-5.4385737e-6,\"bytes\":[32,115,97,99,114,101,100]},{\"token\":\" nights\",\"logprob\":-4.00813e-6,\"bytes\":[32,110,105,103,104,116,115]},{\"token\":\",\",\"logprob\":-0.0036910512,\"bytes\":[44]},{\"token\":\" and\",\"logprob\":-0.0031903093,\"bytes\":[32,97,110,100]},{\"token\":\" I\",\"logprob\":-1.504853e-6,\"bytes\":[32,73]},{\"token\":\" think\",\"logprob\":-4.3202e-7,\"bytes\":[32,116,104,105,110,107]},{\"token\":\" to\",\"logprob\":-1.9361265e-7,\"bytes\":[32,116,111]},{\"token\":\" myself\",\"logprob\":-1.7432603e-6,\"bytes\":[32,109,121,115,101,108,102]},{\"token\":\",\",\"logprob\":-0.29254505,\"bytes\":[44]},{\"token\":\" what\",\"logprob\":-0.016815351,\"bytes\":[32,119,104,97,116]},{\"token\":\" a\",\"logprob\":-3.1281633e-7,\"bytes\":[32,97]},{\"token\":\" wonderful\",\"logprob\":-2.1008714e-6,\"bytes\":[32,119,111,110,100,101,114,102,117,108]},{\"token\":\" world\",\"logprob\":-8.180258e-6,\"bytes\":[32,119,111,114,108,100]},{\"token\":\".\",\"logprob\":-0.014231676,\"bytes\":[46]}],\"usage\":{\"input_tokens\":14,\"input_token_details\":{\"text_tokens\":0,\"audio_tokens\":14},\"output_tokens\":45,\"total_tokens\":59}}\n"
+ },
+ {
+ "title": "Logprobs",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F \"include[]=logprobs\" \\\n -F model=\"gpt-4o-transcribe\" \\\n -F response_format=\"json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"gpt-4o-transcribe\",\n response_format: \"json\",\n include: [\"logprobs\"]\n });\n\n console.log(transcription);\n}\nmain();\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"text\": \"Hey, my knee is hurting and I want to see the doctor tomorrow ideally.\",\n \"logprobs\": [\n { \"token\": \"Hey\", \"logprob\": -1.0415299, \"bytes\": [72, 101, 121] },\n { \"token\": \",\", \"logprob\": -9.805982e-5, \"bytes\": [44] },\n { \"token\": \" my\", \"logprob\": -0.00229799, \"bytes\": [32, 109, 121] },\n {\n \"token\": \" knee\",\n \"logprob\": -4.7159858e-5,\n \"bytes\": [32, 107, 110, 101, 101]\n },\n { \"token\": \" is\", \"logprob\": -0.043909557, \"bytes\": [32, 105, 115] },\n {\n \"token\": \" hurting\",\n \"logprob\": -1.1041146e-5,\n \"bytes\": [32, 104, 117, 114, 116, 105, 110, 103]\n },\n { \"token\": \" and\", \"logprob\": -0.011076359, \"bytes\": [32, 97, 110, 100] },\n { \"token\": \" I\", \"logprob\": -5.3193703e-6, \"bytes\": [32, 73] },\n {\n \"token\": \" want\",\n \"logprob\": -0.0017156356,\n \"bytes\": [32, 119, 97, 110, 116]\n },\n { \"token\": \" to\", \"logprob\": -7.89631e-7, \"bytes\": [32, 116, 111] },\n { \"token\": \" see\", \"logprob\": -5.5122365e-7, \"bytes\": [32, 115, 101, 101] },\n { \"token\": \" the\", \"logprob\": -0.0040786397, \"bytes\": [32, 116, 104, 101] },\n {\n \"token\": \" doctor\",\n \"logprob\": -2.3392786e-6,\n \"bytes\": [32, 100, 111, 99, 116, 111, 114]\n },\n {\n \"token\": \" tomorrow\",\n \"logprob\": -7.89631e-7,\n \"bytes\": [32, 116, 111, 109, 111, 114, 114, 111, 119]\n },\n {\n \"token\": \" ideally\",\n \"logprob\": -0.5800861,\n \"bytes\": [32, 105, 100, 101, 97, 108, 108, 121]\n },\n { \"token\": \".\", \"logprob\": -0.00011093382, \"bytes\": [46] }\n ],\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \"input_token_details\": {\n \"text_tokens\": 0,\n \"audio_tokens\": 14\n },\n \"output_tokens\": 45,\n \"total_tokens\": 59\n }\n}\n"
+ },
+ {
+ "title": "Word timestamps",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F \"timestamp_granularities[]=word\" \\\n -F model=\"whisper-1\" \\\n -F response_format=\"verbose_json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"whisper-1\",\n response_format: \"verbose_json\",\n timestamp_granularities: [\"word\"]\n });\n\n console.log(transcription.text);\n}\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Audio;\n\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"whisper-1\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscriptionOptions options = new()\n{\n ResponseFormat = AudioTranscriptionFormat.Verbose,\n TimestampGranularities = AudioTimestampGranularities.Word,\n};\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);\n\nConsole.WriteLine($\"{transcription.Text}\");\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"task\": \"transcribe\",\n \"language\": \"english\",\n \"duration\": 8.470000267028809,\n \"text\": \"The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.\",\n \"words\": [\n {\n \"word\": \"The\",\n \"start\": 0.0,\n \"end\": 0.23999999463558197\n },\n ...\n {\n \"word\": \"volleyball\",\n \"start\": 7.400000095367432,\n \"end\": 7.900000095367432\n }\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 9\n }\n}\n"
+ },
+ {
+ "title": "Segment timestamps",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F \"timestamp_granularities[]=segment\" \\\n -F model=\"whisper-1\" \\\n -F response_format=\"verbose_json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"whisper-1\",\n response_format: \"verbose_json\",\n timestamp_granularities: [\"segment\"]\n });\n\n console.log(transcription.text);\n}\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Audio;\n\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"whisper-1\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscriptionOptions options = new()\n{\n ResponseFormat = AudioTranscriptionFormat.Verbose,\n TimestampGranularities = AudioTimestampGranularities.Segment,\n};\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);\n\nConsole.WriteLine($\"{transcription.Text}\");\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"task\": \"transcribe\",\n \"language\": \"english\",\n \"duration\": 8.470000267028809,\n \"text\": \"The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.\",\n \"segments\": [\n {\n \"id\": 0,\n \"seek\": 0,\n \"start\": 0.0,\n \"end\": 3.319999933242798,\n \"text\": \" The beach was a popular spot on a hot summer day.\",\n \"tokens\": [\n 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530\n ],\n \"temperature\": 0.0,\n \"avg_logprob\": -0.2860786020755768,\n \"compression_ratio\": 1.2363636493682861,\n \"no_speech_prob\": 0.00985979475080967\n },\n ...\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 9\n }\n}\n"
}
- }
- ],
+ ]
+ }
+ }
+ },
+ "/openai/v1/audio/translations": {
+ "post": {
+ "operationId": "Audio_createTranslation",
+ "summary": "Create a translation",
+ "description": "Creates a translation from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranslationResponseJson"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranslationResponseVerboseJson"
+ }
+ ]
}
}
}
@@ -10797,64 +10906,70 @@
}
},
"tags": [
- "Conversations"
- ]
+ "Audio"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranslationRequest"
+ },
+ "encoding": {
+ "model": {
+ "contentType": "text/plain"
+ },
+ "temperature": {
+ "contentType": "text/plain"
+ }
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create translation",
+ "group": "audio",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/translations \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/german.m4a\" \\\n -F model=\"whisper-1\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ntranslation = client.audio.translations.create(\n file=b\"Example data\",\n model=\"whisper-1\",\n)\nprint(translation)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const translation = await openai.audio.translations.create({\n file: fs.createReadStream(\"speech.mp3\"),\n model: \"whisper-1\",\n });\n\n console.log(translation.text);\n}\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Audio;\n\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"whisper-1\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath);\n\nConsole.WriteLine($\"{transcription.Text}\");\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst translation = await client.audio.translations.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'whisper-1',\n});\n\nconsole.log(translation);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranslation, err := client.Audio.Translations.New(context.TODO(), openai.AudioTranslationNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelWhisper1,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", translation)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.translations.TranslationCreateParams;\nimport com.openai.models.audio.translations.TranslationCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranslationCreateParams params = TranslationCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.WHISPER_1)\n .build();\n TranslationCreateResponse translation = client.audio().translations().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranslation = openai.audio.translations.create(file: StringIO.new(\"Example data\"), model: :\"whisper-1\")\n\nputs(translation)"
+ },
+ "response": "{\n \"text\": \"Hello, my name is Wolfgang and I come from Germany. Where are you heading today?\"\n}\n"
+ }
+ }
}
},
- "/openai/v1/evals": {
+ "/openai/v1/batches": {
"get": {
- "operationId": "Evals_listEvals",
- "summary": "List evaluations",
- "description": "Returns the evaluations configured in the current project.",
+ "operationId": "Batches_listBatches",
+ "summary": "List batches",
+ "description": "Lists batches matching the request filters.",
"parameters": [
{
"name": "after",
"in": "query",
"required": false,
- "description": "Identifier for the last run from the previous pagination request.",
+ "description": "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.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
"name": "limit",
"in": "query",
"required": false,
- "description": "Number of runs to retrieve.",
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
"schema": {
"$ref": "#/components/schemas/integer",
"default": 20
- },
- "explode": false
- },
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
- "schema": {
- "type": "string",
- "enum": [
- "asc",
- "desc"
- ],
- "default": "asc"
- },
- "explode": false
- },
- {
- "name": "order_by",
- "in": "query",
- "required": false,
- "description": "Evals can be ordered by creation time or last updated time.\nUse `created_at` for creation time or `updated_at` for last updated time.",
- "schema": {
- "type": "string",
- "enum": [
- "created_at",
- "updated_at"
- ],
- "default": "created_at"
}
}
],
@@ -10864,33 +10979,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Eval"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ListBatchesResponse"
}
}
}
@@ -10917,13 +11006,30 @@
}
},
"tags": [
- "Evals"
- ]
+ "Batch"
+ ],
+ "x-oaiMeta": {
+ "name": "List batches",
+ "group": "batch",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/batches?limit=2 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.batches.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.batches.list();\n\n for await (const batch of list) {\n console.log(batch);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const batch of client.batches.list()) {\n console.log(batch.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Batches.List(context.TODO(), openai.BatchListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.batches.BatchListPage;\nimport com.openai.models.batches.BatchListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n BatchListPage page = client.batches().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.batches.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly job\",\n }\n },\n { ... },\n ],\n \"first_id\": \"batch_abc123\",\n \"last_id\": \"batch_abc456\",\n \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
},
"post": {
- "operationId": "Evals_createEval",
- "summary": "Create an evaluation",
- "description": "Creates the structure of an evaluation that can be used to test a model's performance.\nAn 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.\nFor more information, see the [Evals guide](https://platform.openai.com/docs/guides/evals).",
+ "operationId": "Batches_createBatch",
+ "summary": "Create a batch",
+ "description": "Creates a batch from the supplied request.",
"parameters": [],
"responses": {
"200": {
@@ -10931,7 +11037,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Eval"
+ "$ref": "#/components/schemas/OpenAI.Batch"
}
}
}
@@ -10958,31 +11064,48 @@
}
},
"tags": [
- "Evals"
+ "Batch"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateEvalRequest"
+ "$ref": "#/components/schemas/OpenAI.CreateBatchParametersBody"
}
}
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create batch",
+ "group": "batch",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/batches \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"input_file_id\": \"file-abc123\",\n \"endpoint\": \"/v1/chat/completions\",\n \"completion_window\": \"24h\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nbatch = client.batches.create(\n completion_window=\"24h\",\n endpoint=\"/v1/responses\",\n input_file_id=\"input_file_id\",\n)\nprint(batch.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const batch = await openai.batches.create({\n input_file_id: \"file-abc123\",\n endpoint: \"/v1/chat/completions\",\n completion_window: \"24h\"\n });\n\n console.log(batch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst batch = await client.batches.create({\n completion_window: '24h',\n endpoint: '/v1/responses',\n input_file_id: 'input_file_id',\n});\n\nconsole.log(batch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tbatch, err := client.Batches.New(context.TODO(), openai.BatchNewParams{\n\t\tCompletionWindow: openai.BatchNewParamsCompletionWindow24h,\n\t\tEndpoint: openai.BatchNewParamsEndpointV1Responses,\n\t\tInputFileID: \"input_file_id\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", batch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.batches.Batch;\nimport com.openai.models.batches.BatchCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n BatchCreateParams params = BatchCreateParams.builder()\n .completionWindow(BatchCreateParams.CompletionWindow._24H)\n .endpoint(BatchCreateParams.Endpoint.V1_RESPONSES)\n .inputFileId(\"input_file_id\")\n .build();\n Batch batch = client.batches().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nbatch = openai.batches.create(\n completion_window: :\"24h\",\n endpoint: :\"/v1/responses\",\n input_file_id: \"input_file_id\"\n)\n\nputs(batch)"
+ },
+ "response": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"validating\",\n \"output_file_id\": null,\n \"error_file_id\": null,\n \"created_at\": 1711471533,\n \"in_progress_at\": null,\n \"expires_at\": null,\n \"finalizing_at\": null,\n \"completed_at\": null,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 0,\n \"completed\": 0,\n \"failed\": 0\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n"
}
}
}
},
- "/openai/v1/evals/{eval_id}": {
- "delete": {
- "operationId": "Evals_deleteEval",
- "summary": "Delete an evaluation",
- "description": "Removes the specified evaluation and its associated data.",
+ "/openai/v1/batches/{batch_id}": {
+ "get": {
+ "operationId": "Batches_retrieveBatch",
+ "summary": "Get a batch",
+ "description": "Retrieves a batch by its identifier.",
"parameters": [
{
- "name": "eval_id",
+ "name": "batch_id",
"in": "path",
"required": true,
- "description": "The ID of the evaluation to delete.",
+ "description": "The ID of the batch to retrieve.",
"schema": {
"type": "string"
}
@@ -10994,7 +11117,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteEvalResponse"
+ "$ref": "#/components/schemas/OpenAI.Batch"
}
}
}
@@ -11021,70 +11144,37 @@
}
},
"tags": [
- "Evals"
- ]
- },
- "get": {
- "operationId": "Evals_getEval",
- "summary": "Get an evaluation",
- "description": "Retrieves the specified evaluation and its configuration.",
- "parameters": [
- {
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to retrieve.",
- "schema": {
- "type": "string"
- }
- }
+ "Batch"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Eval"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- },
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "x-oaiMeta": {
+ "name": "Retrieve batch",
+ "group": "batch",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/batches/batch_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nbatch = client.batches.retrieve(\n \"batch_id\",\n)\nprint(batch.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const batch = await openai.batches.retrieve(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst batch = await client.batches.retrieve('batch_id');\n\nconsole.log(batch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tbatch, err := client.Batches.Get(context.TODO(), \"batch_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", batch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.batches.Batch;\nimport com.openai.models.batches.BatchRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Batch batch = client.batches().retrieve(\"batch_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nbatch = openai.batches.retrieve(\"batch_id\")\n\nputs(batch)"
+ },
+ "response": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/completions\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n"
}
- },
- "tags": [
- "Evals"
- ]
- },
+ }
+ }
+ },
+ "/openai/v1/batches/{batch_id}/cancel": {
"post": {
- "operationId": "Evals_updateEval",
- "summary": "Update an evaluation",
- "description": "Updates certain properties of an evaluation.",
+ "operationId": "Batches_cancelBatch",
+ "summary": "Cancel a batch",
+ "description": "Cancels a batch by its identifier.",
"parameters": [
{
- "name": "eval_id",
+ "name": "batch_id",
"in": "path",
"required": true,
- "description": "The ID of the evaluation to update.",
+ "description": "The ID of the batch to cancel.",
"schema": {
"type": "string"
}
@@ -11096,7 +11186,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Eval"
+ "$ref": "#/components/schemas/OpenAI.Batch"
}
}
}
@@ -11123,87 +11213,86 @@
}
},
"tags": [
- "Evals"
+ "Batch"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateEvalParametersBody"
- }
- }
+ "x-oaiMeta": {
+ "name": "Cancel batch",
+ "group": "batch",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/batches/batch_abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -X POST\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nbatch = client.batches.cancel(\n \"batch_id\",\n)\nprint(batch.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const batch = await openai.batches.cancel(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst batch = await client.batches.cancel('batch_id');\n\nconsole.log(batch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tbatch, err := client.Batches.Cancel(context.TODO(), \"batch_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", batch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.batches.Batch;\nimport com.openai.models.batches.BatchCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Batch batch = client.batches().cancel(\"batch_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nbatch = openai.batches.cancel(\"batch_id\")\n\nputs(batch)"
+ },
+ "response": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"cancelling\",\n \"output_file_id\": null,\n \"error_file_id\": null,\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": null,\n \"completed_at\": null,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": 1711475133,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 23,\n \"failed\": 1\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n"
}
}
}
},
- "/openai/v1/evals/{eval_id}/runs": {
+ "/openai/v1/chat/completions": {
"get": {
- "operationId": "Evals_listRuns",
- "summary": "List evaluation runs",
- "description": "Returns the runs associated with the specified evaluation.",
+ "operationId": "Chat_listChatCompletions",
+ "summary": "List chat completions",
+ "description": "Lists chat completions matching the request filters.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to retrieve runs for.",
+ "name": "model",
+ "in": "query",
+ "required": false,
+ "description": "The model used to generate the Chat Completions.",
"schema": {
"type": "string"
}
},
+ {
+ "name": "metadata",
+ "in": "query",
+ "required": false,
+ "description": "A list of metadata keys to filter the Chat Completions by. Example:\n `metadata[key1]=value1&metadata[key2]=value2`",
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
{
"name": "after",
"in": "query",
"required": false,
- "description": "Identifier for the last run from the previous pagination request.",
+ "description": "Identifier for the last chat completion from the previous pagination request.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
"name": "limit",
"in": "query",
"required": false,
- "description": "Number of runs to retrieve.",
+ "description": "Number of Chat Completions to retrieve.",
"schema": {
"$ref": "#/components/schemas/integer",
"default": 20
- },
- "explode": false
+ }
},
{
"name": "order",
"in": "query",
"required": false,
- "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
+ "description": "Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
"schema": {
- "type": "string",
- "enum": [
- "asc",
- "desc"
- ],
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
"default": "asc"
- },
- "explode": false
- },
- {
- "name": "status",
- "in": "query",
- "required": false,
- "description": "Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.",
- "schema": {
- "type": "string",
- "enum": [
- "queued",
- "in_progress",
- "completed",
- "canceled",
- "failed"
- ]
- },
- "explode": false
+ }
}
],
"responses": {
@@ -11212,33 +11301,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRun"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionList"
}
}
}
@@ -11265,31 +11328,38 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "x-oaiMeta": {
+ "name": "List Chat Completions",
+ "group": "chat",
+ "path": "list",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.chat.completions.list()\npage = page.data[0]\nprint(page.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const chatCompletion of client.chat.completions.list()) {\n console.log(chatCompletion.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Chat.Completions.List(context.TODO(), openai.ChatCompletionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.chat.completions.ChatCompletionListPage;\nimport com.openai.models.chat.completions.ChatCompletionListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionListPage page = client.chat().completions().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.chat.completions.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"chat.completion\",\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"model\": \"gpt-5.4\",\n \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {},\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum,\nLearning patterns in silence—\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \"tool_calls\": null,\n \"function_call\": null\n },\n \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \"response_format\": null\n }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
},
"post": {
- "operationId": "Evals_createEvalRun",
- "summary": "Create an evaluation run",
- "description": "Creates an evaluation run for the specified evaluation.",
- "parameters": [
- {
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to create a run for.",
- "schema": {
- "type": "string"
- }
- }
- ],
+ "operationId": "Chat_createChatCompletion",
+ "summary": "Create a chat completion",
+ "description": "Creates a chat completion from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EvalRun"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponse"
}
}
}
@@ -11316,40 +11386,109 @@
}
},
"tags": [
- "Evals"
+ "Chat"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateEvalRunRequest"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequest"
}
}
- }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create chat completion",
+ "group": "chat",
+ "path": "create",
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_chat_model_id\",\n \"messages\": [\n {\n \"role\": \"developer\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.chat.completions.create({\n messages: [{ role: \"developer\", content: \"You are a helpful assistant.\" }],\n model: \"VAR_chat_model_id\",\n store: true,\n });\n\n console.log(completion.choices[0]);\n}\n\nmain();\n",
+ "csharp": "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new SystemChatMessage(\"You are a helpful assistant.\"),\n new UserChatMessage(\"Hello!\")\n];\n\nChatCompletion completion = client.CompleteChat(messages);\n\nConsole.WriteLine(completion.Content[0].Text);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"id\": \"chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT\",\n \"object\": \"chat.completion\",\n \"created\": 1741569952,\n \"model\": \"gpt-5.4\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 19,\n \"completion_tokens\": 10,\n \"total_tokens\": 29,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\"\n}\n"
+ },
+ {
+ "title": "Image input",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is in this image?\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"\n }\n }\n ]\n }\n ],\n \"max_tokens\": 300\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const response = await openai.chat.completions.create({\n model: \"gpt-5.4\",\n messages: [\n {\n role: \"user\",\n content: [\n { type: \"text\", text: \"What's in this image?\" },\n {\n type: \"image_url\",\n image_url: {\n \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\",\n },\n }\n ],\n },\n ],\n });\n console.log(response.choices[0]);\n}\nmain();\n",
+ "csharp": "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new UserChatMessage(\n [\n ChatMessageContentPart.CreateTextPart(\"What's in this image?\"),\n ChatMessageContentPart.CreateImagePart(new Uri(\"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"))\n ])\n];\n\nChatCompletion completion = client.CompleteChat(messages);\n\nConsole.WriteLine(completion.Content[0].Text);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"id\": \"chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG\",\n \"object\": \"chat.completion\",\n \"created\": 1741570283,\n \"model\": \"gpt-5.4\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1117,\n \"completion_tokens\": 46,\n \"total_tokens\": 1163,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\"\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_chat_model_id\",\n \"messages\": [\n {\n \"role\": \"developer\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.chat.completions.create({\n model: \"VAR_chat_model_id\",\n messages: [\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n stream: true,\n });\n\n for await (const chunk of completion) {\n console.log(chunk.choices[0].delta.content);\n }\n}\n\nmain();\n",
+ "csharp": "using System;\nusing System.ClientModel;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new SystemChatMessage(\"You are a helpful assistant.\"),\n new UserChatMessage(\"Hello!\")\n];\n\nAsyncCollectionResult completionUpdates = client.CompleteChatStreamingAsync(messages);\n\nawait foreach (StreamingChatCompletionUpdate completionUpdate in completionUpdates)\n{\n if (completionUpdate.ContentUpdate.Count > 0)\n {\n Console.Write(completionUpdate.ContentUpdate[0].Text);\n }\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-4o-mini\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-4o-mini\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n....\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-4o-mini\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n"
+ },
+ {
+ "title": "Functions",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n-d '{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the weather like in Boston today?\"\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\"]\n }\n }\n }\n ],\n \"tool_choice\": \"auto\"\n}'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const messages = [{\"role\": \"user\", \"content\": \"What's the weather like in Boston today?\"}];\n const tools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \"required\": [\"location\"],\n },\n }\n }\n ];\n\n const response = await openai.chat.completions.create({\n model: \"gpt-5.4\",\n messages: messages,\n tools: tools,\n tool_choice: \"auto\",\n });\n\n console.log(response);\n}\n\nmain();\n",
+ "csharp": "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nChatTool getCurrentWeatherTool = ChatTool.CreateFunctionTool(\n functionName: \"get_current_weather\",\n functionDescription: \"Get the current weather in a given location\",\n functionParameters: BinaryData.FromString(\"\"\"\n {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [ \"celsius\", \"fahrenheit\" ]\n }\n },\n \"required\": [ \"location\" ]\n }\n \"\"\")\n);\n\nList messages =\n[\n new UserChatMessage(\"What's the weather like in Boston today?\"),\n];\n\nChatCompletionOptions options = new()\n{\n Tools =\n {\n getCurrentWeatherTool\n },\n ToolChoice = ChatToolChoice.CreateAutoChoice(),\n};\n\nChatCompletion completion = client.CompleteChat(messages, options);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"id\": \"chatcmpl-abc123\",\n \"object\": \"chat.completion\",\n \"created\": 1699896916,\n \"model\": \"gpt-4o-mini\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_abc123\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\n\"location\": \"Boston, MA\"\n}\"\n }\n }\n ]\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 82,\n \"completion_tokens\": 17,\n \"total_tokens\": 99,\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n }\n}\n"
+ },
+ {
+ "title": "Logprobs",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_chat_model_id\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"logprobs\": true,\n \"top_logprobs\": 2\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.chat.completions.create({\n messages: [{ role: \"user\", content: \"Hello!\" }],\n model: \"VAR_chat_model_id\",\n logprobs: true,\n top_logprobs: 2,\n });\n\n console.log(completion.choices[0]);\n}\n\nmain();\n",
+ "csharp": "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new UserChatMessage(\"Hello!\")\n];\n\nChatCompletionOptions options = new()\n{\n IncludeLogProbabilities = true,\n TopLogProbabilityCount = 2\n};\n\nChatCompletion completion = client.CompleteChat(messages, options);\n\nConsole.WriteLine(completion.Content[0].Text);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"id\": \"chatcmpl-123\",\n \"object\": \"chat.completion\",\n \"created\": 1702685778,\n \"model\": \"gpt-4o-mini\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\"\n },\n \"logprobs\": {\n \"content\": [\n {\n \"token\": \"Hello\",\n \"logprob\": -0.31725305,\n \"bytes\": [72, 101, 108, 108, 111],\n \"top_logprobs\": [\n {\n \"token\": \"Hello\",\n \"logprob\": -0.31725305,\n \"bytes\": [72, 101, 108, 108, 111]\n },\n {\n \"token\": \"Hi\",\n \"logprob\": -1.3190403,\n \"bytes\": [72, 105]\n }\n ]\n },\n {\n \"token\": \"!\",\n \"logprob\": -0.02380986,\n \"bytes\": [\n 33\n ],\n \"top_logprobs\": [\n {\n \"token\": \"!\",\n \"logprob\": -0.02380986,\n \"bytes\": [33]\n },\n {\n \"token\": \" there\",\n \"logprob\": -3.787621,\n \"bytes\": [32, 116, 104, 101, 114, 101]\n }\n ]\n },\n {\n \"token\": \" How\",\n \"logprob\": -0.000054669687,\n \"bytes\": [32, 72, 111, 119],\n \"top_logprobs\": [\n {\n \"token\": \" How\",\n \"logprob\": -0.000054669687,\n \"bytes\": [32, 72, 111, 119]\n },\n {\n \"token\": \"<|end|>\",\n \"logprob\": -10.953937,\n \"bytes\": null\n }\n ]\n },\n {\n \"token\": \" can\",\n \"logprob\": -0.015801601,\n \"bytes\": [32, 99, 97, 110],\n \"top_logprobs\": [\n {\n \"token\": \" can\",\n \"logprob\": -0.015801601,\n \"bytes\": [32, 99, 97, 110]\n },\n {\n \"token\": \" may\",\n \"logprob\": -4.161023,\n \"bytes\": [32, 109, 97, 121]\n }\n ]\n },\n {\n \"token\": \" I\",\n \"logprob\": -3.7697225e-6,\n \"bytes\": [\n 32,\n 73\n ],\n \"top_logprobs\": [\n {\n \"token\": \" I\",\n \"logprob\": -3.7697225e-6,\n \"bytes\": [32, 73]\n },\n {\n \"token\": \" assist\",\n \"logprob\": -13.596657,\n \"bytes\": [32, 97, 115, 115, 105, 115, 116]\n }\n ]\n },\n {\n \"token\": \" assist\",\n \"logprob\": -0.04571125,\n \"bytes\": [32, 97, 115, 115, 105, 115, 116],\n \"top_logprobs\": [\n {\n \"token\": \" assist\",\n \"logprob\": -0.04571125,\n \"bytes\": [32, 97, 115, 115, 105, 115, 116]\n },\n {\n \"token\": \" help\",\n \"logprob\": -3.1089056,\n \"bytes\": [32, 104, 101, 108, 112]\n }\n ]\n },\n {\n \"token\": \" you\",\n \"logprob\": -5.4385737e-6,\n \"bytes\": [32, 121, 111, 117],\n \"top_logprobs\": [\n {\n \"token\": \" you\",\n \"logprob\": -5.4385737e-6,\n \"bytes\": [32, 121, 111, 117]\n },\n {\n \"token\": \" today\",\n \"logprob\": -12.807695,\n \"bytes\": [32, 116, 111, 100, 97, 121]\n }\n ]\n },\n {\n \"token\": \" today\",\n \"logprob\": -0.0040071653,\n \"bytes\": [32, 116, 111, 100, 97, 121],\n \"top_logprobs\": [\n {\n \"token\": \" today\",\n \"logprob\": -0.0040071653,\n \"bytes\": [32, 116, 111, 100, 97, 121]\n },\n {\n \"token\": \"?\",\n \"logprob\": -5.5247097,\n \"bytes\": [63]\n }\n ]\n },\n {\n \"token\": \"?\",\n \"logprob\": -0.0008108172,\n \"bytes\": [63],\n \"top_logprobs\": [\n {\n \"token\": \"?\",\n \"logprob\": -0.0008108172,\n \"bytes\": [63]\n },\n {\n \"token\": \"?\n\",\n \"logprob\": -7.184561,\n \"bytes\": [63, 10]\n }\n ]\n }\n ]\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 9,\n \"completion_tokens\": 9,\n \"total_tokens\": 18,\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"system_fingerprint\": null\n}\n"
+ }
+ ]
}
}
},
- "/openai/v1/evals/{eval_id}/runs/{run_id}": {
+ "/openai/v1/chat/completions/{completion_id}": {
"delete": {
- "operationId": "Evals_deleteEvalRun",
- "summary": "Delete an evaluation run",
- "description": "Removes the specified evaluation run.",
+ "operationId": "Chat_deleteChatCompletion",
+ "summary": "Delete a chat completion",
+ "description": "Deletes a chat completion by its identifier.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to delete the run from.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
+ "name": "completion_id",
"in": "path",
"required": true,
- "description": "The ID of the run to delete.",
+ "description": "The ID of the chat completion to delete.",
"schema": {
"type": "string"
}
@@ -11361,7 +11500,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteEvalRunResponse"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionDeleted"
}
}
}
@@ -11388,28 +11527,34 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete chat completion",
+ "group": "chat",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/chat/completions/chat_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nchat_completion_deleted = client.chat.completions.delete(\n \"completion_id\",\n)\nprint(chat_completion_deleted.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletionDeleted = await client.chat.completions.delete('completion_id');\n\nconsole.log(chatCompletionDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletionDeleted, err := client.Chat.Completions.Delete(context.TODO(), \"completion_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletionDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.chat.completions.ChatCompletionDeleteParams;\nimport com.openai.models.chat.completions.ChatCompletionDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionDeleted chatCompletionDeleted = client.chat().completions().delete(\"completion_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion_deleted = openai.chat.completions.delete(\"completion_id\")\n\nputs(chat_completion_deleted)"
+ },
+ "response": "{\n \"object\": \"chat.completion.deleted\",\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"deleted\": true\n}\n"
+ }
+ }
},
"get": {
- "operationId": "Evals_getEvalRun",
- "summary": "Get an evaluation run",
- "description": "Retrieves the specified evaluation run and its current status.",
+ "operationId": "Chat_getChatCompletion",
+ "summary": "Get a chat completion",
+ "description": "Retrieves a chat completion by its identifier.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to retrieve runs for.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
+ "name": "completion_id",
"in": "path",
"required": true,
- "description": "The ID of the run to retrieve.",
+ "description": "The ID of the chat completion to retrieve.",
"schema": {
"type": "string"
}
@@ -11421,7 +11566,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EvalRun"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponse"
}
}
}
@@ -11448,28 +11593,34 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "x-oaiMeta": {
+ "name": "Get chat completion",
+ "group": "chat",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions/chatcmpl-abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nchat_completion = client.chat.completions.retrieve(\n \"completion_id\",\n)\nprint(chat_completion.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.retrieve('completion_id');\n\nconsole.log(chatCompletion.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.Get(context.TODO(), \"completion_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletion chatCompletion = client.chat().completions().retrieve(\"completion_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.retrieve(\"completion_id\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"object\": \"chat.completion\",\n \"id\": \"chatcmpl-abc123\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {},\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum,\nLearning patterns in silence—\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \"tool_calls\": null,\n \"function_call\": null\n },\n \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \"response_format\": null\n}\n"
+ }
+ }
},
"post": {
- "operationId": "Evals_cancelEvalRun",
- "summary": "Cancel an evaluation run",
- "description": "Cancels an ongoing evaluation run.",
+ "operationId": "Chat_updateChatCompletion",
+ "summary": "Update a chat completion",
+ "description": "Updates a chat completion with the supplied changes.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation whose run you want to cancel.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
+ "name": "completion_id",
"in": "path",
"required": true,
- "description": "The ID of the run to cancel.",
+ "description": "The ID of the chat completion to update.",
"schema": {
"type": "string"
}
@@ -11481,7 +11632,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EvalRun"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponse"
}
}
}
@@ -11508,29 +11659,47 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UpdateChatCompletionParametersBody"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Update chat completion",
+ "group": "chat",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/chat/completions/chat_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"metadata\": {\"foo\": \"bar\"}}'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nchat_completion = client.chat.completions.update(\n completion_id=\"completion_id\",\n metadata={\n \"foo\": \"string\"\n },\n)\nprint(chat_completion.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.update('completion_id', {\n metadata: { foo: 'string' },\n});\n\nconsole.log(chatCompletion.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.Update(\n\t\tcontext.TODO(),\n\t\t\"completion_id\",\n\t\topenai.ChatCompletionUpdateParams{\n\t\t\tMetadata: shared.Metadata{\n\t\t\t\t\"foo\": \"string\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionUpdateParams params = ChatCompletionUpdateParams.builder()\n .completionId(\"completion_id\")\n .metadata(ChatCompletionUpdateParams.Metadata.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"string\"))\n .build())\n .build();\n ChatCompletion chatCompletion = client.chat().completions().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.update(\"completion_id\", metadata: {foo: \"string\"})\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"object\": \"chat.completion\",\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {\n \"foo\": \"bar\"\n },\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum,\nLearning patterns in silence—\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \"tool_calls\": null,\n \"function_call\": null\n },\n \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \"response_format\": null\n}\n"
+ }
+ }
}
},
- "/openai/v1/evals/{eval_id}/runs/{run_id}/output_items": {
+ "/openai/v1/chat/completions/{completion_id}/messages": {
"get": {
- "operationId": "Evals_getEvalRunOutputItems",
- "summary": "List evaluation run output items",
- "description": "Returns the output items produced by the specified evaluation run.",
+ "operationId": "Chat_getChatCompletionMessages",
+ "summary": "Get chat completion messages",
+ "description": "Retrieves chat completion messages by its identifier.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
+ "name": "completion_id",
"in": "path",
"required": true,
- "description": "The ID of the run to retrieve output items for.",
+ "description": "The ID of the chat completion to retrieve messages from.",
"schema": {
"type": "string"
}
@@ -11539,49 +11708,30 @@
"name": "after",
"in": "query",
"required": false,
- "description": "Identifier for the last run from the previous pagination request.",
+ "description": "Identifier for the last message from the previous pagination request.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
"name": "limit",
"in": "query",
"required": false,
- "description": "Number of runs to retrieve.",
+ "description": "Number of messages to retrieve.",
"schema": {
"$ref": "#/components/schemas/integer",
"default": 20
- },
- "explode": false
+ }
},
{
"name": "order",
"in": "query",
"required": false,
- "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
+ "description": "Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
"schema": {
- "type": "string",
- "enum": [
- "asc",
- "desc"
- ],
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
"default": "asc"
- },
- "explode": false
- },
- {
- "name": "status",
- "in": "query",
- "required": false,
- "description": "Filter output items by status. Use `failed` to filter by failed output\nitems or `pass` to filter by passed output items.",
- "schema": {
- "type": "string",
- "enum": [
- "fail",
- "pass"
- ]
}
}
],
@@ -11591,33 +11741,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunOutputItem"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageList"
}
}
}
@@ -11644,51 +11768,39 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "x-oaiMeta": {
+ "name": "Get chat messages",
+ "group": "chat",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions/chat_abc123/messages \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.chat.completions.messages.list(\n completion_id=\"completion_id\",\n)\npage = page.data[0]\nprint(page)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const chatCompletionStoreMessage of client.chat.completions.messages.list(\n 'completion_id',\n)) {\n console.log(chatCompletionStoreMessage);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Chat.Completions.Messages.List(\n\t\tcontext.TODO(),\n\t\t\"completion_id\",\n\t\topenai.ChatCompletionMessageListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.chat.completions.messages.MessageListPage;\nimport com.openai.models.chat.completions.messages.MessageListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageListPage page = client.chat().completions().messages().list(\"completion_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.chat.completions.messages.list(\"completion_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"role\": \"user\",\n \"content\": \"write a haiku about ai\",\n \"name\": null,\n \"content_parts\": null\n }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
}
},
- "/openai/v1/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}": {
- "get": {
- "operationId": "Evals_getEvalRunOutputItem",
- "summary": "Get an output item of an evaluation run",
- "description": "Retrieves a single output item from the specified evaluation run.",
- "parameters": [
- {
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to retrieve runs for.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
- "in": "path",
- "required": true,
- "description": "The ID of the run to retrieve.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "output_item_id",
- "in": "path",
- "required": true,
- "description": "The ID of the output item to retrieve.",
- "schema": {
- "type": "string"
- }
- }
- ],
+ "/openai/v1/completions": {
+ "post": {
+ "operationId": "Completions_createCompletion",
+ "summary": "Create a completion",
+ "description": "Creates a completion from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EvalRunOutputItem"
+ "$ref": "#/components/schemas/OpenAI.CreateCompletionResponse"
}
}
}
@@ -11715,25 +11827,98 @@
}
},
"tags": [
- "Evals"
- ]
+ "Completions"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateCompletionRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create completion",
+ "group": "completions",
+ "legacy": true,
+ "examples": [
+ {
+ "title": "No streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_completion_model_id\",\n \"prompt\": \"Say this is a test\",\n \"max_tokens\": 7,\n \"temperature\": 0\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.completions.create(\n model=\"gpt-3.5-turbo-instruct\",\n prompt=\"This is a test.\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.completions.create({\n model: \"VAR_completion_model_id\",\n prompt: \"Say this is a test.\",\n max_tokens: 7,\n temperature: 0,\n });\n\n console.log(completion);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst completion = await client.completions.create({\n model: 'gpt-3.5-turbo-instruct',\n prompt: 'This is a test.',\n});\n\nconsole.log(completion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcompletion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{\n\t\tModel: openai.CompletionNewParamsModelGPT3_5TurboInstruct,\n\t\tPrompt: openai.CompletionNewParamsPromptUnion{\n\t\t\tOfString: openai.String(\"This is a test.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", completion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.completions.Completion;\nimport com.openai.models.completions.CompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n CompletionCreateParams params = CompletionCreateParams.builder()\n .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)\n .prompt(\"This is a test.\")\n .build();\n Completion completion = client.completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncompletion = openai.completions.create(model: :\"gpt-3.5-turbo-instruct\", prompt: \"This is a test.\")\n\nputs(completion)"
+ },
+ "response": "{\n \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n \"object\": \"text_completion\",\n \"created\": 1589478378,\n \"model\": \"VAR_completion_model_id\",\n \"system_fingerprint\": \"fp_44709d6fcb\",\n \"choices\": [\n {\n \"text\": \"\n\nThis is indeed a test\",\n \"index\": 0,\n \"logprobs\": null,\n \"finish_reason\": \"length\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 5,\n \"completion_tokens\": 7,\n \"total_tokens\": 12\n }\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_completion_model_id\",\n \"prompt\": \"Say this is a test\",\n \"max_tokens\": 7,\n \"temperature\": 0,\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.completions.create(\n model=\"gpt-3.5-turbo-instruct\",\n prompt=\"This is a test.\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const stream = await openai.completions.create({\n model: \"VAR_completion_model_id\",\n prompt: \"Say this is a test.\",\n stream: true,\n });\n\n for await (const chunk of stream) {\n console.log(chunk.choices[0].text)\n }\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst completion = await client.completions.create({\n model: 'gpt-3.5-turbo-instruct',\n prompt: 'This is a test.',\n});\n\nconsole.log(completion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcompletion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{\n\t\tModel: openai.CompletionNewParamsModelGPT3_5TurboInstruct,\n\t\tPrompt: openai.CompletionNewParamsPromptUnion{\n\t\t\tOfString: openai.String(\"This is a test.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", completion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.completions.Completion;\nimport com.openai.models.completions.CompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n CompletionCreateParams params = CompletionCreateParams.builder()\n .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)\n .prompt(\"This is a test.\")\n .build();\n Completion completion = client.completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncompletion = openai.completions.create(model: :\"gpt-3.5-turbo-instruct\", prompt: \"This is a test.\")\n\nputs(completion)"
+ },
+ "response": "{\n \"id\": \"cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe\",\n \"object\": \"text_completion\",\n \"created\": 1690759702,\n \"choices\": [\n {\n \"text\": \"This\",\n \"index\": 0,\n \"logprobs\": null,\n \"finish_reason\": null\n }\n ],\n \"model\": \"gpt-3.5-turbo-instruct\"\n \"system_fingerprint\": \"fp_44709d6fcb\",\n}\n"
+ }
+ ]
+ }
}
},
- "/openai/v1/fine_tuning/jobs": {
- "post": {
- "operationId": "createFineTuningJob",
- "summary": "Create a fine-tuning job",
- "description": "Creates a fine-tuning job which begins the process of creating a new model from a given dataset.\n\nResponse includes details of the enqueued job including job status and the name of the fine-tuned models once complete.\n\n[Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)",
+ "/openai/v1/containers": {
+ "get": {
+ "operationId": "Containers_listContainers",
+ "summary": "List containers",
+ "description": "Lists containers matching the request filters.",
"parameters": [
{
- "name": "api-version",
+ "name": "limit",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "name",
+ "in": "query",
+ "required": false,
+ "description": "Filter results by container name.",
+ "schema": {
+ "type": "string"
+ }
}
],
"responses": {
@@ -11742,7 +11927,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "$ref": "#/components/schemas/OpenAI.ContainerListResource"
}
}
}
@@ -11769,64 +11954,38 @@
}
},
"tags": [
- "Fine-Tuning"
+ "Containers"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequest"
- }
- }
+ "x-oaiMeta": {
+ "name": "List containers",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const containerListResponse of client.containers.list()) {\n console.log(containerListResponse.id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.containers.list()\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Containers.List(context.TODO(), openai.ContainerListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.ContainerListPage;\nimport com.openai.models.containers.ContainerListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ContainerListPage page = client.containers().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.containers.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container\",\n \"created_at\": 1747844794,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747844794,\n \"memory_limit\": \"4g\",\n \"name\": \"My Container\"\n }\n ],\n \"first_id\": \"container_123\",\n \"last_id\": \"container_123\",\n \"has_more\": false\n}\n"
}
- }
+ },
+ "x-ms-list": true
},
- "get": {
- "operationId": "listPaginatedFineTuningJobs",
- "summary": "List fine-tuning jobs",
- "description": "Returns the fine-tuning jobs for the current organization.",
- "parameters": [
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "Identifier for the last job from the previous pagination request.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "Number of fine-tuning jobs to retrieve.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
- }
- ],
+ "post": {
+ "operationId": "Containers_createContainer",
+ "summary": "Create a container",
+ "description": "Creates a container from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse"
+ "$ref": "#/components/schemas/OpenAI.ContainerResource"
}
}
}
@@ -11853,34 +12012,111 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
+ "Containers"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateContainerBody"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create container",
+ "group": "containers",
+ "path": "post",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"My Container\",\n \"memory_limit\": \"4g\",\n \"skills\": [\n {\n \"type\": \"skill_reference\",\n \"skill_id\": \"skill_4db6f1a2c9e73508b41f9da06e2c7b5f\"\n },\n {\n \"type\": \"skill_reference\",\n \"skill_id\": \"openai-spreadsheets\",\n \"version\": \"latest\"\n }\n ],\n \"network_policy\": {\n \"type\": \"allowlist\",\n \"allowed_domains\": [\"api.buildkite.com\"]\n }\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst container = await client.containers.create({ name: 'name' });\n\nconsole.log(container.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncontainer = client.containers.create(\n name=\"name\",\n)\nprint(container.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcontainer, err := client.Containers.New(context.TODO(), openai.ContainerNewParams{\n\t\tName: \"name\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", container.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.ContainerCreateParams;\nimport com.openai.models.containers.ContainerCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ContainerCreateParams params = ContainerCreateParams.builder()\n .name(\"name\")\n .build();\n ContainerCreateResponse container = client.containers().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncontainer = openai.containers.create(name: \"name\")\n\nputs(container)"
+ },
+ "response": "{\n \"id\": \"cntr_682e30645a488191b6363a0cbefc0f0a025ec61b66250591\",\n \"object\": \"container\",\n \"created_at\": 1747857508,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747857508,\n \"network_policy\": {\n \"type\": \"allowlist\",\n \"allowed_domains\": [\"api.buildkite.com\"]\n },\n \"memory_limit\": \"4g\",\n \"name\": \"My Container\"\n}\n"
+ }
+ }
}
},
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}": {
- "get": {
- "operationId": "retrieveFineTuningJob",
- "summary": "Get a fine-tuning job",
- "description": "Gets info about a fine-tuning job.\n\n[Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)",
+ "/openai/v1/containers/{container_id}": {
+ "delete": {
+ "operationId": "Containers_deleteContainer",
+ "summary": "Delete a container",
+ "description": "Deletes a container by its identifier.",
"parameters": [
{
- "name": "fine_tuning_job_id",
+ "name": "container_id",
"in": "path",
"required": true,
- "description": "The ID of the fine-tuning job.",
+ "description": "The ID of the container to delete.",
"schema": {
"type": "string"
}
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded."
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
},
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a container",
+ "group": "containers",
+ "path": "delete",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.containers.delete('container_id');",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nclient.containers.delete(\n \"container_id\",\n)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Containers.Delete(context.TODO(), \"container_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.ContainerDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n client.containers().delete(\"container_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresult = openai.containers.delete(\"container_id\")\n\nputs(result)"
+ },
+ "response": "{\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Containers_retrieveContainer",
+ "summary": "Get a container",
+ "description": "Retrieves a container by its identifier.",
+ "parameters": [
{
- "name": "api-version",
- "in": "query",
+ "name": "container_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
@@ -11889,7 +12125,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "$ref": "#/components/schemas/OpenAI.ContainerResource"
}
}
}
@@ -11916,34 +12152,70 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve container",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst container = await client.containers.retrieve('container_id');\n\nconsole.log(container.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncontainer = client.containers.retrieve(\n \"container_id\",\n)\nprint(container.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcontainer, err := client.Containers.Get(context.TODO(), \"container_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", container.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.ContainerRetrieveParams;\nimport com.openai.models.containers.ContainerRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ContainerRetrieveResponse container = client.containers().retrieve(\"container_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncontainer = openai.containers.retrieve(\"container_id\")\n\nputs(container)"
+ },
+ "response": "{\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container\",\n \"created_at\": 1747844794,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747844794,\n \"memory_limit\": \"4g\",\n \"name\": \"My Container\"\n}\n"
+ }
+ }
}
},
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel": {
- "post": {
- "operationId": "cancelFineTuningJob",
- "summary": "Cancel a fine-tuning job",
- "description": "Immediately cancels the specified fine-tuning job.",
+ "/openai/v1/containers/{container_id}/files": {
+ "get": {
+ "operationId": "Containers_listContainerFiles",
+ "summary": "List container files",
+ "description": "Lists container files matching the request filters.",
"parameters": [
{
- "name": "fine_tuning_job_id",
+ "name": "container_id",
"in": "path",
"required": true,
- "description": "The ID of the fine-tuning job to cancel.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
}
},
{
- "name": "api-version",
+ "name": "limit",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
}
],
"responses": {
@@ -11952,7 +12224,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "$ref": "#/components/schemas/OpenAI.ContainerFileListResource"
}
}
}
@@ -11979,65 +12251,48 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
- }
- },
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints": {
- "get": {
- "operationId": "listFineTuningJobCheckpoints",
- "summary": "List fine-tuning job checkpoints",
- "description": "Returns the checkpoints saved during the specified fine-tuning job.",
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "List container files",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fileListResponse of client.containers.files.list('container_id')) {\n console.log(fileListResponse.id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.containers.files.list(\n container_id=\"container_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Containers.Files.List(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\topenai.ContainerFileListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.files.FileListPage;\nimport com.openai.models.containers.files.FileListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileListPage page = client.containers().files().list(\"container_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.containers.files.list(\"container_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n }\n ],\n \"first_id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"has_more\": false,\n \"last_id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\"\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Containers_createContainerFileMultipart_Containers_createContainerFileJson",
"parameters": [
{
- "name": "fine_tuning_job_id",
+ "name": "container_id",
"in": "path",
"required": true,
- "description": "The ID of the fine-tuning job to get checkpoints for.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
}
- },
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "Identifier for the last checkpoint ID from the previous pagination request.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "Number of checkpoints to retrieve.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- },
- "explode": false
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
}
],
+ "description": "Creates a container file multipart from the supplied request. Creates a container file json from the supplied request.",
+ "summary": "Create a container file multipart Create a container file json",
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse"
+ "$ref": "#/components/schemas/OpenAI.ContainerFileResource"
}
}
}
@@ -12063,57 +12318,138 @@
}
}
},
+ "x-ms-request-body-description-override": "The request body.",
+ "x-oaiMeta": {
+ "name": "Create container file",
+ "group": "containers",
+ "path": "post",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F file=\"@example.txt\"\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst file = await client.containers.files.create('container_id');\n\nconsole.log(file.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile = client.containers.files.create(\n container_id=\"container_id\",\n)\nprint(file.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfile, err := client.Containers.Files.New(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\topenai.ContainerFileNewParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", file.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.files.FileCreateParams;\nimport com.openai.models.containers.files.FileCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileCreateResponse file = client.containers().files().create(\"container_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile = openai.containers.files.create(\"container_id\")\n\nputs(file)"
+ },
+ "response": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n}\n"
+ }
+ },
"tags": [
- "Fine-Tuning"
- ]
+ "Containers"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateContainerFileBody"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateContainerFileBody"
+ }
+ }
+ },
+ "description": "The multipart request body. The request body."
+ }
}
},
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/events": {
- "get": {
- "operationId": "listFineTuningJobEvents",
- "summary": "List fine-tuning job events",
- "description": "Returns the status events emitted during the specified fine-tuning job.",
+ "/openai/v1/containers/{container_id}/files/{file_id}": {
+ "delete": {
+ "operationId": "Containers_deleteContainerFile",
+ "summary": "Delete a container file",
+ "description": "Deletes a container file by its identifier.",
"parameters": [
{
- "name": "fine_tuning_job_id",
+ "name": "container_id",
"in": "path",
"required": true,
- "description": "The ID of the fine-tuning job to get events for.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
}
},
{
- "name": "after",
- "in": "query",
- "required": false,
- "description": "Identifier for the last event from the previous pagination request.",
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-description-override": "The ID of the file."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded."
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
},
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a container file",
+ "group": "containers",
+ "path": "delete",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863/files/cfile_682e0e8a43c88191a7978f477a09bdf5 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.containers.files.delete('file_id', { container_id: 'container_id' });",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nclient.containers.files.delete(\n file_id=\"file_id\",\n container_id=\"container_id\",\n)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Containers.Files.Delete(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\t\"file_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.files.FileDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileDeleteParams params = FileDeleteParams.builder()\n .containerId(\"container_id\")\n .fileId(\"file_id\")\n .build();\n client.containers().files().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresult = openai.containers.files.delete(\"file_id\", container_id: \"container_id\")\n\nputs(result)"
+ },
+ "response": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Containers_retrieveContainerFile",
+ "summary": "Get a container file",
+ "description": "Retrieves a container file by its identifier.",
+ "parameters": [
{
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "Number of events to retrieve.",
+ "name": "container_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the container.",
"schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
+ "type": "string"
+ }
},
{
- "name": "api-version",
- "in": "query",
+ "name": "file_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the file.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-description-override": "The ID of the file."
}
],
"responses": {
@@ -12122,7 +12458,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ListFineTuningJobEventsResponse"
+ "$ref": "#/components/schemas/OpenAI.ContainerFileResource"
}
}
}
@@ -12149,34 +12485,112 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve container file",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/container_123/files/file_456 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst file = await client.containers.files.retrieve('file_id', { container_id: 'container_id' });\n\nconsole.log(file.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile = client.containers.files.retrieve(\n file_id=\"file_id\",\n container_id=\"container_id\",\n)\nprint(file.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfile, err := client.Containers.Files.Get(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\t\"file_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", file.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.files.FileRetrieveParams;\nimport com.openai.models.containers.files.FileRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileRetrieveParams params = FileRetrieveParams.builder()\n .containerId(\"container_id\")\n .fileId(\"file_id\")\n .build();\n FileRetrieveResponse file = client.containers().files().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile = openai.containers.files.retrieve(\"file_id\", container_id: \"container_id\")\n\nputs(file)"
+ },
+ "response": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n}\n"
+ }
+ }
}
},
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause": {
- "post": {
- "operationId": "pauseFineTuningJob",
- "summary": "Pause a fine-tuning job",
- "description": "Pauses the specified fine-tuning job while it is running.",
+ "/openai/v1/containers/{container_id}/files/{file_id}/content": {
+ "get": {
+ "operationId": "Containers_retrieveContainerFileContent",
+ "summary": "Get a container file content",
+ "description": "Retrieves a container file content by its identifier.",
"parameters": [
{
- "name": "fine_tuning_job_id",
+ "name": "container_id",
"in": "path",
"required": true,
- "description": "The ID of the fine-tuning job to pause.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
}
},
{
- "name": "api-version",
- "in": "query",
+ "name": "file_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the file.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-description-override": "The ID of the file."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded."
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve container file content",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/container_123/files/cfile_456/content \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst content = await client.containers.files.content.retrieve('file_id', {\n container_id: 'container_id',\n});\n\nconsole.log(content);\n\nconst data = await content.blob();\nconsole.log(data);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncontent = client.containers.files.content.retrieve(\n file_id=\"file_id\",\n container_id=\"container_id\",\n)\nprint(content)\ndata = content.read()\nprint(data)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcontent, err := client.Containers.Files.Content.Get(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\t\"file_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", content)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.containers.files.content.ContentRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ContentRetrieveParams params = ContentRetrieveParams.builder()\n .containerId(\"container_id\")\n .fileId(\"file_id\")\n .build();\n HttpResponse content = client.containers().files().content().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncontent = openai.containers.files.content.retrieve(\"file_id\", container_id: \"container_id\")\n\nputs(content)"
+ },
+ "response": "\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/conversations": {
+ "post": {
+ "operationId": "createConversation",
+ "summary": "Create a conversation",
+ "description": "Creates a new conversation resource.",
+ "parameters": [
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
}
],
"responses": {
@@ -12185,7 +12599,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
}
}
}
@@ -12212,34 +12626,112 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
- }
- },
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume": {
- "post": {
- "operationId": "resumeFineTuningJob",
- "summary": "Resume a fine-tuning job",
- "description": "Resumes the specified fine-tuning job after it has been paused.",
+ "Conversations"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateConversationBody"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Create a conversation",
+ "group": "conversations",
+ "path": "create",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"metadata\": {\"topic\": \"demo\"},\n \"items\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ]\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst conversation = await client.conversations.create({\n metadata: { topic: \"demo\" },\n items: [\n { type: \"message\", role: \"user\", content: \"Hello!\" }\n ],\n});\nconsole.log(conversation);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation = client.conversations.create()\nprint(conversation.id)",
+ "csharp": "using System;\nusing System.Collections.Generic;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversation conversation = client.CreateConversation(\n new CreateConversationOptions\n {\n Metadata = new Dictionary\n {\n { \"topic\", \"demo\" }\n },\n Items =\n {\n new ConversationMessageInput\n {\n Role = \"user\",\n Content = \"Hello!\",\n }\n }\n }\n);\nConsole.WriteLine(conversation.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversation = await client.conversations.create();\n\nconsole.log(conversation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversation, err := client.Conversations.New(context.TODO(), conversations.ConversationNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.Conversation;\nimport com.openai.models.conversations.ConversationCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Conversation conversation = client.conversations().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation = openai.conversations.create\n\nputs(conversation)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation\",\n \"created_at\": 1741900000,\n \"metadata\": {\"topic\": \"demo\"}\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "listConversations",
+ "summary": "List conversations",
+ "description": "Returns the conversations available in the current project.",
"parameters": [
{
- "name": "fine_tuning_job_id",
- "in": "path",
- "required": true,
- "description": "The ID of the fine-tuning job to resume.",
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
"schema": {
"type": "string"
- }
+ },
+ "explode": false
},
{
- "name": "api-version",
+ "name": "before",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "agent_name",
+ "in": "query",
+ "required": false,
+ "description": "Filter by agent name. If provided, only items associated with the specified agent will be returned.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "agent_id",
+ "in": "query",
+ "required": false,
+ "description": "Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.",
"schema": {
"type": "string"
},
"explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
}
],
"responses": {
@@ -12248,7 +12740,33 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
}
}
}
@@ -12275,16 +12793,25 @@
}
},
"tags": [
- "Fine-Tuning"
+ "Conversations"
]
}
},
- "/openai/v1/responses": {
+ "/openai/v1/conversations/{conversation_id}": {
"post": {
- "operationId": "createResponse",
- "summary": "Create a model response",
- "description": "Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response.",
+ "operationId": "updateConversation",
+ "summary": "Update a conversation",
+ "description": "Modifies the specified conversation's properties.",
"parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation to update.",
+ "schema": {
+ "type": "string"
+ }
+ },
{
"name": "x-ms-user-identity",
"in": "header",
@@ -12298,339 +12825,98 @@
"responses": {
"200": {
"description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "content": {
+ "application/json": {
"schema": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
}
}
- },
+ }
+ },
+ "4XX": {
+ "description": "Client error",
"content": {
"application/json": {
"schema": {
- "type": "object",
- "properties": {
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
- },
- "top_logprobs": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "temperature": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "top_p": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "user": {
- "type": "string",
- "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
- "deprecated": true
- },
- "safety_identifier": {
- "type": "string",
- "maxLength": 64,
- "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
- },
- "prompt_cache_key": {
- "type": "string",
- "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
- },
- "service_tier": {
- "$ref": "#/components/schemas/OpenAI.ServiceTier"
- },
- "prompt_cache_retention": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_memory",
- "24h"
- ]
- },
- {
- "type": "null"
- }
- ]
- },
- "previous_response_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "model": {
- "type": "string",
- "description": "The model deployment to use for the creation of this response."
- },
- "background": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "max_tool_calls": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "text": {
- "$ref": "#/components/schemas/OpenAI.ResponseTextParam"
- },
- "tools": {
- "$ref": "#/components/schemas/OpenAI.ToolsArray"
- },
- "tool_choice": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ]
- },
- "prompt": {
- "$ref": "#/components/schemas/OpenAI.Prompt"
- },
- "truncation": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "disabled"
- ]
- },
- {
- "type": "null"
- }
- ],
- "default": "disabled"
- },
- "id": {
- "type": "string",
- "description": "Unique identifier for this Response."
- },
- "object": {
- "type": "string",
- "enum": [
- "response"
- ],
- "description": "The object type of this resource - always set to `response`.",
- "x-stainless-const": true
- },
- "status": {
- "type": "string",
- "enum": [
- "completed",
- "failed",
- "in_progress",
- "cancelled",
- "queued",
- "incomplete"
- ],
- "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) of when this Response was created."
- },
- "completed_at": {
- "anyOf": [
- {
- "type": "string",
- "format": "date-time"
- },
- {
- "type": "null"
- }
- ],
- "type": "integer",
- "format": "unixTimestamp"
- },
- "error": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseError"
- },
- {
- "type": "null"
- }
- ]
- },
- "incomplete_details": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails"
- },
- {
- "type": "null"
- }
- ]
- },
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- },
- "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs."
- },
- "reasoning": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Reasoning"
- },
- {
- "type": "null"
- }
- ]
- },
- "instructions": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "output_text": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "usage": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsage"
- },
- "moderation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Moderation"
- },
- {
- "type": "null"
- }
- ]
- },
- "parallel_tool_calls": {
- "type": "boolean",
- "description": "Whether to allow the model to run tool calls in parallel.",
- "default": true
- },
- "conversation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationReference"
- },
- {
- "type": "null"
- }
- ]
- },
- "max_output_tokens": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "agent_reference": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/AgentReference"
- },
- {
- "type": "null"
- }
- ],
- "description": "The agent used for this response"
- },
- "content_filters": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ContentFilterResult"
- },
- "description": "The content filter evaluation results."
- }
- },
- "required": [
- "id",
- "object",
- "created_at",
- "error",
- "incomplete_details",
- "output",
- "instructions",
- "parallel_tool_calls",
- "agent_reference"
- ]
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
- },
- "text/event-stream": {
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.CreateResponseStreamingResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Conversations"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UpdateConversationBody"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Update a conversation",
+ "group": "conversations",
+ "path": "update",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations/conv_123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"metadata\": {\"topic\": \"project-x\"}\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst updated = await client.conversations.update(\n \"conv_123\",\n { metadata: { topic: \"project-x\" } }\n);\nconsole.log(updated);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation = client.conversations.update(\n conversation_id=\"conv_123\",\n metadata={\n \"foo\": \"string\"\n },\n)\nprint(conversation.id)",
+ "csharp": "using System;\nusing System.Collections.Generic;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversation updated = client.UpdateConversation(\n conversationId: \"conv_123\",\n new UpdateConversationOptions\n {\n Metadata = new Dictionary\n {\n { \"topic\", \"project-x\" }\n }\n }\n);\nConsole.WriteLine(updated.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversation = await client.conversations.update('conv_123', { metadata: { foo: 'string' } });\n\nconsole.log(conversation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversation, err := client.Conversations.Update(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\tconversations.ConversationUpdateParams{\n\t\t\tMetadata: shared.Metadata{\n\t\t\t\t\"foo\": \"string\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.conversations.Conversation;\nimport com.openai.models.conversations.ConversationUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ConversationUpdateParams params = ConversationUpdateParams.builder()\n .conversationId(\"conv_123\")\n .metadata(ConversationUpdateParams.Metadata.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"string\"))\n .build())\n .build();\n Conversation conversation = client.conversations().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation = openai.conversations.update(\"conv_123\", metadata: {foo: \"string\"})\n\nputs(conversation)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation\",\n \"created_at\": 1741900000,\n \"metadata\": {\"topic\": \"project-x\"}\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "getConversation",
+ "summary": "Retrieve a conversation",
+ "description": "Retrieves the specified conversation and its metadata.",
+ "parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
}
}
}
@@ -12657,7 +12943,178 @@
}
},
"tags": [
- "Responses"
+ "Conversations"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve a conversation",
+ "group": "conversations",
+ "path": "retrieve",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations/conv_123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst conversation = await client.conversations.retrieve(\"conv_123\");\nconsole.log(conversation);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation = client.conversations.retrieve(\n \"conv_123\",\n)\nprint(conversation.id)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversation conversation = client.GetConversation(\"conv_123\");\nConsole.WriteLine(conversation.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversation = await client.conversations.retrieve('conv_123');\n\nconsole.log(conversation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversation, err := client.Conversations.Get(context.TODO(), \"conv_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.Conversation;\nimport com.openai.models.conversations.ConversationRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Conversation conversation = client.conversations().retrieve(\"conv_123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation = openai.conversations.retrieve(\"conv_123\")\n\nputs(conversation)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation\",\n \"created_at\": 1741900000,\n \"metadata\": {\"topic\": \"demo\"}\n}\n"
+ }
+ }
+ },
+ "delete": {
+ "operationId": "deleteConversation",
+ "summary": "Delete a conversation",
+ "description": "Removes the specified conversation resource from the current project.",
+ "parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeletedConversationResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Conversations"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a conversation",
+ "group": "conversations",
+ "path": "delete",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/conversations/conv_123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst deleted = await client.conversations.delete(\"conv_123\");\nconsole.log(deleted);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation_deleted_resource = client.conversations.delete(\n \"conv_123\",\n)\nprint(conversation_deleted_resource.id)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nDeletedConversation deleted = client.DeleteConversation(\"conv_123\");\nConsole.WriteLine(deleted.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationDeletedResource = await client.conversations.delete('conv_123');\n\nconsole.log(conversationDeletedResource.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversationDeletedResource, err := client.Conversations.Delete(context.TODO(), \"conv_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversationDeletedResource.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.ConversationDeleteParams;\nimport com.openai.models.conversations.ConversationDeletedResource;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ConversationDeletedResource conversationDeletedResource = client.conversations().delete(\"conv_123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_deleted_resource = openai.conversations.delete(\"conv_123\")\n\nputs(conversation_deleted_resource)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/conversations/{conversation_id}/items": {
+ "post": {
+ "operationId": "createConversationItems",
+ "summary": "Create conversation items",
+ "description": "Adds one or more items to the specified conversation.",
+ "parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation on which the item needs to be created.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include",
+ "in": "query",
+ "required": false,
+ "description": "Additional fields to include in the response.\nSee the `include` parameter for listing Conversation items for more information.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ConversationItemList"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Conversations"
],
"requestBody": {
"required": true,
@@ -12666,290 +13123,55 @@
"schema": {
"type": "object",
"properties": {
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
- },
- "top_logprobs": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "temperature": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "top_p": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "user": {
- "type": "string",
- "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
- "deprecated": true
- },
- "safety_identifier": {
- "type": "string",
- "maxLength": 64,
- "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
- },
- "prompt_cache_key": {
- "type": "string",
- "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
- },
- "service_tier": {
- "$ref": "#/components/schemas/OpenAI.ServiceTier"
- },
- "prompt_cache_retention": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_memory",
- "24h"
- ]
- },
- {
- "type": "null"
- }
- ]
- },
- "previous_response_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "model": {
- "type": "string",
- "description": "The model deployment to use for the creation of this response."
- },
- "background": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "max_tool_calls": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "text": {
- "$ref": "#/components/schemas/OpenAI.ResponseTextParam"
- },
- "tools": {
- "$ref": "#/components/schemas/OpenAI.ToolsArray"
- },
- "tool_choice": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ]
- },
- "prompt": {
- "$ref": "#/components/schemas/OpenAI.Prompt"
- },
- "truncation": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "disabled"
- ]
- },
- {
- "type": "null"
- }
- ],
- "deprecated": true,
- "default": "disabled"
- },
- "reasoning": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Reasoning"
- },
- {
- "type": "null"
- }
- ]
- },
- "input": {
- "$ref": "#/components/schemas/OpenAI.InputParam"
- },
- "include": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.IncludeEnum"
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "parallel_tool_calls": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": true
- },
- "store": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": true
- },
- "instructions": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "moderation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ModerationParam"
- },
- {
- "type": "null"
- }
- ]
- },
- "stream": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "stream_options": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamOptions"
- },
- {
- "type": "null"
- }
- ]
- },
- "conversation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationParam"
- },
- {
- "type": "null"
- }
- ]
- },
- "context_management": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ContextManagementParam"
- }
- },
- {
- "type": "null"
- }
- ],
- "description": "Context management configuration for this request."
- },
- "max_output_tokens": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "agent_reference": {
- "$ref": "#/components/schemas/AgentReference",
- "description": "The agent to use for generating the response."
- },
- "structured_inputs": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The structured inputs to the response that can participate in prompt template substitution or tool argument bindings."
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ },
+ "maxItems": 20,
+ "description": "The items to add to the conversation. You may add up to 20 items at a time."
}
- }
+ },
+ "required": [
+ "items"
+ ]
}
}
}
+ },
+ "x-oaiMeta": {
+ "name": "Create items",
+ "group": "conversations",
+ "path": "create-item",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations/conv_123/items \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"items\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"Hello!\"}\n ]\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"How are you?\"}\n ]\n }\n ]\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst items = await client.conversations.items.create(\n \"conv_123\",\n {\n items: [\n {\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text: \"Hello!\" }],\n },\n {\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text: \"How are you?\" }],\n },\n ],\n }\n);\nconsole.log(items.data);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation_item_list = client.conversations.items.create(\n conversation_id=\"conv_123\",\n items=[{\n \"content\": \"string\",\n \"role\": \"user\",\n \"type\": \"message\",\n }],\n)\nprint(conversation_item_list.first_id)",
+ "csharp": "using System;\nusing System.Collections.Generic;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversationItemList created = client.ConversationItems.Create(\n conversationId: \"conv_123\",\n new CreateConversationItemsOptions\n {\n Items = new List\n {\n new ConversationMessage\n {\n Role = \"user\",\n Content =\n {\n new ConversationInputText { Text = \"Hello!\" }\n }\n },\n new ConversationMessage\n {\n Role = \"user\",\n Content =\n {\n new ConversationInputText { Text = \"How are you?\" }\n }\n }\n }\n }\n);\nConsole.WriteLine(created.Data.Count);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationItemList = await client.conversations.items.create('conv_123', {\n items: [\n {\n content: 'string',\n role: 'user',\n type: 'message',\n },\n ],\n});\n\nconsole.log(conversationItemList.first_id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversationItemList, err := client.Conversations.Items.New(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\tconversations.ItemNewParams{\n\t\t\tItems: []responses.ResponseInputItemUnionParam{{\n\t\t\t\tOfMessage: &responses.EasyInputMessageParam{\n\t\t\t\t\tContent: responses.EasyInputMessageContentUnionParam{\n\t\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t\t},\n\t\t\t\t\tRole: responses.EasyInputMessageRoleUser,\n\t\t\t\t\tType: responses.EasyInputMessageTypeMessage,\n\t\t\t\t},\n\t\t\t}},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversationItemList.FirstID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.items.ConversationItemList;\nimport com.openai.models.conversations.items.ItemCreateParams;\nimport com.openai.models.responses.EasyInputMessage;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemCreateParams params = ItemCreateParams.builder()\n .conversationId(\"conv_123\")\n .addItem(EasyInputMessage.builder()\n .content(\"string\")\n .role(EasyInputMessage.Role.USER)\n .type(EasyInputMessage.Type.MESSAGE)\n .build())\n .build();\n ConversationItemList conversationItemList = client.conversations().items().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item_list = openai.conversations.items.create(\"conv_123\", items: [{content: \"string\", role: :user, type: :message}])\n\nputs(conversation_item_list)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_abc\",\n \"status\": \"completed\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"Hello!\"}\n ]\n },\n {\n \"type\": \"message\",\n \"id\": \"msg_def\",\n \"status\": \"completed\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"How are you?\"}\n ]\n }\n ],\n \"first_id\": \"msg_abc\",\n \"last_id\": \"msg_def\",\n \"has_more\": false\n}\n"
+ }
}
},
"get": {
- "operationId": "listResponses",
- "summary": "List responses",
- "description": "Returns a collection of all stored responses matching specified filter criteria.",
+ "operationId": "listConversationItems",
+ "summary": "List conversation items",
+ "description": "Returns the items belonging to the specified conversation.",
"parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation on which the items needs to be listed.",
+ "schema": {
+ "type": "string"
+ }
+ },
{
"name": "limit",
"in": "query",
@@ -12993,32 +13215,12 @@
"explode": false
},
{
- "name": "agent_name",
- "in": "query",
- "required": false,
- "description": "Filter by agent name. If provided, only items associated with the specified agent will be returned.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "agent_id",
- "in": "query",
- "required": false,
- "description": "Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "conversation_id",
+ "name": "item_type",
"in": "query",
"required": false,
- "description": "Filter by conversation ID. If provided, only responses associated with the specified conversation will be returned.",
+ "description": "Filter by item type. If provided, only items of the specified type will be returned.",
"schema": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ItemType"
},
"explode": false
},
@@ -13047,7 +13249,7 @@
"data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.Response"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
},
"description": "The requested list of items."
},
@@ -13091,23 +13293,70 @@
}
},
"tags": [
- "Responses"
- ]
+ "Conversations"
+ ],
+ "x-oaiMeta": {
+ "name": "List items",
+ "group": "conversations",
+ "path": "list-items",
+ "examples": {
+ "request": {
+ "curl": "curl \"https://api.openai.com/v1/conversations/conv_123/items?limit=10\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst items = await client.conversations.items.list(\"conv_123\", { limit: 10 });\nconsole.log(items.data);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.conversations.items.list(\n conversation_id=\"conv_123\",\n)\npage = page.data[0]\nprint(page)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversationItemList items = client.ConversationItems.List(\n conversationId: \"conv_123\",\n new ListConversationItemsOptions { Limit = 10 }\n);\nConsole.WriteLine(items.Data.Count);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const conversationItem of client.conversations.items.list('conv_123')) {\n console.log(conversationItem);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Conversations.Items.List(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\tconversations.ItemListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.items.ItemListPage;\nimport com.openai.models.conversations.items.ItemListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemListPage page = client.conversations().items().list(\"conv_123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.conversations.items.list(\"conv_123\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_abc\",\n \"status\": \"completed\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"Hello!\"}\n ]\n }\n ],\n \"first_id\": \"msg_abc\",\n \"last_id\": \"msg_abc\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
}
},
- "/openai/v1/responses/compact": {
- "post": {
- "operationId": "compactResponseConversation",
- "summary": "Compact a conversation",
- "description": "Compacts a conversation into a response object suitable for long-running and zero-data-retention scenarios.",
- "parameters": [],
+ "/openai/v1/conversations/{conversation_id}/items/{item_id}": {
+ "get": {
+ "operationId": "getConversationItem",
+ "summary": "Get a conversation item",
+ "description": "Retrieves a specific item from the specified conversation.",
+ "parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the conversation that contains the item.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "item_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation item to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.CompactResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
}
}
@@ -13134,66 +13383,50 @@
}
},
"tags": [
- "Responses"
+ "Conversations"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.CompactResponseMethodPublicBody"
- }
- }
+ "x-oaiMeta": {
+ "name": "Retrieve an item",
+ "group": "conversations",
+ "path": "get-item",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations/conv_123/items/msg_abc \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst item = await client.conversations.items.retrieve(\n \"conv_123\",\n \"msg_abc\"\n);\nconsole.log(item);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation_item = client.conversations.items.retrieve(\n item_id=\"msg_abc\",\n conversation_id=\"conv_123\",\n)\nprint(conversation_item)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversationItem item = client.ConversationItems.Get(\n conversationId: \"conv_123\",\n itemId: \"msg_abc\"\n);\nConsole.WriteLine(item.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationItem = await client.conversations.items.retrieve('msg_abc', {\n conversation_id: 'conv_123',\n});\n\nconsole.log(conversationItem);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversationItem, err := client.Conversations.Items.Get(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\t\"msg_abc\",\n\t\tconversations.ItemGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversationItem)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.items.ConversationItem;\nimport com.openai.models.conversations.items.ItemRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemRetrieveParams params = ItemRetrieveParams.builder()\n .conversationId(\"conv_123\")\n .itemId(\"msg_abc\")\n .build();\n ConversationItem conversationItem = client.conversations().items().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item = openai.conversations.items.retrieve(\"msg_abc\", conversation_id: \"conv_123\")\n\nputs(conversation_item)"
+ },
+ "response": "{\n \"type\": \"message\",\n \"id\": \"msg_abc\",\n \"status\": \"completed\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"Hello!\"}\n ]\n}\n"
}
}
- }
- },
- "/openai/v1/responses/{response_id}": {
- "get": {
- "operationId": "getResponse",
- "summary": "Retrieve a model response",
- "description": "Retrieves a model response with the given ID.",
+ },
+ "delete": {
+ "operationId": "deleteConversationItem",
+ "summary": "Delete a conversation item",
+ "description": "Removes the specified item from a conversation.",
"parameters": [
{
- "name": "response_id",
+ "name": "conversation_id",
"in": "path",
"required": true,
+ "description": "The id of the conversation on which the item needs to be deleted from.",
"schema": {
"type": "string"
}
},
{
- "name": "include[]",
- "in": "query",
- "required": false,
+ "name": "item_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation item to delete.",
"schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.IncludeEnum"
- },
- "default": []
+ "type": "string"
}
},
- {
- "name": "stream",
- "in": "query",
- "required": false,
- "schema": {
- "type": "boolean",
- "default": false
- },
- "explode": false
- },
- {
- "name": "starting_after",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "format": "int32"
- },
- "explode": false
- },
{
"name": "x-ms-user-identity",
"in": "header",
@@ -13207,24 +13440,10 @@
"responses": {
"200": {
"description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.Response"
- }
- },
- "text/event-stream": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.CreateResponseStreamingResponse"
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
}
}
}
@@ -13251,49 +13470,41 @@
}
},
"tags": [
- "Responses"
- ]
- },
- "delete": {
- "operationId": "deleteResponse",
- "summary": "Delete a model response",
- "description": "Deletes a model response.",
- "parameters": [
- {
- "name": "response_id",
- "in": "path",
- "required": true,
- "description": "The ID of the response to delete.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
- }
+ "Conversations"
],
+ "x-oaiMeta": {
+ "name": "Delete an item",
+ "group": "conversations",
+ "path": "delete-item",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/conversations/conv_123/items/msg_abc \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst conversation = await client.conversations.items.delete(\n \"conv_123\",\n \"msg_abc\"\n);\nconsole.log(conversation);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation = client.conversations.items.delete(\n item_id=\"msg_abc\",\n conversation_id=\"conv_123\",\n)\nprint(conversation.id)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversation conversation = client.ConversationItems.Delete(\n conversationId: \"conv_123\",\n itemId: \"msg_abc\"\n);\nConsole.WriteLine(conversation.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversation = await client.conversations.items.delete('msg_abc', {\n conversation_id: 'conv_123',\n});\n\nconsole.log(conversation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversation, err := client.Conversations.Items.Delete(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\t\"msg_abc\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.Conversation;\nimport com.openai.models.conversations.items.ItemDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemDeleteParams params = ItemDeleteParams.builder()\n .conversationId(\"conv_123\")\n .itemId(\"msg_abc\")\n .build();\n Conversation conversation = client.conversations().items().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation = openai.conversations.items.delete(\"msg_abc\", conversation_id: \"conv_123\")\n\nputs(conversation)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation\",\n \"created_at\": 1741900000,\n \"metadata\": {\"topic\": \"demo\"}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/embeddings": {
+ "post": {
+ "operationId": "Embeddings_createEmbedding",
+ "summary": "Create an embedding",
+ "description": "Creates an embedding from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteResponseResult"
+ "$ref": "#/components/schemas/OpenAI.CreateEmbeddingResponse"
}
}
}
@@ -13320,159 +13531,98 @@
}
},
"tags": [
- "Responses"
- ]
- }
- },
- "/openai/v1/responses/{response_id}/cancel": {
- "post": {
- "operationId": "cancelResponse",
- "summary": "Cancel a model response",
- "description": "Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.",
- "parameters": [
- {
- "name": "response_id",
- "in": "path",
- "required": true,
- "description": "The ID of the response to cancel.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
- }
+ "Embeddings"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.Response"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateEmbeddingRequest"
}
}
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- }
+ "description": "The request body."
},
- "tags": [
- "Responses"
- ]
+ "x-oaiMeta": {
+ "name": "Create embeddings",
+ "group": "embeddings",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/embeddings \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"input\": \"The food was delicious and the waiter...\",\n \"model\": \"text-embedding-ada-002\",\n \"encoding_format\": \"float\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncreate_embedding_response = client.embeddings.create(\n input=\"The quick brown fox jumped over the lazy dog\",\n model=\"text-embedding-3-small\",\n)\nprint(create_embedding_response.data)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const embedding = await openai.embeddings.create({\n model: \"text-embedding-ada-002\",\n input: \"The quick brown fox jumped over the lazy dog\",\n encoding_format: \"float\",\n });\n\n console.log(embedding);\n}\n\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Embeddings;\n\nEmbeddingClient client = new(\n model: \"text-embedding-3-small\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nOpenAIEmbedding embedding = client.GenerateEmbedding(input: \"The quick brown fox jumped over the lazy dog\");\nReadOnlyMemory vector = embedding.ToFloats();\n\nfor (int i = 0; i < vector.Length; i++)\n{\n Console.WriteLine($\" [{i,4}] = {vector.Span[i]}\");\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst createEmbeddingResponse = await client.embeddings.create({\n input: 'The quick brown fox jumped over the lazy dog',\n model: 'text-embedding-3-small',\n});\n\nconsole.log(createEmbeddingResponse.data);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcreateEmbeddingResponse, err := client.Embeddings.New(context.TODO(), openai.EmbeddingNewParams{\n\t\tInput: openai.EmbeddingNewParamsInputUnion{\n\t\t\tOfString: openai.String(\"The quick brown fox jumped over the lazy dog\"),\n\t\t},\n\t\tModel: openai.EmbeddingModelTextEmbedding3Small,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", createEmbeddingResponse.Data)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.embeddings.CreateEmbeddingResponse;\nimport com.openai.models.embeddings.EmbeddingCreateParams;\nimport com.openai.models.embeddings.EmbeddingModel;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EmbeddingCreateParams params = EmbeddingCreateParams.builder()\n .input(\"The quick brown fox jumped over the lazy dog\")\n .model(EmbeddingModel.TEXT_EMBEDDING_3_SMALL)\n .build();\n CreateEmbeddingResponse createEmbeddingResponse = client.embeddings().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncreate_embedding_response = openai.embeddings.create(\n input: \"The quick brown fox jumped over the lazy dog\",\n model: :\"text-embedding-3-small\"\n)\n\nputs(create_embedding_response)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"embedding\": [\n 0.0023064255,\n -0.009327292,\n .... (1536 floats total for ada-002)\n -0.0028842222,\n ],\n \"index\": 0\n }\n ],\n \"model\": \"text-embedding-ada-002\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}\n"
+ }
+ }
}
},
- "/openai/v1/responses/{response_id}/input_items": {
+ "/openai/v1/evals": {
"get": {
- "operationId": "listInputItems",
- "summary": "List input items for a response",
- "description": "Retrieves the input items associated with the specified response.",
+ "operationId": "Evals_listEvals",
+ "summary": "List evaluations",
+ "description": "Returns the evaluations configured in the current project.",
"parameters": [
{
- "name": "response_id",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "limit",
+ "name": "after",
"in": "query",
"required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "description": "Identifier for the last run from the previous pagination request.",
"schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
+ "type": "string"
},
"explode": false
},
{
- "name": "order",
+ "name": "limit",
"in": "query",
"required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "description": "Number of runs to retrieve.",
"schema": {
- "$ref": "#/components/schemas/PageOrder"
+ "$ref": "#/components/schemas/integer",
+ "default": 20
},
"explode": false
},
{
- "name": "after",
+ "name": "order",
"in": "query",
"required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
"schema": {
- "type": "string"
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "default": "asc"
},
"explode": false
},
{
- "name": "before",
+ "name": "order_by",
"in": "query",
"required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "description": "Evals can be ordered by creation time or last updated time.\nUse `created_at` for creation time or `updated_at` for last updated time.",
"schema": {
- "type": "string"
+ "type": "string",
+ "enum": [
+ "created_at",
+ "updated_at"
+ ],
+ "default": "created_at"
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
@@ -13485,7 +13635,7 @@
"data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/Eval"
},
"description": "The requested list of items."
},
@@ -13529,29 +13679,107 @@
}
},
"tags": [
- "Responses"
- ]
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "List evals",
+ "group": "evals",
+ "path": "list",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals?limit=1 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.evals.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst evals = await openai.evals.list({ limit: 1 });\nconsole.log(evals);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const evalListResponse of client.evals.list()) {\n console.log(evalListResponse.id);\n}",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.EvalListPage;\nimport com.openai.models.evals.EvalListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalListPage page = client.evals().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.evals.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"object\": \"eval\",\n \"data_source_config\": {\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"usecase\": \"push_notifications_summarizer\"\n },\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\"\n },\n \"sample\": {\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"item\",\n \"sample\"\n ]\n }\n },\n \"testing_criteria\": [\n {\n \"name\": \"Push Notification Summary Grader\",\n \"id\": \"Push Notification Summary Grader-9b876f24-4762-4be9-aff4-db7a9b31c673\",\n \"type\": \"label_model\",\n \"model\": \"o3-mini\",\n \"input\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"\nLabel the following push notification summary as either correct or incorrect.\nThe push notification and the summary will be provided below.\nA good push notificiation summary is concise and snappy.\nIf it is good, then label it as correct, if not, then incorrect.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"\nPush notifications: {{item.input}}\nSummary: {{sample.output_text}}\n\"\n }\n }\n ],\n \"passing_labels\": [\n \"correct\"\n ],\n \"labels\": [\n \"correct\",\n \"incorrect\"\n ],\n \"sampling_params\": null\n }\n ],\n \"name\": \"Push Notification Summary Grader\",\n \"created_at\": 1739314509,\n \"metadata\": {\n \"description\": \"A stored completions eval for push notification summaries\"\n }\n }\n ],\n \"first_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"last_id\": \"eval_67aa884cf6688190b58f657d4441c8b7\",\n \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Evals_createEval",
+ "summary": "Create an evaluation",
+ "description": "Creates the structure of an evaluation that can be used to test a model's performance.\nAn 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.\nFor more information, see the [Evals guide](https://platform.openai.com/docs/guides/evals).",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Eval"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateEvalRequest"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Create eval",
+ "group": "evals",
+ "path": "post",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Sentiment\",\n \"data_source_config\": {\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"usecase\": \"chatbot\"\n }\n },\n \"testing_criteria\": [\n {\n \"type\": \"label_model\",\n \"model\": \"o3-mini\",\n \"input\": [\n {\n \"role\": \"developer\",\n \"content\": \"Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Statement: {{item.input}}\"\n }\n ],\n \"passing_labels\": [\n \"positive\"\n ],\n \"labels\": [\n \"positive\",\n \"neutral\",\n \"negative\"\n ],\n \"name\": \"Example label grader\"\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\neval = client.evals.create(\n data_source_config={\n \"item_schema\": {\n \"foo\": \"bar\"\n },\n \"type\": \"custom\",\n },\n testing_criteria=[{\n \"input\": [{\n \"content\": \"content\",\n \"role\": \"role\",\n }],\n \"labels\": [\"string\"],\n \"model\": \"model\",\n \"name\": \"name\",\n \"passing_labels\": [\"string\"],\n \"type\": \"label_model\",\n }],\n)\nprint(eval.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst evalObj = await openai.evals.create({\n name: \"Sentiment\",\n data_source_config: {\n type: \"stored_completions\",\n metadata: { usecase: \"chatbot\" }\n },\n testing_criteria: [\n {\n type: \"label_model\",\n model: \"o3-mini\",\n input: [\n { role: \"developer\", content: \"Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'\" },\n { role: \"user\", content: \"Statement: {{item.input}}\" }\n ],\n passing_labels: [\"positive\"],\n labels: [\"positive\", \"neutral\", \"negative\"],\n name: \"Example label grader\"\n }\n ]\n});\nconsole.log(evalObj);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst _eval = await client.evals.create({\n data_source_config: {\n item_schema: { foo: 'bar' },\n type: 'custom',\n },\n testing_criteria: [\n {\n input: [{ content: 'content', role: 'role' }],\n labels: ['string'],\n model: 'model',\n name: 'name',\n passing_labels: ['string'],\n type: 'label_model',\n },\n ],\n});\n\nconsole.log(_eval.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.evals.EvalCreateParams;\nimport com.openai.models.evals.EvalCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalCreateParams params = EvalCreateParams.builder()\n .customDataSourceConfig(EvalCreateParams.DataSourceConfig.Custom.ItemSchema.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"bar\"))\n .build())\n .addTestingCriterion(EvalCreateParams.TestingCriterion.LabelModel.builder()\n .addInput(EvalCreateParams.TestingCriterion.LabelModel.Input.SimpleInputMessage.builder()\n .content(\"content\")\n .role(\"role\")\n .build())\n .addLabel(\"string\")\n .model(\"model\")\n .name(\"name\")\n .addPassingLabel(\"string\")\n .build())\n .build();\n EvalCreateResponse eval = client.evals().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\neval_ = openai.evals.create(\n data_source_config: {item_schema: {foo: \"bar\"}, type: :custom},\n testing_criteria: [\n {\n input: [{content: \"content\", role: \"role\"}],\n labels: [\"string\"],\n model: \"model\",\n name: \"name\",\n passing_labels: [\"string\"],\n type: :label_model\n }\n ]\n)\n\nputs(eval_)"
+ },
+ "response": "{\n \"object\": \"eval\",\n \"id\": \"eval_67b7fa9a81a88190ab4aa417e397ea21\",\n \"data_source_config\": {\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"usecase\": \"chatbot\"\n },\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\"\n },\n \"sample\": {\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"item\",\n \"sample\"\n ]\n },\n \"testing_criteria\": [\n {\n \"name\": \"Example label grader\",\n \"type\": \"label_model\",\n \"model\": \"o3-mini\",\n \"input\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Classify the sentiment of the following statement as one of positive, neutral, or negative\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Statement: {{item.input}}\"\n }\n }\n ],\n \"passing_labels\": [\n \"positive\"\n ],\n \"labels\": [\n \"positive\",\n \"neutral\",\n \"negative\"\n ]\n }\n ],\n \"name\": \"Sentiment\",\n \"created_at\": 1740110490,\n \"metadata\": {\n \"description\": \"An eval for sentiment analysis\"\n }\n}\n"
+ }
+ }
}
},
- "/redTeams/runs": {
- "get": {
- "operationId": "RedTeams_list",
- "summary": "List redteams",
- "description": "Returns the redteams available in the current project.",
+ "/openai/v1/evals/{eval_id}": {
+ "delete": {
+ "operationId": "Evals_deleteEval",
+ "summary": "Delete an evaluation",
+ "description": "Removes the specified evaluation and its associated data.",
"parameters": [
{
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
- {
- "name": "Foundry-Features",
- "in": "header",
+ "name": "eval_id",
+ "in": "path",
"required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "description": "The ID of the evaluation to delete.",
"schema": {
- "type": "string",
- "enum": [
- "RedTeams=V1Preview"
- ]
+ "type": "string"
}
}
],
@@ -13561,84 +13789,64 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/PagedRedTeam"
+ "$ref": "#/components/schemas/DeleteEvalResponse"
}
}
}
},
"4XX": {
"description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
},
"5XX": {
"description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
}
},
"tags": [
- "Redteams"
- ]
- }
- },
- "/redTeams/runs/{name}": {
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete an eval",
+ "group": "evals",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_abc123 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\neval = client.evals.delete(\n \"eval_id\",\n)\nprint(eval.eval_id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst deleted = await openai.evals.delete(\"eval_abc123\");\nconsole.log(deleted);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst _eval = await client.evals.delete('eval_id');\n\nconsole.log(_eval.eval_id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.EvalDeleteParams;\nimport com.openai.models.evals.EvalDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalDeleteResponse eval = client.evals().delete(\"eval_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\neval_ = openai.evals.delete(\"eval_id\")\n\nputs(eval_)"
+ },
+ "response": "{\n \"object\": \"eval.deleted\",\n \"deleted\": true,\n \"eval_id\": \"eval_abc123\"\n}\n"
+ }
+ }
+ },
"get": {
- "operationId": "RedTeams_get",
- "summary": "Get a redteam",
- "description": "Retrieves the specified redteam and its configuration.",
+ "operationId": "Evals_getEval",
+ "summary": "Get an evaluation",
+ "description": "Retrieves the specified evaluation and its configuration.",
"parameters": [
{
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
- {
- "name": "name",
+ "name": "eval_id",
"in": "path",
"required": true,
- "description": "Identifier of the red team run.",
+ "description": "The ID of the evaluation to retrieve.",
"schema": {
"type": "string"
}
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "RedTeams=V1Preview"
- ]
- }
}
],
"responses": {
@@ -13647,91 +13855,74 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RedTeam"
+ "$ref": "#/components/schemas/Eval"
}
}
}
},
"4XX": {
"description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
},
"5XX": {
"description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
}
},
"tags": [
- "Redteams"
- ]
- }
- },
- "/redTeams/runs:run": {
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Get an eval",
+ "group": "evals",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\neval = client.evals.retrieve(\n \"eval_id\",\n)\nprint(eval.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst evalObj = await openai.evals.retrieve(\"eval_67abd54d9b0081909a86353f6fb9317a\");\nconsole.log(evalObj);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst _eval = await client.evals.retrieve('eval_id');\n\nconsole.log(_eval.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.EvalRetrieveParams;\nimport com.openai.models.evals.EvalRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalRetrieveResponse eval = client.evals().retrieve(\"eval_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\neval_ = openai.evals.retrieve(\"eval_id\")\n\nputs(eval_)"
+ },
+ "response": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"string\"\n },\n \"ground_truth\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"input\",\n \"ground_truth\"\n ]\n }\n },\n \"required\": [\n \"item\"\n ]\n }\n },\n \"testing_criteria\": [\n {\n \"name\": \"String check\",\n \"id\": \"String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2\",\n \"type\": \"string_check\",\n \"input\": \"{{item.input}}\",\n \"reference\": \"{{item.ground_truth}}\",\n \"operation\": \"eq\"\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {},\n}\n"
+ }
+ }
+ },
"post": {
- "operationId": "RedTeams_create",
- "summary": "Create a redteam run",
- "description": "Submits a new redteam run for execution with the provided configuration.",
+ "operationId": "Evals_updateEval",
+ "summary": "Update an evaluation",
+ "description": "Updates certain properties of an evaluation.",
"parameters": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "RedTeams=V1Preview"
- ]
- }
- },
- {
- "name": "api-version",
- "in": "query",
+ "name": "eval_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the evaluation to update.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
- "201": {
- "description": "The request has succeeded and a new resource has been created as a result.",
+ "200": {
+ "description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RedTeam"
+ "$ref": "#/components/schemas/Eval"
}
}
}
@@ -13758,58 +13949,101 @@
}
},
"tags": [
- "Redteams"
+ "Evals"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RedTeam"
+ "$ref": "#/components/schemas/UpdateEvalParametersBody"
}
}
- },
- "description": "Redteam to be run"
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Update an eval",
+ "group": "evals",
+ "path": "update",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"name\": \"Updated Eval\", \"metadata\": {\"description\": \"Updated description\"}}'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\neval = client.evals.update(\n eval_id=\"eval_id\",\n)\nprint(eval.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst updatedEval = await openai.evals.update(\n \"eval_67abd54d9b0081909a86353f6fb9317a\",\n {\n name: \"Updated Eval\",\n metadata: { description: \"Updated description\" }\n }\n);\nconsole.log(updatedEval);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst _eval = await client.evals.update('eval_id');\n\nconsole.log(_eval.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.EvalUpdateParams;\nimport com.openai.models.evals.EvalUpdateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalUpdateResponse eval = client.evals().update(\"eval_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\neval_ = openai.evals.update(\"eval_id\")\n\nputs(eval_)"
+ },
+ "response": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"string\"\n },\n \"ground_truth\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"input\",\n \"ground_truth\"\n ]\n }\n },\n \"required\": [\n \"item\"\n ]\n }\n },\n \"testing_criteria\": [\n {\n \"name\": \"String check\",\n \"id\": \"String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2\",\n \"type\": \"string_check\",\n \"input\": \"{{item.input}}\",\n \"reference\": \"{{item.ground_truth}}\",\n \"operation\": \"eq\"\n }\n ],\n \"name\": \"Updated Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {\"description\": \"Updated description\"},\n}\n"
+ }
}
}
},
- "/routines": {
+ "/openai/v1/evals/{eval_id}/runs": {
"get": {
- "operationId": "listRoutines",
- "summary": "List routines",
- "description": "Returns the routines available in the current project.",
+ "operationId": "Evals_listRuns",
+ "summary": "List evaluation runs",
+ "description": "Returns the runs associated with the specified evaluation.",
"parameters": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to retrieve runs for.",
"schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
+ "type": "string"
}
},
{
- "$ref": "#/components/parameters/ListRoutinesParameters.limit"
- },
- {
- "$ref": "#/components/parameters/ListRoutinesParameters.after"
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last run from the previous pagination request.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
},
{
- "$ref": "#/components/parameters/ListRoutinesParameters.before"
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of runs to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ },
+ "explode": false
},
{
- "$ref": "#/components/parameters/ListRoutinesParameters.order"
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "default": "asc"
+ },
+ "explode": false
},
{
- "name": "api-version",
+ "name": "status",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.",
"schema": {
- "type": "string"
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "completed",
+ "canceled",
+ "failed"
+ ]
},
"explode": false
}
@@ -13829,7 +14063,7 @@
"data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/Routine"
+ "$ref": "#/components/schemas/EvalRun"
},
"description": "The requested list of items."
},
@@ -13873,45 +14107,22 @@
}
},
"tags": [
- "Routines"
- ],
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
- }
- },
- "/routines/{routine_name}": {
- "put": {
- "operationId": "createOrUpdateRoutine",
- "summary": "Create or update a routine",
- "description": "Creates a new routine or replaces an existing routine with the supplied definition.",
+ "Evals"
+ ]
+ },
+ "post": {
+ "operationId": "Evals_createEvalRun",
+ "summary": "Create an evaluation run",
+ "description": "Creates an evaluation run for the specified evaluation.",
"parameters": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
- }
- },
- {
- "$ref": "#/components/parameters/CreateOrUpdateRoutineParameters.routine_name"
- },
- {
- "name": "api-version",
- "in": "query",
+ "name": "eval_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the evaluation to create a run for.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
@@ -13920,7 +14131,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Routine"
+ "$ref": "#/components/schemas/EvalRun"
}
}
}
@@ -13947,53 +14158,58 @@
}
},
"tags": [
- "Routines"
+ "Evals"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RoutineCreateOrUpdateRequest"
+ "$ref": "#/components/schemas/CreateEvalRunRequest"
}
}
}
},
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Create eval run",
+ "group": "evals",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67e579652b548190aaa83ada4b125f47/runs \\\n -X POST \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"name\":\"gpt-4o-mini\",\"data_source\":{\"type\":\"completions\",\"input_messages\":{\"type\":\"template\",\"template\":[{\"role\":\"developer\",\"content\":\"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"} , {\"role\":\"user\",\"content\":\"{{item.input}}\"}]} ,\"sampling_params\":{\"temperature\":1,\"max_completions_tokens\":2048,\"top_p\":1,\"seed\":42},\"model\":\"gpt-4o-mini\",\"source\":{\"type\":\"file_content\",\"content\":[{\"item\":{\"input\":\"Tech Company Launches Advanced Artificial Intelligence Platform\",\"ground_truth\":\"Technology\"}}]}}'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.evals.runs.create(\n eval_id=\"eval_id\",\n data_source={\n \"source\": {\n \"content\": [{\n \"item\": {\n \"foo\": \"bar\"\n }\n }],\n \"type\": \"file_content\",\n },\n \"type\": \"jsonl\",\n },\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst run = await openai.evals.runs.create(\n \"eval_67e579652b548190aaa83ada4b125f47\",\n {\n name: \"gpt-4o-mini\",\n data_source: {\n type: \"completions\",\n input_messages: {\n type: \"template\",\n template: [\n {\n role: \"developer\",\n content: \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n },\n {\n role: \"user\",\n content: \"{{item.input}}\"\n }\n ]\n },\n sampling_params: {\n temperature: 1,\n max_completions_tokens: 2048,\n top_p: 1,\n seed: 42\n },\n model: \"gpt-4o-mini\",\n source: {\n type: \"file_content\",\n content: [\n {\n item: {\n input: \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n ground_truth: \"Technology\"\n }\n }\n ]\n }\n }\n }\n);\nconsole.log(run);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.evals.runs.create('eval_id', {\n data_source: {\n source: { content: [{ item: { foo: 'bar' } }], type: 'file_content' },\n type: 'jsonl',\n },\n});\n\nconsole.log(run.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.evals.runs.CreateEvalJsonlRunDataSource;\nimport com.openai.models.evals.runs.RunCreateParams;\nimport com.openai.models.evals.runs.RunCreateResponse;\nimport java.util.List;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCreateParams params = RunCreateParams.builder()\n .evalId(\"eval_id\")\n .dataSource(CreateEvalJsonlRunDataSource.builder()\n .fileContentSource(List.of(CreateEvalJsonlRunDataSource.Source.FileContent.Content.builder()\n .item(CreateEvalJsonlRunDataSource.Source.FileContent.Content.Item.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"bar\"))\n .build())\n .build()))\n .build())\n .build();\n RunCreateResponse run = client.evals().runs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.evals.runs.create(\n \"eval_id\",\n data_source: {source: {content: [{item: {foo: \"bar\"}}], type: :file_content}, type: :jsonl}\n)\n\nputs(run)"
+ },
+ "response": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67e57965b480819094274e3a32235e4c\",\n \"eval_id\": \"eval_67e579652b548190aaa83ada4b125f47\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47&run_id=evalrun_67e57965b480819094274e3a32235e4c\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
+ }
}
- },
- "get": {
- "operationId": "getRoutine",
- "summary": "Get a routine",
- "description": "Retrieves the specified routine and its current configuration.",
+ }
+ },
+ "/openai/v1/evals/{eval_id}/runs/{run_id}": {
+ "delete": {
+ "operationId": "Evals_deleteEvalRun",
+ "summary": "Delete an evaluation run",
+ "description": "Removes the specified evaluation run.",
"parameters": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to delete the run from.",
"schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
+ "type": "string"
}
},
{
- "$ref": "#/components/parameters/GetRoutineParameters"
- },
- {
- "name": "api-version",
- "in": "query",
+ "name": "run_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the run to delete.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
@@ -14002,7 +14218,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Routine"
+ "$ref": "#/components/schemas/DeleteEvalRunResponse"
}
}
}
@@ -14029,48 +14245,59 @@
}
},
"tags": [
- "Routines"
+ "Evals"
],
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Delete eval run",
+ "group": "evals",
+ "path": "delete",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_123abc/runs/evalrun_abc456 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.evals.runs.delete(\n run_id=\"run_id\",\n eval_id=\"eval_id\",\n)\nprint(run.run_id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst deleted = await openai.evals.runs.delete(\n \"eval_123abc\",\n \"evalrun_abc456\"\n);\nconsole.log(deleted);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.evals.runs.delete('run_id', { eval_id: 'eval_id' });\n\nconsole.log(run.run_id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.RunDeleteParams;\nimport com.openai.models.evals.runs.RunDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunDeleteParams params = RunDeleteParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .build();\n RunDeleteResponse run = client.evals().runs().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.evals.runs.delete(\"run_id\", eval_id: \"eval_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"object\": \"eval.run.deleted\",\n \"deleted\": true,\n \"run_id\": \"evalrun_abc456\"\n}\n"
+ }
}
},
- "delete": {
- "operationId": "deleteRoutine",
- "summary": "Delete a routine",
- "description": "Deletes the specified routine.",
+ "get": {
+ "operationId": "Evals_getEvalRun",
+ "summary": "Get an evaluation run",
+ "description": "Retrieves the specified evaluation run and its current status.",
"parameters": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to retrieve runs for.",
"schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
+ "type": "string"
}
},
{
- "$ref": "#/components/parameters/DeleteRoutineParameters"
- },
- {
- "name": "api-version",
- "in": "query",
+ "name": "run_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the run to retrieve.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
- "204": {
- "description": "There is no content to send for this request, but the headers may be useful."
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EvalRun"
+ }
+ }
+ }
},
"4XX": {
"description": "Client error",
@@ -14094,60 +14321,174 @@
}
},
"tags": [
- "Routines"
+ "Evals"
],
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Get an eval run",
+ "group": "evals",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.evals.runs.retrieve(\n run_id=\"run_id\",\n eval_id=\"eval_id\",\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst run = await openai.evals.runs.retrieve(\n \"evalrun_67abd54d60ec8190832b46859da808f7\",\n { eval_id: \"eval_67abd54d9b0081909a86353f6fb9317a\" }\n);\nconsole.log(run);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.evals.runs.retrieve('run_id', { eval_id: 'eval_id' });\n\nconsole.log(run.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.RunRetrieveParams;\nimport com.openai.models.evals.runs.RunRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunRetrieveParams params = RunRetrieveParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .build();\n RunRetrieveResponse run = client.evals().runs().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.evals.runs.retrieve(\"run_id\", eval_id: \"eval_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
+ }
}
- }
- },
- "/routines/{routine_name}/runs": {
- "get": {
- "operationId": "listRoutineRuns",
- "summary": "List prior runs for a routine",
- "description": "Returns prior runs recorded for the specified routine.",
+ },
+ "post": {
+ "operationId": "Evals_cancelEvalRun",
+ "summary": "Cancel an evaluation run",
+ "description": "Cancels an ongoing evaluation run.",
"parameters": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation whose run you want to cancel.",
"schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
+ "type": "string"
}
},
{
- "$ref": "#/components/parameters/ListRoutineRunsParameters.routine_name"
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EvalRun"
+ }
+ }
+ }
},
- {
- "$ref": "#/components/parameters/ListRoutineRunsParameters.filter"
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
},
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel eval run",
+ "group": "evals",
+ "path": "post",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/cancel \\\n -X POST \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.evals.runs.cancel(\n run_id=\"run_id\",\n eval_id=\"eval_id\",\n)\nprint(response.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst canceledRun = await openai.evals.runs.cancel(\n \"evalrun_67abd54d60ec8190832b46859da808f7\",\n { eval_id: \"eval_67abd54d9b0081909a86353f6fb9317a\" }\n);\nconsole.log(canceledRun);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.evals.runs.cancel('run_id', { eval_id: 'eval_id' });\n\nconsole.log(response.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.RunCancelParams;\nimport com.openai.models.evals.runs.RunCancelResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCancelParams params = RunCancelParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .build();\n RunCancelResponse response = client.evals().runs().cancel(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.evals.runs.cancel(\"run_id\", eval_id: \"eval_id\")\n\nputs(response)"
+ },
+ "response": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7\",\n \"status\": \"canceled\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/evals/{eval_id}/runs/{run_id}/output_items": {
+ "get": {
+ "operationId": "Evals_getEvalRunOutputItems",
+ "summary": "List evaluation run output items",
+ "description": "Returns the output items produced by the specified evaluation run.",
+ "parameters": [
{
- "$ref": "#/components/parameters/ListRoutineRunsParameters.limit"
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The eval id path parameter.",
+ "schema": {
+ "type": "string"
+ }
},
{
- "$ref": "#/components/parameters/ListRoutineRunsParameters.after"
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to retrieve output items for.",
+ "schema": {
+ "type": "string"
+ }
},
{
- "$ref": "#/components/parameters/ListRoutineRunsParameters.before"
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last run from the previous pagination request.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
},
{
- "$ref": "#/components/parameters/ListRoutineRunsParameters.order"
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of runs to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ },
+ "explode": false
},
{
- "name": "api-version",
+ "name": "order",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
"schema": {
- "type": "string"
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "default": "asc"
},
"explode": false
+ },
+ {
+ "name": "status",
+ "in": "query",
+ "required": false,
+ "description": "Filter output items by status. Use `failed` to filter by failed output\nitems or `pass` to filter by passed output items.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "fail",
+ "pass"
+ ]
+ }
}
],
"responses": {
@@ -14165,7 +14506,7 @@
"data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/RoutineRun"
+ "$ref": "#/components/schemas/EvalRunOutputItem"
},
"description": "The requested list of items."
},
@@ -14209,45 +14550,59 @@
}
},
"tags": [
- "Routines"
+ "Evals"
],
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
+ "x-oaiMeta": {
+ "name": "Get eval run output items",
+ "group": "evals",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/egroup_67abd54d9b0081909a86353f6fb9317a/runs/erun_67abd54d60ec8190832b46859da808f7/output_items \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.evals.runs.output_items.list(\n run_id=\"run_id\",\n eval_id=\"eval_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst outputItems = await openai.evals.runs.outputItems.list(\n \"egroup_67abd54d9b0081909a86353f6fb9317a\",\n \"erun_67abd54d60ec8190832b46859da808f7\"\n);\nconsole.log(outputItems);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const outputItemListResponse of client.evals.runs.outputItems.list('run_id', {\n eval_id: 'eval_id',\n})) {\n console.log(outputItemListResponse.id);\n}",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.outputitems.OutputItemListPage;\nimport com.openai.models.evals.runs.outputitems.OutputItemListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n OutputItemListParams params = OutputItemListParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .build();\n OutputItemListPage page = client.evals().runs().outputItems().list(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.evals.runs.output_items.list(\"run_id\", eval_id: \"eval_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67e5796c28e081909917bf79f6e6214d\",\n \"created_at\": 1743092076,\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"status\": \"pass\",\n \"datasource_item_id\": 5,\n \"datasource_item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n },\n \"results\": [\n {\n \"name\": \"String check-a2486074-d803-4445-b431-ad2262e85d47\",\n \"sample\": null,\n \"passed\": true,\n \"score\": 1.0\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"developer\",\n \"content\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n },\n {\n \"role\": \"user\",\n \"content\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Markets\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"usage\": {\n \"total_tokens\": 325,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 323,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n }\n ],\n \"first_id\": \"outputitem_67e5796c28e081909917bf79f6e6214d\",\n \"last_id\": \"outputitem_67e5796c28e081909917bf79f6e6214d\",\n \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
}
},
- "/routines/{routine_name}:disable": {
- "post": {
- "operationId": "disableRoutine",
- "summary": "Disable a routine",
- "description": "Disables the specified routine so it no longer runs.",
+ "/openai/v1/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}": {
+ "get": {
+ "operationId": "Evals_getEvalRunOutputItem",
+ "summary": "Get an output item of an evaluation run",
+ "description": "Retrieves a single output item from the specified evaluation run.",
"parameters": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to retrieve runs for.",
"schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
+ "type": "string"
}
},
{
- "$ref": "#/components/parameters/DisableRoutineParameters"
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to retrieve.",
+ "schema": {
+ "type": "string"
+ }
},
{
- "name": "api-version",
- "in": "query",
+ "name": "output_item_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the output item to retrieve.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
@@ -14256,7 +14611,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Routine"
+ "$ref": "#/components/schemas/EvalRunOutputItem"
}
}
}
@@ -14283,45 +14638,70 @@
}
},
"tags": [
- "Routines"
+ "Evals"
],
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Get an output item of an eval run",
+ "group": "evals",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/output_items/outputitem_67abd55eb6548190bb580745d5644a33 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\noutput_item = client.evals.runs.output_items.retrieve(\n output_item_id=\"output_item_id\",\n eval_id=\"eval_id\",\n run_id=\"run_id\",\n)\nprint(output_item.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst outputItem = await openai.evals.runs.outputItems.retrieve(\n \"outputitem_67abd55eb6548190bb580745d5644a33\",\n {\n eval_id: \"eval_67abd54d9b0081909a86353f6fb9317a\",\n run_id: \"evalrun_67abd54d60ec8190832b46859da808f7\",\n }\n);\nconsole.log(outputItem);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst outputItem = await client.evals.runs.outputItems.retrieve('output_item_id', {\n eval_id: 'eval_id',\n run_id: 'run_id',\n});\n\nconsole.log(outputItem.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.outputitems.OutputItemRetrieveParams;\nimport com.openai.models.evals.runs.outputitems.OutputItemRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n OutputItemRetrieveParams params = OutputItemRetrieveParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .outputItemId(\"output_item_id\")\n .build();\n OutputItemRetrieveResponse outputItem = client.evals().runs().outputItems().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\noutput_item = openai.evals.runs.output_items.retrieve(\"output_item_id\", eval_id: \"eval_id\", run_id: \"run_id\")\n\nputs(output_item)"
+ },
+ "response": "{\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67e5796c28e081909917bf79f6e6214d\",\n \"created_at\": 1743092076,\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"status\": \"pass\",\n \"datasource_item_id\": 5,\n \"datasource_item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n },\n \"results\": [\n {\n \"name\": \"String check-a2486074-d803-4445-b431-ad2262e85d47\",\n \"sample\": null,\n \"passed\": true,\n \"score\": 1.0\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"developer\",\n \"content\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n },\n {\n \"role\": \"user\",\n \"content\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Markets\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"usage\": {\n \"total_tokens\": 325,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 323,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n}\n"
+ }
}
}
},
- "/routines/{routine_name}:dispatch_async": {
- "post": {
- "operationId": "dispatchRoutineAsync",
- "summary": "Queue an asynchronous routine dispatch",
- "description": "Queues an asynchronous dispatch for the specified routine.",
+ "/openai/v1/files": {
+ "get": {
+ "operationId": "Files_listFiles",
+ "summary": "List files",
+ "description": "Lists files matching the request filters.",
"parameters": [
{
- "name": "Foundry-Features",
- "in": "header",
+ "name": "purpose",
+ "in": "query",
"required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "description": "Only return files with the given purpose.",
"schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
+ "type": "string"
}
},
{
- "$ref": "#/components/parameters/DispatchRoutineAsyncParameters.routine_name"
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 10000
+ }
},
{
- "name": "api-version",
+ "name": "order",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
}
],
"responses": {
@@ -14330,7 +14710,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DispatchRoutineResponse"
+ "$ref": "#/components/schemas/OpenAI.ListFilesResponse"
}
}
}
@@ -14357,55 +14737,118 @@
}
},
"tags": [
- "Routines"
+ "Files"
+ ],
+ "x-oaiMeta": {
+ "name": "List files",
+ "group": "files",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.files.list()\npage = page.data[0]\nprint(page)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.files.list();\n\n for await (const file of list) {\n console.log(file);\n }\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fileObject of client.files.list()) {\n console.log(fileObject);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Files.List(context.TODO(), openai.FileListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FileListPage;\nimport com.openai.models.files.FileListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileListPage page = client.files().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.files.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 175,\n \"created_at\": 1613677385,\n \"expires_at\": 1677614202,\n \"filename\": \"salesOverview.pdf\",\n \"purpose\": \"assistants\",\n },\n {\n \"id\": \"file-abc456\",\n \"object\": \"file\",\n \"bytes\": 140,\n \"created_at\": 1613779121,\n \"expires_at\": 1677614202,\n \"filename\": \"puppy.jsonl\",\n \"purpose\": \"fine-tune\",\n }\n ],\n \"first_id\": \"file-abc123\",\n \"last_id\": \"file-abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Files_createFile",
+ "summary": "Create a file",
+ "description": "Creates a file from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OpenAIFile"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Files"
],
"requestBody": {
"required": true,
"content": {
- "application/json": {
+ "multipart/form-data": {
"schema": {
- "$ref": "#/components/schemas/DispatchRoutineRequest"
+ "$ref": "#/components/schemas/OpenAI.CreateFileRequest"
+ },
+ "encoding": {
+ "purpose": {
+ "contentType": "application/json"
+ },
+ "expires_after": {
+ "contentType": "application/json"
+ }
}
}
- }
+ },
+ "description": "The multipart request body."
},
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Upload file",
+ "group": "files",
+ "description": "Uploads a file for later use across OpenAI APIs. Uploads to this endpoint are rate-limited to 1,000 requests per minute per authenticated user. For Retrieval or `file_search` ingestion, upload files here first. If you need to attach multiple uploaded files to the same vector store, use vector store file batches instead of attaching them one by one.\n",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F purpose=\"fine-tune\" \\\n -F file=\"@mydata.jsonl\"\n -F expires_after[anchor]=\"created_at\"\n -F expires_after[seconds]=2592000\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile_object = client.files.create(\n file=b\"Example data\",\n purpose=\"assistants\",\n)\nprint(file_object.id)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.create({\n file: fs.createReadStream(\"mydata.jsonl\"),\n purpose: \"fine-tune\",\n expires_after: {\n anchor: \"created_at\",\n seconds: 2592000\n }\n });\n\n console.log(file);\n}\n\nmain();",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fileObject = await client.files.create({\n file: fs.createReadStream('fine-tune.jsonl'),\n purpose: 'assistants',\n});\n\nconsole.log(fileObject.id);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfileObject, err := client.Files.New(context.TODO(), openai.FileNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tPurpose: openai.FilePurposeAssistants,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fileObject.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FileCreateParams;\nimport com.openai.models.files.FileObject;\nimport com.openai.models.files.FilePurpose;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileCreateParams params = FileCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .purpose(FilePurpose.ASSISTANTS)\n .build();\n FileObject fileObject = client.files().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile_object = openai.files.create(file: StringIO.new(\"Example data\"), purpose: :assistants)\n\nputs(file_object)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1677614202,\n \"filename\": \"mydata.jsonl\",\n \"purpose\": \"fine-tune\",\n}\n"
+ }
}
}
},
- "/routines/{routine_name}:enable": {
- "post": {
- "operationId": "enableRoutine",
- "summary": "Enable a routine",
- "description": "Enables the specified routine so it can be dispatched.",
+ "/openai/v1/files/{file_id}": {
+ "delete": {
+ "operationId": "Files_deleteFile",
+ "summary": "Delete a file",
+ "description": "Deletes a file by its identifier.",
"parameters": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
- }
- },
- {
- "$ref": "#/components/parameters/EnableRoutineParameters"
- },
- {
- "name": "api-version",
- "in": "query",
+ "name": "file_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the file to use for this request.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
@@ -14414,7 +14857,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Routine"
+ "$ref": "#/components/schemas/OpenAI.DeleteFileResponse"
}
}
}
@@ -14441,54 +14884,37 @@
}
},
"tags": [
- "Routines"
+ "Files"
],
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Delete file",
+ "group": "files",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files/file-abc123 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile_deleted = client.files.delete(\n \"file_id\",\n)\nprint(file_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.delete(\"file-abc123\");\n\n console.log(file);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fileDeleted = await client.files.delete('file_id');\n\nconsole.log(fileDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfileDeleted, err := client.Files.Delete(context.TODO(), \"file_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fileDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FileDeleteParams;\nimport com.openai.models.files.FileDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileDeleted fileDeleted = client.files().delete(\"file_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile_deleted = openai.files.delete(\"file_id\")\n\nputs(file_deleted)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"deleted\": true\n}\n"
+ }
}
- }
- },
- "/schedules": {
+ },
"get": {
- "operationId": "Schedules_list",
- "summary": "List schedules",
- "description": "Returns schedules that match the supplied type and enabled filters.",
+ "operationId": "Files_retrieveFile",
+ "summary": "Get a file",
+ "description": "Retrieves a file by its identifier.",
"parameters": [
{
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
- {
- "name": "type",
- "in": "query",
- "required": false,
- "description": "Filter by the type of schedule.",
- "schema": {
- "$ref": "#/components/schemas/ScheduleTaskType"
- },
- "explode": false
- },
- {
- "name": "enabled",
- "in": "query",
- "required": false,
- "description": "Filter by the enabled status.",
- "schema": {
- "type": "boolean"
- },
- "explode": false
- },
- {
- "name": "Foundry-Features",
- "in": "header",
+ "name": "file_id",
+ "in": "path",
"required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "description": "The ID of the file to use for this request.",
"schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
+ "type": "string"
}
}
],
@@ -14498,371 +14924,344 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/PagedSchedule"
+ "$ref": "#/components/schemas/OpenAI.OpenAIFile"
}
}
}
},
"4XX": {
"description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
},
"5XX": {
"description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
+ "content": {
+ "application/json": {
"schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
}
},
"tags": [
- "Schedules"
- ]
+ "Files"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve file",
+ "group": "files",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files/file-abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile_object = client.files.retrieve(\n \"file_id\",\n)\nprint(file_object.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.retrieve(\"file-abc123\");\n\n console.log(file);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fileObject = await client.files.retrieve('file_id');\n\nconsole.log(fileObject.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfileObject, err := client.Files.Get(context.TODO(), \"file_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fileObject.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FileObject;\nimport com.openai.models.files.FileRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileObject fileObject = client.files().retrieve(\"file_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile_object = openai.files.retrieve(\"file_id\")\n\nputs(file_object)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1677614202,\n \"filename\": \"mydata.jsonl\",\n \"purpose\": \"fine-tune\",\n}\n"
+ }
+ }
}
},
- "/schedules/{id}": {
- "delete": {
- "operationId": "Schedules_delete",
- "summary": "Delete a schedule",
- "description": "Deletes the specified schedule resource.",
+ "/openai/v1/files/{file_id}/content": {
+ "get": {
+ "operationId": "Files_downloadFile",
+ "summary": "Download a file",
+ "description": "Downloads a file.",
"parameters": [
{
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
- {
- "name": "id",
+ "name": "file_id",
"in": "path",
"required": true,
- "description": "Identifier of the schedule.",
+ "description": "The ID of the file to use for this request.",
"schema": {
"type": "string"
}
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
- }
}
],
"responses": {
- "204": {
- "description": "There is no content to send for this request, but the headers may be useful."
- },
- "4XX": {
- "description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "text/plain": {
"schema": {
"type": "string"
}
}
- },
+ }
+ },
+ "4XX": {
+ "description": "Client error",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
},
"5XX": {
"description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
}
},
"tags": [
- "Schedules"
- ]
- },
- "get": {
- "operationId": "Schedules_get",
- "summary": "Get a schedule",
- "description": "Retrieves the specified schedule resource.",
- "parameters": [
- {
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
- {
- "name": "id",
- "in": "path",
- "required": true,
- "description": "Identifier of the schedule.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
- }
- }
+ "Files"
],
+ "x-oaiMeta": {
+ "name": "Retrieve file content",
+ "group": "files",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files/file-abc123/content \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" > file.jsonl\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.files.content(\n \"file_id\",\n)\nprint(response)\ncontent = response.read()\nprint(content)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.content(\"file-abc123\");\n\n console.log(file);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.files.content('file_id');\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Files.Content(context.TODO(), \"file_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.files.FileContentParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n HttpResponse response = client.files().content(\"file_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.files.content(\"file_id\")\n\nputs(response)"
+ },
+ "response": ""
+ }
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/alpha/graders/run": {
+ "post": {
+ "operationId": "Graders_runGrader",
+ "summary": "Run a grader",
+ "description": "Runs a grader.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Schedule"
+ "$ref": "#/components/schemas/OpenAI.RunGraderResponse"
}
}
}
},
"4XX": {
"description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
},
"5XX": {
"description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
}
},
"tags": [
- "Schedules"
- ]
- },
- "put": {
- "operationId": "Schedules_createOrUpdate",
- "summary": "Create or update a schedule",
- "description": "Creates a new schedule or updates an existing schedule with the supplied definition.",
- "parameters": [
- {
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
- {
- "name": "id",
- "in": "path",
- "required": true,
- "description": "Identifier of the schedule.",
- "schema": {
- "type": "string"
+ "Fine-tuning"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunGraderRequest"
+ }
}
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Run grader",
+ "beta": true,
+ "group": "graders",
+ "examples": [
+ {
+ "title": "Score text alignment",
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"grader\": {\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.\n\nReference answer: {{item.reference_answer}}\n\nModel answer: {{sample.output_text}}\"\n }\n ]\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42\n }\n },\n \"item\": {\n \"reference_answer\": \"fuzzy wuzzy was a bear\"\n },\n \"model_sample\": \"fuzzy wuzzy was a bear\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.run(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n model_sample=\"model_sample\",\n)\nprint(response.metadata)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst result = await openai.fineTuning.alpha.graders.run({\n grader: {\n type: \"score_model\",\n name: \"Example score model grader\",\n input: [\n {\n role: \"user\",\n content: [\n {\n type: \"input_text\",\n text: \"Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.\n\nReference answer: {{item.reference_answer}}\n\nModel answer: {{sample.output_text}}\",\n },\n ],\n },\n ],\n model: \"gpt-5-mini\",\n sampling_params: { temperature: 1, top_p: 1, seed: 42 },\n },\n item: { reference_answer: \"fuzzy wuzzy was a bear\" },\n model_sample: \"fuzzy wuzzy was a bear\",\n});\nconsole.log(result);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.run({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n model_sample: 'model_sample',\n});\n\nconsole.log(response.metadata);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{\n\t\tGrader: openai.FineTuningAlphaGraderRunParamsGraderUnion{\n\t\t\tOfStringCheck: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t\tModelSample: \"model_sample\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.Metadata)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderRunParams;\nimport com.openai.models.finetuning.alpha.graders.GraderRunResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderRunParams params = GraderRunParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .modelSample(\"model_sample\")\n .build();\n GraderRunResponse response = client.fineTuning().alpha().graders().run(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.run(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check},\n model_sample: \"model_sample\"\n)\n\nputs(response)"
+ },
+ "response": "{\n \"reward\": 1.0,\n \"metadata\": {\n \"name\": \"Example score model grader\",\n \"type\": \"score_model\",\n \"errors\": {\n \"formula_parse_error\": false,\n \"sample_parse_error\": false,\n \"truncated_observation_error\": false,\n \"unresponsive_reward_error\": false,\n \"invalid_variable_error\": false,\n \"other_error\": false,\n \"python_grader_server_error\": false,\n \"python_grader_server_error_type\": null,\n \"python_grader_runtime_error\": false,\n \"python_grader_runtime_error_details\": null,\n \"model_grader_server_error\": false,\n \"model_grader_refusal_error\": false,\n \"model_grader_parse_error\": false,\n \"model_grader_server_error_details\": null\n },\n \"execution_time\": 4.365238428115845,\n \"scores\": {},\n \"token_usage\": {\n \"prompt_tokens\": 190,\n \"total_tokens\": 324,\n \"completion_tokens\": 134,\n \"cached_tokens\": 0\n },\n \"sampled_model_name\": \"gpt-4o-2024-08-06\"\n },\n \"sub_rewards\": {},\n \"model_grader_token_usage_per_model\": {\n \"gpt-4o-2024-08-06\": {\n \"prompt_tokens\": 190,\n \"total_tokens\": 324,\n \"completion_tokens\": 134,\n \"cached_tokens\": 0\n }\n }\n}\n"
+ },
+ {
+ "title": "Score an image caption",
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"grader\": {\n \"type\": \"score_model\",\n \"name\": \"Image caption grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Score how well the provided caption matches the image on a 0-1 scale. Only return the score.\n\nCaption: {{sample.output_text}}\"\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/dog-catching-ball.png\",\n \"file_id\": null,\n \"detail\": \"high\"\n }\n ]\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 0.2\n }\n },\n \"item\": {\n \"expected_caption\": \"A golden retriever jumps to catch a tennis ball\"\n },\n \"model_sample\": \"A dog leaps to grab a tennis ball mid-air\"\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.run({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n model_sample: 'model_sample',\n});\n\nconsole.log(response.metadata);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.run(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n model_sample=\"model_sample\",\n)\nprint(response.metadata)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{\n\t\tGrader: openai.FineTuningAlphaGraderRunParamsGraderUnion{\n\t\t\tOfStringCheck: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t\tModelSample: \"model_sample\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.Metadata)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderRunParams;\nimport com.openai.models.finetuning.alpha.graders.GraderRunResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderRunParams params = GraderRunParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .modelSample(\"model_sample\")\n .build();\n GraderRunResponse response = client.fineTuning().alpha().graders().run(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.run(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check},\n model_sample: \"model_sample\"\n)\n\nputs(response)"
+ }
+ },
+ {
+ "title": "Score an audio response",
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"grader\": {\n \"type\": \"score_model\",\n \"name\": \"Audio clarity grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Listen to the clip and return a confidence score from 0 to 1 that the speaker said: {{item.target_phrase}}\"\n },\n {\n \"type\": \"input_audio\",\n \"input_audio\": {\n \"data\": \"{{item.audio_clip_b64}}\",\n \"format\": \"mp3\"\n }\n }\n ]\n }\n ],\n \"model\": \"gpt-audio\",\n \"sampling_params\": {\n \"temperature\": 0.2,\n \"top_p\": 1,\n \"seed\": 123\n }\n },\n \"item\": {\n \"target_phrase\": \"Please deliver the package on Tuesday\",\n \"audio_clip_b64\": \"\"\n },\n \"model_sample\": \"Please deliver the package on Tuesday\"\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.run({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n model_sample: 'model_sample',\n});\n\nconsole.log(response.metadata);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.run(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n model_sample=\"model_sample\",\n)\nprint(response.metadata)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{\n\t\tGrader: openai.FineTuningAlphaGraderRunParamsGraderUnion{\n\t\t\tOfStringCheck: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t\tModelSample: \"model_sample\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.Metadata)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderRunParams;\nimport com.openai.models.finetuning.alpha.graders.GraderRunResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderRunParams params = GraderRunParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .modelSample(\"model_sample\")\n .build();\n GraderRunResponse response = client.fineTuning().alpha().graders().run(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.run(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check},\n model_sample: \"model_sample\"\n)\n\nputs(response)"
+ }
}
- }
- ],
+ ]
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/alpha/graders/validate": {
+ "post": {
+ "operationId": "Graders_validateGrader",
+ "summary": "Validate a grader",
+ "description": "Validates a grader.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Schedule"
- }
- }
- }
- },
- "201": {
- "description": "The request has succeeded and a new resource has been created as a result.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Schedule"
+ "$ref": "#/components/schemas/OpenAI.ValidateGraderResponse"
}
}
}
},
"4XX": {
"description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
},
"5XX": {
"description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
}
},
"tags": [
- "Schedules"
+ "Fine-tuning"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Schedule"
+ "$ref": "#/components/schemas/OpenAI.ValidateGraderRequest"
}
}
},
- "description": "The resource instance."
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Validate grader",
+ "beta": true,
+ "group": "graders",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/alpha/graders/validate \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.validate({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n});\n\nconsole.log(response.grader);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.validate(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n)\nprint(response.grader)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Validate(context.TODO(), openai.FineTuningAlphaGraderValidateParams{\n\t\tGrader: openai.FineTuningAlphaGraderValidateParamsGraderUnion{\n\t\t\tOfStringCheckGrader: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.Grader)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderValidateParams;\nimport com.openai.models.finetuning.alpha.graders.GraderValidateResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderValidateParams params = GraderValidateParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .build();\n GraderValidateResponse response = client.fineTuning().alpha().graders().validate(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.validate(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check}\n)\n\nputs(response)"
+ },
+ "response": "{\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n}\n"
+ }
}
}
},
- "/schedules/{id}/runs": {
+ "/openai/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions": {
"get": {
- "operationId": "Schedules_listRuns",
- "summary": "List schedule runs",
- "description": "Returns schedule runs that match the supplied filters.",
+ "operationId": "FineTuning_listFineTuningCheckpointPermissions",
+ "summary": "List fine tuning checkpoint permissions",
+ "description": "Lists fine tuning checkpoint permissions matching the request filters.",
"parameters": [
{
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
- {
- "name": "id",
+ "name": "fine_tuned_model_checkpoint",
"in": "path",
"required": true,
- "description": "Identifier of the schedule.",
+ "description": "The ID of the fine-tuned model checkpoint to get permissions for.",
"schema": {
"type": "string"
}
},
{
- "name": "type",
+ "name": "project_id",
"in": "query",
"required": false,
- "description": "Filter by the type of schedule.",
+ "description": "The ID of the project to get permissions for.",
"schema": {
- "$ref": "#/components/schemas/ScheduleTaskType"
- },
- "explode": false
+ "type": "string"
+ }
},
{
- "name": "enabled",
+ "name": "after",
"in": "query",
"required": false,
- "description": "Filter by the enabled status.",
+ "description": "Identifier for the last permission ID from the previous pagination request.",
"schema": {
- "type": "boolean"
+ "type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of permissions to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 10
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "The order in which to retrieve permissions.",
"schema": {
"type": "string",
"enum": [
- "Schedules=V1Preview"
- ]
+ "ascending",
+ "descending"
+ ],
+ "default": "descending"
}
}
],
@@ -14872,100 +15271,65 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/PagedScheduleRun"
+ "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse"
}
}
}
},
"4XX": {
"description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
},
"5XX": {
"description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
}
},
"tags": [
- "Schedules"
- ]
- }
- },
- "/schedules/{schedule_id}/runs/{run_id}": {
- "get": {
- "operationId": "Schedules_getRun",
- "summary": "Get a schedule run",
- "description": "Retrieves the specified run for a schedule.",
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "List checkpoint permissions",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst permission = await client.fineTuning.checkpoints.permissions.retrieve(\n 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',\n);\n\nconsole.log(permission.first_id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npermission = client.fine_tuning.checkpoints.permissions.retrieve(\n fine_tuned_model_checkpoint=\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(permission.first_id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpermission, err := client.FineTuning.Checkpoints.Permissions.Get(\n\t\tcontext.TODO(),\n\t\t\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n\t\topenai.FineTuningCheckpointPermissionGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", permission.FirstID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveParams;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PermissionRetrieveResponse permission = client.fineTuning().checkpoints().permissions().retrieve(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npermission = openai.fine_tuning.checkpoints.permissions.retrieve(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(permission)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n },\n {\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_enQCFmOTGj3syEpYVhBRLTSy\",\n \"created_at\": 1721764800,\n \"project_id\": \"proj_iqGMw1llN8IrBb6SvvY5A1oF\"\n },\n ],\n \"first_id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"cp_enQCFmOTGj3syEpYVhBRLTSy\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "FineTuning_createFineTuningCheckpointPermission",
+ "summary": "Create a fine tuning checkpoint permission",
+ "description": "Creates a fine tuning checkpoint permission from the supplied request.",
"parameters": [
{
- "name": "schedule_id",
- "in": "path",
- "required": true,
- "description": "The unique identifier of the schedule.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
+ "name": "fine_tuned_model_checkpoint",
"in": "path",
"required": true,
- "description": "The unique identifier of the schedule run.",
+ "description": "The ID of the fine-tuned model checkpoint to create a permission for.",
"schema": {
"type": "string"
}
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
- }
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
}
],
"responses": {
@@ -14974,7 +15338,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ScheduleRun"
+ "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse"
}
}
}
@@ -15001,79 +15365,59 @@
}
},
"tags": [
- "Schedules"
- ]
+ "Fine-tuning"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create checkpoint permissions",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n -d '{\"project_ids\": [\"proj_abGMw1llN8IrBb6SvvY5A1iH\"]}'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const permissionCreateResponse of client.fineTuning.checkpoints.permissions.create(\n 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd',\n { project_ids: ['string'] },\n)) {\n console.log(permissionCreateResponse.id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.checkpoints.permissions.create(\n fine_tuned_model_checkpoint=\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n project_ids=[\"string\"],\n)\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Checkpoints.Permissions.New(\n\t\tcontext.TODO(),\n\t\t\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n\t\topenai.FineTuningCheckpointPermissionNewParams{\n\t\t\tProjectIDs: []string{\"string\"},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionCreatePage;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PermissionCreateParams params = PermissionCreateParams.builder()\n .fineTunedModelCheckpoint(\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\")\n .addProjectId(\"string\")\n .build();\n PermissionCreatePage page = client.fineTuning().checkpoints().permissions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.fine_tuning.checkpoints.permissions.create(\n \"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n project_ids: [\"string\"]\n)\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n }\n ],\n \"first_id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"has_more\": false\n}\n"
+ }
+ }
}
},
- "/skills": {
- "get": {
- "operationId": "Skills_listSkills",
- "summary": "List skills",
- "description": "Returns the skills available in the current project.",
+ "/openai/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}": {
+ "delete": {
+ "operationId": "FineTuning_deleteFineTuningCheckpointPermission",
+ "summary": "Delete a fine tuning checkpoint permission",
+ "description": "Deletes a fine tuning checkpoint permission by its identifier.",
"parameters": [
{
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
- },
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
- },
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "Foundry-Features",
- "in": "header",
+ "name": "fine_tuned_model_checkpoint",
+ "in": "path",
"required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "description": "The ID of the fine-tuned model checkpoint to delete a permission for.",
"schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
+ "type": "string"
}
},
{
- "name": "api-version",
- "in": "query",
+ "name": "permission_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the fine-tuned model checkpoint permission to delete.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
@@ -15082,33 +15426,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Skill"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse"
}
}
}
@@ -15135,51 +15453,69 @@
}
},
"tags": [
- "Skills"
+ "Fine-tuning"
],
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Delete checkpoint permission",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions/cp_zc4Q7MP6XxulcVzj4MZdwsAB \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst permission = await client.fineTuning.checkpoints.permissions.delete(\n 'cp_zc4Q7MP6XxulcVzj4MZdwsAB',\n { fine_tuned_model_checkpoint: 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd' },\n);\n\nconsole.log(permission.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npermission = client.fine_tuning.checkpoints.permissions.delete(\n permission_id=\"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n fine_tuned_model_checkpoint=\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n)\nprint(permission.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpermission, err := client.FineTuning.Checkpoints.Permissions.Delete(\n\t\tcontext.TODO(),\n\t\t\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n\t\t\"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", permission.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteParams;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PermissionDeleteParams params = PermissionDeleteParams.builder()\n .fineTunedModelCheckpoint(\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\")\n .permissionId(\"cp_zc4Q7MP6XxulcVzj4MZdwsAB\")\n .build();\n PermissionDeleteResponse permission = client.fineTuning().checkpoints().permissions().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npermission = openai.fine_tuning.checkpoints.permissions.delete(\n \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n fine_tuned_model_checkpoint: \"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\"\n)\n\nputs(permission)"
+ },
+ "response": "{\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"deleted\": true\n}\n"
+ }
}
}
},
- "/skills/{name}": {
+ "/openai/v1/fine_tuning/jobs": {
"get": {
- "operationId": "Skills_getSkill",
- "summary": "Retrieve a skill",
- "description": "Retrieves the specified skill and its current configuration.",
+ "operationId": "FineTuning_listPaginatedFineTuningJobs",
+ "summary": "List paginated fine tuning jobs",
+ "description": "Lists paginated fine tuning jobs matching the request filters.",
"parameters": [
{
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The unique name of the skill.",
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last job from the previous pagination request.",
"schema": {
- "$ref": "#/components/schemas/SkillName"
- }
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
},
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of fine-tuning jobs to retrieve.",
"schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
+ "$ref": "#/components/schemas/integer",
+ "default": 20
}
},
{
- "name": "api-version",
+ "name": "metadata",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to indicate no metadata.",
"schema": {
- "type": "string"
- },
- "explode": false
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
}
],
"responses": {
@@ -15188,7 +15524,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Skill"
+ "$ref": "#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse"
}
}
}
@@ -15215,58 +15551,38 @@
}
},
"tags": [
- "Skills"
+ "Fine-tuning"
],
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
- }
- },
- "post": {
- "operationId": "updateSkill",
- "summary": "Update a skill",
- "description": "Modifies the specified skill's configuration.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill to update.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
+ "x-oaiMeta": {
+ "name": "List fine-tuning jobs",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs?limit=2&metadata[key]=value \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.jobs.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.fineTuning.jobs.list();\n\n for await (const fineTune of list) {\n console.log(fineTune);\n }\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fineTuningJob of client.fineTuning.jobs.list()) {\n console.log(fineTuningJob.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Jobs.List(context.TODO(), openai.FineTuningJobListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.JobListPage;\nimport com.openai.models.finetuning.jobs.JobListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobListPage page = client.fineTuning().jobs().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.fine_tuning.jobs.list\n\nputs(page)"
},
- "explode": false
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n { ... },\n { ... }\n ], \"has_more\": true\n}\n"
}
- ],
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "FineTuning_createFineTuningJob",
+ "summary": "Create a fine tuning job",
+ "description": "Creates a fine tuning job from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Skill"
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
}
}
}
@@ -15293,68 +15609,116 @@
}
},
"tags": [
- "Skills"
+ "Fine-tuning"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "type": "object",
- "properties": {
- "default_version": {
- "type": "string",
- "description": "The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest."
- }
- },
- "required": [
- "default_version"
- ]
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequest"
}
}
- }
+ },
+ "description": "The request body."
},
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
+ "x-oaiMeta": {
+ "name": "Create fine-tuning job",
+ "group": "fine-tuning",
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-BK7bzQj3FfZFXr7DbL6xJwfo\",\n \"model\": \"gpt-4o-mini\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.create({\n training_file: \"file-abc123\"\n });\n\n console.log(fineTune);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n }\n }\n },\n \"metadata\": null\n}\n"
+ },
+ {
+ "title": "Epochs",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"model\": \"gpt-4o-mini\",\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 2\n }\n }\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\nimport { SupervisedMethod, SupervisedHyperparameters } from \"openai/resources/fine-tuning/methods\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.create({\n training_file: \"file-abc123\",\n model: \"gpt-4o-mini\",\n method: {\n type: \"supervised\",\n supervised: {\n hyperparameters: {\n n_epochs: 2\n }\n }\n }\n });\n\n console.log(fineTune);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": 2\n },\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": 2\n }\n }\n },\n \"metadata\": null,\n \"error\": {\n \"code\": null,\n \"message\": null,\n \"param\": null\n },\n \"finished_at\": null,\n \"seed\": 683058546,\n \"trained_tokens\": null,\n \"estimated_finish\": null,\n \"integrations\": [],\n \"user_provided_suffix\": null,\n \"usage_metrics\": null,\n \"shared_with_openai\": false\n}\n"
+ },
+ {
+ "title": "DPO",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"validation_file\": \"file-abc123\",\n \"model\": \"gpt-4o-mini\",\n \"method\": {\n \"type\": \"dpo\",\n \"dpo\": {\n \"hyperparameters\": {\n \"beta\": 0.1\n }\n }\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc\",\n \"model\": \"gpt-4o-mini\",\n \"created_at\": 1746130590,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-abc\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-123\",\n \"training_file\": \"file-abc\",\n \"method\": {\n \"type\": \"dpo\",\n \"dpo\": {\n \"hyperparameters\": {\n \"beta\": 0.1,\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\"\n }\n }\n },\n \"metadata\": null,\n \"error\": {\n \"code\": null,\n \"message\": null,\n \"param\": null\n },\n \"finished_at\": null,\n \"hyperparameters\": null,\n \"seed\": 1036326793,\n \"estimated_finish\": null,\n \"integrations\": [],\n \"user_provided_suffix\": null,\n \"usage_metrics\": null,\n \"shared_with_openai\": false\n}\n"
+ },
+ {
+ "title": "Reinforcement",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc\",\n \"validation_file\": \"file-123\",\n \"model\": \"o4-mini\",\n \"method\": {\n \"type\": \"reinforcement\",\n \"reinforcement\": {\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n },\n \"hyperparameters\": {\n \"reasoning_effort\": \"medium\"\n }\n }\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"o4-mini\",\n \"created_at\": 1721764800,\n \"finished_at\": null,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"validating_files\",\n \"validation_file\": \"file-123\",\n \"training_file\": \"file-abc\",\n \"trained_tokens\": null,\n \"error\": {},\n \"user_provided_suffix\": null,\n \"seed\": 950189191,\n \"estimated_finish\": null,\n \"integrations\": [],\n \"method\": {\n \"type\": \"reinforcement\",\n \"reinforcement\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n \"eval_interval\": \"auto\",\n \"eval_samples\": \"auto\",\n \"compute_multiplier\": \"auto\",\n \"reasoning_effort\": \"medium\"\n },\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n },\n \"response_format\": null\n }\n },\n \"metadata\": null,\n \"usage_metrics\": null,\n \"shared_with_openai\": false\n}\n\n"
+ },
+ {
+ "title": "Validation file",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"validation_file\": \"file-abc123\",\n \"model\": \"gpt-4o-mini\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.create({\n training_file: \"file-abc123\",\n validation_file: \"file-abc123\"\n });\n\n console.log(fineTune);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\",\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n }\n }\n },\n \"metadata\": null\n}\n"
+ },
+ {
+ "title": "W&B Integration",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"validation_file\": \"file-abc123\",\n \"model\": \"gpt-4o-mini\",\n \"integrations\": [\n {\n \"type\": \"wandb\",\n \"wandb\": {\n \"project\": \"my-wandb-project\",\n \"name\": \"ft-run-display-name\"\n \"tags\": [\n \"first-experiment\", \"v2\"\n ]\n }\n }\n ]\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\",\n \"integrations\": [\n {\n \"type\": \"wandb\",\n \"wandb\": {\n \"project\": \"my-wandb-project\",\n \"entity\": None,\n \"run_id\": \"ftjob-abc123\"\n }\n }\n ],\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n }\n }\n },\n \"metadata\": null\n}\n"
+ }
]
}
- },
- "delete": {
- "operationId": "Skills_deleteSkill",
- "summary": "Delete a skill",
- "description": "Removes the specified skill and its associated versions.",
+ }
+ },
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}": {
+ "get": {
+ "operationId": "FineTuning_retrieveFineTuningJob",
+ "summary": "Get a fine tuning job",
+ "description": "Retrieves a fine tuning job by its identifier.",
"parameters": [
{
- "name": "name",
+ "name": "fine_tuning_job_id",
"in": "path",
"required": true,
- "description": "The unique name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the fine-tuning job.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
@@ -15363,7 +15727,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteSkillResponse"
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
}
}
}
@@ -15390,60 +15754,49 @@
}
},
"tags": [
- "Skills"
+ "Fine-tuning"
],
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Retrieve fine-tuning job",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.retrieve(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.retrieve(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.retrieve('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Get(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().retrieve(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.retrieve(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n }\n}\n"
+ }
}
}
},
- "/skills/{name}/content": {
- "get": {
- "operationId": "getSkillContent",
- "summary": "Download the zip content for the default version of a skill",
- "description": "Downloads the zip content for the default version of a skill.",
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel": {
+ "post": {
+ "operationId": "FineTuning_cancelFineTuningJob",
+ "summary": "Cancel a fine tuning job",
+ "description": "Cancels a fine tuning job by its identifier.",
"parameters": [
{
- "name": "name",
+ "name": "fine_tuning_job_id",
"in": "path",
"required": true,
- "description": "The name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the fine-tuning job to cancel.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
"200": {
- "description": "The response body for downloading a skill package.",
+ "description": "The request has succeeded.",
"content": {
- "application/zip": {
+ "application/json": {
"schema": {
- "contentMediaType": "application/zip"
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
}
}
}
@@ -15470,60 +15823,69 @@
}
},
"tags": [
- "Skills"
+ "Fine-tuning"
],
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Cancel fine-tuning",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.cancel(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.cancel(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.cancel('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Cancel(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().cancel(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.cancel(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"cancelled\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\"\n}\n"
+ }
}
}
},
- "/skills/{name}/versions": {
- "post": {
- "operationId": "createSkillVersion_createSkillVersionFromFiles",
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints": {
+ "get": {
+ "operationId": "FineTuning_listFineTuningJobCheckpoints",
+ "summary": "List fine tuning job checkpoints",
+ "description": "Lists fine tuning job checkpoints matching the request filters.",
"parameters": [
{
- "name": "name",
+ "name": "fine_tuning_job_id",
"in": "path",
"required": true,
- "description": "The name of the skill. If the skill does not exist, it will be created.",
+ "description": "The ID of the fine-tuning job to get checkpoints for.",
"schema": {
- "$ref": "#/components/schemas/SkillName"
+ "type": "string"
}
},
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last checkpoint ID from the previous pagination request.",
"schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
},
{
- "name": "api-version",
+ "name": "limit",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "Number of checkpoints to retrieve.",
"schema": {
- "type": "string"
- },
- "explode": false
+ "$ref": "#/components/schemas/integer",
+ "default": 10
+ }
}
],
- "description": "Creates a new version of a skill. If the skill does not exist, it will be created. Creates a new version of a skill from uploaded files via multipart form data.",
- "summary": "Create a new version of a skill Create a skill version from uploaded files",
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/SkillVersion"
+ "$ref": "#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse"
}
}
}
@@ -15549,127 +15911,61 @@
}
}
},
- "x-ms-description-override": "Creates a new version of a skill. If the skill does not exist, it will be created.",
- "x-ms-summary-override": "Create a new version of a skill",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
- },
"tags": [
- "Skills"
+ "Fine-tuning"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "inline_content": {
- "$ref": "#/components/schemas/SkillInlineContent",
- "description": "Inline skill content for simple skills without file uploads. Foundry-specific extension."
- },
- "default": {
- "type": "boolean",
- "description": "Whether to set this version as the default."
- }
- }
- }
+ "x-oaiMeta": {
+ "name": "List fine-tuning checkpoints",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/checkpoints \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list(\n 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',\n)) {\n console.log(fineTuningJobCheckpoint.id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.jobs.checkpoints.list(\n fine_tuning_job_id=\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Jobs.Checkpoints.List(\n\t\tcontext.TODO(),\n\t\t\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n\t\topenai.FineTuningJobCheckpointListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.checkpoints.CheckpointListPage;\nimport com.openai.models.finetuning.jobs.checkpoints.CheckpointListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n CheckpointListPage page = client.fineTuning().jobs().checkpoints().list(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.fine_tuning.jobs.checkpoints.list(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(page)"
},
- "multipart/form-data": {
- "schema": {
- "$ref": "#/components/schemas/CreateSkillVersionFromFilesBody"
- },
- "encoding": {
- "files": {
- "contentType": "*/*"
- },
- "default": {
- "contentType": "text/plain"
- }
- }
- }
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000\",\n \"metrics\": {\n \"full_valid_loss\": 0.134,\n \"full_valid_mean_token_accuracy\": 0.874\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 2000\n },\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"created_at\": 1721764800,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000\",\n \"metrics\": {\n \"full_valid_loss\": 0.167,\n \"full_valid_mean_token_accuracy\": 0.781\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 1000\n }\n ],\n \"first_id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"has_more\": true\n}\n"
}
- }
- },
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/events": {
"get": {
- "operationId": "listSkillVersions",
- "summary": "List skill versions",
- "description": "Returns the available versions for the specified skill.",
+ "operationId": "FineTuning_listFineTuningEvents",
+ "summary": "List fine tuning events",
+ "description": "Lists fine tuning events matching the request filters.",
"parameters": [
{
- "name": "name",
+ "name": "fine_tuning_job_id",
"in": "path",
"required": true,
- "description": "The name of the skill to list versions for.",
+ "description": "The ID of the fine-tuning job to get events for.",
"schema": {
- "$ref": "#/components/schemas/SkillName"
+ "type": "string"
}
},
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
- },
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
- },
{
"name": "after",
"in": "query",
"required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "description": "Identifier for the last event from the previous pagination request.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
- "name": "before",
+ "name": "limit",
"in": "query",
"required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "description": "Number of events to retrieve.",
"schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
+ "$ref": "#/components/schemas/integer",
+ "default": 20
}
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
}
],
"responses": {
@@ -15678,33 +15974,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/SkillVersion"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ListFineTuningJobEventsResponse"
}
}
}
@@ -15731,60 +16001,41 @@
}
},
"tags": [
- "Skills"
+ "Fine-tuning"
],
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
- }
+ "x-oaiMeta": {
+ "name": "List fine-tuning events",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/events \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.jobs.list_events(\n fine_tuning_job_id=\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.fineTuning.list_events(id=\"ftjob-abc123\", limit=2);\n\n for await (const fineTune of list) {\n console.log(fineTune);\n }\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fineTuningJobEvent of client.fineTuning.jobs.listEvents(\n 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',\n)) {\n console.log(fineTuningJobEvent.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Jobs.ListEvents(\n\t\tcontext.TODO(),\n\t\t\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n\t\topenai.FineTuningJobListEventsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.JobListEventsPage;\nimport com.openai.models.finetuning.jobs.JobListEventsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobListEventsPage page = client.fineTuning().jobs().listEvents(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.fine_tuning.jobs.list_events(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ft-event-ddTJfwuMVpfLXseO0Am0Gqjm\",\n \"created_at\": 1721764800,\n \"level\": \"info\",\n \"message\": \"Fine tuning job successfully completed\",\n \"data\": null,\n \"type\": \"message\"\n },\n {\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ft-event-tyiGuB72evQncpH87xe505Sv\",\n \"created_at\": 1721764800,\n \"level\": \"info\",\n \"message\": \"New fine-tuned model created: ft:gpt-4o-mini:openai::7p4lURel\",\n \"data\": null,\n \"type\": \"message\"\n }\n ],\n \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
}
},
- "/skills/{name}/versions/{version}": {
- "get": {
- "operationId": "getSkillVersion",
- "summary": "Retrieve a specific version of a skill",
- "description": "Retrieves the specified version of a skill by name and version identifier.",
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause": {
+ "post": {
+ "operationId": "FineTuning_pauseFineTuningJob",
+ "summary": "Pause a fine tuning job",
+ "description": "Pauses a fine tuning job.",
"parameters": [
{
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
- {
- "name": "version",
+ "name": "fine_tuning_job_id",
"in": "path",
"required": true,
- "description": "The version identifier to retrieve.",
+ "description": "The ID of the fine-tuning job to pause.",
"schema": {
"type": "string"
}
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
}
],
"responses": {
@@ -15793,7 +16044,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/SkillVersion"
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
}
}
}
@@ -15820,58 +16071,40 @@
}
},
"tags": [
- "Skills"
+ "Fine-tuning"
],
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Pause fine-tuning",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/pause \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.pause(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.pause(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.pause('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Pause(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobPauseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().pause(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.pause(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"paused\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\"\n}\n"
+ }
}
- },
- "delete": {
- "operationId": "deleteSkillVersion",
- "summary": "Delete a specific version of a skill",
- "description": "Removes the specified version of a skill.",
+ }
+ },
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume": {
+ "post": {
+ "operationId": "FineTuning_resumeFineTuningJob",
+ "summary": "Resume a fine tuning job",
+ "description": "Resumes a fine tuning job.",
"parameters": [
{
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
- {
- "name": "version",
+ "name": "fine_tuning_job_id",
"in": "path",
"required": true,
- "description": "The version identifier to delete.",
+ "description": "The ID of the fine-tuning job to resume.",
"schema": {
"type": "string"
}
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
}
],
"responses": {
@@ -15880,7 +16113,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteSkillVersionResponse"
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
}
}
}
@@ -15907,69 +16140,168 @@
}
},
"tags": [
- "Skills"
+ "Fine-tuning"
],
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
+ "x-oaiMeta": {
+ "name": "Resume fine-tuning",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/resume \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.resume(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.resume(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.resume('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Resume(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobResumeParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().resume(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.resume(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\"\n}\n"
+ }
}
}
},
- "/skills/{name}/versions/{version}/content": {
- "get": {
- "operationId": "getSkillVersionContent",
- "summary": "Download the zip content for a specific version of a skill",
- "description": "Downloads the zip content for a specific version of a skill.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
+ "/openai/v1/images/edits": {
+ "post": {
+ "operationId": "Images_createImageEditMultipart_Images_createImageEditJson",
+ "parameters": [],
+ "description": "Creates an image edit multipart from the supplied request. Creates an image edit json from the supplied request.",
+ "summary": "Create an image edit multipart Create an image edit json",
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ImagesResponse"
+ }
+ }
}
},
- {
- "name": "version",
- "in": "path",
- "required": true,
- "description": "The version to download content for.",
- "schema": {
- "type": "string"
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
}
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
}
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
}
+ },
+ "x-ms-request-body-description-override": "The request body.",
+ "x-oaiMeta": {
+ "name": "Create image edit",
+ "group": "images",
+ "examples": [
+ {
+ "title": "Edit image",
+ "request": {
+ "curl": "curl -s -D >(grep -i x-request-id >&2) \\\n -o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) \\\n -X POST \"https://api.openai.com/v1/images/edits\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"model=gpt-image-1.5\" \\\n -F \"image[]=@body-lotion.png\" \\\n -F \"image[]=@bath-bomb.png\" \\\n -F \"image[]=@incense-kit.png\" \\\n -F \"image[]=@soap.png\" \\\n -F 'prompt=Create a lovely gift basket with these four items in it'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor image in client.images.edit(\n image=b\"Example data\",\n prompt=\"A cute baby sea otter wearing a beret\",\n):\n print(image)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI, { toFile } from \"openai\";\n\nconst client = new OpenAI();\n\nconst imageFiles = [\n \"bath-bomb.png\",\n \"body-lotion.png\",\n \"incense-kit.png\",\n \"soap.png\",\n];\n\nconst images = await Promise.all(\n imageFiles.map(async (file) =>\n await toFile(fs.createReadStream(file), null, {\n type: \"image/png\",\n })\n ),\n);\n\nconst rsp = await client.images.edit({\n model: \"gpt-image-1.5\",\n image: images,\n prompt: \"Create a lovely gift basket with these four items in it\",\n});\n\n// Save the image to a file\nconst image_base64 = rsp.data[0].b64_json;\nconst image_bytes = Buffer.from(image_base64, \"base64\");\nfs.writeFileSync(\"basket.png\", image_bytes);\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.edit({\n image: fs.createReadStream('path/to/file'),\n prompt: 'A cute baby sea otter wearing a beret',\n});\n\nconsole.log(imagesResponse);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{\n\t\tImage: openai.ImageEditParamsImageUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t\tPrompt: \"A cute baby sea otter wearing a beret\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageEditParams;\nimport com.openai.models.images.ImagesResponse;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageEditParams params = ImageEditParams.builder()\n .image(new ByteArrayInputStream(\"Example data\".getBytes()))\n .prompt(\"A cute baby sea otter wearing a beret\")\n .build();\n ImagesResponse imagesResponse = client.images().edit(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.edit(image: StringIO.new(\"Example data\"), prompt: \"A cute baby sea otter wearing a beret\")\n\nputs(images_response)"
+ }
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl -s -N -X POST \"https://api.openai.com/v1/images/edits\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"model=gpt-image-1.5\" \\\n -F \"image[]=@body-lotion.png\" \\\n -F \"image[]=@bath-bomb.png\" \\\n -F \"image[]=@incense-kit.png\" \\\n -F \"image[]=@soap.png\" \\\n -F 'prompt=Create a lovely gift basket with these four items in it' \\\n -F \"stream=true\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor image in client.images.edit(\n image=b\"Example data\",\n prompt=\"A cute baby sea otter wearing a beret\",\n):\n print(image)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI, { toFile } from \"openai\";\n\nconst client = new OpenAI();\n\nconst imageFiles = [\n \"bath-bomb.png\",\n \"body-lotion.png\",\n \"incense-kit.png\",\n \"soap.png\",\n];\n\nconst images = await Promise.all(\n imageFiles.map(async (file) =>\n await toFile(fs.createReadStream(file), null, {\n type: \"image/png\",\n })\n ),\n);\n\nconst stream = await client.images.edit({\n model: \"gpt-image-1.5\",\n image: images,\n prompt: \"Create a lovely gift basket with these four items in it\",\n stream: true,\n});\n\nfor await (const event of stream) {\n console.log(event);\n}\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.edit({\n image: fs.createReadStream('path/to/file'),\n prompt: 'A cute baby sea otter wearing a beret',\n});\n\nconsole.log(imagesResponse);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{\n\t\tImage: openai.ImageEditParamsImageUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t\tPrompt: \"A cute baby sea otter wearing a beret\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageEditParams;\nimport com.openai.models.images.ImagesResponse;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageEditParams params = ImageEditParams.builder()\n .image(new ByteArrayInputStream(\"Example data\".getBytes()))\n .prompt(\"A cute baby sea otter wearing a beret\")\n .build();\n ImagesResponse imagesResponse = client.images().edit(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.edit(image: StringIO.new(\"Example data\"), prompt: \"A cute baby sea otter wearing a beret\")\n\nputs(images_response)"
+ },
+ "response": "event: image_edit.partial_image\ndata: {\"type\":\"image_edit.partial_image\",\"b64_json\":\"...\",\"partial_image_index\":0}\n\nevent: image_edit.completed\ndata: {\"type\":\"image_edit.completed\",\"b64_json\":\"...\",\"usage\":{\"total_tokens\":100,\"input_tokens\":50,\"output_tokens\":50,\"input_tokens_details\":{\"text_tokens\":10,\"image_tokens\":40}}}\n"
+ }
+ ]
+ },
+ "tags": [
+ "Images"
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateImageEditRequest"
+ },
+ "encoding": {
+ "image": {
+ "contentType": "application/octet-stream, application/json"
+ },
+ "background": {
+ "contentType": "application/json"
+ },
+ "model": {
+ "contentType": "application/json"
+ },
+ "n": {
+ "contentType": "application/json"
+ },
+ "size": {
+ "contentType": "application/json"
+ },
+ "response_format": {
+ "contentType": "application/json"
+ },
+ "output_format": {
+ "contentType": "application/json"
+ },
+ "output_compression": {
+ "contentType": "application/json"
+ },
+ "input_fidelity": {
+ "contentType": "application/json"
+ },
+ "stream": {
+ "contentType": "application/json"
+ },
+ "partial_images": {
+ "contentType": "application/json"
+ },
+ "quality": {
+ "contentType": "application/json"
+ }
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.EditImageBodyJsonParam"
+ }
+ }
+ },
+ "description": "The multipart request body. The request body."
+ }
+ }
+ },
+ "/openai/v1/images/generations": {
+ "post": {
+ "operationId": "Images_createImage",
+ "summary": "Create an image",
+ "description": "Creates an image from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
- "description": "The response body for downloading a skill package.",
+ "description": "The request has succeeded.",
"content": {
- "application/zip": {
+ "application/json": {
"schema": {
- "contentMediaType": "application/zip"
+ "$ref": "#/components/schemas/OpenAI.ImagesResponse"
}
}
}
@@ -15996,107 +16328,151 @@
}
},
"tags": [
- "Skills"
+ "Images"
],
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateImageRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create image",
+ "group": "images",
+ "examples": [
+ {
+ "title": "Generate image",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/images/generations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-image-1.5\",\n \"prompt\": \"A cute baby sea otter\",\n \"n\": 1,\n \"size\": \"1024x1024\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor image in client.images.generate(\n prompt=\"A cute baby sea otter\",\n):\n print(image)",
+ "javascript": "import OpenAI from \"openai\";\nimport { writeFile } from \"fs/promises\";\n\nconst client = new OpenAI();\n\nconst img = await client.images.generate({\n model: \"gpt-image-1.5\",\n prompt: \"A cute baby sea otter\",\n n: 1,\n size: \"1024x1024\"\n});\n\nconst imageBuffer = Buffer.from(img.data[0].b64_json, \"base64\");\nawait writeFile(\"output.png\", imageBuffer);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });\n\nconsole.log(imagesResponse);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{\n\t\tPrompt: \"A cute baby sea otter\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageGenerateParams;\nimport com.openai.models.images.ImagesResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageGenerateParams params = ImageGenerateParams.builder()\n .prompt(\"A cute baby sea otter\")\n .build();\n ImagesResponse imagesResponse = client.images().generate(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.generate(prompt: \"A cute baby sea otter\")\n\nputs(images_response)"
+ },
+ "response": "{\n \"created\": 1713833628,\n \"data\": [\n {\n \"b64_json\": \"...\"\n }\n ],\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \"image_tokens\": 40\n }\n }\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/images/generations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-image-1.5\",\n \"prompt\": \"A cute baby sea otter\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"stream\": true\n }' \\\n --no-buffer\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor image in client.images.generate(\n prompt=\"A cute baby sea otter\",\n):\n print(image)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst client = new OpenAI();\n\nconst stream = await client.images.generate({\n model: \"gpt-image-1.5\",\n prompt: \"A cute baby sea otter\",\n n: 1,\n size: \"1024x1024\",\n stream: true,\n});\n\nfor await (const event of stream) {\n console.log(event);\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });\n\nconsole.log(imagesResponse);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{\n\t\tPrompt: \"A cute baby sea otter\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageGenerateParams;\nimport com.openai.models.images.ImagesResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageGenerateParams params = ImageGenerateParams.builder()\n .prompt(\"A cute baby sea otter\")\n .build();\n ImagesResponse imagesResponse = client.images().generate(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.generate(prompt: \"A cute baby sea otter\")\n\nputs(images_response)"
+ },
+ "response": "event: image_generation.partial_image\ndata: {\"type\":\"image_generation.partial_image\",\"b64_json\":\"...\",\"partial_image_index\":0}\n\nevent: image_generation.completed\ndata: {\"type\":\"image_generation.completed\",\"b64_json\":\"...\",\"usage\":{\"total_tokens\":100,\"input_tokens\":50,\"output_tokens\":50,\"input_tokens_details\":{\"text_tokens\":10,\"image_tokens\":40}}}\n"
+ }
]
}
}
},
- "/toolboxes": {
- "get": {
- "operationId": "listToolboxes",
- "summary": "List toolboxes",
- "description": "Returns the toolboxes available in the current project.",
- "parameters": [
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
- },
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
- },
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "/openai/v1/images/variations": {
+ "post": {
+ "operationId": "Images_createImageVariation",
+ "summary": "Create an image variation",
+ "description": "Creates an image variation from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ImagesResponse"
+ }
+ }
+ }
},
- {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
}
+ },
+ "tags": [
+ "Images"
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateImageVariationRequest"
+ },
+ "encoding": {
+ "model": {
+ "contentType": "application/json"
+ },
+ "n": {
+ "contentType": "application/json"
+ },
+ "response_format": {
+ "contentType": "application/json"
+ },
+ "size": {
+ "contentType": "application/json"
+ }
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create image variation",
+ "group": "images",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/images/variations \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F image=\"@otter.png\" \\\n -F n=2 \\\n -F size=\"1024x1024\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nimages_response = client.images.create_variation(\n image=b\"Example data\",\n)\nprint(images_response.created)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const image = await openai.images.createVariation({\n image: fs.createReadStream(\"otter.png\"),\n });\n\n console.log(image.data);\n}\nmain();",
+ "csharp": "using System;\n\nusing OpenAI.Images;\n\nImageClient client = new(\n model: \"dall-e-2\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nGeneratedImage image = client.GenerateImageVariation(imageFilePath: \"otter.png\");\n\nConsole.WriteLine(image.ImageUri);\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.createVariation({\n image: fs.createReadStream('otter.png'),\n});\n\nconsole.log(imagesResponse.created);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.NewVariation(context.TODO(), openai.ImageNewVariationParams{\n\t\tImage: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse.Created)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageCreateVariationParams;\nimport com.openai.models.images.ImagesResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageCreateVariationParams params = ImageCreateVariationParams.builder()\n .image(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n ImagesResponse imagesResponse = client.images().createVariation(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.create_variation(image: StringIO.new(\"Example data\"))\n\nputs(images_response)"
+ },
+ "response": "{\n \"created\": 1589478378,\n \"data\": [\n {\n \"url\": \"https://...\"\n },\n {\n \"url\": \"https://...\"\n }\n ]\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/models": {
+ "get": {
+ "operationId": "OpenAIModels_listModels",
+ "summary": "List models",
+ "description": "Lists models matching the request filters.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ToolboxObject"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ListModelsResponse"
}
}
}
@@ -16123,34 +16499,42 @@
}
},
"tags": [
- "Toolboxes"
- ]
+ "Models"
+ ],
+ "x-oaiMeta": {
+ "name": "List models",
+ "group": "models",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/models \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.models.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.models.list();\n\n for await (const model of list) {\n console.log(model);\n }\n}\nmain();",
+ "csharp": "using System;\n\nusing OpenAI.Models;\n\nOpenAIModelClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nforeach (var model in client.GetModels().Value)\n{\n Console.WriteLine(model.Id);\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const model of client.models.list()) {\n console.log(model.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Models.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.models.ModelListPage;\nimport com.openai.models.models.ModelListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ModelListPage page = client.models().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.models.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"model-id-0\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"organization-owner\"\n },\n {\n \"id\": \"model-id-1\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"organization-owner\",\n },\n {\n \"id\": \"model-id-2\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"openai\"\n },\n ]\n}\n"
+ }
+ },
+ "x-ms-list": true
}
},
- "/toolboxes/{name}": {
- "get": {
- "operationId": "getToolbox",
- "summary": "Retrieve a toolbox",
- "description": "Retrieves the specified toolbox and its current configuration.",
+ "/openai/v1/models/{model}": {
+ "delete": {
+ "operationId": "OpenAIModels_deleteModel",
+ "summary": "Delete a model",
+ "description": "Deletes a model by its identifier.",
"parameters": [
{
- "name": "name",
+ "name": "model",
"in": "path",
"required": true,
- "description": "The name of the toolbox to retrieve.",
+ "description": "The model to delete",
"schema": {
"type": "string"
}
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
}
],
"responses": {
@@ -16159,7 +16543,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ToolboxObject"
+ "$ref": "#/components/schemas/OpenAI.DeleteModelResponse"
}
}
}
@@ -16186,26 +16570,39 @@
}
},
"tags": [
- "Toolboxes"
- ]
+ "Models"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a fine-tuned model",
+ "group": "models",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/models/ft:gpt-4o-mini:acemeco:suffix:abc123 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmodel_deleted = client.models.delete(\n \"ft:gpt-4o-mini:acemeco:suffix:abc123\",\n)\nprint(model_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const model = await openai.models.delete(\"ft:gpt-4o-mini:acemeco:suffix:abc123\");\n\n console.log(model);\n}\nmain();",
+ "csharp": "using System;\nusing System.ClientModel;\n\nusing OpenAI.Models;\n\nOpenAIModelClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nClientResult success = client.DeleteModel(\"ft:gpt-4o-mini:acemeco:suffix:abc123\");\nConsole.WriteLine(success);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst modelDeleted = await client.models.delete('ft:gpt-4o-mini:acemeco:suffix:abc123');\n\nconsole.log(modelDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmodelDeleted, err := client.Models.Delete(context.TODO(), \"ft:gpt-4o-mini:acemeco:suffix:abc123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", modelDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.models.ModelDeleteParams;\nimport com.openai.models.models.ModelDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ModelDeleted modelDeleted = client.models().delete(\"ft:gpt-4o-mini:acemeco:suffix:abc123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmodel_deleted = openai.models.delete(\"ft:gpt-4o-mini:acemeco:suffix:abc123\")\n\nputs(model_deleted)"
+ },
+ "response": "{\n \"id\": \"ft:gpt-4o-mini:acemeco:suffix:abc123\",\n \"object\": \"model\",\n \"deleted\": true\n}\n"
+ }
+ }
},
- "patch": {
- "operationId": "updateToolbox",
- "summary": "Update a toolbox to point to a specific version",
- "description": "Updates the toolbox's default version pointer to the specified version.",
+ "get": {
+ "operationId": "OpenAIModels_retrieveModel",
+ "summary": "Get a model",
+ "description": "Retrieves a model by its identifier.",
"parameters": [
{
- "$ref": "#/components/parameters/UpdateToolboxRequest.name"
- },
- {
- "name": "api-version",
- "in": "query",
+ "name": "model",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the model to use for this request",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
@@ -16214,7 +16611,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ToolboxObject"
+ "$ref": "#/components/schemas/OpenAI.Model"
}
}
}
@@ -16241,47 +16638,139 @@
}
},
"tags": [
- "Toolboxes"
+ "Models"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve model",
+ "group": "models",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/models/VAR_chat_model_id \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmodel = client.models.retrieve(\n \"gpt-4o-mini\",\n)\nprint(model.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const model = await openai.models.retrieve(\"VAR_chat_model_id\");\n\n console.log(model);\n}\n\nmain();",
+ "csharp": "using System;\nusing System.ClientModel;\n\nusing OpenAI.Models;\n\n OpenAIModelClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nClientResult model = client.GetModel(\"babbage-002\");\nConsole.WriteLine(model.Value.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst model = await client.models.retrieve('gpt-4o-mini');\n\nconsole.log(model.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmodel, err := client.Models.Get(context.TODO(), \"gpt-4o-mini\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", model.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.models.Model;\nimport com.openai.models.models.ModelRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Model model = client.models().retrieve(\"gpt-4o-mini\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmodel = openai.models.retrieve(\"gpt-4o-mini\")\n\nputs(model)"
+ },
+ "response": "{\n \"id\": \"VAR_chat_model_id\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"openai\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/moderations": {
+ "post": {
+ "operationId": "Moderations_createModeration",
+ "summary": "Create a moderation",
+ "description": "Creates a moderation from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Moderations"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateToolboxRequest"
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequest"
}
}
- }
- }
- },
- "delete": {
- "operationId": "deleteToolbox",
- "summary": "Delete a toolbox",
- "description": "Removes the specified toolbox along with all of its versions.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the toolbox to delete.",
- "schema": {
- "type": "string"
- }
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create moderation",
+ "group": "moderations",
+ "examples": [
+ {
+ "title": "Single string",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/moderations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"input\": \"I want to kill them.\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmoderation = client.moderations.create(\n input=\"I want to kill them.\",\n)\nprint(moderation.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const moderation = await openai.moderations.create({ input: \"I want to kill them.\" });\n\n console.log(moderation);\n}\nmain();\n",
+ "csharp": "using System;\nusing System.ClientModel;\n\nusing OpenAI.Moderations;\n\nModerationClient client = new(\n model: \"omni-moderation-latest\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nClientResult moderation = client.ClassifyText(\"I want to kill them.\");\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst moderation = await client.moderations.create({ input: 'I want to kill them.' });\n\nconsole.log(moderation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmoderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{\n\t\tInput: openai.ModerationNewParamsInputUnion{\n\t\t\tOfString: openai.String(\"I want to kill them.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", moderation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.moderations.ModerationCreateParams;\nimport com.openai.models.moderations.ModerationCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ModerationCreateParams params = ModerationCreateParams.builder()\n .input(\"I want to kill them.\")\n .build();\n ModerationCreateResponse moderation = client.moderations().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmoderation = openai.moderations.create(input: \"I want to kill them.\")\n\nputs(moderation)"
+ },
+ "response": "{\n \"id\": \"modr-AB8CjOTu2jiq12hp1AQPfeqFWaORR\",\n \"model\": \"text-moderation-007\",\n \"results\": [\n {\n \"flagged\": true,\n \"categories\": {\n \"sexual\": false,\n \"hate\": false,\n \"harassment\": true,\n \"self-harm\": false,\n \"sexual/minors\": false,\n \"hate/threatening\": false,\n \"violence/graphic\": false,\n \"self-harm/intent\": false,\n \"self-harm/instructions\": false,\n \"harassment/threatening\": true,\n \"violence\": true\n },\n \"category_scores\": {\n \"sexual\": 0.000011726012417057063,\n \"hate\": 0.22706663608551025,\n \"harassment\": 0.5215635299682617,\n \"self-harm\": 2.227119921371923e-6,\n \"sexual/minors\": 7.107352217872176e-8,\n \"hate/threatening\": 0.023547329008579254,\n \"violence/graphic\": 0.00003391829886822961,\n \"self-harm/intent\": 1.646940972932498e-6,\n \"self-harm/instructions\": 1.1198755256458526e-9,\n \"harassment/threatening\": 0.5694745779037476,\n \"violence\": 0.9971134662628174\n }\n }\n ]\n}\n"
},
- "explode": false
- }
- ],
+ {
+ "title": "Image and text",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/moderations \\\n -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"omni-moderation-latest\",\n \"input\": [\n { \"type\": \"text\", \"text\": \"...text to classify goes here...\" },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/image.png\"\n }\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmoderation = client.moderations.create(\n input=\"I want to kill them.\",\n)\nprint(moderation.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nconst moderation = await openai.moderations.create({\n model: \"omni-moderation-latest\",\n input: [\n { type: \"text\", text: \"...text to classify goes here...\" },\n {\n type: \"image_url\",\n image_url: {\n url: \"https://example.com/image.png\"\n // can also use base64 encoded image URLs\n // url: \"data:image/jpeg;base64,abcdefg...\"\n }\n }\n ],\n});\n\nconsole.log(moderation);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst moderation = await client.moderations.create({ input: 'I want to kill them.' });\n\nconsole.log(moderation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmoderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{\n\t\tInput: openai.ModerationNewParamsInputUnion{\n\t\t\tOfString: openai.String(\"I want to kill them.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", moderation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.moderations.ModerationCreateParams;\nimport com.openai.models.moderations.ModerationCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ModerationCreateParams params = ModerationCreateParams.builder()\n .input(\"I want to kill them.\")\n .build();\n ModerationCreateResponse moderation = client.moderations().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmoderation = openai.moderations.create(input: \"I want to kill them.\")\n\nputs(moderation)"
+ },
+ "response": "{\n \"id\": \"modr-0d9740456c391e43c445bf0f010940c7\",\n \"model\": \"omni-moderation-latest\",\n \"results\": [\n {\n \"flagged\": true,\n \"categories\": {\n \"harassment\": true,\n \"harassment/threatening\": true,\n \"sexual\": false,\n \"hate\": false,\n \"hate/threatening\": false,\n \"illicit\": false,\n \"illicit/violent\": false,\n \"self-harm/intent\": false,\n \"self-harm/instructions\": false,\n \"self-harm\": false,\n \"sexual/minors\": false,\n \"violence\": true,\n \"violence/graphic\": true\n },\n \"category_scores\": {\n \"harassment\": 0.8189693396524255,\n \"harassment/threatening\": 0.804985420696006,\n \"sexual\": 1.573112165348997e-6,\n \"hate\": 0.007562942636942845,\n \"hate/threatening\": 0.004208854591835476,\n \"illicit\": 0.030535955153511665,\n \"illicit/violent\": 0.008925306722380033,\n \"self-harm/intent\": 0.00023023930975076432,\n \"self-harm/instructions\": 0.0002293869201073356,\n \"self-harm\": 0.012598046106750154,\n \"sexual/minors\": 2.212566909570261e-8,\n \"violence\": 0.9999992735124786,\n \"violence/graphic\": 0.843064871157054\n },\n \"category_applied_input_types\": {\n \"harassment\": [\n \"text\"\n ],\n \"harassment/threatening\": [\n \"text\"\n ],\n \"sexual\": [\n \"text\",\n \"image\"\n ],\n \"hate\": [\n \"text\"\n ],\n \"hate/threatening\": [\n \"text\"\n ],\n \"illicit\": [\n \"text\"\n ],\n \"illicit/violent\": [\n \"text\"\n ],\n \"self-harm/intent\": [\n \"text\",\n \"image\"\n ],\n \"self-harm/instructions\": [\n \"text\",\n \"image\"\n ],\n \"self-harm\": [\n \"text\",\n \"image\"\n ],\n \"sexual/minors\": [\n \"text\"\n ],\n \"violence\": [\n \"text\",\n \"image\"\n ],\n \"violence/graphic\": [\n \"text\",\n \"image\"\n ]\n }\n }\n ]\n}\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/realtime/calls": {
+ "post": {
+ "operationId": "Realtime_create-realtime-call",
+ "summary": "Create a Realtime call",
+ "description": "Creates a Realtime API call over WebRTC and returns the SDP answer needed to complete the peer connection.",
+ "parameters": [],
"responses": {
- "204": {
- "description": "There is no content to send for this request, but the headers may be useful. "
+ "201": {
+ "description": "The request has succeeded and a new resource has been created as a result.",
+ "headers": {
+ "location": {
+ "required": false,
+ "description": "The location request header.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/sdp": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
},
"4XX": {
"description": "Client error",
@@ -16305,47 +16794,57 @@
}
},
"tags": [
- "Toolboxes"
- ]
+ "Realtime"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeCallCreateRequest"
+ },
+ "encoding": {
+ "session": {
+ "contentType": "application/json"
+ }
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create call",
+ "group": "realtime",
+ "returns": "Returns `201 Created` with the SDP answer in the response body. The\n`Location` response header includes the call ID for follow-up requests,\ne.g., establishing a monitoring WebSocket or hanging up the call.",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/realtime/calls \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"sdp= inputItems =\n[\n ResponseItem.CreateUserMessageItem(\n [\n ResponseContentPart.CreateInputTextPart(\"What is in this image?\"),\n ResponseContentPart.CreateInputImagePart(new Uri(\"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"))\n ]\n )\n];\n\nOpenAIResponse response = client.CreateResponse(inputItems);\n\nConsole.WriteLine(response.GetOutputText());\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41\",\n \"object\": \"response\",\n \"created_at\": 1741476777,\n \"status\": \"completed\",\n \"completed_at\": 1741476778,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 328,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 52,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 380\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "File input",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"what is in this file?\"},\n {\n \"type\": \"input_file\",\n \"file_url\": \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\"\n }\n ]\n }\n ]\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n input: [\n {\n role: \"user\",\n content: [\n { type: \"input_text\", text: \"what is in this file?\" },\n {\n type: \"input_file\",\n file_url: \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\",\n },\n ],\n },\n ],\n});\n\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86\",\n \"object\": \"response\",\n \"created_at\": 1752100704,\n \"status\": \"completed\",\n \"completed_at\": 1752100705,\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"id\": \"msg_686eef60d3e081a29283bdcbc4322fd90e34c516d176ff86\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"The file seems to contain excerpts from a letter to the shareholders of Berkshire Hathaway Inc., likely written by Warren Buffett. It covers several topics:\n\n1. **Communication Philosophy**: Buffett emphasizes the importance of transparency and candidness in reporting mistakes and successes to shareholders.\n\n2. **Mistakes and Learnings**: The letter acknowledges past mistakes in business assessments and management hires, highlighting the importance of correcting errors promptly.\n\n3. **CEO Succession**: Mention of Greg Abel stepping in as the new CEO and continuing the tradition of honest communication.\n\n4. **Pete Liegl Story**: A detailed account of acquiring Forest River and the relationship with its founder, highlighting trust and effective business decisions.\n\n5. **2024 Performance**: Overview of business performance, particularly in insurance and investment activities, with a focus on GEICO's improvement.\n\n6. **Tax Contributions**: Discussion of significant tax payments to the U.S. Treasury, credited to shareholders' reinvestments.\n\n7. **Investment Strategy**: A breakdown of Berkshire\\u2019s investments in both controlled subsidiaries and marketable equities, along with a focus on long-term holding strategies.\n\n8. **American Capitalism**: Reflections on America\\u2019s economic development and Berkshire\\u2019s role within it.\n\n9. **Property-Casualty Insurance**: Insights into the P/C insurance business model and its challenges and benefits.\n\n10. **Japanese Investments**: Information about Berkshire\\u2019s investments in Japanese companies and future plans.\n\n11. **Annual Meeting**: Details about the upcoming annual gathering in Omaha, including schedule changes and new book releases.\n\n12. **Personal Anecdotes**: Light-hearted stories about family and interactions, conveying Buffett's personable approach.\n\n13. **Financial Performance Data**: Tables comparing Berkshire\\u2019s annual performance to the S&P 500, showing impressive long-term gains.\n\nOverall, the letter reinforces Berkshire Hathaway's commitment to transparency, investment in both its businesses and the wider economy, and emphasizes strong leadership and prudent financial management.\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 8438,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 398,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 8836\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "Web search",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"tools\": [{ \"type\": \"web_search_preview\" }],\n \"input\": \"What was a positive news story from today?\"\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n tools: [{ type: \"web_search_preview\" }],\n input: \"What was a positive news story from today?\",\n});\n\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "csharp": "using System;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"What was a positive news story from today?\";\n\nResponseCreationOptions options = new()\n{\n Tools =\n {\n ResponseTool.CreateWebSearchTool()\n },\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n\nConsole.WriteLine(response.GetOutputText());\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c\",\n \"object\": \"response\",\n \"created_at\": 1741484430,\n \"status\": \"completed\",\n \"completed_at\": 1741484431,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"type\": \"web_search_call\",\n \"id\": \"ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c\",\n \"status\": \"completed\"\n },\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"As of today, March 9, 2025, one notable positive news story...\",\n \"annotations\": [\n {\n \"type\": \"url_citation\",\n \"start_index\": 442,\n \"end_index\": 557,\n \"url\": \"https://.../?utm_source=chatgpt.com\",\n \"title\": \"...\"\n },\n {\n \"type\": \"url_citation\",\n \"start_index\": 962,\n \"end_index\": 1077,\n \"url\": \"https://.../?utm_source=chatgpt.com\",\n \"title\": \"...\"\n },\n {\n \"type\": \"url_citation\",\n \"start_index\": 1336,\n \"end_index\": 1451,\n \"url\": \"https://.../?utm_source=chatgpt.com\",\n \"title\": \"...\"\n }\n ]\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"web_search_preview\",\n \"domains\": [],\n \"search_context_size\": \"medium\",\n \"user_location\": {\n \"type\": \"approximate\",\n \"city\": null,\n \"country\": \"US\",\n \"region\": null,\n \"timezone\": null\n }\n }\n ],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 328,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 356,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 684\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "File search",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"tools\": [{\n \"type\": \"file_search\",\n \"vector_store_ids\": [\"vs_1234567890\"],\n \"max_num_results\": 20\n }],\n \"input\": \"What are the attributes of an ancient brown dragon?\"\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n tools: [{\n type: \"file_search\",\n vector_store_ids: [\"vs_1234567890\"],\n max_num_results: 20\n }],\n input: \"What are the attributes of an ancient brown dragon?\",\n});\n\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "csharp": "using System;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"What are the attributes of an ancient brown dragon?\";\n\nResponseCreationOptions options = new()\n{\n Tools =\n {\n ResponseTool.CreateFileSearchTool(\n vectorStoreIds: [\"vs_1234567890\"],\n maxResultCount: 20\n )\n },\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n\nConsole.WriteLine(response.GetOutputText());\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7\",\n \"object\": \"response\",\n \"created_at\": 1741485253,\n \"status\": \"completed\",\n \"completed_at\": 1741485254,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"type\": \"file_search_call\",\n \"id\": \"fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7\",\n \"status\": \"completed\",\n \"queries\": [\n \"attributes of an ancient brown dragon\"\n ],\n \"results\": null\n },\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"The attributes of an ancient brown dragon include...\",\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"index\": 320,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 576,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 815,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 815,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1030,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1030,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1156,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1225,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n }\n ]\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"file_search\",\n \"filters\": null,\n \"max_num_results\": 20,\n \"ranking_options\": {\n \"ranker\": \"auto\",\n \"score_threshold\": 0.0\n },\n \"vector_store_ids\": [\n \"vs_1234567890\"\n ]\n }\n ],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 18307,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 348,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 18655\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"instructions\": \"You are a helpful assistant.\",\n \"input\": \"Hello!\",\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n instructions: \"You are a helpful assistant.\",\n input: \"Hello!\",\n stream: true,\n});\n\nfor await (const event of response) {\n console.log(event);\n}\n",
+ "csharp": "using System;\nusing System.ClientModel;\nusing System.Threading.Tasks;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"Hello!\";\n\nResponseCreationOptions options = new()\n{\n Instructions = \"You are a helpful assistant.\",\n};\n\nAsyncCollectionResult responseUpdates = client.CreateResponseStreamingAsync(userInputText, options);\n\nawait foreach (StreamingResponseUpdate responseUpdate in responseUpdates)\n{\n if (responseUpdate is StreamingResponseOutputTextDeltaUpdate outputTextDeltaUpdate)\n {\n Console.Write(outputTextDeltaUpdate.Delta);\n }\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "event: response.created\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654\",\"object\":\"response\",\"created_at\":1741290958,\"status\":\"in_progress\",\"error\":null,\"incomplete_details\":null,\"instructions\":\"You are a helpful assistant.\",\"max_output_tokens\":null,\"model\":\"gpt-5.4\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"}},\"tool_choice\":\"auto\",\"tools\":[],\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654\",\"object\":\"response\",\"created_at\":1741290958,\"status\":\"in_progress\",\"error\":null,\"incomplete_details\":null,\"instructions\":\"You are a helpful assistant.\",\"max_output_tokens\":null,\"model\":\"gpt-5.4\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"}},\"tool_choice\":\"auto\",\"tools\":[],\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"item_id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"item_id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\"}\n\n...\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"item_id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"output_index\":0,\"content_index\":0,\"text\":\"Hi there! How can I assist you today?\"}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"item_id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Hi there! How can I assist you today?\",\"annotations\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hi there! How can I assist you today?\",\"annotations\":[]}]}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654\",\"object\":\"response\",\"created_at\":1741290958,\"status\":\"completed\",\"error\":null,\"incomplete_details\":null,\"instructions\":\"You are a helpful assistant.\",\"max_output_tokens\":null,\"model\":\"gpt-5.4\",\"output\":[{\"id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hi there! How can I assist you today?\",\"annotations\":[]}]}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"}},\"tool_choice\":\"auto\",\"tools\":[],\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":37,\"output_tokens\":11,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":48},\"user\":null,\"metadata\":{}}}\n"
+ },
+ {
+ "title": "Functions",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"input\": \"What is the weather like in Boston today?\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\", \"unit\"]\n }\n }\n ],\n \"tool_choice\": \"auto\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst tools = [\n {\n type: \"function\",\n name: \"get_current_weather\",\n description: \"Get the current weather in a given location\",\n parameters: {\n type: \"object\",\n properties: {\n location: {\n type: \"string\",\n description: \"The city and state, e.g. San Francisco, CA\",\n },\n unit: { type: \"string\", enum: [\"celsius\", \"fahrenheit\"] },\n },\n required: [\"location\", \"unit\"],\n },\n },\n];\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n tools: tools,\n input: \"What is the weather like in Boston today?\",\n tool_choice: \"auto\",\n});\n\nconsole.log(response);\n",
+ "csharp": "using System;\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nResponseTool getCurrentWeatherFunctionTool = ResponseTool.CreateFunctionTool(\n functionName: \"get_current_weather\",\n functionDescription: \"Get the current weather in a given location\",\n functionParameters: BinaryData.FromString(\"\"\"\n {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]}\n },\n \"required\": [\"location\", \"unit\"]\n }\n \"\"\"\n )\n);\n\nstring userInputText = \"What is the weather like in Boston today?\";\n\nResponseCreationOptions options = new()\n{\n Tools =\n {\n getCurrentWeatherFunctionTool\n },\n ToolChoice = ResponseToolChoice.CreateAutoChoice(),\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0\",\n \"object\": \"response\",\n \"created_at\": 1741294021,\n \"status\": \"completed\",\n \"completed_at\": 1741294022,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"type\": \"function_call\",\n \"id\": \"fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0\",\n \"call_id\": \"call_unLAR8MvFNptuiZK6K6HCy5k\",\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\"location\":\"Boston, MA\",\"unit\":\"celsius\"}\",\n \"status\": \"completed\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"description\": \"Get the current weather in a given location\",\n \"name\": \"get_current_weather\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\n \"celsius\",\n \"fahrenheit\"\n ]\n }\n },\n \"required\": [\n \"location\",\n \"unit\"\n ]\n },\n \"strict\": true\n }\n ],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 291,\n \"output_tokens\": 23,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 314\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "Reasoning",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"o3-mini\",\n \"input\": \"How much wood would a woodchuck chuck?\",\n \"reasoning\": {\n \"effort\": \"high\"\n }\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"o3-mini\",\n input: \"How much wood would a woodchuck chuck?\",\n reasoning: {\n effort: \"high\"\n }\n});\n\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "csharp": "using System;\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"o3-mini\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"How much wood would a woodchuck chuck?\";\n\nResponseCreationOptions options = new()\n{\n ReasoningOptions = new()\n {\n ReasoningEffortLevel = ResponseReasoningEffortLevel.High,\n },\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n\nConsole.WriteLine(response.GetOutputText());\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ccd7eca01881908ff0b5146584e408072912b2993db808\",\n \"object\": \"response\",\n \"created_at\": 1741477868,\n \"status\": \"completed\",\n \"completed_at\": 1741477869,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"o1-2024-12-17\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"The classic tongue twister...\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 81,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 1035,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 832\n },\n \"total_tokens\": 1116\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ }
+ ]
+ }
+ },
+ "get": {
+ "operationId": "listResponses",
+ "summary": "List responses",
+ "description": "Returns a collection of all stored responses matching specified filter criteria.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "agent_name",
+ "in": "query",
+ "required": false,
+ "description": "Filter by agent name. If provided, only items associated with the specified agent will be returned.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "agent_id",
+ "in": "query",
+ "required": false,
+ "description": "Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "conversation_id",
+ "in": "query",
+ "required": false,
+ "description": "Filter by conversation ID. If provided, only responses associated with the specified conversation will be returned.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Response"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ]
+ }
+ },
+ "/openai/v1/responses/compact": {
+ "post": {
+ "operationId": "Compactconversation",
+ "summary": "Compact a conversation",
+ "description": "Compacts a conversation into a response object suitable for long-running and zero-data-retention scenarios.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CompactResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CompactResponseMethodPublicBody"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Compact a response",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/responses/compact \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.1-codex-max\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": \"Create a simple landing page for a dog petting café.\"\n },\n {\n \"id\": \"msg_001\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"Below is a single file, ready-to-use landing page for a dog petting café:...\"\n }\n ],\n \"role\": \"assistant\"\n }\n ]\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\n// Compact the previous response if you are running out of tokens\nconst compactedResponse = await openai.responses.compact({\n model: \"gpt-5.1-codex-max\",\n input: [\n {\n role: \"user\",\n content: \"Create a simple landing page for a dog petting café.\",\n },\n // All items returned from previous requests are included here, like reasoning, message, function call, etc.\n {\n id: \"msg_030d085c0b53e67e0069332e3a72d4819c96c6f2c4adc15d33\",\n type: \"message\",\n status: \"completed\",\n content: [\n {\n type: \"output_text\",\n annotations: [],\n logprobs: [],\n text: \"Below is a single file, ready-to-use landing page for a dog petting café:...\",\n },\n ],\n role: \"assistant\",\n },\n ],\n});\n\n// Pass the compactedResponse.output as input to the next request\nconsole.log(compactedResponse);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncompacted_response = client.responses.compact(\n model=\"gpt-5.4\",\n)\nprint(compacted_response.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst compactedResponse = await client.responses.compact({ model: 'gpt-5.4' });\n\nconsole.log(compactedResponse.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcompactedResponse, err := client.Responses.Compact(context.TODO(), responses.ResponseCompactParams{\n\t\tModel: responses.ResponseCompactParamsModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", compactedResponse.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.CompactedResponse;\nimport com.openai.models.responses.ResponseCompactParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ResponseCompactParams params = ResponseCompactParams.builder()\n .model(ResponseCompactParams.Model.GPT_5_4)\n .build();\n CompactedResponse compactedResponse = client.responses().compact(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncompacted_response = openai.responses.compact(model: :\"gpt-5.4\")\n\nputs(compacted_response)"
+ },
+ "response": "{\n \"id\": \"resp_001\",\n \"object\": \"response.compaction\",\n \"created_at\": 1764967971,\n \"output\": [\n {\n \"id\": \"msg_000\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Create a simple landing page for a dog petting cafe.\"\n }\n ],\n \"role\": \"user\"\n },\n {\n \"id\": \"cmp_001\",\n \"type\": \"compaction\",\n \"encrypted_content\": \"gAAAAABpM0Yj-...=\"\n }\n ],\n \"usage\": {\n \"input_tokens\": 139,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 438,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 64\n },\n \"total_tokens\": 577\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/responses/{response_id}": {
+ "get": {
+ "operationId": "getResponse",
+ "summary": "Retrieve a model response",
+ "description": "Retrieves a model response with the given ID.",
+ "parameters": [
+ {
+ "name": "response_id",
+ "in": "path",
+ "required": true,
+ "description": "The response id path parameter.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include[]",
+ "in": "query",
+ "required": false,
+ "description": "The includables query parameter.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.IncludeEnum"
+ },
+ "default": []
+ }
+ },
+ {
+ "name": "stream",
+ "in": "query",
+ "required": false,
+ "description": "The stream query parameter.",
+ "schema": {
+ "type": "boolean",
+ "default": false
+ },
+ "explode": false
+ },
+ {
+ "name": "starting_after",
+ "in": "query",
+ "required": false,
+ "description": "The sequence number of the event after which to start streaming.",
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "headers": {
+ "x-agent-session-id": {
+ "required": false,
+ "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Response"
+ }
+ },
+ "text/event-stream": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateResponseStreamingResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "x-oaiMeta": {
+ "name": "Get a model response",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses/resp_123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst response = await client.responses.retrieve(\"resp_123\");\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.retrieve(\n response_id=\"resp_677efb5139a88190b512bc3fef8e535d\",\n):\n print(response)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.retrieve('resp_677efb5139a88190b512bc3fef8e535d');\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.Get(\n\t\tcontext.TODO(),\n\t\t\"resp_677efb5139a88190b512bc3fef8e535d\",\n\t\tresponses.ResponseGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().retrieve(\"resp_677efb5139a88190b512bc3fef8e535d\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.retrieve(\"resp_677efb5139a88190b512bc3fef8e535d\")\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67cb71b351908190a308f3859487620d06981a8637e6bc44\",\n \"object\": \"response\",\n \"created_at\": 1741386163,\n \"status\": \"completed\",\n \"completed_at\": 1741386164,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"Silent circuits hum,\nThoughts emerge in data streams—\nDigital dawn breaks.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 32,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 18,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 50\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ }
+ }
+ },
+ "delete": {
+ "operationId": "deleteResponse",
+ "summary": "Delete a model response",
+ "description": "Deletes a model response.",
+ "parameters": [
+ {
+ "name": "response_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the response to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "headers": {
+ "x-agent-session-id": {
+ "required": false,
+ "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteResponseResult"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a model response",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/responses/resp_123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst response = await client.responses.delete(\"resp_123\");\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nclient.responses.delete(\n \"resp_677efb5139a88190b512bc3fef8e535d\",\n)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.responses.delete('resp_677efb5139a88190b512bc3fef8e535d');",
+ "go": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Responses.Delete(context.TODO(), \"resp_677efb5139a88190b512bc3fef8e535d\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.ResponseDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n client.responses().delete(\"resp_677efb5139a88190b512bc3fef8e535d\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresult = openai.responses.delete(\"resp_677efb5139a88190b512bc3fef8e535d\")\n\nputs(result)"
+ },
+ "response": "{\n \"id\": \"resp_6786a1bec27481909a17d673315b29f6\",\n \"object\": \"response\",\n \"deleted\": true\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/responses/{response_id}/cancel": {
+ "post": {
+ "operationId": "cancelResponse",
+ "summary": "Cancel a model response",
+ "description": "Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.",
+ "parameters": [
+ {
+ "name": "response_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the response to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "headers": {
+ "x-agent-session-id": {
+ "required": false,
+ "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Response"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel a response",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/responses/resp_123/cancel \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst response = await client.responses.cancel(\"resp_123\");\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.responses.cancel(\n \"resp_677efb5139a88190b512bc3fef8e535d\",\n)\nprint(response.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.cancel('resp_677efb5139a88190b512bc3fef8e535d');\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.Cancel(context.TODO(), \"resp_677efb5139a88190b512bc3fef8e535d\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().cancel(\"resp_677efb5139a88190b512bc3fef8e535d\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.cancel(\"resp_677efb5139a88190b512bc3fef8e535d\")\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67cb71b351908190a308f3859487620d06981a8637e6bc44\",\n \"object\": \"response\",\n \"created_at\": 1741386163,\n \"status\": \"cancelled\",\n \"background\": true,\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44\",\n \"status\": \"in_progress\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"Silent circuits hum,\nThoughts emerge in data streams—\nDigital dawn breaks.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/responses/{response_id}/input_items": {
+ "get": {
+ "operationId": "listInputItems",
+ "summary": "List input items for a response",
+ "description": "Retrieves the input items associated with the specified response.",
+ "parameters": [
+ {
+ "name": "response_id",
+ "in": "path",
+ "required": true,
+ "description": "The response id path parameter.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "headers": {
+ "x-agent-session-id": {
+ "required": false,
+ "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "x-oaiMeta": {
+ "name": "List input items",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses/resp_abc123/input_items \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst response = await client.responses.inputItems.list(\"resp_123\");\nconsole.log(response.data);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.responses.input_items.list(\n response_id=\"response_id\",\n)\npage = page.data[0]\nprint(page)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const responseItem of client.responses.inputItems.list('response_id')) {\n console.log(responseItem);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Responses.InputItems.List(\n\t\tcontext.TODO(),\n\t\t\"response_id\",\n\t\tresponses.InputItemListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.inputitems.InputItemListPage;\nimport com.openai.models.responses.inputitems.InputItemListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n InputItemListPage page = client.responses().inputItems().list(\"response_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.responses.input_items.list(\"response_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"msg_abc123\",\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Tell me a three sentence bedtime story about a unicorn.\"\n }\n ]\n }\n ],\n \"first_id\": \"msg_abc123\",\n \"last_id\": \"msg_abc123\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/threads": {
+ "post": {
+ "operationId": "Threads_createThread",
+ "summary": "Create a thread",
+ "description": "Creates a thread from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create thread",
+ "group": "threads",
+ "beta": true,
+ "examples": [
+ {
+ "title": "Empty",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d ''\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.beta.threads.create()\nprint(thread.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const emptyThread = await openai.beta.threads.create();\n\n console.log(emptyThread);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.beta.threads.create();\n\nconsole.log(thread.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", thread.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.Thread;\nimport com.openai.models.beta.threads.ThreadCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Thread thread = client.beta().threads().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread = openai.beta.threads.create\n\nputs(thread)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1699012949,\n \"metadata\": {},\n \"tool_resources\": {}\n}\n"
+ },
+ {
+ "title": "Messages",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n-H \"OpenAI-Beta: assistants=v2\" \\\n-d '{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": \"Hello, what is AI?\"\n }, {\n \"role\": \"user\",\n \"content\": \"How does AI work? Explain it in simple terms.\"\n }]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.beta.threads.create()\nprint(thread.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const messageThread = await openai.beta.threads.create({\n messages: [\n {\n role: \"user\",\n content: \"Hello, what is AI?\"\n },\n {\n role: \"user\",\n content: \"How does AI work? Explain it in simple terms.\",\n },\n ],\n });\n\n console.log(messageThread);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.beta.threads.create();\n\nconsole.log(thread.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", thread.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.Thread;\nimport com.openai.models.beta.threads.ThreadCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Thread thread = client.beta().threads().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread = openai.beta.threads.create\n\nputs(thread)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1699014083,\n \"metadata\": {},\n \"tool_resources\": {}\n}\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/threads/runs": {
+ "post": {
+ "operationId": "Threads_createThreadAndRun",
+ "summary": "Create a thread and run",
+ "description": "Creates a thread and run from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create thread and run",
+ "group": "threads",
+ "beta": true,
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_abc123\",\n \"thread\": {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Explain deep learning to a 5 year old.\"}\n ]\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor thread in client.beta.threads.create_and_run(\n assistant_id=\"assistant_id\",\n):\n print(thread)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.createAndRun({\n assistant_id: \"asst_abc123\",\n thread: {\n messages: [\n { role: \"user\", content: \"Explain deep learning to a 5 year old.\" },\n ],\n },\n });\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{\n\t\tAssistantID: \"assistant_id\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.ThreadCreateAndRunParams;\nimport com.openai.models.beta.threads.runs.Run;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().createAndRun(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.create_and_run(assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699076792,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"queued\",\n \"started_at\": null,\n \"expires_at\": 1699077392,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": null,\n \"required_action\": null,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant.\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completion_tokens\": null,\n \"max_prompt_tokens\": null,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"incomplete_details\": null,\n \"usage\": null,\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_123\",\n \"thread\": {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello\"}\n ]\n },\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor thread in client.beta.threads.create_and_run(\n assistant_id=\"assistant_id\",\n):\n print(thread)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const stream = await openai.beta.threads.createAndRun({\n assistant_id: \"asst_123\",\n thread: {\n messages: [\n { role: \"user\", content: \"Hello\" },\n ],\n },\n stream: true\n });\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{\n\t\tAssistantID: \"assistant_id\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.ThreadCreateAndRunParams;\nimport com.openai.models.beta.threads.runs.Run;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().createAndRun(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.create_and_run(assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "event: thread.created\ndata: {\"id\":\"thread_123\",\"object\":\"thread\",\"created_at\":1710348075,\"metadata\":{}}\n\nevent: thread.run.created\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"tool_resources\":{},\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"tool_resources\":{},\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"tool_resources\":{},\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.message.created\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[], \"metadata\":{}}\n\nevent: thread.message.in_progress\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[], \"metadata\":{}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"Hello\",\"annotations\":[]}}]}}\n\n...\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" today\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"?\"}}]}}\n\nevent: thread.message.completed\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"completed\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":1710348077,\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":{\"value\":\"Hello! How can I assist you today?\",\"annotations\":[]}}], \"metadata\":{}}\n\nevent: thread.run.step.completed\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710348077,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31}}\n\nevent: thread.run.completed\n{\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"completed\",\"started_at\":1713226836,\"expires_at\":null,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":1713226837,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":345,\"completion_tokens\":11,\"total_tokens\":356},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}\n\nevent: done\ndata: [DONE]\n"
+ },
+ {
+ "title": "Streaming with Functions",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_abc123\",\n \"thread\": {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"What is the weather like in San Francisco?\"}\n ]\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\"]\n }\n }\n }\n ],\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor thread in client.beta.threads.create_and_run(\n assistant_id=\"assistant_id\",\n):\n print(thread)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst tools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \"required\": [\"location\"],\n },\n }\n }\n];\n\nasync function main() {\n const stream = await openai.beta.threads.createAndRun({\n assistant_id: \"asst_123\",\n thread: {\n messages: [\n { role: \"user\", content: \"What is the weather like in San Francisco?\" },\n ],\n },\n tools: tools,\n stream: true\n });\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{\n\t\tAssistantID: \"assistant_id\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.ThreadCreateAndRunParams;\nimport com.openai.models.beta.threads.runs.Run;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().createAndRun(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.create_and_run(assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "event: thread.created\ndata: {\"id\":\"thread_123\",\"object\":\"thread\",\"created_at\":1710351818,\"metadata\":{}}\n\nevent: thread.run.created\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710351818,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710352418,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710351818,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710352418,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710351818,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":1710351818,\"expires_at\":1710352418,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710351819,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"tool_calls\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710352418,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[]},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710351819,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"tool_calls\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710352418,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[]},\"usage\":null}\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"id\":\"call_XXNp8YGaFrjrSjgqxtC8JJ1B\",\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"arguments\":\"\",\"output\":null}}]}}}\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"type\":\"function\",\"function\":{\"arguments\":\"{\"\"}}]}}}\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"type\":\"function\",\"function\":{\"arguments\":\"location\"}}]}}}\n\n...\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"type\":\"function\",\"function\":{\"arguments\":\"ahrenheit\"}}]}}}\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"type\":\"function\",\"function\":{\"arguments\":\"\"}\"}}]}}}\n\nevent: thread.run.requires_action\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710351818,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"requires_action\",\"started_at\":1710351818,\"expires_at\":1710352418,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":{\"type\":\"submit_tool_outputs\",\"submit_tool_outputs\":{\"tool_calls\":[{\"id\":\"call_XXNp8YGaFrjrSjgqxtC8JJ1B\",\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"arguments\":\"{\"location\":\"San Francisco, CA\",\"unit\":\"fahrenheit\"}\"}}]}},\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":345,\"completion_tokens\":11,\"total_tokens\":356},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: done\ndata: [DONE]\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}": {
+ "delete": {
+ "operationId": "Threads_deleteThread",
+ "summary": "Delete a thread",
+ "description": "Deletes a thread by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteThreadResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete thread",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread_deleted = client.beta.threads.delete(\n \"thread_id\",\n)\nprint(thread_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const response = await openai.beta.threads.delete(\"thread_abc123\");\n\n console.log(response);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst threadDeleted = await client.beta.threads.delete('thread_id');\n\nconsole.log(threadDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthreadDeleted, err := client.Beta.Threads.Delete(context.TODO(), \"thread_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", threadDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.ThreadDeleteParams;\nimport com.openai.models.beta.threads.ThreadDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ThreadDeleted threadDeleted = client.beta().threads().delete(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread_deleted = openai.beta.threads.delete(\"thread_id\")\n\nputs(thread_deleted)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Threads_getThread",
+ "summary": "Get a thread",
+ "description": "Retrieves a thread by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve thread",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.beta.threads.retrieve(\n \"thread_id\",\n)\nprint(thread.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myThread = await openai.beta.threads.retrieve(\n \"thread_abc123\"\n );\n\n console.log(myThread);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.beta.threads.retrieve('thread_id');\n\nconsole.log(thread.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Beta.Threads.Get(context.TODO(), \"thread_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", thread.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.Thread;\nimport com.openai.models.beta.threads.ThreadRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Thread thread = client.beta().threads().retrieve(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread = openai.beta.threads.retrieve(\"thread_id\")\n\nputs(thread)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1699014083,\n \"metadata\": {},\n \"tool_resources\": {\n \"code_interpreter\": {\n \"file_ids\": []\n }\n }\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Threads_modifyThread",
+ "summary": "Update a thread",
+ "description": "Updates a thread with the supplied changes.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to modify. Only the `metadata` can be modified.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ModifyThreadRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Modify thread",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"metadata\": {\n \"modified\": \"true\",\n \"user\": \"abc123\"\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.beta.threads.update(\n thread_id=\"thread_id\",\n)\nprint(thread.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const updatedThread = await openai.beta.threads.update(\n \"thread_abc123\",\n {\n metadata: { modified: \"true\", user: \"abc123\" },\n }\n );\n\n console.log(updatedThread);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.beta.threads.update('thread_id');\n\nconsole.log(thread.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Beta.Threads.Update(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", thread.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.Thread;\nimport com.openai.models.beta.threads.ThreadUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Thread thread = client.beta().threads().update(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread = openai.beta.threads.update(\"thread_id\")\n\nputs(thread)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1699014083,\n \"metadata\": {\n \"modified\": \"true\",\n \"user\": \"abc123\"\n },\n \"tool_resources\": {}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/messages": {
+ "get": {
+ "operationId": "Threads_listMessages",
+ "summary": "List messages",
+ "description": "Lists messages matching the request filters.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) the messages belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "query",
+ "required": false,
+ "description": "Filter messages by the run ID that generated them.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListMessagesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "List messages",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.beta.threads.messages.list(\n thread_id=\"thread_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const threadMessages = await openai.beta.threads.messages.list(\n \"thread_abc123\"\n );\n\n console.log(threadMessages.data);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.beta.threads.messages.list('thread_id')) {\n console.log(message.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Beta.Threads.Messages.List(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadMessageListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.MessageListPage;\nimport com.openai.models.beta.threads.messages.MessageListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageListPage page = client.beta().threads().messages().list(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.beta.threads.messages.list(\"thread_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1699016383,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"How does AI work? Explain it in simple terms.\",\n \"annotations\": []\n }\n }\n ],\n \"attachments\": [],\n \"metadata\": {}\n },\n {\n \"id\": \"msg_abc456\",\n \"object\": \"thread.message\",\n \"created_at\": 1699016383,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"Hello, what is AI?\",\n \"annotations\": []\n }\n }\n ],\n \"attachments\": [],\n \"metadata\": {}\n }\n ],\n \"first_id\": \"msg_abc123\",\n \"last_id\": \"msg_abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Threads_createMessage",
+ "summary": "Create a message",
+ "description": "Creates a message from the supplied request.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) to create a message for.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.MessageObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateMessageRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create message",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"role\": \"user\",\n \"content\": \"How does AI work? Explain it in simple terms.\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.beta.threads.messages.create(\n thread_id=\"thread_id\",\n content=\"string\",\n role=\"user\",\n)\nprint(message.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const threadMessages = await openai.beta.threads.messages.create(\n \"thread_abc123\",\n { role: \"user\", content: \"How does AI work? Explain it in simple terms.\" }\n );\n\n console.log(threadMessages);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.beta.threads.messages.create('thread_id', {\n content: 'string',\n role: 'user',\n});\n\nconsole.log(message.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmessage, err := client.Beta.Threads.Messages.New(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadMessageNewParams{\n\t\t\tContent: openai.BetaThreadMessageNewParamsContentUnion{\n\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t},\n\t\t\tRole: openai.BetaThreadMessageNewParamsRoleUser,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", message.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.Message;\nimport com.openai.models.beta.threads.messages.MessageCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageCreateParams params = MessageCreateParams.builder()\n .threadId(\"thread_id\")\n .content(\"string\")\n .role(MessageCreateParams.Role.USER)\n .build();\n Message message = client.beta().threads().messages().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmessage = openai.beta.threads.messages.create(\"thread_id\", content: \"string\", role: :user)\n\nputs(message)"
+ },
+ "response": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1713226573,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"How does AI work? Explain it in simple terms.\",\n \"annotations\": []\n }\n }\n ],\n \"attachments\": [],\n \"metadata\": {}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/messages/{message_id}": {
+ "delete": {
+ "operationId": "Threads_deleteMessage",
+ "summary": "Delete a message",
+ "description": "Deletes a message by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to which this message belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "message_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the message to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteMessageResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete message",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmessage_deleted = client.beta.threads.messages.delete(\n message_id=\"message_id\",\n thread_id=\"thread_id\",\n)\nprint(message_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const deletedMessage = await openai.beta.threads.messages.delete(\n \"msg_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n\n console.log(deletedMessage);\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst messageDeleted = await client.beta.threads.messages.delete('message_id', {\n thread_id: 'thread_id',\n});\n\nconsole.log(messageDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmessageDeleted, err := client.Beta.Threads.Messages.Delete(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"message_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", messageDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.MessageDeleteParams;\nimport com.openai.models.beta.threads.messages.MessageDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageDeleteParams params = MessageDeleteParams.builder()\n .threadId(\"thread_id\")\n .messageId(\"message_id\")\n .build();\n MessageDeleted messageDeleted = client.beta().threads().messages().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmessage_deleted = openai.beta.threads.messages.delete(\"message_id\", thread_id: \"thread_id\")\n\nputs(message_deleted)"
+ },
+ "response": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Threads_getMessage",
+ "summary": "Get a message",
+ "description": "Retrieves a message by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) to which this message belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "message_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the message to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.MessageObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve message",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.beta.threads.messages.retrieve(\n message_id=\"message_id\",\n thread_id=\"thread_id\",\n)\nprint(message.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const message = await openai.beta.threads.messages.retrieve(\n \"msg_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n\n console.log(message);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.beta.threads.messages.retrieve('message_id', {\n thread_id: 'thread_id',\n});\n\nconsole.log(message.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmessage, err := client.Beta.Threads.Messages.Get(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"message_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", message.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.Message;\nimport com.openai.models.beta.threads.messages.MessageRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageRetrieveParams params = MessageRetrieveParams.builder()\n .threadId(\"thread_id\")\n .messageId(\"message_id\")\n .build();\n Message message = client.beta().threads().messages().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmessage = openai.beta.threads.messages.retrieve(\"message_id\", thread_id: \"thread_id\")\n\nputs(message)"
+ },
+ "response": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1699017614,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"How does AI work? Explain it in simple terms.\",\n \"annotations\": []\n }\n }\n ],\n \"attachments\": [],\n \"metadata\": {}\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Threads_modifyMessage",
+ "summary": "Update a message",
+ "description": "Updates a message with the supplied changes.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to which this message belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "message_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the message to modify.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.MessageObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ModifyMessageRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Modify message",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"metadata\": {\n \"modified\": \"true\",\n \"user\": \"abc123\"\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.beta.threads.messages.update(\n message_id=\"message_id\",\n thread_id=\"thread_id\",\n)\nprint(message.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const message = await openai.beta.threads.messages.update(\n \"thread_abc123\",\n \"msg_abc123\",\n {\n metadata: {\n modified: \"true\",\n user: \"abc123\",\n },\n }\n }'",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.beta.threads.messages.update('message_id', { thread_id: 'thread_id' });\n\nconsole.log(message.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmessage, err := client.Beta.Threads.Messages.Update(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"message_id\",\n\t\topenai.BetaThreadMessageUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", message.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.Message;\nimport com.openai.models.beta.threads.messages.MessageUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageUpdateParams params = MessageUpdateParams.builder()\n .threadId(\"thread_id\")\n .messageId(\"message_id\")\n .build();\n Message message = client.beta().threads().messages().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmessage = openai.beta.threads.messages.update(\"message_id\", thread_id: \"thread_id\")\n\nputs(message)"
+ },
+ "response": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1699017614,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"How does AI work? Explain it in simple terms.\",\n \"annotations\": []\n }\n }\n ],\n \"file_ids\": [],\n \"metadata\": {\n \"modified\": \"true\",\n \"user\": \"abc123\"\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs": {
+ "get": {
+ "operationId": "Threads_listRuns",
+ "summary": "List runs",
+ "description": "Lists runs matching the request filters.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread the run belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListRunsResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "List runs",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.beta.threads.runs.list(\n thread_id=\"thread_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const runs = await openai.beta.threads.runs.list(\n \"thread_abc123\"\n );\n\n console.log(runs);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const run of client.beta.threads.runs.list('thread_id')) {\n console.log(run.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Beta.Threads.Runs.List(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadRunListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.RunListPage;\nimport com.openai.models.beta.threads.runs.RunListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunListPage page = client.beta().threads().runs().list(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.beta.threads.runs.list(\"thread_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699075072,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699075072,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699075073,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"tool_resources\": {\n \"code_interpreter\": {\n \"file_ids\": [\n \"file-abc123\",\n \"file-abc456\"\n ]\n }\n },\n \"metadata\": {},\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n },\n {\n \"id\": \"run_abc456\",\n \"object\": \"thread.run\",\n \"created_at\": 1699063290,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699063290,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699063291,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"tool_resources\": {\n \"code_interpreter\": {\n \"file_ids\": [\n \"file-abc123\",\n \"file-abc456\"\n ]\n }\n },\n \"metadata\": {},\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n }\n ],\n \"first_id\": \"run_abc123\",\n \"last_id\": \"run_abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Threads_createRun",
+ "summary": "Create a run",
+ "description": "Creates a run from the supplied request.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include[]",
+ "in": "query",
+ "required": false,
+ "description": "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.\n See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "step_details.tool_calls[*].file_search.results[*].content"
+ ]
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateRunRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create run",
+ "group": "threads",
+ "beta": true,
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_abc123\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.create(\n thread_id=\"thread_id\",\n assistant_id=\"assistant_id\",\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.create(\n \"thread_abc123\",\n { assistant_id: \"asst_abc123\" }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.New(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadRunNewParams{\n\t\t\tAssistantID: \"assistant_id\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCreateParams params = RunCreateParams.builder()\n .threadId(\"thread_id\")\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().runs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.create(\"thread_id\", assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699063290,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"queued\",\n \"started_at\": 1699063290,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699063291,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"metadata\": {},\n \"usage\": null,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_123/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_123\",\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.create(\n thread_id=\"thread_id\",\n assistant_id=\"assistant_id\",\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const stream = await openai.beta.threads.runs.create(\n \"thread_123\",\n { assistant_id: \"asst_123\", stream: true }\n );\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.New(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadRunNewParams{\n\t\t\tAssistantID: \"assistant_id\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCreateParams params = RunCreateParams.builder()\n .threadId(\"thread_id\")\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().runs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.create(\"thread_id\", assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "event: thread.run.created\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710330640,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710331240,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710330640,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710331240,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710330640,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":1710330641,\"expires_at\":1710331240,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710330641,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710331240,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710330641,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710331240,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.message.created\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710330641,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.in_progress\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710330641,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"Hello\",\"annotations\":[]}}]}}\n\n...\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" today\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"?\"}}]}}\n\nevent: thread.message.completed\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710330641,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"completed\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":1710330642,\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":{\"value\":\"Hello! How can I assist you today?\",\"annotations\":[]}}],\"metadata\":{}}\n\nevent: thread.run.step.completed\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710330641,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710330642,\"expires_at\":1710331240,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31}}\n\nevent: thread.run.completed\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710330640,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"completed\",\"started_at\":1710330641,\"expires_at\":null,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":1710330642,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: done\ndata: [DONE]\n"
+ },
+ {
+ "title": "Streaming with Functions",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_abc123\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\"]\n }\n }\n }\n ],\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.create(\n thread_id=\"thread_id\",\n assistant_id=\"assistant_id\",\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst tools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \"required\": [\"location\"],\n },\n }\n }\n];\n\nasync function main() {\n const stream = await openai.beta.threads.runs.create(\n \"thread_abc123\",\n {\n assistant_id: \"asst_abc123\",\n tools: tools,\n stream: true\n }\n );\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.New(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadRunNewParams{\n\t\t\tAssistantID: \"assistant_id\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCreateParams params = RunCreateParams.builder()\n .threadId(\"thread_id\")\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().runs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.create(\"thread_id\", assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "event: thread.run.created\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":1710348075,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.message.created\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.in_progress\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"Hello\",\"annotations\":[]}}]}}\n\n...\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" today\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"?\"}}]}}\n\nevent: thread.message.completed\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"completed\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":1710348077,\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":{\"value\":\"Hello! How can I assist you today?\",\"annotations\":[]}}],\"metadata\":{}}\n\nevent: thread.run.step.completed\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710348077,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31}}\n\nevent: thread.run.completed\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"completed\",\"started_at\":1710348075,\"expires_at\":null,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":1710348077,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: done\ndata: [DONE]\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}": {
+ "get": {
+ "operationId": "Threads_getRun",
+ "summary": "Get a run",
+ "description": "Retrieves a run by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) that was run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve run",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.beta.threads.runs.retrieve(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.retrieve(\n \"run_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.retrieve('run_id', { thread_id: 'thread_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.Get(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunRetrieveParams params = RunRetrieveParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .build();\n Run run = client.beta().threads().runs().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.retrieve(\"run_id\", thread_id: \"thread_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699075072,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699075072,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699075073,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"metadata\": {},\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Threads_modifyRun",
+ "summary": "Update a run",
+ "description": "Updates a run with the supplied changes.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) that was run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to modify.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ModifyRunRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Modify run",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"metadata\": {\n \"user_id\": \"user_abc123\"\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.beta.threads.runs.update(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.update(\n \"run_abc123\",\n {\n thread_id: \"thread_abc123\",\n metadata: {\n user_id: \"user_abc123\",\n },\n }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.update('run_id', { thread_id: 'thread_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.Update(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\topenai.BetaThreadRunUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunUpdateParams params = RunUpdateParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .build();\n Run run = client.beta().threads().runs().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.update(\"run_id\", thread_id: \"thread_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699075072,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699075072,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699075073,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"tool_resources\": {\n \"code_interpreter\": {\n \"file_ids\": [\n \"file-abc123\",\n \"file-abc456\"\n ]\n }\n },\n \"metadata\": {\n \"user_id\": \"user_abc123\"\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}/cancel": {
+ "post": {
+ "operationId": "Threads_cancelRun",
+ "summary": "Cancel a run",
+ "description": "Cancels a run by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to which this run belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel a run",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X POST\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.beta.threads.runs.cancel(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.cancel(\n \"run_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.cancel('run_id', { thread_id: 'thread_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.Cancel(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCancelParams params = RunCancelParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .build();\n Run run = client.beta().threads().runs().cancel(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.cancel(\"run_id\", thread_id: \"thread_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699076126,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"cancelling\",\n \"started_at\": 1699076126,\n \"expires_at\": 1699076726,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": null,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You summarize books.\",\n \"tools\": [\n {\n \"type\": \"file_search\"\n }\n ],\n \"tool_resources\": {\n \"file_search\": {\n \"vector_store_ids\": [\"vs_123\"]\n }\n },\n \"metadata\": {},\n \"usage\": null,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}/steps": {
+ "get": {
+ "operationId": "Threads_listRunSteps",
+ "summary": "List run steps",
+ "description": "Lists run steps matching the request filters.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread the run and run steps belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run the run steps belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include[]",
+ "in": "query",
+ "required": false,
+ "description": "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.\n See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "step_details.tool_calls[*].file_search.results[*].content"
+ ]
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListRunStepsResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "List run steps",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.beta.threads.runs.steps.list(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const runStep = await openai.beta.threads.runs.steps.list(\n \"run_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n console.log(runStep);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const runStep of client.beta.threads.runs.steps.list('run_id', {\n thread_id: 'thread_id',\n})) {\n console.log(runStep.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Beta.Threads.Runs.Steps.List(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\topenai.BetaThreadRunStepListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.steps.StepListPage;\nimport com.openai.models.beta.threads.runs.steps.StepListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n StepListParams params = StepListParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .build();\n StepListPage page = client.beta().threads().runs().steps().list(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.beta.threads.runs.steps.list(\"run_id\", thread_id: \"thread_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"step_abc123\",\n \"object\": \"thread.run.step\",\n \"created_at\": 1699063291,\n \"run_id\": \"run_abc123\",\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"type\": \"message_creation\",\n \"status\": \"completed\",\n \"cancelled_at\": null,\n \"completed_at\": 1699063291,\n \"expired_at\": null,\n \"failed_at\": null,\n \"last_error\": null,\n \"step_details\": {\n \"type\": \"message_creation\",\n \"message_creation\": {\n \"message_id\": \"msg_abc123\"\n }\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n }\n }\n ],\n \"first_id\": \"step_abc123\",\n \"last_id\": \"step_abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}": {
+ "get": {
+ "operationId": "Threads_getRunStep",
+ "summary": "Get a run step",
+ "description": "Retrieves a run step by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to which the run and run step belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to which the run step belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "step_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run step to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include[]",
+ "in": "query",
+ "required": false,
+ "description": "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.\n See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "step_details.tool_calls[*].file_search.results[*].content"
+ ]
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunStepObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve run step",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun_step = client.beta.threads.runs.steps.retrieve(\n step_id=\"step_id\",\n thread_id=\"thread_id\",\n run_id=\"run_id\",\n)\nprint(run_step.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const runStep = await openai.beta.threads.runs.steps.retrieve(\n \"step_abc123\",\n { thread_id: \"thread_abc123\", run_id: \"run_abc123\" }\n );\n console.log(runStep);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst runStep = await client.beta.threads.runs.steps.retrieve('step_id', {\n thread_id: 'thread_id',\n run_id: 'run_id',\n});\n\nconsole.log(runStep.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trunStep, err := client.Beta.Threads.Runs.Steps.Get(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\t\"step_id\",\n\t\topenai.BetaThreadRunStepGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", runStep.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.steps.RunStep;\nimport com.openai.models.beta.threads.runs.steps.StepRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n StepRetrieveParams params = StepRetrieveParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .stepId(\"step_id\")\n .build();\n RunStep runStep = client.beta().threads().runs().steps().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun_step = openai.beta.threads.runs.steps.retrieve(\"step_id\", thread_id: \"thread_id\", run_id: \"run_id\")\n\nputs(run_step)"
+ },
+ "response": "{\n \"id\": \"step_abc123\",\n \"object\": \"thread.run.step\",\n \"created_at\": 1699063291,\n \"run_id\": \"run_abc123\",\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"type\": \"message_creation\",\n \"status\": \"completed\",\n \"cancelled_at\": null,\n \"completed_at\": 1699063291,\n \"expired_at\": null,\n \"failed_at\": null,\n \"last_error\": null,\n \"step_details\": {\n \"type\": \"message_creation\",\n \"message_creation\": {\n \"message_id\": \"msg_abc123\"\n }\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs": {
+ "post": {
+ "operationId": "Threads_submitToolOuputsToRun",
+ "summary": "Create a tool ouputs to run",
+ "description": "Creates a tool ouputs to run from the supplied request.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) to which this run belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run that requires the tool output submission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.SubmitToolOutputsRunRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Submit tool outputs to run",
+ "group": "threads",
+ "beta": true,
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"tool_outputs\": [\n {\n \"tool_call_id\": \"call_001\",\n \"output\": \"70 degrees and sunny.\"\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.submit_tool_outputs(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n tool_outputs=[{}],\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.submitToolOutputs(\n \"run_123\",\n {\n thread_id: \"thread_123\",\n tool_outputs: [\n {\n tool_call_id: \"call_001\",\n output: \"70 degrees and sunny.\",\n },\n ],\n }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.submitToolOutputs('run_id', {\n thread_id: 'thread_id',\n tool_outputs: [{}],\n});\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.SubmitToolOutputs(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\topenai.BetaThreadRunSubmitToolOutputsParams{\n\t\t\tToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())\n .build();\n Run run = client.beta().threads().runs().submitToolOutputs(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.submit_tool_outputs(\"run_id\", thread_id: \"thread_id\", tool_outputs: [{}])\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699075592,\n \"assistant_id\": \"asst_123\",\n \"thread_id\": \"thread_123\",\n \"status\": \"queued\",\n \"started_at\": 1699075592,\n \"expires_at\": 1699076192,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": null,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\"]\n }\n }\n }\n ],\n \"metadata\": {},\n \"usage\": null,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"tool_outputs\": [\n {\n \"tool_call_id\": \"call_001\",\n \"output\": \"70 degrees and sunny.\"\n }\n ],\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.submit_tool_outputs(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n tool_outputs=[{}],\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const stream = await openai.beta.threads.runs.submitToolOutputs(\n \"run_123\",\n {\n thread_id: \"thread_123\",\n tool_outputs: [\n {\n tool_call_id: \"call_001\",\n output: \"70 degrees and sunny.\",\n },\n ],\n }\n );\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.submitToolOutputs('run_id', {\n thread_id: 'thread_id',\n tool_outputs: [{}],\n});\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.SubmitToolOutputs(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\topenai.BetaThreadRunSubmitToolOutputsParams{\n\t\t\tToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())\n .build();\n Run run = client.beta().threads().runs().submitToolOutputs(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.submit_tool_outputs(\"run_id\", thread_id: \"thread_id\", tool_outputs: [{}])\n\nputs(run)"
+ },
+ "response": "event: thread.run.step.completed\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710352449,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"tool_calls\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710352475,\"expires_at\":1710353047,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"id\":\"call_iWr0kQ2EaYMaxNdl0v3KYkx7\",\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"arguments\":\"{\"location\":\"San Francisco, CA\",\"unit\":\"fahrenheit\"}\",\"output\":\"70 degrees and sunny.\"}}]},\"usage\":{\"prompt_tokens\":291,\"completion_tokens\":24,\"total_tokens\":315}}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710352447,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":1710352448,\"expires_at\":1710353047,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710352447,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":1710352475,\"expires_at\":1710353047,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_002\",\"object\":\"thread.run.step\",\"created_at\":1710352476,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710353047,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_002\"}},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_002\",\"object\":\"thread.run.step\",\"created_at\":1710352476,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710353047,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_002\"}},\"usage\":null}\n\nevent: thread.message.created\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message\",\"created_at\":1710352476,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.in_progress\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message\",\"created_at\":1710352476,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"The\",\"annotations\":[]}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" current\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" weather\"}}]}}\n\n...\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" sunny\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\".\"}}]}}\n\nevent: thread.message.completed\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message\",\"created_at\":1710352476,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"completed\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":1710352477,\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":{\"value\":\"The current weather in San Francisco, CA is 70 degrees Fahrenheit and sunny.\",\"annotations\":[]}}],\"metadata\":{}}\n\nevent: thread.run.step.completed\ndata: {\"id\":\"step_002\",\"object\":\"thread.run.step\",\"created_at\":1710352476,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710352477,\"expires_at\":1710353047,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_002\"}},\"usage\":{\"prompt_tokens\":329,\"completion_tokens\":18,\"total_tokens\":347}}\n\nevent: thread.run.completed\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710352447,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"completed\",\"started_at\":1710352475,\"expires_at\":null,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":1710352477,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: done\ndata: [DONE]\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/uploads": {
+ "post": {
+ "operationId": "Uploads_createUpload",
+ "summary": "Create an upload",
+ "description": "Creates an upload from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Upload"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Uploads"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateUploadRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create upload",
+ "group": "uploads",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/uploads \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"purpose\": \"fine-tune\",\n \"filename\": \"training_examples.jsonl\",\n \"bytes\": 2147483648,\n \"mime_type\": \"text/jsonl\",\n \"expires_after\": {\n \"anchor\": \"created_at\",\n \"seconds\": 3600\n }\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst upload = await client.uploads.create({\n bytes: 0,\n filename: 'filename',\n mime_type: 'mime_type',\n purpose: 'assistants',\n});\n\nconsole.log(upload.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nupload = client.uploads.create(\n bytes=0,\n filename=\"filename\",\n mime_type=\"mime_type\",\n purpose=\"assistants\",\n)\nprint(upload.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tupload, err := client.Uploads.New(context.TODO(), openai.UploadNewParams{\n\t\tBytes: 0,\n\t\tFilename: \"filename\",\n\t\tMimeType: \"mime_type\",\n\t\tPurpose: openai.FilePurposeAssistants,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", upload.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FilePurpose;\nimport com.openai.models.uploads.Upload;\nimport com.openai.models.uploads.UploadCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n UploadCreateParams params = UploadCreateParams.builder()\n .bytes(0L)\n .filename(\"filename\")\n .mimeType(\"mime_type\")\n .purpose(FilePurpose.ASSISTANTS)\n .build();\n Upload upload = client.uploads().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nupload = openai.uploads.create(bytes: 0, filename: \"filename\", mime_type: \"mime_type\", purpose: :assistants)\n\nputs(upload)"
+ },
+ "response": "{\n \"id\": \"upload_abc123\",\n \"object\": \"upload\",\n \"bytes\": 2147483648,\n \"created_at\": 1719184911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n \"status\": \"pending\",\n \"expires_at\": 1719127296\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/uploads/{upload_id}/cancel": {
+ "post": {
+ "operationId": "Uploads_cancelUpload",
+ "summary": "Cancel an upload",
+ "description": "Cancels an upload by its identifier.",
+ "parameters": [
+ {
+ "name": "upload_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the Upload.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Upload"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Uploads"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel upload",
+ "group": "uploads",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/uploads/upload_abc123/cancel\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst upload = await client.uploads.cancel('upload_abc123');\n\nconsole.log(upload.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nupload = client.uploads.cancel(\n \"upload_abc123\",\n)\nprint(upload.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tupload, err := client.Uploads.Cancel(context.TODO(), \"upload_abc123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", upload.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.uploads.Upload;\nimport com.openai.models.uploads.UploadCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Upload upload = client.uploads().cancel(\"upload_abc123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nupload = openai.uploads.cancel(\"upload_abc123\")\n\nputs(upload)"
+ },
+ "response": "{\n \"id\": \"upload_abc123\",\n \"object\": \"upload\",\n \"bytes\": 2147483648,\n \"created_at\": 1719184911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n \"status\": \"cancelled\",\n \"expires_at\": 1719127296\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/uploads/{upload_id}/complete": {
+ "post": {
+ "operationId": "Uploads_completeUpload",
+ "summary": "Create an upload",
+ "description": "Creates an upload from the supplied request.",
+ "parameters": [
+ {
+ "name": "upload_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the Upload.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Upload"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Uploads"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CompleteUploadRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Complete upload",
+ "group": "uploads",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/uploads/upload_abc123/complete\n -d '{\n \"part_ids\": [\"part_def456\", \"part_ghi789\"]\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst upload = await client.uploads.complete('upload_abc123', { part_ids: ['string'] });\n\nconsole.log(upload.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nupload = client.uploads.complete(\n upload_id=\"upload_abc123\",\n part_ids=[\"string\"],\n)\nprint(upload.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tupload, err := client.Uploads.Complete(\n\t\tcontext.TODO(),\n\t\t\"upload_abc123\",\n\t\topenai.UploadCompleteParams{\n\t\t\tPartIDs: []string{\"string\"},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", upload.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.uploads.Upload;\nimport com.openai.models.uploads.UploadCompleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n UploadCompleteParams params = UploadCompleteParams.builder()\n .uploadId(\"upload_abc123\")\n .addPartId(\"string\")\n .build();\n Upload upload = client.uploads().complete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nupload = openai.uploads.complete(\"upload_abc123\", part_ids: [\"string\"])\n\nputs(upload)"
+ },
+ "response": "{\n \"id\": \"upload_abc123\",\n \"object\": \"upload\",\n \"bytes\": 2147483648,\n \"created_at\": 1719184911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n \"status\": \"completed\",\n \"expires_at\": 1719127296,\n \"file\": {\n \"id\": \"file-xyz321\",\n \"object\": \"file\",\n \"bytes\": 2147483648,\n \"created_at\": 1719186911,\n \"expires_at\": 1719127296,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/uploads/{upload_id}/parts": {
+ "post": {
+ "operationId": "Uploads_addUploadPart",
+ "summary": "Add an upload part",
+ "description": "Adds an upload part to the parent resource.",
+ "parameters": [
+ {
+ "name": "upload_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the Upload.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UploadPart"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Uploads"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.AddUploadPartRequest"
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Add upload part",
+ "group": "uploads",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/uploads/upload_abc123/parts\n -F data=\"aHR0cHM6Ly9hcGkub3BlbmFpLmNvbS92MS91cGxvYWRz...\"\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst uploadPart = await client.uploads.parts.create('upload_abc123', {\n data: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(uploadPart.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nupload_part = client.uploads.parts.create(\n upload_id=\"upload_abc123\",\n data=b\"Example data\",\n)\nprint(upload_part.id)",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tuploadPart, err := client.Uploads.Parts.New(\n\t\tcontext.TODO(),\n\t\t\"upload_abc123\",\n\t\topenai.UploadPartNewParams{\n\t\t\tData: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", uploadPart.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.uploads.parts.PartCreateParams;\nimport com.openai.models.uploads.parts.UploadPart;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PartCreateParams params = PartCreateParams.builder()\n .uploadId(\"upload_abc123\")\n .data(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n UploadPart uploadPart = client.uploads().parts().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nupload_part = openai.uploads.parts.create(\"upload_abc123\", data: StringIO.new(\"Example data\"))\n\nputs(upload_part)"
+ },
+ "response": "{\n \"id\": \"part_def456\",\n \"object\": \"upload.part\",\n \"created_at\": 1719185911,\n \"upload_id\": \"upload_abc123\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores": {
+ "get": {
+ "operationId": "VectorStores_listVectorStores",
+ "summary": "List vector stores",
+ "description": "Lists vector stores matching the request filters.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoresResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "List vector stores",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStores = await openai.vectorStores.list();\n console.log(vectorStores);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vectorStore of client.vectorStores.list()) {\n console.log(vectorStore.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.List(context.TODO(), openai.VectorStoreListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStoreListPage;\nimport com.openai.models.vectorstores.VectorStoreListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStoreListPage page = client.vectorStores().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ\",\n \"description\": \"Contains commonly asked questions and answers, organized by topic.\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n },\n {\n \"id\": \"vs_abc456\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ v2\",\n \"description\": null,\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n }\n ],\n \"first_id\": \"vs_abc123\",\n \"last_id\": \"vs_abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "VectorStores_createVectorStore",
+ "summary": "Create a vector store",
+ "description": "Creates a vector store from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVectorStoreRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"name\": \"Support FAQ\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store = client.vector_stores.create()\nprint(vector_store.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStore = await openai.vectorStores.create({\n name: \"Support FAQ\"\n });\n console.log(vectorStore);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStore = await client.vectorStores.create();\n\nconsole.log(vectorStore.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStore, err := client.VectorStores.New(context.TODO(), openai.VectorStoreNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStore.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStore;\nimport com.openai.models.vectorstores.VectorStoreCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStore vectorStore = client.vectorStores().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store = openai.vector_stores.create\n\nputs(vector_store)"
+ },
+ "response": "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ\",\n \"description\": \"Contains commonly asked questions and answers, organized by topic.\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}": {
+ "delete": {
+ "operationId": "VectorStores_deleteVectorStore",
+ "summary": "Delete a vector store",
+ "description": "Deletes a vector store by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteVectorStoreResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_deleted = client.vector_stores.delete(\n \"vector_store_id\",\n)\nprint(vector_store_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const deletedVectorStore = await openai.vectorStores.delete(\n \"vs_abc123\"\n );\n console.log(deletedVectorStore);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreDeleted = await client.vectorStores.delete('vector_store_id');\n\nconsole.log(vectorStoreDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreDeleted, err := client.VectorStores.Delete(context.TODO(), \"vector_store_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStoreDeleteParams;\nimport com.openai.models.vectorstores.VectorStoreDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStoreDeleted vectorStoreDeleted = client.vectorStores().delete(\"vector_store_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_deleted = openai.vector_stores.delete(\"vector_store_id\")\n\nputs(vector_store_deleted)"
+ },
+ "response": "{\n id: \"vs_abc123\",\n object: \"vector_store.deleted\",\n deleted: true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "VectorStores_getVectorStore",
+ "summary": "Get a vector store",
+ "description": "Retrieves a vector store by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store = client.vector_stores.retrieve(\n \"vector_store_id\",\n)\nprint(vector_store.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStore = await openai.vectorStores.retrieve(\n \"vs_abc123\"\n );\n console.log(vectorStore);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStore = await client.vectorStores.retrieve('vector_store_id');\n\nconsole.log(vectorStore.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStore, err := client.VectorStores.Get(context.TODO(), \"vector_store_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStore.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStore;\nimport com.openai.models.vectorstores.VectorStoreRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStore vectorStore = client.vectorStores().retrieve(\"vector_store_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store = openai.vector_stores.retrieve(\"vector_store_id\")\n\nputs(vector_store)"
+ },
+ "response": "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "VectorStores_modifyVectorStore",
+ "summary": "Update a vector store",
+ "description": "Updates a vector store with the supplied changes.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store to modify.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UpdateVectorStoreRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Modify vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n -d '{\n \"name\": \"Support FAQ\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store = client.vector_stores.update(\n vector_store_id=\"vector_store_id\",\n)\nprint(vector_store.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStore = await openai.vectorStores.update(\n \"vs_abc123\",\n {\n name: \"Support FAQ\"\n }\n );\n console.log(vectorStore);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStore = await client.vectorStores.update('vector_store_id');\n\nconsole.log(vectorStore.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStore, err := client.VectorStores.Update(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\topenai.VectorStoreUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStore.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStore;\nimport com.openai.models.vectorstores.VectorStoreUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStore vectorStore = client.vectorStores().update(\"vector_store_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store = openai.vector_stores.update(\"vector_store_id\")\n\nputs(vector_store)"
+ },
+ "response": "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ\",\n \"description\": \"Contains commonly asked questions and answers, organized by topic.\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/file_batches": {
+ "post": {
+ "operationId": "VectorStores_createVectorStoreFileBatch",
+ "summary": "Create a vector store file batch",
+ "description": "Creates a vector store file batch from the supplied request.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store for which to create a File Batch.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileBatchRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create vector store file batch",
+ "group": "vector_stores",
+ "description": "Attaches multiple files to a vector store in one request. This is the recommended approach for multi-file ingestion, especially because per-vector-store file attach writes are rate-limited (300 requests/minute shared with `/vector_stores/{vector_store_id}/files`).\n",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"files\": [\n {\n \"file_id\": \"file-abc123\",\n \"attributes\": {\"category\": \"finance\"}\n },\n {\n \"file_id\": \"file-abc456\",\n \"chunking_strategy\": {\n \"type\": \"static\",\n \"max_chunk_size_tokens\": 1200,\n \"chunk_overlap_tokens\": 200\n }\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file_batch = client.vector_stores.file_batches.create(\n vector_store_id=\"vs_abc123\",\n)\nprint(vector_store_file_batch.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const myVectorStoreFileBatch = await openai.vectorStores.fileBatches.create(\n \"vs_abc123\",\n {\n files: [\n {\n file_id: \"file-abc123\",\n attributes: { category: \"finance\" },\n },\n {\n file_id: \"file-abc456\",\n chunking_strategy: {\n type: \"static\",\n max_chunk_size_tokens: 1200,\n chunk_overlap_tokens: 200,\n },\n },\n ]\n }\n );\n console.log(myVectorStoreFileBatch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFileBatch = await client.vectorStores.fileBatches.create('vs_abc123');\n\nconsole.log(vectorStoreFileBatch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFileBatch, err := client.VectorStores.FileBatches.New(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\topenai.VectorStoreFileBatchNewParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFileBatch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.filebatches.FileBatchCreateParams;\nimport com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().create(\"vs_abc123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file_batch = openai.vector_stores.file_batches.create(\"vs_abc123\")\n\nputs(vector_store_file_batch)"
+ },
+ "response": "{\n \"id\": \"vsfb_abc123\",\n \"object\": \"vector_store.file_batch\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"in_progress\",\n \"file_counts\": {\n \"in_progress\": 1,\n \"completed\": 1,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 0,\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}": {
+ "get": {
+ "operationId": "VectorStores_getVectorStoreFileBatch",
+ "summary": "Get a vector store file batch",
+ "description": "Retrieves a vector store file batch by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the file batch belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "batch_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file batch being retrieved.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve vector store file batch",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches/vsfb_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file_batch = client.vector_stores.file_batches.retrieve(\n batch_id=\"vsfb_abc123\",\n vector_store_id=\"vs_abc123\",\n)\nprint(vector_store_file_batch.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStoreFileBatch = await openai.vectorStores.fileBatches.retrieve(\n \"vsfb_abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(vectorStoreFileBatch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFileBatch = await client.vectorStores.fileBatches.retrieve('vsfb_abc123', {\n vector_store_id: 'vs_abc123',\n});\n\nconsole.log(vectorStoreFileBatch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFileBatch, err := client.VectorStores.FileBatches.Get(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\t\"vsfb_abc123\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFileBatch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.filebatches.FileBatchRetrieveParams;\nimport com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileBatchRetrieveParams params = FileBatchRetrieveParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .batchId(\"vsfb_abc123\")\n .build();\n VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file_batch = openai.vector_stores.file_batches.retrieve(\"vsfb_abc123\", vector_store_id: \"vs_abc123\")\n\nputs(vector_store_file_batch)"
+ },
+ "response": "{\n \"id\": \"vsfb_abc123\",\n \"object\": \"vector_store.file_batch\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"in_progress\",\n \"file_counts\": {\n \"in_progress\": 1,\n \"completed\": 1,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 0,\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": {
+ "post": {
+ "operationId": "VectorStores_cancelVectorStoreFileBatch",
+ "summary": "Cancel a vector store file batch",
+ "description": "Cancels a vector store file batch by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the file batch belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "batch_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file batch to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel vector store file batch",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X POST\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file_batch = client.vector_stores.file_batches.cancel(\n batch_id=\"batch_id\",\n vector_store_id=\"vector_store_id\",\n)\nprint(vector_store_file_batch.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const deletedVectorStoreFileBatch = await openai.vectorStores.fileBatches.cancel(\n \"vsfb_abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(deletedVectorStoreFileBatch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFileBatch = await client.vectorStores.fileBatches.cancel('batch_id', {\n vector_store_id: 'vector_store_id',\n});\n\nconsole.log(vectorStoreFileBatch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFileBatch, err := client.VectorStores.FileBatches.Cancel(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\t\"batch_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFileBatch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.filebatches.FileBatchCancelParams;\nimport com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileBatchCancelParams params = FileBatchCancelParams.builder()\n .vectorStoreId(\"vector_store_id\")\n .batchId(\"batch_id\")\n .build();\n VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().cancel(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file_batch = openai.vector_stores.file_batches.cancel(\"batch_id\", vector_store_id: \"vector_store_id\")\n\nputs(vector_store_file_batch)"
+ },
+ "response": "{\n \"id\": \"vsfb_abc123\",\n \"object\": \"vector_store.file_batch\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"in_progress\",\n \"file_counts\": {\n \"in_progress\": 12,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 15,\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": {
+ "get": {
+ "operationId": "VectorStores_listFilesInVectorStoreBatch",
+ "summary": "List files in vector store batch",
+ "description": "Lists files in vector store batch matching the request filters.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the files belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "batch_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file batch that the files belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "filter",
+ "in": "query",
+ "required": false,
+ "description": "Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesFilter"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "List vector store files in a batch",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.file_batches.list_files(\n batch_id=\"batch_id\",\n vector_store_id=\"vector_store_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStoreFiles = await openai.vectorStores.fileBatches.listFiles(\n \"vsfb_abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(vectorStoreFiles);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vectorStoreFile of client.vectorStores.fileBatches.listFiles('batch_id', {\n vector_store_id: 'vector_store_id',\n})) {\n console.log(vectorStoreFile.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.FileBatches.ListFiles(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\t\"batch_id\",\n\t\topenai.VectorStoreFileBatchListFilesParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.filebatches.FileBatchListFilesPage;\nimport com.openai.models.vectorstores.filebatches.FileBatchListFilesParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileBatchListFilesParams params = FileBatchListFilesParams.builder()\n .vectorStoreId(\"vector_store_id\")\n .batchId(\"batch_id\")\n .build();\n FileBatchListFilesPage page = client.vectorStores().fileBatches().listFiles(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.file_batches.list_files(\"batch_id\", vector_store_id: \"vector_store_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n },\n {\n \"id\": \"file-abc456\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n }\n ],\n \"first_id\": \"file-abc123\",\n \"last_id\": \"file-abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/files": {
+ "get": {
+ "operationId": "VectorStores_listVectorStoreFiles",
+ "summary": "List vector store files",
+ "description": "Lists vector store files matching the request filters.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the files belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "filter",
+ "in": "query",
+ "required": false,
+ "description": "Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesFilter"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "List vector store files",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.files.list(\n vector_store_id=\"vector_store_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStoreFiles = await openai.vectorStores.files.list(\n \"vs_abc123\"\n );\n console.log(vectorStoreFiles);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vectorStoreFile of client.vectorStores.files.list('vector_store_id')) {\n console.log(vectorStoreFile.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.Files.List(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\topenai.VectorStoreFileListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileListPage;\nimport com.openai.models.vectorstores.files.FileListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileListPage page = client.vectorStores().files().list(\"vector_store_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.files.list(\"vector_store_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n },\n {\n \"id\": \"file-abc456\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n }\n ],\n \"first_id\": \"file-abc123\",\n \"last_id\": \"file-abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "VectorStores_createVectorStoreFile",
+ "summary": "Create a vector store file",
+ "description": "Creates a vector store file from the supplied request.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store for which to create a File.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create vector store file",
+ "group": "vector_stores",
+ "description": "Attaches one file to a vector store. File attach writes are rate-limited per vector store (300 requests/minute shared with `/vector_stores/{vector_store_id}/file_batches`), so use file batches when uploading multiple files.\n",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"file_id\": \"file-abc123\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file = client.vector_stores.files.create(\n vector_store_id=\"vs_abc123\",\n file_id=\"file_id\",\n)\nprint(vector_store_file.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const myVectorStoreFile = await openai.vectorStores.files.create(\n \"vs_abc123\",\n {\n file_id: \"file-abc123\"\n }\n );\n console.log(myVectorStoreFile);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFile = await client.vectorStores.files.create('vs_abc123', { file_id: 'file_id' });\n\nconsole.log(vectorStoreFile.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFile, err := client.VectorStores.Files.New(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\topenai.VectorStoreFileNewParams{\n\t\t\tFileID: \"file_id\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFile.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileCreateParams;\nimport com.openai.models.vectorstores.files.VectorStoreFile;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileCreateParams params = FileCreateParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .fileId(\"file_id\")\n .build();\n VectorStoreFile vectorStoreFile = client.vectorStores().files().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file = openai.vector_stores.files.create(\"vs_abc123\", file_id: \"file_id\")\n\nputs(vector_store_file)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"usage_bytes\": 1234,\n \"vector_store_id\": \"vs_abcd\",\n \"status\": \"completed\",\n \"last_error\": null\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/files/{file_id}": {
+ "delete": {
+ "operationId": "VectorStores_deleteVectorStoreFile",
+ "summary": "Delete a vector store file",
+ "description": "Deletes a vector store file by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the file belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteVectorStoreFileResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete vector store file",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file_deleted = client.vector_stores.files.delete(\n file_id=\"file_id\",\n vector_store_id=\"vector_store_id\",\n)\nprint(vector_store_file_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const deletedVectorStoreFile = await openai.vectorStores.files.delete(\n \"file-abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(deletedVectorStoreFile);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFileDeleted = await client.vectorStores.files.delete('file_id', {\n vector_store_id: 'vector_store_id',\n});\n\nconsole.log(vectorStoreFileDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFileDeleted, err := client.VectorStores.Files.Delete(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\t\"file_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFileDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileDeleteParams;\nimport com.openai.models.vectorstores.files.VectorStoreFileDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileDeleteParams params = FileDeleteParams.builder()\n .vectorStoreId(\"vector_store_id\")\n .fileId(\"file_id\")\n .build();\n VectorStoreFileDeleted vectorStoreFileDeleted = client.vectorStores().files().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file_deleted = openai.vector_stores.files.delete(\"file_id\", vector_store_id: \"vector_store_id\")\n\nputs(vector_store_file_deleted)"
+ },
+ "response": "{\n id: \"file-abc123\",\n object: \"vector_store.file.deleted\",\n deleted: true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "VectorStores_getVectorStoreFile",
+ "summary": "Get a vector store file",
+ "description": "Retrieves a vector store file by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the file belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file being retrieved.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve vector store file",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file = client.vector_stores.files.retrieve(\n file_id=\"file-abc123\",\n vector_store_id=\"vs_abc123\",\n)\nprint(vector_store_file.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStoreFile = await openai.vectorStores.files.retrieve(\n \"file-abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(vectorStoreFile);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFile = await client.vectorStores.files.retrieve('file-abc123', {\n vector_store_id: 'vs_abc123',\n});\n\nconsole.log(vectorStoreFile.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFile, err := client.VectorStores.Files.Get(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\t\"file-abc123\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFile.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileRetrieveParams;\nimport com.openai.models.vectorstores.files.VectorStoreFile;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileRetrieveParams params = FileRetrieveParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .fileId(\"file-abc123\")\n .build();\n VectorStoreFile vectorStoreFile = client.vectorStores().files().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file = openai.vector_stores.files.retrieve(\"file-abc123\", vector_store_id: \"vs_abc123\")\n\nputs(vector_store_file)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abcd\",\n \"status\": \"completed\",\n \"last_error\": null\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "VectorStores_updateVectorStoreFileAttributes",
+ "summary": "Update vector store file attributes",
+ "description": "Updates vector store file attributes with the supplied changes.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store the file belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file to update attributes.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UpdateVectorStoreFileAttributesRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Update vector store file attributes",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id} \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"attributes\": {\"key1\": \"value1\", \"key2\": 2}}'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFile = await client.vectorStores.files.update('file-abc123', {\n vector_store_id: 'vs_abc123',\n attributes: { foo: 'string' },\n});\n\nconsole.log(vectorStoreFile.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file = client.vector_stores.files.update(\n file_id=\"file-abc123\",\n vector_store_id=\"vs_abc123\",\n attributes={\n \"foo\": \"string\"\n },\n)\nprint(vector_store_file.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFile, err := client.VectorStores.Files.Update(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\t\"file-abc123\",\n\t\topenai.VectorStoreFileUpdateParams{\n\t\t\tAttributes: map[string]openai.VectorStoreFileUpdateParamsAttributeUnion{\n\t\t\t\t\"foo\": {\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFile.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.vectorstores.files.FileUpdateParams;\nimport com.openai.models.vectorstores.files.VectorStoreFile;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileUpdateParams params = FileUpdateParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .fileId(\"file-abc123\")\n .attributes(FileUpdateParams.Attributes.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"string\"))\n .build())\n .build();\n VectorStoreFile vectorStoreFile = client.vectorStores().files().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file = openai.vector_stores.files.update(\n \"file-abc123\",\n vector_store_id: \"vs_abc123\",\n attributes: {foo: \"string\"}\n)\n\nputs(vector_store_file)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"usage_bytes\": 1234,\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abcd\",\n \"status\": \"completed\",\n \"last_error\": null,\n \"chunking_strategy\": {...},\n \"attributes\": {\"key1\": \"value1\", \"key2\": 2}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/content": {
+ "get": {
+ "operationId": "VectorStores_retrieveVectorStoreFileContent",
+ "summary": "Get a vector store file content",
+ "description": "Retrieves a vector store file content by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file within the vector store.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileContentResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve vector store file content",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl \\\nhttps://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123/content \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fileContentResponse of client.vectorStores.files.content('file-abc123', {\n vector_store_id: 'vs_abc123',\n})) {\n console.log(fileContentResponse.text);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.files.content(\n file_id=\"file-abc123\",\n vector_store_id=\"vs_abc123\",\n)\npage = page.data[0]\nprint(page.text)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.Files.Content(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\t\"file-abc123\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileContentPage;\nimport com.openai.models.vectorstores.files.FileContentParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileContentParams params = FileContentParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .fileId(\"file-abc123\")\n .build();\n FileContentPage page = client.vectorStores().files().content(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.files.content(\"file-abc123\", vector_store_id: \"vs_abc123\")\n\nputs(page)"
+ },
+ "response": "{\n \"file_id\": \"file-abc123\",\n \"filename\": \"example.txt\",\n \"attributes\": {\"key\": \"value\"},\n \"content\": [\n {\"type\": \"text\", \"text\": \"...\"},\n ...\n ]\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/search": {
+ "post": {
+ "operationId": "VectorStores_searchVectorStore",
+ "summary": "Search a vector store",
+ "description": "Searchs a vector store.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store to search.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Search vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST \\\nhttps://api.openai.com/v1/vector_stores/vs_abc123/search \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\"query\": \"What is the return policy?\", \"filters\": {...}}'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vectorStoreSearchResponse of client.vectorStores.search('vs_abc123', {\n query: 'string',\n})) {\n console.log(vectorStoreSearchResponse.file_id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.search(\n vector_store_id=\"vs_abc123\",\n query=\"string\",\n)\npage = page.data[0]\nprint(page.file_id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.Search(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\topenai.VectorStoreSearchParams{\n\t\t\tQuery: openai.VectorStoreSearchParamsQueryUnion{\n\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStoreSearchPage;\nimport com.openai.models.vectorstores.VectorStoreSearchParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStoreSearchParams params = VectorStoreSearchParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .query(\"string\")\n .build();\n VectorStoreSearchPage page = client.vectorStores().search(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.search(\"vs_abc123\", query: \"string\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"vector_store.search_results.page\",\n \"search_query\": \"What is the return policy?\",\n \"data\": [\n {\n \"file_id\": \"file_123\",\n \"filename\": \"document.pdf\",\n \"score\": 0.95,\n \"attributes\": {\n \"author\": \"John Doe\",\n \"date\": \"2023-01-01\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Relevant chunk\"\n }\n ]\n },\n {\n \"file_id\": \"file_456\",\n \"filename\": \"notes.txt\",\n \"score\": 0.89,\n \"attributes\": {\n \"author\": \"Jane Smith\",\n \"date\": \"2023-01-02\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Sample text content from the vector store.\"\n }\n ]\n }\n ],\n \"has_more\": false,\n \"next_page\": null\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/videos": {
+ "get": {
+ "operationId": "VideoGeneration_listVideos",
+ "summary": "List videos",
+ "description": "Lists videos matching the request filters.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of items to retrieve",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "minimum": 0,
+ "maximum": 100
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order of results by timestamp. Use `asc` for ascending order or `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last item from the previous pagination request",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoListResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "name": "List videos",
+ "group": "videos",
+ "path": "list for the organization.",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/videos \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from 'openai';\n\nconst openai = new OpenAI();\n\n// Automatically fetches more pages as needed.\nfor await (const video of openai.videos.list()) {\n console.log(video.id);\n}\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.videos.list()\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Videos.List(context.TODO(), openai.VideoListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.videos.list\n\nputs(page)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoListPage;\nimport com.openai.models.videos.VideoListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoListPage page = client.videos().list();\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const video of client.videos.list()) {\n console.log(video.id);\n}"
+ },
+ "response": "{\n \"data\": [\n {\n \"id\": \"video_123\",\n \"object\": \"video\",\n \"model\": \"sora-2\",\n \"status\": \"completed\"\n }\n ],\n \"object\": \"list\"\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "VideoGeneration_createVideo",
+ "summary": "Create a video",
+ "description": "Creates a video from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoMultipartBody"
+ },
+ "encoding": {
+ "model": {
+ "contentType": "text/plain"
+ },
+ "input_reference": {
+ "contentType": "application/octet-stream, application/json"
+ },
+ "seconds": {
+ "contentType": "application/json"
+ },
+ "size": {
+ "contentType": "application/json"
+ }
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create video",
+ "group": "videos",
+ "path": "create",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/videos \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"model=sora-2\" \\\n -F \"prompt=A calico cat playing a piano on stage\"\n",
+ "javascript": "import OpenAI from 'openai';\n\nconst openai = new OpenAI();\n\nconst video = await openai.videos.create({ prompt: 'A calico cat playing a piano on stage' });\n\nconsole.log(video.id);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.create(\n prompt=\"x\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.New(context.TODO(), openai.VideoNewParams{\n\t\tPrompt: \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.create(prompt: \"x\")\n\nputs(video)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoCreateParams params = VideoCreateParams.builder()\n .prompt(\"x\")\n .build();\n Video video = client.videos().create(params);\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.create({ prompt: 'x' });\n\nconsole.log(video.id);"
+ },
+ "response": "{\n \"id\": \"video_123\",\n \"object\": \"video\",\n \"model\": \"sora-2\",\n \"status\": \"queued\",\n \"progress\": 0,\n \"created_at\": 1712697600,\n \"size\": \"1024x1792\",\n \"seconds\": \"8\",\n \"quality\": \"standard\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/characters": {
+ "post": {
+ "operationId": "VideoGeneration_createVideoCharacter",
+ "summary": "Create a video character",
+ "description": "Creates a video character from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoCharacterResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoCharacterBody"
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "examples": {
+ "response": "",
+ "request": {
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.videos.createCharacter({\n name: 'x',\n video: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(response.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.videos.create_character(\n name=\"x\",\n video=b\"Example data\",\n)\nprint(response.id)",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Videos.NewCharacter(context.TODO(), openai.VideoNewCharacterParams{\n\t\tName: \"x\",\n\t\tVideo: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoCreateCharacterParams;\nimport com.openai.models.videos.VideoCreateCharacterResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoCreateCharacterParams params = VideoCreateCharacterParams.builder()\n .name(\"x\")\n .video(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n VideoCreateCharacterResponse response = client.videos().createCharacter(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.videos.create_character(name: \"x\", video: StringIO.new(\"Example data\"))\n\nputs(response)"
+ }
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/characters/{character_id}": {
+ "get": {
+ "operationId": "VideoGeneration_getVideoCharacter",
+ "summary": "Get a video character",
+ "description": "Retrieves a video character by its identifier.",
+ "parameters": [
+ {
+ "name": "character_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the character to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoCharacterResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "examples": {
+ "response": "",
+ "request": {
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.videos.getCharacter('char_123');\n\nconsole.log(response.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.videos.get_character(\n \"char_123\",\n)\nprint(response.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Videos.GetCharacter(context.TODO(), \"char_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoGetCharacterParams;\nimport com.openai.models.videos.VideoGetCharacterResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoGetCharacterResponse response = client.videos().getCharacter(\"char_123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.videos.get_character(\"char_123\")\n\nputs(response)"
+ }
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/edits": {
+ "post": {
+ "operationId": "VideoGeneration_createVideoEditMultipart_VideoGeneration_createVideoEditJson",
+ "parameters": [],
+ "description": "Creates a video edit from the supplied request. Creates a video edit from the supplied request.",
+ "summary": "Create a video edit Create a video edit",
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "x-ms-request-body-description-override": "The request body.",
+ "x-ms-description-override": "Creates a video edit from the supplied request.",
+ "x-ms-summary-override": "Create a video edit",
+ "x-oaiMeta": {
+ "examples": {
+ "response": "",
+ "request": {
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.edit({ prompt: 'x', video: fs.createReadStream('path/to/file') });\n\nconsole.log(video.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.edit(\n prompt=\"x\",\n video=b\"Example data\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Edit(context.TODO(), openai.VideoEditParams{\n\t\tPrompt: \"x\",\n\t\tVideo: openai.VideoEditParamsVideoUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoEditParams;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoEditParams params = VideoEditParams.builder()\n .prompt(\"x\")\n .video(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n Video video = client.videos().edit(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.edit(prompt: \"x\", video: StringIO.new(\"Example data\"))\n\nputs(video)"
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoEditMultipartBody"
+ },
+ "encoding": {
+ "video": {
+ "contentType": "application/octet-stream, application/json"
+ }
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoEditJsonBody"
+ }
+ }
+ },
+ "description": "The multipart request body. The request body."
+ }
+ }
+ },
+ "/openai/v1/videos/extensions": {
+ "post": {
+ "operationId": "VideoGeneration_createVideoExtendMultipart_VideoGeneration_createVideoExtendJson",
+ "parameters": [],
+ "description": "Extends a video from the supplied request. Extends a video from the supplied request.",
+ "summary": "Extend a video Extend a video",
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "x-ms-request-body-description-override": "The request body.",
+ "x-ms-description-override": "Extends a video from the supplied request.",
+ "x-ms-summary-override": "Extend a video",
+ "x-oaiMeta": {
+ "examples": {
+ "response": "",
+ "request": {
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.extend({\n prompt: 'x',\n seconds: '4',\n video: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(video.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.extend(\n prompt=\"x\",\n seconds=\"4\",\n video=b\"Example data\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Extend(context.TODO(), openai.VideoExtendParams{\n\t\tPrompt: \"x\",\n\t\tSeconds: openai.VideoSeconds4,\n\t\tVideo: openai.VideoExtendParamsVideoUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoExtendParams;\nimport com.openai.models.videos.VideoSeconds;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoExtendParams params = VideoExtendParams.builder()\n .prompt(\"x\")\n .seconds(VideoSeconds._4)\n .video(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n Video video = client.videos().extend(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.extend_(prompt: \"x\", seconds: :\"4\", video: StringIO.new(\"Example data\"))\n\nputs(video)"
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoExtendMultipartBody"
+ },
+ "encoding": {
+ "video": {
+ "contentType": "application/json, application/octet-stream"
+ },
+ "seconds": {
+ "contentType": "application/json"
+ }
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoExtendJsonBody"
+ }
+ }
+ },
+ "description": "The multipart request body. The request body."
+ }
+ }
+ },
+ "/openai/v1/videos/{video_id}": {
+ "delete": {
+ "operationId": "VideoGeneration_deleteVideo",
+ "summary": "Delete a video",
+ "description": "Deletes a video by its identifier.",
+ "parameters": [
+ {
+ "name": "video_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the video to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeletedVideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete video",
+ "group": "videos",
+ "path": "delete",
+ "examples": {
+ "response": "",
+ "request": {
+ "javascript": "import OpenAI from 'openai';\n\nconst client = new OpenAI();\n\nconst video = await client.videos.delete('video_123');\n\nconsole.log(video.id);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.delete(\n \"video_123\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Delete(context.TODO(), \"video_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.delete(\"video_123\")\n\nputs(video)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoDeleteParams;\nimport com.openai.models.videos.VideoDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoDeleteResponse video = client.videos().delete(\"video_123\");\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.delete('video_123');\n\nconsole.log(video.id);"
+ }
+ }
+ }
+ },
+ "get": {
+ "operationId": "VideoGeneration_getVideo",
+ "summary": "Get a video",
+ "description": "Retrieves a video by its identifier.",
+ "parameters": [
+ {
+ "name": "video_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the video to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve video",
+ "group": "videos",
+ "path": "retrieve matching the provided identifier.",
+ "examples": {
+ "response": "",
+ "request": {
+ "javascript": "import OpenAI from 'openai';\n\nconst client = new OpenAI();\n\nconst video = await client.videos.retrieve('video_123');\n\nconsole.log(video.id);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.retrieve(\n \"video_123\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Get(context.TODO(), \"video_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.retrieve(\"video_123\")\n\nputs(video)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Video video = client.videos().retrieve(\"video_123\");\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.retrieve('video_123');\n\nconsole.log(video.id);"
+ }
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/{video_id}/content": {
+ "get": {
+ "operationId": "VideoGeneration_retrieveVideoContent",
+ "summary": "Get a video content",
+ "description": "Retrieves a video content by its identifier.",
+ "parameters": [
+ {
+ "name": "video_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the video whose media to download.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "variant",
+ "in": "query",
+ "required": false,
+ "description": "Which downloadable asset to return. Defaults to the MP4 video.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoContentVariant"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "video/mp4": {
+ "schema": {
+ "contentMediaType": "video/mp4"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve video content",
+ "group": "videos",
+ "path": "content",
+ "examples": {
+ "response": "",
+ "request": {
+ "javascript": "import OpenAI from 'openai';\n\nconst client = new OpenAI();\n\nconst response = await client.videos.downloadContent('video_123');\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.videos.download_content(\n video_id=\"video_123\",\n)\nprint(response)\ncontent = response.read()\nprint(content)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Videos.DownloadContent(\n\t\tcontext.TODO(),\n\t\t\"video_123\",\n\t\topenai.VideoDownloadContentParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.videos.download_content(\"video_123\")\n\nputs(response)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.videos.VideoDownloadContentParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n HttpResponse response = client.videos().downloadContent(\"video_123\");\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.videos.downloadContent('video_123');\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);"
+ }
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/{video_id}/remix": {
+ "post": {
+ "operationId": "VideoGeneration_createVideoRemix",
+ "summary": "Create a video remix",
+ "description": "Creates a video remix from the supplied request.",
+ "parameters": [
+ {
+ "name": "video_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the completed video to remix.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoRemixBody"
+ },
+ "encoding": {
+ "prompt": {
+ "contentType": "text/plain"
+ }
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Remix video",
+ "group": "videos",
+ "path": "remix using the provided prompt.",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/videos/video_123/remix \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"prompt\": \"Extend the scene with the cat taking a bow to the cheering audience\"\n }'\n",
+ "javascript": "import OpenAI from 'openai';\n\nconst client = new OpenAI();\n\nconst video = await client.videos.remix('video_123', { prompt: 'Extend the scene with the cat taking a bow to the cheering audience' });\n\nconsole.log(video.id);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.remix(\n video_id=\"video_123\",\n prompt=\"x\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Remix(\n\t\tcontext.TODO(),\n\t\t\"video_123\",\n\t\topenai.VideoRemixParams{\n\t\t\tPrompt: \"x\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.remix(\"video_123\", prompt: \"x\")\n\nputs(video)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoRemixParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoRemixParams params = VideoRemixParams.builder()\n .videoId(\"video_123\")\n .prompt(\"x\")\n .build();\n Video video = client.videos().remix(params);\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.remix('video_123', { prompt: 'x' });\n\nconsole.log(video.id);"
+ },
+ "response": "{\n \"id\": \"video_456\",\n \"object\": \"video\",\n \"model\": \"sora-2\",\n \"status\": \"queued\",\n \"progress\": 0,\n \"created_at\": 1712698600,\n \"size\": \"720x1280\",\n \"seconds\": \"8\",\n \"remixed_from_video_id\": \"video_123\"\n}\n"
+ }
+ }
+ }
+ },
+ "/redTeams/runs": {
+ "get": {
+ "operationId": "RedTeams_list",
+ "summary": "List redteams",
+ "description": "Returns the redteams available in the current project.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PagedRedTeam"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Redteams"
+ ]
+ }
+ },
+ "/redTeams/runs/{name}": {
+ "get": {
+ "operationId": "RedTeams_get",
+ "summary": "Get a redteam",
+ "description": "Retrieves the specified redteam and its configuration.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the red team run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RedTeam"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Redteams"
+ ]
+ }
+ },
+ "/redTeams/runs:run": {
+ "post": {
+ "operationId": "RedTeams_create",
+ "summary": "Create a redteam run",
+ "description": "Submits a new redteam run for execution with the provided configuration.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "The request has succeeded and a new resource has been created as a result.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RedTeam"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Redteams"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RedTeam"
+ }
+ }
+ },
+ "description": "Redteam to be run"
+ }
+ }
+ },
+ "/routines": {
+ "get": {
+ "operationId": "listRoutines",
+ "summary": "List routines",
+ "description": "Returns the routines available in the current project.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutinesParameters.limit"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutinesParameters.after"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutinesParameters.before"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutinesParameters.order"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Routine"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}": {
+ "put": {
+ "operationId": "createOrUpdateRoutine",
+ "summary": "Create or update a routine",
+ "description": "Creates a new routine or replaces an existing routine with the supplied definition.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/CreateOrUpdateRoutineParameters.routine_name"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Routine"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RoutineCreateOrUpdateRequest"
+ }
+ }
+ }
+ },
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "get": {
+ "operationId": "getRoutine",
+ "summary": "Get a routine",
+ "description": "Retrieves the specified routine and its current configuration.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/GetRoutineParameters"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Routine"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "delete": {
+ "operationId": "deleteRoutine",
+ "summary": "Delete a routine",
+ "description": "Deletes the specified routine.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/DeleteRoutineParameters"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "There is no content to send for this request, but the headers may be useful."
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}/runs": {
+ "get": {
+ "operationId": "listRoutineRuns",
+ "summary": "List prior runs for a routine",
+ "description": "Returns prior runs recorded for the specified routine.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.routine_name"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.filter"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.limit"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.after"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.before"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.order"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RoutineRun"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}:disable": {
+ "post": {
+ "operationId": "disableRoutine",
+ "summary": "Disable a routine",
+ "description": "Disables the specified routine so it no longer runs.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/DisableRoutineParameters"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Routine"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}:dispatch_async": {
+ "post": {
+ "operationId": "dispatchRoutineAsync",
+ "summary": "Queue an asynchronous routine dispatch",
+ "description": "Queues an asynchronous dispatch for the specified routine.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/DispatchRoutineAsyncParameters.routine_name"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DispatchRoutineResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DispatchRoutineRequest"
+ }
+ }
+ }
+ },
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}:enable": {
+ "post": {
+ "operationId": "enableRoutine",
+ "summary": "Enable a routine",
+ "description": "Enables the specified routine so it can be dispatched.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/EnableRoutineParameters"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Routine"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/schedules": {
+ "get": {
+ "operationId": "Schedules_list",
+ "summary": "List schedules",
+ "description": "Returns schedules that match the supplied type and enabled filters.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "type",
+ "in": "query",
+ "required": false,
+ "description": "Filter by the type of schedule.",
+ "schema": {
+ "$ref": "#/components/schemas/ScheduleTaskType"
+ },
+ "explode": false
+ },
+ {
+ "name": "enabled",
+ "in": "query",
+ "required": false,
+ "description": "Filter by the enabled status.",
+ "schema": {
+ "type": "boolean"
+ },
+ "explode": false
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PagedSchedule"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ }
+ },
+ "/schedules/{id}": {
+ "delete": {
+ "operationId": "Schedules_delete",
+ "summary": "Delete a schedule",
+ "description": "Deletes the specified schedule resource.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "There is no content to send for this request, but the headers may be useful."
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ },
+ "get": {
+ "operationId": "Schedules_get",
+ "summary": "Get a schedule",
+ "description": "Retrieves the specified schedule resource.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Schedule"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ },
+ "put": {
+ "operationId": "Schedules_createOrUpdate",
+ "summary": "Create or update a schedule",
+ "description": "Creates a new schedule or updates an existing schedule with the supplied definition.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Schedule"
+ }
+ }
+ }
+ },
+ "201": {
+ "description": "The request has succeeded and a new resource has been created as a result.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Schedule"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Schedule"
+ }
+ }
+ },
+ "description": "The resource instance."
+ }
+ }
+ },
+ "/schedules/{id}/runs": {
+ "get": {
+ "operationId": "Schedules_listRuns",
+ "summary": "List schedule runs",
+ "description": "Returns schedule runs that match the supplied filters.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "type",
+ "in": "query",
+ "required": false,
+ "description": "Filter by the type of schedule.",
+ "schema": {
+ "$ref": "#/components/schemas/ScheduleTaskType"
+ },
+ "explode": false
+ },
+ {
+ "name": "enabled",
+ "in": "query",
+ "required": false,
+ "description": "Filter by the enabled status.",
+ "schema": {
+ "type": "boolean"
+ },
+ "explode": false
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PagedScheduleRun"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ }
+ },
+ "/schedules/{schedule_id}/runs/{run_id}": {
+ "get": {
+ "operationId": "Schedules_getRun",
+ "summary": "Get a schedule run",
+ "description": "Retrieves the specified run for a schedule.",
+ "parameters": [
+ {
+ "name": "schedule_id",
+ "in": "path",
+ "required": true,
+ "description": "The unique identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The unique identifier of the schedule run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ScheduleRun"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ }
+ },
+ "/skills": {
+ "get": {
+ "operationId": "Skills_listSkills",
+ "summary": "List skills",
+ "description": "Returns the skills available in the current project.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Skill"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}": {
+ "get": {
+ "operationId": "Skills_getSkill",
+ "summary": "Retrieve a skill",
+ "description": "Retrieves the specified skill and its current configuration.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Skill"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "post": {
+ "operationId": "updateSkill",
+ "summary": "Update a skill",
+ "description": "Modifies the specified skill's configuration.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill to update.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Skill"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "default_version": {
+ "type": "string",
+ "description": "The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest."
+ }
+ },
+ "required": [
+ "default_version"
+ ]
+ }
+ }
+ }
+ },
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "delete": {
+ "operationId": "Skills_deleteSkill",
+ "summary": "Delete a skill",
+ "description": "Removes the specified skill and its associated versions.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteSkillResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}/content": {
+ "get": {
+ "operationId": "getSkillContent",
+ "summary": "Download the zip content for the default version of a skill",
+ "description": "Downloads the zip content for the default version of a skill.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The response body for downloading a skill package.",
+ "content": {
+ "application/zip": {
+ "schema": {
+ "contentMediaType": "application/zip"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}/versions": {
+ "post": {
+ "operationId": "createSkillVersion_createSkillVersionFromFiles",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill. If the skill does not exist, it will be created.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "description": "Creates a new version of a skill. If the skill does not exist, it will be created. Creates a new version of a skill from uploaded files via multipart form data.",
+ "summary": "Create a new version of a skill Create a skill version from uploaded files",
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SkillVersion"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "x-ms-description-override": "Creates a new version of a skill. If the skill does not exist, it will be created.",
+ "x-ms-summary-override": "Create a new version of a skill",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ },
+ "tags": [
+ "Skills"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "inline_content": {
+ "$ref": "#/components/schemas/SkillInlineContent",
+ "description": "Inline skill content for simple skills without file uploads. Foundry-specific extension."
+ },
+ "default": {
+ "type": "boolean",
+ "description": "Whether to set this version as the default."
+ }
+ }
+ }
+ },
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateSkillVersionFromFilesBody"
+ },
+ "encoding": {
+ "files": {
+ "contentType": "*/*"
+ },
+ "default": {
+ "contentType": "text/plain"
+ }
+ }
+ }
+ },
+ "description": "The multipart request content."
+ }
+ },
+ "get": {
+ "operationId": "listSkillVersions",
+ "summary": "List skill versions",
+ "description": "Returns the available versions for the specified skill.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill to list versions for.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/SkillVersion"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}/versions/{version}": {
+ "get": {
+ "operationId": "getSkillVersion",
+ "summary": "Retrieve a specific version of a skill",
+ "description": "Retrieves the specified version of a skill by name and version identifier.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version identifier to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SkillVersion"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "delete": {
+ "operationId": "deleteSkillVersion",
+ "summary": "Delete a specific version of a skill",
+ "description": "Removes the specified version of a skill.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version identifier to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteSkillVersionResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}/versions/{version}/content": {
+ "get": {
+ "operationId": "getSkillVersionContent",
+ "summary": "Download the zip content for a specific version of a skill",
+ "description": "Downloads the zip content for a specific version of a skill.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version to download content for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The response body for downloading a skill package.",
+ "content": {
+ "application/zip": {
+ "schema": {
+ "contentMediaType": "application/zip"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/toolboxes": {
+ "get": {
+ "operationId": "listToolboxes",
+ "summary": "List toolboxes",
+ "description": "Returns the toolboxes available in the current project.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolboxObject"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ }
+ },
+ "/toolboxes/{name}": {
+ "get": {
+ "operationId": "getToolbox",
+ "summary": "Retrieve a toolbox",
+ "description": "Retrieves the specified toolbox and its current configuration.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ToolboxObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ },
+ "patch": {
+ "operationId": "updateToolbox",
+ "summary": "Update a toolbox to point to a specific version",
+ "description": "Updates the toolbox's default version pointer to the specified version.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/UpdateToolboxRequest.name"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ToolboxObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateToolboxRequest"
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "operationId": "deleteToolbox",
+ "summary": "Delete a toolbox",
+ "description": "Removes the specified toolbox along with all of its versions.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "There is no content to send for this request, but the headers may be useful. "
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ }
+ },
+ "/toolboxes/{name}/versions": {
+ "post": {
+ "operationId": "createToolboxVersion",
+ "summary": "Create a new version of a toolbox",
+ "description": "Creates a new toolbox version, provisioning the toolbox itself if it does not already exist.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox. If the toolbox does not exist, it will be created.",
+ "schema": {
+ "type": "string",
+ "maxLength": 256
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ToolboxVersionObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the toolbox."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Arbitrary key-value metadata to associate with the toolbox."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolboxTool"
+ },
+ "description": "The list of tools to include in this version."
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolboxSkill"
+ },
+ "description": "The list of skill sources to include in this version. A skill reference specifies a skill name and optionally a version. If version is omitted, the skill's default version is used."
+ },
+ "policies": {
+ "$ref": "#/components/schemas/ToolboxPolicies",
+ "description": "Policy configuration for this toolbox version."
+ }
+ },
+ "required": [
+ "tools"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "operationId": "listToolboxVersions",
+ "summary": "List toolbox versions",
+ "description": "Returns the available versions for the specified toolbox.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox to list versions for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolboxVersionObject"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ }
+ },
+ "/toolboxes/{name}/versions/{version}": {
+ "get": {
+ "operationId": "getToolboxVersion",
+ "summary": "Retrieve a specific version of a toolbox",
+ "description": "Retrieves the specified version of a toolbox by name and version identifier.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version identifier to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ToolboxVersionObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ },
+ "delete": {
+ "operationId": "deleteToolboxVersion",
+ "summary": "Delete a specific version of a toolbox",
+ "description": "Removes the specified version of a toolbox.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version identifier to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "There is no content to send for this request, but the headers may be useful. "
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ }
+ }
+ },
+ "security": [
+ {
+ "OAuth2Auth": [
+ "https://ai.azure.com/.default"
+ ]
+ }
+ ],
+ "components": {
+ "parameters": {
+ "Azure.Core.ClientRequestIdHeader": {
+ "name": "x-ms-client-request-id",
+ "in": "header",
+ "required": false,
+ "description": "An opaque, globally-unique, client-generated string identifier for the request.",
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.uuid"
+ }
+ },
+ "Azure.Core.Foundations.ApiVersionParameter": {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string",
+ "minLength": 1
+ },
+ "explode": false
+ },
+ "CreateOrUpdateRoutineParameters.routine_name": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "DeleteRoutineParameters": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "DisableRoutineParameters": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "DispatchRoutineAsyncParameters.routine_name": {
"name": "routine_name",
"in": "path",
"required": true,
@@ -16833,277 +26137,12159 @@
"maxLength": 128
}
},
- "ListRoutinesParameters.after": {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "An opaque cursor returned as last_id by the previous list response.",
- "schema": {
- "type": "string"
+ "EnableRoutineParameters": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "GetRoutineParameters": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "ListRoutineRunsParameters.after": {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "An opaque cursor returned as last_id by the previous list-runs response.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.before": {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "Unsupported. Reserved for future backward pagination support.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.filter": {
+ "name": "filter",
+ "in": "query",
+ "required": false,
+ "description": "An optional MLflow search-runs filter expression applied within the routine's experiment.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.limit": {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "The maximum number of runs to return.",
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.order": {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "The ordering direction. Supported values are asc and desc.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.routine_name": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "ListRoutinesParameters.after": {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "An opaque cursor returned as last_id by the previous list response.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutinesParameters.before": {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "Unsupported. Reserved for future backward pagination support.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutinesParameters.limit": {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "The maximum number of routines to return.",
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "explode": false
+ },
+ "ListRoutinesParameters.order": {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "The ordering direction. Supported values are asc and desc.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "UpdateToolboxRequest.name": {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox to update.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "schemas": {
+ "A2APreviewTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "a2a_preview"
+ ],
+ "description": "The type of the tool. Always `\"a2a_preview`."
+ },
+ "base_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "Base URL of the agent."
+ },
+ "agent_card_path": {
+ "type": "string",
+ "description": "The path to the agent card relative to the `base_url`.\nIf not provided, defaults to `/.well-known/agent-card.json`"
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The connection ID in the project for the A2A server.\nThe connection stores authentication and other connection details needed to connect to the A2A server."
+ },
+ "send_credentials_for_agent_card": {
+ "type": "boolean",
+ "description": "When `true`, Foundry sends its credentials when fetching the remote\nagent's Agent Card. The service defaults to `false` if a value is not\nspecified by the caller (anonymous fetch).",
+ "default": false
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "An agent implementing the A2A protocol.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "A2APreviewToolboxTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "a2a_preview"
+ ]
+ },
+ "base_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "Base URL of the agent."
+ },
+ "agent_card_path": {
+ "type": "string",
+ "description": "The path to the agent card relative to the `base_url`.\nIf not provided, defaults to `/.well-known/agent-card.json`"
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The connection ID in the project for the A2A server.\nThe connection stores authentication and other connection details needed to connect to the A2A server."
+ },
+ "send_credentials_for_agent_card": {
+ "type": "boolean",
+ "description": "When `true`, Foundry sends its credentials when fetching the remote\nagent's Agent Card. The service defaults to `false` if a value is not\nspecified by the caller (anonymous fetch).",
+ "default": false
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "An A2A tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "A2AProtocolConfiguration": {
+ "type": "object",
+ "description": "Configuration specific to the A2A protocol."
+ },
+ "A2AToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "a2a_preview_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the A2A agent card being called."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "An A2A (Agent-to-Agent) tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "A2AToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "a2a_preview_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the A2A agent card that was called."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the A2A tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of an A2A (Agent-to-Agent) tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "AISearchIndexResource": {
+ "type": "object",
+ "properties": {
+ "project_connection_id": {
+ "type": "string",
+ "description": "An index connection ID in an IndexResource attached to this agent."
+ },
+ "index_name": {
+ "type": "string",
+ "description": "The name of an index in an IndexResource attached to this agent."
+ },
+ "query_type": {
+ "$ref": "#/components/schemas/AzureAISearchQueryType",
+ "description": "Type of query in an AIIndexResource attached to this agent."
+ },
+ "top_k": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Number of documents to retrieve from search and present to the model."
+ },
+ "filter": {
+ "type": "string",
+ "description": "filter string for search resource. [Learn more here](https://learn.microsoft.com/azure/search/search-filters)."
+ },
+ "index_asset_id": {
+ "type": "string",
+ "description": "Index asset id for search resource."
+ }
+ },
+ "description": "A AI Search Index resource."
+ },
+ "ActivityProtocolConfiguration": {
+ "type": "object",
+ "properties": {
+ "enable_m365_public_endpoint": {
+ "type": "boolean",
+ "description": "Whether to enable the M365 public endpoint for the activity protocol."
+ }
+ },
+ "description": "Configuration specific to the activity protocol."
+ },
+ "AgentBlueprintReference": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/AgentBlueprintReferenceType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "ManagedAgentIdentityBlueprint": "#/components/schemas/ManagedAgentIdentityBlueprintReference"
+ }
+ }
+ },
+ "AgentBlueprintReferenceType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "ManagedAgentIdentityBlueprint"
+ ]
+ }
+ ]
+ },
+ "AgentCard": {
+ "type": "object",
+ "required": [
+ "version",
+ "skills"
+ ],
+ "properties": {
+ "version": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32,
+ "description": "The version of the agent card."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 2048,
+ "description": "The description of the agent card."
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentCardSkill"
+ },
+ "minItems": 1,
+ "maxItems": 16,
+ "description": "The set of skills that an agent can perform."
+ }
+ }
+ },
+ "AgentCardSkill": {
+ "type": "object",
+ "required": [
+ "id",
+ "name"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "a unique identifier for the skill"
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 128,
+ "description": "The name of the skill"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 2048,
+ "description": "A description of the skill"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentCardSkillTag"
+ },
+ "maxItems": 5,
+ "description": "set of tagwords describing classes of capabilities for the skill"
+ },
+ "examples": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentCardSkillExample"
+ },
+ "maxItems": 5,
+ "description": "A list of example scenarios that the skill can perform."
+ }
+ }
+ },
+ "AgentCardSkillExample": {
+ "type": "string",
+ "maxLength": 1024,
+ "description": "A skill example string with a maximum length of 1024 characters."
+ },
+ "AgentCardSkillTag": {
+ "type": "string",
+ "maxLength": 32
+ },
+ "AgentCardUpdate": {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32,
+ "description": "The version of the agent card."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 2048,
+ "description": "The description of the agent card."
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentCardSkill"
+ },
+ "minItems": 1,
+ "maxItems": 16,
+ "description": "The set of skills that an agent can perform."
+ }
+ }
+ },
+ "AgentClusterInsightRequest": {
+ "type": "object",
+ "required": [
+ "type",
+ "agentName"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AgentClusterInsight"
+ ],
+ "description": "The type of request."
+ },
+ "agentName": {
+ "type": "string",
+ "description": "Identifier for the agent."
+ },
+ "modelConfiguration": {
+ "$ref": "#/components/schemas/InsightModelConfiguration",
+ "description": "Configuration of the model used in the insight generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightRequest"
+ }
+ ],
+ "description": "Insights on set of Agent Evaluation Results",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "AgentClusterInsightResult": {
+ "type": "object",
+ "required": [
+ "type",
+ "clusterInsight"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AgentClusterInsight"
+ ],
+ "description": "The type of insights result."
+ },
+ "clusterInsight": {
+ "$ref": "#/components/schemas/ClusterInsightResult"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightResult"
+ }
+ ],
+ "description": "Insights from the agent cluster analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "AgentDataGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "agent_name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "The source type for this source, which is Agent."
+ },
+ "agent_name": {
+ "type": "string",
+ "description": "The agent name to fetch instructions from."
+ },
+ "agent_version": {
+ "type": "string",
+ "description": "The agent version. If not specified, the latest version is used."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DataGenerationJobSource"
+ }
+ ],
+ "description": "Agent source for data generation jobs — references an agent to fetch instructions and metadata from.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "AgentDefinition": {
+ "type": "object",
+ "required": [
+ "kind"
+ ],
+ "properties": {
+ "kind": {
+ "$ref": "#/components/schemas/AgentKind"
+ },
+ "rai_config": {
+ "$ref": "#/components/schemas/RaiConfig",
+ "description": "Configuration for Responsible AI (RAI) content filtering and safety features."
+ }
+ },
+ "discriminator": {
+ "propertyName": "kind",
+ "mapping": {
+ "hosted": "#/components/schemas/HostedAgentDefinition",
+ "prompt": "#/components/schemas/PromptAgentDefinition",
+ "workflow": "#/components/schemas/WorkflowAgentDefinition",
+ "external": "#/components/schemas/ExternalAgentDefinition"
+ }
+ }
+ },
+ "AgentDefinitionOptInKeys": {
+ "type": "string",
+ "enum": [
+ "WorkflowAgents=V1Preview",
+ "ExternalAgents=V1Preview",
+ "DraftAgents=V1Preview"
+ ],
+ "description": "Feature opt-in keys for agent definition operations supporting hosted or workflow agents."
+ },
+ "AgentEndpointAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationSchemeType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "Entra": "#/components/schemas/EntraAuthorizationScheme",
+ "BotService": "#/components/schemas/BotServiceAuthorizationScheme",
+ "BotServiceRbac": "#/components/schemas/BotServiceRbacAuthorizationScheme",
+ "BotServiceTenant": "#/components/schemas/BotServiceTenantAuthorizationScheme"
+ }
+ }
+ },
+ "AgentEndpointAuthorizationSchemeType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Entra",
+ "BotService",
+ "BotServiceRbac",
+ "BotServiceTenant"
+ ]
+ }
+ ]
+ },
+ "AgentEndpointConfig": {
+ "type": "object",
+ "properties": {
+ "version_selector": {
+ "$ref": "#/components/schemas/VersionSelector",
+ "description": "The version selector of the agent endpoint determines how traffic is routed to different versions of the agent."
+ },
+ "protocol_configuration": {
+ "$ref": "#/components/schemas/ProtocolConfiguration",
+ "description": "Per-protocol configuration for the agent endpoint."
+ },
+ "authorization_schemes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ },
+ "description": "The authorization schemes supported by the agent endpoint"
+ }
+ }
+ },
+ "AgentEndpointConfigUpdate": {
+ "type": "object",
+ "properties": {
+ "version_selector": {
+ "$ref": "#/components/schemas/VersionSelectorUpdate",
+ "description": "The version selector of the agent endpoint determines how traffic is routed to different versions of the agent."
+ },
+ "protocol_configuration": {
+ "$ref": "#/components/schemas/ProtocolConfiguration",
+ "description": "Per-protocol configuration for the agent endpoint."
+ },
+ "authorization_schemes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ },
+ "description": "The authorization schemes supported by the agent endpoint"
+ }
+ }
+ },
+ "AgentEndpointProtocol": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "activity",
+ "responses",
+ "a2a",
+ "mcp",
+ "invocations",
+ "invocations_ws"
+ ]
+ }
+ ]
+ },
+ "AgentEvaluatorGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "agent_name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "The source type for this source, which is Agent."
+ },
+ "agent_name": {
+ "type": "string",
+ "description": "The agent name to fetch instructions from."
+ },
+ "agent_version": {
+ "type": "string",
+ "description": "The agent version. If not specified, the latest version is used."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
+ }
+ ],
+ "description": "Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "AgentFilterTraceSource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent_filter"
+ ],
+ "description": "The type of trace source, always `agent_filter`."
+ },
+ "agent_id": {
+ "type": "string",
+ "description": "The identifier of the agent to filter traces by."
+ },
+ "agent_name": {
+ "type": "string",
+ "description": "The name of the agent to filter traces by."
+ },
+ "agent_version": {
+ "type": "string",
+ "description": "The version of the agent to filter traces by."
+ },
+ "start_time": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "Start time for the trace query window, expressed as a Unix timestamp (seconds)."
+ },
+ "end_time": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "End time for the trace query window, expressed as a Unix timestamp (seconds)."
+ },
+ "max_traces": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of traces to sample. Must be greater than 0."
+ },
+ "filter_strategy": {
+ "$ref": "#/components/schemas/FilterStrategyType",
+ "description": "The strategy used to filter traces."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TraceSource"
+ }
+ ],
+ "description": "A trace source that selects traces by agent reference with time-based filtering."
+ },
+ "AgentIdentity": {
+ "type": "object",
+ "required": [
+ "principal_id",
+ "client_id"
+ ],
+ "properties": {
+ "principal_id": {
+ "type": "string",
+ "description": "The principal ID of the agent instance"
+ },
+ "client_id": {
+ "type": "string",
+ "description": "The client ID of the agent instance. Also referred to as the instance ID"
+ },
+ "status": {
+ "$ref": "#/components/schemas/AgentIdentityStatus",
+ "description": "The status of the agent identity. Present for both the agent instance identity and the agent blueprint."
+ }
+ }
+ },
+ "AgentIdentityStatus": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "active",
+ "disabled"
+ ]
+ }
+ ],
+ "description": "The status of an agent identity, applicable to both the agent instance identity and the agent blueprint."
+ },
+ "AgentKind": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "prompt",
+ "hosted",
+ "workflow",
+ "external"
+ ]
+ }
+ ]
+ },
+ "AgentObject": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "name",
+ "state",
+ "versions"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "The object type, which is always 'agent'."
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the agent."
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 63,
+ "description": "The name of the agent."
+ },
+ "state": {
+ "$ref": "#/components/schemas/AgentState",
+ "description": "The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests.",
+ "readOnly": true
+ },
+ "versions": {
+ "type": "object",
+ "properties": {
+ "latest": {
+ "$ref": "#/components/schemas/AgentVersionObject"
+ }
+ },
+ "required": [
+ "latest"
+ ],
+ "description": "The latest version of the agent."
+ },
+ "agent_endpoint": {
+ "$ref": "#/components/schemas/AgentEndpointConfig",
+ "description": "The endpoint configuration for the agent"
+ },
+ "instance_identity": {
+ "$ref": "#/components/schemas/AgentIdentity",
+ "description": "The instance identity of the agent",
+ "readOnly": true
+ },
+ "blueprint": {
+ "$ref": "#/components/schemas/AgentIdentity",
+ "description": "The blueprint for the agent",
+ "readOnly": true
+ },
+ "blueprint_reference": {
+ "$ref": "#/components/schemas/AgentBlueprintReference",
+ "description": "The blueprint for the agent",
+ "readOnly": true
+ },
+ "agent_card": {
+ "$ref": "#/components/schemas/AgentCard"
+ }
+ }
+ },
+ "AgentReference": {
+ "type": "object",
+ "required": [
+ "type",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent_reference"
+ ]
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The name of the agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version identifier of the agent."
+ }
+ }
+ },
+ "AgentSessionResource": {
+ "type": "object",
+ "required": [
+ "agent_session_id",
+ "version_indicator",
+ "status",
+ "created_at",
+ "last_accessed_at",
+ "expires_at"
+ ],
+ "properties": {
+ "agent_session_id": {
+ "type": "string",
+ "description": "The session identifier."
+ },
+ "version_indicator": {
+ "$ref": "#/components/schemas/VersionIndicator",
+ "description": "The version indicator determining which agent version backs this session."
+ },
+ "status": {
+ "$ref": "#/components/schemas/AgentSessionStatus",
+ "description": "The current status of the session."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) when the session was created.",
+ "readOnly": true
+ },
+ "last_accessed_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) when the session was last accessed.",
+ "readOnly": true
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).",
+ "readOnly": true
+ }
+ },
+ "description": "An agent session providing a long-lived compute sandbox for hosted agent invocations."
+ },
+ "AgentSessionStatus": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "creating",
+ "active",
+ "idle",
+ "updating",
+ "failed",
+ "deleting",
+ "deleted",
+ "expired"
+ ]
+ }
+ ],
+ "description": "The status of an agent session."
+ },
+ "AgentState": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "enabled",
+ "disabled"
+ ]
+ }
+ ],
+ "description": "The operational state of an agent."
+ },
+ "AgentTaxonomyInput": {
+ "type": "object",
+ "required": [
+ "type",
+ "target",
+ "riskCategories"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "Input type of the evaluation taxonomy."
+ },
+ "target": {
+ "$ref": "#/components/schemas/Target",
+ "description": "Target configuration for the agent."
+ },
+ "riskCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RiskCategory"
+ },
+ "description": "List of risk categories to evaluate against."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInput"
+ }
+ ],
+ "description": "Input configuration for the evaluation taxonomy when the input type is agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "AgentTaxonomyInputUpdate": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "Input type of the evaluation taxonomy."
+ },
+ "target": {
+ "$ref": "#/components/schemas/TargetUpdate",
+ "description": "Target configuration for the agent."
+ },
+ "riskCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RiskCategory"
+ },
+ "description": "List of risk categories to evaluate against."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInputUpdate"
+ }
+ ],
+ "description": "Input configuration for the evaluation taxonomy when the input type is agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "AgentVersionObject": {
+ "type": "object",
+ "required": [
+ "metadata",
+ "object",
+ "id",
+ "name",
+ "version",
+ "created_at",
+ "definition"
+ ],
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "agent.version"
+ ],
+ "description": "The object type, which is always 'agent.version'."
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the agent version."
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The name of the agent. Name can be used to retrieve/update/delete the agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version identifier of the agent. Agents are immutable and every update creates a new version while keeping the name same."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The Unix timestamp (seconds) when the agent was created."
+ },
+ "definition": {
+ "$ref": "#/components/schemas/AgentDefinition"
+ },
+ "draft": {
+ "type": "boolean",
+ "description": "Whether this agent version is a draft (candidate) rather than a release. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to false.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DraftAgents=V1Preview"
+ ]
+ },
+ "default": false
+ },
+ "status": {
+ "$ref": "#/components/schemas/AgentVersionStatus",
+ "description": "The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For hosted agents, reflects infrastructure readiness."
+ },
+ "instance_identity": {
+ "$ref": "#/components/schemas/AgentIdentity",
+ "description": "The instance identity of the agent",
+ "readOnly": true
+ },
+ "blueprint": {
+ "$ref": "#/components/schemas/AgentIdentity",
+ "description": "The blueprint for the agent",
+ "readOnly": true
+ },
+ "blueprint_reference": {
+ "$ref": "#/components/schemas/AgentBlueprintReference",
+ "description": "The blueprint for the agent",
+ "readOnly": true
+ },
+ "agent_guid": {
+ "type": "string",
+ "description": "The unique GUID identifier of the agent.",
+ "readOnly": true
+ }
+ }
+ },
+ "AgentVersionStatus": {
+ "type": "string",
+ "enum": [
+ "creating",
+ "active",
+ "failed",
+ "deleting",
+ "deleted"
+ ],
+ "description": "The provisioning status of an agent version."
+ },
+ "AgenticIdentityPreviewCredentials": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AgenticIdentityToken_Preview"
+ ],
+ "description": "The credential type",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BaseCredentials"
+ }
+ ],
+ "description": "Agentic identity credential definition"
+ },
+ "ApiErrorResponse": {
+ "type": "object",
+ "required": [
+ "error"
+ ],
+ "properties": {
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error"
+ }
+ },
+ "description": "Error response for API failures."
+ },
+ "ApiKeyCredentials": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "ApiKey"
+ ],
+ "description": "The credential type",
+ "readOnly": true
+ },
+ "key": {
+ "type": "string",
+ "description": "API Key",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BaseCredentials"
+ }
+ ],
+ "description": "API Key Credential definition"
+ },
+ "ArtifactProfile": {
+ "type": "object",
+ "required": [
+ "category"
+ ],
+ "properties": {
+ "category": {
+ "$ref": "#/components/schemas/FoundryModelArtifactProfileCategory",
+ "description": "The category of the artifact profile"
+ },
+ "signals": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FoundryModelArtifactProfileSignal"
+ },
+ "description": "Signals detected in the model artifact"
+ }
+ },
+ "description": "Artifact profile of the model",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "AssetCredentialResponse": {
+ "type": "object",
+ "required": [
+ "blobReference"
+ ],
+ "properties": {
+ "blobReference": {
+ "$ref": "#/components/schemas/BlobReference",
+ "description": "Credential info to access the storage account."
+ }
+ },
+ "description": "Represents a reference to a blob for consumption"
+ },
+ "AssetId": {
+ "type": "string",
+ "description": "Identifier of a saved asset."
+ },
+ "AttackStrategy": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "easy",
+ "moderate",
+ "difficult",
+ "ascii_art",
+ "ascii_smuggler",
+ "atbash",
+ "base64",
+ "binary",
+ "caesar",
+ "character_space",
+ "jailbreak",
+ "ansi_attack",
+ "character_swap",
+ "suffix_append",
+ "string_join",
+ "unicode_confusable",
+ "unicode_substitution",
+ "diacritic",
+ "flip",
+ "leetspeak",
+ "rot13",
+ "morse",
+ "url",
+ "baseline",
+ "indirect_jailbreak",
+ "tense",
+ "multi_turn",
+ "crescendo"
+ ]
+ }
+ ],
+ "description": "Strategies for attacks.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ },
+ "Azure.Core.Foundations.Error": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "One of a server-defined set of error codes."
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable representation of the error."
+ },
+ "target": {
+ "type": "string",
+ "description": "The target of the error."
+ },
+ "details": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.Error"
+ },
+ "description": "An array of details about specific errors that led to this reported error."
+ },
+ "innererror": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.InnerError",
+ "description": "An object containing more specific information than the current object about the error."
+ }
+ },
+ "description": "The error object."
+ },
+ "Azure.Core.Foundations.ErrorResponse": {
+ "type": "object",
+ "required": [
+ "error"
+ ],
+ "properties": {
+ "error": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.Error",
+ "description": "The error object."
+ }
+ },
+ "description": "A response containing error details."
+ },
+ "Azure.Core.Foundations.InnerError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "One of a server-defined set of error codes."
+ },
+ "innererror": {
+ "description": "Inner error.",
+ "$ref": "#/components/schemas/Azure.Core.Foundations.InnerError"
+ }
+ },
+ "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors."
+ },
+ "Azure.Core.Foundations.OperationState": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "NotStarted",
+ "Running",
+ "Succeeded",
+ "Failed",
+ "Canceled"
+ ]
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "description": "Enum describing allowed operation states."
+ },
+ "Azure.Core.uuid": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Universally Unique Identifier"
+ },
+ "AzureAIAgentTarget": {
+ "type": "object",
+ "required": [
+ "type",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_agent"
+ ],
+ "description": "The type of target, always `azure_ai_agent`."
+ },
+ "name": {
+ "type": "string",
+ "description": "The unique identifier of the Azure AI agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the Azure AI agent."
+ },
+ "tool_descriptions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolDescription"
+ },
+ "description": "The parameters used to control the sampling behavior of the agent during text generation."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Target"
+ }
+ ],
+ "description": "Represents a target specifying an Azure AI agent."
+ },
+ "AzureAIAgentTargetUpdate": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_agent"
+ ],
+ "description": "The type of target, always `azure_ai_agent`."
+ },
+ "name": {
+ "type": "string",
+ "description": "The unique identifier of the Azure AI agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the Azure AI agent."
+ },
+ "tool_descriptions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolDescription"
+ },
+ "description": "The parameters used to control the sampling behavior of the agent during text generation."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TargetUpdate"
+ }
+ ],
+ "description": "Represents a target specifying an Azure AI agent."
+ },
+ "AzureAIBenchmarkDataSourceConfig": {
+ "type": "object",
+ "required": [
+ "scenario",
+ "benchmark_name"
+ ],
+ "properties": {
+ "scenario": {
+ "type": "string",
+ "enum": [
+ "benchmark_preview"
+ ],
+ "description": "Data schema scenario, always `benchmark` for benchmark evaluations."
+ },
+ "benchmark_name": {
+ "type": "string",
+ "description": "The name of the benchmark specification."
+ },
+ "benchmark_version": {
+ "type": "string",
+ "description": "The version of the benchmark specification (e.g., '0.1'). Latest version if not specified."
+ },
+ "grader_model": {
+ "type": "string",
+ "description": "Optional grader model for benchmarks that use model graders, Required when the benchmark's testing_criteria uses a model grader type."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ }
+ ],
+ "description": "Data source configuration for benchmark evaluations."
+ },
+ "AzureAIBenchmarkPreviewEvalRunDataSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "target"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_benchmark_preview"
+ ],
+ "description": "The type of data source, always `azure_ai_benchmark_preview`."
+ },
+ "input_messages": {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference",
+ "description": "Input messages configuration."
+ },
+ "target": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/AzureAIModelTarget"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIAgentTarget"
+ }
+ ],
+ "description": "The target model or agent to evaluate against the benchmark.\nWhen using `azure_ai_model` target, `sampling_params` must not be provided;\ninference parameters are auto-filled from the benchmark specification stored in eval group properties."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Represents a data source for benchmark evaluation runs."
+ },
+ "AzureAIDataSourceConfig": {
+ "type": "object",
+ "required": [
+ "type",
+ "scenario"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_source"
+ ],
+ "description": "The object type, which is always `azure_ai_source`."
+ },
+ "scenario": {
+ "type": "string",
+ "enum": [
+ "red_team",
+ "responses",
+ "traces_preview",
+ "synthetic_data_gen_preview",
+ "benchmark_preview"
+ ],
+ "description": "Data schema scenario."
+ }
+ },
+ "discriminator": {
+ "propertyName": "scenario",
+ "mapping": {
+ "benchmark_preview": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DataSourceConfig"
+ }
+ ],
+ "description": "Base data source configuration for Azure AI evaluation scenarios."
+ },
+ "AzureAIModelTarget": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_model"
+ ],
+ "description": "The type of target, always `azure_ai_model`."
+ },
+ "model": {
+ "type": "string",
+ "description": "The unique identifier of the Azure AI model."
+ },
+ "sampling_params": {
+ "$ref": "#/components/schemas/ModelSamplingParams",
+ "description": "The parameters used to control the sampling behavior of the model during text generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Target"
+ }
+ ],
+ "description": "Represents a target specifying an Azure AI model for operations requiring model selection."
+ },
+ "AzureAIModelTargetUpdate": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_model"
+ ],
+ "description": "The type of target, always `azure_ai_model`."
+ },
+ "model": {
+ "type": "string",
+ "description": "The unique identifier of the Azure AI model."
+ },
+ "sampling_params": {
+ "$ref": "#/components/schemas/ModelSamplingParams",
+ "description": "The parameters used to control the sampling behavior of the model during text generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TargetUpdate"
+ }
+ ],
+ "description": "Represents a target specifying an Azure AI model for operations requiring model selection."
+ },
+ "AzureAIResponsesEvalRunDataSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "item_generation_params",
+ "max_runs_hourly",
+ "event_configuration_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_responses"
+ ],
+ "description": "The type of data source, always `azure_ai_responses`."
+ },
+ "item_generation_params": {
+ "$ref": "#/components/schemas/ResponseRetrievalItemGenerationParams",
+ "description": "The parameters for item generation."
+ },
+ "max_runs_hourly": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of evaluation runs allowed per hour."
+ },
+ "event_configuration_id": {
+ "type": "string",
+ "description": "The event configuration name associated with this evaluation run."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Represents a data source for evaluation runs that are specific to Continuous Evaluation scenarios."
+ },
+ "AzureAISearchIndex": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AzureSearch"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Index"
+ }
+ ],
+ "description": "Azure AI Search Index Definition"
+ },
+ "AzureAISearchIndexUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AzureSearch"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/IndexUpdate"
+ }
+ ],
+ "description": "Azure AI Search Index Definition"
+ },
+ "AzureAISearchQueryType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "simple",
+ "semantic",
+ "vector",
+ "vector_simple_hybrid",
+ "vector_semantic_hybrid"
+ ]
+ }
+ ],
+ "description": "Available query types for Azure AI Search tool."
+ },
+ "AzureAISearchTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "azure_ai_search"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_search"
+ ],
+ "description": "The object type, which is always 'azure_ai_search'."
+ },
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "azure_ai_search": {
+ "$ref": "#/components/schemas/AzureAISearchToolResource",
+ "description": "The azure ai search index resource."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for an Azure AI search tool as used to configure an agent."
+ },
+ "AzureAISearchToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_search_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "An Azure AI Search tool call."
+ },
+ "AzureAISearchToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_search_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Azure AI Search tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of an Azure AI Search tool call."
+ },
+ "AzureAISearchToolResource": {
+ "type": "object",
+ "required": [
+ "indexes"
+ ],
+ "properties": {
+ "indexes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AISearchIndexResource"
+ },
+ "maxItems": 1,
+ "description": "The indices attached to this agent. There can be a maximum of 1 index\nresource attached to the agent."
+ }
+ },
+ "description": "A set of index resources used by the `azure_ai_search` tool."
+ },
+ "AzureAISearchToolboxTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "azure_ai_search"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_search"
+ ]
+ },
+ "azure_ai_search": {
+ "$ref": "#/components/schemas/AzureAISearchToolResource",
+ "description": "The azure ai search index resource."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "An Azure AI Search tool stored in a toolbox."
+ },
+ "AzureAITraceDataSourcePreviewEvalRunDataSource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_trace_data_source_preview"
+ ],
+ "description": "The type of data source, always `azure_ai_trace_data_source_preview`."
+ },
+ "trace_source": {
+ "$ref": "#/components/schemas/TraceSource",
+ "description": "The trace source that defines how traces are selected for evaluation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "A wrapper data source that contains a polymorphic trace source to specify how traces are selected for evaluation."
+ },
+ "AzureContentFilterBlocklistIdResult": {
+ "type": "object",
+ "required": [
+ "id",
+ "filtered"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the custom blocklist."
+ },
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the blocklist resulted in filtering."
+ }
+ },
+ "description": "A content filter blocklist ID result."
+ },
+ "AzureContentFilterBlocklistResult": {
+ "type": "object",
+ "required": [
+ "filtered"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether any blocklist resulted in filtering."
+ },
+ "details": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AzureContentFilterBlocklistIdResult"
+ },
+ "description": "The pairs of individual blocklist IDs and their filtering results."
+ }
+ },
+ "description": "A collection of filtering results for configured custom blocklists."
+ },
+ "AzureContentFilterCitation": {
+ "type": "object",
+ "properties": {
+ "license": {
+ "type": "string",
+ "description": "The license associated with the detection."
+ },
+ "url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL associated with the license."
+ }
+ },
+ "description": "Citation details for protected material detection."
+ },
+ "AzureContentFilterCompletionTextSpan": {
+ "type": "object",
+ "required": [
+ "completion_start_offset",
+ "completion_end_offset"
+ ],
+ "properties": {
+ "completion_start_offset": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Offset of the UTF32 code point which begins the span."
+ },
+ "completion_end_offset": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Offset of the first UTF32 code point which is excluded from the span."
+ }
+ },
+ "description": "A representation of a span of completion text as used by Azure OpenAI content filter results."
+ },
+ "AzureContentFilterCompletionTextSpanDetectionResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected",
+ "details"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the content category was detected."
+ },
+ "details": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpan"
+ },
+ "description": "Detailed information about the detected completion text spans."
+ }
+ },
+ "description": "A content filter detection result with completion text span details."
+ },
+ "AzureContentFilterDetectionResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the content category was detected."
+ }
+ },
+ "description": "A content filter result indicating whether the content was detected and filtered."
+ },
+ "AzureContentFilterDetectionWithCitationResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the content category was detected."
+ },
+ "citation": {
+ "$ref": "#/components/schemas/AzureContentFilterCitation",
+ "description": "Citation details describing the associated license and its location."
+ }
+ },
+ "description": "A content filter detection result that includes citation information for protected material."
+ },
+ "AzureContentFilterDetectionWithReasonResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the content category was detected."
+ },
+ "reason": {
+ "type": "string",
+ "description": "A human-readable explanation of why the detection result was produced."
+ }
+ },
+ "description": "A content filter detection result that includes a reason description."
+ },
+ "AzureContentFilterError": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "integer",
+ "format": "int32",
+ "description": "A machine-readable error code."
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable error message."
+ }
+ },
+ "description": "Error details from the content filtering system."
+ },
+ "AzureContentFilterPersonallyIdentifiableInformationResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether PII was detected in the content."
+ },
+ "sub_categories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AzureContentFilterPiiSubCategoryResult"
+ },
+ "description": "Detailed results for individual PII subcategories."
+ }
+ },
+ "description": "A content filter detection result for Personally Identifiable Information."
+ },
+ "AzureContentFilterPiiSubCategoryResult": {
+ "type": "object",
+ "required": [
+ "sub_category",
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "sub_category": {
+ "type": "string",
+ "description": "The PII subcategory that was evaluated."
+ },
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered for this subcategory."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the subcategory was detected in the content."
+ }
+ },
+ "description": "Result details for an individual PII subcategory."
+ },
+ "AzureContentFilterResultsForResponses": {
+ "type": "object",
+ "properties": {
+ "sexual": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
+ "description": "Severity result for sexual content."
+ },
+ "hate": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
+ "description": "Severity result for hate content."
+ },
+ "violence": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
+ "description": "Severity result for violence content."
+ },
+ "self_harm": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
+ "description": "Severity result for self-harm content."
+ },
+ "profanity": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
+ "description": "Detection result for profanity."
+ },
+ "custom_blocklists": {
+ "$ref": "#/components/schemas/AzureContentFilterBlocklistResult",
+ "description": "Results for configured custom blocklists."
+ },
+ "jailbreak": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
+ "description": "Detection result for jailbreak attempts."
+ },
+ "task_adherence": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionWithReasonResult",
+ "description": "Detection result for task adherence evaluation."
+ },
+ "protected_material_text": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
+ "description": "Detection result for protected material text."
+ },
+ "protected_material_code": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionWithCitationResult",
+ "description": "Detection result for protected material code with citation."
+ },
+ "ungrounded_material": {
+ "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult",
+ "description": "Detection result for ungrounded material with completion text span details."
+ },
+ "personally_identifiable_information": {
+ "$ref": "#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult",
+ "description": "Detection result for Personally Identifiable Information."
+ },
+ "indirect_attack": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
+ "description": "Detection result for indirect attacks."
+ },
+ "error": {
+ "$ref": "#/components/schemas/AzureContentFilterError",
+ "description": "Error details if content filtering evaluation failed."
+ }
+ },
+ "description": "Content filter results for the Responses API."
+ },
+ "AzureContentFilterSeverity": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "safe",
+ "low",
+ "medium",
+ "high"
+ ]
+ }
+ ],
+ "description": "Ratings for the intensity and risk level of harmful content."
+ },
+ "AzureContentFilterSeverityResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "severity"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "severity": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverity",
+ "description": "The severity level of the content."
+ }
+ },
+ "description": "A content filter result indicating severity level and whether content was filtered."
+ },
+ "AzureFunctionBinding": {
+ "type": "object",
+ "required": [
+ "type",
+ "storage_queue"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "storage_queue"
+ ],
+ "description": "The type of binding, which is always 'storage_queue'."
+ },
+ "storage_queue": {
+ "$ref": "#/components/schemas/AzureFunctionStorageQueue",
+ "description": "Storage queue."
+ }
+ },
+ "description": "The structure for keeping storage queue name and URI."
+ },
+ "AzureFunctionDefinition": {
+ "type": "object",
+ "required": [
+ "function",
+ "input_binding",
+ "output_binding"
+ ],
+ "properties": {
+ "function": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the function to be called."
+ },
+ "description": {
+ "type": "string",
+ "description": "A description of what the function does, used by the model to choose when and how to call the function."
+ },
+ "parameters": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The parameters the functions accepts, described as a JSON Schema object."
+ }
+ },
+ "required": [
+ "name",
+ "parameters"
+ ],
+ "description": "The definition of azure function and its parameters."
+ },
+ "input_binding": {
+ "$ref": "#/components/schemas/AzureFunctionBinding",
+ "description": "Input storage queue. The queue storage trigger runs a function as messages are added to it."
+ },
+ "output_binding": {
+ "$ref": "#/components/schemas/AzureFunctionBinding",
+ "description": "Output storage queue. The function writes output to this queue when the input items are processed."
+ }
+ },
+ "description": "The definition of Azure function."
+ },
+ "AzureFunctionStorageQueue": {
+ "type": "object",
+ "required": [
+ "queue_service_endpoint",
+ "queue_name"
+ ],
+ "properties": {
+ "queue_service_endpoint": {
+ "type": "string",
+ "description": "URI to the Azure Storage Queue service allowing you to manipulate a queue."
+ },
+ "queue_name": {
+ "type": "string",
+ "description": "The name of an Azure function storage queue."
+ }
+ },
+ "description": "The structure for keeping storage queue name and URI."
+ },
+ "AzureFunctionTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "azure_function"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_function"
+ ],
+ "description": "The object type, which is always 'browser_automation'."
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "azure_function": {
+ "$ref": "#/components/schemas/AzureFunctionDefinition",
+ "description": "The Azure Function Tool definition."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for an Azure Function Tool, as used to configure an Agent."
+ },
+ "AzureFunctionToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_function_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the Azure Function being called."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "An Azure Function tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "AzureFunctionToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_function_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the Azure Function that was called."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Azure Function tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of an Azure Function tool call."
+ },
+ "AzureOpenAIModelConfiguration": {
+ "type": "object",
+ "required": [
+ "type",
+ "modelDeploymentName"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AzureOpenAIModel"
+ ]
+ },
+ "modelDeploymentName": {
+ "type": "string",
+ "description": "Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`)."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RedTeamTargetConfig"
+ }
+ ],
+ "description": "Azure OpenAI model configuration. The API version would be selected by the service for querying the model.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ },
+ "AzureUserSecurityContext": {
+ "type": "object",
+ "properties": {
+ "application_name": {
+ "type": "string",
+ "description": "The name of the application. Sensitive personal information should not be included in this field."
+ },
+ "end_user_id": {
+ "type": "string",
+ "description": "This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field."
+ },
+ "end_user_tenant_id": {
+ "type": "string",
+ "description": "The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant."
+ },
+ "source_ip": {
+ "type": "string",
+ "description": "Captures the original client's IP address."
+ }
+ },
+ "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud."
+ },
+ "BaseCredentials": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/CredentialType",
+ "description": "The type of credential used by the connection",
+ "readOnly": true
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "ApiKey": "#/components/schemas/ApiKeyCredentials",
+ "AAD": "#/components/schemas/EntraIDCredentials",
+ "CustomKeys": "#/components/schemas/CustomCredential",
+ "SAS": "#/components/schemas/SASCredentials",
+ "None": "#/components/schemas/NoAuthenticationCredentials",
+ "AgenticIdentityToken_Preview": "#/components/schemas/AgenticIdentityPreviewCredentials"
+ }
+ },
+ "description": "A base class for connection credentials"
+ },
+ "BingCustomSearchConfiguration": {
+ "type": "object",
+ "required": [
+ "project_connection_id",
+ "instance_name"
+ ],
+ "properties": {
+ "project_connection_id": {
+ "type": "string",
+ "description": "Project connection id for grounding with bing search"
+ },
+ "instance_name": {
+ "type": "string",
+ "description": "Name of the custom configuration instance given to config."
+ },
+ "market": {
+ "type": "string",
+ "description": "The market where the results come from."
+ },
+ "set_lang": {
+ "type": "string",
+ "description": "The language to use for user interface strings when calling Bing API."
+ },
+ "count": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The number of search results to return in the bing api response"
+ },
+ "freshness": {
+ "type": "string",
+ "description": "Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters)."
+ }
+ },
+ "description": "A bing custom search configuration.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingCustomSearchPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "bing_custom_search_preview"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_custom_search_preview"
+ ],
+ "description": "The object type, which is always 'bing_custom_search_preview'."
+ },
+ "bing_custom_search_preview": {
+ "$ref": "#/components/schemas/BingCustomSearchToolParameters",
+ "description": "The bing custom search tool parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for a Bing custom search tool as used to configure an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingCustomSearchToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_custom_search_preview_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "A Bing custom search tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingCustomSearchToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_custom_search_preview_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Bing custom search tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of a Bing custom search tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingCustomSearchToolParameters": {
+ "type": "object",
+ "required": [
+ "search_configurations"
+ ],
+ "properties": {
+ "search_configurations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/BingCustomSearchConfiguration"
+ },
+ "maxItems": 1,
+ "description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
+ }
+ },
+ "description": "The bing custom search tool parameters.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingGroundingSearchConfiguration": {
+ "type": "object",
+ "required": [
+ "project_connection_id"
+ ],
+ "properties": {
+ "project_connection_id": {
+ "type": "string",
+ "description": "Project connection id for grounding with bing search"
+ },
+ "market": {
+ "type": "string",
+ "description": "The market where the results come from."
+ },
+ "set_lang": {
+ "type": "string",
+ "description": "The language to use for user interface strings when calling Bing API."
+ },
+ "count": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The number of search results to return in the bing api response"
+ },
+ "freshness": {
+ "type": "string",
+ "description": "Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters)."
+ }
+ },
+ "description": "Search configuration for Bing Grounding"
+ },
+ "BingGroundingSearchToolParameters": {
+ "type": "object",
+ "required": [
+ "search_configurations"
+ ],
+ "properties": {
+ "search_configurations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/BingGroundingSearchConfiguration"
+ },
+ "maxItems": 1,
+ "description": "The search configurations attached to this tool. There can be a maximum of 1\nsearch configuration resource attached to the tool."
+ }
+ },
+ "description": "The bing grounding search tool parameters."
+ },
+ "BingGroundingTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "bing_grounding"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_grounding"
+ ],
+ "description": "The object type, which is always 'bing_grounding'."
+ },
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "bing_grounding": {
+ "$ref": "#/components/schemas/BingGroundingSearchToolParameters",
+ "description": "The bing grounding search tool parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for a bing grounding search tool as used to configure an agent."
+ },
+ "BingGroundingToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_grounding_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "A Bing grounding tool call."
+ },
+ "BingGroundingToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_grounding_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Bing grounding tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of a Bing grounding tool call."
+ },
+ "BlobReference": {
+ "type": "object",
+ "required": [
+ "blobUri",
+ "storageAccountArmId",
+ "credential"
+ ],
+ "properties": {
+ "blobUri": {
+ "type": "string",
+ "format": "uri",
+ "description": "Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path`"
+ },
+ "storageAccountArmId": {
+ "type": "string",
+ "description": "ARM ID of the storage account to use."
+ },
+ "credential": {
+ "$ref": "#/components/schemas/SasCredential",
+ "description": "Credential info to access the storage account."
+ }
+ },
+ "description": "Blob reference details."
+ },
+ "BotServiceAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "BotService"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ }
+ ]
+ },
+ "BotServiceRbacAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "BotServiceRbac"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ }
+ ]
+ },
+ "BotServiceTenantAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "BotServiceTenant"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ }
+ ]
+ },
+ "BrowserAutomationPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "browser_automation_preview"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "browser_automation_preview"
+ ],
+ "description": "The object type, which is always 'browser_automation_preview'."
+ },
+ "browser_automation_preview": {
+ "$ref": "#/components/schemas/BrowserAutomationToolParameters",
+ "description": "The Browser Automation Tool parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for a Browser Automation Tool, as used to configure an Agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationPreviewToolboxTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "browser_automation_preview"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "browser_automation_preview"
+ ]
+ },
+ "browser_automation_preview": {
+ "$ref": "#/components/schemas/BrowserAutomationToolParameters",
+ "description": "The Browser Automation Tool parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A browser automation tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "browser_automation_preview_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "A browser automation tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "browser_automation_preview_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the browser automation tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of a browser automation tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationToolConnectionParameters": {
+ "type": "object",
+ "required": [
+ "project_connection_id"
+ ],
+ "properties": {
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the project connection to your Azure Playwright resource."
+ }
+ },
+ "description": "Definition of input parameters for the connection used by the Browser Automation Tool.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationToolParameters": {
+ "type": "object",
+ "required": [
+ "connection"
+ ],
+ "properties": {
+ "connection": {
+ "$ref": "#/components/schemas/BrowserAutomationToolConnectionParameters",
+ "description": "The project connection parameters associated with the Browser Automation Tool."
+ }
+ },
+ "description": "Definition of input parameters for the Browser Automation Tool.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "CaptureStructuredOutputsTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "outputs"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "capture_structured_outputs"
+ ],
+ "description": "The type of the tool. Always `capture_structured_outputs`."
+ },
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "outputs": {
+ "$ref": "#/components/schemas/StructuredOutputDefinition",
+ "description": "The structured outputs to capture from the model."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A tool for capturing structured outputs"
+ },
+ "ChartCoordinate": {
+ "type": "object",
+ "required": [
+ "x",
+ "y",
+ "size"
+ ],
+ "properties": {
+ "x": {
+ "type": "integer",
+ "format": "int32",
+ "description": "X-axis coordinate."
+ },
+ "y": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Y-axis coordinate."
+ },
+ "size": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Size of the chart element."
+ }
+ },
+ "description": "Coordinates for the analysis chart.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "ChatSummaryMemoryItem": {
+ "type": "object",
+ "required": [
+ "kind"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "enum": [
+ "chat_summary"
+ ],
+ "description": "The kind of the memory item."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MemoryItem"
+ }
+ ],
+ "description": "A memory item containing a summary extracted from conversations.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "ClusterInsightResult": {
+ "type": "object",
+ "required": [
+ "summary",
+ "clusters"
+ ],
+ "properties": {
+ "summary": {
+ "$ref": "#/components/schemas/InsightSummary",
+ "description": "Summary of the insights report."
+ },
+ "clusters": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/InsightCluster"
+ },
+ "description": "List of clusters identified in the insights."
+ },
+ "coordinates": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ChartCoordinate"
+ },
+ "description": " Optional mapping of IDs to 2D coordinates used by the UX for visualization.\n\n The map keys are string identifiers (for example, a cluster id or a sample id)\n and the values are the coordinates and visual size for rendering on a 2D chart.\n\n This property is omitted unless the client requests coordinates (for example,\n by passing `includeCoordinates=true` as a query parameter).\n\n Example:\n ```\n {\n \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 },\n \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 }\n }\n ```\n\n Coordinates are intended only for client-side visualization and do not\n modify the canonical insights results."
+ }
+ },
+ "description": "Insights from the cluster analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "ClusterTokenUsage": {
+ "type": "object",
+ "required": [
+ "inputTokenUsage",
+ "outputTokenUsage",
+ "totalTokenUsage"
+ ],
+ "properties": {
+ "inputTokenUsage": {
+ "type": "integer",
+ "format": "int32",
+ "description": "input token usage"
+ },
+ "outputTokenUsage": {
+ "type": "integer",
+ "format": "int32",
+ "description": "output token usage"
+ },
+ "totalTokenUsage": {
+ "type": "integer",
+ "format": "int32",
+ "description": "total token usage"
+ }
+ },
+ "description": "Token usage for cluster analysis",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "CodeBasedEvaluatorDefinition": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "code"
+ ]
+ },
+ "code_text": {
+ "type": "string",
+ "description": "Inline code text for the evaluator"
+ },
+ "entry_point": {
+ "type": "string",
+ "description": "The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "image_tag": {
+ "type": "string",
+ "description": "The container image tag to use for evaluator code execution",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "blob_uri": {
+ "type": "string",
+ "format": "uri",
+ "description": "The blob URI for the evaluator storage",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluatorDefinition"
+ }
+ ],
+ "description": "Code-based evaluator definition using python code",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "CodeConfiguration": {
+ "type": "object",
+ "required": [
+ "runtime",
+ "entry_point",
+ "dependency_resolution"
+ ],
+ "properties": {
+ "runtime": {
+ "type": "string",
+ "description": "The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13')."
+ },
+ "entry_point": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The entry point command and arguments for the code execution."
+ },
+ "dependency_resolution": {
+ "$ref": "#/components/schemas/CodeDependencyResolution",
+ "description": "How package dependencies are resolved at deployment time. Defaults to `bundled`,\nwhere the caller bundles all dependencies into the uploaded zip and the service\nperforms no remote build. `remote_build` instructs the service to build\ndependencies remotely from the manifest included in the uploaded zip.",
+ "default": "bundled"
+ },
+ "content_hash": {
+ "type": "string",
+ "description": "The SHA-256 hex digest of the uploaded code zip. Set by the service from the `x-ms-code-zip-sha256` request header; read-only in responses and never accepted in request payloads.",
+ "readOnly": true
+ }
+ },
+ "description": "Code-based deployment configuration for a hosted agent."
+ },
+ "CodeDependencyResolution": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "bundled",
+ "remote_build"
+ ]
+ }
+ ],
+ "description": "How package dependencies are resolved at deployment time for a code-based hosted agent."
+ },
+ "CodeInterpreterToolboxTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "code_interpreter"
+ ]
+ },
+ "container": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AutoCodeInterpreterToolParam"
+ }
+ ],
+ "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code, along with an\noptional `memory_limit` setting.\nIf not provided, the service assumes auto."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A code interpreter tool stored in a toolbox."
+ },
+ "CompletionMessageToolCallChunk": {
+ "type": "object",
+ "required": [
+ "id",
+ "type"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The Id for the tool call."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "function"
+ ],
+ "description": "The type of tool call, which is always \"function\"."
+ },
+ "function": {
+ "$ref": "#/components/schemas/FunctionToolCall",
+ "description": "Details of the function tool call, if applicable."
+ }
+ },
+ "description": "Tool call details within a message."
+ },
+ "Connection": {
+ "type": "object",
+ "required": [
+ "name",
+ "id",
+ "type",
+ "target",
+ "isDefault",
+ "credentials",
+ "metadata"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The friendly name of the connection, provided by the user.",
+ "readOnly": true
+ },
+ "id": {
+ "type": "string",
+ "description": "A unique identifier for the connection, generated by the service",
+ "readOnly": true
+ },
+ "type": {
+ "$ref": "#/components/schemas/ConnectionType",
+ "description": "Category of the connection",
+ "readOnly": true
+ },
+ "target": {
+ "type": "string",
+ "description": "The connection URL to be used for this service",
+ "readOnly": true
+ },
+ "isDefault": {
+ "type": "boolean",
+ "description": "Whether the connection is tagged as the default connection of its type",
+ "readOnly": true
+ },
+ "credentials": {
+ "$ref": "#/components/schemas/BaseCredentials",
+ "description": "The credentials used by the connection",
+ "readOnly": true
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Metadata of the connection",
+ "readOnly": true
+ }
+ },
+ "description": "Response from the list and get connections operations"
+ },
+ "ConnectionType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "AzureOpenAI",
+ "AzureBlob",
+ "AzureStorageAccount",
+ "CognitiveSearch",
+ "CosmosDB",
+ "ApiKey",
+ "AppConfig",
+ "AppInsights",
+ "CustomKeys",
+ "RemoteTool_Preview"
+ ]
+ }
+ ],
+ "description": "The Type (or category) of the connection"
+ },
+ "ContainerConfiguration": {
+ "type": "object",
+ "required": [
+ "image"
+ ],
+ "properties": {
+ "image": {
+ "type": "string",
+ "description": "The container image for the hosted agent.",
+ "examples": [
+ "my-registry.azurecr.io/my-hosted-agent:latest"
+ ]
+ }
+ },
+ "description": "Container-based deployment configuration for a hosted agent."
+ },
+ "ContentFilterResult": {
+ "type": "object",
+ "required": [
+ "blocked",
+ "source_type",
+ "content_filter_results"
+ ],
+ "properties": {
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the content was blocked by the content filter."
+ },
+ "source_type": {
+ "type": "string",
+ "description": "The source type of the content filter evaluation (e.g., 'prompt', 'response', 'pre_tool_call', 'post_tool_call')."
+ },
+ "content_filter_results": {
+ "$ref": "#/components/schemas/AzureContentFilterResultsForResponses",
+ "description": "The content filter results for this evaluation."
+ },
+ "tool_call_id": {
+ "type": "string",
+ "description": "The ID of the tool call associated with this content filter result, if applicable."
+ }
+ },
+ "description": "A content filter evaluation result for a specific source in the response."
+ },
+ "ContinuousEvaluationRuleAction": {
+ "type": "object",
+ "required": [
+ "type",
+ "evalId"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "continuousEvaluation"
+ ]
+ },
+ "evalId": {
+ "type": "string",
+ "description": "Eval Id to add continuous evaluation runs to."
+ },
+ "maxHourlyRuns": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of evaluation runs allowed per hour."
+ },
+ "samplingRate": {
+ "type": "number",
+ "format": "double",
+ "maximum": 100,
+ "description": "Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the service-default is to evaluate every event, which is equivalent to setting a sampling rate of 100.",
+ "exclusiveMinimum": 0,
+ "default": 100
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationRuleAction"
+ }
+ ],
+ "description": "Evaluation rule action for continuous evaluation."
+ },
+ "ConversationGenPreviewItemGenerationParams": {
+ "type": "object",
+ "required": [
+ "type",
+ "model"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation_gen_preview"
+ ],
+ "description": "The type of item generation parameters, always `conversation_gen_preview`."
+ },
+ "model": {
+ "type": "string",
+ "description": "The model deployment used for simulation, in the format '{connectionName}/modelDeploymentName'."
+ },
+ "max_turns": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of turns per simulated conversation. Defaults to 20.",
+ "default": 20
+ },
+ "num_conversations": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Number of simulated conversations to generate per test scenario. Defaults to 5.",
+ "default": 5
+ },
+ "data_mapping": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Mapping from source fields to response_id field, which is required for retrieving chat history."
+ },
+ "sampling_params": {
+ "$ref": "#/components/schemas/ModelSamplingParams",
+ "description": "Sampling parameters for the conversation generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ItemGenerationParams"
+ }
+ ],
+ "description": "Represents the parameters for conversation simulation item generation."
+ },
+ "ConversationIdTraceSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "conversation_ids"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation_id_source"
+ ],
+ "description": "The type of trace source, always `conversation_id_source`."
+ },
+ "conversation_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Collection of conversation identifiers to filter traces by."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TraceSource"
+ }
+ ],
+ "description": "A trace source that selects traces by conversation IDs."
+ },
+ "CosmosDBIndex": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "CosmosDBNoSqlVectorStore"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Index"
+ }
+ ],
+ "description": "CosmosDB Vector Store Index Definition"
+ },
+ "CosmosDBIndexUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "CosmosDBNoSqlVectorStore"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/IndexUpdate"
+ }
+ ],
+ "description": "CosmosDB Vector Store Index Definition"
+ },
+ "CreateAgentFromCodeContent": {
+ "type": "object",
+ "properties": {
+ "metadata": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/CreateAgentVersionFromCodeMetadata"
+ }
+ ],
+ "description": "JSON metadata including description and hosted definition."
+ },
+ "code": {
+ "description": "The code zip file (max 250 MB)."
+ }
+ },
+ "required": [
+ "metadata",
+ "code"
+ ]
+ },
+ "CreateAgentFromManifestRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "manifest_id",
+ "parameter_values"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "maxLength": 63,
+ "description": "The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "manifest_id": {
+ "type": "string",
+ "description": "The manifest ID to import the agent version from."
+ },
+ "parameter_values": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The inputs to the manifest that will result in a fully materialized Agent."
+ }
+ }
+ },
+ "CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "definition"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "maxLength": 63,
+ "description": "The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
+ },
+ "state": {
+ "$ref": "#/components/schemas/AgentState",
+ "description": "The initial operational state of the agent. Defaults to 'enabled' if not specified.",
+ "default": "enabled"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "definition": {
+ "$ref": "#/components/schemas/AgentDefinition",
+ "description": "The agent definition. This can be a workflow, hosted agent, or a simple agent definition.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "WorkflowAgents=V1Preview",
+ "ExternalAgents=V1Preview",
+ "DraftAgents=V1Preview"
+ ]
+ }
+ },
+ "blueprint_reference": {
+ "$ref": "#/components/schemas/AgentBlueprintReference",
+ "description": "The blueprint reference for the agent."
+ },
+ "draft": {
+ "type": "boolean",
+ "description": "(Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DraftAgents=V1Preview"
+ ]
+ },
+ "default": false
+ },
+ "agent_endpoint": {
+ "$ref": "#/components/schemas/AgentEndpointConfig",
+ "description": "An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent"
+ },
+ "agent_card": {
+ "$ref": "#/components/schemas/AgentCard",
+ "description": "Optional agent card for the agent"
+ }
+ },
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "WorkflowAgents=V1Preview",
+ "ExternalAgents=V1Preview",
+ "DraftAgents=V1Preview"
+ ]
+ }
+ },
+ "CreateAgentSessionRequest": {
+ "type": "object",
+ "required": [
+ "version_indicator"
+ ],
+ "properties": {
+ "agent_session_id": {
+ "type": "string",
+ "description": "Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. Auto-generated if omitted."
+ },
+ "version_indicator": {
+ "$ref": "#/components/schemas/VersionIndicator",
+ "description": "Determines which agent version backs the session."
+ }
+ },
+ "description": "Request to create a new agent session."
+ },
+ "CreateAgentVersionFromCodeContent": {
+ "type": "object",
+ "properties": {
+ "metadata": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/CreateAgentVersionFromCodeMetadata"
+ }
+ ],
+ "description": "JSON metadata including description and hosted definition."
+ },
+ "code": {
+ "description": "The code zip file (max 250 MB)."
+ }
+ },
+ "required": [
+ "metadata",
+ "code"
+ ]
+ },
+ "CreateAgentVersionFromCodeMetadata": {
+ "type": "object",
+ "required": [
+ "definition"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "definition": {
+ "$ref": "#/components/schemas/HostedAgentDefinition",
+ "description": "The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, and protocol_versions."
+ }
+ },
+ "description": "JSON metadata for code-based agent operations (create, update, create version).\nThe agent name comes from the URL path parameter or the `x-ms-agent-name` header,\nso it is not included in this model.\nThe content hash (SHA-256 of the zip) is carried in the `x-ms-code-zip-sha256` header."
+ },
+ "CreateAgentVersionFromManifestRequest": {
+ "type": "object",
+ "required": [
+ "manifest_id",
+ "parameter_values"
+ ],
+ "properties": {
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "manifest_id": {
+ "type": "string",
+ "description": "The manifest ID to import the agent version from."
+ },
+ "parameter_values": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The inputs to the manifest that will result in a fully materialized Agent."
+ }
+ }
+ },
+ "CreateAgentVersionRequest": {
+ "type": "object",
+ "required": [
+ "definition"
+ ],
+ "properties": {
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "definition": {
+ "$ref": "#/components/schemas/AgentDefinition",
+ "description": "The agent definition. This can be a workflow, hosted agent, or a simple agent definition.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "WorkflowAgents=V1Preview",
+ "ExternalAgents=V1Preview",
+ "DraftAgents=V1Preview"
+ ]
+ }
+ },
+ "blueprint_reference": {
+ "$ref": "#/components/schemas/AgentBlueprintReference",
+ "description": "The blueprint reference for the agent."
+ },
+ "draft": {
+ "type": "boolean",
+ "description": "(Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DraftAgents=V1Preview"
+ ]
+ },
+ "default": false
+ }
+ }
+ },
+ "CreateEvalRequest": {
+ "type": "object",
+ "required": [
+ "data_source_config",
+ "testing_criteria"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the evaluation."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "data_source_config": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ }
+ ],
+ "description": "The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation."
+ },
+ "testing_criteria": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
+ }
+ ]
+ },
+ "description": "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}}`)."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ }
+ },
+ "title": "CreateEvalRequest"
+ },
+ "CreateEvalRunRequest": {
+ "type": "object",
+ "required": [
+ "data_source"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the run."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "data_source": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Details about the run's data source."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ },
+ "evaluation_level": {
+ "$ref": "#/components/schemas/EvaluationLevel",
+ "description": "The level at which evaluation is performed. Defaults to 'turn' if not specified.",
+ "default": "turn"
+ }
+ },
+ "title": "CreateEvalRunRequest"
+ },
+ "CreateSkillVersionFromFilesBody": {
+ "type": "object",
+ "properties": {
+ "files": {
+ "type": "array",
+ "items": {},
+ "description": "Skill files to upload. Upload a single zip file or multiple individual files with relative paths."
+ },
+ "default": {
+ "type": "boolean",
+ "description": "Whether to set this version as the default. Defaults to false."
+ }
+ },
+ "required": [
+ "files"
+ ]
+ },
+ "CredentialType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "ApiKey",
+ "AAD",
+ "SAS",
+ "CustomKeys",
+ "None",
+ "AgenticIdentityToken_Preview"
+ ]
+ }
+ ],
+ "description": "The credential type used by the connection"
+ },
+ "CronTrigger": {
+ "type": "object",
+ "required": [
+ "type",
+ "expression"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Cron"
+ ]
+ },
+ "expression": {
+ "type": "string",
+ "description": "Cron expression that defines the schedule frequency."
+ },
+ "timeZone": {
+ "type": "string",
+ "description": "Time zone for the cron schedule. Defaults to `UTC`.",
+ "default": "UTC"
+ },
+ "startTime": {
+ "type": "string",
+ "description": "Start time for the cron schedule in ISO 8601 format."
+ },
+ "endTime": {
+ "type": "string",
+ "description": "End time for the cron schedule in ISO 8601 format."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Trigger"
+ }
+ ],
+ "description": "Cron based trigger.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "CustomCredential": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "CustomKeys"
+ ],
+ "description": "The credential type",
+ "readOnly": true
+ }
+ },
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BaseCredentials"
+ }
+ ],
+ "description": "Custom credential definition"
+ },
+ "CustomRoutineTrigger": {
+ "type": "object",
+ "required": [
+ "type",
+ "provider",
+ "parameters"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "custom"
+ ],
+ "description": "The trigger type."
+ },
+ "provider": {
+ "type": "string",
+ "maxLength": 128,
+ "description": "The external provider that emits the custom event."
+ },
+ "event_name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The provider-specific event name that fires the routine."
+ },
+ "parameters": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Provider-specific trigger parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RoutineTrigger"
+ }
+ ],
+ "description": "A custom event routine trigger.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "DailyRecurrenceSchedule": {
+ "type": "object",
+ "required": [
+ "type",
+ "hours"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Daily"
+ ],
+ "description": "Daily recurrence type."
+ },
+ "hours": {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "description": "Hours for the recurrence schedule."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RecurrenceSchedule"
+ }
+ ],
+ "description": "Daily recurrence schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJob": {
+ "type": "object",
+ "required": [
+ "id",
+ "status",
+ "created_at"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Server-assigned unique identifier.",
+ "readOnly": true
+ },
+ "inputs": {
+ "$ref": "#/components/schemas/DataGenerationJobInputs",
+ "description": "Caller-supplied inputs."
+ },
+ "result": {
+ "$ref": "#/components/schemas/DataGenerationJobResult",
+ "description": "Result produced on success.",
+ "readOnly": true
+ },
+ "status": {
+ "$ref": "#/components/schemas/JobStatus",
+ "description": "Current lifecycle status.",
+ "readOnly": true
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error",
+ "description": "Error details — populated only on failure.",
+ "readOnly": true
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).",
+ "readOnly": true
+ },
+ "finished_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job was finished, represented in Unix time (seconds since January 1, 1970).",
+ "readOnly": true
+ }
+ },
+ "description": "Data Generation Job resource.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobInputs": {
+ "type": "object",
+ "required": [
+ "name",
+ "sources",
+ "options",
+ "scenario"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The display name of the data generation job."
+ },
+ "sources": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/DataGenerationJobSource"
+ },
+ "description": "The sources used for the data generation job."
+ },
+ "options": {
+ "$ref": "#/components/schemas/DataGenerationJobOptions",
+ "description": "The options for the data generation job."
+ },
+ "scenario": {
+ "$ref": "#/components/schemas/DataGenerationJobScenario",
+ "description": "The scenario of the data generation job. Either for fine-tuning or evaluation."
+ },
+ "output_options": {
+ "$ref": "#/components/schemas/DataGenerationJobOutputOptions",
+ "description": "Optional caller-supplied metadata for the job's output. See individual fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both."
+ }
+ },
+ "description": "Caller-supplied inputs for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobOptions": {
+ "type": "object",
+ "required": [
+ "type",
+ "max_samples"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DataGenerationJobType",
+ "description": "The data generation job type."
+ },
+ "max_samples": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of samples to generate."
+ },
+ "train_split": {
+ "type": "number",
+ "format": "float",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The proportion of the generated data to be used for training when the data is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1."
+ },
+ "model_options": {
+ "$ref": "#/components/schemas/DataGenerationModelOptions",
+ "description": "The LLM model options."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "simple_qna": "#/components/schemas/SimpleQnADataGenerationJobOptions",
+ "traces": "#/components/schemas/TracesDataGenerationJobOptions",
+ "tool_use": "#/components/schemas/ToolUseFineTuningDataGenerationJobOptions"
+ }
+ },
+ "description": "Options for managing data generation jobs.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobOutput": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DataGenerationJobOutputType",
+ "description": "The type of the output."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "file": "#/components/schemas/FileDataGenerationJobOutput",
+ "dataset": "#/components/schemas/DatasetDataGenerationJobOutput"
+ }
+ },
+ "description": "Output information for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobOutputOptions": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario)."
+ },
+ "description": {
+ "type": "string",
+ "description": "Description to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs."
+ }
+ },
+ "description": "Output options for data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobOutputType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "file",
+ "dataset"
+ ]
+ }
+ ],
+ "description": "The supported output file types for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobResult": {
+ "type": "object",
+ "required": [
+ "generated_samples"
+ ],
+ "properties": {
+ "outputs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/DataGenerationJobOutput"
+ },
+ "description": "The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation."
+ },
+ "generated_samples": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The number of samples actually generated."
+ },
+ "token_usage": {
+ "$ref": "#/components/schemas/DataGenerationTokenUsage",
+ "description": "The token usage information for the data generation job."
+ }
+ },
+ "description": "Result produced by a successful data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobScenario": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "supervised_finetuning",
+ "reinforcement_finetuning",
+ "evaluation"
+ ]
+ }
+ ],
+ "description": "The supported scenarios for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DataGenerationJobSourceType",
+ "description": "The type of source."
+ },
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "prompt": "#/components/schemas/PromptDataGenerationJobSource",
+ "agent": "#/components/schemas/AgentDataGenerationJobSource",
+ "traces": "#/components/schemas/TracesDataGenerationJobSource",
+ "file": "#/components/schemas/FileDataGenerationJobSource"
+ }
+ },
+ "description": "The base source model for data generation jobs.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobSourceType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "prompt",
+ "agent",
+ "traces",
+ "file"
+ ]
+ }
+ ],
+ "description": "The supported source types for data generation jobs.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "simple_qna",
+ "traces",
+ "tool_use"
+ ]
+ }
+ ],
+ "description": "The supported data generation job types.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationModelOptions": {
+ "type": "object",
+ "required": [
+ "model"
+ ],
+ "properties": {
+ "model": {
+ "type": "string",
+ "description": "Base model name used to generate data."
+ }
+ },
+ "description": "LLM model options for data generation jobs.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationTokenUsage": {
+ "type": "object",
+ "required": [
+ "prompt_tokens",
+ "completion_tokens",
+ "total_tokens"
+ ],
+ "properties": {
+ "prompt_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The number of prompt tokens used.",
+ "readOnly": true
+ },
+ "completion_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The number of completion tokens generated.",
+ "readOnly": true
+ },
+ "total_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Total number of tokens used.",
+ "readOnly": true
+ }
+ },
+ "description": "Token usage information for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataSourceConfig": {
+ "type": "object",
+ "required": [
+ "type",
+ "schema"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "The data source type discriminator."
+ },
+ "schema": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The overall object JSON schema for the run data source items."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "azure_ai_source": "#/components/schemas/AzureAIDataSourceConfig"
+ }
+ },
+ "description": "Base class for run data sources with discriminator support."
+ },
+ "DatasetDataGenerationJobOutput": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "dataset"
+ ],
+ "description": "Dataset output."
+ },
+ "id": {
+ "type": "string",
+ "description": "The id of the output dataset created.",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the output dataset.",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the output dataset.",
+ "readOnly": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Description of the output dataset.",
+ "readOnly": true
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary of the output dataset.",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DataGenerationJobOutput"
+ }
+ ],
+ "description": "Dataset output for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DatasetEvaluatorGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "dataset"
+ ],
+ "description": "The source type for this source, which is Dataset."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the dataset."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the dataset. If not specified, the latest version is used."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
+ }
+ ],
+ "description": "Dataset source for evaluator generation jobs — reference to a dataset.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "DatasetReference": {
+ "type": "object",
+ "required": [
+ "name",
+ "version"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Dataset name."
+ },
+ "version": {
+ "type": "string",
+ "description": "Dataset version."
+ }
+ },
+ "description": "Reference to a versioned Foundry Dataset.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "DatasetType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "uri_file",
+ "uri_folder"
+ ]
+ }
+ ],
+ "description": "Enum to determine the type of data."
+ },
+ "DatasetVersion": {
+ "type": "object",
+ "required": [
+ "dataUri",
+ "type",
+ "name",
+ "version"
+ ],
+ "properties": {
+ "dataUri": {
+ "type": "string",
+ "minLength": 1,
+ "pattern": "[a-zA-Z0-9_]",
+ "description": "URI of the data ([example](https://go.microsoft.com/fwlink/?linkid=2202330))"
+ },
+ "type": {
+ "$ref": "#/components/schemas/DatasetType",
+ "description": "Dataset type"
+ },
+ "isReference": {
+ "type": "boolean",
+ "description": "Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted",
+ "readOnly": true
+ },
+ "connectionName": {
+ "type": "string",
+ "description": "The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset"
+ },
+ "id": {
+ "type": "string",
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the resource",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the resource",
+ "readOnly": true
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "uri_file": "#/components/schemas/FileDatasetVersion",
+ "uri_folder": "#/components/schemas/FolderDatasetVersion"
+ }
+ },
+ "description": "DatasetVersion Definition"
+ },
+ "DatasetVersionUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DatasetType",
+ "description": "Dataset type"
+ },
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "uri_file": "#/components/schemas/FileDatasetVersionUpdate",
+ "uri_folder": "#/components/schemas/FolderDatasetVersionUpdate"
+ }
+ },
+ "description": "DatasetVersion Definition"
+ },
+ "DayOfWeek": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday"
+ ]
+ }
+ ],
+ "description": "Days of the week for recurrence schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "DeleteAgentResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "name",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "agent.deleted"
+ ],
+ "description": "The object type. Always 'agent.deleted'."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the agent was successfully deleted."
+ }
+ },
+ "description": "A deleted agent Object"
+ },
+ "DeleteAgentVersionResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "name",
+ "version",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "agent.version.deleted"
+ ],
+ "description": "The object type. Always 'agent.version.deleted'."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version identifier of the agent."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the agent was successfully deleted."
+ }
+ },
+ "description": "A deleted agent version Object"
+ },
+ "DeleteEvalResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "eval_id",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval.deleted"
+ ],
+ "description": "The object type. Always 'eval.deleted'."
+ },
+ "eval_id": {
+ "type": "string",
+ "description": "id of the eval."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the eval was successfully deleted."
+ }
+ },
+ "description": "A deleted evaluation Object"
+ },
+ "DeleteEvalRunResponse": {
+ "type": "object",
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval.deleted"
+ ],
+ "description": "The object type. Always 'eval.deleted'."
+ },
+ "run_id": {
+ "type": "string",
+ "description": "id of the eval."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the eval was successfully deleted."
+ }
+ },
+ "description": "A deleted evaluation run Object."
+ },
+ "DeleteMemoryResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "memory_id",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "memory_store.item.deleted"
+ ],
+ "description": "The object type. Always 'memory_store.item.deleted'."
+ },
+ "memory_id": {
+ "type": "string",
+ "description": "The unique ID of the deleted memory item."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the memory item was successfully deleted."
+ }
+ },
+ "description": "Response for deleting a memory item from a memory store.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "DeleteMemoryStoreResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "name",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "memory_store.deleted"
+ ],
+ "description": "The object type. Always 'memory_store.deleted'."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the memory store."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the memory store was successfully deleted."
+ }
+ },
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "DeleteResponseResult": {
+ "type": "object",
+ "required": [
+ "id",
+ "object",
+ "deleted"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The operation ID."
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "response"
+ ],
+ "description": "Always return 'response'."
+ },
+ "deleted": {
+ "type": "boolean",
+ "enum": [
+ true
+ ],
+ "description": "Always return true"
+ }
+ },
+ "description": "The result of a delete response operation."
+ },
+ "DeleteSkillResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "name",
+ "deleted"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the deleted skill."
+ },
+ "name": {
+ "$ref": "#/components/schemas/SkillName",
+ "description": "The unique name of the skill."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the skill was successfully deleted."
+ }
+ },
+ "description": "A deleted skill.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "DeleteSkillVersionResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "name",
+ "deleted",
+ "version"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the deleted skill version."
+ },
+ "name": {
+ "$ref": "#/components/schemas/SkillName",
+ "description": "The name of the skill."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the skill version was successfully deleted."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version that was deleted."
+ }
+ },
+ "description": "A deleted skill version.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "Deployment": {
+ "type": "object",
+ "required": [
+ "type",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DeploymentType",
+ "description": "The type of the deployment"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the deployment",
+ "readOnly": true
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "ModelDeployment": "#/components/schemas/ModelDeployment"
+ }
+ },
+ "description": "Model Deployment Definition"
+ },
+ "DeploymentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "ModelDeployment"
+ ]
+ }
+ ]
+ },
+ "Dimension": {
+ "type": "object",
+ "required": [
+ "id",
+ "description",
+ "weight"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. Provided by the user when manually creating a rubric evaluator or during human-in-the-loop review of a generated set; the generation pipeline produces an initial value the user can edit. Editable when saving new versions."
+ },
+ "description": {
+ "type": "string",
+ "description": "What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and pursues the appropriate workflow')."
+ },
+ "weight": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 1,
+ "maximum": 10,
+ "description": "Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension weight 8-10; all others use 1-6. User edits are not constrained by this heuristic."
+ },
+ "always_applicable": {
+ "type": "boolean",
+ "description": "When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is not specified by the caller.",
+ "default": false
+ }
+ },
+ "description": "A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "DispatchRoutineRequest": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/RoutineDispatchPayload",
+ "description": "A direct action-input override sent downstream when testing a routine."
+ }
+ },
+ "description": "Request body for the public dispatch_async route.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "DispatchRoutineResponse": {
+ "type": "object",
+ "properties": {
+ "dispatch_id": {
+ "type": "string",
+ "description": "The dispatch identifier created for the routine dispatch."
+ },
+ "action_correlation_id": {
+ "type": "string",
+ "description": "A downstream action correlation identifier, when available."
+ },
+ "task_id": {
+ "type": "string",
+ "description": "A workspace task identifier created for the dispatch, when available."
+ }
+ },
+ "description": "Identifiers returned after a routine dispatch is queued.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "EndpointBasedEvaluatorDefinition": {
+ "type": "object",
+ "required": [
+ "type",
+ "connection_name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "endpoint"
+ ]
+ },
+ "connection_name": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends `api-key` header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity)."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluatorDefinition"
+ }
+ ],
+ "description": "Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row."
+ },
+ "EntraAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Entra"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ }
+ ]
+ },
+ "EntraIDCredentials": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AAD"
+ ],
+ "description": "The credential type",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BaseCredentials"
+ }
+ ],
+ "description": "Entra ID credential definition"
+ },
+ "Eval": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "name",
+ "data_source_config",
+ "testing_criteria",
+ "created_at",
+ "metadata"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval"
+ ],
+ "description": "The object type.",
+ "x-stainless-const": true,
+ "default": "eval"
+ },
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the evaluation."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the evaluation."
+ },
+ "data_source_config": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ }
+ ],
+ "description": "Configuration of data sources used in runs of the evaluation."
+ },
+ "testing_criteria": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
+ }
+ ]
+ },
+ "description": "A list of testing criteria."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the eval was created."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "modified_at": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Unix timestamp (in seconds) when the evaluation run was last modified."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "the name of the person who created the run."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ }
+ },
+ "description": "An Eval object with a data source config and testing criteria.\nAn Eval represents a task to be done for your LLM integration.\nLike:\n- Improve the quality of my chatbot\n- See how well my chatbot handles customer support\n- Check if o4-mini is better at my usecase than gpt-4o",
+ "title": "Eval",
+ "x-oaiMeta": {
+ "name": "The eval object",
+ "group": "evals",
+ "example": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\"type\": \"string\"},\n },\n \"required\": [\"label\"]\n },\n \"include_sample_schema\": true\n },\n \"testing_criteria\": [\n {\n \"name\": \"My string check grader\",\n \"type\": \"string_check\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\",\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {\n \"test\": \"synthetics\",\n }\n}\n"
+ }
+ },
+ "EvalCsvFileIdSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file_id"
+ ],
+ "description": "The type of source, always `file_id`."
+ },
+ "id": {
+ "type": "string",
+ "description": "The identifier of the uploaded CSV file."
+ }
+ },
+ "description": "Represents a reference to an uploaded CSV file used as a source for evaluation data."
+ },
+ "EvalCsvRunDataSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "source"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "csv"
+ ],
+ "description": "The type of data source, always `csv`."
+ },
+ "source": {
+ "$ref": "#/components/schemas/EvalCsvFileIdSource",
+ "description": "The source of the CSV data, either inline content or a file reference."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Represents a CSV data source for evaluation runs."
+ },
+ "EvalResult": {
+ "type": "object",
+ "required": [
+ "name",
+ "type",
+ "score",
+ "passed"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name of the check"
+ },
+ "type": {
+ "type": "string",
+ "description": "type of the check"
+ },
+ "score": {
+ "type": "number",
+ "format": "float",
+ "description": "score"
+ },
+ "passed": {
+ "type": "boolean",
+ "description": "indicates if the check passed or failed"
+ }
+ },
+ "description": "Result of the evaluation.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvalRun": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "eval_id",
+ "status",
+ "model",
+ "name",
+ "created_at",
+ "report_url",
+ "result_counts",
+ "per_model_usage",
+ "per_testing_criteria_results",
+ "data_source",
+ "metadata",
+ "error"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval.run"
+ ],
+ "description": "The type of the object. Always \"eval.run\".",
+ "x-stainless-const": true,
+ "default": "eval.run"
+ },
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the evaluation run."
+ },
+ "eval_id": {
+ "type": "string",
+ "description": "The identifier of the associated evaluation."
+ },
+ "status": {
+ "type": "string",
+ "description": "The status of the evaluation run."
+ },
+ "model": {
+ "type": "string",
+ "description": "The model that is evaluated, if applicable."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the evaluation run."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the evaluation run was created."
+ },
+ "report_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL to the rendered evaluation run report on the UI dashboard."
+ },
+ "result_counts": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunResultCounts",
+ "description": "Counters summarizing the outcomes of the evaluation run."
+ },
+ "per_model_usage": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunPerModelUsage"
+ },
+ "description": "Usage statistics for each model during the evaluation run."
+ },
+ "per_testing_criteria_results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults"
+ },
+ "description": "Results per testing criteria applied during the evaluation run."
+ },
+ "data_source": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Information about the run's data source."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.EvalApiError"
+ },
+ "modified_at": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Unix timestamp (in seconds) when the evaluation run was last modified."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "the name of the person who created the run."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ },
+ "evaluation_level": {
+ "$ref": "#/components/schemas/EvaluationLevel",
+ "description": "The level at which evaluation is performed. Defaults to 'turn' if not specified.",
+ "default": "turn"
+ }
+ },
+ "description": "A schema representing an evaluation run.",
+ "title": "EvalRun",
+ "x-oaiMeta": {
+ "name": "The eval run object",
+ "group": "evals",
+ "example": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67e57965b480819094274e3a32235e4c\",\n \"eval_id\": \"eval_67e579652b548190aaa83ada4b125f47\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
+ }
+ },
+ "EvalRunDataSource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "The data source type discriminator."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "azure_ai_traces_preview": "#/components/schemas/TracesPreviewEvalRunDataSource",
+ "azure_ai_synthetic_data_gen_preview": "#/components/schemas/SyntheticDataGenerationPreviewEvalRunDataSource",
+ "azure_ai_responses": "#/components/schemas/AzureAIResponsesEvalRunDataSource",
+ "azure_ai_target_completions": "#/components/schemas/TargetCompletionEvalRunDataSource",
+ "csv": "#/components/schemas/EvalCsvRunDataSource",
+ "azure_ai_red_team": "#/components/schemas/RedTeamEvalRunDataSource",
+ "azure_ai_trace_data_source_preview": "#/components/schemas/AzureAITraceDataSourcePreviewEvalRunDataSource",
+ "azure_ai_benchmark_preview": "#/components/schemas/AzureAIBenchmarkPreviewEvalRunDataSource"
+ }
+ },
+ "description": "Base class for run data sources with discriminator support."
+ },
+ "EvalRunOutputItem": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "run_id",
+ "eval_id",
+ "created_at",
+ "status",
+ "datasource_item_id",
+ "datasource_item",
+ "results",
+ "sample"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval.run.output_item"
+ ],
+ "description": "The type of the object. Always \"eval.run.output_item\".",
+ "x-stainless-const": true,
+ "default": "eval.run.output_item"
+ },
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the evaluation run output item."
+ },
+ "run_id": {
+ "type": "string",
+ "description": "The identifier of the evaluation run associated with this output item."
+ },
+ "eval_id": {
+ "type": "string",
+ "description": "The identifier of the evaluation group."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the evaluation run was created."
+ },
+ "status": {
+ "type": "string",
+ "description": "The status of the evaluation run."
+ },
+ "datasource_item_id": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The identifier for the data source item."
+ },
+ "datasource_item": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Details of the input data source item."
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunOutputItemResult"
+ },
+ "description": "A list of grader results for this output item."
+ },
+ "sample": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSample",
+ "description": "A sample containing the input and output of the evaluation run."
+ }
+ },
+ "description": "A schema representing an evaluation run output item.",
+ "title": "EvalRunOutputItem",
+ "x-oaiMeta": {
+ "name": "The eval run output item object",
+ "group": "evals",
+ "example": "{\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"created_at\": 1739314509,\n \"status\": \"pass\",\n \"datasource_item_id\": 137,\n \"datasource_item\": {\n \"teacher\": \"To grade essays, I only check for style, content, and grammar.\",\n \"student\": \"I am a student who is trying to write the best essay.\"\n },\n \"results\": [\n {\n \"name\": \"String Check Grader\",\n \"type\": \"string-check-grader\",\n \"score\": 1.0,\n \"passed\": true,\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"You are an evaluator bot...\"\n },\n {\n \"role\": \"user\",\n \"content\": \"You are assessing...\"\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"The rubric is not clear nor concise.\"\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"total_tokens\": 521,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 519,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n}\n"
+ }
+ },
+ "EvalRunOutputItemResult": {
+ "type": "object",
+ "required": [
+ "name",
+ "score",
+ "passed"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "type": {
+ "type": "string",
+ "description": "The grader type (for example, \"string-check-grader\")."
+ },
+ "score": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The numeric score produced by the grader."
+ },
+ "passed": {
+ "type": "boolean",
+ "description": "Whether the grader considered the output a pass."
+ },
+ "sample": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional sample or intermediate data produced by the grader."
+ },
+ "status": {
+ "$ref": "#/components/schemas/EvalRunOutputItemResultStatus",
+ "description": "The evaluation status for this result item. Values: \"completed\", \"errored\", \"skipped\". Null if not provided by evaluator. When status is skipped, passed/score can be ignored."
+ },
+ "metric": {
+ "type": "string",
+ "description": "The name of the metric (e.g., \"fluency\", \"f1_score\")."
+ },
+ "label": {
+ "type": "string",
+ "description": "The label associated with the test criteria metric (e.g., \"pass\", \"fail\", \"good\", \"bad\")."
+ },
+ "threshold": {
+ "type": "number",
+ "format": "float",
+ "description": "The threshold used to determine pass/fail for this test criteria, if it is numerical."
+ },
+ "reason": {
+ "type": "string",
+ "description": "The reason for the test criteria metric."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Additional details about the test criteria metric."
+ }
+ },
+ "unevaluatedProperties": {},
+ "description": "A single grader result for an evaluation run output item.",
+ "title": "EvalRunOutputItemResult"
+ },
+ "EvalRunOutputItemResultStatus": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "completed",
+ "errored",
+ "skipped"
+ ]
+ }
+ ],
+ "description": "The evaluation status for an evaluation run output item result."
+ },
+ "EvalRunOutputItemSampleInput": {
+ "type": "object",
+ "required": [
+ "role",
+ "content",
+ "tool_calls"
+ ],
+ "properties": {
+ "role": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CompletionMessageToolCallChunk"
+ },
+ "description": "Tool calls made within the message, if any."
+ }
+ },
+ "description": "A message in the evaluation run."
+ },
+ "EvalRunOutputItemSampleOutput": {
+ "type": "object",
+ "required": [
+ "tool_calls"
+ ],
+ "properties": {
+ "role": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CompletionMessageToolCallChunk"
+ },
+ "description": "Tool calls made within the message, if any."
+ }
+ },
+ "description": "A message in the evaluation run."
+ },
+ "EvalRunResultCompareItem": {
+ "type": "object",
+ "required": [
+ "treatmentRunId",
+ "treatmentRunSummary",
+ "deltaEstimate",
+ "pValue",
+ "treatmentEffect"
+ ],
+ "properties": {
+ "treatmentRunId": {
+ "type": "string",
+ "description": "The treatment run ID."
+ },
+ "treatmentRunSummary": {
+ "$ref": "#/components/schemas/EvalRunResultSummary",
+ "description": "Summary statistics of the treatment run."
+ },
+ "deltaEstimate": {
+ "type": "number",
+ "format": "float",
+ "description": "Estimated difference between treatment and baseline."
+ },
+ "pValue": {
+ "type": "number",
+ "format": "float",
+ "description": "P-value for the treatment effect."
+ },
+ "treatmentEffect": {
+ "$ref": "#/components/schemas/TreatmentEffectType",
+ "description": "Type of treatment effect."
+ }
+ },
+ "description": "Metric comparison for a treatment against the baseline.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvalRunResultComparison": {
+ "type": "object",
+ "required": [
+ "testingCriteria",
+ "metric",
+ "evaluator",
+ "baselineRunSummary",
+ "compareItems"
+ ],
+ "properties": {
+ "testingCriteria": {
+ "type": "string",
+ "description": "Name of the testing criteria."
+ },
+ "metric": {
+ "type": "string",
+ "description": "Metric being evaluated."
+ },
+ "evaluator": {
+ "type": "string",
+ "description": "Name of the evaluator for this testing criteria."
+ },
+ "baselineRunSummary": {
+ "$ref": "#/components/schemas/EvalRunResultSummary",
+ "description": "Summary statistics of the baseline run."
+ },
+ "compareItems": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunResultCompareItem"
+ },
+ "description": "List of comparison results for each treatment run."
+ }
+ },
+ "description": "Comparison results for treatment runs against the baseline.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvalRunResultSummary": {
+ "type": "object",
+ "required": [
+ "runId",
+ "sampleCount",
+ "average",
+ "standardDeviation"
+ ],
+ "properties": {
+ "runId": {
+ "type": "string",
+ "description": "The evaluation run ID."
+ },
+ "sampleCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Number of samples in the evaluation run."
+ },
+ "average": {
+ "type": "number",
+ "format": "float",
+ "description": "Average value of the metric in the evaluation run."
+ },
+ "standardDeviation": {
+ "type": "number",
+ "format": "float",
+ "description": "Standard deviation of the metric in the evaluation run."
+ }
+ },
+ "description": "Summary statistics of a metric in an evaluation run.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationComparisonInsightRequest": {
+ "type": "object",
+ "required": [
+ "type",
+ "evalId",
+ "baselineRunId",
+ "treatmentRunIds"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationComparison"
+ ],
+ "description": "The type of request."
+ },
+ "evalId": {
+ "type": "string",
+ "description": "Identifier for the evaluation."
+ },
+ "baselineRunId": {
+ "type": "string",
+ "description": "The baseline run ID for comparison."
+ },
+ "treatmentRunIds": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of treatment run IDs for comparison."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightRequest"
+ }
+ ],
+ "description": "Evaluation Comparison Request",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationComparisonInsightResult": {
+ "type": "object",
+ "required": [
+ "type",
+ "comparisons",
+ "method"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationComparison"
+ ],
+ "description": "The type of insights result."
+ },
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunResultComparison"
+ },
+ "description": "Comparison results for each treatment run against the baseline."
+ },
+ "method": {
+ "type": "string",
+ "description": "The statistical method used for comparison."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightResult"
+ }
+ ],
+ "description": "Insights from the evaluation comparison.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationLevel": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "turn",
+ "conversation"
+ ]
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "description": "The level at which evaluation is performed."
+ },
+ "EvaluationResultSample": {
+ "type": "object",
+ "required": [
+ "type",
+ "evaluationResult"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationResultSample"
+ ],
+ "description": "Evaluation Result Sample Type"
+ },
+ "evaluationResult": {
+ "$ref": "#/components/schemas/EvalResult",
+ "description": "Evaluation result for the analysis sample."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightSample"
+ }
+ ],
+ "description": "A sample from the evaluation result.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationRule": {
+ "type": "object",
+ "required": [
+ "id",
+ "action",
+ "eventType",
+ "enabled",
+ "systemData"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the evaluation rule.",
+ "readOnly": true
+ },
+ "displayName": {
+ "type": "string",
+ "description": "Display Name for the evaluation rule."
+ },
+ "description": {
+ "type": "string",
+ "description": "Description for the evaluation rule."
+ },
+ "action": {
+ "$ref": "#/components/schemas/EvaluationRuleAction",
+ "description": "Definition of the evaluation rule action.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "filter": {
+ "$ref": "#/components/schemas/EvaluationRuleFilter",
+ "description": "Filter condition of the evaluation rule."
+ },
+ "eventType": {
+ "$ref": "#/components/schemas/EvaluationRuleEventType",
+ "description": "Event type that the evaluation rule applies to."
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Indicates whether the evaluation rule is enabled. Default is true."
+ },
+ "systemData": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "System metadata for the evaluation rule.",
+ "readOnly": true
+ }
+ },
+ "description": "Evaluation rule model."
+ },
+ "EvaluationRuleAction": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluationRuleActionType",
+ "description": "Type of the evaluation action."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "continuousEvaluation": "#/components/schemas/ContinuousEvaluationRuleAction",
+ "humanEvaluationPreview": "#/components/schemas/HumanEvaluationPreviewRuleAction"
+ }
+ },
+ "description": "Evaluation action model."
+ },
+ "EvaluationRuleActionType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "continuousEvaluation",
+ "humanEvaluationPreview"
+ ]
+ }
+ ],
+ "description": "Type of the evaluation action."
+ },
+ "EvaluationRuleEventType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "responseCompleted",
+ "manual"
+ ]
+ }
+ ],
+ "description": "Type of the evaluation rule event."
+ },
+ "EvaluationRuleFilter": {
+ "type": "object",
+ "required": [
+ "agentName"
+ ],
+ "properties": {
+ "agentName": {
+ "type": "string",
+ "description": "Filter by agent name."
+ }
+ },
+ "description": "Evaluation filter model."
+ },
+ "EvaluationRunClusterInsightRequest": {
+ "type": "object",
+ "required": [
+ "type",
+ "evalId",
+ "runIds"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationRunClusterInsight"
+ ],
+ "description": "The type of insights request."
+ },
+ "evalId": {
+ "type": "string",
+ "description": "Evaluation Id for the insights."
+ },
+ "runIds": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of evaluation run IDs for the insights."
+ },
+ "modelConfiguration": {
+ "$ref": "#/components/schemas/InsightModelConfiguration",
+ "description": "Configuration of the model used in the insight generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightRequest"
+ }
+ ],
+ "description": "Insights on set of Evaluation Results",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationRunClusterInsightResult": {
+ "type": "object",
+ "required": [
+ "type",
+ "clusterInsight"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationRunClusterInsight"
+ ],
+ "description": "The type of insights result."
+ },
+ "clusterInsight": {
+ "$ref": "#/components/schemas/ClusterInsightResult"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightResult"
+ }
+ ],
+ "description": "Insights from the evaluation run cluster analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationScheduleTask": {
+ "type": "object",
+ "required": [
+ "type",
+ "evalId",
+ "evalRun"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Evaluation"
+ ]
+ },
+ "evalId": {
+ "type": "string",
+ "description": "Identifier of the evaluation group."
+ },
+ "evalRun": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The evaluation run payload."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ScheduleTask"
+ }
+ ],
+ "description": "Evaluation task for the schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "EvaluationTaxonomy": {
+ "type": "object",
+ "required": [
+ "name",
+ "version",
+ "taxonomyInput"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the resource",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the resource",
+ "readOnly": true
+ },
+ "taxonomyInput": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInput",
+ "description": "Input configuration for the evaluation taxonomy."
+ },
+ "taxonomyCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaxonomyCategory"
+ },
+ "description": "List of taxonomy categories."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Additional properties for the evaluation taxonomy."
+ }
+ },
+ "description": "Evaluation Taxonomy Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationTaxonomyCreateOrUpdate": {
+ "type": "object",
+ "required": [
+ "taxonomyInput"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ },
+ "taxonomyInput": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInput",
+ "description": "Input configuration for the evaluation taxonomy."
+ },
+ "taxonomyCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaxonomyCategory"
+ },
+ "description": "List of taxonomy categories."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Additional properties for the evaluation taxonomy."
+ }
+ },
+ "description": "Evaluation Taxonomy Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationTaxonomyInput": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInputType",
+ "description": "Input type of the evaluation taxonomy."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "agent": "#/components/schemas/AgentTaxonomyInput"
+ }
+ },
+ "description": "Input configuration for the evaluation taxonomy.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationTaxonomyInputType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "agent",
+ "policy"
+ ]
+ }
+ ],
+ "description": "Type of the evaluation taxonomy input.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationTaxonomyInputUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInputType",
+ "description": "Input type of the evaluation taxonomy."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "agent": "#/components/schemas/AgentTaxonomyInputUpdate"
+ }
+ },
+ "description": "Input configuration for the evaluation taxonomy.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationTaxonomyUpdate": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ },
+ "taxonomyInput": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInputUpdate",
+ "description": "Input configuration for the evaluation taxonomy."
+ },
+ "taxonomyCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaxonomyCategory"
+ },
+ "description": "List of taxonomy categories."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Additional properties for the evaluation taxonomy."
+ }
+ },
+ "description": "Evaluation Taxonomy Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorCategory": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "quality",
+ "safety",
+ "agents"
+ ]
+ }
+ ],
+ "description": "The category of the evaluator",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorCredentialRequest": {
+ "type": "object",
+ "required": [
+ "blob_uri"
+ ],
+ "properties": {
+ "blob_uri": {
+ "type": "string",
+ "format": "uri",
+ "description": "The blob URI for the evaluator storage. Example: `https://account.blob.core.windows.net:443/container`"
+ }
+ },
+ "description": "Request body for getting evaluator credentials",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorDefinition": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluatorDefinitionType",
+ "description": "The type of evaluator definition"
+ },
+ "init_parameters": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters like type, properties, required."
+ },
+ "data_schema": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like type, properties, required."
+ },
+ "metrics": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/EvaluatorMetric"
+ },
+ "description": "List of output metrics produced by this evaluator"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "code": "#/components/schemas/CodeBasedEvaluatorDefinition",
+ "prompt": "#/components/schemas/PromptBasedEvaluatorDefinition",
+ "rubric": "#/components/schemas/RubricBasedEvaluatorDefinition",
+ "endpoint": "#/components/schemas/EndpointBasedEvaluatorDefinition"
+ }
+ },
+ "description": "Base evaluator configuration with discriminator",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorDefinitionType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "prompt",
+ "code",
+ "prompt_and_code",
+ "service",
+ "openai_graders",
+ "rubric",
+ "endpoint"
+ ]
+ }
+ ],
+ "description": "The type of evaluator definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationArtifacts": {
+ "type": "object",
+ "required": [
+ "dataset",
+ "kinds"
+ ],
+ "properties": {
+ "dataset": {
+ "$ref": "#/components/schemas/DatasetReference",
+ "description": "Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to `EvaluatorVersion.version`) holding all artifacts produced by the generation pipeline. Each row in the JSONL carries a `kind` field discriminating its content (e.g. `spec`, `tools`, `context`)."
+ },
+ "kinds": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The kinds of rows present in `dataset`. Always contains `\"spec\"` (the generated evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain `\"tools\"` (when the generation pipeline produced or inferred OpenAI tool schemas) and/or `\"context\"` (when supplementary materials such as file uploads or trace samples were used during generation)."
+ }
+ },
+ "description": "Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationInputs": {
+ "type": "object",
+ "required": [
+ "sources",
+ "model",
+ "evaluator_name"
+ ],
+ "properties": {
+ "sources": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
+ },
+ "description": "Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry is an `EvaluatorGenerationJobSource` variant discriminated by `type`."
+ },
+ "model": {
+ "type": "string",
+ "description": "The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide their own model rather than relying on service-owned capacity."
+ },
+ "evaluator_name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 256,
+ "pattern": "^[A-Za-z0-9_.~-]+$",
+ "description": "The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII letters, digits, underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` is reserved for system-managed evaluators and is rejected by the service. If an evaluator with this name already exists in the project (and is rubric-subtype), the service creates a new version under the same name and uses the prior version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive loop). Old versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`."
+ },
+ "evaluator_display_name": {
+ "type": "string",
+ "description": "Optional human-friendly display name for the resulting evaluator. Surfaced as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier."
+ },
+ "evaluator_description": {
+ "type": "string",
+ "description": "Optional human-friendly description for the resulting evaluator. Surfaced as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related models."
+ }
+ },
+ "description": "Caller-supplied inputs for an evaluator generation job.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationJob": {
+ "type": "object",
+ "required": [
+ "id",
+ "status",
+ "created_at"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Server-assigned unique identifier.",
+ "readOnly": true
+ },
+ "inputs": {
+ "$ref": "#/components/schemas/EvaluatorGenerationInputs",
+ "description": "Caller-supplied inputs."
+ },
+ "result": {
+ "$ref": "#/components/schemas/EvaluatorVersion",
+ "description": "Result produced on success.",
+ "readOnly": true
+ },
+ "status": {
+ "$ref": "#/components/schemas/JobStatus",
+ "description": "Current lifecycle status.",
+ "readOnly": true
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error",
+ "description": "Error details — populated only on failure.",
+ "readOnly": true
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).",
+ "readOnly": true
+ },
+ "finished_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).",
+ "readOnly": true
+ },
+ "usage": {
+ "$ref": "#/components/schemas/EvaluatorGenerationTokenUsage",
+ "description": "Token consumption summary. Populated when the job reaches a terminal state.",
+ "readOnly": true
+ },
+ "input_quality_warnings": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RubricGenerationInputQualityWarning"
+ },
+ "description": "Non-fatal input-quality advisories produced by the generation pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. Omitted when generation was clean. Cleared when a subsequent `PATCH` to the paired `EvaluatorVersion.definition` invalidates the advisories.",
+ "readOnly": true
+ }
+ },
+ "description": "Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationJobCreate": {
+ "type": "object",
+ "properties": {
+ "inputs": {
+ "$ref": "#/components/schemas/EvaluatorGenerationInputs",
+ "description": "Caller-supplied inputs."
+ }
+ },
+ "description": "Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluatorGenerationJobSourceType",
+ "description": "The type of source."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "prompt": "#/components/schemas/PromptEvaluatorGenerationJobSource",
+ "agent": "#/components/schemas/AgentEvaluatorGenerationJobSource",
+ "traces": "#/components/schemas/TracesEvaluatorGenerationJobSource",
+ "dataset": "#/components/schemas/DatasetEvaluatorGenerationJobSource"
+ }
+ },
+ "description": "The base source model for evaluator generation jobs. Polymorphic over `type`.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationJobSourceType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "prompt",
+ "agent",
+ "traces",
+ "dataset"
+ ]
+ }
+ ],
+ "description": "The supported source types for evaluator generation jobs.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationTokenUsage": {
+ "type": "object",
+ "required": [
+ "input_tokens",
+ "output_tokens",
+ "total_tokens"
+ ],
+ "properties": {
+ "input_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Number of input (prompt) tokens consumed."
+ },
+ "output_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Number of output (completion) tokens generated."
+ },
+ "total_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Total tokens consumed (input + output)."
+ }
+ },
+ "description": "Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorMetric": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluatorMetricType",
+ "description": "Type of the metric."
+ },
+ "desirable_direction": {
+ "$ref": "#/components/schemas/EvaluatorMetricDirection",
+ "description": "It indicates whether a higher value is better or a lower value is better for this metric."
+ },
+ "min_value": {
+ "type": "number",
+ "format": "float",
+ "description": "Minimum value for the metric"
+ },
+ "max_value": {
+ "type": "number",
+ "format": "float",
+ "description": "Maximum value for the metric. If not specified, it is assumed to be unbounded."
+ },
+ "threshold": {
+ "type": "number",
+ "format": "float",
+ "description": "Default pass/fail threshold for this metric."
+ },
+ "is_primary": {
+ "type": "boolean",
+ "description": "Indicates if this metric is primary when there are multiple metrics."
+ }
+ },
+ "description": "Evaluator Metric",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorMetricDirection": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "increase",
+ "decrease",
+ "neutral"
+ ]
+ }
+ ],
+ "description": "The direction of the metric indicating whether a higher value is better, a lower value is better, or neutral",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorMetricType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "ordinal",
+ "continuous",
+ "boolean"
+ ]
+ }
+ ],
+ "description": "The type of the evaluator",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "builtin",
+ "custom"
+ ]
+ }
+ ],
+ "description": "The type of the evaluator",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorVersion": {
+ "type": "object",
+ "required": [
+ "evaluator_type",
+ "categories",
+ "definition",
+ "created_by",
+ "created_at",
+ "modified_at",
+ "name",
+ "version"
+ ],
+ "properties": {
+ "display_name": {
+ "type": "string",
+ "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Metadata about the evaluator"
+ },
+ "evaluator_type": {
+ "$ref": "#/components/schemas/EvaluatorType",
+ "description": "The type of the evaluator"
+ },
+ "categories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluatorCategory"
+ },
+ "description": "The categories of the evaluator"
+ },
+ "supported_evaluation_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluationLevel"
+ },
+ "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
+ "default": [
+ "turn"
+ ]
+ },
+ "definition": {
+ "$ref": "#/components/schemas/EvaluatorDefinition",
+ "description": "Definition of the evaluator"
+ },
+ "generation_artifacts": {
+ "$ref": "#/components/schemas/EvaluatorGenerationArtifacts",
+ "description": "Provenance artifacts from the generation pipeline. Read-only; present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry Dataset.",
+ "readOnly": true
+ },
+ "generation_job_id": {
+ "type": "string",
+ "description": "Read-only provenance link back to the EvaluatorGenerationJob that produced this version. Present only on evaluator versions created via the generation pipeline; absent for manually-created versions and unaffected by subsequent `PATCH` calls.",
+ "readOnly": true
+ },
+ "warnings": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/GenerationWarningType"
+ },
+ "description": "Categories of warnings surfaced on this generated evaluator version. Present only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent (treat as no warnings) when the version is not from generation, when the paired job was clean, or when a subsequent `PATCH` to `definition` cleared the paired job's advisories. Follow `generation_job_id` to fetch the detailed warning payloads.",
+ "readOnly": true
+ },
+ "created_by": {
+ "type": "string",
+ "description": "Creator of the evaluator",
+ "readOnly": true
+ },
+ "created_at": {
+ "type": "string",
+ "description": "Creation date/time of the evaluator",
+ "readOnly": true
+ },
+ "modified_at": {
+ "type": "string",
+ "description": "Last modified date/time of the evaluator",
+ "readOnly": true
+ },
+ "id": {
+ "type": "string",
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the resource",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the resource",
+ "readOnly": true
+ }
+ },
+ "description": "Evaluator Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorVersionCreate": {
+ "type": "object",
+ "required": [
+ "evaluator_type",
+ "categories",
+ "definition"
+ ],
+ "properties": {
+ "display_name": {
+ "type": "string",
+ "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Metadata about the evaluator"
+ },
+ "evaluator_type": {
+ "$ref": "#/components/schemas/EvaluatorType",
+ "description": "The type of the evaluator"
+ },
+ "categories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluatorCategory"
+ },
+ "description": "The categories of the evaluator"
+ },
+ "supported_evaluation_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluationLevel"
+ },
+ "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
+ "default": [
+ "turn"
+ ]
+ },
+ "definition": {
+ "$ref": "#/components/schemas/EvaluatorDefinition",
+ "description": "Definition of the evaluator"
+ },
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ }
+ },
+ "description": "Evaluator Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorVersionUpdate": {
+ "type": "object",
+ "properties": {
+ "display_name": {
+ "type": "string",
+ "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Metadata about the evaluator"
+ },
+ "categories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluatorCategory"
+ },
+ "description": "The categories of the evaluator"
+ },
+ "supported_evaluation_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluationLevel"
+ },
+ "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
+ "default": [
+ "turn"
+ ]
+ },
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ }
+ },
+ "description": "Evaluator Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "ExternalAgentDefinition": {
+ "type": "object",
+ "required": [
+ "kind"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "enum": [
+ "external"
+ ]
+ },
+ "otel_agent_id": {
+ "type": "string",
+ "description": "The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry agent.\nSpans must include the attribute `gen_ai.agent.id = ` to appear under this registration.\nDefaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios\nwhere the running external agent already emits a stable id that differs from the Foundry agent name.\nThe resolved value is always echoed on read."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentDefinition"
+ }
+ ],
+ "description": "The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS).\nRegistration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations)\nover customer-emitted OpenTelemetry data.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ExternalAgents=V1Preview"
+ ]
+ }
+ },
+ "FabricDataAgentToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "fabric_dataagent_preview_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "A Fabric data agent tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "FabricDataAgentToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "fabric_dataagent_preview_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Fabric data agent tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of a Fabric data agent tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "FabricDataAgentToolParameters": {
+ "type": "object",
+ "properties": {
+ "project_connections": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolProjectConnection"
+ },
+ "maxItems": 1,
+ "description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
+ }
+ },
+ "description": "The fabric data agent tool parameters.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "FabricIQPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "project_connection_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "fabric_iq_preview"
+ ],
+ "description": "The object type, which is always 'fabric_iq_preview'."
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the FabricIQ project connection."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "(Optional) The label of the FabricIQ MCP server to connect to."
+ },
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used."
+ },
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "(Optional) Whether the agent requires approval before executing actions. Default is always.",
+ "default": "always"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A FabricIQ server-side tool.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "FabricIQPreviewToolboxTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "project_connection_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "fabric_iq_preview"
+ ]
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the FabricIQ project connection."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "(Optional) The label of the FabricIQ MCP server to connect to."
+ },
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used."
+ },
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "(Optional) Whether the agent requires approval before executing actions. Default is always.",
+ "default": "always"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A FabricIQ tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "FileDataGenerationJobOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "filename"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file"
+ ],
+ "description": "Azure OpenAI file output."
+ },
+ "id": {
+ "type": "string",
+ "description": "The id of the output Azure OpenAI file.",
+ "readOnly": true
+ },
+ "filename": {
+ "type": "string",
+ "description": "The filename of the output Azure OpenAI file.",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DataGenerationJobOutput"
+ }
+ ],
+ "description": "Azure OpenAI file output for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "FileDataGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file"
+ ],
+ "description": "The source type for this job, which is File."
+ },
+ "id": {
+ "type": "string",
+ "description": "Input Azure Open AI file id used for data generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DataGenerationJobSource"
+ }
+ ],
+ "description": "File source for data generation jobs — Azure OpenAI file input.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "FileDatasetVersion": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "uri_file"
+ ],
+ "description": "Dataset type"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DatasetVersion"
+ }
+ ],
+ "description": "FileDatasetVersion Definition"
+ },
+ "FileDatasetVersionUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "uri_file"
+ ],
+ "description": "Dataset type"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DatasetVersionUpdate"
+ }
+ ],
+ "description": "FileDatasetVersion Definition"
+ },
+ "FileSearchToolboxTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file_search"
+ ]
+ },
+ "max_num_results": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive."
+ },
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.RankingOptions",
+ "description": "Ranking options for search."
+ },
+ "filters": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Filters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The IDs of the vector stores to search."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A file search tool stored in a toolbox."
+ },
+ "FilterStrategyType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "random_sampling",
+ "smart_filtering"
+ ]
+ }
+ ],
+ "description": "Specifies the type of filter strategy used to select traces for evaluation."
+ },
+ "FixedRatioVersionSelectionRule": {
+ "type": "object",
+ "required": [
+ "type",
+ "traffic_percentage"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "FixedRatio"
+ ]
+ },
+ "traffic_percentage": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "maximum": 100,
+ "description": "The percentage of traffic to route to the version. Must be between 0 and 100."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/VersionSelectionRule"
+ }
+ ]
+ },
+ "FolderDatasetVersion": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "uri_folder"
+ ],
+ "description": "Dataset type"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DatasetVersion"
+ }
+ ],
+ "description": "FileDatasetVersion Definition"
+ },
+ "FolderDatasetVersionUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "uri_folder"
+ ],
+ "description": "Dataset type"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DatasetVersionUpdate"
+ }
+ ],
+ "description": "FileDatasetVersion Definition"
+ },
+ "FoundryModelArtifactProfileCategory": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "DataOnly",
+ "RuntimeDependent",
+ "Unknown"
+ ]
+ }
+ ],
+ "description": "The artifact profile category.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryModelArtifactProfileSignal": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "PickleDeserialization",
+ "CustomPythonCode",
+ "DynamicOps",
+ "NativeBinary",
+ "UnknownFormat"
+ ]
+ }
+ ],
+ "description": "Signals detected in the model artifact.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryModelSourceType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "LocalUpload",
+ "TrainingJob"
+ ]
+ }
+ ],
+ "description": "The source type of the model.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryModelWarning": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "$ref": "#/components/schemas/FoundryModelWarningCode",
+ "description": "The warning code."
+ },
+ "message": {
+ "type": "string",
+ "description": "The warning message."
+ }
+ },
+ "description": "A warning associated with a model.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryModelWarningCode": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "RuntimeDependentArtifact",
+ "UnclassifiedArtifact"
+ ]
+ }
+ ],
+ "description": "Warning code for model artifacts.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryModelWeightType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "FullWeight",
+ "LoRA",
+ "DraftModel"
+ ]
+ }
+ ],
+ "description": "The weight type of the model.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryTimestamp": {
+ "type": "integer",
+ "format": "unixtime"
+ },
+ "FunctionToolCall": {
+ "type": "object",
+ "required": [
+ "name",
+ "arguments"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the function to call."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "The arguments to call the function with, as generated by the model in JSON format."
+ }
+ },
+ "description": "Details of a function tool call."
+ },
+ "GenerationWarningType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "input_quality"
+ ]
+ }
+ ],
+ "description": "Category of a warning surfaced on a generated evaluator version. Extensible so new warning categories (e.g., safety, output quality) can be introduced without a breaking change.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "GitHubIssueEvent": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "opened",
+ "closed"
+ ]
+ }
+ ],
+ "description": "Known GitHub issue events that can fire a routine.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "GitHubIssueRoutineTrigger": {
+ "type": "object",
+ "required": [
+ "type",
+ "connection_id",
+ "owner",
+ "repository",
+ "issue_event"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "github_issue"
+ ],
+ "description": "The trigger type."
+ },
+ "connection_id": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The workspace connection identifier that resolves the GitHub configuration for the trigger."
+ },
+ "owner": {
+ "type": "string",
+ "maxLength": 128,
+ "description": "The GitHub owner or organization that scopes which issues can fire the trigger."
+ },
+ "repository": {
+ "type": "string",
+ "maxLength": 128,
+ "description": "The GitHub repository filter that scopes which issues can fire the trigger."
+ },
+ "issue_event": {
+ "$ref": "#/components/schemas/GitHubIssueEvent",
+ "description": "The GitHub issue event that fires the routine."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RoutineTrigger"
+ }
+ ],
+ "description": "A GitHub issue routine trigger.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "HeaderTelemetryEndpointAuth": {
+ "type": "object",
+ "required": [
+ "type",
+ "header_name",
+ "secret_id",
+ "secret_key"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "header"
+ ],
+ "description": "The authentication type, always 'header' for header-based secret authentication."
+ },
+ "header_name": {
+ "type": "string",
+ "description": "The name of the HTTP header to inject the secret value into.",
+ "examples": [
+ "X-Otlp-Api-Key"
+ ]
+ },
+ "secret_id": {
+ "type": "string",
+ "description": "The identifier of the secret store or connection.",
+ "examples": [
+ "my-secret-store"
+ ]
+ },
+ "secret_key": {
+ "type": "string",
+ "description": "The key within the secret to retrieve the authentication value.",
+ "examples": [
+ "OTLP_KEY"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TelemetryEndpointAuth"
+ }
+ ],
+ "description": "Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header."
+ },
+ "HostedAgentDefinition": {
+ "type": "object",
+ "required": [
+ "kind",
+ "cpu",
+ "memory"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "enum": [
+ "hosted"
+ ]
+ },
+ "cpu": {
+ "type": "string",
+ "description": "The CPU configuration for the hosted agent.",
+ "examples": [
+ "0.25"
+ ]
+ },
+ "memory": {
+ "type": "string",
+ "description": "The memory configuration for the hosted agent.",
+ "examples": [
+ "0.5Gi"
+ ]
+ },
+ "environment_variables": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Environment variables to set in the hosted agent container.",
+ "examples": [
+ {
+ "name": "LOG_LEVEL",
+ "value": "debug"
+ }
+ ]
+ },
+ "container_configuration": {
+ "$ref": "#/components/schemas/ContainerConfiguration",
+ "description": "Container-based deployment configuration. Provide this for image-based deployments. Mutually exclusive with code_configuration — the service validates that exactly one is set."
+ },
+ "protocol_versions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ProtocolVersionRecord"
+ },
+ "description": "The protocols that the agent supports for ingress communication.",
+ "examples": [
+ [
+ {
+ "protocol": "responses",
+ "version": "v0.1.1"
+ },
+ {
+ "protocol": "a2a",
+ "version": "v0.3.0"
+ }
+ ]
+ ]
+ },
+ "code_configuration": {
+ "$ref": "#/components/schemas/CodeConfiguration",
+ "description": "Code-based deployment configuration. Provide this for code-based deployments. Mutually exclusive with container_configuration — the service validates that exactly one is set."
+ },
+ "telemetry_config": {
+ "$ref": "#/components/schemas/TelemetryConfig",
+ "description": "Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentDefinition"
+ }
+ ],
+ "description": "The hosted agent definition."
+ },
+ "HourlyRecurrenceSchedule": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Hourly"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RecurrenceSchedule"
+ }
+ ],
+ "description": "Hourly recurrence schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "HumanEvaluationPreviewRuleAction": {
+ "type": "object",
+ "required": [
+ "type",
+ "templateId"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "humanEvaluationPreview"
+ ]
+ },
+ "templateId": {
+ "$ref": "#/components/schemas/AssetId",
+ "description": "Human evaluation template Id."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationRuleAction"
+ }
+ ],
+ "description": "Evaluation rule action for human evaluation.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "Index": {
+ "type": "object",
+ "required": [
+ "type",
+ "name",
+ "version"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/IndexType",
+ "description": "Type of index"
+ },
+ "id": {
+ "type": "string",
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the resource",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the resource",
+ "readOnly": true
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "AzureSearch": "#/components/schemas/AzureAISearchIndex",
+ "ManagedAzureSearch": "#/components/schemas/ManagedAzureAISearchIndex",
+ "CosmosDBNoSqlVectorStore": "#/components/schemas/CosmosDBIndex"
+ }
+ },
+ "description": "Index resource Definition"
+ },
+ "IndexType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "AzureSearch",
+ "CosmosDBNoSqlVectorStore",
+ "ManagedAzureSearch"
+ ]
+ }
+ ]
+ },
+ "IndexUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/IndexType",
+ "description": "Type of index"
+ },
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "AzureSearch": "#/components/schemas/AzureAISearchIndexUpdate",
+ "ManagedAzureSearch": "#/components/schemas/ManagedAzureAISearchIndexUpdate",
+ "CosmosDBNoSqlVectorStore": "#/components/schemas/CosmosDBIndexUpdate"
+ }
+ },
+ "description": "Index resource Definition"
+ },
+ "Insight": {
+ "type": "object",
+ "required": [
+ "id",
+ "metadata",
+ "state",
+ "displayName",
+ "request"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the insights report.",
+ "readOnly": true
+ },
+ "metadata": {
+ "$ref": "#/components/schemas/InsightsMetadata",
+ "description": "Metadata about the insights report.",
+ "readOnly": true
+ },
+ "state": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.OperationState",
+ "description": "The current state of the insights.",
+ "readOnly": true
+ },
+ "displayName": {
+ "type": "string",
+ "description": "User friendly display name for the insight."
+ },
+ "request": {
+ "$ref": "#/components/schemas/InsightRequest",
+ "description": "Request for the insights analysis."
+ },
+ "result": {
+ "$ref": "#/components/schemas/InsightResult",
+ "description": "The result of the insights report.",
+ "readOnly": true
+ }
+ },
+ "description": "The response body for cluster insights.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightCluster": {
+ "type": "object",
+ "required": [
+ "id",
+ "label",
+ "suggestion",
+ "suggestionTitle",
+ "description",
+ "weight"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The id of the analysis cluster."
+ },
+ "label": {
+ "type": "string",
+ "description": "Label for the cluster"
+ },
+ "suggestion": {
+ "type": "string",
+ "description": "Suggestion for the cluster"
+ },
+ "suggestionTitle": {
+ "type": "string",
+ "description": "The title of the suggestion for the cluster"
+ },
+ "description": {
+ "type": "string",
+ "description": "Description of the analysis cluster."
+ },
+ "weight": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The weight of the analysis cluster. This indicate number of samples in the cluster."
+ },
+ "subClusters": {
+ "description": "List of subclusters within this cluster. Empty if no subclusters exist.",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/InsightCluster"
+ }
+ },
+ "samples": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/InsightSample"
+ },
+ "description": "List of samples that belong to this cluster. Empty if samples are part of subclusters."
+ }
+ },
+ "description": "A cluster of analysis samples.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightModelConfiguration": {
+ "type": "object",
+ "required": [
+ "modelDeploymentName"
+ ],
+ "properties": {
+ "modelDeploymentName": {
+ "type": "string",
+ "description": "The model deployment to be evaluated. Accepts either the deployment name alone or with the connection name as '{connectionName}/'."
+ }
+ },
+ "description": "Configuration of the model used in the insight generation.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightRequest": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/InsightType",
+ "description": "The type of request."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "EvaluationRunClusterInsight": "#/components/schemas/EvaluationRunClusterInsightRequest",
+ "AgentClusterInsight": "#/components/schemas/AgentClusterInsightRequest",
+ "EvaluationComparison": "#/components/schemas/EvaluationComparisonInsightRequest"
+ }
+ },
+ "description": "The request of the insights report.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightResult": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/InsightType",
+ "description": "The type of insights result."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "EvaluationComparison": "#/components/schemas/EvaluationComparisonInsightResult",
+ "EvaluationRunClusterInsight": "#/components/schemas/EvaluationRunClusterInsightResult",
+ "AgentClusterInsight": "#/components/schemas/AgentClusterInsightResult"
+ }
+ },
+ "description": "The result of the insights.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightSample": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "features",
+ "correlationInfo"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the analysis sample."
+ },
+ "type": {
+ "$ref": "#/components/schemas/SampleType",
+ "description": "Sample type"
+ },
+ "features": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Features to help with additional filtering of data in UX."
+ },
+ "correlationInfo": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Info about the correlation for the analysis sample."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "EvaluationResultSample": "#/components/schemas/EvaluationResultSample"
+ }
+ },
+ "description": "A sample from the analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightScheduleTask": {
+ "type": "object",
+ "required": [
+ "type",
+ "insight"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Insight"
+ ]
+ },
+ "insight": {
+ "$ref": "#/components/schemas/Insight",
+ "description": "The insight payload."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ScheduleTask"
+ }
+ ],
+ "description": "Insight task for the schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "InsightSummary": {
+ "type": "object",
+ "required": [
+ "sampleCount",
+ "uniqueSubclusterCount",
+ "uniqueClusterCount",
+ "method",
+ "usage"
+ ],
+ "properties": {
+ "sampleCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of samples analyzed."
+ },
+ "uniqueSubclusterCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of unique subcluster labels."
+ },
+ "uniqueClusterCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of unique clusters."
+ },
+ "method": {
+ "type": "string",
+ "description": "Method used for clustering."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/ClusterTokenUsage",
+ "description": "Token usage while performing clustering analysis"
+ }
+ },
+ "description": "Summary of the error cluster analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "EvaluationRunClusterInsight",
+ "AgentClusterInsight",
+ "EvaluationComparison"
+ ]
+ }
+ ],
+ "description": "The request of the insights.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightsMetadata": {
+ "type": "object",
+ "required": [
+ "createdAt"
+ ],
+ "properties": {
+ "createdAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The timestamp when the insights were created."
+ },
+ "completedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The timestamp when the insights were completed."
+ }
+ },
+ "description": "Metadata about the insights.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InvocationsProtocolConfiguration": {
+ "type": "object",
+ "description": "Configuration specific to the invocations protocol."
+ },
+ "InvocationsWsProtocolConfiguration": {
+ "type": "object",
+ "description": "Configuration specific to the WebSocket-based invocations protocol."
+ },
+ "InvokeAgentInvocationsApiDispatchPayload": {
+ "type": "object",
+ "required": [
+ "type",
+ "input"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "invoke_agent_invocations_api"
+ ],
+ "description": "The manual dispatch payload type."
+ },
+ "input": {
+ "description": "The JSON value sent as the complete downstream invocations input. The value is passed through as-is and can be an object, string, number, boolean, array, or null."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RoutineDispatchPayload"
+ }
+ ],
+ "description": "A manual payload used to test an invocations API routine dispatch.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "InvokeAgentInvocationsApiRoutineAction": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "invoke_agent_invocations_api"
+ ],
+ "description": "The action type."
+ },
+ "agent_name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The project-scoped agent name for routine dispatch."
+ },
+ "agent_endpoint_id": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "Legacy endpoint-scoped agent identifier for routine dispatch."
+ },
+ "input": {
+ "description": "Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied."
+ },
+ "session_id": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "An optional existing hosted-agent session identifier to continue during the downstream dispatch."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RoutineAction"
+ }
+ ],
+ "description": "Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "InvokeAgentResponsesApiDispatchPayload": {
+ "type": "object",
+ "required": [
+ "type",
+ "input"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "invoke_agent_responses_api"
+ ],
+ "description": "The manual dispatch payload type."
+ },
+ "input": {
+ "description": "The JSON value sent as the complete downstream responses input. The value is passed through as-is and can be an object, string, number, boolean, array, or null."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RoutineDispatchPayload"
+ }
+ ],
+ "description": "A manual payload used to test a responses API routine dispatch.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "InvokeAgentResponsesApiRoutineAction": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "invoke_agent_responses_api"
+ ],
+ "description": "The action type."
+ },
+ "agent_name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The project-scoped agent name for routine dispatch."
+ },
+ "agent_endpoint_id": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "Legacy endpoint-scoped agent identifier for routine dispatch."
+ },
+ "input": {
+ "description": "Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied."
+ },
+ "conversation": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "An optional existing conversation identifier to continue during the downstream dispatch."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RoutineAction"
+ }
+ ],
+ "description": "Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "ItemGenerationParams": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/ItemGenerationParamsType",
+ "description": "The type of item generation parameters to use."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "red_team": "#/components/schemas/RedTeamItemGenerationParams",
+ "red_team_seed_prompts": "#/components/schemas/RedTeamSeedPromptsItemGenerationParams",
+ "red_team_taxonomy": "#/components/schemas/RedTeamTaxonomyItemGenerationParams",
+ "response_retrieval": "#/components/schemas/ResponseRetrievalItemGenerationParams",
+ "conversation_gen_preview": "#/components/schemas/ConversationGenPreviewItemGenerationParams",
+ "synthetic_data_gen_preview": "#/components/schemas/SyntheticDataGenerationPreviewItemGenerationParams"
+ }
+ },
+ "description": "Represents the set of parameters used to control item generation operations."
+ },
+ "ItemGenerationParamsType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "red_team",
+ "response_retrieval",
+ "red_team_seed_prompts",
+ "red_team_taxonomy",
+ "synthetic_data_gen_preview",
+ "conversation_gen_preview"
+ ]
+ }
+ ],
+ "description": "The types of parameters for red team item generation."
+ },
+ "JobStatus": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "succeeded",
+ "failed",
+ "cancelled"
+ ]
+ }
+ ],
+ "description": "Extensible status values shared by Foundry jobs."
+ },
+ "LoraConfig": {
+ "type": "object",
+ "properties": {
+ "rank": {
+ "type": "integer",
+ "format": "int32",
+ "description": "LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64."
+ },
+ "alpha": {
+ "type": "integer",
+ "format": "int32",
+ "description": "LoRA scaling factor (α). Positive integer; typically 2× the rank."
+ },
+ "targetModules": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from adapter_config.json if omitted."
+ },
+ "dropout": {
+ "type": "number",
+ "format": "float",
+ "description": "Dropout rate used during training. Informational — not used at serving time."
+ }
+ },
+ "description": "Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "MCPToolboxTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "server_label"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp"
+ ]
+ },
+ "server_label": {
+ "type": "string",
+ "description": "A label for this MCP server, used to identify it in tool calls."
+ },
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL for the MCP server. One of `server_url`, `connector_id`, or\n `tunnel_id` must be provided."
+ },
+ "connector_id": {
+ "type": "string",
+ "enum": [
+ "connector_dropbox",
+ "connector_gmail",
+ "connector_googlecalendar",
+ "connector_googledrive",
+ "connector_microsoftteams",
+ "connector_outlookcalendar",
+ "connector_outlookemail",
+ "connector_sharepoint"
+ ],
+ "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more\n about service connectors [here](/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`"
+ },
+ "tunnel_id": {
+ "type": "string",
+ "pattern": "^tunnel_[a-z0-9]{32}$",
+ "description": "The Secure MCP Tunnel ID to use instead of a direct server URL. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided."
+ },
+ "authorization": {
+ "type": "string",
+ "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here."
+ },
+ "server_description": {
+ "type": "string",
+ "description": "Optional description of the MCP server, used to provide more context."
+ },
+ "headers": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "allowed_tools": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "always",
+ "never"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": "always"
+ },
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this MCP tool is deferred and discovered via tool search."
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "An MCP tool stored in a toolbox."
+ },
+ "ManagedAgentIdentityBlueprintReference": {
+ "type": "object",
+ "required": [
+ "type",
+ "blueprint_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "ManagedAgentIdentityBlueprint"
+ ]
+ },
+ "blueprint_id": {
+ "type": "string",
+ "description": "The ID of the managed blueprint"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentBlueprintReference"
+ }
+ ]
+ },
+ "ManagedAzureAISearchIndex": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "ManagedAzureSearch"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Index"
+ }
+ ],
+ "description": "Managed Azure AI Search Index Definition"
+ },
+ "ManagedAzureAISearchIndexUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "ManagedAzureSearch"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/IndexUpdate"
+ }
+ ],
+ "description": "Managed Azure AI Search Index Definition"
+ },
+ "McpProtocolConfiguration": {
+ "type": "object",
+ "description": "Configuration specific to the MCP protocol."
+ },
+ "MemoryCommandToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "memory_command_preview_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool, including `action` (`remember` or `forget`) and `content`."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "A memory command tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "MemoryCommandToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "memory_command_preview_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of a memory command tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "MemoryItem": {
+ "type": "object",
+ "required": [
+ "memory_id",
+ "updated_at",
+ "scope",
+ "content",
+ "kind"
+ ],
+ "properties": {
+ "memory_id": {
+ "type": "string",
+ "description": "The unique ID of the memory item."
+ },
+ "updated_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The last update time of the memory item."
+ },
+ "scope": {
+ "type": "string",
+ "description": "The namespace that logically groups and isolates memories, such as a user ID."
+ },
+ "content": {
+ "type": "string",
+ "description": "The content of the memory."
+ },
+ "kind": {
+ "$ref": "#/components/schemas/MemoryItemKind",
+ "description": "The kind of the memory item."
+ }
+ },
+ "discriminator": {
+ "propertyName": "kind",
+ "mapping": {
+ "user_profile": "#/components/schemas/UserProfileMemoryItem",
+ "chat_summary": "#/components/schemas/ChatSummaryMemoryItem",
+ "procedural": "#/components/schemas/ProceduralMemoryItem"
+ }
+ },
+ "description": "A single memory item stored in the memory store, containing content and metadata.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryItemKind": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "user_profile",
+ "chat_summary",
+ "procedural"
+ ]
+ }
+ ],
+ "description": "Memory item kind.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryOperation": {
+ "type": "object",
+ "required": [
+ "kind",
+ "memory_item"
+ ],
+ "properties": {
+ "kind": {
+ "$ref": "#/components/schemas/MemoryOperationKind",
+ "description": "The type of memory operation being performed."
+ },
+ "memory_item": {
+ "$ref": "#/components/schemas/MemoryItem",
+ "description": "The memory item to create, update, or delete."
+ }
+ },
+ "description": "Represents a single memory operation (create, update, or delete) performed on a memory item.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryOperationKind": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "create",
+ "update",
+ "delete"
+ ]
+ }
+ ],
+ "description": "Memory operation kind.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemorySearchItem": {
+ "type": "object",
+ "required": [
+ "memory_item"
+ ],
+ "properties": {
+ "memory_item": {
+ "$ref": "#/components/schemas/MemoryItem",
+ "description": "Retrieved memory item."
+ }
+ },
+ "description": "A retrieved memory item from memory search.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemorySearchOptions": {
+ "type": "object",
+ "properties": {
+ "max_memories": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of memory items to return."
+ }
+ },
+ "description": "Memory search options.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemorySearchPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "memory_store_name",
+ "scope"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "memory_search_preview"
+ ],
+ "description": "The type of the tool. Always `memory_search_preview`."
+ },
+ "memory_store_name": {
+ "type": "string",
+ "description": "The name of the memory store to use."
+ },
+ "scope": {
+ "type": "string",
+ "description": "The namespace used to group and isolate memories, such as a user ID.\nLimits which memories can be retrieved or updated.\nUse special variable `{{$userId}}` to scope memories to the current signed-in user."
+ },
+ "search_options": {
+ "$ref": "#/components/schemas/MemorySearchOptions",
+ "description": "Options for searching the memory store."
+ },
+ "update_delay": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Time to wait before updating memories after inactivity (seconds). Default 300.",
+ "default": 300
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A tool for integrating memories into the agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "MemorySearchToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "memory_search_call"
+ ]
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ },
+ "memories": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MemoryItem"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The results returned from the memory search."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "A memory search tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "MemoryStoreDefaultDefinition": {
+ "type": "object",
+ "required": [
+ "kind",
+ "chat_model",
+ "embedding_model"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "enum": [
+ "default"
+ ],
+ "description": "The kind of the memory store."
+ },
+ "chat_model": {
+ "type": "string",
+ "description": "The name or identifier of the chat completion model deployment used for memory processing."
+ },
+ "embedding_model": {
+ "type": "string",
+ "description": "The name or identifier of the embedding model deployment used for memory processing."
+ },
+ "options": {
+ "$ref": "#/components/schemas/MemoryStoreDefaultOptions",
+ "description": "Default memory store options."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MemoryStoreDefinition"
+ }
+ ],
+ "description": "Default memory store implementation.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreDefaultOptions": {
+ "type": "object",
+ "required": [
+ "user_profile_enabled",
+ "chat_summary_enabled"
+ ],
+ "properties": {
+ "user_profile_enabled": {
+ "type": "boolean",
+ "description": "Whether to enable user profile extraction and storage. Default is true.",
+ "default": true
+ },
+ "user_profile_details": {
+ "type": "string",
+ "description": "Specific categories or types of user profile information to extract and store."
+ },
+ "chat_summary_enabled": {
+ "type": "boolean",
+ "description": "Whether to enable chat summary extraction and storage. Defaults to `true`.",
+ "default": true
+ },
+ "procedural_memory_enabled": {
+ "type": "boolean",
+ "description": "Whether to enable procedural memory extraction and storage. The service defaults to `true` if a value is not specified by the caller.",
+ "default": true
+ },
+ "default_ttl_seconds": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The default time-to-live for memories in seconds. A value of `0` indicates that memories do not expire. Defaults to `0`.",
+ "default": 0
+ }
+ },
+ "description": "Default memory store configurations.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreDefinition": {
+ "type": "object",
+ "required": [
+ "kind"
+ ],
+ "properties": {
+ "kind": {
+ "$ref": "#/components/schemas/MemoryStoreKind",
+ "description": "The kind of the memory store."
+ }
+ },
+ "discriminator": {
+ "propertyName": "kind",
+ "mapping": {
+ "default": "#/components/schemas/MemoryStoreDefaultDefinition"
+ }
+ },
+ "description": "Base definition for memory store configurations.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreDeleteScopeResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "name",
+ "scope",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "memory_store.scope.deleted"
+ ],
+ "description": "The object type. Always 'memory_store.scope.deleted'."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the memory store."
+ },
+ "scope": {
+ "type": "string",
+ "description": "The scope from which memories were deleted."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the deletion operation was successful."
+ }
+ },
+ "description": "Response for deleting memories from a scope.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreKind": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "default"
+ ]
+ }
+ ],
+ "description": "The type of memory store implementation to use.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreObject": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "created_at",
+ "updated_at",
+ "name",
+ "definition"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "memory_store"
+ ],
+ "description": "The object type, which is always 'memory_store'."
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the memory store."
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The Unix timestamp (seconds) when the memory store was created."
+ },
+ "updated_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The Unix timestamp (seconds) when the memory store was last updated."
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The name of the memory store."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the memory store."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Arbitrary key-value metadata to associate with the memory store."
+ },
+ "definition": {
+ "$ref": "#/components/schemas/MemoryStoreDefinition",
+ "description": "The definition of the memory store."
+ }
+ },
+ "description": "A memory store that can store and retrieve user memories.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreOperationUsage": {
+ "type": "object",
+ "required": [
+ "embedding_tokens",
+ "input_tokens",
+ "input_tokens_details",
+ "output_tokens",
+ "output_tokens_details",
+ "total_tokens"
+ ],
+ "properties": {
+ "embedding_tokens": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The number of embedding tokens."
+ },
+ "input_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of input tokens."
+ },
+ "input_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails",
+ "description": "A detailed breakdown of the input tokens."
+ },
+ "output_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of output tokens."
+ },
+ "output_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails",
+ "description": "A detailed breakdown of the output tokens."
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The total number of tokens used."
+ }
+ },
+ "description": "Usage statistics of a memory store operation.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreSearchResponse": {
+ "type": "object",
+ "required": [
+ "search_id",
+ "memories",
+ "usage"
+ ],
+ "properties": {
+ "search_id": {
+ "type": "string",
+ "description": "The unique ID of this search request. Use this value as previous_search_id in subsequent requests to perform incremental searches."
+ },
+ "memories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MemorySearchItem"
+ },
+ "description": "Related memory items found during the search operation."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/MemoryStoreOperationUsage",
+ "description": "Usage statistics associated with the memory search operation."
+ }
+ },
+ "description": "Memory search response.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreUpdateCompletedResult": {
+ "type": "object",
+ "required": [
+ "memory_operations",
+ "usage"
+ ],
+ "properties": {
+ "memory_operations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MemoryOperation"
+ },
+ "description": "A list of individual memory operations that were performed during the update."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/MemoryStoreOperationUsage",
+ "description": "Usage statistics associated with the memory update operation."
+ }
+ },
+ "description": "Memory update result.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreUpdateResponse": {
+ "type": "object",
+ "required": [
+ "update_id",
+ "status"
+ ],
+ "properties": {
+ "update_id": {
+ "type": "string",
+ "description": "The unique ID of this update request. Use this value as previous_update_id in subsequent requests to perform incremental updates."
+ },
+ "status": {
+ "$ref": "#/components/schemas/MemoryStoreUpdateStatus",
+ "description": "The status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", \"failed\", or \"superseded\"."
+ },
+ "superseded_by": {
+ "type": "string",
+ "description": "The update_id the operation was superseded by when status is \"superseded\"."
+ },
+ "result": {
+ "$ref": "#/components/schemas/MemoryStoreUpdateCompletedResult",
+ "description": "The result of memory store update operation when status is \"completed\"."
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error",
+ "description": "Error object that describes the error when status is \"failed\"."
+ }
+ },
+ "description": "Provides the status of a memory store update operation.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreUpdateStatus": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "completed",
+ "failed",
+ "superseded"
+ ]
+ }
+ ],
+ "description": "Status of a memory store update operation.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MicrosoftFabricPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "fabric_dataagent_preview"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "fabric_dataagent_preview"
+ ],
+ "description": "The object type, which is always 'fabric_dataagent_preview'."
+ },
+ "fabric_dataagent_preview": {
+ "$ref": "#/components/schemas/FabricDataAgentToolParameters",
+ "description": "The fabric data agent tool parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for a Microsoft Fabric tool as used to configure an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "ModelCredentialRequest": {
+ "type": "object",
+ "required": [
+ "blobUri"
+ ],
+ "properties": {
+ "blobUri": {
+ "type": "string",
+ "format": "uri",
+ "description": "Blob URI of the model asset to fetch credentials for."
+ }
+ },
+ "description": "Request to fetch credentials for a model asset.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "ModelDeployment": {
+ "type": "object",
+ "required": [
+ "type",
+ "modelName",
+ "modelVersion",
+ "modelPublisher",
+ "capabilities",
+ "sku"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "ModelDeployment"
+ ],
+ "description": "The type of the deployment"
+ },
+ "modelName": {
+ "type": "string",
+ "description": "Publisher-specific name of the deployed model",
+ "readOnly": true
+ },
+ "modelVersion": {
+ "type": "string",
+ "description": "Publisher-specific version of the deployed model",
+ "readOnly": true
+ },
+ "modelPublisher": {
+ "type": "string",
+ "description": "Name of the deployed model's publisher",
+ "readOnly": true
+ },
+ "capabilities": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Capabilities of deployed model",
+ "readOnly": true
+ },
+ "sku": {
+ "$ref": "#/components/schemas/Sku",
+ "description": "Sku of the model deployment",
+ "readOnly": true
+ },
+ "connectionName": {
+ "type": "string",
+ "description": "Name of the connection the deployment comes from",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Deployment"
+ }
+ ],
+ "description": "Model Deployment Definition"
+ },
+ "ModelPendingUploadRequest": {
+ "type": "object",
+ "required": [
+ "pendingUploadType"
+ ],
+ "properties": {
+ "pendingUploadId": {
+ "type": "string",
+ "description": "If PendingUploadId is not provided, a random GUID will be used."
+ },
+ "connectionName": {
+ "type": "string",
+ "description": "Azure Storage Account connection name to use for generating temporary SAS token"
+ },
+ "pendingUploadType": {
+ "type": "string",
+ "enum": [
+ "TemporaryBlobReference"
+ ],
+ "description": "The type of pending upload. Only TemporaryBlobReference is supported for models."
+ }
+ },
+ "description": "Represents a request for a pending upload of a model version.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "ModelPendingUploadResponse": {
+ "type": "object",
+ "required": [
+ "blobReference",
+ "pendingUploadId",
+ "pendingUploadType"
+ ],
+ "properties": {
+ "blobReference": {
+ "$ref": "#/components/schemas/BlobReference",
+ "description": "Container-level read, write, list SAS."
+ },
+ "pendingUploadId": {
+ "type": "string",
+ "description": "ID for this upload request."
+ },
+ "version": {
+ "type": "string",
+ "description": "Version of asset to be created if user did not specify version when initially creating upload"
+ },
+ "pendingUploadType": {
+ "type": "string",
+ "enum": [
+ "TemporaryBlobReference"
+ ],
+ "description": "The type of pending upload. Only TemporaryBlobReference is supported for models."
+ }
+ },
+ "description": "Represents the response for a model pending upload request.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "ModelSamplingParams": {
+ "type": "object",
+ "properties": {
+ "temperature": {
+ "type": "number",
+ "format": "float",
+ "description": "The temperature parameter for sampling. Defaults to 1.0.",
+ "default": 1
+ },
+ "top_p": {
+ "type": "number",
+ "format": "float",
+ "description": "The top-p parameter for nucleus sampling. Defaults to 1.0.",
+ "default": 1
+ },
+ "seed": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The random seed for reproducibility. Defaults to 42.",
+ "default": 42
+ },
+ "max_completion_tokens": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The maximum number of tokens allowed in the completion."
+ }
+ },
+ "description": "Represents a set of parameters used to control the sampling behavior of a language model during text generation."
+ },
+ "ModelSourceData": {
+ "type": "object",
+ "properties": {
+ "sourceType": {
+ "$ref": "#/components/schemas/FoundryModelSourceType",
+ "description": "The source type of the model"
+ },
+ "jobId": {
+ "type": "string",
+ "description": "The job ID that produced this model"
+ }
+ },
+ "description": "Source information for the model",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "ModelVersion": {
+ "type": "object",
+ "required": [
+ "blobUri",
+ "name",
+ "version"
+ ],
+ "properties": {
+ "blobUri": {
+ "type": "string",
+ "format": "uri",
+ "description": "URI of the model artifact in blob storage"
+ },
+ "weightType": {
+ "$ref": "#/components/schemas/FoundryModelWeightType",
+ "description": "The weight type of the model"
+ },
+ "baseModel": {
+ "type": "string",
+ "description": "Base model asset ID"
+ },
+ "source": {
+ "$ref": "#/components/schemas/ModelSourceData",
+ "description": "The source of the model"
+ },
+ "loraConfig": {
+ "$ref": "#/components/schemas/LoraConfig",
+ "description": "Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided values take precedence over auto-detected values."
+ },
+ "artifactProfile": {
+ "$ref": "#/components/schemas/ArtifactProfile",
+ "description": "The artifact profile of the model",
+ "readOnly": true
+ },
+ "warnings": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FoundryModelWarning"
+ },
+ "description": "Service-computed advisory warnings derived from the artifact profile.",
+ "readOnly": true
+ },
+ "id": {
+ "type": "string",
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the resource",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the resource",
+ "readOnly": true
+ },
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ }
+ },
+ "description": "Model Version Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "MonthlyRecurrenceSchedule": {
+ "type": "object",
+ "required": [
+ "type",
+ "daysOfMonth"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Monthly"
+ ],
+ "description": "Monthly recurrence type."
+ },
+ "daysOfMonth": {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "description": "Days of the month for the recurrence schedule."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RecurrenceSchedule"
+ }
+ ],
+ "description": "Monthly recurrence schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "NoAuthenticationCredentials": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "None"
+ ],
+ "description": "The credential type ",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BaseCredentials"
+ }
+ ],
+ "description": "Credentials that do not require authentication"
+ },
+ "OAuthConsentRequestOutputItem": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "consent_link",
+ "server_label"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth_consent_request"
+ ]
+ },
+ "consent_link": {
+ "type": "string",
+ "description": "The link the user can use to perform OAuth consent."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The server label for the OAuth consent request."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "Request from the service for the user to perform OAuth consent."
+ },
+ "OneTimeTrigger": {
+ "type": "object",
+ "required": [
+ "type",
+ "triggerAt"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "OneTime"
+ ]
+ },
+ "triggerAt": {
+ "type": "string",
+ "description": "Date and time for the one-time trigger in ISO 8601 format."
+ },
+ "timeZone": {
+ "type": "string",
+ "description": "Time zone for the one-time trigger. Defaults to `UTC`.",
+ "default": "UTC"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Trigger"
+ }
+ ],
+ "description": "One-time trigger.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "OpenAI.AddUploadPartRequest": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "description": "The chunk of bytes for this Part."
+ }
+ },
+ "required": [
+ "data"
+ ]
+ },
+ "OpenAI.Annotation": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.AnnotationType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "file_citation": "#/components/schemas/OpenAI.FileCitationBody",
+ "url_citation": "#/components/schemas/OpenAI.UrlCitationBody",
+ "container_file_citation": "#/components/schemas/OpenAI.ContainerFileCitationBody",
+ "file_path": "#/components/schemas/OpenAI.FilePath"
+ }
+ },
+ "description": "An annotation that applies to a span of output text."
+ },
+ "OpenAI.AnnotationType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "file_citation",
+ "url_citation",
+ "container_file_citation",
+ "file_path"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ApplyPatchCallOutputStatus": {
+ "type": "string",
+ "enum": [
+ "completed",
+ "failed"
+ ]
+ },
+ "OpenAI.ApplyPatchCallOutputStatusParam": {
+ "type": "string",
+ "enum": [
+ "completed",
+ "failed"
+ ],
+ "description": "Outcome values reported for apply_patch tool call outputs.",
+ "title": "Apply patch call output status"
+ },
+ "OpenAI.ApplyPatchCallStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed"
+ ]
+ },
+ "OpenAI.ApplyPatchCallStatusParam": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed"
+ ],
+ "description": "Status values reported for apply_patch tool calls.",
+ "title": "Apply patch call status"
+ },
+ "OpenAI.ApplyPatchCreateFileOperation": {
+ "type": "object",
+ "required": [
+ "type",
+ "path",
+ "diff"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "create_file"
+ ],
+ "description": "Create a new file with the provided diff.",
+ "x-stainless-const": true
+ },
+ "path": {
+ "type": "string",
+ "description": "Path of the file to create."
+ },
+ "diff": {
+ "type": "string",
+ "description": "Diff to apply."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
+ }
+ ],
+ "description": "Instruction describing how to create a file via the apply_patch tool.",
+ "title": "Apply patch create file operation"
+ },
+ "OpenAI.ApplyPatchCreateFileOperationParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "path",
+ "diff"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "create_file"
+ ],
+ "description": "The operation type. Always `create_file`.",
+ "x-stainless-const": true
+ },
+ "path": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Path of the file to create relative to the workspace root."
+ },
+ "diff": {
+ "type": "string",
+ "maxLength": 10485760,
+ "description": "Unified diff content to apply when creating the file."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
+ }
+ ],
+ "description": "Instruction for creating a new file via the apply_patch tool.",
+ "title": "Apply patch create file operation"
+ },
+ "OpenAI.ApplyPatchDeleteFileOperation": {
+ "type": "object",
+ "required": [
+ "type",
+ "path"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "delete_file"
+ ],
+ "description": "Delete the specified file.",
+ "x-stainless-const": true
+ },
+ "path": {
+ "type": "string",
+ "description": "Path of the file to delete."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
+ }
+ ],
+ "description": "Instruction describing how to delete a file via the apply_patch tool.",
+ "title": "Apply patch delete file operation"
+ },
+ "OpenAI.ApplyPatchDeleteFileOperationParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "path"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "delete_file"
+ ],
+ "description": "The operation type. Always `delete_file`.",
+ "x-stainless-const": true
+ },
+ "path": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Path of the file to delete relative to the workspace root."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
+ }
+ ],
+ "description": "Instruction for deleting an existing file via the apply_patch tool.",
+ "title": "Apply patch delete file operation"
+ },
+ "OpenAI.ApplyPatchFileOperation": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperationType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperation",
+ "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation",
+ "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation"
+ }
+ },
+ "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
+ "title": "Apply patch operation"
+ },
+ "OpenAI.ApplyPatchFileOperationType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "create_file",
+ "delete_file",
+ "update_file"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ApplyPatchOperationParam": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParamType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperationParam",
+ "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperationParam",
+ "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperationParam"
+ }
+ },
+ "description": "One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.",
+ "title": "Apply patch operation"
+ },
+ "OpenAI.ApplyPatchOperationParamType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "create_file",
+ "delete_file",
+ "update_file"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ApplyPatchToolParam": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "apply_patch"
+ ],
+ "description": "The type of the tool. Always `apply_patch`.",
+ "x-stainless-const": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "Allows the assistant to create, delete, or update files using unified diffs.",
+ "title": "Apply patch tool"
+ },
+ "OpenAI.ApplyPatchUpdateFileOperation": {
+ "type": "object",
+ "required": [
+ "type",
+ "path",
+ "diff"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "update_file"
+ ],
+ "description": "Update an existing file with the provided diff.",
+ "x-stainless-const": true
+ },
+ "path": {
+ "type": "string",
+ "description": "Path of the file to update."
+ },
+ "diff": {
+ "type": "string",
+ "description": "Diff to apply."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
+ }
+ ],
+ "description": "Instruction describing how to update a file via the apply_patch tool.",
+ "title": "Apply patch update file operation"
+ },
+ "OpenAI.ApplyPatchUpdateFileOperationParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "path",
+ "diff"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "update_file"
+ ],
+ "description": "The operation type. Always `update_file`.",
+ "x-stainless-const": true
+ },
+ "path": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Path of the file to update relative to the workspace root."
+ },
+ "diff": {
+ "type": "string",
+ "maxLength": 10485760,
+ "description": "Unified diff content to apply to the existing file."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
+ }
+ ],
+ "description": "Instruction for updating an existing file via the apply_patch tool.",
+ "title": "Apply patch update file operation"
+ },
+ "OpenAI.ApproximateLocation": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "approximate"
+ ],
+ "description": "The type of location approximation. Always `approximate`.",
+ "x-stainless-const": true,
+ "default": "approximate"
+ },
+ "country": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "region": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "city": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "timezone": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.AssistantObject": {
+ "type": "object",
+ "required": [
+ "id",
+ "object",
+ "created_at",
+ "name",
+ "description",
+ "model",
+ "instructions",
+ "tools",
+ "metadata"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "assistant"
+ ],
+ "description": "The object type, which is always `assistant`.",
+ "x-stainless-const": true
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the assistant was created."
+ },
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "model": {
+ "type": "string",
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them."
+ },
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ },
+ "maxItems": 128,
+ "description": "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`.",
+ "default": []
+ },
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantObjectToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "response_format": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "description": "Represents an `assistant` that can call the model and use tools.",
+ "title": "Assistant",
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "The assistant object",
+ "example": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1698984975,\n \"name\": \"Math Tutor\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
+ }
+ },
+ "OpenAI.AssistantObjectToolResources": {
+ "type": "object",
+ "properties": {
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.AssistantObjectToolResourcesCodeInterpreter"
+ },
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.AssistantObjectToolResourcesFileSearch"
+ }
+ }
+ },
+ "OpenAI.AssistantObjectToolResourcesCodeInterpreter": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 20
+ }
+ }
+ },
+ "OpenAI.AssistantObjectToolResourcesFileSearch": {
+ "type": "object",
+ "properties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 1
+ }
+ }
+ },
+ "OpenAI.AssistantSupportedModels": {
+ "type": "string",
+ "enum": [
+ "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",
+ "o3-mini",
+ "o3-mini-2025-01-31",
+ "o1",
+ "o1-2024-12-17",
+ "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"
+ ]
+ },
+ "OpenAI.AssistantTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.AssistantToolType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "code_interpreter": "#/components/schemas/OpenAI.AssistantToolsCode",
+ "file_search": "#/components/schemas/OpenAI.AssistantToolsFileSearch",
+ "function": "#/components/schemas/OpenAI.AssistantToolsFunction"
+ }
+ }
+ },
+ "OpenAI.AssistantToolType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "code_interpreter",
+ "file_search",
+ "function"
+ ]
+ }
+ ]
+ },
+ "OpenAI.AssistantToolsCode": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "code_interpreter"
+ ],
+ "description": "The type of tool being defined: `code_interpreter`",
+ "x-stainless-const": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ }
+ ],
+ "title": "Code interpreter tool"
+ },
+ "OpenAI.AssistantToolsFileSearch": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file_search"
+ ],
+ "description": "The type of tool being defined: `file_search`",
+ "x-stainless-const": true
+ },
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchFileSearch",
+ "description": "Overrides for the file search tool."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ }
+ ],
+ "title": "FileSearch tool"
+ },
+ "OpenAI.AssistantToolsFileSearchFileSearch": {
+ "type": "object",
+ "properties": {
+ "max_num_results": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 1,
+ "maximum": 50
+ },
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchRankingOptions"
+ }
+ }
+ },
+ "OpenAI.AssistantToolsFileSearchTypeOnly": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file_search"
+ ],
+ "description": "The type of tool being defined: `file_search`",
+ "x-stainless-const": true
+ }
+ },
+ "title": "FileSearch tool"
+ },
+ "OpenAI.AssistantToolsFunction": {
+ "type": "object",
+ "required": [
+ "type",
+ "function"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "function"
+ ],
+ "description": "The type of tool being defined: `function`",
+ "x-stainless-const": true
+ },
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.FunctionObject"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ }
+ ],
+ "title": "Function tool"
+ },
+ "OpenAI.AssistantsApiResponseFormatOption": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatText"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
+ }
+ ],
+ "description": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\nSetting 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](/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n*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."
+ },
+ "OpenAI.AssistantsApiToolChoiceOption": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "none",
+ "auto",
+ "required"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantsNamedToolChoice"
+ }
+ ],
+ "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool."
+ },
+ "OpenAI.AssistantsNamedToolChoice": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "function",
+ "code_interpreter",
+ "file_search"
+ ],
+ "description": "The type of the tool. If type is `function`, the function name must be set"
+ },
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsNamedToolChoiceFunction"
+ }
+ },
+ "description": "Specifies a tool the model should use. Use to force the model to call a specific tool."
+ },
+ "OpenAI.AssistantsNamedToolChoiceFunction": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.AudioResponseFormat": {
+ "type": "string",
+ "enum": [
+ "json",
+ "text",
+ "srt",
+ "verbose_json",
+ "vtt",
+ "diarized_json"
+ ],
+ "description": "The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`. For `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and `diarized_json`, with `diarized_json` required to receive speaker annotations."
+ },
+ "OpenAI.AudioTranscription": {
+ "type": "object",
+ "properties": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "whisper-1",
+ "gpt-4o-mini-transcribe",
+ "gpt-4o-mini-transcribe-2025-12-15",
+ "gpt-4o-transcribe",
+ "gpt-4o-transcribe-diarize",
+ "gpt-realtime-whisper"
+ ]
+ }
+ ],
+ "description": "The model to use for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels."
+ },
+ "language": {
+ "type": "string",
+ "description": "The language of the input audio. Supplying the input language in\n [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format\n will improve accuracy and latency."
+ },
+ "prompt": {
+ "type": "string",
+ "description": "An optional text to guide the model's style or continue a previous audio\n segment.\n For `whisper-1`, the [prompt is a list of keywords](/docs/guides/speech-to-text#prompting).\n For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the prompt is a free text string, for example \"expect words related to technology\".\n Prompt is not supported with `gpt-realtime-whisper` in GA Realtime sessions."
+ },
+ "delay": {
+ "type": "string",
+ "enum": [
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
+ "description": "Controls how long the model waits before emitting transcription text.\n Higher values can improve transcription accuracy at the cost of latency.\n Only supported with `gpt-realtime-whisper` in GA Realtime sessions."
+ }
+ }
+ },
+ "OpenAI.AudioTranscriptionResponse": {
+ "type": "object",
+ "properties": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "whisper-1",
+ "gpt-4o-mini-transcribe",
+ "gpt-4o-mini-transcribe-2025-12-15",
+ "gpt-4o-transcribe",
+ "gpt-4o-transcribe-diarize",
+ "gpt-realtime-whisper"
+ ]
+ }
+ ],
+ "description": "The model used for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`."
+ },
+ "language": {
+ "type": "string",
+ "description": "The language of the input audio."
+ },
+ "prompt": {
+ "type": "string",
+ "description": "The prompt configured for input audio transcription, when present."
+ }
+ }
+ },
+ "OpenAI.AutoChunkingStrategyRequestParam": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "auto"
+ ],
+ "description": "Always `auto`.",
+ "x-stainless-const": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam"
+ }
+ ],
+ "description": "The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.",
+ "title": "Auto Chunking Strategy"
+ },
+ "OpenAI.AutoCodeInterpreterToolParam": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "auto"
+ ],
+ "description": "Always `auto`.",
+ "x-stainless-const": true,
+ "default": "auto"
+ },
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 50,
+ "description": "An optional list of uploaded files to make available to your code."
+ },
+ "memory_limit": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "network_policy": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
+ }
+ },
+ "description": "Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.",
+ "title": "Automatic Code Interpreter Tool Parameters"
+ },
+ "OpenAI.Batch": {
+ "type": "object",
+ "required": [
+ "id",
+ "object",
+ "endpoint",
+ "input_file_id",
+ "completion_window",
+ "status",
+ "created_at"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "batch"
+ ],
+ "description": "The object type, which is always `batch`.",
+ "x-stainless-const": true
+ },
+ "endpoint": {
+ "type": "string",
+ "description": "The OpenAI API endpoint used by the batch."
+ },
+ "model": {
+ "type": "string",
+ "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](/docs/models) to browse and compare available models."
+ },
+ "errors": {
+ "$ref": "#/components/schemas/OpenAI.BatchErrors"
+ },
+ "input_file_id": {
+ "type": "string",
+ "description": "The ID of the input file for the batch."
+ },
+ "completion_window": {
+ "type": "string",
+ "description": "The time frame within which the batch should be processed."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "validating",
+ "failed",
+ "in_progress",
+ "finalizing",
+ "completed",
+ "expired",
+ "cancelling",
+ "cancelled"
+ ],
+ "description": "The current status of the batch."
+ },
+ "output_file_id": {
+ "type": "string",
+ "description": "The ID of the file containing the outputs of successfully executed requests."
+ },
+ "error_file_id": {
+ "type": "string",
+ "description": "The ID of the file containing the outputs of requests with errors."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch was created."
+ },
+ "in_progress_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch started processing."
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch will expire."
+ },
+ "finalizing_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch started finalizing."
+ },
+ "completed_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch was completed."
+ },
+ "failed_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch failed."
+ },
+ "expired_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch expired."
+ },
+ "cancelling_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch started cancelling."
+ },
+ "cancelled_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch was cancelled."
+ },
+ "request_counts": {
+ "$ref": "#/components/schemas/OpenAI.BatchRequestCounts",
+ "description": "The request counts for different statuses within the batch."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.BatchUsage",
+ "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "x-oaiMeta": {
+ "name": "The batch object",
+ "example": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/completions\",\n \"model\": \"gpt-5-2025-08-07\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"usage\": {\n \"input_tokens\": 1500,\n \"input_tokens_details\": {\n \"cached_tokens\": 1024\n },\n \"output_tokens\": 500,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 300\n },\n \"total_tokens\": 2000\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n"
+ }
+ },
+ "OpenAI.BatchError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "An error code identifying the error type."
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable message providing more details about the error."
+ },
+ "param": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The name of the parameter that caused the error, if applicable."
+ },
+ "line": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The line number of the input file where the error occurred, if applicable."
+ }
+ }
+ },
+ "OpenAI.BatchErrors": {
+ "type": "object",
+ "properties": {
+ "object": {
+ "type": "string"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.BatchError"
+ }
+ }
+ }
+ },
+ "OpenAI.BatchFileExpirationAfter": {
+ "type": "object",
+ "required": [
+ "anchor",
+ "seconds"
+ ],
+ "properties": {
+ "anchor": {
+ "type": "string",
+ "enum": [
+ "created_at"
+ ],
+ "description": "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.",
+ "x-stainless-const": true
+ },
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "minimum": 3600,
+ "maximum": 2592000,
+ "description": "The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days)."
+ }
},
- "explode": false
+ "description": "The expiration policy for the output and/or error file that are generated for a batch.",
+ "title": "File expiration policy"
},
- "ListRoutinesParameters.before": {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "Unsupported. Reserved for future backward pagination support.",
- "schema": {
- "type": "string"
+ "OpenAI.BatchRequestCounts": {
+ "type": "object",
+ "required": [
+ "total",
+ "completed",
+ "failed"
+ ],
+ "properties": {
+ "total": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "completed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.BatchUsage": {
+ "type": "object",
+ "required": [
+ "input_tokens",
+ "input_tokens_details",
+ "output_tokens",
+ "output_tokens_details",
+ "total_tokens"
+ ],
+ "properties": {
+ "input_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "input_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.BatchUsageInputTokensDetails"
+ },
+ "output_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "output_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.BatchUsageOutputTokensDetails"
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.BatchUsageInputTokensDetails": {
+ "type": "object",
+ "required": [
+ "cached_tokens"
+ ],
+ "properties": {
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.BatchUsageOutputTokensDetails": {
+ "type": "object",
+ "required": [
+ "reasoning_tokens"
+ ],
+ "properties": {
+ "reasoning_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionAllowedTools": {
+ "type": "object",
+ "required": [
+ "mode",
+ "tools"
+ ],
+ "properties": {
+ "mode": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "required"
+ ],
+ "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "description": "A list of tool definitions that the model should be allowed to call.\n For the Chat Completions API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"function\": { \"name\": \"get_weather\" } },\n { \"type\": \"function\", \"function\": { \"name\": \"get_time\" } }\n ]\n ```"
+ }
},
- "explode": false
+ "description": "Constrains the tools available to the model to a pre-defined set.",
+ "title": "Allowed tools"
},
- "ListRoutinesParameters.limit": {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "The maximum number of routines to return.",
- "schema": {
- "type": "integer",
- "format": "int32"
+ "OpenAI.ChatCompletionAllowedToolsChoice": {
+ "type": "object",
+ "required": [
+ "type",
+ "allowed_tools"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "allowed_tools"
+ ],
+ "description": "Allowed tool configuration type. Always `allowed_tools`.",
+ "x-stainless-const": true
+ },
+ "allowed_tools": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionAllowedTools"
+ }
+ },
+ "description": "Constrains the tools available to the model to a pre-defined set.",
+ "title": "Allowed tools"
+ },
+ "OpenAI.ChatCompletionDeleted": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "chat.completion.deleted"
+ ],
+ "description": "The type of object being deleted.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the chat completion that was deleted."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the chat completion was deleted."
+ }
+ }
+ },
+ "OpenAI.ChatCompletionFunctionCallOption": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the function to call."
+ }
+ },
+ "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function."
+ },
+ "OpenAI.ChatCompletionFunctions": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "A description of what the function does, used by the model to choose when and how to call the function."
+ },
+ "name": {
+ "type": "string",
+ "description": "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."
+ },
+ "parameters": {
+ "$ref": "#/components/schemas/OpenAI.FunctionParameters"
+ }
+ },
+ "deprecated": true
+ },
+ "OpenAI.ChatCompletionList": {
+ "type": "object",
+ "required": [
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "description": "The type of this object. It is always set to \"list\".",
+ "x-stainless-const": true,
+ "default": "list"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponse"
+ },
+ "description": "An array of chat completion objects.",
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The identifier of the first chat completion in the data array."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The identifier of the last chat completion in the data array.",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Indicates whether there are more Chat Completions available."
+ }
+ },
+ "description": "An object representing a list of Chat Completions.",
+ "title": "ChatCompletionList",
+ "x-oaiMeta": {
+ "name": "The chat completion list object",
+ "group": "chat",
+ "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"chat.completion\",\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {},\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum,\nLearning patterns in silence—\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \"tool_calls\": null,\n \"function_call\": null\n },\n \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \"response_format\": null\n }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "OpenAI.ChatCompletionMessageCustomToolCall": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "custom"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "custom"
+ ],
+ "description": "The type of the tool. Always `custom`.",
+ "x-stainless-const": true
+ },
+ "custom": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCallCustom",
+ "description": "The custom tool that the model called."
+ }
+ },
+ "description": "A call to a custom tool created by the model.",
+ "title": "Custom tool call"
+ },
+ "OpenAI.ChatCompletionMessageCustomToolCallCustom": {
+ "type": "object",
+ "required": [
+ "name",
+ "input"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "input": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionMessageList": {
+ "type": "object",
+ "required": [
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "description": "The type of this object. It is always set to \"list\".",
+ "x-stainless-const": true,
+ "default": "list"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageListData"
+ },
+ "description": "An array of chat completion message objects.",
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The identifier of the first chat message in the data array."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The identifier of the last chat message in the data array.",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Indicates whether there are more chat messages available."
+ }
+ },
+ "description": "An object representing a list of chat completion messages.",
+ "title": "ChatCompletionMessageList",
+ "x-oaiMeta": {
+ "name": "The chat completion message list object",
+ "group": "chat",
+ "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"role\": \"user\",\n \"content\": \"write a haiku about ai\",\n \"name\": null,\n \"content_parts\": null\n }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "OpenAI.ChatCompletionMessageListData": {
+ "type": "object",
+ "required": [
+ "content",
+ "refusal",
+ "role",
+ "id"
+ ],
+ "properties": {
+ "content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "refusal": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tool_calls": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem"
+ },
+ "annotations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations"
+ },
+ "description": "Annotations for the message, when applicable, as when using the\n [web search tool](/docs/guides/tools-web-search?api-mode=chat)."
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "assistant"
+ ],
+ "description": "The role of the author of this message.",
+ "x-stainless-const": true
+ },
+ "function_call": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall",
+ "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.",
+ "deprecated": true
+ },
+ "audio": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "id": {
+ "type": "string"
+ },
+ "content_parts": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.ChatCompletionMessageToolCall": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "function"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "function"
+ ],
+ "description": "The type of the tool. Currently, only `function` is supported.",
+ "x-stainless-const": true
+ },
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallFunction",
+ "description": "The function that the model called."
+ }
+ },
+ "description": "A call to a function tool created by the model.",
+ "title": "Function tool call"
+ },
+ "OpenAI.ChatCompletionMessageToolCallFunction": {
+ "type": "object",
+ "required": [
+ "name",
+ "arguments"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "arguments": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionMessageToolCalls": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCall"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall"
+ }
+ ]
+ },
+ "description": "The tool calls generated by the model, such as function calls."
+ },
+ "OpenAI.ChatCompletionMessageToolCallsItem": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCall"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall"
+ }
+ ]
},
- "explode": false
+ "description": "The tool calls generated by the model, such as function calls."
},
- "ListRoutinesParameters.order": {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "The ordering direction. Supported values are asc and desc.",
- "schema": {
- "type": "string"
+ "OpenAI.ChatCompletionModeration": {
+ "type": "object",
+ "required": [
+ "input",
+ "output"
+ ],
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntry",
+ "description": "Moderation for the request input."
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntry",
+ "description": "Moderation for the generated output."
+ }
},
- "explode": false
+ "description": "Moderation results or errors for the request input and generated output."
},
- "UpdateToolboxRequest.name": {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the toolbox to update.",
- "schema": {
- "type": "string"
- }
- }
- },
- "schemas": {
- "A2APreviewTool": {
+ "OpenAI.ChatCompletionModerationEntry": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "a2a_preview"
- ],
- "description": "The type of the tool. Always `\"a2a_preview`."
- },
- "base_url": {
- "type": "string",
- "format": "uri",
- "description": "Base URL of the agent."
- },
- "agent_card_path": {
- "type": "string",
- "description": "The path to the agent card relative to the `base_url`.\nIf not provided, defaults to `/.well-known/agent-card.json`"
- },
- "project_connection_id": {
- "type": "string",
- "description": "The connection ID in the project for the A2A server.\nThe connection stores authentication and other connection details needed to connect to the A2A server."
- },
- "send_credentials_for_agent_card": {
- "type": "boolean",
- "description": "When `true`, Foundry sends its credentials when fetching the remote\nagent's Agent Card. The service defaults to `false` if a value is not\nspecified by the caller (anonymous fetch).",
- "default": false
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntryType"
}
},
- "allOf": [
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "moderation_results": "#/components/schemas/OpenAI.ChatCompletionModerationResults",
+ "error": "#/components/schemas/OpenAI.ChatCompletionModerationError"
+ }
+ },
+ "description": "Moderation results or an error for a chat completion moderation check."
+ },
+ "OpenAI.ChatCompletionModerationEntryType": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "moderation_results",
+ "error"
+ ]
}
- ],
- "description": "An agent implementing the A2A protocol."
+ ]
},
- "A2APreviewToolboxTool": {
+ "OpenAI.ChatCompletionModerationError": {
"type": "object",
"required": [
- "type"
+ "type",
+ "code",
+ "message"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "a2a_preview"
- ]
- },
- "base_url": {
- "type": "string",
- "format": "uri",
- "description": "Base URL of the agent."
+ "error"
+ ],
+ "description": "The object type, which is always `error`.",
+ "x-stainless-const": true
},
- "agent_card_path": {
+ "code": {
"type": "string",
- "description": "The path to the agent card relative to the `base_url`.\nIf not provided, defaults to `/.well-known/agent-card.json`"
+ "description": "The error code."
},
- "project_connection_id": {
+ "message": {
"type": "string",
- "description": "The connection ID in the project for the A2A server.\nThe connection stores authentication and other connection details needed to connect to the A2A server."
- },
- "send_credentials_for_agent_card": {
- "type": "boolean",
- "description": "When `true`, Foundry sends its credentials when fetching the remote\nagent's Agent Card. The service defaults to `false` if a value is not\nspecified by the caller (anonymous fetch).",
- "default": false
+ "description": "The error message."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/ToolboxTool"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntry"
}
],
- "description": "An A2A tool stored in a toolbox."
- },
- "A2AProtocolConfiguration": {
- "type": "object",
- "description": "Configuration specific to the A2A protocol."
+ "description": "An error produced while attempting moderation."
},
- "A2AToolCall": {
+ "OpenAI.ChatCompletionModerationResults": {
"type": "object",
"required": [
"type",
- "call_id",
- "name",
- "arguments",
- "status"
+ "model",
+ "results"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "a2a_preview_call"
- ]
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "name": {
- "type": "string",
- "description": "The name of the A2A agent card being called."
+ "moderation_results"
+ ],
+ "description": "The object type, which is always `moderation_results`.",
+ "x-stainless-const": true
},
- "arguments": {
+ "model": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "description": "The moderation model used to generate the results."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationResultBody"
+ },
+ "description": "A list of moderation results."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntry"
}
],
- "description": "An A2A (Agent-to-Agent) tool call."
+ "description": "Successful moderation results for the request input or generated output."
},
- "A2AToolCallOutput": {
+ "OpenAI.ChatCompletionNamedToolChoice": {
"type": "object",
"required": [
"type",
- "call_id",
- "name",
- "status"
+ "function"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "a2a_preview_call_output"
- ]
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "function"
+ ],
+ "description": "For function calling, the type is always `function`.",
+ "x-stainless-const": true
},
- "name": {
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceFunction"
+ }
+ },
+ "description": "Specifies a tool the model should use. Use to force the model to call a specific function.",
+ "title": "Function tool choice"
+ },
+ "OpenAI.ChatCompletionNamedToolChoiceCustom": {
+ "type": "object",
+ "required": [
+ "type",
+ "custom"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The name of the A2A agent card that was called."
- },
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the A2A tool call."
+ "enum": [
+ "custom"
+ ],
+ "description": "For custom tool calling, the type is always `custom`.",
+ "x-stainless-const": true
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "custom": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustomCustom"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "description": "Specifies a tool the model should use. Use to force the model to call a specific custom tool.",
+ "title": "Custom tool choice"
+ },
+ "OpenAI.ChatCompletionNamedToolChoiceCustomCustom": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
}
+ }
+ },
+ "OpenAI.ChatCompletionNamedToolChoiceFunction": {
+ "type": "object",
+ "required": [
+ "name"
],
- "description": "The output of an A2A (Agent-to-Agent) tool call."
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
},
- "AISearchIndexResource": {
+ "OpenAI.ChatCompletionRequestAssistantMessage": {
"type": "object",
+ "required": [
+ "role"
+ ],
"properties": {
- "project_connection_id": {
- "type": "string",
- "description": "An index connection ID in an IndexResource attached to this agent."
+ "content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "index_name": {
+ "refusal": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "role": {
"type": "string",
- "description": "The name of an index in an IndexResource attached to this agent."
+ "enum": [
+ "assistant"
+ ],
+ "description": "The role of the messages author, in this case `assistant`.",
+ "x-stainless-const": true
},
- "query_type": {
- "$ref": "#/components/schemas/AzureAISearchQueryType",
- "description": "Type of query in an AIIndexResource attached to this agent."
+ "name": {
+ "type": "string",
+ "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
},
- "top_k": {
- "type": "integer",
- "format": "int32",
- "description": "Number of documents to retrieve from search and present to the model."
+ "audio": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageAudio"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "filter": {
- "type": "string",
- "description": "filter string for search resource. [Learn more here](https://learn.microsoft.com/azure/search/search-filters)."
+ "tool_calls": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCalls"
},
- "index_asset_id": {
- "type": "string",
- "description": "Index asset id for search resource."
+ "function_call": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageFunctionCall"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "A AI Search Index resource."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
+ }
+ ],
+ "description": "Messages sent by the model in response to user messages.",
+ "title": "Assistant message"
},
- "ActivityProtocolConfiguration": {
+ "OpenAI.ChatCompletionRequestAssistantMessageAudio": {
"type": "object",
+ "required": [
+ "id"
+ ],
"properties": {
- "enable_m365_public_endpoint": {
- "type": "boolean",
- "description": "Whether to enable the M365 public endpoint for the activity protocol."
+ "id": {
+ "type": "string"
}
- },
- "description": "Configuration specific to the activity protocol."
+ }
},
- "AgentBlueprintReference": {
+ "OpenAI.ChatCompletionRequestAssistantMessageContentPart": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/AgentBlueprintReferenceType"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "ManagedAgentIdentityBlueprint": "#/components/schemas/ManagedAgentIdentityBlueprintReference"
+ "refusal": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartRefusal",
+ "text": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText"
}
}
},
- "AgentBlueprintReferenceType": {
+ "OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText": {
+ "type": "object",
+ "required": [
+ "type",
+ "text"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ],
+ "description": "The type of the content part.",
+ "x-stainless-const": true
+ },
+ "text": {
+ "type": "string",
+ "description": "The text content."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart"
+ }
+ ],
+ "description": "Learn about [text inputs](/docs/guides/text-generation).",
+ "title": "Text content part"
+ },
+ "OpenAI.ChatCompletionRequestAssistantMessageContentPartType": {
"anyOf": [
{
"type": "string"
@@ -17111,281 +38297,316 @@
{
"type": "string",
"enum": [
- "ManagedAgentIdentityBlueprint"
+ "text",
+ "refusal"
]
}
]
},
- "AgentCard": {
+ "OpenAI.ChatCompletionRequestAssistantMessageFunctionCall": {
"type": "object",
"required": [
- "version",
- "skills"
+ "arguments",
+ "name"
],
"properties": {
- "version": {
- "type": "string",
- "minLength": 1,
- "maxLength": 32,
- "description": "The version of the agent card."
- },
- "description": {
- "type": "string",
- "maxLength": 2048,
- "description": "The description of the agent card."
+ "arguments": {
+ "type": "string"
},
- "skills": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentCardSkill"
- },
- "minItems": 1,
- "maxItems": 16,
- "description": "The set of skills that an agent can perform."
+ "name": {
+ "type": "string"
}
}
},
- "AgentCardSkill": {
+ "OpenAI.ChatCompletionRequestDeveloperMessage": {
"type": "object",
"required": [
- "id",
- "name"
+ "content",
+ "role"
],
"properties": {
- "id": {
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
+ }
+ }
+ ],
+ "description": "The contents of the developer message."
+ },
+ "role": {
"type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "a unique identifier for the skill"
+ "enum": [
+ "developer"
+ ],
+ "description": "The role of the messages author, in this case `developer`.",
+ "x-stainless-const": true
},
"name": {
"type": "string",
- "minLength": 1,
- "maxLength": 128,
- "description": "The name of the skill"
- },
- "description": {
+ "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
+ }
+ ],
+ "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.",
+ "title": "Developer message"
+ },
+ "OpenAI.ChatCompletionRequestFunctionMessage": {
+ "type": "object",
+ "required": [
+ "role",
+ "content",
+ "name"
+ ],
+ "properties": {
+ "role": {
"type": "string",
- "maxLength": 2048,
- "description": "A description of the skill"
+ "enum": [
+ "function"
+ ],
+ "description": "The role of the messages author, in this case `function`.",
+ "x-stainless-const": true
},
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentCardSkillTag"
- },
- "maxItems": 5,
- "description": "set of tagwords describing classes of capabilities for the skill"
+ "content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "examples": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentCardSkillExample"
- },
- "maxItems": 5,
- "description": "A list of example scenarios that the skill can perform."
+ "name": {
+ "type": "string",
+ "description": "The name of the function to call."
}
- }
- },
- "AgentCardSkillExample": {
- "type": "string",
- "maxLength": 1024,
- "description": "A skill example string with a maximum length of 1024 characters."
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
+ }
+ ],
+ "title": "Function message",
+ "deprecated": true
},
- "AgentCardSkillTag": {
- "type": "string",
- "maxLength": 32
+ "OpenAI.ChatCompletionRequestMessage": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "role",
+ "mapping": {
+ "assistant": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessage",
+ "developer": "#/components/schemas/OpenAI.ChatCompletionRequestDeveloperMessage",
+ "function": "#/components/schemas/OpenAI.ChatCompletionRequestFunctionMessage",
+ "system": "#/components/schemas/OpenAI.ChatCompletionRequestSystemMessage",
+ "user": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessage",
+ "tool": "#/components/schemas/OpenAI.ChatCompletionRequestToolMessage"
+ }
+ }
},
- "AgentCardUpdate": {
+ "OpenAI.ChatCompletionRequestMessageContentPartAudio": {
"type": "object",
+ "required": [
+ "type",
+ "input_audio"
+ ],
"properties": {
- "version": {
+ "type": {
"type": "string",
- "minLength": 1,
- "maxLength": 32,
- "description": "The version of the agent card."
+ "enum": [
+ "input_audio"
+ ],
+ "description": "The type of the content part. Always `input_audio`.",
+ "x-stainless-const": true
},
- "description": {
- "type": "string",
- "maxLength": 2048,
- "description": "The description of the agent card."
+ "input_audio": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
+ }
+ ],
+ "description": "Learn about [audio inputs](/docs/guides/audio).",
+ "title": "Audio content part"
+ },
+ "OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio": {
+ "type": "object",
+ "required": [
+ "data",
+ "format"
+ ],
+ "properties": {
+ "data": {
+ "type": "string"
},
- "skills": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentCardSkill"
- },
- "minItems": 1,
- "maxItems": 16,
- "description": "The set of skills that an agent can perform."
+ "format": {
+ "type": "string",
+ "enum": [
+ "wav",
+ "mp3"
+ ]
}
}
},
- "AgentClusterInsightRequest": {
+ "OpenAI.ChatCompletionRequestMessageContentPartFile": {
"type": "object",
"required": [
"type",
- "agentName"
+ "file"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "AgentClusterInsight"
+ "file"
],
- "description": "The type of request."
- },
- "agentName": {
- "type": "string",
- "description": "Identifier for the agent."
+ "description": "The type of the content part. Always `file`.",
+ "x-stainless-const": true
},
- "modelConfiguration": {
- "$ref": "#/components/schemas/InsightModelConfiguration",
- "description": "Configuration of the model used in the insight generation."
+ "file": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFileFile"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/InsightRequest"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
}
],
- "description": "Insights on set of Agent Evaluation Results",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
+ "description": "Learn about [file inputs](/docs/guides/text) for text generation.",
+ "title": "File content part"
+ },
+ "OpenAI.ChatCompletionRequestMessageContentPartFileFile": {
+ "type": "object",
+ "properties": {
+ "filename": {
+ "type": "string"
+ },
+ "file_data": {
+ "type": "string"
+ },
+ "file_id": {
+ "type": "string"
+ }
}
},
- "AgentClusterInsightResult": {
+ "OpenAI.ChatCompletionRequestMessageContentPartImage": {
"type": "object",
"required": [
"type",
- "clusterInsight"
+ "image_url"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "AgentClusterInsight"
+ "image_url"
],
- "description": "The type of insights result."
+ "description": "The type of the content part.",
+ "x-stainless-const": true
},
- "clusterInsight": {
- "$ref": "#/components/schemas/ClusterInsightResult"
+ "image_url": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/InsightResult"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
}
],
- "description": "Insights from the agent cluster analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "Learn about [image inputs](/docs/guides/vision).",
+ "title": "Image content part"
},
- "AgentDataGenerationJobSource": {
+ "OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl": {
"type": "object",
"required": [
- "type",
- "agent_name"
+ "url"
],
"properties": {
- "description": {
+ "url": {
"type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ "format": "uri"
},
- "type": {
+ "detail": {
"type": "string",
"enum": [
- "agent"
+ "auto",
+ "low",
+ "high"
],
- "description": "The source type for this source, which is Agent."
- },
- "agent_name": {
- "type": "string",
- "description": "The agent name to fetch instructions from."
- },
- "agent_version": {
- "type": "string",
- "description": "The agent version. If not specified, the latest version is used."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/DataGenerationJobSource"
+ "default": "auto"
}
- ],
- "description": "Agent source for data generation jobs — references an agent to fetch instructions and metadata from.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "AgentDefinition": {
+ "OpenAI.ChatCompletionRequestMessageContentPartRefusal": {
"type": "object",
"required": [
- "kind"
+ "type",
+ "refusal"
],
"properties": {
- "kind": {
- "$ref": "#/components/schemas/AgentKind"
+ "type": {
+ "type": "string",
+ "enum": [
+ "refusal"
+ ],
+ "description": "The type of the content part.",
+ "x-stainless-const": true
},
- "rai_config": {
- "$ref": "#/components/schemas/RaiConfig",
- "description": "Configuration for Responsible AI (RAI) content filtering and safety features."
+ "refusal": {
+ "type": "string",
+ "description": "The refusal message generated by the model."
}
},
- "discriminator": {
- "propertyName": "kind",
- "mapping": {
- "hosted": "#/components/schemas/HostedAgentDefinition",
- "prompt": "#/components/schemas/PromptAgentDefinition",
- "workflow": "#/components/schemas/WorkflowAgentDefinition",
- "external": "#/components/schemas/ExternalAgentDefinition"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart"
}
- },
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
- ]
- }
- },
- "AgentDefinitionOptInKeys": {
- "type": "string",
- "enum": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
],
- "description": "Feature opt-in keys for agent definition operations supporting hosted or workflow agents."
+ "title": "Refusal content part"
},
- "AgentEndpointAuthorizationScheme": {
+ "OpenAI.ChatCompletionRequestMessageContentPartText": {
"type": "object",
"required": [
- "type"
+ "type",
+ "text"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationSchemeType"
+ "type": "string",
+ "enum": [
+ "text"
+ ],
+ "description": "The type of the content part.",
+ "x-stainless-const": true
+ },
+ "text": {
+ "type": "string",
+ "description": "The text content."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "Entra": "#/components/schemas/EntraAuthorizationScheme",
- "BotService": "#/components/schemas/BotServiceAuthorizationScheme",
- "BotServiceRbac": "#/components/schemas/BotServiceRbacAuthorizationScheme",
- "BotServiceTenant": "#/components/schemas/BotServiceTenantAuthorizationScheme"
- }
- }
+ "description": "Learn about [text inputs](/docs/guides/text-generation).",
+ "title": "Text content part"
},
- "AgentEndpointAuthorizationSchemeType": {
+ "OpenAI.ChatCompletionRequestMessageType": {
"anyOf": [
{
"type": "string"
@@ -17393,179 +38614,197 @@
{
"type": "string",
"enum": [
- "Entra",
- "BotService",
- "BotServiceRbac",
- "BotServiceTenant"
+ "developer",
+ "system",
+ "user",
+ "assistant",
+ "tool",
+ "function"
]
}
]
},
- "AgentEndpointConfig": {
- "type": "object",
- "properties": {
- "version_selector": {
- "$ref": "#/components/schemas/VersionSelector",
- "description": "The version selector of the agent endpoint determines how traffic is routed to different versions of the agent."
- },
- "protocol_configuration": {
- "$ref": "#/components/schemas/ProtocolConfiguration",
- "description": "Per-protocol configuration for the agent endpoint."
- },
- "authorization_schemes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
- },
- "description": "The authorization schemes supported by the agent endpoint"
- }
- }
- },
- "AgentEndpointConfigUpdate": {
+ "OpenAI.ChatCompletionRequestSystemMessage": {
"type": "object",
+ "required": [
+ "content",
+ "role"
+ ],
"properties": {
- "version_selector": {
- "$ref": "#/components/schemas/VersionSelectorUpdate",
- "description": "The version selector of the agent endpoint determines how traffic is routed to different versions of the agent."
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestSystemMessageContentPart"
+ }
+ }
+ ],
+ "description": "The contents of the system message."
},
- "protocol_configuration": {
- "$ref": "#/components/schemas/ProtocolConfiguration",
- "description": "Per-protocol configuration for the agent endpoint."
+ "role": {
+ "type": "string",
+ "enum": [
+ "system"
+ ],
+ "description": "The role of the messages author, in this case `system`.",
+ "x-stainless-const": true
},
- "authorization_schemes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
- },
- "description": "The authorization schemes supported by the agent endpoint"
+ "name": {
+ "type": "string",
+ "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
}
- }
- },
- "AgentEndpointProtocol": {
- "anyOf": [
- {
- "type": "string"
- },
+ },
+ "allOf": [
{
- "type": "string",
- "enum": [
- "activity",
- "responses",
- "a2a",
- "mcp",
- "invocations",
- "invocations_ws"
- ]
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
}
- ]
+ ],
+ "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.",
+ "title": "System message"
},
- "AgentEvaluatorGenerationJobSource": {
+ "OpenAI.ChatCompletionRequestSystemMessageContentPart": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
+ },
+ "OpenAI.ChatCompletionRequestToolMessage": {
"type": "object",
"required": [
- "type",
- "agent_name"
+ "role",
+ "content",
+ "tool_call_id"
],
"properties": {
- "description": {
- "type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
- },
- "type": {
+ "role": {
"type": "string",
"enum": [
- "agent"
+ "tool"
],
- "description": "The source type for this source, which is Agent."
+ "description": "The role of the messages author, in this case `tool`.",
+ "x-stainless-const": true
},
- "agent_name": {
- "type": "string",
- "description": "The agent name to fetch instructions from."
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestToolMessageContentPart"
+ }
+ }
+ ],
+ "description": "The contents of the tool message."
},
- "agent_version": {
+ "tool_call_id": {
"type": "string",
- "description": "The agent version. If not specified, the latest version is used."
+ "description": "Tool call that this message is responding to."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
}
],
- "description": "Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "title": "Tool message"
},
- "AgentFilterTraceSource": {
+ "OpenAI.ChatCompletionRequestToolMessageContentPart": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
+ },
+ "OpenAI.ChatCompletionRequestUserMessage": {
"type": "object",
"required": [
- "type"
+ "content",
+ "role"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "agent_filter"
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
+ }
+ }
],
- "description": "The type of trace source, always `agent_filter`."
- },
- "agent_id": {
- "type": "string",
- "description": "The identifier of the agent to filter traces by."
+ "description": "The contents of the user message."
},
- "agent_name": {
+ "role": {
"type": "string",
- "description": "The name of the agent to filter traces by."
+ "enum": [
+ "user"
+ ],
+ "description": "The role of the messages author, in this case `user`.",
+ "x-stainless-const": true
},
- "agent_version": {
+ "name": {
"type": "string",
- "description": "The version of the agent to filter traces by."
- },
- "start_time": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "Start time for the trace query window, expressed as a Unix timestamp (seconds)."
- },
- "end_time": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "End time for the trace query window, expressed as a Unix timestamp (seconds)."
- },
- "max_traces": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of traces to sample. Must be greater than 0."
- },
- "filter_strategy": {
- "$ref": "#/components/schemas/FilterStrategyType",
- "description": "The strategy used to filter traces."
+ "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/TraceSource"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
}
],
- "description": "A trace source that selects traces by agent reference with time-based filtering."
+ "description": "Messages sent by an end user, containing prompts or additional context\ninformation.",
+ "title": "User message"
},
- "AgentIdentity": {
+ "OpenAI.ChatCompletionRequestUserMessageContentPart": {
"type": "object",
"required": [
- "principal_id",
- "client_id"
+ "type"
],
"properties": {
- "principal_id": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "image_url": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage",
+ "input_audio": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudio",
+ "file": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFile",
+ "text": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText": {
+ "type": "object",
+ "required": [
+ "type",
+ "text"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The principal ID of the agent instance"
+ "enum": [
+ "text"
+ ],
+ "description": "The type of the content part.",
+ "x-stainless-const": true
},
- "client_id": {
+ "text": {
"type": "string",
- "description": "The client ID of the agent instance. Also referred to as the instance ID"
+ "description": "The text content."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
+ }
+ ],
+ "description": "Learn about [text inputs](/docs/guides/text-generation).",
+ "title": "Text content part"
},
- "AgentKind": {
+ "OpenAI.ChatCompletionRequestUserMessageContentPartType": {
"anyOf": [
{
"type": "string"
@@ -17573,468 +38812,339 @@
{
"type": "string",
"enum": [
- "prompt",
- "hosted",
- "workflow",
- "external"
+ "text",
+ "image_url",
+ "input_audio",
+ "file"
]
}
]
},
- "AgentObject": {
+ "OpenAI.ChatCompletionResponseMessage": {
"type": "object",
"required": [
- "object",
- "id",
- "name",
- "state",
- "versions"
+ "content",
+ "refusal",
+ "role"
],
"properties": {
- "object": {
- "type": "string",
- "enum": [
- "agent"
- ],
- "description": "The object type, which is always 'agent'."
- },
- "id": {
- "type": "string",
- "description": "The unique identifier of the agent."
- },
- "name": {
- "type": "string",
- "maxLength": 63,
- "description": "The name of the agent."
- },
- "state": {
- "$ref": "#/components/schemas/AgentState",
- "description": "The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests.",
- "readOnly": true
+ "content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "versions": {
- "type": "object",
- "properties": {
- "latest": {
- "$ref": "#/components/schemas/AgentVersionObject"
+ "refusal": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
}
- },
- "required": [
- "latest"
- ],
- "description": "The latest version of the agent."
+ ]
},
- "agent_endpoint": {
- "$ref": "#/components/schemas/AgentEndpointConfig",
- "description": "The endpoint configuration for the agent"
+ "tool_calls": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem"
},
- "instance_identity": {
- "$ref": "#/components/schemas/AgentIdentity",
- "description": "The instance identity of the agent",
- "readOnly": true
+ "annotations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations"
+ },
+ "description": "Annotations for the message, when applicable, as when using the\n [web search tool](/docs/guides/tools-web-search?api-mode=chat)."
},
- "blueprint": {
- "$ref": "#/components/schemas/AgentIdentity",
- "description": "The blueprint for the agent",
- "readOnly": true
+ "role": {
+ "type": "string",
+ "enum": [
+ "assistant"
+ ],
+ "description": "The role of the author of this message.",
+ "x-stainless-const": true
},
- "blueprint_reference": {
- "$ref": "#/components/schemas/AgentBlueprintReference",
- "description": "The blueprint for the agent",
- "readOnly": true
+ "function_call": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall",
+ "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.",
+ "deprecated": true
},
- "agent_card": {
- "$ref": "#/components/schemas/AgentCard"
+ "audio": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- }
+ },
+ "description": "A chat completion message generated by the model."
},
- "AgentReference": {
+ "OpenAI.ChatCompletionResponseMessageAnnotations": {
"type": "object",
"required": [
"type",
- "name"
+ "url_citation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "agent_reference"
- ]
- },
- "name": {
- "type": "string",
- "maxLength": 256,
- "description": "The name of the agent."
+ "url_citation"
+ ],
+ "x-stainless-const": true
},
- "version": {
- "type": "string",
- "description": "The version identifier of the agent."
+ "url_citation": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation"
}
}
},
- "AgentSessionResource": {
+ "OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation": {
"type": "object",
"required": [
- "agent_session_id",
- "version_indicator",
- "status",
- "created_at",
- "last_accessed_at",
- "expires_at"
+ "end_index",
+ "start_index",
+ "url",
+ "title"
],
"properties": {
- "agent_session_id": {
- "type": "string",
- "description": "The session identifier."
- },
- "version_indicator": {
- "$ref": "#/components/schemas/VersionIndicator",
- "description": "The version indicator determining which agent version backs this session."
- },
- "status": {
- "$ref": "#/components/schemas/AgentSessionStatus",
- "description": "The current status of the session."
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) when the session was created.",
- "readOnly": true
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "last_accessed_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) when the session was last accessed.",
- "readOnly": true
+ "url": {
+ "type": "string",
+ "format": "uri"
},
- "expires_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).",
- "readOnly": true
- }
- },
- "description": "An agent session providing a long-lived compute sandbox for hosted agent invocations."
- },
- "AgentSessionStatus": {
- "anyOf": [
- {
+ "title": {
"type": "string"
- },
- {
- "type": "string",
- "enum": [
- "creating",
- "active",
- "idle",
- "updating",
- "failed",
- "deleting",
- "deleted",
- "expired"
- ]
}
+ }
+ },
+ "OpenAI.ChatCompletionResponseMessageAudio": {
+ "type": "object",
+ "required": [
+ "id",
+ "expires_at",
+ "data",
+ "transcript"
],
- "description": "The status of an agent session."
- },
- "AgentState": {
- "anyOf": [
- {
+ "properties": {
+ "id": {
"type": "string"
},
- {
- "type": "string",
- "enum": [
- "enabled",
- "disabled"
- ]
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime"
+ },
+ "data": {
+ "type": "string"
+ },
+ "transcript": {
+ "type": "string"
}
- ],
- "description": "The operational state of an agent."
+ }
},
- "AgentTaxonomyInput": {
+ "OpenAI.ChatCompletionResponseMessageFunctionCall": {
"type": "object",
"required": [
- "type",
- "target",
- "riskCategories"
+ "arguments",
+ "name"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "agent"
- ],
- "description": "Input type of the evaluation taxonomy."
+ "arguments": {
+ "type": "string"
},
- "target": {
- "$ref": "#/components/schemas/Target",
- "description": "Target configuration for the agent."
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionStreamOptions": {
+ "type": "object",
+ "properties": {
+ "include_usage": {
+ "type": "boolean",
+ "description": "If set, an additional chunk will be streamed before the `data: [DONE]`\n message. The `usage` field on this chunk shows the token usage statistics\n for the entire request, and the `choices` field will always be an empty\n array.\n All other chunks will also include a `usage` field, but with a null\n value. **NOTE:** If the stream is interrupted, you may not receive the\n final usage chunk which contains the total token usage for the request."
},
- "riskCategories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/RiskCategory"
- },
- "description": "List of risk categories to evaluate against."
+ "include_obfuscation": {
+ "type": "boolean",
+ "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluationTaxonomyInput"
- }
- ],
- "description": "Input configuration for the evaluation taxonomy when the input type is agent.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "Options for streaming response. Only set this when you set `stream: true`."
},
- "AgentTaxonomyInputUpdate": {
+ "OpenAI.ChatCompletionTokenLogprob": {
"type": "object",
+ "required": [
+ "token",
+ "logprob",
+ "bytes",
+ "top_logprobs"
+ ],
"properties": {
- "type": {
+ "token": {
"type": "string",
- "enum": [
- "agent"
- ],
- "description": "Input type of the evaluation taxonomy."
+ "description": "The token."
},
- "target": {
- "$ref": "#/components/schemas/TargetUpdate",
- "description": "Target configuration for the agent."
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "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."
},
- "riskCategories": {
+ "bytes": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "top_logprobs": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/RiskCategory"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprobTopLogprobs"
},
- "description": "List of risk categories to evaluate against."
+ "description": "List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`."
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluationTaxonomyInputUpdate"
- }
- ],
- "description": "Input configuration for the evaluation taxonomy when the input type is agent.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "AgentVersionObject": {
+ "OpenAI.ChatCompletionTokenLogprobTopLogprobs": {
"type": "object",
"required": [
- "metadata",
- "object",
- "id",
- "name",
- "version",
- "created_at",
- "definition"
+ "token",
+ "logprob",
+ "bytes"
],
"properties": {
- "metadata": {
+ "token": {
+ "type": "string"
+ },
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "bytes": {
"anyOf": [
{
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
},
{
"type": "null"
}
- ],
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
- },
- "object": {
- "type": "string",
- "enum": [
- "agent.version"
- ],
- "description": "The object type, which is always 'agent.version'."
- },
- "id": {
- "type": "string",
- "description": "The unique identifier of the agent version."
- },
- "name": {
- "type": "string",
- "maxLength": 256,
- "description": "The name of the agent. Name can be used to retrieve/update/delete the agent."
- },
- "version": {
- "type": "string",
- "description": "The version identifier of the agent. Agents are immutable and every update creates a new version while keeping the name same."
- },
- "description": {
- "type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
- },
- "created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The Unix timestamp (seconds) when the agent was created."
- },
- "definition": {
- "$ref": "#/components/schemas/AgentDefinition"
- },
- "draft": {
- "type": "boolean",
- "description": "Whether this agent version is a draft (candidate) rather than a release. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to false.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DraftAgents=V1Preview"
- ]
- },
- "default": false
- },
- "status": {
- "$ref": "#/components/schemas/AgentVersionStatus",
- "description": "The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For hosted agents, reflects infrastructure readiness."
- },
- "instance_identity": {
- "$ref": "#/components/schemas/AgentIdentity",
- "description": "The instance identity of the agent",
- "readOnly": true
- },
- "blueprint": {
- "$ref": "#/components/schemas/AgentIdentity",
- "description": "The blueprint for the agent",
- "readOnly": true
- },
- "blueprint_reference": {
- "$ref": "#/components/schemas/AgentBlueprintReference",
- "description": "The blueprint for the agent",
- "readOnly": true
- },
- "agent_guid": {
- "type": "string",
- "description": "The unique GUID identifier of the agent.",
- "readOnly": true
+ ]
}
}
},
- "AgentVersionStatus": {
- "type": "string",
- "enum": [
- "creating",
- "active",
- "failed",
- "deleting",
- "deleted"
- ],
- "description": "The provisioning status of an agent version."
- },
- "AgenticIdentityPreviewCredentials": {
+ "OpenAI.ChatCompletionTool": {
"type": "object",
"required": [
- "type"
+ "type",
+ "function"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "AgenticIdentityToken_Preview"
+ "function"
],
- "description": "The credential type",
- "readOnly": true
+ "description": "The type of the tool. Currently, only `function` is supported.",
+ "x-stainless-const": true
+ },
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.FunctionObject"
}
},
- "allOf": [
+ "description": "A function tool that can be used to generate a response.",
+ "title": "Function tool"
+ },
+ "OpenAI.ChatCompletionToolChoiceOption": {
+ "oneOf": [
{
- "$ref": "#/components/schemas/BaseCredentials"
+ "type": "string",
+ "enum": [
+ "none",
+ "auto",
+ "required"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionAllowedToolsChoice"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoice"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustom"
}
],
- "description": "Agentic identity credential definition"
- },
- "ApiErrorResponse": {
- "type": "object",
- "required": [
- "error"
- ],
- "properties": {
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error"
- }
- },
- "description": "Error response for API failures."
+ "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n`none` is the default when no tools are present. `auto` is the default if tools are present."
},
- "ApiKeyCredentials": {
+ "OpenAI.ChunkingStrategyRequestParam": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "ApiKey"
- ],
- "description": "The credential type",
- "readOnly": true
- },
- "key": {
- "type": "string",
- "description": "API Key",
- "readOnly": true
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParamType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/BaseCredentials"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "auto": "#/components/schemas/OpenAI.AutoChunkingStrategyRequestParam",
+ "static": "#/components/schemas/OpenAI.StaticChunkingStrategyRequestParam"
}
- ],
- "description": "API Key Credential definition"
+ },
+ "description": "The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy."
},
- "ArtifactProfile": {
- "type": "object",
- "required": [
- "category"
- ],
- "properties": {
- "category": {
- "$ref": "#/components/schemas/FoundryModelArtifactProfileCategory",
- "description": "The category of the artifact profile"
+ "OpenAI.ChunkingStrategyRequestParamType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "signals": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/FoundryModelArtifactProfileSignal"
- },
- "description": "Signals detected in the model artifact"
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "static"
+ ]
}
- },
- "description": "Artifact profile of the model",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
- }
+ ]
},
- "AssetCredentialResponse": {
+ "OpenAI.ChunkingStrategyResponse": {
"type": "object",
"required": [
- "blobReference"
+ "type"
],
"properties": {
- "blobReference": {
- "$ref": "#/components/schemas/BlobReference",
- "description": "Credential info to access the storage account."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponseType"
}
},
- "description": "Represents a reference to a blob for consumption"
- },
- "AssetId": {
- "type": "string",
- "description": "Identifier of a saved asset."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "static": "#/components/schemas/OpenAI.StaticChunkingStrategyResponseParam",
+ "other": "#/components/schemas/OpenAI.OtherChunkingStrategyResponseParam"
+ }
+ },
+ "description": "The strategy used to chunk the file."
},
- "AttackStrategy": {
+ "OpenAI.ChunkingStrategyResponseType": {
"anyOf": [
{
"type": "string"
@@ -18042,412 +39152,616 @@
{
"type": "string",
"enum": [
- "easy",
- "moderate",
- "difficult",
- "ascii_art",
- "ascii_smuggler",
- "atbash",
- "base64",
- "binary",
- "caesar",
- "character_space",
- "jailbreak",
- "ansi_attack",
- "character_swap",
- "suffix_append",
- "string_join",
- "unicode_confusable",
- "unicode_substitution",
- "diacritic",
- "flip",
- "leetspeak",
- "rot13",
- "morse",
- "url",
- "baseline",
- "indirect_jailbreak",
- "tense",
- "multi_turn",
- "crescendo"
+ "static",
+ "other"
]
}
- ],
- "description": "Strategies for attacks.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "RedTeams=V1Preview"
- ]
- }
+ ]
},
- "Azure.Core.Foundations.Error": {
+ "OpenAI.ClickButtonType": {
+ "type": "string",
+ "enum": [
+ "left",
+ "right",
+ "wheel",
+ "back",
+ "forward"
+ ]
+ },
+ "OpenAI.ClickParam": {
"type": "object",
"required": [
- "code",
- "message"
+ "type",
+ "button",
+ "x",
+ "y"
],
"properties": {
- "code": {
+ "type": {
"type": "string",
- "description": "One of a server-defined set of error codes."
+ "enum": [
+ "click"
+ ],
+ "description": "Specifies the event type. For a click action, this property is always `click`.",
+ "x-stainless-const": true
},
- "message": {
- "type": "string",
- "description": "A human-readable representation of the error."
+ "button": {
+ "$ref": "#/components/schemas/OpenAI.ClickButtonType",
+ "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`."
},
- "target": {
- "type": "string",
- "description": "The target of the error."
+ "x": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The x-coordinate where the click occurred."
},
- "details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.Error"
- },
- "description": "An array of details about specific errors that led to this reported error."
+ "y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The y-coordinate where the click occurred."
},
- "innererror": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.InnerError",
- "description": "An object containing more specific information than the current object about the error."
+ "keys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "The error object."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ }
+ ],
+ "description": "A click action.",
+ "title": "Click"
},
- "Azure.Core.Foundations.ErrorResponse": {
+ "OpenAI.CodeInterpreterOutputImage": {
"type": "object",
"required": [
- "error"
+ "type",
+ "url"
],
"properties": {
- "error": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.Error",
- "description": "The error object."
- }
- },
- "description": "A response containing error details."
- },
- "Azure.Core.Foundations.InnerError": {
- "type": "object",
- "properties": {
- "code": {
+ "type": {
"type": "string",
- "description": "One of a server-defined set of error codes."
+ "enum": [
+ "image"
+ ],
+ "description": "The type of the output. Always `image`.",
+ "x-stainless-const": true,
+ "default": "image"
},
- "innererror": {
- "description": "Inner error.",
- "$ref": "#/components/schemas/Azure.Core.Foundations.InnerError"
+ "url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the image output from the code interpreter."
}
},
- "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors."
+ "description": "The image output from the code interpreter.",
+ "title": "Code interpreter output image"
},
- "Azure.Core.Foundations.OperationState": {
- "anyOf": [
- {
+ "OpenAI.CodeInterpreterOutputLogs": {
+ "type": "object",
+ "required": [
+ "type",
+ "logs"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "NotStarted",
- "Running",
- "Succeeded",
- "Failed",
- "Canceled"
- ]
+ "logs"
+ ],
+ "description": "The type of the output. Always `logs`.",
+ "x-stainless-const": true,
+ "default": "logs"
},
- {
- "type": "string"
+ "logs": {
+ "type": "string",
+ "description": "The logs output from the code interpreter."
}
- ],
- "description": "Enum describing allowed operation states."
- },
- "Azure.Core.uuid": {
- "type": "string",
- "format": "uuid",
- "description": "Universally Unique Identifier"
+ },
+ "description": "The logs output from the code interpreter.",
+ "title": "Code interpreter output logs"
},
- "AzureAIAgentTarget": {
+ "OpenAI.CodeInterpreterTool": {
"type": "object",
"required": [
- "type",
- "name"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_agent"
+ "code_interpreter"
],
- "description": "The type of target, always `azure_ai_agent`."
+ "description": "The type of the code interpreter tool. Always `code_interpreter`.",
+ "x-stainless-const": true
},
"name": {
"type": "string",
- "description": "The unique identifier of the Azure AI agent."
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- "version": {
+ "description": {
"type": "string",
- "description": "The version of the Azure AI agent."
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- "tool_descriptions": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ToolDescription"
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
},
- "description": "The parameters used to control the sampling behavior of the agent during text generation."
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
+ "container": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AutoCodeInterpreterToolParam"
+ }
+ ],
+ "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code, along with an\noptional `memory_limit` setting.\nIf not provided, the service assumes auto."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/Target"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "Represents a target specifying an Azure AI agent."
+ "description": "A tool that runs Python code to help generate a response to a prompt.",
+ "title": "Code interpreter"
},
- "AzureAIAgentTargetUpdate": {
+ "OpenAI.CompactResource": {
"type": "object",
+ "required": [
+ "id",
+ "object",
+ "output",
+ "created_at",
+ "usage"
+ ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "azure_ai_agent"
- ],
- "description": "The type of target, always `azure_ai_agent`."
- },
- "name": {
+ "id": {
"type": "string",
- "description": "The unique identifier of the Azure AI agent."
+ "description": "The unique identifier for the compacted response."
},
- "version": {
+ "object": {
"type": "string",
- "description": "The version of the Azure AI agent."
+ "enum": [
+ "response.compaction"
+ ],
+ "description": "The object type. Always `response.compaction`.",
+ "x-stainless-const": true,
+ "default": "response.compaction"
},
- "tool_descriptions": {
+ "output": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/ToolDescription"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
},
- "description": "The parameters used to control the sampling behavior of the agent during text generation."
+ "description": "The compacted list of output items."
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the compacted conversation was created."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsage",
+ "description": "Token accounting for the compaction pass, including cached, reasoning, and total tokens."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/TargetUpdate"
- }
- ],
- "description": "Represents a target specifying an Azure AI agent."
+ "title": "The compacted response object"
},
- "AzureAIBenchmarkDataSourceConfig": {
+ "OpenAI.CompactResponseMethodPublicBody": {
"type": "object",
"required": [
- "scenario",
- "benchmark_name"
+ "model"
],
"properties": {
- "scenario": {
+ "model": {
"type": "string",
- "enum": [
- "benchmark_preview"
- ],
- "description": "Data schema scenario, always `benchmark` for benchmark evaluations."
+ "description": "The model deployment to use for the compaction of this response."
},
- "benchmark_name": {
- "type": "string",
- "description": "The name of the benchmark specification."
+ "input": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "benchmark_version": {
- "type": "string",
- "description": "The version of the benchmark specification (e.g., '0.1'). Latest version if not specified."
+ "previous_response_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "grader_model": {
- "type": "string",
- "description": "Optional grader model for benchmarks that use model graders, Required when the benchmark's testing_criteria uses a model grader type."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "prompt_cache_key": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "prompt_cache_retention": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.PromptCacheRetentionEnum"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "service_tier": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ServiceTierEnum"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- ],
- "description": "Data source configuration for benchmark evaluations."
+ }
},
- "AzureAIBenchmarkPreviewEvalRunDataSource": {
+ "OpenAI.ComparisonFilter": {
"type": "object",
"required": [
"type",
- "target"
+ "key",
+ "value"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_benchmark_preview"
+ "eq",
+ "ne",
+ "gt",
+ "gte",
+ "lt",
+ "lte",
+ "in",
+ "nin"
],
- "description": "The type of data source, always `azure_ai_benchmark_preview`."
+ "description": "Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.\n - `eq`: equals\n - `ne`: not equal\n - `gt`: greater than\n - `gte`: greater than or equal\n - `lt`: less than\n - `lte`: less than or equal\n - `in`: in\n - `nin`: not in",
+ "default": "eq"
},
- "input_messages": {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference",
- "description": "Input messages configuration."
+ "key": {
+ "type": "string",
+ "description": "The key to compare against the value."
},
- "target": {
- "anyOf": [
+ "value": {
+ "oneOf": [
{
- "$ref": "#/components/schemas/AzureAIModelTarget"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/AzureAIAgentTarget"
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ]
+ }
}
],
- "description": "The target model or agent to evaluate against the benchmark.\nWhen using `azure_ai_model` target, `sampling_params` must not be provided;\ninference parameters are auto-filled from the benchmark specification stored in eval group properties."
+ "description": "The value to compare against the attribute key; supports string, number, or boolean types."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/EvalRunDataSource"
+ "description": "A filter used to compare a specified attribute key to a given value using a defined comparison operation.",
+ "title": "Comparison Filter",
+ "x-oaiMeta": {
+ "name": "ComparisonFilter"
+ }
+ },
+ "OpenAI.CompleteUploadRequest": {
+ "type": "object",
+ "required": [
+ "part_ids"
+ ],
+ "properties": {
+ "part_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The ordered list of Part IDs."
+ },
+ "md5": {
+ "type": "string",
+ "description": "The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect."
}
+ }
+ },
+ "OpenAI.CompletionUsage": {
+ "type": "object",
+ "required": [
+ "completion_tokens",
+ "prompt_tokens",
+ "total_tokens"
],
- "description": "Represents a data source for benchmark evaluation runs."
+ "properties": {
+ "completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of tokens in the generated completion."
+ },
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of tokens in the prompt."
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Total number of tokens used in the request (prompt + completion)."
+ },
+ "completion_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.CompletionUsageCompletionTokensDetails",
+ "description": "Breakdown of tokens used in a completion."
+ },
+ "prompt_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.CompletionUsagePromptTokensDetails",
+ "description": "Breakdown of tokens used in the prompt."
+ }
+ },
+ "description": "Usage statistics for the completion request."
},
- "AzureAIDataSourceConfig": {
+ "OpenAI.CompletionUsageCompletionTokensDetails": {
+ "type": "object",
+ "properties": {
+ "accepted_prediction_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "audio_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "reasoning_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "rejected_prediction_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.CompletionUsagePromptTokensDetails": {
+ "type": "object",
+ "properties": {
+ "audio_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.CompoundFilter": {
"type": "object",
"required": [
"type",
- "scenario"
+ "filters"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_source"
+ "and",
+ "or"
],
- "description": "The object type, which is always `azure_ai_source`."
+ "description": "Type of operation: `and` or `or`."
},
- "scenario": {
- "type": "string",
- "enum": [
- "red_team",
- "responses",
- "traces_preview",
- "synthetic_data_gen_preview",
- "benchmark_preview"
- ],
- "description": "Data schema scenario."
- }
- },
- "discriminator": {
- "propertyName": "scenario",
- "mapping": {
- "benchmark_preview": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ "filters": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
+ },
+ {}
+ ]
+ },
+ "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/DataSourceConfig"
- }
- ],
- "description": "Base data source configuration for Azure AI evaluation scenarios."
+ "description": "Combine multiple filters using `and` or `or`.",
+ "title": "Compound Filter",
+ "x-oaiMeta": {
+ "name": "CompoundFilter"
+ }
},
- "AzureAIModelTarget": {
+ "OpenAI.ComputerAction": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "azure_ai_model"
- ],
- "description": "The type of target, always `azure_ai_model`."
- },
- "model": {
- "type": "string",
- "description": "The unique identifier of the Azure AI model."
- },
- "sampling_params": {
- "$ref": "#/components/schemas/ModelSamplingParams",
- "description": "The parameters used to control the sampling behavior of the model during text generation."
+ "$ref": "#/components/schemas/OpenAI.ComputerActionType"
}
},
- "allOf": [
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "click": "#/components/schemas/OpenAI.ClickParam",
+ "double_click": "#/components/schemas/OpenAI.DoubleClickAction",
+ "drag": "#/components/schemas/OpenAI.DragParam",
+ "keypress": "#/components/schemas/OpenAI.KeyPressAction",
+ "move": "#/components/schemas/OpenAI.MoveParam",
+ "screenshot": "#/components/schemas/OpenAI.ScreenshotParam",
+ "scroll": "#/components/schemas/OpenAI.ScrollParam",
+ "type": "#/components/schemas/OpenAI.TypeParam",
+ "wait": "#/components/schemas/OpenAI.WaitParam"
+ }
+ }
+ },
+ "OpenAI.ComputerActionList": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ },
+ "description": "Flattened batched actions for `computer_use`. Each action includes an\n`type` discriminator and action-specific fields.",
+ "title": "Computer Action List"
+ },
+ "OpenAI.ComputerActionType": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/Target"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "click",
+ "double_click",
+ "drag",
+ "keypress",
+ "move",
+ "screenshot",
+ "scroll",
+ "type",
+ "wait"
+ ]
}
- ],
- "description": "Represents a target specifying an Azure AI model for operations requiring model selection."
+ ]
},
- "AzureAIModelTargetUpdate": {
+ "OpenAI.ComputerCallSafetyCheckParam": {
"type": "object",
+ "required": [
+ "id"
+ ],
"properties": {
- "type": {
+ "id": {
"type": "string",
- "enum": [
- "azure_ai_model"
- ],
- "description": "The type of target, always `azure_ai_model`."
+ "description": "The ID of the pending safety check."
},
- "model": {
- "type": "string",
- "description": "The unique identifier of the Azure AI model."
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "sampling_params": {
- "$ref": "#/components/schemas/ModelSamplingParams",
- "description": "The parameters used to control the sampling behavior of the model during text generation."
+ "message": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/TargetUpdate"
- }
- ],
- "description": "Represents a target specifying an Azure AI model for operations requiring model selection."
+ "description": "A pending safety check for the computer call."
},
- "AzureAIResponsesEvalRunDataSource": {
+ "OpenAI.ComputerEnvironment": {
+ "type": "string",
+ "enum": [
+ "windows",
+ "mac",
+ "linux",
+ "ubuntu",
+ "browser"
+ ]
+ },
+ "OpenAI.ComputerScreenshotContent": {
"type": "object",
"required": [
"type",
- "item_generation_params",
- "max_runs_hourly",
- "event_configuration_id"
+ "image_url",
+ "file_id",
+ "detail"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_responses"
+ "computer_screenshot"
],
- "description": "The type of data source, always `azure_ai_responses`."
+ "description": "Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.",
+ "x-stainless-const": true
},
- "item_generation_params": {
- "$ref": "#/components/schemas/ResponseRetrievalItemGenerationParams",
- "description": "The parameters for item generation."
+ "image_url": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "max_runs_hourly": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of evaluation runs allowed per hour."
+ "file_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "event_configuration_id": {
- "type": "string",
- "description": "The event configuration name associated with this evaluation run."
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/EvalRunDataSource"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "Represents a data source for evaluation runs that are specific to Continuous Evaluation scenarios."
+ "description": "A screenshot of a computer.",
+ "title": "Computer screenshot"
},
- "AzureAISearchIndex": {
+ "OpenAI.ComputerScreenshotImage": {
"type": "object",
"required": [
"type"
@@ -18456,19 +39770,25 @@
"type": {
"type": "string",
"enum": [
- "AzureSearch"
+ "computer_screenshot"
],
- "description": "Type of index"
+ "description": "Specifies the event type. For a computer screenshot, this property is\n always set to `computer_screenshot`.",
+ "x-stainless-const": true,
+ "default": "computer_screenshot"
+ },
+ "image_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the screenshot image."
+ },
+ "file_id": {
+ "type": "string",
+ "description": "The identifier of an uploaded file that contains the screenshot."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/Index"
- }
- ],
- "description": "Azure AI Search Index Definition"
+ "description": "A computer screenshot image used with the computer use tool."
},
- "AzureAISearchIndexUpdate": {
+ "OpenAI.ComputerTool": {
"type": "object",
"required": [
"type"
@@ -18477,71 +39797,48 @@
"type": {
"type": "string",
"enum": [
- "AzureSearch"
+ "computer"
],
- "description": "Type of index"
+ "description": "The type of the computer tool. Always `computer`.",
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/IndexUpdate"
- }
- ],
- "description": "Azure AI Search Index Definition"
- },
- "AzureAISearchQueryType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "simple",
- "semantic",
- "vector",
- "vector_simple_hybrid",
- "vector_semantic_hybrid"
- ]
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "Available query types for Azure AI Search tool."
+ "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).",
+ "title": "Computer"
},
- "AzureAISearchTool": {
+ "OpenAI.ComputerUsePreviewTool": {
"type": "object",
"required": [
"type",
- "azure_ai_search"
+ "environment",
+ "display_width",
+ "display_height"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_search"
+ "computer_use_preview"
],
- "description": "The object type, which is always 'azure_ai_search'."
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The type of the computer use tool. Always `computer_use_preview`.",
+ "x-stainless-const": true
},
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "environment": {
+ "$ref": "#/components/schemas/OpenAI.ComputerEnvironment",
+ "description": "The type of computer environment to control."
},
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "display_width": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The width of the computer display."
},
- "azure_ai_search": {
- "$ref": "#/components/schemas/AzureAISearchToolResource",
- "description": "The azure ai search index resource."
+ "display_height": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The height of the computer display."
}
},
"allOf": [
@@ -18549,1507 +39846,1940 @@
"$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "The input definition information for an Azure AI search tool as used to configure an agent."
+ "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).",
+ "title": "Computer use preview"
},
- "AzureAISearchToolCall": {
+ "OpenAI.ContainerAutoParam": {
"type": "object",
"required": [
- "type",
- "call_id",
- "arguments",
- "status"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_search_call"
- ]
+ "container_auto"
+ ],
+ "description": "Automatically creates a container for this request",
+ "x-stainless-const": true
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 50,
+ "description": "An optional list of uploaded files to make available to your code."
},
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "memory_limit": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ContainerSkill"
+ },
+ "maxItems": 200,
+ "description": "An optional list of skills referenced by id or inline data."
+ },
+ "network_policy": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
}
- ],
- "description": "An Azure AI Search tool call."
+ ]
},
- "AzureAISearchToolCallOutput": {
+ "OpenAI.ContainerFileCitationBody": {
"type": "object",
"required": [
"type",
- "call_id",
- "status"
+ "container_id",
+ "file_id",
+ "start_index",
+ "end_index",
+ "filename"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_search_call_output"
- ]
+ "container_file_citation"
+ ],
+ "description": "The type of the container file citation. Always `container_file_citation`.",
+ "x-stainless-const": true
},
- "call_id": {
+ "container_id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The ID of the container file."
},
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Azure AI Search tool call."
+ "file_id": {
+ "type": "string",
+ "description": "The ID of the file."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the first character of the container file citation in the message."
+ },
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the last character of the container file citation in the message."
+ },
+ "filename": {
+ "type": "string",
+ "description": "The filename of the container file cited."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.Annotation"
}
],
- "description": "The output of an Azure AI Search tool call."
+ "description": "A citation for a container file used to generate a model response.",
+ "title": "Container file citation"
},
- "AzureAISearchToolResource": {
+ "OpenAI.ContainerFileListResource": {
"type": "object",
"required": [
- "indexes"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "indexes": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "description": "The type of object returned, must be 'list'."
+ },
+ "data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/AISearchIndexResource"
+ "$ref": "#/components/schemas/OpenAI.ContainerFileResource"
},
- "maxItems": 1,
- "description": "The indices attached to this agent. There can be a maximum of 1 index\nresource attached to the agent."
- }
- },
- "description": "A set of index resources used by the `azure_ai_search` tool."
- },
- "AzureAISearchToolboxTool": {
- "type": "object",
- "required": [
- "type",
- "azure_ai_search"
- ],
- "properties": {
- "type": {
+ "description": "A list of container files.",
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
"type": "string",
- "enum": [
- "azure_ai_search"
- ]
+ "description": "The ID of the first file in the list."
},
- "azure_ai_search": {
- "$ref": "#/components/schemas/AzureAISearchToolResource",
- "description": "The azure ai search index resource."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/ToolboxTool"
- }
- ],
- "description": "An Azure AI Search tool stored in a toolbox."
- },
- "AzureAITraceDataSourcePreviewEvalRunDataSource": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "last_id": {
"type": "string",
- "enum": [
- "azure_ai_trace_data_source_preview"
- ],
- "description": "The type of data source, always `azure_ai_trace_data_source_preview`."
+ "description": "The ID of the last file in the list.",
+ "x-ms-list-continuation-token": true
},
- "trace_source": {
- "$ref": "#/components/schemas/TraceSource",
- "description": "The trace source that defines how traces are selected for evaluation."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/EvalRunDataSource"
+ "has_more": {
+ "type": "boolean",
+ "description": "Whether there are more files available."
}
- ],
- "description": "A wrapper data source that contains a polymorphic trace source to specify how traces are selected for evaluation."
+ }
},
- "AzureContentFilterBlocklistIdResult": {
+ "OpenAI.ContainerFileResource": {
"type": "object",
"required": [
"id",
- "filtered"
+ "object",
+ "container_id",
+ "created_at",
+ "bytes",
+ "path",
+ "source"
],
"properties": {
"id": {
"type": "string",
- "description": "The ID of the custom blocklist."
+ "description": "Unique identifier for the file."
},
- "filtered": {
- "type": "boolean",
- "description": "Whether the blocklist resulted in filtering."
+ "object": {
+ "type": "string",
+ "enum": [
+ "container.file"
+ ],
+ "description": "The type of this object (`container.file`)."
+ },
+ "container_id": {
+ "type": "string",
+ "description": "The container this file belongs to."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the file was created."
+ },
+ "bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Size of the file in bytes."
+ },
+ "path": {
+ "type": "string",
+ "description": "Path of the file in the container."
+ },
+ "source": {
+ "type": "string",
+ "description": "Source of the file (e.g., `user`, `assistant`)."
}
},
- "description": "A content filter blocklist ID result."
+ "title": "The container file object",
+ "x-oaiMeta": {
+ "name": "The container file object",
+ "example": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n}\n"
+ }
},
- "AzureContentFilterBlocklistResult": {
+ "OpenAI.ContainerListResource": {
"type": "object",
"required": [
- "filtered"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether any blocklist resulted in filtering."
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "description": "The type of object returned, must be 'list'."
},
- "details": {
+ "data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/AzureContentFilterBlocklistIdResult"
+ "$ref": "#/components/schemas/OpenAI.ContainerResource"
},
- "description": "The pairs of individual blocklist IDs and their filtering results."
- }
- },
- "description": "A collection of filtering results for configured custom blocklists."
- },
- "AzureContentFilterCitation": {
- "type": "object",
- "properties": {
- "license": {
+ "description": "A list of containers.",
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
"type": "string",
- "description": "The license associated with the detection."
+ "description": "The ID of the first container in the list."
},
- "url": {
+ "last_id": {
"type": "string",
- "format": "uri",
- "description": "The URL associated with the license."
- }
- },
- "description": "Citation details for protected material detection."
- },
- "AzureContentFilterCompletionTextSpan": {
- "type": "object",
- "required": [
- "completion_start_offset",
- "completion_end_offset"
- ],
- "properties": {
- "completion_start_offset": {
- "type": "integer",
- "format": "int32",
- "description": "Offset of the UTF32 code point which begins the span."
+ "description": "The ID of the last container in the list.",
+ "x-ms-list-continuation-token": true
},
- "completion_end_offset": {
- "type": "integer",
- "format": "int32",
- "description": "Offset of the first UTF32 code point which is excluded from the span."
+ "has_more": {
+ "type": "boolean",
+ "description": "Whether there are more containers available."
}
- },
- "description": "A representation of a span of completion text as used by Azure OpenAI content filter results."
+ }
},
- "AzureContentFilterCompletionTextSpanDetectionResult": {
+ "OpenAI.ContainerMemoryLimit": {
+ "type": "string",
+ "enum": [
+ "1g",
+ "4g",
+ "16g",
+ "64g"
+ ]
+ },
+ "OpenAI.ContainerNetworkPolicyAllowlistParam": {
"type": "object",
"required": [
- "filtered",
- "detected",
- "details"
+ "type",
+ "allowed_domains"
],
"properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
- },
- "detected": {
- "type": "boolean",
- "description": "Whether the content category was detected."
+ "type": {
+ "type": "string",
+ "enum": [
+ "allowlist"
+ ],
+ "description": "Allow outbound network access only to specified domains. Always `allowlist`.",
+ "x-stainless-const": true
},
- "details": {
+ "allowed_domains": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpan"
+ "type": "string"
},
- "description": "Detailed information about the detected completion text spans."
- }
- },
- "description": "A content filter detection result with completion text span details."
- },
- "AzureContentFilterDetectionResult": {
- "type": "object",
- "required": [
- "filtered",
- "detected"
- ],
- "properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
- },
- "detected": {
- "type": "boolean",
- "description": "Whether the content category was detected."
+ "minItems": 1,
+ "description": "A list of allowed domains when type is `allowlist`."
}
},
- "description": "A content filter result indicating whether the content was detected and filtered."
- },
- "AzureContentFilterDetectionWithCitationResult": {
- "type": "object",
- "required": [
- "filtered",
- "detected"
- ],
- "properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
- },
- "detected": {
- "type": "boolean",
- "description": "Whether the content category was detected."
- },
- "citation": {
- "$ref": "#/components/schemas/AzureContentFilterCitation",
- "description": "Citation details describing the associated license and its location."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
- },
- "description": "A content filter detection result that includes citation information for protected material."
+ ]
},
- "AzureContentFilterDetectionWithReasonResult": {
+ "OpenAI.ContainerNetworkPolicyDisabledParam": {
"type": "object",
"required": [
- "filtered",
- "detected"
+ "type"
],
"properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
- },
- "detected": {
- "type": "boolean",
- "description": "Whether the content category was detected."
- },
- "reason": {
+ "type": {
"type": "string",
- "description": "A human-readable explanation of why the detection result was produced."
+ "enum": [
+ "disabled"
+ ],
+ "description": "Disable outbound network access. Always `disabled`.",
+ "x-stainless-const": true
}
},
- "description": "A content filter detection result that includes a reason description."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
+ }
+ ]
},
- "AzureContentFilterError": {
+ "OpenAI.ContainerNetworkPolicyParam": {
"type": "object",
"required": [
- "code",
- "message"
+ "type"
],
"properties": {
- "code": {
- "type": "integer",
- "format": "int32",
- "description": "A machine-readable error code."
- },
- "message": {
- "type": "string",
- "description": "A human-readable error message."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParamType"
}
},
- "description": "Error details from the content filtering system."
- },
- "AzureContentFilterPersonallyIdentifiableInformationResult": {
- "type": "object",
- "required": [
- "filtered",
- "detected"
- ],
- "properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
- },
- "detected": {
- "type": "boolean",
- "description": "Whether PII was detected in the content."
- },
- "sub_categories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AzureContentFilterPiiSubCategoryResult"
- },
- "description": "Detailed results for individual PII subcategories."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "disabled": "#/components/schemas/OpenAI.ContainerNetworkPolicyDisabledParam",
+ "allowlist": "#/components/schemas/OpenAI.ContainerNetworkPolicyAllowlistParam"
}
},
- "description": "A content filter detection result for Personally Identifiable Information."
+ "description": "Network access policy for the container."
},
- "AzureContentFilterPiiSubCategoryResult": {
+ "OpenAI.ContainerNetworkPolicyParamType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "disabled",
+ "allowlist"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ContainerReferenceResource": {
"type": "object",
"required": [
- "sub_category",
- "filtered",
- "detected"
+ "type",
+ "container_id"
],
"properties": {
- "sub_category": {
+ "type": {
"type": "string",
- "description": "The PII subcategory that was evaluated."
- },
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered for this subcategory."
+ "enum": [
+ "container_reference"
+ ],
+ "description": "The environment type. Always `container_reference`.",
+ "x-stainless-const": true
},
- "detected": {
- "type": "boolean",
- "description": "Whether the subcategory was detected in the content."
+ "container_id": {
+ "type": "string"
}
},
- "description": "Result details for an individual PII subcategory."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ }
+ ],
+ "description": "Represents a container created with /v1/containers.",
+ "title": "Container Reference"
},
- "AzureContentFilterResultsForResponses": {
+ "OpenAI.ContainerResource": {
"type": "object",
+ "required": [
+ "id",
+ "object",
+ "name",
+ "created_at",
+ "status"
+ ],
"properties": {
- "sexual": {
- "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
- "description": "Severity result for sexual content."
- },
- "hate": {
- "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
- "description": "Severity result for hate content."
- },
- "violence": {
- "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
- "description": "Severity result for violence content."
- },
- "self_harm": {
- "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
- "description": "Severity result for self-harm content."
- },
- "profanity": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
- "description": "Detection result for profanity."
- },
- "custom_blocklists": {
- "$ref": "#/components/schemas/AzureContentFilterBlocklistResult",
- "description": "Results for configured custom blocklists."
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the container."
},
- "jailbreak": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
- "description": "Detection result for jailbreak attempts."
+ "object": {
+ "type": "string",
+ "description": "The type of this object."
},
- "task_adherence": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionWithReasonResult",
- "description": "Detection result for task adherence evaluation."
+ "name": {
+ "type": "string",
+ "description": "Name of the container."
},
- "protected_material_text": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
- "description": "Detection result for protected material text."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the container was created."
},
- "protected_material_code": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionWithCitationResult",
- "description": "Detection result for protected material code with citation."
+ "status": {
+ "type": "string",
+ "description": "Status of the container (e.g., active, deleted)."
},
- "ungrounded_material": {
- "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult",
- "description": "Detection result for ungrounded material with completion text span details."
+ "last_active_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the container was last active."
},
- "personally_identifiable_information": {
- "$ref": "#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult",
- "description": "Detection result for Personally Identifiable Information."
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.ContainerResourceExpiresAfter",
+ "description": "The container will expire after this time period.\n The anchor is the reference point for the expiration.\n The minutes is the number of minutes after the anchor before the container expires."
},
- "indirect_attack": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
- "description": "Detection result for indirect attacks."
+ "memory_limit": {
+ "type": "string",
+ "enum": [
+ "1g",
+ "4g",
+ "16g",
+ "64g"
+ ],
+ "description": "The memory limit configured for the container."
},
- "error": {
- "$ref": "#/components/schemas/AzureContentFilterError",
- "description": "Error details if content filtering evaluation failed."
+ "network_policy": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
},
- "description": "Content filter results for the Responses API."
+ "title": "The container object",
+ "x-oaiMeta": {
+ "name": "The container object",
+ "example": "{\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container\",\n \"created_at\": 1747844794,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747844794,\n \"memory_limit\": \"1g\",\n \"name\": \"My Container\"\n}\n"
+ }
},
- "AzureContentFilterSeverity": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "OpenAI.ContainerResourceExpiresAfter": {
+ "type": "object",
+ "properties": {
+ "anchor": {
"type": "string",
"enum": [
- "safe",
- "low",
- "medium",
- "high"
+ "last_active_at"
]
+ },
+ "minutes": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "Ratings for the intensity and risk level of harmful content."
+ }
},
- "AzureContentFilterSeverityResult": {
+ "OpenAI.ContainerSkill": {
"type": "object",
"required": [
- "filtered",
- "severity"
+ "type"
],
"properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
- },
- "severity": {
- "$ref": "#/components/schemas/AzureContentFilterSeverity",
- "description": "The severity level of the content."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ContainerSkillType"
}
},
- "description": "A content filter result indicating severity level and whether content was filtered."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "skill_reference": "#/components/schemas/OpenAI.SkillReferenceParam",
+ "inline": "#/components/schemas/OpenAI.InlineSkillParam"
+ }
+ }
},
- "AzureFunctionBinding": {
- "type": "object",
- "required": [
- "type",
- "storage_queue"
- ],
- "properties": {
- "type": {
+ "OpenAI.ContainerSkillType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
"type": "string",
"enum": [
- "storage_queue"
- ],
- "description": "The type of binding, which is always 'storage_queue'."
- },
- "storage_queue": {
- "$ref": "#/components/schemas/AzureFunctionStorageQueue",
- "description": "Storage queue."
+ "skill_reference",
+ "inline"
+ ]
}
- },
- "description": "The structure for keeping storage queue name and URI."
+ ]
},
- "AzureFunctionDefinition": {
+ "OpenAI.ContextManagementParam": {
"type": "object",
"required": [
- "function",
- "input_binding",
- "output_binding"
+ "type"
],
"properties": {
- "function": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the function to be called."
- },
- "description": {
- "type": "string",
- "description": "A description of what the function does, used by the model to choose when and how to call the function."
+ "type": {
+ "type": "string",
+ "description": "The context management entry type. Currently only 'compaction' is supported."
+ },
+ "compact_threshold": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "parameters": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The parameters the functions accepts, described as a JSON Schema object."
+ {
+ "type": "null"
}
- },
- "required": [
- "name",
- "parameters"
- ],
- "description": "The definition of azure function and its parameters."
- },
- "input_binding": {
- "$ref": "#/components/schemas/AzureFunctionBinding",
- "description": "Input storage queue. The queue storage trigger runs a function as messages are added to it."
- },
- "output_binding": {
- "$ref": "#/components/schemas/AzureFunctionBinding",
- "description": "Output storage queue. The function writes output to this queue when the input items are processed."
+ ]
}
- },
- "description": "The definition of Azure function."
+ }
},
- "AzureFunctionStorageQueue": {
+ "OpenAI.ConversationItem": {
"type": "object",
"required": [
- "queue_service_endpoint",
- "queue_name"
+ "type"
],
"properties": {
- "queue_service_endpoint": {
- "type": "string",
- "description": "URI to the Azure Storage Queue service allowing you to manipulate a queue."
- },
- "queue_name": {
- "type": "string",
- "description": "The name of an Azure function storage queue."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ConversationItemType"
}
},
- "description": "The structure for keeping storage queue name and URI."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "message": "#/components/schemas/OpenAI.ConversationItemMessage",
+ "function_call": "#/components/schemas/OpenAI.ConversationItemFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutput",
+ "file_search_call": "#/components/schemas/OpenAI.ConversationItemFileSearchToolCall",
+ "web_search_call": "#/components/schemas/OpenAI.ConversationItemWebSearchToolCall",
+ "image_generation_call": "#/components/schemas/OpenAI.ConversationItemImageGenToolCall",
+ "computer_call": "#/components/schemas/OpenAI.ConversationItemComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.ConversationItemComputerToolCallOutput",
+ "tool_search_call": "#/components/schemas/OpenAI.ConversationItemToolSearchCall",
+ "tool_search_output": "#/components/schemas/OpenAI.ConversationItemToolSearchOutput",
+ "additional_tools": "#/components/schemas/OpenAI.ConversationItemAdditionalTools",
+ "reasoning": "#/components/schemas/OpenAI.ConversationItemReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.ConversationItemCompactionBody",
+ "code_interpreter_call": "#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.ConversationItemFunctionShellCall",
+ "shell_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput",
+ "apply_patch_call": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput",
+ "mcp_list_tools": "#/components/schemas/OpenAI.ConversationItemMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource",
+ "mcp_call": "#/components/schemas/OpenAI.ConversationItemMcpToolCall",
+ "custom_tool_call": "#/components/schemas/OpenAI.ConversationItemCustomToolCallResource",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.ConversationItemCustomToolCallOutputResource"
+ }
+ },
+ "description": "A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](/docs/api-reference/responses/object#responses/object-output).",
+ "title": "Conversation item"
},
- "AzureFunctionTool": {
+ "OpenAI.ConversationItemAdditionalTools": {
"type": "object",
"required": [
"type",
- "azure_function"
+ "id",
+ "role",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_function"
+ "additional_tools"
],
- "description": "The object type, which is always 'browser_automation'."
+ "description": "The type of the item. Always `additional_tools`.",
+ "x-stainless-const": true,
+ "default": "additional_tools"
},
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the additional tools item."
},
- "azure_function": {
- "$ref": "#/components/schemas/AzureFunctionDefinition",
- "description": "The Azure Function Tool definition."
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role that provided the additional tools."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The additional tool definitions made available at this item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
- ],
- "description": "The input definition information for an Azure Function Tool, as used to configure an Agent."
+ ]
},
- "AzureFunctionToolCall": {
+ "OpenAI.ConversationItemApplyPatchToolCall": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
- "name",
- "arguments",
- "status"
+ "status",
+ "operation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_function_call"
- ]
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "apply_patch_call"
+ ],
+ "description": "The type of the item. Always `apply_patch_call`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the Azure Function being called."
+ "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
},
- "arguments": {
+ "call_id": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
"status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ },
+ "operation": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
+ "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
+ "title": "Apply patch operation"
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "An Azure Function tool call."
+ "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
+ "title": "Apply patch tool call"
},
- "AzureFunctionToolCallOutput": {
+ "OpenAI.ConversationItemApplyPatchToolCallOutput": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
- "name",
"status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_function_call_output"
- ]
+ "apply_patch_call_output"
+ ],
+ "description": "The type of the item. Always `apply_patch_call_output`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call_output"
},
- "call_id": {
+ "id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
},
- "name": {
+ "call_id": {
"type": "string",
- "description": "The name of the Azure Function that was called."
+ "description": "The unique ID of the apply patch tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
},
"output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Azure Function tool call."
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call output."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "The output of an Azure Function tool call."
+ "description": "The output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
},
- "AzureOpenAIModelConfiguration": {
+ "OpenAI.ConversationItemCodeInterpreterToolCall": {
"type": "object",
"required": [
"type",
- "modelDeploymentName"
+ "id",
+ "status",
+ "container_id",
+ "code",
+ "outputs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "AzureOpenAIModel"
- ]
+ "code_interpreter_call"
+ ],
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "x-stainless-const": true,
+ "default": "code_interpreter_call"
},
- "modelDeploymentName": {
+ "id": {
"type": "string",
- "description": "Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`)."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/RedTeamTargetConfig"
- }
- ],
- "description": "Azure OpenAI model configuration. The API version would be selected by the service for querying the model.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "RedTeams=V1Preview"
- ]
- }
- },
- "BaseCredentials": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/CredentialType",
- "description": "The type of credential used by the connection",
- "readOnly": true
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "ApiKey": "#/components/schemas/ApiKeyCredentials",
- "AAD": "#/components/schemas/EntraIDCredentials",
- "CustomKeys": "#/components/schemas/CustomCredential",
- "SAS": "#/components/schemas/SASCredentials",
- "None": "#/components/schemas/NoAuthenticationCredentials",
- "AgenticIdentityToken_Preview": "#/components/schemas/AgenticIdentityPreviewCredentials"
+ "description": "The unique ID of the code interpreter tool call."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete",
+ "interpreting",
+ "failed"
+ ],
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
+ },
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the container used to run the code."
+ },
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "outputs": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "A base class for connection credentials"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
},
- "BingCustomSearchConfiguration": {
+ "OpenAI.ConversationItemCompactionBody": {
"type": "object",
"required": [
- "project_connection_id",
- "instance_name"
+ "type",
+ "id",
+ "encrypted_content"
],
"properties": {
- "project_connection_id": {
- "type": "string",
- "description": "Project connection id for grounding with bing search"
- },
- "instance_name": {
+ "type": {
"type": "string",
- "description": "Name of the custom configuration instance given to config."
+ "enum": [
+ "compaction"
+ ],
+ "description": "The type of the item. Always `compaction`.",
+ "x-stainless-const": true,
+ "default": "compaction"
},
- "market": {
+ "id": {
"type": "string",
- "description": "The market where the results come from."
+ "description": "The unique ID of the compaction item."
},
- "set_lang": {
+ "encrypted_content": {
"type": "string",
- "description": "The language to use for user interface strings when calling Bing API."
- },
- "count": {
- "type": "integer",
- "format": "int64",
- "description": "The number of search results to return in the bing api response"
+ "description": "The encrypted content that was produced by compaction."
},
- "freshness": {
+ "created_by": {
"type": "string",
- "description": "Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters)."
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "A bing custom search configuration."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "BingCustomSearchPreviewTool": {
+ "OpenAI.ConversationItemComputerToolCall": {
"type": "object",
"required": [
"type",
- "bing_custom_search_preview"
+ "id",
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "bing_custom_search_preview"
+ "computer_call"
],
- "description": "The object type, which is always 'bing_custom_search_preview'."
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
- "bing_custom_search_preview": {
- "$ref": "#/components/schemas/BingCustomSearchToolParameters",
- "description": "The bing custom search tool parameters."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the computer call."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used when responding to the tool call with output."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ },
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ },
+ "pending_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The pending safety checks for the computer call."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "The input definition information for a Bing custom search tool as used to configure an agent."
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "BingCustomSearchToolCall": {
+ "OpenAI.ConversationItemComputerToolCallOutput": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
- "arguments",
- "status"
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "bing_custom_search_preview_call"
- ]
+ "computer_call_output"
+ ],
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "x-stainless-const": true,
+ "default": "computer_call_output"
},
- "call_id": {
+ "id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The ID of the computer tool call output.",
+ "readOnly": true
},
- "arguments": {
+ "call_id": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "description": "The ID of the computer tool call that produced the output."
+ },
+ "acknowledged_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
},
"status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "A Bing custom search tool call."
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "BingCustomSearchToolCallOutput": {
+ "OpenAI.ConversationItemCustomToolCallOutputResource": {
"type": "object",
"required": [
"type",
"call_id",
+ "output",
"status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "bing_custom_search_preview_call_output"
- ]
+ "custom_tool_call_output"
+ ],
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
},
"call_id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
},
"output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Bing custom search tool call."
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
},
"status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "The output of a Bing custom search tool call."
- },
- "BingCustomSearchToolParameters": {
- "type": "object",
- "required": [
- "search_configurations"
- ],
- "properties": {
- "search_configurations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/BingCustomSearchConfiguration"
- },
- "maxItems": 1,
- "description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
- }
- },
- "description": "The bing custom search tool parameters."
+ "title": "ResponseCustomToolCallOutputItem"
},
- "BingGroundingSearchConfiguration": {
+ "OpenAI.ConversationItemCustomToolCallResource": {
"type": "object",
"required": [
- "project_connection_id"
+ "type",
+ "call_id",
+ "name",
+ "input",
+ "status"
],
"properties": {
- "project_connection_id": {
+ "type": {
"type": "string",
- "description": "Project connection id for grounding with bing search"
+ "enum": [
+ "custom_tool_call"
+ ],
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "x-stainless-const": true
},
- "market": {
+ "id": {
"type": "string",
- "description": "The market where the results come from."
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
},
- "set_lang": {
+ "call_id": {
"type": "string",
- "description": "The language to use for user interface strings when calling Bing API."
+ "description": "An identifier used to map this custom tool call to a tool call output."
},
- "count": {
- "type": "integer",
- "format": "int64",
- "description": "The number of search results to return in the bing api response"
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the custom tool being called."
},
- "freshness": {
+ "name": {
"type": "string",
- "description": "Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters)."
+ "description": "The name of the custom tool being called."
+ },
+ "input": {
+ "type": "string",
+ "description": "The input for the custom tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "Search configuration for Bing Grounding"
- },
- "BingGroundingSearchToolParameters": {
- "type": "object",
- "required": [
- "search_configurations"
- ],
- "properties": {
- "search_configurations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/BingGroundingSearchConfiguration"
- },
- "maxItems": 1,
- "description": "The search configurations attached to this tool. There can be a maximum of 1\nsearch configuration resource attached to the tool."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
- },
- "description": "The bing grounding search tool parameters."
+ ],
+ "title": "ResponseCustomToolCallItem"
},
- "BingGroundingTool": {
+ "OpenAI.ConversationItemFileSearchToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "bing_grounding"
+ "status",
+ "queries"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the file search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "bing_grounding"
+ "file_search_call"
],
- "description": "The object type, which is always 'bing_grounding'."
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The type of the file search tool call. Always `file_search_call`.",
+ "x-stainless-const": true
},
- "description": {
+ "status": {
"type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "incomplete",
+ "failed"
+ ],
+ "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
},
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
+ "queries": {
+ "type": "array",
+ "items": {
+ "type": "string"
},
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The queries used to search for files."
},
- "bing_grounding": {
- "$ref": "#/components/schemas/BingGroundingSearchToolParameters",
- "description": "The bing grounding search tool parameters."
+ "results": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "The input definition information for a bing grounding search tool as used to configure an agent."
+ "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
+ "title": "File search tool call"
},
- "BingGroundingToolCall": {
+ "OpenAI.ConversationItemFunctionShellCall": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
- "arguments",
- "status"
+ "action",
+ "status",
+ "environment"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "bing_grounding_call"
- ]
+ "shell_call"
+ ],
+ "description": "The type of the item. Always `shell_call`.",
+ "x-stainless-const": true,
+ "default": "shell_call"
},
- "call_id": {
+ "id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
},
- "arguments": {
+ "call_id": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
+ "description": "The shell commands and limits that describe how to run the tool call."
},
"status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
+ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
+ },
+ "environment": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "A Bing grounding tool call."
+ "description": "A tool call that executes one or more shell commands in a managed environment.",
+ "title": "Shell tool call"
},
- "BingGroundingToolCallOutput": {
+ "OpenAI.ConversationItemFunctionShellCallOutput": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
- "status"
+ "status",
+ "output",
+ "max_output_length"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "bing_grounding_call_output"
- ]
+ "shell_call_output"
+ ],
+ "description": "The type of the shell call output. Always `shell_call_output`.",
+ "x-stainless-const": true,
+ "default": "shell_call_output"
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the shell call output. Populated when this item is returned via API."
},
"call_id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
+ "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
},
"output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Bing grounding tool call."
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
+ },
+ "description": "An array of shell call output contents"
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "The output of a Bing grounding tool call."
+ "description": "The output of a shell tool call that was emitted.",
+ "title": "Shell call output"
},
- "BlobReference": {
+ "OpenAI.ConversationItemFunctionToolCall": {
"type": "object",
"required": [
- "blobUri",
- "storageAccountArmId",
- "credential"
+ "id",
+ "type",
+ "call_id",
+ "name",
+ "arguments"
],
"properties": {
- "blobUri": {
- "type": "string",
- "format": "uri",
- "description": "Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path`"
- },
- "storageAccountArmId": {
+ "id": {
"type": "string",
- "description": "ARM ID of the storage account to use."
+ "description": "The unique ID of the function tool call.",
+ "readOnly": true
},
- "credential": {
- "$ref": "#/components/schemas/SasCredential",
- "description": "Credential info to access the storage account."
- }
- },
- "description": "Blob reference details."
- },
- "BotServiceAuthorizationScheme": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
"type": {
"type": "string",
"enum": [
- "BotService"
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
- }
- ]
- },
- "BotServiceRbacAuthorizationScheme": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "function_call"
+ ],
+ "description": "The type of the function tool call. Always `function_call`.",
+ "x-stainless-const": true
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the function to run."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the function to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the function."
+ },
+ "status": {
"type": "string",
"enum": [
- "BotServiceRbac"
- ]
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
- ]
+ ],
+ "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
+ "title": "Function tool call"
},
- "BotServiceTenantAuthorizationScheme": {
+ "OpenAI.ConversationItemFunctionToolCallOutput": {
"type": "object",
"required": [
- "type"
+ "id",
+ "type",
+ "call_id",
+ "output"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
+ "readOnly": true
+ },
"type": {
"type": "string",
"enum": [
- "BotServiceTenant"
- ]
+ "function_call_output"
+ ],
+ "description": "The type of the function tool call output. Always `function_call_output`.",
+ "x-stainless-const": true
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
- ]
+ ],
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
},
- "BrowserAutomationPreviewTool": {
+ "OpenAI.ConversationItemImageGenToolCall": {
"type": "object",
"required": [
"type",
- "browser_automation_preview"
+ "id",
+ "status",
+ "result"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "browser_automation_preview"
+ "image_generation_call"
],
- "description": "The object type, which is always 'browser_automation_preview'."
+ "description": "The type of the image generation call. Always `image_generation_call`.",
+ "x-stainless-const": true
},
- "browser_automation_preview": {
- "$ref": "#/components/schemas/BrowserAutomationToolParameters",
- "description": "The Browser Automation Tool parameters."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the image generation call."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "generating",
+ "failed"
+ ],
+ "description": "The status of the image generation call."
+ },
+ "result": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "The input definition information for a Browser Automation Tool, as used to configure an Agent."
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
},
- "BrowserAutomationPreviewToolboxTool": {
+ "OpenAI.ConversationItemList": {
"type": "object",
"required": [
- "type",
- "browser_automation_preview"
+ "object",
+ "data",
+ "has_more",
+ "first_id",
+ "last_id"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "browser_automation_preview"
- ]
+ "list"
+ ],
+ "description": "The type of object returned, must be `list`.",
+ "x-stainless-const": true
},
- "browser_automation_preview": {
- "$ref": "#/components/schemas/BrowserAutomationToolParameters",
- "description": "The Browser Automation Tool parameters."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ },
+ "description": "A list of conversation items.",
+ "x-ms-list-page-items": true
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Whether there are more items available."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The ID of the first item in the list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The ID of the last item in the list.",
+ "x-ms-list-continuation-token": true
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/ToolboxTool"
- }
- ],
- "description": "A browser automation tool stored in a toolbox."
+ "description": "A list of Conversation items.",
+ "title": "The conversation item list",
+ "x-oaiMeta": {
+ "name": "The item list",
+ "group": "conversations"
+ }
},
- "BrowserAutomationToolCall": {
+ "OpenAI.ConversationItemLocalShellToolCall": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
- "arguments",
+ "action",
"status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "browser_automation_preview_call"
- ]
+ "local_shell_call"
+ ],
+ "description": "The type of the local shell call. Always `local_shell_call`.",
+ "x-stainless-const": true
},
- "call_id": {
+ "id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The unique ID of the local shell call."
},
- "arguments": {
+ "call_id": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
},
"status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the local shell call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "A browser automation tool call."
+ "description": "A tool call to run a command on the local shell.",
+ "title": "Local shell call"
},
- "BrowserAutomationToolCallOutput": {
+ "OpenAI.ConversationItemLocalShellToolCallOutput": {
"type": "object",
"required": [
"type",
- "call_id",
- "status"
+ "id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "browser_automation_preview_call_output"
- ]
+ "local_shell_call_output"
+ ],
+ "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "x-stainless-const": true
},
- "call_id": {
+ "id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The unique ID of the local shell tool call generated by the model."
},
"output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the browser automation tool call."
+ "type": "string",
+ "description": "A JSON string of the output of the local shell tool call."
},
"status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "The output of a browser automation tool call."
+ "description": "The output of a local shell tool call.",
+ "title": "Local shell call output"
},
- "BrowserAutomationToolConnectionParameters": {
+ "OpenAI.ConversationItemMcpApprovalRequest": {
"type": "object",
"required": [
- "project_connection_id"
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
- "project_connection_id": {
+ "type": {
"type": "string",
- "description": "The ID of the project connection to your Azure Playwright resource."
+ "enum": [
+ "mcp_approval_request"
+ ],
+ "description": "The type of the item. Always `mcp_approval_request`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the approval request."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server making the request."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tool to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of arguments for the tool."
}
},
- "description": "Definition of input parameters for the connection used by the Browser Automation Tool."
- },
- "BrowserAutomationToolParameters": {
- "type": "object",
- "required": [
- "connection"
- ],
- "properties": {
- "connection": {
- "$ref": "#/components/schemas/BrowserAutomationToolConnectionParameters",
- "description": "The project connection parameters associated with the Browser Automation Tool."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
- },
- "description": "Definition of input parameters for the Browser Automation Tool."
+ ],
+ "description": "A request for human approval of a tool invocation.",
+ "title": "MCP approval request"
},
- "CaptureStructuredOutputsTool": {
+ "OpenAI.ConversationItemMcpApprovalResponseResource": {
"type": "object",
"required": [
"type",
- "outputs"
+ "id",
+ "approval_request_id",
+ "approve"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "capture_structured_outputs"
+ "mcp_approval_response"
],
- "description": "The type of the tool. Always `capture_structured_outputs`."
+ "description": "The type of the item. Always `mcp_approval_response`.",
+ "x-stainless-const": true
},
- "name": {
+ "id": {
"type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The unique ID of the approval response"
},
- "description": {
+ "approval_request_id": {
"type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The ID of the approval request being answered."
},
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "approve": {
+ "type": "boolean",
+ "description": "Whether the request was approved."
},
- "outputs": {
- "$ref": "#/components/schemas/StructuredOutputDefinition",
- "description": "The structured outputs to capture from the model."
+ "reason": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "A tool for capturing structured outputs"
+ "description": "A response to an MCP approval request.",
+ "title": "MCP approval response"
},
- "ChartCoordinate": {
+ "OpenAI.ConversationItemMcpListTools": {
"type": "object",
"required": [
- "x",
- "y",
- "size"
+ "type",
+ "id",
+ "server_label",
+ "tools"
],
"properties": {
- "x": {
- "type": "integer",
- "format": "int32",
- "description": "X-axis coordinate."
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp_list_tools"
+ ],
+ "description": "The type of the item. Always `mcp_list_tools`.",
+ "x-stainless-const": true
},
- "y": {
- "type": "integer",
- "format": "int32",
- "description": "Y-axis coordinate."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the list."
},
- "size": {
- "type": "integer",
- "format": "int32",
- "description": "Size of the chart element."
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
+ },
+ "description": "The tools available on the server."
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
},
- "description": "Coordinates for the analysis chart.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "A list of tools available on an MCP server.",
+ "title": "MCP list tools"
},
- "ChatSummaryMemoryItem": {
+ "OpenAI.ConversationItemMcpToolCall": {
"type": "object",
"required": [
- "kind"
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
- "kind": {
+ "type": {
"type": "string",
"enum": [
- "chat_summary"
+ "mcp_call"
],
- "description": "The kind of the memory item."
+ "description": "The type of the item. Always `mcp_call`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool call."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server running the tool."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tool that was run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments passed to the tool."
+ },
+ "output": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "error": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
+ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ },
+ "approval_request_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/MemoryItem"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "A memory item containing a summary extracted from conversations.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "An invocation of a tool on an MCP server.",
+ "title": "MCP tool call"
},
- "ClusterInsightResult": {
+ "OpenAI.ConversationItemMessage": {
"type": "object",
"required": [
- "summary",
- "clusters"
+ "type",
+ "id",
+ "status",
+ "role",
+ "content"
],
"properties": {
- "summary": {
- "$ref": "#/components/schemas/InsightSummary",
- "description": "Summary of the insights report."
+ "type": {
+ "type": "string",
+ "enum": [
+ "message"
+ ],
+ "description": "The type of the message. Always set to `message`.",
+ "x-stainless-const": true,
+ "default": "message"
},
- "clusters": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the message."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MessageStatus",
+ "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API."
+ },
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`."
+ },
+ "content": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/InsightCluster"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
},
- "description": "List of clusters identified in the insights."
+ "description": "The content of the message"
},
- "coordinates": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ChartCoordinate"
- },
- "description": " Optional mapping of IDs to 2D coordinates used by the UX for visualization.\n\n The map keys are string identifiers (for example, a cluster id or a sample id)\n and the values are the coordinates and visual size for rendering on a 2D chart.\n\n This property is omitted unless the client requests coordinates (for example,\n by passing `includeCoordinates=true` as a query parameter).\n\n Example:\n ```\n {\n \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 },\n \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 }\n }\n ```\n\n Coordinates are intended only for client-side visualization and do not\n modify the canonical insights results."
+ "phase": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
- },
- "description": "Insights from the cluster analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ ],
+ "description": "A message to or from the model.",
+ "title": "Message"
},
- "ClusterTokenUsage": {
+ "OpenAI.ConversationItemReasoningItem": {
"type": "object",
"required": [
- "inputTokenUsage",
- "outputTokenUsage",
- "totalTokenUsage"
+ "type",
+ "id",
+ "summary"
],
"properties": {
- "inputTokenUsage": {
- "type": "integer",
- "format": "int32",
- "description": "input token usage"
+ "type": {
+ "type": "string",
+ "enum": [
+ "reasoning"
+ ],
+ "description": "The type of the object. Always `reasoning`.",
+ "x-stainless-const": true
},
- "outputTokenUsage": {
- "type": "integer",
- "format": "int32",
- "description": "output token usage"
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the reasoning content."
},
- "totalTokenUsage": {
- "type": "integer",
- "format": "int32",
- "description": "total token usage"
+ "encrypted_content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
+ },
+ "description": "Reasoning summary content."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ },
+ "description": "Reasoning text content."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
- "description": "Token usage for cluster analysis",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
},
- "CodeBasedEvaluatorDefinition": {
+ "OpenAI.ConversationItemToolSearchCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "call_id",
+ "execution",
+ "arguments",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "code"
- ]
+ "tool_search_call"
+ ],
+ "description": "The type of the item. Always `tool_search_call`.",
+ "x-stainless-const": true,
+ "default": "tool_search_call"
},
- "code_text": {
+ "id": {
"type": "string",
- "description": "Inline code text for the evaluator"
+ "description": "The unique ID of the tool search call item."
},
- "entry_point": {
- "type": "string",
- "description": "The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "call_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "image_tag": {
- "type": "string",
- "description": "The container image tag to use for evaluator code execution",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
},
- "blob_uri": {
+ "arguments": {
+ "description": "Arguments used for the tool search call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the tool search call item that was recorded."
+ },
+ "created_by": {
"type": "string",
- "format": "uri",
- "description": "The blob URI for the evaluator storage",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/EvaluatorDefinition"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
- ],
- "description": "Code-based evaluator definition using python code",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ ]
},
- "CodeConfiguration": {
+ "OpenAI.ConversationItemToolSearchOutput": {
"type": "object",
"required": [
- "runtime",
- "entry_point",
- "dependency_resolution"
+ "type",
+ "id",
+ "call_id",
+ "execution",
+ "tools",
+ "status"
],
"properties": {
- "runtime": {
+ "type": {
"type": "string",
- "description": "The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13')."
+ "enum": [
+ "tool_search_output"
+ ],
+ "description": "The type of the item. Always `tool_search_output`.",
+ "x-stainless-const": true,
+ "default": "tool_search_output"
},
- "entry_point": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool search output item."
+ },
+ "call_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "tools": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.Tool"
},
- "description": "The entry point command and arguments for the code execution."
+ "description": "The loaded tool definitions returned by tool search."
},
- "dependency_resolution": {
- "$ref": "#/components/schemas/CodeDependencyResolution",
- "description": "How package dependencies are resolved at deployment time. Defaults to `bundled`,\nwhere the caller bundles all dependencies into the uploaded zip and the service\nperforms no remote build. `remote_build` instructs the service to build\ndependencies remotely from the manifest included in the uploaded zip.",
- "default": "bundled"
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the tool search output item that was recorded."
},
- "content_hash": {
+ "created_by": {
"type": "string",
- "description": "The SHA-256 hex digest of the uploaded code zip. Set by the service from the `x-ms-code-zip-sha256` request header; read-only in responses and never accepted in request payloads.",
- "readOnly": true
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "Code-based deployment configuration for a hosted agent."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ]
},
- "CodeDependencyResolution": {
+ "OpenAI.ConversationItemType": {
"anyOf": [
{
"type": "string"
@@ -20057,305 +41787,378 @@
{
"type": "string",
"enum": [
- "bundled",
- "remote_build"
+ "message",
+ "function_call",
+ "function_call_output",
+ "file_search_call",
+ "web_search_call",
+ "image_generation_call",
+ "computer_call",
+ "computer_call_output",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "reasoning",
+ "compaction",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "mcp_call",
+ "custom_tool_call",
+ "custom_tool_call_output"
]
}
- ],
- "description": "How package dependencies are resolved at deployment time for a code-based hosted agent."
+ ]
},
- "CodeInterpreterToolboxTool": {
+ "OpenAI.ConversationItemWebSearchToolCall": {
"type": "object",
"required": [
- "type"
+ "id",
+ "type",
+ "status",
+ "action"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "code_interpreter"
- ]
+ "web_search_call"
+ ],
+ "description": "The type of the web search tool call. Always `web_search_call`.",
+ "x-stainless-const": true
},
- "container": {
- "anyOf": [
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
+ ],
+ "description": "The status of the web search tool call."
+ },
+ "action": {
+ "oneOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
},
{
- "$ref": "#/components/schemas/OpenAI.AutoCodeInterpreterToolParam"
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
}
],
- "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code, along with an\noptional `memory_limit` setting.\nIf not provided, the service assumes auto."
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/ToolboxTool"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "A code interpreter tool stored in a toolbox."
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
},
- "CompletionMessageToolCallChunk": {
+ "OpenAI.ConversationParam": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationParam-2"
+ }
+ ],
+ "description": "The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.\nInput items and output items from this response are automatically added to this conversation after this response completes."
+ },
+ "OpenAI.ConversationParam-2": {
+ "type": "object",
+ "required": [
+ "id"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the conversation."
+ }
+ },
+ "description": "The conversation that this response belongs to.",
+ "title": "Conversation object"
+ },
+ "OpenAI.ConversationReference": {
+ "type": "object",
+ "required": [
+ "id"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the conversation that this response was associated with."
+ }
+ },
+ "description": "The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.",
+ "title": "Conversation"
+ },
+ "OpenAI.ConversationResource": {
"type": "object",
"required": [
"id",
- "type"
+ "object",
+ "metadata",
+ "created_at"
],
"properties": {
"id": {
"type": "string",
- "description": "The Id for the tool call."
+ "description": "The unique ID of the conversation."
},
- "type": {
+ "object": {
"type": "string",
"enum": [
- "function"
+ "conversation"
],
- "description": "The type of tool call, which is always \"function\"."
+ "description": "The object type, which is always `conversation`.",
+ "x-stainless-const": true,
+ "default": "conversation"
},
- "function": {
- "$ref": "#/components/schemas/FunctionToolCall",
- "description": "Details of the function tool call, if applicable."
+ "metadata": {
+ "$ref": "#/components/schemas/OpenAI.Metadata",
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The time at which the conversation was created, measured in seconds since the Unix epoch."
+ }
+ }
+ },
+ "OpenAI.CoordParam": {
+ "type": "object",
+ "required": [
+ "x",
+ "y"
+ ],
+ "properties": {
+ "x": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The x-coordinate."
+ },
+ "y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The y-coordinate."
}
},
- "description": "Tool call details within a message."
+ "description": "An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.",
+ "title": "Coordinate"
},
- "Connection": {
+ "OpenAI.CreateAssistantRequest": {
"type": "object",
"required": [
- "name",
- "id",
- "type",
- "target",
- "isDefault",
- "credentials",
- "metadata"
+ "model"
],
"properties": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantSupportedModels"
+ }
+ ],
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.",
+ "x-oaiTypeLabel": "string"
+ },
"name": {
- "type": "string",
- "description": "The friendly name of the connection, provided by the user.",
- "readOnly": true
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "id": {
- "type": "string",
- "description": "A unique identifier for the connection, generated by the service",
- "readOnly": true
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "type": {
- "$ref": "#/components/schemas/ConnectionType",
- "description": "Category of the connection",
- "readOnly": true
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "target": {
- "type": "string",
- "description": "The connection URL to be used for this service",
- "readOnly": true
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "isDefault": {
- "type": "boolean",
- "description": "Whether the connection is tagged as the default connection of its type",
- "readOnly": true
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ },
+ "maxItems": 128,
+ "description": "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`.",
+ "default": []
},
- "credentials": {
- "$ref": "#/components/schemas/BaseCredentials",
- "description": "The credentials used by the connection",
- "readOnly": true
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Metadata of the connection",
- "readOnly": true
- }
- },
- "description": "Response from the list and get connections operations"
- },
- "ConnectionType": {
- "anyOf": [
- {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
},
- {
- "type": "string",
- "enum": [
- "AzureOpenAI",
- "AzureBlob",
- "AzureStorageAccount",
- "CognitiveSearch",
- "CosmosDB",
- "ApiKey",
- "AppConfig",
- "AppInsights",
- "CustomKeys",
- "RemoteTool_Preview"
- ]
- }
- ],
- "description": "The Type (or category) of the connection"
- },
- "ContainerConfiguration": {
- "type": "object",
- "required": [
- "image"
- ],
- "properties": {
- "image": {
- "type": "string",
- "description": "The container image for the hosted agent.",
- "examples": [
- "my-registry.azurecr.io/my-hosted-agent:latest"
+ "response_format": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
+ },
+ {
+ "type": "null"
+ }
]
}
- },
- "description": "Container-based deployment configuration for a hosted agent."
+ }
},
- "ContentFilterResult": {
+ "OpenAI.CreateAssistantRequestToolResources": {
"type": "object",
- "required": [
- "blocked",
- "source_type",
- "content_filter_results"
- ],
"properties": {
- "blocked": {
- "type": "boolean",
- "description": "Whether the content was blocked by the content filter."
- },
- "source_type": {
- "type": "string",
- "description": "The source type of the content filter evaluation (e.g., 'prompt', 'response', 'pre_tool_call', 'post_tool_call')."
- },
- "content_filter_results": {
- "$ref": "#/components/schemas/AzureContentFilterResultsForResponses",
- "description": "The content filter results for this evaluation."
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesCodeInterpreter"
},
- "tool_call_id": {
- "type": "string",
- "description": "The ID of the tool call associated with this content filter result, if applicable."
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearch"
}
- },
- "description": "A content filter evaluation result for a specific source in the response."
+ }
},
- "ContinuousEvaluationRuleAction": {
+ "OpenAI.CreateAssistantRequestToolResourcesCodeInterpreter": {
"type": "object",
- "required": [
- "type",
- "evalId"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "continuousEvaluation"
- ]
- },
- "evalId": {
- "type": "string",
- "description": "Eval Id to add continuous evaluation runs to."
- },
- "maxHourlyRuns": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of evaluation runs allowed per hour."
- },
- "samplingRate": {
- "type": "number",
- "format": "double",
- "maximum": 100,
- "description": "Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the service-default is to evaluate every event, which is equivalent to setting a sampling rate of 100.",
- "exclusiveMinimum": 0,
- "default": 100
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluationRuleAction"
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 20
}
- ],
- "description": "Evaluation rule action for continuous evaluation."
+ }
},
- "ConversationGenPreviewItemGenerationParams": {
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearch": {
"type": "object",
- "required": [
- "type",
- "model"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "conversation_gen_preview"
- ],
- "description": "The type of item generation parameters, always `conversation_gen_preview`."
- },
- "model": {
- "type": "string",
- "description": "The model deployment used for simulation, in the format '{connectionName}/modelDeploymentName'."
- },
- "max_turns": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of turns per simulated conversation. Defaults to 20.",
- "default": 20
- },
- "num_conversations": {
- "type": "integer",
- "format": "int32",
- "description": "Number of simulated conversations to generate per test scenario. Defaults to 5.",
- "default": 5
- },
- "data_mapping": {
- "type": "object",
- "unevaluatedProperties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
"type": "string"
},
- "description": "Mapping from source fields to response_id field, which is required for retrieving chat history."
+ "maxItems": 1
},
- "sampling_params": {
- "$ref": "#/components/schemas/ModelSamplingParams",
- "description": "Sampling parameters for the conversation generation."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/ItemGenerationParams"
+ "vector_stores": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStores"
+ },
+ "maxItems": 1
}
- ],
- "description": "Represents the parameters for conversation simulation item generation."
+ }
},
- "ConversationIdTraceSource": {
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStores": {
"type": "object",
- "required": [
- "type",
- "conversation_ids"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "conversation_id_source"
- ],
- "description": "The type of trace source, always `conversation_id_source`."
- },
- "conversation_ids": {
+ "file_ids": {
"type": "array",
"items": {
"type": "string"
},
- "description": "Collection of conversation identifiers to filter traces by."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/TraceSource"
+ "maxItems": 100000000
+ },
+ "chunking_strategy": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- ],
- "description": "A trace source that selects traces by conversation IDs."
+ }
},
- "CosmosDBIndex": {
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto": {
"type": "object",
"required": [
"type"
@@ -20364,524 +42167,487 @@
"type": {
"type": "string",
"enum": [
- "CosmosDBNoSqlVectorStore"
+ "auto"
],
- "description": "Type of index"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/Index"
+ "x-stainless-const": true
}
- ],
- "description": "CosmosDB Vector Store Index Definition"
+ }
},
- "CosmosDBIndexUpdate": {
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic": {
"type": "object",
"required": [
- "type"
+ "type",
+ "static"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "CosmosDBNoSqlVectorStore"
+ "static"
],
- "description": "Type of index"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/IndexUpdate"
+ "x-stainless-const": true
+ },
+ "static": {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic"
}
- ],
- "description": "CosmosDB Vector Store Index Definition"
+ }
},
- "CreateAgentFromCodeContent": {
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic": {
"type": "object",
+ "required": [
+ "max_chunk_size_tokens",
+ "chunk_overlap_tokens"
+ ],
"properties": {
- "metadata": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CreateAgentVersionFromCodeMetadata"
- }
- ],
- "description": "JSON metadata including description and hosted definition."
+ "max_chunk_size_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 100,
+ "maximum": 4096
},
- "code": {
- "description": "The code zip file (max 250 MB)."
+ "chunk_overlap_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- },
- "required": [
- "metadata",
- "code"
- ]
+ }
},
- "CreateAgentFromManifestRequest": {
+ "OpenAI.CreateBatchParametersBody": {
"type": "object",
"required": [
- "name",
- "manifest_id",
- "parameter_values"
+ "input_file_id",
+ "endpoint",
+ "completion_window"
],
"properties": {
- "name": {
- "type": "string",
- "maxLength": 63,
- "description": "The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
- },
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
+ "input_file_id": {
+ "type": "string"
},
- "description": {
+ "endpoint": {
"type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
+ "enum": [
+ "/v1/responses",
+ "/v1/chat/completions",
+ "/v1/embeddings",
+ "/v1/completions",
+ "/v1/moderations",
+ "/v1/images/generations",
+ "/v1/images/edits",
+ "/v1/videos"
+ ]
},
- "manifest_id": {
+ "completion_window": {
"type": "string",
- "description": "The manifest ID to import the agent version from."
+ "enum": [
+ "24h"
+ ]
},
- "parameter_values": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The inputs to the manifest that will result in a fully materialized Agent."
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "output_expires_after": {
+ "$ref": "#/components/schemas/OpenAI.BatchFileExpirationAfter"
}
}
},
- "CreateAgentRequest": {
+ "OpenAI.CreateChatCompletionRequest": {
"type": "object",
"required": [
- "name",
- "definition"
+ "messages",
+ "model"
],
"properties": {
- "name": {
- "type": "string",
- "maxLength": 63,
- "description": "The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
- },
- "state": {
- "$ref": "#/components/schemas/AgentState",
- "description": "The initial operational state of the agent. Defaults to 'enabled' if not specified.",
- "default": "enabled"
- },
"metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "description": {
- "type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
+ "top_logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "definition": {
- "$ref": "#/components/schemas/AgentDefinition",
- "description": "The agent definition. This can be a workflow, hosted agent, or a simple agent definition.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
- ]
- }
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
},
- "blueprint_reference": {
- "$ref": "#/components/schemas/AgentBlueprintReference",
- "description": "The blueprint reference for the agent."
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
},
- "draft": {
- "type": "boolean",
- "description": "(Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DraftAgents=V1Preview"
- ]
- },
- "default": false
+ "user": {
+ "type": "string",
+ "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
+ "deprecated": true
},
- "agent_endpoint": {
- "$ref": "#/components/schemas/AgentEndpointConfig",
- "description": "An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent"
+ "safety_identifier": {
+ "type": "string",
+ "maxLength": 64,
+ "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
},
- "agent_card": {
- "$ref": "#/components/schemas/AgentCard",
- "description": "Optional agent card for the agent"
- }
- },
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
- ]
- }
- },
- "CreateAgentSessionRequest": {
- "type": "object",
- "required": [
- "version_indicator"
- ],
- "properties": {
- "agent_session_id": {
+ "prompt_cache_key": {
"type": "string",
- "description": "Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. Auto-generated if omitted."
+ "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
},
- "version_indicator": {
- "$ref": "#/components/schemas/VersionIndicator",
- "description": "Determines which agent version backs the session."
- }
- },
- "description": "Request to create a new agent session."
- },
- "CreateAgentVersionFromCodeContent": {
- "type": "object",
- "properties": {
- "metadata": {
- "allOf": [
+ "service_tier": {
+ "$ref": "#/components/schemas/OpenAI.ServiceTier"
+ },
+ "prompt_cache_retention": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/CreateAgentVersionFromCodeMetadata"
+ "type": "string",
+ "enum": [
+ "in_memory",
+ "24h"
+ ]
+ },
+ {
+ "type": "null"
}
- ],
- "description": "JSON metadata including description and hosted definition."
+ ]
},
- "code": {
- "description": "The code zip file (max 250 MB)."
- }
- },
- "required": [
- "metadata",
- "code"
- ]
- },
- "CreateAgentVersionFromCodeMetadata": {
- "type": "object",
- "required": [
- "definition"
- ],
- "properties": {
- "description": {
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
+ },
+ "minItems": 1,
+ "description": "A list of messages comprising the conversation so far. Depending on the\n [model](/docs/models) you use, different message types (modalities) are\n supported, like [text](/docs/guides/text-generation),\n [images](/docs/guides/vision), and [audio](/docs/guides/audio)."
+ },
+ "model": {
"type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
+ "description": "The model deployment to use for this chat completion."
},
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
+ "modalities": {
+ "$ref": "#/components/schemas/OpenAI.ResponseModalities"
},
- "definition": {
- "$ref": "#/components/schemas/HostedAgentDefinition",
- "description": "The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, and protocol_versions."
- }
- },
- "description": "JSON metadata for code-based agent operations (create, update, create version).\nThe agent name comes from the URL path parameter or the `x-ms-agent-name` header,\nso it is not included in this model.\nThe content hash (SHA-256 of the zip) is carried in the `x-ms-code-zip-sha256` header."
- },
- "CreateAgentVersionFromManifestRequest": {
- "type": "object",
- "required": [
- "manifest_id",
- "parameter_values"
- ],
- "properties": {
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
+ "verbosity": {
+ "$ref": "#/components/schemas/OpenAI.Verbosity"
+ },
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "max_completion_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning)."
+ },
+ "frequency_penalty": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": -2,
+ "maximum": 2,
+ "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\n their existing frequency in the text so far, decreasing the model's\n likelihood to repeat the same line verbatim."
},
- "description": {
- "type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
+ "presence_penalty": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": -2,
+ "maximum": 2,
+ "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\n whether they appear in the text so far, increasing the model's likelihood\n to talk about new topics."
},
- "manifest_id": {
- "type": "string",
- "description": "The manifest ID to import the agent version from."
+ "web_search_options": {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestWebSearchOptions",
+ "description": "This tool searches the web for relevant results to use in a response.\n Learn more about the [web search tool](/docs/guides/tools-web-search?api-mode=chat).",
+ "title": "Web search"
},
- "parameter_values": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The inputs to the manifest that will result in a fully materialized Agent."
- }
- }
- },
- "CreateAgentVersionRequest": {
- "type": "object",
- "required": [
- "definition"
- ],
- "properties": {
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat",
+ "description": "An object specifying the format that the model must output.\n Setting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\n Structured Outputs which ensures the model will match your supplied JSON\n schema. Learn more in the [Structured Outputs\n guide](/docs/guides/structured-outputs).\n Setting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\n ensures the message the model generates is valid JSON. Using `json_schema`\n is preferred for models that support it."
},
- "description": {
- "type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
+ "audio": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestAudio"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Parameters for audio output. Required when audio output is requested with\n `modalities: [\"audio\"]`. [Learn more](/docs/guides/audio)."
},
- "definition": {
- "$ref": "#/components/schemas/AgentDefinition",
- "description": "The agent definition. This can be a workflow, hosted agent, or a simple agent definition.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
- ]
- }
+ "store": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Whether or not to store the output of this chat completion request for\n use in our [model distillation](/docs/guides/distillation) or\n [evals](/docs/guides/evals) products.\n Supports text and image inputs. Note: image inputs over 8MB will be dropped."
},
- "blueprint_reference": {
- "$ref": "#/components/schemas/AgentBlueprintReference",
- "description": "The blueprint reference for the agent."
+ "moderation": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ModerationParam"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "draft": {
- "type": "boolean",
- "description": "(Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DraftAgents=V1Preview"
- ]
- },
- "default": false
- }
- },
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
- ]
- }
- },
- "CreateEvalRequest": {
- "type": "object",
- "required": [
- "data_source_config",
- "testing_criteria"
- ],
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the evaluation."
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "If set to true, the model response data will be streamed to the client\n 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).\n See the [Streaming section below](/docs/api-reference/chat/streaming)\n for more information, along with the [streaming responses](/docs/guides/streaming-responses)\n guide for more information on how to handle the streaming events."
},
- "metadata": {
+ "stop": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "$ref": "#/components/schemas/OpenAI.StopConfiguration"
},
{
"type": "null"
}
]
},
- "data_source_config": {
- "oneOf": [
+ "logit_bias": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig"
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
},
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig"
+ "type": "null"
+ }
+ ],
+ "description": "Modify the likelihood of specified tokens appearing in the completion.\n Accepts a JSON object that maps tokens (specified by their token ID in the\n tokenizer) to an associated bias value from -100 to 100. Mathematically,\n the bias is added to the logits generated by the model prior to sampling.\n The exact effect will vary per model, but values between -1 and 1 should\n decrease or increase likelihood of selection; values like -100 or 100\n should result in a ban or exclusive selection of the relevant token.",
+ "x-oaiTypeLabel": "map"
+ },
+ "logprobs": {
+ "anyOf": [
+ {
+ "type": "boolean"
},
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig"
+ "type": "null"
+ }
+ ],
+ "description": "Whether to return log probabilities of the output tokens or not. If true,\n returns the log probabilities of each output token returned in the\n `content` of `message`."
+ },
+ "max_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
- "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ "type": "null"
+ }
+ ],
+ "description": "The maximum number of [tokens](/tokenizer) that can be generated in the\n chat completion. This value can be used to control\n [costs](https://openai.com/api/pricing/) for text generated via API.\n This value is now deprecated in favor of `max_completion_tokens`, and is\n not compatible with [o-series models](/docs/guides/reasoning).",
+ "deprecated": true
+ },
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
- "$ref": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ "type": "null"
}
],
- "description": "The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation."
+ "minimum": 1,
+ "maximum": 128,
+ "description": "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.",
+ "default": 1
},
- "testing_criteria": {
+ "prediction": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.PredictionContent"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Configuration for a [Predicted Output](/docs/guides/predicted-outputs),\n which can greatly improve response times when large parts of the model\n response are known ahead of time. This is most common when you are\n regenerating a file with only minor changes to most of the content."
+ },
+ "seed": {
+ "anyOf": [
+ {
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "This feature is in Beta.\n 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.\n Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.",
+ "deprecated": true,
+ "x-oaiMeta": {
+ "beta": true
+ }
+ },
+ "stream_options": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamOptions"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tools": {
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTool"
},
{
- "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletions"
}
]
},
- "description": "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}}`)."
+ "description": "A list of tools the model may call. You can provide either\n [custom tools](/docs/guides/function-calling#custom-tools) or\n [function tools](/docs/guides/function-calling)."
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
- }
- },
- "title": "CreateEvalRequest"
- },
- "CreateEvalRunRequest": {
- "type": "object",
- "required": [
- "data_source"
- ],
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the run."
+ "tool_choice": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionToolChoiceOption"
},
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
+ "default": true
},
- "data_source": {
+ "function_call": {
"oneOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource"
+ "type": "string",
+ "enum": [
+ "none",
+ "auto"
+ ]
},
{
- "$ref": "#/components/schemas/EvalRunDataSource"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionFunctionCallOption"
}
],
- "description": "Details about the run's data source."
+ "description": "Deprecated in favor of `tool_choice`.\n Controls which (if any) function is called by the model.\n `none` means the model will not call a function and instead generates a\n message.\n `auto` means the model can pick between generating a message or calling a\n function.\n Specifying a particular function via `{\"name\": \"my_function\"}` forces the\n model to call that function.\n `none` is the default when no functions are present. `auto` is the default\n if functions are present.",
+ "deprecated": true
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "functions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionFunctions"
},
- "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ "minItems": 1,
+ "maxItems": 128,
+ "description": "Deprecated in favor of `tools`.\n A list of functions the model may generate JSON inputs for.",
+ "deprecated": true
},
- "evaluation_level": {
- "$ref": "#/components/schemas/EvaluationLevel",
- "description": "The level at which evaluation is performed. Defaults to 'turn' if not specified.",
- "default": "turn"
+ "user_security_context": {
+ "$ref": "#/components/schemas/AzureUserSecurityContext",
+ "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud."
}
- },
- "title": "CreateEvalRunRequest"
+ }
},
- "CreateSkillVersionFromFilesBody": {
+ "OpenAI.CreateChatCompletionRequestAudio": {
"type": "object",
- "properties": {
- "files": {
- "type": "array",
- "items": {},
- "description": "Skill files to upload. Upload a single zip file or multiple individual files with relative paths."
- },
- "default": {
- "type": "boolean",
- "description": "Whether to set this version as the default. Defaults to false."
- }
- },
"required": [
- "files"
- ]
- },
- "CredentialType": {
- "anyOf": [
- {
- "type": "string"
+ "voice",
+ "format"
+ ],
+ "properties": {
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsOrCustomVoice"
},
- {
+ "format": {
"type": "string",
"enum": [
- "ApiKey",
- "AAD",
- "SAS",
- "CustomKeys",
- "None",
- "AgenticIdentityToken_Preview"
+ "wav",
+ "aac",
+ "mp3",
+ "flac",
+ "opus",
+ "pcm16"
]
}
- ],
- "description": "The credential type used by the connection"
+ }
},
- "CronTrigger": {
+ "OpenAI.CreateChatCompletionRequestResponseFormat": {
"type": "object",
"required": [
- "type",
- "expression"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "Cron"
- ]
- },
- "expression": {
- "type": "string",
- "description": "Cron expression that defines the schedule frequency."
- },
- "timeZone": {
- "type": "string",
- "description": "Time zone for the cron schedule. Defaults to `UTC`.",
- "default": "UTC"
- },
- "startTime": {
- "type": "string",
- "description": "Start time for the cron schedule in ISO 8601 format."
- },
- "endTime": {
- "type": "string",
- "description": "End time for the cron schedule in ISO 8601 format."
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/Trigger"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "text": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText",
+ "json_object": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject",
+ "json_schema": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
}
- ],
- "description": "Cron based trigger.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
- }
+ },
+ "description": "An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it."
},
- "CustomCredential": {
+ "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject": {
"type": "object",
"required": [
"type"
@@ -20890,2822 +42656,3441 @@
"type": {
"type": "string",
"enum": [
- "CustomKeys"
+ "json_object"
],
- "description": "The credential type",
- "readOnly": true
+ "description": "The type of response format being defined. Always `json_object`.",
+ "x-stainless-const": true
}
},
- "unevaluatedProperties": {
- "type": "string"
- },
"allOf": [
{
- "$ref": "#/components/schemas/BaseCredentials"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
}
],
- "description": "Custom credential definition"
+ "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
+ "title": "JSON object"
},
- "CustomRoutineTrigger": {
+ "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText": {
"type": "object",
"required": [
- "type",
- "provider",
- "parameters"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom"
+ "text"
],
- "description": "The trigger type."
- },
- "provider": {
- "type": "string",
- "maxLength": 128,
- "description": "The external provider that emits the custom event."
- },
- "event_name": {
- "type": "string",
- "maxLength": 256,
- "description": "The provider-specific event name that fires the routine."
- },
- "parameters": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Provider-specific trigger parameters."
+ "description": "The type of response format being defined. Always `text`.",
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/RoutineTrigger"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
}
],
- "description": "A custom event routine trigger.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "description": "Default response format. Used to generate text responses.",
+ "title": "Text"
+ },
+ "OpenAI.CreateChatCompletionRequestResponseFormatType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "text",
+ "json_schema",
+ "json_object"
+ ]
+ }
+ ]
+ },
+ "OpenAI.CreateChatCompletionRequestWebSearchOptions": {
+ "type": "object",
+ "properties": {
+ "user_location": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestWebSearchOptionsUserLocation"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "search_context_size": {
+ "$ref": "#/components/schemas/OpenAI.WebSearchContextSize"
+ }
}
},
- "DailyRecurrenceSchedule": {
+ "OpenAI.CreateChatCompletionRequestWebSearchOptionsUserLocation": {
"type": "object",
"required": [
"type",
- "hours"
+ "approximate"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "Daily"
+ "approximate"
],
- "description": "Daily recurrence type."
+ "x-stainless-const": true
},
- "hours": {
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int32"
- },
- "description": "Hours for the recurrence schedule."
+ "approximate": {
+ "$ref": "#/components/schemas/OpenAI.WebSearchLocation"
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/RecurrenceSchedule"
- }
- ],
- "description": "Daily recurrence schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
}
},
- "DataGenerationJob": {
+ "OpenAI.CreateChatCompletionResponse": {
"type": "object",
"required": [
"id",
- "status",
- "created_at"
+ "choices",
+ "created",
+ "model",
+ "object"
],
"properties": {
"id": {
"type": "string",
- "description": "Server-assigned unique identifier.",
- "readOnly": true
- },
- "inputs": {
- "$ref": "#/components/schemas/DataGenerationJobInputs",
- "description": "Caller-supplied inputs."
- },
- "result": {
- "$ref": "#/components/schemas/DataGenerationJobResult",
- "description": "Result produced on success.",
- "readOnly": true
- },
- "status": {
- "$ref": "#/components/schemas/JobStatus",
- "description": "Current lifecycle status.",
- "readOnly": true
+ "description": "A unique identifier for the chat completion."
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error",
- "description": "Error details — populated only on failure.",
- "readOnly": true
+ "choices": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponseChoices"
+ },
+ "description": "A list of chat completion choices. Can be more than one if `n` is greater than 1."
},
- "created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).",
- "readOnly": true
+ "created": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) of when the chat completion was created."
},
- "finished_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job was finished, represented in Unix time (seconds since January 1, 1970).",
- "readOnly": true
- }
- },
- "description": "Data Generation Job resource.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobInputs": {
- "type": "object",
- "required": [
- "name",
- "sources",
- "options",
- "scenario"
- ],
- "properties": {
- "name": {
+ "model": {
"type": "string",
- "description": "The display name of the data generation job."
+ "description": "The model deployment used for the creation of this chat completion."
+ },
+ "service_tier": {
+ "$ref": "#/components/schemas/OpenAI.ServiceTier"
},
- "sources": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/DataGenerationJobSource"
- },
- "description": "The sources used for the data generation job."
+ "system_fingerprint": {
+ "type": "string",
+ "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.",
+ "deprecated": true
},
- "options": {
- "$ref": "#/components/schemas/DataGenerationJobOptions",
- "description": "The options for the data generation job."
+ "object": {
+ "type": "string",
+ "enum": [
+ "chat.completion"
+ ],
+ "description": "The object type, which is always `chat.completion`.",
+ "x-stainless-const": true
},
- "scenario": {
- "$ref": "#/components/schemas/DataGenerationJobScenario",
- "description": "The scenario of the data generation job. Either for fine-tuning or evaluation."
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.CompletionUsage"
},
- "output_options": {
- "$ref": "#/components/schemas/DataGenerationJobOutputOptions",
- "description": "Optional caller-supplied metadata for the job's output. See individual fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both."
+ "moderation": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModeration"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "Caller-supplied inputs for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
+ "description": "Represents a chat completion response returned by model, based on the provided input.",
+ "x-oaiMeta": {
+ "name": "The chat completion object",
+ "group": "chat",
+ "example": "{\n \"id\": \"chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG\",\n \"object\": \"chat.completion\",\n \"created\": 1741570283,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1117,\n \"completion_tokens\": 46,\n \"total_tokens\": 1163,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_fc9f1d7035\"\n}\n"
}
},
- "DataGenerationJobOptions": {
+ "OpenAI.CreateChatCompletionResponseChoices": {
"type": "object",
"required": [
- "type",
- "max_samples"
+ "finish_reason",
+ "index",
+ "message",
+ "logprobs"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/DataGenerationJobType",
- "description": "The data generation job type."
+ "finish_reason": {
+ "type": "string",
+ "enum": [
+ "stop",
+ "length",
+ "tool_calls",
+ "content_filter",
+ "function_call"
+ ]
},
- "max_samples": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of samples to generate."
+ "index": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "train_split": {
- "type": "number",
- "format": "float",
- "minimum": 0,
- "maximum": 1,
- "description": "The proportion of the generated data to be used for training when the data is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1."
+ "message": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessage"
},
- "model_options": {
- "$ref": "#/components/schemas/DataGenerationModelOptions",
- "description": "The LLM model options."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "simple_qna": "#/components/schemas/SimpleQnADataGenerationJobOptions",
- "traces": "#/components/schemas/TracesDataGenerationJobOptions",
- "tool_use": "#/components/schemas/ToolUseFineTuningDataGenerationJobOptions"
+ "logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponseChoicesLogprobs"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "Options for managing data generation jobs.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DataGenerationJobOutput": {
+ "OpenAI.CreateChatCompletionResponseChoicesLogprobs": {
"type": "object",
"required": [
- "type"
+ "content",
+ "refusal"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/DataGenerationJobOutputType",
- "description": "The type of the output."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "file": "#/components/schemas/FileDataGenerationJobOutput",
- "dataset": "#/components/schemas/DatasetDataGenerationJobOutput"
+ "content": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "refusal": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "Output information for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DataGenerationJobOutputOptions": {
+ "OpenAI.CreateCompletionRequest": {
"type": "object",
+ "required": [
+ "model",
+ "prompt"
+ ],
"properties": {
- "name": {
- "type": "string",
- "description": "Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario)."
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "gpt-3.5-turbo-instruct",
+ "davinci-002",
+ "babbage-002"
+ ]
+ }
+ ],
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.",
+ "x-oaiTypeLabel": "string"
},
- "description": {
- "type": "string",
- "description": "Description to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs."
+ "prompt": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n 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.",
+ "default": "<|endoftext|>"
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs."
- }
- },
- "description": "Output options for data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobOutputType": {
- "anyOf": [
- {
- "type": "string"
+ "best_of": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 20,
+ "description": "Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed.\n 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`.\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`.",
+ "default": 1
},
- {
- "type": "string",
- "enum": [
- "file",
- "dataset"
+ "echo": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Echo back the prompt in addition to the completion"
+ },
+ "frequency_penalty": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": -2,
+ "maximum": 2,
+ "description": "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.\n [See more information about frequency and presence penalties.](/docs/guides/text-generation)"
+ },
+ "logit_bias": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Modify the likelihood of specified tokens appearing in the completion.\n 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.\n As an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated.",
+ "x-oaiTypeLabel": "map"
+ },
+ "logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 5,
+ "description": "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.\n The maximum value for `logprobs` is 5."
+ },
+ "max_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "description": "The maximum number of [tokens](/tokenizer) that can be generated in the completion.\n 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.",
+ "default": 16
+ },
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 1,
+ "maximum": 128,
+ "description": "How many completions to generate for each prompt.\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`.",
+ "default": 1
+ },
+ "presence_penalty": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": -2,
+ "maximum": 2,
+ "description": "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.\n [See more information about frequency and presence penalties.](/docs/guides/text-generation)"
+ },
+ "seed": {
+ "anyOf": [
+ {
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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.\n Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend."
+ },
+ "stop": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.StopConfiguration"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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_options": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamOptions"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "suffix": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The suffix that comes after a completion of inserted text.\n This parameter is only supported for `gpt-3.5-turbo-instruct`."
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 2,
+ "description": "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.\n We generally recommend altering this or `top_p` but not both.",
+ "default": 1
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 1,
+ "description": "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.\n We generally recommend altering this or `temperature` but not both.",
+ "default": 1
+ },
+ "user": {
+ "type": "string",
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
}
- ],
- "description": "The supported output file types for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DataGenerationJobResult": {
+ "OpenAI.CreateCompletionResponse": {
"type": "object",
"required": [
- "generated_samples"
+ "id",
+ "choices",
+ "created",
+ "model",
+ "object"
],
"properties": {
- "outputs": {
+ "id": {
+ "type": "string",
+ "description": "A unique identifier for the completion."
+ },
+ "choices": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/DataGenerationJobOutput"
+ "$ref": "#/components/schemas/OpenAI.CreateCompletionResponseChoices"
},
- "description": "The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation."
+ "description": "The list of completion choices the model generated for the input prompt."
},
- "generated_samples": {
+ "created": {
"type": "integer",
- "format": "int32",
- "description": "The number of samples actually generated."
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) of when the completion was created."
},
- "token_usage": {
- "$ref": "#/components/schemas/DataGenerationTokenUsage",
- "description": "The token usage information for the data generation job."
- }
- },
- "description": "Result produced by a successful data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobScenario": {
- "anyOf": [
- {
- "type": "string"
+ "model": {
+ "type": "string",
+ "description": "The model used for completion."
},
- {
+ "system_fingerprint": {
+ "type": "string",
+ "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism."
+ },
+ "object": {
"type": "string",
"enum": [
- "supervised_finetuning",
- "reinforcement_finetuning",
- "evaluation"
- ]
+ "text_completion"
+ ],
+ "description": "The object type, which is always \"text_completion\"",
+ "x-stainless-const": true
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.CompletionUsage"
}
- ],
- "description": "The supported scenarios for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
+ },
+ "description": "Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).",
+ "x-oaiMeta": {
+ "name": "The completion object",
+ "legacy": true,
+ "example": "{\n \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n \"object\": \"text_completion\",\n \"created\": 1589478378,\n \"model\": \"gpt-4-turbo\",\n \"choices\": [\n {\n \"text\": \"\n\nThis is indeed a test\",\n \"index\": 0,\n \"logprobs\": null,\n \"finish_reason\": \"length\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 5,\n \"completion_tokens\": 7,\n \"total_tokens\": 12\n }\n}\n"
}
},
- "DataGenerationJobSource": {
+ "OpenAI.CreateCompletionResponseChoices": {
"type": "object",
"required": [
- "type"
+ "finish_reason",
+ "index",
+ "logprobs",
+ "text"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/DataGenerationJobSourceType",
- "description": "The type of source."
- },
- "description": {
- "type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "prompt": "#/components/schemas/PromptDataGenerationJobSource",
- "agent": "#/components/schemas/AgentDataGenerationJobSource",
- "traces": "#/components/schemas/TracesDataGenerationJobSource",
- "file": "#/components/schemas/FileDataGenerationJobSource"
- }
- },
- "description": "The base source model for data generation jobs.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobSourceType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "finish_reason": {
"type": "string",
"enum": [
- "prompt",
- "agent",
- "traces",
- "file"
+ "stop",
+ "length",
+ "content_filter"
+ ]
+ },
+ "index": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateCompletionResponseChoicesLogprobs"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "text": {
+ "type": "string"
}
- ],
- "description": "The supported source types for data generation jobs.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DataGenerationJobType": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.CreateCompletionResponseChoicesLogprobs": {
+ "type": "object",
+ "properties": {
+ "text_offset": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
},
- {
- "type": "string",
- "enum": [
- "simple_qna",
- "traces",
- "tool_use"
- ]
+ "token_logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ },
+ "tokens": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "top_logprobs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ }
}
- ],
- "description": "The supported data generation job types.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DataGenerationModelOptions": {
+ "OpenAI.CreateContainerBody": {
"type": "object",
"required": [
- "model"
+ "name"
],
"properties": {
- "model": {
+ "name": {
"type": "string",
- "description": "Base model name used to generate data."
+ "description": "Name of the container to create."
+ },
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "IDs of files to copy to the container."
+ },
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.CreateContainerBodyExpiresAfter",
+ "description": "Container expiration time in seconds relative to the 'anchor' time."
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ContainerSkill"
+ },
+ "description": "An optional list of skills referenced by id or inline data."
+ },
+ "memory_limit": {
+ "type": "string",
+ "enum": [
+ "1g",
+ "4g",
+ "16g",
+ "64g"
+ ],
+ "description": "Optional memory limit for the container. Defaults to \"1g\"."
+ },
+ "network_policy": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
- },
- "description": "LLM model options for data generation jobs.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DataGenerationTokenUsage": {
+ "OpenAI.CreateContainerBodyExpiresAfter": {
"type": "object",
"required": [
- "prompt_tokens",
- "completion_tokens",
- "total_tokens"
+ "anchor",
+ "minutes"
],
"properties": {
- "prompt_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "The number of prompt tokens used.",
- "readOnly": true
- },
- "completion_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "The number of completion tokens generated.",
- "readOnly": true
+ "anchor": {
+ "type": "string",
+ "enum": [
+ "last_active_at"
+ ]
},
- "total_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Total number of tokens used.",
- "readOnly": true
+ "minutes": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- },
- "description": "Token usage information for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DataSourceConfig": {
+ "OpenAI.CreateContainerFileBody": {
"type": "object",
- "required": [
- "type",
- "schema"
- ],
"properties": {
- "type": {
- "type": "string",
- "description": "The data source type discriminator."
+ "file_id": {
+ "type": "object",
+ "description": "Name of the file to create."
},
- "schema": {
+ "file": {
"type": "object",
- "unevaluatedProperties": {},
- "description": "The overall object JSON schema for the run data source items."
+ "description": "The File object (not file name) to be uploaded."
}
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "azure_ai_source": "#/components/schemas/AzureAIDataSourceConfig"
+ }
+ },
+ "OpenAI.CreateConversationBody": {
+ "type": "object",
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "items": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "Base class for run data sources with discriminator support."
+ }
},
- "DatasetDataGenerationJobOutput": {
+ "OpenAI.CreateEmbeddingRequest": {
"type": "object",
"required": [
- "type"
+ "input",
+ "model"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "dataset"
+ "input": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ }
],
- "description": "Dataset output."
+ "description": "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."
},
- "id": {
- "type": "string",
- "description": "The id of the output dataset created.",
- "readOnly": true
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "text-embedding-ada-002",
+ "text-embedding-3-small",
+ "text-embedding-3-large"
+ ]
+ }
+ ],
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.",
+ "x-oaiTypeLabel": "string"
},
- "name": {
+ "encoding_format": {
"type": "string",
- "description": "The name of the output dataset.",
- "readOnly": true
+ "enum": [
+ "float",
+ "base64"
+ ],
+ "description": "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).",
+ "default": "float"
},
- "version": {
- "type": "string",
- "description": "The version of the output dataset.",
- "readOnly": true
+ "dimensions": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 1,
+ "description": "The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models."
},
- "description": {
+ "user": {
"type": "string",
- "description": "Description of the output dataset.",
- "readOnly": true
- },
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary of the output dataset.",
- "readOnly": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/DataGenerationJobOutput"
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
}
- ],
- "description": "Dataset output for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DatasetEvaluatorGenerationJobSource": {
+ "OpenAI.CreateEmbeddingResponse": {
"type": "object",
"required": [
- "type",
- "name"
+ "data",
+ "model",
+ "object",
+ "usage"
],
"properties": {
- "description": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Embedding"
+ },
+ "description": "The list of embeddings generated by the model."
+ },
+ "model": {
"type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ "description": "The name of the model used to generate the embedding."
},
- "type": {
+ "object": {
"type": "string",
"enum": [
- "dataset"
+ "list"
],
- "description": "The source type for this source, which is Dataset."
- },
- "name": {
- "type": "string",
- "description": "The name of the dataset."
+ "description": "The object type, which is always \"list\".",
+ "x-stainless-const": true
},
- "version": {
- "type": "string",
- "description": "The version of the dataset. If not specified, the latest version is used."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.CreateEmbeddingResponseUsage",
+ "description": "The usage information for the request."
}
- ],
- "description": "Dataset source for evaluator generation jobs — reference to a dataset.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "DatasetReference": {
+ "OpenAI.CreateEmbeddingResponseUsage": {
"type": "object",
"required": [
- "name",
- "version"
+ "prompt_tokens",
+ "total_tokens"
],
"properties": {
- "name": {
- "type": "string",
- "description": "Dataset name."
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "version": {
- "type": "string",
- "description": "Dataset version."
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- },
- "description": "Reference to a versioned Foundry Dataset.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "DatasetType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "uri_file",
- "uri_folder"
- ]
- }
- ],
- "description": "Enum to determine the type of data."
- },
- "DatasetVersion": {
+ "OpenAI.CreateEvalCompletionsRunDataSource": {
"type": "object",
"required": [
- "dataUri",
"type",
- "name",
- "version"
+ "source"
],
"properties": {
- "dataUri": {
- "type": "string",
- "minLength": 1,
- "pattern": "[a-zA-Z0-9_]",
- "description": "URI of the data ([example](https://go.microsoft.com/fwlink/?linkid=2202330))"
- },
"type": {
- "$ref": "#/components/schemas/DatasetType",
- "description": "Dataset type"
- },
- "isReference": {
- "type": "boolean",
- "description": "Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted",
- "readOnly": true
- },
- "connectionName": {
"type": "string",
- "description": "The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset"
+ "enum": [
+ "completions"
+ ],
+ "description": "The type of run data source. Always `completions`.",
+ "default": "completions"
},
- "id": {
- "type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
+ "input_messages": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
+ }
+ ],
+ "description": "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."
},
- "name": {
- "type": "string",
- "description": "The name of the resource",
- "readOnly": true
+ "sampling_params": {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams"
},
- "version": {
+ "model": {
"type": "string",
- "description": "The version of the resource",
- "readOnly": true
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "uri_file": "#/components/schemas/FileDatasetVersion",
- "uri_folder": "#/components/schemas/FolderDatasetVersion"
+ "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")."
+ },
+ "source": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalStoredCompletionsSource"
+ }
+ ],
+ "description": "Determines what populates the `item` namespace in this run's data source."
}
},
- "description": "DatasetVersion Definition"
+ "description": "A CompletionsRunDataSource object describing a model sampling configuration.",
+ "title": "CompletionsRunDataSource",
+ "x-oaiMeta": {
+ "name": "The completions data source object used to configure an individual run",
+ "group": "eval runs",
+ "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"completions\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n"
+ }
},
- "DatasetVersionUpdate": {
+ "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference": {
"type": "object",
"required": [
- "type"
+ "type",
+ "item_reference"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/DatasetType",
- "description": "Dataset type"
- },
- "description": {
- "type": "string",
- "description": "The asset description text."
- },
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "uri_file": "#/components/schemas/FileDatasetVersionUpdate",
- "uri_folder": "#/components/schemas/FolderDatasetVersionUpdate"
- }
- },
- "description": "DatasetVersion Definition"
- },
- "DayOfWeek": {
- "anyOf": [
- {
- "type": "string"
- },
- {
"type": "string",
"enum": [
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday"
+ "item_reference"
]
+ },
+ "item_reference": {
+ "type": "string"
}
- ],
- "description": "Days of the week for recurrence schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
}
},
- "DeleteAgentResponse": {
+ "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate": {
"type": "object",
"required": [
- "object",
- "name",
- "deleted"
+ "type",
+ "template"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "agent.deleted"
- ],
- "description": "The object type. Always 'agent.deleted'."
- },
- "name": {
- "type": "string",
- "description": "The name of the agent."
+ "template"
+ ]
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the agent was successfully deleted."
+ "template": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EasyInputMessage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ }
+ ]
+ }
}
- },
- "description": "A deleted agent Object"
+ }
},
- "DeleteAgentVersionResponse": {
+ "OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams": {
"type": "object",
- "required": [
- "object",
- "name",
- "version",
- "deleted"
- ],
"properties": {
- "object": {
- "type": "string",
- "enum": [
- "agent.version.deleted"
- ],
- "description": "The object type. Always 'agent.version.deleted'."
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "name": {
- "type": "string",
- "description": "The name of the agent."
+ "temperature": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "default": 1
},
- "version": {
- "type": "string",
- "description": "The version identifier of the agent."
+ "max_completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the agent was successfully deleted."
+ "top_p": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "default": 1
+ },
+ "seed": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "default": 42
+ },
+ "response_format": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatText"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject"
+ }
+ ]
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTool"
+ }
}
- },
- "description": "A deleted agent version Object"
+ }
},
- "DeleteEvalResponse": {
+ "OpenAI.CreateEvalCustomDataSourceConfig": {
"type": "object",
"required": [
- "object",
- "eval_id",
- "deleted"
+ "type",
+ "item_schema"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "eval.deleted"
+ "custom"
],
- "description": "The object type. Always 'eval.deleted'."
+ "description": "The type of data source. Always `custom`.",
+ "x-stainless-const": true,
+ "default": "custom"
},
- "eval_id": {
- "type": "string",
- "description": "id of the eval."
+ "item_schema": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The json schema for each row in the data source."
},
- "deleted": {
+ "include_sample_schema": {
"type": "boolean",
- "description": "Whether the eval was successfully deleted."
+ "description": "Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)"
}
},
- "description": "A deleted evaluation Object"
+ "description": "A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.\nThis schema is used to define the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run",
+ "title": "CustomDataSourceConfig",
+ "x-oaiMeta": {
+ "name": "The eval file data source config object",
+ "group": "evals",
+ "example": "{\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"}\n },\n \"required\": [\"name\", \"age\"]\n },\n \"include_sample_schema\": true\n}\n"
+ }
},
- "DeleteEvalRunResponse": {
+ "OpenAI.CreateEvalJsonlRunDataSource": {
"type": "object",
+ "required": [
+ "type",
+ "source"
+ ],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "eval.deleted"
+ "jsonl"
],
- "description": "The object type. Always 'eval.deleted'."
- },
- "run_id": {
- "type": "string",
- "description": "id of the eval."
+ "description": "The type of data source. Always `jsonl`.",
+ "x-stainless-const": true,
+ "default": "jsonl"
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the eval was successfully deleted."
+ "source": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
+ }
+ ],
+ "description": "Determines what populates the `item` namespace in the data source."
}
},
- "description": "A deleted evaluation run Object."
+ "description": "A JsonlRunDataSource object with that specifies a JSONL file that matches the eval",
+ "title": "JsonlRunDataSource",
+ "x-oaiMeta": {
+ "name": "The file data source object for the eval run configuration",
+ "group": "evals",
+ "example": "{\n \"type\": \"jsonl\",\n \"source\": {\n \"type\": \"file_id\",\n \"id\": \"file-9GYS6xbkWgWhmE7VoLUWFg\"\n }\n}\n"
+ }
},
- "DeleteMemoryResponse": {
+ "OpenAI.CreateEvalLogsDataSourceConfig": {
"type": "object",
"required": [
- "object",
- "memory_id",
- "deleted"
+ "type"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "memory_store.item.deleted"
+ "logs"
],
- "description": "The object type. Always 'memory_store.item.deleted'."
- },
- "memory_id": {
- "type": "string",
- "description": "The unique ID of the deleted memory item."
+ "description": "The type of data source. Always `logs`.",
+ "x-stainless-const": true,
+ "default": "logs"
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the memory item was successfully deleted."
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Metadata filters for the logs data source."
}
},
- "description": "Response for deleting a memory item from a memory store.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
+ "description": "A data source config which specifies the metadata property of your logs query.\nThis is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.",
+ "title": "LogsDataSourceConfig",
+ "x-oaiMeta": {
+ "name": "The logs data source object for evals",
+ "group": "evals",
+ "example": "{\n \"type\": \"logs\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n"
}
},
- "DeleteMemoryStoreResponse": {
+ "OpenAI.CreateEvalResponsesRunDataSource": {
"type": "object",
"required": [
- "object",
- "name",
- "deleted"
+ "type",
+ "source"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "memory_store.deleted"
+ "responses"
],
- "description": "The object type. Always 'memory_store.deleted'."
+ "description": "The type of run data source. Always `responses`.",
+ "default": "responses"
},
- "name": {
+ "input_messages": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference"
+ }
+ ],
+ "description": "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."
+ },
+ "sampling_params": {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams"
+ },
+ "model": {
"type": "string",
- "description": "The name of the memory store."
+ "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")."
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the memory store was successfully deleted."
+ "source": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalResponsesSource"
+ }
+ ],
+ "description": "Determines what populates the `item` namespace in this run's data source."
}
},
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
+ "description": "A ResponsesRunDataSource object describing a model sampling configuration.",
+ "title": "ResponsesRunDataSource",
+ "x-oaiMeta": {
+ "name": "The completions data source object used to configure an individual run",
+ "group": "eval runs",
+ "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"responses\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n"
}
},
- "DeleteResponseResult": {
+ "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference": {
"type": "object",
"required": [
- "id",
- "object",
- "deleted"
+ "type",
+ "item_reference"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The operation ID."
- },
- "object": {
+ "type": {
"type": "string",
"enum": [
- "response"
- ],
- "description": "Always return 'response'."
+ "item_reference"
+ ]
},
- "deleted": {
- "type": "boolean",
- "enum": [
- true
- ],
- "description": "Always return true"
+ "item_reference": {
+ "type": "string"
}
- },
- "description": "The result of a delete response operation."
+ }
},
- "DeleteSkillResponse": {
+ "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate": {
"type": "object",
"required": [
- "id",
- "name",
- "deleted"
+ "type",
+ "template"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The unique identifier of the deleted skill."
- },
- "name": {
- "$ref": "#/components/schemas/SkillName",
- "description": "The unique name of the skill."
+ "enum": [
+ "template"
+ ]
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the skill was successfully deleted."
+ "template": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "role": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "role",
+ "content"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ }
+ ]
+ }
}
- },
- "description": "A deleted skill.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
}
},
- "DeleteSkillVersionResponse": {
+ "OpenAI.CreateEvalResponsesRunDataSourceSamplingParams": {
"type": "object",
- "required": [
- "id",
- "name",
- "deleted",
- "version"
- ],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique identifier of the deleted skill version."
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "name": {
- "$ref": "#/components/schemas/SkillName",
- "description": "The name of the skill."
+ "temperature": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "default": 1
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the skill version was successfully deleted."
+ "max_completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "version": {
- "type": "string",
- "description": "The version that was deleted."
+ "top_p": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "default": 1
+ },
+ "seed": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "default": 42
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ },
+ "text": {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText"
}
- },
- "description": "A deleted skill version.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
}
},
- "Deployment": {
+ "OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
+ }
+ }
+ },
+ "OpenAI.CreateEvalStoredCompletionsDataSourceConfig": {
"type": "object",
"required": [
- "type",
- "name"
+ "type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/DeploymentType",
- "description": "The type of the deployment"
- },
- "name": {
"type": "string",
- "description": "Name of the deployment",
- "readOnly": true
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "ModelDeployment": "#/components/schemas/ModelDeployment"
+ "enum": [
+ "stored_completions"
+ ],
+ "description": "The type of data source. Always `stored_completions`.",
+ "x-stainless-const": true,
+ "default": "stored_completions"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Metadata filters for the stored completions data source."
}
},
- "description": "Model Deployment Definition"
+ "description": "Deprecated in favor of LogsDataSourceConfig.",
+ "title": "StoredCompletionsDataSourceConfig",
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "The stored completions data source object for evals",
+ "group": "evals",
+ "example": "{\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n"
+ }
},
- "DeploymentType": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.CreateFileRequest": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "description": "The File object (not file name) to be uploaded."
},
- {
- "type": "string",
- "enum": [
- "ModelDeployment"
- ]
+ "purpose": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FilePurpose"
+ }
+ ],
+ "description": "The intended purpose of the uploaded file. One of:\n - `assistants`: Used in the Assistants API\n - `batch`: Used in the Batch API\n - `fine-tune`: Used for fine-tuning\n - `vision`: Images used for vision fine-tuning\n - `user_data`: Flexible file type for any purpose\n - `evals`: Used for eval data sets"
+ },
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.FileExpirationAfter"
}
+ },
+ "required": [
+ "file",
+ "purpose"
]
},
- "Dimension": {
+ "OpenAI.CreateFineTuningCheckpointPermissionRequest": {
"type": "object",
"required": [
- "id",
- "description",
- "weight"
+ "project_ids"
],
"properties": {
- "id": {
- "type": "string",
- "description": "Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. Provided by the user when manually creating a rubric evaluator or during human-in-the-loop review of a generated set; the generation pipeline produces an initial value the user can edit. Editable when saving new versions."
- },
- "description": {
- "type": "string",
- "description": "What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and pursues the appropriate workflow')."
- },
- "weight": {
- "type": "integer",
- "format": "int32",
- "minimum": 1,
- "maximum": 10,
- "description": "Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension weight 8-10; all others use 1-6. User edits are not constrained by this heuristic."
- },
- "always_applicable": {
- "type": "boolean",
- "description": "When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is not specified by the caller.",
- "default": false
+ "project_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The project identifiers to grant access to."
}
- },
- "description": "A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "DispatchRoutineRequest": {
+ "OpenAI.CreateFineTuningJobRequest": {
"type": "object",
+ "required": [
+ "model",
+ "training_file"
+ ],
"properties": {
- "payload": {
- "$ref": "#/components/schemas/RoutineDispatchPayload",
- "description": "A direct action-input override sent downstream when testing a routine."
- }
- },
- "description": "Request body for the public dispatch_async route.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "babbage-002",
+ "davinci-002",
+ "gpt-3.5-turbo",
+ "gpt-4o-mini"
+ ]
+ }
+ ],
+ "description": "The name of the model to fine-tune. You can select one of the\n [supported models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned).",
+ "x-oaiTypeLabel": "string"
+ },
+ "training_file": {
+ "type": "string",
+ "description": "The ID of an uploaded file that contains training data.\n See [upload file](/docs/api-reference/files/create) for how to upload a file.\n Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.\n The contents of the file should differ depending on if the model uses the [chat](/docs/api-reference/fine-tuning/chat-input), [completions](/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](/docs/api-reference/fine-tuning/preference-input) format.\n See the [fine-tuning guide](/docs/guides/model-optimization) for more details."
+ },
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters",
+ "description": "The hyperparameters used for the fine-tuning job.\n This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter.",
+ "deprecated": true
+ },
+ "suffix": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "A string of up to 64 characters that will be added to your fine-tuned model name.\n For example, a `suffix` of \"custom-model-name\" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`."
+ },
+ "validation_file": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The ID of an uploaded file that contains validation data.\n If you provide this file, the data is used to generate validation\n metrics periodically during fine-tuning. These metrics can be viewed in\n the fine-tuning results file.\n The same data should not be present in both train and validation files.\n Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.\n See the [fine-tuning guide](/docs/guides/model-optimization) for more details."
+ },
+ "integrations": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "A list of integrations to enable for your fine-tuning job."
+ },
+ "seed": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 2147483647,
+ "description": "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.\n If a seed is not specified, one will be generated for you."
+ },
+ "method": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneMethod"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
}
},
- "DispatchRoutineResponse": {
+ "OpenAI.CreateFineTuningJobRequestHyperparameters": {
"type": "object",
"properties": {
- "dispatch_id": {
- "type": "string",
- "description": "The dispatch identifier created for the routine dispatch."
+ "batch_size": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "default": "auto"
},
- "action_correlation_id": {
- "type": "string",
- "description": "A downstream action correlation identifier, when available."
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "default": "auto"
},
- "task_id": {
- "type": "string",
- "description": "A workspace task identifier created for the dispatch, when available."
+ "n_epochs": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "default": "auto"
}
- },
- "description": "Identifiers returned after a routine dispatch is queued.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
}
},
- "EndpointBasedEvaluatorDefinition": {
+ "OpenAI.CreateFineTuningJobRequestIntegrations": {
"type": "object",
"required": [
"type",
- "connection_name"
+ "wandb"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "endpoint"
- ]
+ "wandb"
+ ],
+ "x-stainless-const": true
},
- "connection_name": {
- "type": "string",
- "minLength": 1,
- "description": "Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends `api-key` header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity)."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluatorDefinition"
+ "wandb": {
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb"
}
- ],
- "description": "Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row."
+ }
},
- "EntraAuthorizationScheme": {
+ "OpenAI.CreateFineTuningJobRequestIntegrationsWandb": {
"type": "object",
"required": [
- "type"
+ "project"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "Entra"
+ "project": {
+ "type": "string"
+ },
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "entity": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
- }
- ]
+ }
},
- "EntraIDCredentials": {
+ "OpenAI.CreateImageEditRequest": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
+ "image": {
+ "anyOf": [
+ {},
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "contentEncoding": "base64"
+ }
+ }
+ ],
+ "description": "The image(s) to edit. Must be a supported image file or an array of images.\n For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`\n file less than 50MB. You can provide up to 16 images.\n `chatgpt-image-latest` follows the same input constraints as GPT image models.\n For `dall-e-2`, you can only provide one image, and it should be a square\n `png` file less than 4MB."
+ },
+ "prompt": {
"type": "string",
- "enum": [
- "AAD"
+ "description": "A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models."
+ },
+ "mask": {
+ "description": "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`."
+ },
+ "background": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "transparent",
+ "opaque",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The credential type",
- "readOnly": true
+ "description": "Allows to set transparency for the background of the generated image(s).\n This parameter is only supported for the GPT image models. Must be one of\n `transparent`, `opaque` or `auto` (default value). When `auto` is used, the\n model will automatically determine the best background for the image.\n If `transparent`, the output format needs to support transparency, so it\n should be set to either `png` (default value) or `webp`."
+ },
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "gpt-image-1.5",
+ "dall-e-2",
+ "gpt-image-1",
+ "gpt-image-1-mini",
+ "chatgpt-image-latest"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The model to use for image generation. Defaults to `gpt-image-1.5`.",
+ "x-oaiTypeLabel": "string"
+ },
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The number of images to generate. Must be between 1 and 10."
+ },
+ "size": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "256x256",
+ "512x512",
+ "1024x1024",
+ "1536x1024",
+ "1024x1536",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`."
+ },
+ "response_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "url",
+ "b64_json"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images."
+ },
+ "output_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "png",
+ "jpeg",
+ "webp"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The format in which the generated images are returned. This parameter is\n only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.\n The default value is `png`."
+ },
+ "output_compression": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The compression level (0-100%) for the generated images. This parameter\n is only supported for the GPT image models with the `webp` or `jpeg` output\n formats, and defaults to 100."
+ },
+ "user": {
+ "type": "string",
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
+ },
+ "input_fidelity": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFidelity"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Edit the image in streaming mode. Defaults to `false`. See the\n [Image generation guide](/docs/guides/image-generation) for more information."
+ },
+ "partial_images": {
+ "$ref": "#/components/schemas/OpenAI.PartialImages"
+ },
+ "quality": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "standard",
+ "low",
+ "medium",
+ "high",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The quality of the image that will be generated for GPT image models. Defaults to `auto`."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/BaseCredentials"
- }
- ],
- "description": "Entra ID credential definition"
+ "required": [
+ "image",
+ "prompt"
+ ]
},
- "Eval": {
+ "OpenAI.CreateImageRequest": {
"type": "object",
"required": [
- "object",
- "id",
- "name",
- "data_source_config",
- "testing_criteria",
- "created_at",
- "metadata"
+ "prompt"
],
"properties": {
- "object": {
+ "prompt": {
"type": "string",
- "enum": [
- "eval"
+ "description": "A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`."
+ },
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "gpt-image-1.5",
+ "dall-e-2",
+ "dall-e-3",
+ "gpt-image-1",
+ "gpt-image-1-mini"
+ ]
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The object type.",
- "x-stainless-const": true,
- "default": "eval"
+ "description": "The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.",
+ "x-oaiTypeLabel": "string",
+ "default": "dall-e-2"
},
- "id": {
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 1,
+ "maximum": 10,
+ "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.",
+ "default": 1
+ },
+ "quality": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "standard",
+ "hd",
+ "low",
+ "medium",
+ "high",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The quality of the image that will be generated.\n - `auto` (default value) will automatically select the best quality for the given model.\n - `high`, `medium` and `low` are supported for the GPT image models.\n - `hd` and `standard` are supported for `dall-e-3`.\n - `standard` is the only option for `dall-e-2`.",
+ "default": "auto"
+ },
+ "response_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "url",
+ "b64_json"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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 the GPT image models, which always return base64-encoded images.",
+ "default": "url"
+ },
+ "output_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "png",
+ "jpeg",
+ "webp"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.",
+ "default": "png"
+ },
+ "output_compression": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100.",
+ "default": 100
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Generate the image in streaming mode. Defaults to `false`. See the\n [Image generation guide](/docs/guides/image-generation) for more information.\n This parameter is only supported for the GPT image models."
+ },
+ "partial_images": {
+ "$ref": "#/components/schemas/OpenAI.PartialImages"
+ },
+ "size": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "1024x1024",
+ "1536x1024",
+ "1024x1536",
+ "256x256",
+ "512x512",
+ "1792x1024",
+ "1024x1792"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.",
+ "default": "auto"
+ },
+ "moderation": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "low",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value).",
+ "default": "auto"
+ },
+ "background": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "transparent",
+ "opaque",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Allows to set transparency for the background of the generated image(s).\n This parameter is only supported for the GPT image models. Must be one of\n `transparent`, `opaque` or `auto` (default value). When `auto` is used, the\n model will automatically determine the best background for the image.\n If `transparent`, the output format needs to support transparency, so it\n should be set to either `png` (default value) or `webp`.",
+ "default": "auto"
+ },
+ "style": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "vivid",
+ "natural"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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.",
+ "default": "vivid"
+ },
+ "user": {
"type": "string",
- "description": "Unique identifier for the evaluation."
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
+ }
+ }
+ },
+ "OpenAI.CreateImageVariationRequest": {
+ "type": "object",
+ "properties": {
+ "image": {
+ "description": "The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square."
},
- "name": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "dall-e-2"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The model to use for image generation. Only `dall-e-2` is supported at this time.",
+ "x-oaiTypeLabel": "string"
+ },
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The number of images to generate. Must be between 1 and 10."
+ },
+ "response_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "url",
+ "b64_json"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
+ },
+ "size": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "256x256",
+ "512x512",
+ "1024x1024"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`."
+ },
+ "user": {
+ "type": "string",
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
+ }
+ },
+ "required": [
+ "image"
+ ]
+ },
+ "OpenAI.CreateMessageRequest": {
+ "type": "object",
+ "required": [
+ "role",
+ "content"
+ ],
+ "properties": {
+ "role": {
"type": "string",
- "description": "The name of the evaluation."
+ "enum": [
+ "user",
+ "assistant"
+ ],
+ "description": "The role of the entity that is creating the message. Allowed values include:\n - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.\n - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation."
},
- "data_source_config": {
+ "content": {
"oneOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig"
- },
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessageContentImageFileObject"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MessageContentImageUrlObject"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MessageRequestContentTextObject"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "attachments": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateMessageRequestAttachments"
+ }
},
{
- "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ "type": "null"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
},
{
- "$ref": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ "type": "null"
}
- ],
- "description": "Configuration of data sources used in runs of the evaluation."
+ ]
+ }
+ }
+ },
+ "OpenAI.CreateMessageRequestAttachments": {
+ "type": "object",
+ "properties": {
+ "file_id": {
+ "type": "string"
},
- "testing_criteria": {
+ "tools": {
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsCode"
},
{
- "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly"
}
]
- },
- "description": "A list of testing criteria."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) for when the eval was created."
+ }
+ }
+ }
+ },
+ "OpenAI.CreateModerationRequest": {
+ "type": "object",
+ "required": [
+ "input"
+ ],
+ "properties": {
+ "input": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequestInput"
+ }
+ }
+ ],
+ "description": "Input (or inputs) to classify. Can be a single string, an array of strings, or\n an array of multi-modal input objects similar to other models."
},
- "metadata": {
+ "model": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "type": "string"
},
{
- "type": "null"
+ "type": "string",
+ "enum": [
+ "omni-moderation-latest",
+ "omni-moderation-2024-09-26",
+ "text-moderation-latest",
+ "text-moderation-stable"
+ ]
}
- ]
- },
- "modified_at": {
- "$ref": "#/components/schemas/integer",
- "description": "Unix timestamp (in seconds) when the evaluation run was last modified."
- },
- "created_by": {
- "type": "string",
- "description": "the name of the person who created the run."
- },
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ ],
+ "description": "The content moderation model you would like to use. Learn more in\n [the moderation guide](/docs/guides/moderation), and learn about\n available models [here](/docs/models#moderation).",
+ "x-oaiTypeLabel": "string",
+ "default": "omni-moderation-latest"
}
- },
- "description": "An Eval object with a data source config and testing criteria.\nAn Eval represents a task to be done for your LLM integration.\nLike:\n- Improve the quality of my chatbot\n- See how well my chatbot handles customer support\n- Check if o4-mini is better at my usecase than gpt-4o",
- "title": "Eval",
- "x-oaiMeta": {
- "name": "The eval object",
- "group": "evals",
- "example": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\"type\": \"string\"},\n },\n \"required\": [\"label\"]\n },\n \"include_sample_schema\": true\n },\n \"testing_criteria\": [\n {\n \"name\": \"My string check grader\",\n \"type\": \"string_check\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\",\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {\n \"test\": \"synthetics\",\n }\n}\n"
}
},
- "EvalCsvFileIdSource": {
+ "OpenAI.CreateModerationRequestInput": {
"type": "object",
"required": [
- "type",
- "id"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "file_id"
- ],
- "description": "The type of source, always `file_id`."
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequestInputType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "image_url": "#/components/schemas/OpenAI.ModerationImageURLInput",
+ "text": "#/components/schemas/OpenAI.ModerationTextInput"
+ }
+ }
+ },
+ "OpenAI.CreateModerationRequestInputType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "id": {
+ {
"type": "string",
- "description": "The identifier of the uploaded CSV file."
+ "enum": [
+ "image_url",
+ "text"
+ ]
}
- },
- "description": "Represents a reference to an uploaded CSV file used as a source for evaluation data."
+ ]
},
- "EvalCsvRunDataSource": {
+ "OpenAI.CreateModerationResponse": {
"type": "object",
"required": [
- "type",
- "source"
+ "id",
+ "model",
+ "results"
],
"properties": {
- "type": {
+ "id": {
"type": "string",
- "enum": [
- "csv"
- ],
- "description": "The type of data source, always `csv`."
+ "description": "The unique identifier for the moderation request."
},
- "source": {
- "$ref": "#/components/schemas/EvalCsvFileIdSource",
- "description": "The source of the CSV data, either inline content or a file reference."
+ "model": {
+ "type": "string",
+ "description": "The model used to generate the moderation results."
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponseResults"
+ },
+ "description": "A list of moderation objects."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/EvalRunDataSource"
- }
+ "description": "Represents if a given text input is potentially harmful.",
+ "x-oaiMeta": {
+ "name": "The moderation object",
+ "example": "{\n \"id\": \"modr-0d9740456c391e43c445bf0f010940c7\",\n \"model\": \"omni-moderation-latest\",\n \"results\": [\n {\n \"flagged\": true,\n \"categories\": {\n \"harassment\": true,\n \"harassment/threatening\": true,\n \"sexual\": false,\n \"hate\": false,\n \"hate/threatening\": false,\n \"illicit\": false,\n \"illicit/violent\": false,\n \"self-harm/intent\": false,\n \"self-harm/instructions\": false,\n \"self-harm\": false,\n \"sexual/minors\": false,\n \"violence\": true,\n \"violence/graphic\": true\n },\n \"category_scores\": {\n \"harassment\": 0.8189693396524255,\n \"harassment/threatening\": 0.804985420696006,\n \"sexual\": 1.573112165348997e-6,\n \"hate\": 0.007562942636942845,\n \"hate/threatening\": 0.004208854591835476,\n \"illicit\": 0.030535955153511665,\n \"illicit/violent\": 0.008925306722380033,\n \"self-harm/intent\": 0.00023023930975076432,\n \"self-harm/instructions\": 0.0002293869201073356,\n \"self-harm\": 0.012598046106750154,\n \"sexual/minors\": 2.212566909570261e-8,\n \"violence\": 0.9999992735124786,\n \"violence/graphic\": 0.843064871157054\n },\n \"category_applied_input_types\": {\n \"harassment\": [\n \"text\"\n ],\n \"harassment/threatening\": [\n \"text\"\n ],\n \"sexual\": [\n \"text\",\n \"image\"\n ],\n \"hate\": [\n \"text\"\n ],\n \"hate/threatening\": [\n \"text\"\n ],\n \"illicit\": [\n \"text\"\n ],\n \"illicit/violent\": [\n \"text\"\n ],\n \"self-harm/intent\": [\n \"text\",\n \"image\"\n ],\n \"self-harm/instructions\": [\n \"text\",\n \"image\"\n ],\n \"self-harm\": [\n \"text\",\n \"image\"\n ],\n \"sexual/minors\": [\n \"text\"\n ],\n \"violence\": [\n \"text\",\n \"image\"\n ],\n \"violence/graphic\": [\n \"text\",\n \"image\"\n ]\n }\n }\n ]\n}\n"
+ }
+ },
+ "OpenAI.CreateModerationResponseResults": {
+ "type": "object",
+ "required": [
+ "flagged",
+ "categories",
+ "category_scores",
+ "category_applied_input_types"
],
- "description": "Represents a CSV data source for evaluation runs."
+ "properties": {
+ "flagged": {
+ "type": "boolean"
+ },
+ "categories": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponseResultsCategories"
+ },
+ "category_scores": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponseResultsCategoryScores"
+ },
+ "category_applied_input_types": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponseResultsCategoryAppliedInputTypes"
+ }
+ }
},
- "EvalResult": {
+ "OpenAI.CreateModerationResponseResultsCategories": {
"type": "object",
"required": [
- "name",
- "type",
- "score",
- "passed"
+ "hate",
+ "hate/threatening",
+ "harassment",
+ "harassment/threatening",
+ "illicit",
+ "illicit/violent",
+ "self-harm",
+ "self-harm/intent",
+ "self-harm/instructions",
+ "sexual",
+ "sexual/minors",
+ "violence",
+ "violence/graphic"
],
"properties": {
- "name": {
- "type": "string",
- "description": "name of the check"
+ "hate": {
+ "type": "boolean"
},
- "type": {
- "type": "string",
- "description": "type of the check"
+ "hate/threatening": {
+ "type": "boolean"
},
- "score": {
- "type": "number",
- "format": "float",
- "description": "score"
+ "harassment": {
+ "type": "boolean"
},
- "passed": {
- "type": "boolean",
- "description": "indicates if the check passed or failed"
+ "harassment/threatening": {
+ "type": "boolean"
+ },
+ "illicit": {
+ "type": "boolean"
+ },
+ "illicit/violent": {
+ "type": "boolean"
+ },
+ "self-harm": {
+ "type": "boolean"
+ },
+ "self-harm/intent": {
+ "type": "boolean"
+ },
+ "self-harm/instructions": {
+ "type": "boolean"
+ },
+ "sexual": {
+ "type": "boolean"
+ },
+ "sexual/minors": {
+ "type": "boolean"
+ },
+ "violence": {
+ "type": "boolean"
+ },
+ "violence/graphic": {
+ "type": "boolean"
}
- },
- "description": "Result of the evaluation.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "EvalRun": {
+ "OpenAI.CreateModerationResponseResultsCategoryAppliedInputTypes": {
"type": "object",
"required": [
- "object",
- "id",
- "eval_id",
- "status",
- "model",
- "name",
- "created_at",
- "report_url",
- "result_counts",
- "per_model_usage",
- "per_testing_criteria_results",
- "data_source",
- "metadata",
- "error"
+ "hate",
+ "hate/threatening",
+ "harassment",
+ "harassment/threatening",
+ "illicit",
+ "illicit/violent",
+ "self-harm",
+ "self-harm/intent",
+ "self-harm/instructions",
+ "sexual",
+ "sexual/minors",
+ "violence",
+ "violence/graphic"
],
"properties": {
- "object": {
- "type": "string",
- "enum": [
- "eval.run"
- ],
- "description": "The type of the object. Always \"eval.run\".",
- "x-stainless-const": true,
- "default": "eval.run"
+ "hate": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "id": {
- "type": "string",
- "description": "Unique identifier for the evaluation run."
+ "hate/threatening": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "eval_id": {
- "type": "string",
- "description": "The identifier of the associated evaluation."
+ "harassment": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "status": {
- "type": "string",
- "description": "The status of the evaluation run."
+ "harassment/threatening": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "model": {
- "type": "string",
- "description": "The model that is evaluated, if applicable."
+ "illicit": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "name": {
- "type": "string",
- "description": "The name of the evaluation run."
+ "illicit/violent": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) when the evaluation run was created."
+ "self-harm": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
},
- "report_url": {
- "type": "string",
- "format": "uri",
- "description": "The URL to the rendered evaluation run report on the UI dashboard."
+ "self-harm/intent": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
},
- "result_counts": {
- "$ref": "#/components/schemas/OpenAI.EvalRunResultCounts",
- "description": "Counters summarizing the outcomes of the evaluation run."
+ "self-harm/instructions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
},
- "per_model_usage": {
+ "sexual": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.EvalRunPerModelUsage"
- },
- "description": "Usage statistics for each model during the evaluation run."
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
},
- "per_testing_criteria_results": {
+ "sexual/minors": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults"
- },
- "description": "Results per testing criteria applied during the evaluation run."
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "data_source": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource"
- },
- {
- "$ref": "#/components/schemas/EvalRunDataSource"
- }
- ],
- "description": "Information about the run's data source."
+ "violence": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
},
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
+ "violence/graphic": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
+ }
+ }
+ },
+ "OpenAI.CreateModerationResponseResultsCategoryScores": {
+ "type": "object",
+ "required": [
+ "hate",
+ "hate/threatening",
+ "harassment",
+ "harassment/threatening",
+ "illicit",
+ "illicit/violent",
+ "self-harm",
+ "self-harm/intent",
+ "self-harm/instructions",
+ "sexual",
+ "sexual/minors",
+ "violence",
+ "violence/graphic"
+ ],
+ "properties": {
+ "hate": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "hate/threatening": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "harassment": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "harassment/threatening": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "illicit": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "illicit/violent": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "self-harm": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "self-harm/intent": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "self-harm/instructions": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "sexual": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "sexual/minors": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "violence": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "violence/graphic": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ }
+ },
+ "OpenAI.CreateResponseStreamingResponse": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCreatedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseErrorEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFailedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseIncompleteEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseTextDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent"
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.EvalApiError"
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent"
},
- "modified_at": {
- "$ref": "#/components/schemas/integer",
- "description": "Unix timestamp (in seconds) when the evaluation run was last modified."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent"
},
- "created_by": {
- "type": "string",
- "description": "the name of the person who created the run."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent"
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent"
},
- "evaluation_level": {
- "$ref": "#/components/schemas/EvaluationLevel",
- "description": "The level at which evaluation is performed. Defaults to 'turn' if not specified.",
- "default": "turn"
- }
- },
- "description": "A schema representing an evaluation run.",
- "title": "EvalRun",
- "x-oaiMeta": {
- "name": "The eval run object",
- "group": "evals",
- "example": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67e57965b480819094274e3a32235e4c\",\n \"eval_id\": \"eval_67e579652b548190aaa83ada4b125f47\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
- }
- },
- "EvalRunDataSource": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "description": "The data source type discriminator."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "azure_ai_traces_preview": "#/components/schemas/TracesPreviewEvalRunDataSource",
- "azure_ai_synthetic_data_gen_preview": "#/components/schemas/SyntheticDataGenerationPreviewEvalRunDataSource",
- "azure_ai_responses": "#/components/schemas/AzureAIResponsesEvalRunDataSource",
- "azure_ai_target_completions": "#/components/schemas/TargetCompletionEvalRunDataSource",
- "csv": "#/components/schemas/EvalCsvRunDataSource",
- "azure_ai_red_team": "#/components/schemas/RedTeamEvalRunDataSource",
- "azure_ai_trace_data_source_preview": "#/components/schemas/AzureAITraceDataSourcePreviewEvalRunDataSource",
- "azure_ai_benchmark_preview": "#/components/schemas/AzureAIBenchmarkPreviewEvalRunDataSource"
- }
- },
- "description": "Base class for run data sources with discriminator support."
- },
- "EvalRunOutputItem": {
- "type": "object",
- "required": [
- "object",
- "id",
- "run_id",
- "eval_id",
- "created_at",
- "status",
- "datasource_item_id",
- "datasource_item",
- "results",
- "sample"
- ],
- "properties": {
- "object": {
- "type": "string",
- "enum": [
- "eval.run.output_item"
- ],
- "description": "The type of the object. Always \"eval.run.output_item\".",
- "x-stainless-const": true,
- "default": "eval.run.output_item"
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent"
},
- "id": {
- "type": "string",
- "description": "Unique identifier for the evaluation run output item."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent"
},
- "run_id": {
- "type": "string",
- "description": "The identifier of the evaluation run associated with this output item."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent"
},
- "eval_id": {
- "type": "string",
- "description": "The identifier of the evaluation group."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent"
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) when the evaluation run was created."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseQueuedEvent"
},
- "status": {
- "type": "string",
- "description": "The status of the evaluation run."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent"
},
- "datasource_item_id": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The identifier for the data source item."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseAudioDoneEvent"
},
- "datasource_item": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Details of the input data source item."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent"
},
- "results": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunOutputItemResult"
- },
- "description": "A list of grader results for this output item."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent"
},
- "sample": {
- "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSample",
- "description": "A sample containing the input and output of the evaluation run."
- }
- },
- "description": "A schema representing an evaluation run output item.",
- "title": "EvalRunOutputItem",
- "x-oaiMeta": {
- "name": "The eval run output item object",
- "group": "evals",
- "example": "{\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"created_at\": 1739314509,\n \"status\": \"pass\",\n \"datasource_item_id\": 137,\n \"datasource_item\": {\n \"teacher\": \"To grade essays, I only check for style, content, and grammar.\",\n \"student\": \"I am a student who is trying to write the best essay.\"\n },\n \"results\": [\n {\n \"name\": \"String Check Grader\",\n \"type\": \"string-check-grader\",\n \"score\": 1.0,\n \"passed\": true,\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"You are an evaluator bot...\"\n },\n {\n \"role\": \"user\",\n \"content\": \"You are assessing...\"\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"The rubric is not clear nor concise.\"\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"total_tokens\": 521,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 519,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n}\n"
- }
- },
- "EvalRunOutputItemResult": {
- "type": "object",
- "required": [
- "name",
- "score",
- "passed"
- ],
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the grader."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent"
},
- "type": {
- "type": "string",
- "description": "The grader type (for example, \"string-check-grader\")."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCompletedEvent"
},
- "score": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The numeric score produced by the grader."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseContentPartDoneEvent"
},
- "passed": {
- "type": "boolean",
- "description": "Whether the grader considered the output a pass."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent"
},
- "sample": {
- "anyOf": [
- {
- "type": "object",
- "unevaluatedProperties": {}
- },
- {
- "type": "null"
- }
- ],
- "description": "Optional sample or intermediate data produced by the grader."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent"
},
- "status": {
- "$ref": "#/components/schemas/EvalRunOutputItemResultStatus",
- "description": "The evaluation status for this result item. Values: \"completed\", \"errored\", \"skipped\". Null if not provided by evaluator. When status is skipped, passed/score can be ignored."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseOutputItemDoneEvent"
},
- "metric": {
- "type": "string",
- "description": "The name of the metric (e.g., \"fluency\", \"f1_score\")."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent"
},
- "label": {
- "type": "string",
- "description": "The label associated with the test criteria metric (e.g., \"pass\", \"fail\", \"good\", \"bad\")."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent"
},
- "threshold": {
- "type": "number",
- "format": "float",
- "description": "The threshold used to determine pass/fail for this test criteria, if it is numerical."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent"
},
- "reason": {
- "type": "string",
- "description": "The reason for the test criteria metric."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseRefusalDoneEvent"
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Additional details about the test criteria metric."
- }
- },
- "unevaluatedProperties": {},
- "description": "A single grader result for an evaluation run output item.",
- "title": "EvalRunOutputItemResult"
- },
- "EvalRunOutputItemResultStatus": {
- "anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ResponseTextDoneEvent"
},
{
- "type": "string",
- "enum": [
- "completed",
- "errored",
- "skipped"
- ]
- }
- ],
- "description": "The evaluation status for an evaluation run output item result."
- },
- "EvalRunOutputItemSampleInput": {
- "type": "object",
- "required": [
- "role",
- "content",
- "tool_calls"
- ],
- "properties": {
- "role": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent"
},
- "content": {
- "type": "string"
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent"
},
- "tool_calls": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/CompletionMessageToolCallChunk"
- },
- "description": "Tool calls made within the message, if any."
- }
- },
- "description": "A message in the evaluation run."
- },
- "EvalRunOutputItemSampleOutput": {
- "type": "object",
- "required": [
- "tool_calls"
- ],
- "properties": {
- "role": {
- "type": "string"
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent"
},
- "content": {
- "type": "string"
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent"
},
- "tool_calls": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/CompletionMessageToolCallChunk"
- },
- "description": "Tool calls made within the message, if any."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent"
}
- },
- "description": "A message in the evaluation run."
+ ]
},
- "EvalRunResultCompareItem": {
+ "OpenAI.CreateRunRequest": {
"type": "object",
"required": [
- "treatmentRunId",
- "treatmentRunSummary",
- "deltaEstimate",
- "pValue",
- "treatmentEffect"
+ "assistant_id"
],
"properties": {
- "treatmentRunId": {
+ "assistant_id": {
"type": "string",
- "description": "The treatment run ID."
+ "description": "The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run."
},
- "treatmentRunSummary": {
- "$ref": "#/components/schemas/EvalRunResultSummary",
- "description": "Summary statistics of the treatment run."
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantSupportedModels"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The ID of the [Model](/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.",
+ "x-oaiTypeLabel": "string"
},
- "deltaEstimate": {
- "type": "number",
- "format": "float",
- "description": "Estimated difference between treatment and baseline."
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "pValue": {
- "type": "number",
- "format": "float",
- "description": "P-value for the treatment effect."
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis."
},
- "treatmentEffect": {
- "$ref": "#/components/schemas/TreatmentEffectType",
- "description": "Type of treatment effect."
- }
- },
- "description": "Metric comparison for a treatment against the baseline.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "EvalRunResultComparison": {
- "type": "object",
- "required": [
- "testingCriteria",
- "metric",
- "evaluator",
- "baselineRunSummary",
- "compareItems"
- ],
- "properties": {
- "testingCriteria": {
- "type": "string",
- "description": "Name of the testing criteria."
+ "additional_instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
},
- "metric": {
- "type": "string",
- "description": "Metric being evaluated."
+ "additional_messages": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateMessageRequest"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Adds additional messages to the thread before creating the run."
},
- "evaluator": {
- "type": "string",
- "description": "Name of the evaluator for this testing criteria."
+ "tools": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "maxItems": 20,
+ "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis."
},
- "baselineRunSummary": {
- "$ref": "#/components/schemas/EvalRunResultSummary",
- "description": "Summary statistics of the baseline run."
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "compareItems": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunResultCompareItem"
- },
- "description": "List of comparison results for each treatment run."
- }
- },
- "description": "Comparison results for treatment runs against the baseline.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "EvalRunResultSummary": {
- "type": "object",
- "required": [
- "runId",
- "sampleCount",
- "average",
- "standardDeviation"
- ],
- "properties": {
- "runId": {
- "type": "string",
- "description": "The evaluation run ID."
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 2,
+ "description": "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.",
+ "default": 1
},
- "sampleCount": {
- "type": "integer",
- "format": "int32",
- "description": "Number of samples in the evaluation run."
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 1,
+ "description": "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.\n We generally recommend altering this or temperature but not both.",
+ "default": 1
},
- "average": {
- "type": "number",
- "format": "float",
- "description": "Average value of the metric in the evaluation run."
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
},
- "standardDeviation": {
- "type": "number",
- "format": "float",
- "description": "Standard deviation of the metric in the evaluation run."
- }
- },
- "description": "Summary statistics of a metric in an evaluation run.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "EvaluationComparisonInsightRequest": {
- "type": "object",
- "required": [
- "type",
- "evalId",
- "baselineRunId",
- "treatmentRunIds"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "EvaluationComparison"
+ "max_prompt_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of request."
+ "minimum": 256,
+ "description": "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."
},
- "evalId": {
- "type": "string",
- "description": "Identifier for the evaluation."
+ "max_completion_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "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."
},
- "baselineRunId": {
- "type": "string",
- "description": "The baseline run ID for comparison."
+ "truncation_strategy": {
+ "$ref": "#/components/schemas/OpenAI.TruncationObject"
},
- "treatmentRunIds": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "List of treatment run IDs for comparison."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/InsightRequest"
+ "tool_choice": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption"
+ },
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
+ "default": true
+ },
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
}
- ],
- "description": "Evaluation Comparison Request",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "EvaluationComparisonInsightResult": {
+ "OpenAI.CreateSpeechRequest": {
"type": "object",
"required": [
- "type",
- "comparisons",
- "method"
+ "model",
+ "input",
+ "voice"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "EvaluationComparison"
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "tts-1",
+ "tts-1-hd",
+ "gpt-4o-mini-tts",
+ "gpt-4o-mini-tts-2025-12-15"
+ ]
+ }
],
- "description": "The type of insights result."
+ "description": "One of the available [TTS models](/docs/models#tts): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.",
+ "x-oaiTypeLabel": "string"
},
- "comparisons": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunResultComparison"
- },
- "description": "Comparison results for each treatment run against the baseline."
+ "input": {
+ "type": "string",
+ "maxLength": 4096,
+ "description": "The text to generate audio for. The maximum length is 4096 characters."
},
- "method": {
+ "instructions": {
"type": "string",
- "description": "The statistical method used for comparison."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/InsightResult"
- }
- ],
- "description": "Insights from the evaluation comparison.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "EvaluationLevel": {
- "anyOf": [
- {
+ "maxLength": 4096,
+ "description": "Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`."
+ },
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsOrCustomVoice",
+ "description": "The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ \"id\": \"voice_1234\" }`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech#voice-options)."
+ },
+ "response_format": {
"type": "string",
"enum": [
- "turn",
- "conversation"
- ]
+ "mp3",
+ "opus",
+ "aac",
+ "flac",
+ "wav",
+ "pcm"
+ ],
+ "description": "The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.",
+ "default": "mp3"
},
- {
- "type": "string"
- }
- ],
- "description": "The level at which evaluation is performed."
- },
- "EvaluationResultSample": {
- "type": "object",
- "required": [
- "type",
- "evaluationResult"
- ],
- "properties": {
- "type": {
+ "speed": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0.25,
+ "maximum": 4,
+ "description": "The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.",
+ "default": 1
+ },
+ "stream_format": {
"type": "string",
"enum": [
- "EvaluationResultSample"
+ "sse",
+ "audio"
],
- "description": "Evaluation Result Sample Type"
- },
- "evaluationResult": {
- "$ref": "#/components/schemas/EvalResult",
- "description": "Evaluation result for the analysis sample."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/InsightSample"
+ "description": "The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.",
+ "default": "audio"
}
- ],
- "description": "A sample from the evaluation result.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "EvaluationRule": {
+ "OpenAI.CreateThreadAndRunRequest": {
"type": "object",
"required": [
- "id",
- "action",
- "eventType",
- "enabled",
- "systemData"
+ "assistant_id"
],
"properties": {
- "id": {
- "type": "string",
- "description": "Unique identifier for the evaluation rule.",
- "readOnly": true
- },
- "displayName": {
- "type": "string",
- "description": "Display Name for the evaluation rule."
- },
- "description": {
+ "assistant_id": {
"type": "string",
- "description": "Description for the evaluation rule."
+ "description": "The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run."
},
- "action": {
- "$ref": "#/components/schemas/EvaluationRuleAction",
- "description": "Definition of the evaluation rule action.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "thread": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequest"
},
- "filter": {
- "$ref": "#/components/schemas/EvaluationRuleFilter",
- "description": "Filter condition of the evaluation rule."
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "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"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The ID of the [Model](/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.",
+ "x-oaiTypeLabel": "string"
},
- "eventType": {
- "$ref": "#/components/schemas/EvaluationRuleEventType",
- "description": "Event type that the evaluation rule applies to."
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis."
},
- "enabled": {
- "type": "boolean",
- "description": "Indicates whether the evaluation rule is enabled. Default is true."
+ "tools": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "maxItems": 20,
+ "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis."
},
- "systemData": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "System metadata for the evaluation rule.",
- "readOnly": true
- }
- },
- "description": "Evaluation rule model."
- },
- "EvaluationRuleAction": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/EvaluationRuleActionType",
- "description": "Type of the evaluation action."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "continuousEvaluation": "#/components/schemas/ContinuousEvaluationRuleAction",
- "humanEvaluationPreview": "#/components/schemas/HumanEvaluationPreviewRuleAction"
- }
- },
- "description": "Evaluation action model."
- },
- "EvaluationRuleActionType": {
- "anyOf": [
- {
- "type": "string"
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
},
- {
- "type": "string",
- "enum": [
- "continuousEvaluation",
- "humanEvaluationPreview"
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
]
- }
- ],
- "description": "Type of the evaluation action."
- },
- "EvaluationRuleEventType": {
- "anyOf": [
- {
- "type": "string"
},
- {
- "type": "string",
- "enum": [
- "responseCompleted",
- "manual"
- ]
- }
- ],
- "description": "Type of the evaluation rule event."
- },
- "EvaluationRuleFilter": {
- "type": "object",
- "required": [
- "agentName"
- ],
- "properties": {
- "agentName": {
- "type": "string",
- "description": "Filter by agent name."
- }
- },
- "description": "Evaluation filter model."
- },
- "EvaluationRunClusterInsightRequest": {
- "type": "object",
- "required": [
- "type",
- "evalId",
- "runIds"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "EvaluationRunClusterInsight"
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of insights request."
+ "minimum": 0,
+ "maximum": 2,
+ "description": "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.",
+ "default": 1
},
- "evalId": {
- "type": "string",
- "description": "Evaluation Id for the insights."
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 1,
+ "description": "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.\n We generally recommend altering this or temperature but not both.",
+ "default": 1
},
- "runIds": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "List of evaluation run IDs for the insights."
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
},
- "modelConfiguration": {
- "$ref": "#/components/schemas/InsightModelConfiguration",
- "description": "Configuration of the model used in the insight generation."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/InsightRequest"
- }
- ],
- "description": "Insights on set of Evaluation Results",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "EvaluationRunClusterInsightResult": {
- "type": "object",
- "required": [
- "type",
- "clusterInsight"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "EvaluationRunClusterInsight"
+ "max_prompt_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of insights result."
+ "minimum": 256,
+ "description": "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."
},
- "clusterInsight": {
- "$ref": "#/components/schemas/ClusterInsightResult"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/InsightResult"
+ "max_completion_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "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."
+ },
+ "truncation_strategy": {
+ "$ref": "#/components/schemas/OpenAI.TruncationObject"
+ },
+ "tool_choice": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption"
+ },
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
+ "default": true
+ },
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
}
- ],
- "description": "Insights from the evaluation run cluster analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "EvaluationScheduleTask": {
+ "OpenAI.CreateThreadAndRunRequestToolResources": {
"type": "object",
- "required": [
- "type",
- "evalId",
- "evalRun"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "Evaluation"
- ]
- },
- "evalId": {
- "type": "string",
- "description": "Identifier of the evaluation group."
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter"
},
- "evalRun": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The evaluation run payload."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/ScheduleTask"
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch"
}
- ],
- "description": "Evaluation task for the schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
}
},
- "EvaluationTaxonomy": {
+ "OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter": {
"type": "object",
- "required": [
- "name",
- "version",
- "taxonomyInput"
- ],
"properties": {
- "id": {
- "type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
- },
- "name": {
- "type": "string",
- "description": "The name of the resource",
- "readOnly": true
- },
- "version": {
- "type": "string",
- "description": "The version of the resource",
- "readOnly": true
- },
- "taxonomyInput": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInput",
- "description": "Input configuration for the evaluation taxonomy."
- },
- "taxonomyCategories": {
+ "file_ids": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/TaxonomyCategory"
- },
- "description": "List of taxonomy categories."
- },
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
"type": "string"
},
- "description": "Additional properties for the evaluation taxonomy."
+ "maxItems": 20,
+ "default": []
}
- },
- "description": "Evaluation Taxonomy Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
- },
- "EvaluationTaxonomyCreateOrUpdate": {
- "type": "object",
- "required": [
- "taxonomyInput"
- ],
- "properties": {
- "description": {
- "type": "string",
- "description": "The asset description text."
- },
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
- },
- "taxonomyInput": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInput",
- "description": "Input configuration for the evaluation taxonomy."
- },
- "taxonomyCategories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/TaxonomyCategory"
- },
- "description": "List of taxonomy categories."
- },
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
+ },
+ "OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch": {
+ "type": "object",
+ "properties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
"type": "string"
},
- "description": "Additional properties for the evaluation taxonomy."
+ "maxItems": 1
}
- },
- "description": "Evaluation Taxonomy Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationTaxonomyInput": {
+ "OpenAI.CreateThreadRequest": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInputType",
- "description": "Input type of the evaluation taxonomy."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "agent": "#/components/schemas/AgentTaxonomyInput"
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateMessageRequest"
+ },
+ "description": "A list of [messages](/docs/api-reference/messages) to start the thread with."
+ },
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "Input configuration for the evaluation taxonomy.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "Options to create a new thread. If no thread is provided when running a\nrequest, an empty thread will be created."
},
- "EvaluationTaxonomyInputType": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.CreateThreadRequestToolResources": {
+ "type": "object",
+ "properties": {
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesCodeInterpreter"
},
- {
- "type": "string",
- "enum": [
- "agent",
- "policy"
- ]
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearch"
}
- ],
- "description": "Type of the evaluation taxonomy input.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationTaxonomyInputUpdate": {
+ "OpenAI.CreateThreadRequestToolResourcesCodeInterpreter": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInputType",
- "description": "Input type of the evaluation taxonomy."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "agent": "#/components/schemas/AgentTaxonomyInputUpdate"
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 20
}
- },
- "description": "Input configuration for the evaluation taxonomy.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationTaxonomyUpdate": {
+ "OpenAI.CreateThreadRequestToolResourcesFileSearch": {
"type": "object",
"properties": {
- "description": {
- "type": "string",
- "description": "The asset description text."
- },
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
"type": "string"
},
- "description": "Tag dictionary. Tags can be added, removed, and updated."
- },
- "taxonomyInput": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInputUpdate",
- "description": "Input configuration for the evaluation taxonomy."
+ "maxItems": 1
},
- "taxonomyCategories": {
+ "vector_stores": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/TaxonomyCategory"
- },
- "description": "List of taxonomy categories."
- },
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores"
},
- "description": "Additional properties for the evaluation taxonomy."
+ "maxItems": 1
}
- },
- "description": "Evaluation Taxonomy Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorCategory": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 100000000
},
- {
- "type": "string",
- "enum": [
- "quality",
- "safety",
- "agents"
+ "chunking_strategy": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
]
}
- ],
- "description": "The category of the evaluator",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorCredentialRequest": {
+ "OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto": {
"type": "object",
"required": [
- "blob_uri"
+ "type"
],
"properties": {
- "blob_uri": {
+ "type": {
"type": "string",
- "format": "uri",
- "description": "The blob URI for the evaluator storage. Example: `https://account.blob.core.windows.net:443/container`"
+ "enum": [
+ "auto"
+ ],
+ "x-stainless-const": true
}
- },
- "description": "Request body for getting evaluator credentials",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorDefinition": {
+ "OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic": {
"type": "object",
"required": [
- "type"
+ "type",
+ "static"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/EvaluatorDefinitionType",
- "description": "The type of evaluator definition"
- },
- "init_parameters": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters like type, properties, required."
- },
- "data_schema": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like type, properties, required."
- },
- "metrics": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/EvaluatorMetric"
- },
- "description": "List of output metrics produced by this evaluator"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "code": "#/components/schemas/CodeBasedEvaluatorDefinition",
- "prompt": "#/components/schemas/PromptBasedEvaluatorDefinition",
- "rubric": "#/components/schemas/RubricBasedEvaluatorDefinition",
- "endpoint": "#/components/schemas/EndpointBasedEvaluatorDefinition"
- }
- },
- "description": "Base evaluator configuration with discriminator",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluatorDefinitionType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
"type": "string",
"enum": [
- "prompt",
- "code",
- "prompt_and_code",
- "service",
- "openai_graders",
- "rubric",
- "endpoint"
- ]
+ "static"
+ ],
+ "x-stainless-const": true
+ },
+ "static": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic"
}
- ],
- "description": "The type of evaluator definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorGenerationArtifacts": {
+ "OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic": {
"type": "object",
"required": [
- "dataset",
- "kinds"
+ "max_chunk_size_tokens",
+ "chunk_overlap_tokens"
],
"properties": {
- "dataset": {
- "$ref": "#/components/schemas/DatasetReference",
- "description": "Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to `EvaluatorVersion.version`) holding all artifacts produced by the generation pipeline. Each row in the JSONL carries a `kind` field discriminating its content (e.g. `spec`, `tools`, `context`)."
+ "max_chunk_size_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 100,
+ "maximum": 4096
},
- "kinds": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The kinds of rows present in `dataset`. Always contains `\"spec\"` (the generated evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain `\"tools\"` (when the generation pipeline produced or inferred OpenAI tool schemas) and/or `\"context\"` (when supplementary materials such as file uploads or trace samples were used during generation)."
+ "chunk_overlap_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- },
- "description": "Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorGenerationInputs": {
+ "OpenAI.CreateTranscriptionRequest": {
"type": "object",
- "required": [
- "sources",
- "model",
- "evaluator_name"
- ],
"properties": {
- "sources": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
- },
- "description": "Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry is an `EvaluatorGenerationJobSource` variant discriminated by `type`."
+ "file": {
+ "description": "The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.",
+ "x-oaiTypeLabel": "file"
},
"model": {
- "type": "string",
- "description": "The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide their own model rather than relying on service-owned capacity."
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "whisper-1",
+ "gpt-4o-transcribe",
+ "gpt-4o-mini-transcribe",
+ "gpt-4o-mini-transcribe-2025-12-15",
+ "gpt-4o-transcribe-diarize"
+ ]
+ }
+ ],
+ "description": "ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`.",
+ "x-oaiTypeLabel": "string"
},
- "evaluator_name": {
+ "language": {
"type": "string",
- "minLength": 1,
- "maxLength": 256,
- "pattern": "^[A-Za-z0-9_.~-]+$",
- "description": "The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII letters, digits, underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` is reserved for system-managed evaluators and is rejected by the service. If an evaluator with this name already exists in the project (and is rubric-subtype), the service creates a new version under the same name and uses the prior version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive loop). Old versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`."
+ "description": "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."
},
- "evaluator_display_name": {
+ "prompt": {
"type": "string",
- "description": "Optional human-friendly display name for the resulting evaluator. Surfaced as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier."
+ "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`."
},
- "evaluator_description": {
- "type": "string",
- "description": "Optional human-friendly description for the resulting evaluator. Surfaced as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related models."
- }
- },
- "description": "Caller-supplied inputs for an evaluator generation job.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluatorGenerationJob": {
- "type": "object",
- "required": [
- "id",
- "status",
- "created_at"
- ],
- "properties": {
- "id": {
- "type": "string",
- "description": "Server-assigned unique identifier.",
- "readOnly": true
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.AudioResponseFormat"
},
- "inputs": {
- "$ref": "#/components/schemas/EvaluatorGenerationInputs",
- "description": "Caller-supplied inputs."
+ "temperature": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "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."
},
- "result": {
- "$ref": "#/components/schemas/EvaluatorVersion",
- "description": "Result produced on success.",
- "readOnly": true
+ "include": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptionInclude"
+ },
+ "description": "Additional information to include in the transcription response.\n `logprobs` will return the log probabilities of the tokens in the\n response to understand the model's confidence in the transcription.\n `logprobs` only works with response_format set to `json` and only with\n the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`."
},
- "status": {
- "$ref": "#/components/schemas/JobStatus",
- "description": "Current lifecycle status.",
- "readOnly": true
+ "timestamp_granularities": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "word",
+ "segment"
+ ]
+ },
+ "description": "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.\n This option is not available for `gpt-4o-transcribe-diarize`."
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error",
- "description": "Error details — populated only on failure.",
- "readOnly": true
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).",
- "readOnly": true
+ "chunking_strategy": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.VadConfig"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "finished_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).",
- "readOnly": true
+ "known_speaker_names": {
+ "$ref": "#/components/schemas/OpenAI.KnownSpeakerNames"
},
- "usage": {
- "$ref": "#/components/schemas/EvaluatorGenerationTokenUsage",
- "description": "Token consumption summary. Populated when the job reaches a terminal state.",
- "readOnly": true
- }
- },
- "description": "Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluatorGenerationJobCreate": {
- "type": "object",
- "properties": {
- "inputs": {
- "$ref": "#/components/schemas/EvaluatorGenerationInputs",
- "description": "Caller-supplied inputs."
+ "known_speaker_references": {
+ "$ref": "#/components/schemas/OpenAI.KnownSpeakerReferences"
}
},
- "description": "Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "required": [
+ "file",
+ "model"
+ ]
},
- "EvaluatorGenerationJobSource": {
+ "OpenAI.CreateTranscriptionResponseDiarizedJson": {
"type": "object",
"required": [
- "type"
+ "task",
+ "duration",
+ "text",
+ "segments"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/EvaluatorGenerationJobSourceType",
- "description": "The type of source."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "prompt": "#/components/schemas/PromptEvaluatorGenerationJobSource",
- "agent": "#/components/schemas/AgentEvaluatorGenerationJobSource",
- "traces": "#/components/schemas/TracesEvaluatorGenerationJobSource",
- "dataset": "#/components/schemas/DatasetEvaluatorGenerationJobSource"
- }
- },
- "description": "The base source model for evaluator generation jobs. Polymorphic over `type`.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluatorGenerationJobSourceType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "task": {
"type": "string",
"enum": [
- "prompt",
- "agent",
- "traces",
- "dataset"
- ]
- }
- ],
- "description": "The supported source types for evaluator generation jobs.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluatorGenerationTokenUsage": {
- "type": "object",
- "required": [
- "input_tokens",
- "output_tokens",
- "total_tokens"
- ],
- "properties": {
- "input_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Number of input (prompt) tokens consumed."
- },
- "output_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Number of output (completion) tokens generated."
+ "transcribe"
+ ],
+ "description": "The type of task that was run. Always `transcribe`.",
+ "x-stainless-const": true
},
- "total_tokens": {
+ "duration": {
"type": "integer",
"format": "int64",
- "description": "Total tokens consumed (input + output)."
- }
- },
- "description": "Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluatorMetric": {
- "type": "object",
- "properties": {
- "type": {
- "$ref": "#/components/schemas/EvaluatorMetricType",
- "description": "Type of the metric."
- },
- "desirable_direction": {
- "$ref": "#/components/schemas/EvaluatorMetricDirection",
- "description": "It indicates whether a higher value is better or a lower value is better for this metric."
+ "description": "Duration of the input audio in seconds.",
+ "x-ms-duration": "seconds"
},
- "min_value": {
- "type": "number",
- "format": "float",
- "description": "Minimum value for the metric"
- },
- "max_value": {
- "type": "number",
- "format": "float",
- "description": "Maximum value for the metric. If not specified, it is assumed to be unbounded."
+ "text": {
+ "type": "string",
+ "description": "The concatenated transcript text for the entire audio input."
},
- "threshold": {
- "type": "number",
- "format": "float",
- "description": "Default pass/fail threshold for this metric."
+ "segments": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptionDiarizedSegment"
+ },
+ "description": "Segments of the transcript annotated with timestamps and speaker labels."
},
- "is_primary": {
- "type": "boolean",
- "description": "Indicates if this metric is primary when there are multiple metrics."
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage"
}
},
- "description": "Evaluator Metric",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ "description": "Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.",
+ "x-oaiMeta": {
+ "name": "The transcription object (Diarized JSON)",
+ "group": "audio",
+ "example": "{\n \"task\": \"transcribe\",\n \"duration\": 42.7,\n \"text\": \"Agent: Thanks for calling OpenAI support.\nCustomer: Hi, I need help with diarization.\",\n \"segments\": [\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_001\",\n \"start\": 0.0,\n \"end\": 5.2,\n \"text\": \"Thanks for calling OpenAI support.\",\n \"speaker\": \"agent\"\n },\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_002\",\n \"start\": 5.2,\n \"end\": 12.8,\n \"text\": \"Hi, I need help with diarization.\",\n \"speaker\": \"A\"\n }\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 43\n }\n}\n"
}
},
- "EvaluatorMetricDirection": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "OpenAI.CreateTranscriptionResponseJson": {
+ "type": "object",
+ "required": [
+ "text"
+ ],
+ "properties": {
+ "text": {
"type": "string",
- "enum": [
- "increase",
- "decrease",
- "neutral"
- ]
+ "description": "The transcribed text."
+ },
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonLogprobs"
+ },
+ "description": "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."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage"
}
- ],
- "description": "The direction of the metric indicating whether a higher value is better, a lower value is better, or neutral",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ },
+ "description": "Represents a transcription response returned by model, based on the provided input.",
+ "x-oaiMeta": {
+ "name": "The transcription object (JSON)",
+ "group": "audio",
+ "example": "{\n \"text\": \"Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.\",\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \"input_token_details\": {\n \"text_tokens\": 10,\n \"audio_tokens\": 4\n },\n \"output_tokens\": 101,\n \"total_tokens\": 115\n }\n}\n"
}
},
- "EvaluatorMetricType": {
- "anyOf": [
- {
+ "OpenAI.CreateTranscriptionResponseJsonLogprobs": {
+ "type": "object",
+ "properties": {
+ "token": {
"type": "string"
},
- {
- "type": "string",
- "enum": [
- "ordinal",
- "continuous",
- "boolean"
- ]
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "bytes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
}
- ],
- "description": "The type of the evaluator",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorType": {
+ "OpenAI.CreateTranscriptionResponseJsonUsage": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsageType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "duration": "#/components/schemas/OpenAI.TranscriptTextUsageDuration",
+ "tokens": "#/components/schemas/OpenAI.TranscriptTextUsageTokens"
+ }
+ },
+ "description": "Token usage statistics for the request."
+ },
+ "OpenAI.CreateTranscriptionResponseJsonUsageType": {
"anyOf": [
{
"type": "string"
@@ -23713,504 +46098,504 @@
{
"type": "string",
"enum": [
- "builtin",
- "custom"
+ "tokens",
+ "duration"
]
}
- ],
- "description": "The type of the evaluator",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ ]
},
- "EvaluatorVersion": {
+ "OpenAI.CreateTranscriptionResponseVerboseJson": {
"type": "object",
"required": [
- "evaluator_type",
- "categories",
- "definition",
- "created_by",
- "created_at",
- "modified_at",
- "name",
- "version"
+ "language",
+ "duration",
+ "text"
],
"properties": {
- "display_name": {
+ "language": {
"type": "string",
- "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
+ "description": "The language of the input audio."
},
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Metadata about the evaluator"
+ "duration": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The duration of the input audio.",
+ "x-ms-duration": "seconds"
},
- "evaluator_type": {
- "$ref": "#/components/schemas/EvaluatorType",
- "description": "The type of the evaluator"
+ "text": {
+ "type": "string",
+ "description": "The transcribed text."
},
- "categories": {
+ "words": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/EvaluatorCategory"
+ "$ref": "#/components/schemas/OpenAI.TranscriptionWord"
},
- "description": "The categories of the evaluator"
+ "description": "Extracted words and their corresponding timestamps."
},
- "supported_evaluation_levels": {
+ "segments": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/EvaluationLevel"
+ "$ref": "#/components/schemas/OpenAI.TranscriptionSegment"
},
- "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
- "default": [
- "turn"
- ]
- },
- "definition": {
- "$ref": "#/components/schemas/EvaluatorDefinition",
- "description": "Definition of the evaluator"
- },
- "generation_artifacts": {
- "$ref": "#/components/schemas/EvaluatorGenerationArtifacts",
- "description": "Provenance artifacts from the generation pipeline. Read-only; present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry Dataset.",
- "readOnly": true
- },
- "created_by": {
- "type": "string",
- "description": "Creator of the evaluator",
- "readOnly": true
+ "description": "Segments of the transcribed text and their corresponding details."
},
- "created_at": {
- "type": "string",
- "description": "Creation date/time of the evaluator",
- "readOnly": true
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptTextUsageDuration"
+ }
+ },
+ "description": "Represents a verbose json transcription response returned by model, based on the provided input.",
+ "x-oaiMeta": {
+ "name": "The transcription object (Verbose JSON)",
+ "group": "audio",
+ "example": "{\n \"task\": \"transcribe\",\n \"language\": \"english\",\n \"duration\": 8.470000267028809,\n \"text\": \"The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.\",\n \"segments\": [\n {\n \"id\": 0,\n \"seek\": 0,\n \"start\": 0.0,\n \"end\": 3.319999933242798,\n \"text\": \" The beach was a popular spot on a hot summer day.\",\n \"tokens\": [\n 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530\n ],\n \"temperature\": 0.0,\n \"avg_logprob\": -0.2860786020755768,\n \"compression_ratio\": 1.2363636493682861,\n \"no_speech_prob\": 0.00985979475080967\n },\n ...\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 9\n }\n}\n"
+ }
+ },
+ "OpenAI.CreateTranslationRequest": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "description": "The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.",
+ "x-oaiTypeLabel": "file"
},
- "modified_at": {
- "type": "string",
- "description": "Last modified date/time of the evaluator",
- "readOnly": true
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "whisper-1"
+ ]
+ }
+ ],
+ "description": "ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available.",
+ "x-oaiTypeLabel": "string"
},
- "id": {
+ "prompt": {
"type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
+ "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should be in English."
},
- "name": {
+ "response_format": {
"type": "string",
- "description": "The name of the resource",
- "readOnly": true
+ "enum": [
+ "json",
+ "text",
+ "srt",
+ "verbose_json",
+ "vtt"
+ ],
+ "description": "The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`."
},
- "version": {
- "type": "string",
- "description": "The version of the resource",
- "readOnly": true
+ "temperature": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "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."
}
},
- "description": "Evaluator Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ "required": [
+ "file",
+ "model"
+ ]
+ },
+ "OpenAI.CreateTranslationResponseJson": {
+ "type": "object",
+ "required": [
+ "text"
+ ],
+ "properties": {
+ "text": {
+ "type": "string"
+ }
}
},
- "EvaluatorVersionCreate": {
+ "OpenAI.CreateTranslationResponseVerboseJson": {
"type": "object",
"required": [
- "evaluator_type",
- "categories",
- "definition"
+ "language",
+ "duration",
+ "text"
],
"properties": {
- "display_name": {
+ "language": {
"type": "string",
- "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
+ "description": "The language of the output translation (always `english`)."
},
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Metadata about the evaluator"
+ "duration": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The duration of the input audio.",
+ "x-ms-duration": "seconds"
},
- "evaluator_type": {
- "$ref": "#/components/schemas/EvaluatorType",
- "description": "The type of the evaluator"
+ "text": {
+ "type": "string",
+ "description": "The translated text."
},
- "categories": {
+ "segments": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/EvaluatorCategory"
+ "$ref": "#/components/schemas/OpenAI.TranscriptionSegment"
},
- "description": "The categories of the evaluator"
+ "description": "Segments of the translated text and their corresponding details."
+ }
+ }
+ },
+ "OpenAI.CreateUploadRequest": {
+ "type": "object",
+ "required": [
+ "filename",
+ "purpose",
+ "bytes",
+ "mime_type"
+ ],
+ "properties": {
+ "filename": {
+ "type": "string",
+ "description": "The name of the file to upload."
},
- "supported_evaluation_levels": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvaluationLevel"
- },
- "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
- "default": [
- "turn"
- ]
+ "purpose": {
+ "type": "string",
+ "enum": [
+ "assistants",
+ "batch",
+ "fine-tune",
+ "vision"
+ ],
+ "description": "The intended purpose of the uploaded file.\n See the [documentation on File\n purposes](/docs/api-reference/files/create#files-create-purpose)."
},
- "definition": {
- "$ref": "#/components/schemas/EvaluatorDefinition",
- "description": "Definition of the evaluator"
+ "bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of bytes in the file you are uploading."
},
- "description": {
+ "mime_type": {
"type": "string",
- "description": "The asset description text."
+ "description": "The MIME type of the file.\n This must fall within the supported MIME types for your file purpose. See\n the supported MIME types for assistants and vision."
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.FileExpirationAfter"
}
- },
- "description": "Evaluator Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorVersionUpdate": {
+ "OpenAI.CreateVectorStoreFileBatchRequest": {
"type": "object",
"properties": {
- "display_name": {
- "type": "string",
- "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
- },
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Metadata about the evaluator"
- },
- "categories": {
+ "file_ids": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/EvaluatorCategory"
+ "type": "string"
},
- "description": "The categories of the evaluator"
+ "minItems": 1,
+ "maxItems": 2000,
+ "description": "A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied to all files in the batch. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `files`."
},
- "supported_evaluation_levels": {
+ "files": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/EvaluationLevel"
+ "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileRequest"
},
- "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
- "default": [
- "turn"
- ]
+ "minItems": 1,
+ "maxItems": 2000,
+ "description": "A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must be specified for each file. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `file_ids`."
},
- "description": {
- "type": "string",
- "description": "The asset description text."
+ "chunking_strategy": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam"
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "Evaluator Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "ExternalAgentDefinition": {
+ "OpenAI.CreateVectorStoreFileRequest": {
"type": "object",
"required": [
- "kind"
+ "file_id"
],
"properties": {
- "kind": {
+ "file_id": {
"type": "string",
- "enum": [
- "external"
- ]
+ "description": "A [File](/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. For multi-file ingestion, we recommend [`file_batches`](/docs/api-reference/vector-stores-file-batches/createBatch) to minimize per-vector-store write requests."
},
- "otel_agent_id": {
- "type": "string",
- "description": "The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry agent.\nSpans must include the attribute `gen_ai.agent.id = ` to appear under this registration.\nDefaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios\nwhere the running external agent already emits a stable id that differs from the Foundry agent name.\nThe resolved value is always echoed on read."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentDefinition"
+ "chunking_strategy": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam"
+ },
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- ],
- "description": "The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS).\nRegistration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations)\nover customer-emitted OpenTelemetry data.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ExternalAgents=V1Preview"
- ]
}
},
- "FabricDataAgentToolCall": {
+ "OpenAI.CreateVectorStoreRequest": {
"type": "object",
- "required": [
- "type",
- "call_id",
- "arguments",
- "status"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "fabric_dataagent_preview_call"
- ]
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 500,
+ "description": "A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files."
},
- "call_id": {
+ "name": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The name of the vector store."
},
- "arguments": {
+ "description": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "description": "A description for the vector store. Can be used to describe the vector store's purpose."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter"
+ },
+ "chunking_strategy": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam",
+ "description": "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."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ },
+ "OpenAI.CreateVideoCharacterBody": {
+ "type": "object",
+ "properties": {
+ "video": {
+ "description": "Video file used to create a character."
+ },
+ "name": {
+ "type": "string",
+ "description": "Display name for this API character."
}
- ],
- "description": "A Fabric data agent tool call."
+ },
+ "required": [
+ "video",
+ "name"
+ ]
},
- "FabricDataAgentToolCallOutput": {
+ "OpenAI.CreateVideoEditJsonBody": {
"type": "object",
"required": [
- "type",
- "call_id",
- "status"
+ "video",
+ "prompt"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "fabric_dataagent_preview_call_output"
- ]
+ "video": {
+ "$ref": "#/components/schemas/OpenAI.VideoReferenceInputParam",
+ "description": "Reference to the completed video to edit."
},
- "call_id": {
+ "prompt": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Fabric data agent tool call."
- },
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "minLength": 1,
+ "maxLength": 32000,
+ "description": "Text prompt that describes how to edit the source video."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "The output of a Fabric data agent tool call."
+ "description": "JSON parameters for editing an existing generated video.",
+ "title": "Create video edit JSON request"
},
- "FabricDataAgentToolParameters": {
+ "OpenAI.CreateVideoEditMultipartBody": {
"type": "object",
"properties": {
- "project_connections": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ToolProjectConnection"
- },
- "maxItems": 1,
- "description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
+ "video": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoEditMultipartBodyVideo"
+ },
+ "prompt": {
+ "type": "string",
+ "description": "Text prompt that describes how to edit the source video."
}
},
- "description": "The fabric data agent tool parameters."
+ "required": [
+ "video",
+ "prompt"
+ ]
},
- "FabricIQPreviewTool": {
+ "OpenAI.CreateVideoEditMultipartBodyVideo": {
+ "oneOf": [
+ {},
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoReferenceInputParam"
+ }
+ ]
+ },
+ "OpenAI.CreateVideoExtendJsonBody": {
"type": "object",
"required": [
- "type",
- "project_connection_id"
+ "video",
+ "prompt",
+ "seconds"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "fabric_iq_preview"
- ],
- "description": "The object type, which is always 'fabric_iq_preview'."
+ "video": {
+ "$ref": "#/components/schemas/OpenAI.VideoReferenceInputParam",
+ "description": "Reference to the completed video to extend."
},
- "project_connection_id": {
+ "prompt": {
"type": "string",
- "description": "The ID of the FabricIQ project connection."
+ "minLength": 1,
+ "maxLength": 32000,
+ "description": "Updated text prompt that directs the extension generation."
},
- "server_label": {
- "type": "string",
- "description": "(Optional) The label of the FabricIQ MCP server to connect to."
+ "seconds": {
+ "$ref": "#/components/schemas/OpenAI.VideoSeconds",
+ "description": "Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20)."
+ }
+ },
+ "description": "JSON parameters for extending an existing generated video.",
+ "title": "Create video extension JSON request"
+ },
+ "OpenAI.CreateVideoExtendMultipartBody": {
+ "type": "object",
+ "properties": {
+ "video": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoExtendMultipartBodyVideo"
},
- "server_url": {
+ "prompt": {
"type": "string",
- "format": "uri",
- "description": "(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used."
+ "description": "Updated text prompt that directs the extension generation."
},
- "require_approval": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
- },
- {
- "type": "string"
- },
+ "seconds": {
+ "allOf": [
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.VideoSeconds"
}
],
- "description": "(Optional) Whether the agent requires approval before executing actions. Default is always.",
- "default": "always"
+ "description": "Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20)."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "A FabricIQ server-side tool."
- },
- "FabricIQPreviewToolboxTool": {
- "type": "object",
"required": [
- "type",
- "project_connection_id"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "fabric_iq_preview"
- ]
+ "video",
+ "prompt",
+ "seconds"
+ ]
+ },
+ "OpenAI.CreateVideoExtendMultipartBodyVideo": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoReferenceInputParam"
},
- "project_connection_id": {
- "type": "string",
- "description": "The ID of the FabricIQ project connection."
+ {}
+ ]
+ },
+ "OpenAI.CreateVideoMultipartBody": {
+ "type": "object",
+ "properties": {
+ "model": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoModel"
+ }
+ ],
+ "description": "The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to `sora-2`."
},
- "server_label": {
+ "prompt": {
"type": "string",
- "description": "(Optional) The label of the FabricIQ MCP server to connect to."
+ "description": "Text prompt that describes the video to generate."
},
- "server_url": {
- "type": "string",
- "format": "uri",
- "description": "(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used."
+ "input_reference": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoMultipartBodyInputReference"
},
- "require_approval": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
- },
+ "seconds": {
+ "allOf": [
{
- "type": "string"
- },
+ "$ref": "#/components/schemas/OpenAI.VideoSeconds"
+ }
+ ],
+ "description": "Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds."
+ },
+ "size": {
+ "allOf": [
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.VideoSize"
}
],
- "description": "(Optional) Whether the agent requires approval before executing actions. Default is always.",
- "default": "always"
+ "description": "Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280."
}
},
- "allOf": [
+ "required": [
+ "prompt"
+ ]
+ },
+ "OpenAI.CreateVideoMultipartBodyInputReference": {
+ "oneOf": [
+ {},
{
- "$ref": "#/components/schemas/ToolboxTool"
+ "$ref": "#/components/schemas/OpenAI.ImageRefParam"
}
- ],
- "description": "A FabricIQ tool stored in a toolbox."
+ ]
},
- "FileDataGenerationJobOutput": {
+ "OpenAI.CreateVideoRemixBody": {
"type": "object",
- "required": [
- "type",
- "id",
- "filename"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "file"
+ "prompt": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoPrompt"
+ }
],
- "description": "Azure OpenAI file output."
- },
- "id": {
- "type": "string",
- "description": "The id of the output Azure OpenAI file.",
- "readOnly": true
- },
- "filename": {
- "type": "string",
- "description": "The filename of the output Azure OpenAI file.",
- "readOnly": true
+ "description": "Updated text prompt that directs the remix generation."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/DataGenerationJobOutput"
- }
- ],
- "description": "Azure OpenAI file output for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
+ "required": [
+ "prompt"
+ ]
},
- "FileDataGenerationJobSource": {
+ "OpenAI.CustomGrammarFormatParam": {
"type": "object",
"required": [
"type",
- "id"
+ "syntax",
+ "definition"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "file"
+ "grammar"
],
- "description": "The source type for this job, which is File."
+ "description": "Grammar format. Always `grammar`.",
+ "x-stainless-const": true
},
- "id": {
+ "syntax": {
+ "$ref": "#/components/schemas/OpenAI.GrammarSyntax1",
+ "description": "The syntax of the grammar definition. One of `lark` or `regex`."
+ },
+ "definition": {
"type": "string",
- "description": "Input Azure Open AI file id used for data generation."
+ "description": "The grammar definition."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/DataGenerationJobSource"
+ "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat"
}
],
- "description": "File source for data generation jobs — Azure OpenAI file input.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
+ "description": "A grammar defined by the user.",
+ "title": "Grammar format"
},
- "FileDatasetVersion": {
+ "OpenAI.CustomTextFormatParam": {
"type": "object",
"required": [
"type"
@@ -24219,169 +46604,182 @@
"type": {
"type": "string",
"enum": [
- "uri_file"
+ "text"
],
- "description": "Dataset type"
+ "description": "Unconstrained text format. Always `text`.",
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/DatasetVersion"
+ "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat"
}
],
- "description": "FileDatasetVersion Definition"
+ "description": "Unconstrained free-form text.",
+ "title": "Text format"
},
- "FileDatasetVersionUpdate": {
+ "OpenAI.CustomToolChatCompletions": {
"type": "object",
"required": [
- "type"
+ "type",
+ "custom"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "uri_file"
+ "custom"
],
- "description": "Dataset type"
+ "description": "The type of the custom tool. Always `custom`.",
+ "x-stainless-const": true
+ },
+ "custom": {
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustom",
+ "description": "Properties of the custom tool.",
+ "title": "Custom tool properties"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/DatasetVersionUpdate"
- }
- ],
- "description": "FileDatasetVersion Definition"
+ "description": "A custom tool that processes input using a specified format.",
+ "title": "Custom tool"
},
- "FileSearchToolboxTool": {
+ "OpenAI.CustomToolChatCompletionsCustom": {
"type": "object",
"required": [
- "type"
+ "name"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "file_search"
- ]
- },
- "max_num_results": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive."
+ "name": {
+ "type": "string"
},
- "ranking_options": {
- "$ref": "#/components/schemas/OpenAI.RankingOptions",
- "description": "Ranking options for search."
+ "description": {
+ "type": "string"
},
- "filters": {
- "anyOf": [
+ "format": {
+ "oneOf": [
{
- "$ref": "#/components/schemas/OpenAI.Filters"
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatText"
},
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammar"
}
]
- },
- "vector_store_ids": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The IDs of the vector stores to search."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/ToolboxTool"
}
+ }
+ },
+ "OpenAI.CustomToolChatCompletionsCustomFormatGrammar": {
+ "type": "object",
+ "required": [
+ "type",
+ "grammar"
],
- "description": "A file search tool stored in a toolbox."
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "grammar"
+ ],
+ "x-stainless-const": true
+ },
+ "grammar": {
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar",
+ "title": "Grammar format"
+ }
+ }
},
- "FilterStrategyType": {
- "anyOf": [
- {
+ "OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar": {
+ "type": "object",
+ "required": [
+ "definition",
+ "syntax"
+ ],
+ "properties": {
+ "definition": {
"type": "string"
},
- {
+ "syntax": {
"type": "string",
"enum": [
- "random_sampling",
- "smart_filtering"
+ "lark",
+ "regex"
]
}
- ],
- "description": "Specifies the type of filter strategy used to select traces for evaluation."
+ }
},
- "FixedRatioVersionSelectionRule": {
+ "OpenAI.CustomToolChatCompletionsCustomFormatText": {
"type": "object",
"required": [
- "type",
- "traffic_percentage"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "FixedRatio"
- ]
- },
- "traffic_percentage": {
- "type": "integer",
- "format": "int32",
- "minimum": 0,
- "maximum": 100,
- "description": "The percentage of traffic to route to the version. Must be between 0 and 100."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/VersionSelectionRule"
+ "text"
+ ],
+ "x-stainless-const": true
}
- ]
+ }
},
- "FolderDatasetVersion": {
+ "OpenAI.CustomToolParam": {
"type": "object",
"required": [
- "type"
+ "type",
+ "name"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "uri_folder"
+ "custom"
],
- "description": "Dataset type"
+ "description": "The type of the custom tool. Always `custom`.",
+ "x-stainless-const": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom tool, used to identify it in tool calls."
+ },
+ "description": {
+ "type": "string",
+ "description": "Optional description of the custom tool, used to provide more context."
+ },
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat",
+ "description": "The input format for the custom tool. Default is unconstrained text."
+ },
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this tool should be deferred and discovered via tool search."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/DatasetVersion"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "FileDatasetVersion Definition"
+ "description": "A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)",
+ "title": "Custom tool"
},
- "FolderDatasetVersionUpdate": {
+ "OpenAI.CustomToolParamFormat": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "uri_folder"
- ],
- "description": "Dataset type"
+ "$ref": "#/components/schemas/OpenAI.CustomToolParamFormatType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/DatasetVersionUpdate"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "text": "#/components/schemas/OpenAI.CustomTextFormatParam",
+ "grammar": "#/components/schemas/OpenAI.CustomGrammarFormatParam"
}
- ],
- "description": "FileDatasetVersion Definition"
+ },
+ "description": "The input format for the custom tool. Default is unconstrained text."
},
- "FoundryModelArtifactProfileCategory": {
+ "OpenAI.CustomToolParamFormatType": {
"anyOf": [
{
"type": "string"
@@ -24389,760 +46787,1141 @@
{
"type": "string",
"enum": [
- "DataOnly",
- "RuntimeDependent",
- "Unknown"
+ "text",
+ "grammar"
]
}
+ ]
+ },
+ "OpenAI.DeleteAssistantResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "deleted",
+ "object"
],
- "description": "The artifact profile category.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "deleted": {
+ "type": "boolean"
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "assistant.deleted"
+ ],
+ "x-stainless-const": true
+ }
}
},
- "FoundryModelArtifactProfileSignal": {
- "anyOf": [
- {
+ "OpenAI.DeleteFileResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "object",
+ "deleted"
+ ],
+ "properties": {
+ "id": {
"type": "string"
},
- {
+ "object": {
"type": "string",
"enum": [
- "PickleDeserialization",
- "CustomPythonCode",
- "DynamicOps",
- "NativeBinary",
- "UnknownFormat"
- ]
+ "file"
+ ],
+ "x-stainless-const": true
+ },
+ "deleted": {
+ "type": "boolean"
}
+ }
+ },
+ "OpenAI.DeleteFineTuningCheckpointPermissionResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "object",
+ "deleted"
],
- "description": "Signals detected in the model artifact.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the fine-tuned model checkpoint permission that was deleted."
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "checkpoint.permission"
+ ],
+ "description": "The object type, which is always \"checkpoint.permission\".",
+ "x-stainless-const": true
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the fine-tuned model checkpoint permission was successfully deleted."
+ }
}
},
- "FoundryModelSourceType": {
- "anyOf": [
- {
+ "OpenAI.DeleteMessageResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "deleted",
+ "object"
+ ],
+ "properties": {
+ "id": {
"type": "string"
},
- {
+ "deleted": {
+ "type": "boolean"
+ },
+ "object": {
"type": "string",
"enum": [
- "LocalUpload",
- "TrainingJob"
- ]
+ "thread.message.deleted"
+ ],
+ "x-stainless-const": true
}
+ }
+ },
+ "OpenAI.DeleteModelResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "deleted",
+ "object"
],
- "description": "The source type of the model.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "deleted": {
+ "type": "boolean"
+ },
+ "object": {
+ "type": "string"
+ }
}
},
- "FoundryModelWarning": {
+ "OpenAI.DeleteThreadResponse": {
"type": "object",
+ "required": [
+ "id",
+ "deleted",
+ "object"
+ ],
"properties": {
- "code": {
- "$ref": "#/components/schemas/FoundryModelWarningCode",
- "description": "The warning code."
+ "id": {
+ "type": "string"
},
- "message": {
+ "deleted": {
+ "type": "boolean"
+ },
+ "object": {
"type": "string",
- "description": "The warning message."
+ "enum": [
+ "thread.deleted"
+ ],
+ "x-stainless-const": true
}
- },
- "description": "A warning associated with a model.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "FoundryModelWarningCode": {
- "anyOf": [
- {
+ "OpenAI.DeleteVectorStoreFileResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "deleted",
+ "object"
+ ],
+ "properties": {
+ "id": {
"type": "string"
},
- {
+ "deleted": {
+ "type": "boolean"
+ },
+ "object": {
"type": "string",
"enum": [
- "RuntimeDependentArtifact",
- "UnclassifiedArtifact"
- ]
+ "vector_store.file.deleted"
+ ],
+ "x-stainless-const": true
}
- ],
- "description": "Warning code for model artifacts.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "FoundryModelWeightType": {
- "anyOf": [
- {
+ "OpenAI.DeleteVectorStoreResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "deleted",
+ "object"
+ ],
+ "properties": {
+ "id": {
"type": "string"
},
- {
+ "deleted": {
+ "type": "boolean"
+ },
+ "object": {
"type": "string",
"enum": [
- "FullWeight",
- "LoRA",
- "DraftModel"
- ]
+ "vector_store.deleted"
+ ],
+ "x-stainless-const": true
}
- ],
- "description": "The weight type of the model.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "FoundryTimestamp": {
- "type": "integer",
- "format": "unixtime"
+ "OpenAI.DeletedConversationResource": {
+ "type": "object",
+ "required": [
+ "object",
+ "deleted",
+ "id"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "conversation.deleted"
+ ],
+ "x-stainless-const": true,
+ "default": "conversation.deleted"
+ },
+ "deleted": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ }
+ }
},
- "FunctionToolCall": {
+ "OpenAI.DeletedVideoResource": {
"type": "object",
"required": [
- "name",
- "arguments"
+ "object",
+ "deleted",
+ "id"
],
"properties": {
- "name": {
+ "object": {
"type": "string",
- "description": "The name of the function to call."
+ "enum": [
+ "video.deleted"
+ ],
+ "description": "The object type that signals the deletion response.",
+ "x-stainless-const": true,
+ "default": "video.deleted"
},
- "arguments": {
+ "deleted": {
+ "type": "boolean",
+ "description": "Indicates that the video resource was deleted."
+ },
+ "id": {
"type": "string",
- "description": "The arguments to call the function with, as generated by the model in JSON format."
+ "description": "Identifier of the deleted video."
}
},
- "description": "Details of a function tool call."
+ "description": "Confirmation payload returned after deleting a video.",
+ "title": "Deleted video response"
},
- "GitHubIssueEvent": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "OpenAI.DetailEnum": {
+ "type": "string",
+ "enum": [
+ "low",
+ "high",
+ "auto",
+ "original"
+ ]
+ },
+ "OpenAI.DoubleClickAction": {
+ "type": "object",
+ "required": [
+ "type",
+ "x",
+ "y",
+ "keys"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "opened",
- "closed"
+ "double_click"
+ ],
+ "description": "Specifies the event type. For a double click action, this property is always set to `double_click`.",
+ "x-stainless-const": true
+ },
+ "x": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The x-coordinate where the double click occurred."
+ },
+ "y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The y-coordinate where the double click occurred."
+ },
+ "keys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
]
}
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ }
],
- "description": "Known GitHub issue events that can fire a routine.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
+ "description": "A double click action.",
+ "title": "DoubleClick"
},
- "GitHubIssueRoutineTrigger": {
+ "OpenAI.DragParam": {
"type": "object",
"required": [
"type",
- "connection_id",
- "owner",
- "repository",
- "issue_event"
+ "path"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "github_issue"
+ "drag"
],
- "description": "The trigger type."
- },
- "connection_id": {
- "type": "string",
- "maxLength": 256,
- "description": "The workspace connection identifier that resolves the GitHub configuration for the trigger."
- },
- "owner": {
- "type": "string",
- "maxLength": 128,
- "description": "The GitHub owner or organization that scopes which issues can fire the trigger."
+ "description": "Specifies the event type. For a drag action, this property is always set to `drag`.",
+ "x-stainless-const": true
},
- "repository": {
- "type": "string",
- "maxLength": 128,
- "description": "The GitHub repository filter that scopes which issues can fire the trigger."
+ "path": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CoordParam"
+ },
+ "description": "An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg\n ```\n [\n { x: 100, y: 200 },\n { x: 200, y: 300 }\n ]\n ```"
},
- "issue_event": {
- "$ref": "#/components/schemas/GitHubIssueEvent",
- "description": "The GitHub issue event that fires the routine."
+ "keys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/RoutineTrigger"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "A GitHub issue routine trigger.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
+ "description": "A drag action.",
+ "title": "Drag"
},
- "HeaderTelemetryEndpointAuth": {
+ "OpenAI.EasyInputMessage": {
"type": "object",
"required": [
- "type",
- "header_name",
- "secret_id",
- "secret_key"
+ "role",
+ "content",
+ "type"
],
"properties": {
- "type": {
+ "role": {
"type": "string",
"enum": [
- "header"
+ "user",
+ "assistant",
+ "system",
+ "developer"
],
- "description": "The authentication type, always 'header' for header-based secret authentication."
+ "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`."
},
- "header_name": {
- "type": "string",
- "description": "The name of the HTTP header to inject the secret value into.",
- "examples": [
- "X-Otlp-Api-Key"
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
+ }
+ ],
+ "description": "Text, image, or audio input to the model, used to generate a response.\n Can also contain previous assistant responses."
+ },
+ "phase": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ },
+ {
+ "type": "null"
+ }
]
},
- "secret_id": {
+ "type": {
"type": "string",
- "description": "The identifier of the secret store or connection.",
- "examples": [
- "my-secret-store"
- ]
+ "enum": [
+ "message"
+ ],
+ "description": "The type of the message input. Always `message`.",
+ "x-stainless-const": true
},
- "secret_key": {
+ "status": {
"type": "string",
- "description": "The key within the secret to retrieve the authentication value.",
- "examples": [
- "OTLP_KEY"
- ]
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/TelemetryEndpointAuth"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header."
+ "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.",
+ "title": "Input message"
},
- "HostedAgentDefinition": {
+ "OpenAI.EditImageBodyJsonParam": {
"type": "object",
"required": [
- "kind",
- "cpu",
- "memory"
+ "images",
+ "prompt"
],
"properties": {
- "kind": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "gpt-image-1.5",
+ "gpt-image-1",
+ "gpt-image-1-mini",
+ "chatgpt-image-latest"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The model to use for image editing.",
+ "x-oaiTypeLabel": "string",
+ "default": "gpt-image-1.5"
+ },
+ "images": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ImageRefParam"
+ },
+ "minItems": 1,
+ "maxItems": 16,
+ "description": "Input image references to edit.\n For GPT image models, you can provide up to 16 images."
+ },
+ "mask": {
+ "$ref": "#/components/schemas/OpenAI.ImageRefParam"
+ },
+ "prompt": {
"type": "string",
- "enum": [
- "hosted"
- ]
+ "minLength": 1,
+ "maxLength": 32000,
+ "description": "A text description of the desired image edit."
},
- "cpu": {
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The number of edited images to generate.",
+ "default": 1
+ },
+ "quality": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Output quality for GPT image models.",
+ "default": "auto"
+ },
+ "input_fidelity": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "high",
+ "low"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Controls fidelity to the original input image(s)."
+ },
+ "size": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "1024x1024",
+ "1536x1024",
+ "1024x1536"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Requested output image size.",
+ "default": "auto"
+ },
+ "user": {
"type": "string",
- "description": "The CPU configuration for the hosted agent.",
- "examples": [
- "0.25"
- ]
+ "description": "A unique identifier representing your end-user, which can help OpenAI\n monitor and detect abuse."
},
- "memory": {
+ "output_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "png",
+ "jpeg",
+ "webp"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Output image format. Supported for GPT image models.",
+ "default": "png"
+ },
+ "output_compression": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Compression level for `jpeg` or `webp` output."
+ },
+ "moderation": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "low",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Moderation level for GPT image models.",
+ "default": "auto"
+ },
+ "background": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "transparent",
+ "opaque",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Background behavior for generated image output.",
+ "default": "auto"
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Stream partial image results as events."
+ },
+ "partial_images": {
+ "$ref": "#/components/schemas/OpenAI.PartialImages"
+ }
+ },
+ "description": "JSON request body for image edits.\nUse `images` (array of `ImageRefParam`) instead of multipart `image` uploads.\nYou can reference images via external URLs, data URLs, or uploaded file IDs.\nJSON edits support GPT image models only; DALL-E edits require multipart (`dall-e-2` only)."
+ },
+ "OpenAI.Embedding": {
+ "type": "object",
+ "required": [
+ "index",
+ "embedding",
+ "object"
+ ],
+ "properties": {
+ "index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the embedding in the list of embeddings."
+ },
+ "embedding": {
+ "type": "array",
+ "items": {
+ "type": "number",
+ "format": "float"
+ },
+ "description": "The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings)."
+ },
+ "object": {
"type": "string",
- "description": "The memory configuration for the hosted agent.",
- "examples": [
- "0.5Gi"
+ "enum": [
+ "embedding"
+ ],
+ "description": "The object type, which is always \"embedding\".",
+ "x-stainless-const": true
+ }
+ },
+ "description": "Represents an embedding vector returned by embedding endpoint.",
+ "x-oaiMeta": {
+ "name": "The embedding object",
+ "example": "{\n \"object\": \"embedding\",\n \"embedding\": [\n 0.0023064255,\n -0.009327292,\n .... (1536 floats total for ada-002)\n -0.0028842222,\n ],\n \"index\": 0\n}\n"
+ }
+ },
+ "OpenAI.EmptyModelParam": {
+ "type": "object"
+ },
+ "OpenAI.Error": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
},
- "environment_variables": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Environment variables to set in the hosted agent container.",
- "examples": [
+ "message": {
+ "type": "string"
+ },
+ "param": {
+ "anyOf": [
{
- "name": "LOG_LEVEL",
- "value": "debug"
+ "type": "string"
+ },
+ {
+ "type": "null"
}
]
},
- "container_configuration": {
- "$ref": "#/components/schemas/ContainerConfiguration",
- "description": "Container-based deployment configuration. Provide this for image-based deployments. Mutually exclusive with code_configuration — the service validates that exactly one is set."
+ "type": {
+ "type": "string"
},
- "protocol_versions": {
+ "details": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/ProtocolVersionRecord"
- },
- "description": "The protocols that the agent supports for ingress communication.",
- "examples": [
- [
- {
- "protocol": "responses",
- "version": "v0.1.1"
- },
- {
- "protocol": "a2a",
- "version": "v0.3.0"
- }
- ]
- ]
+ "$ref": "#/components/schemas/OpenAI.Error"
+ }
},
- "code_configuration": {
- "$ref": "#/components/schemas/CodeConfiguration",
- "description": "Code-based deployment configuration. Provide this for code-based deployments. Mutually exclusive with container_configuration — the service validates that exactly one is set."
+ "additionalInfo": {
+ "type": "object",
+ "unevaluatedProperties": {}
},
- "telemetry_config": {
- "$ref": "#/components/schemas/TelemetryConfig",
- "description": "Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentDefinition"
+ "debugInfo": {
+ "type": "object",
+ "unevaluatedProperties": {}
}
- ],
- "description": "The hosted agent definition."
+ }
},
- "HourlyRecurrenceSchedule": {
+ "OpenAI.Error-2": {
"type": "object",
"required": [
- "type"
+ "code",
+ "message"
],
"properties": {
- "type": {
+ "code": {
"type": "string",
- "enum": [
- "Hourly"
- ]
+ "description": "A machine-readable error code that was returned."
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable description of the error that was returned."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/RecurrenceSchedule"
- }
+ "description": "An error that occurred while generating the response.",
+ "title": "Error"
+ },
+ "OpenAI.EvalApiError": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
],
- "description": "Hourly recurrence schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "The error code."
+ },
+ "message": {
+ "type": "string",
+ "description": "The error message."
+ }
+ },
+ "description": "An object representing an error response from the Eval API.",
+ "title": "EvalApiError",
+ "x-oaiMeta": {
+ "name": "The API error object",
+ "group": "evals",
+ "example": "{\n \"code\": \"internal_error\",\n \"message\": \"The eval run failed due to an internal error.\"\n}\n"
}
},
- "HumanEvaluationPreviewRuleAction": {
+ "OpenAI.EvalGraderLabelModel": {
"type": "object",
"required": [
"type",
- "templateId"
+ "name",
+ "model",
+ "input",
+ "labels",
+ "passing_labels"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "humanEvaluationPreview"
- ]
+ "label_model"
+ ],
+ "description": "The object type, which is always `label_model`.",
+ "x-stainless-const": true
},
- "templateId": {
- "$ref": "#/components/schemas/AssetId",
- "description": "Human evaluation template Id."
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "model": {
+ "type": "string",
+ "description": "The model to use for the evaluation. Must support structured outputs."
+ },
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ }
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels to assign to each item in the evaluation."
+ },
+ "passing_labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels that indicate a passing result. Must be a subset of labels."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluationRuleAction"
- }
- ],
- "description": "Evaluation rule action for human evaluation."
+ "title": "LabelModelGrader"
},
- "Index": {
+ "OpenAI.EvalGraderPython": {
"type": "object",
"required": [
"type",
"name",
- "version"
+ "source"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/IndexType",
- "description": "Type of index"
- },
- "id": {
"type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
+ "enum": [
+ "python"
+ ],
+ "description": "The object type, which is always `python`.",
+ "x-stainless-const": true
},
"name": {
"type": "string",
- "description": "The name of the resource",
- "readOnly": true
+ "description": "The name of the grader."
},
- "version": {
+ "source": {
"type": "string",
- "description": "The version of the resource",
- "readOnly": true
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "AzureSearch": "#/components/schemas/AzureAISearchIndex",
- "ManagedAzureSearch": "#/components/schemas/ManagedAzureAISearchIndex",
- "CosmosDBNoSqlVectorStore": "#/components/schemas/CosmosDBIndex"
- }
- },
- "description": "Index resource Definition"
- },
- "IndexType": {
- "anyOf": [
- {
- "type": "string"
+ "description": "The source code of the python script."
},
- {
+ "image_tag": {
"type": "string",
- "enum": [
- "AzureSearch",
- "CosmosDBNoSqlVectorStore",
- "ManagedAzureSearch"
- ]
+ "description": "The image tag to use for the python script."
+ },
+ "pass_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The threshold for the score."
}
- ]
+ },
+ "title": "PythonGrader"
},
- "IndexUpdate": {
+ "OpenAI.EvalGraderScoreModel": {
"type": "object",
"required": [
- "type"
+ "type",
+ "name",
+ "model",
+ "input"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/IndexType",
- "description": "Type of index"
+ "type": "string",
+ "enum": [
+ "score_model"
+ ],
+ "description": "The object type, which is always `score_model`.",
+ "x-stainless-const": true
},
- "description": {
+ "name": {
"type": "string",
- "description": "The asset description text."
+ "description": "The name of the grader."
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "model": {
+ "type": "string",
+ "description": "The model to use for the evaluation."
+ },
+ "sampling_params": {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams",
+ "description": "The sampling parameters for the model."
+ },
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
},
- "description": "Tag dictionary. Tags can be added, removed, and updated."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "AzureSearch": "#/components/schemas/AzureAISearchIndexUpdate",
- "ManagedAzureSearch": "#/components/schemas/ManagedAzureAISearchIndexUpdate",
- "CosmosDBNoSqlVectorStore": "#/components/schemas/CosmosDBIndexUpdate"
+ "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings."
+ },
+ "range": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "description": "The range of the score. Defaults to `[0, 1]`."
+ },
+ "pass_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The threshold for the score."
}
},
- "description": "Index resource Definition"
+ "title": "ScoreModelGrader"
},
- "Insight": {
+ "OpenAI.EvalGraderScoreModelSamplingParams": {
"type": "object",
- "required": [
- "id",
- "metadata",
- "state",
- "displayName",
- "request"
- ],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique identifier for the insights report.",
- "readOnly": true
- },
- "metadata": {
- "$ref": "#/components/schemas/InsightsMetadata",
- "description": "Metadata about the insights report.",
- "readOnly": true
+ "seed": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "state": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.OperationState",
- "description": "The current state of the insights.",
- "readOnly": true
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
},
- "displayName": {
- "type": "string",
- "description": "User friendly display name for the insight."
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "request": {
- "$ref": "#/components/schemas/InsightRequest",
- "description": "Request for the insights analysis."
+ "max_completions_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "result": {
- "$ref": "#/components/schemas/InsightResult",
- "description": "The result of the insights report.",
- "readOnly": true
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "The response body for cluster insights.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "InsightCluster": {
+ "OpenAI.EvalGraderStringCheck": {
"type": "object",
"required": [
- "id",
- "label",
- "suggestion",
- "suggestionTitle",
- "description",
- "weight"
+ "type",
+ "name",
+ "input",
+ "reference",
+ "operation"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The id of the analysis cluster."
+ "enum": [
+ "string_check"
+ ],
+ "description": "The object type, which is always `string_check`.",
+ "x-stainless-const": true
},
- "label": {
+ "name": {
"type": "string",
- "description": "Label for the cluster"
+ "description": "The name of the grader."
},
- "suggestion": {
+ "input": {
"type": "string",
- "description": "Suggestion for the cluster"
+ "description": "The input text. This may include template strings."
},
- "suggestionTitle": {
+ "reference": {
"type": "string",
- "description": "The title of the suggestion for the cluster"
+ "description": "The reference text. This may include template strings."
},
- "description": {
+ "operation": {
"type": "string",
- "description": "Description of the analysis cluster."
- },
- "weight": {
- "type": "integer",
- "format": "int32",
- "description": "The weight of the analysis cluster. This indicate number of samples in the cluster."
- },
- "subClusters": {
- "description": "List of subclusters within this cluster. Empty if no subclusters exist.",
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/InsightCluster"
- }
- },
- "samples": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/InsightSample"
- },
- "description": "List of samples that belong to this cluster. Empty if samples are part of subclusters."
+ "enum": [
+ "eq",
+ "ne",
+ "like",
+ "ilike"
+ ],
+ "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
}
},
- "description": "A cluster of analysis samples.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "title": "StringCheckGrader"
},
- "InsightModelConfiguration": {
+ "OpenAI.EvalGraderTextSimilarity": {
"type": "object",
"required": [
- "modelDeploymentName"
+ "type",
+ "name",
+ "input",
+ "reference",
+ "evaluation_metric",
+ "pass_threshold"
],
"properties": {
- "modelDeploymentName": {
+ "type": {
"type": "string",
- "description": "The model deployment to be evaluated. Accepts either the deployment name alone or with the connection name as '{connectionName}/'."
+ "enum": [
+ "text_similarity"
+ ],
+ "description": "The type of grader.",
+ "x-stainless-const": true,
+ "default": "text_similarity"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "input": {
+ "type": "string",
+ "description": "The text being graded."
+ },
+ "reference": {
+ "type": "string",
+ "description": "The text being graded against."
+ },
+ "evaluation_metric": {
+ "type": "string",
+ "enum": [
+ "cosine",
+ "fuzzy_match",
+ "bleu",
+ "gleu",
+ "meteor",
+ "rouge_1",
+ "rouge_2",
+ "rouge_3",
+ "rouge_4",
+ "rouge_5",
+ "rouge_l"
+ ],
+ "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`."
+ },
+ "pass_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The threshold for the score."
}
},
- "description": "Configuration of the model used in the insight generation.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "title": "TextSimilarityGrader"
},
- "InsightRequest": {
+ "OpenAI.EvalItem": {
"type": "object",
"required": [
- "type"
+ "role",
+ "content"
],
"properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "user",
+ "assistant",
+ "system",
+ "developer"
+ ],
+ "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`."
+ },
+ "content": {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContent"
+ },
"type": {
- "$ref": "#/components/schemas/InsightType",
- "description": "The type of request."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "EvaluationRunClusterInsight": "#/components/schemas/EvaluationRunClusterInsightRequest",
- "AgentClusterInsight": "#/components/schemas/AgentClusterInsightRequest",
- "EvaluationComparison": "#/components/schemas/EvaluationComparisonInsightRequest"
+ "type": "string",
+ "enum": [
+ "message"
+ ],
+ "description": "The type of the message input. Always `message`.",
+ "x-stainless-const": true
}
},
- "description": "The request of the insights report.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.",
+ "title": "Eval message object"
},
- "InsightResult": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/InsightType",
- "description": "The type of insights result."
+ "OpenAI.EvalItemContent": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItem"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentArray"
}
+ ],
+ "description": "Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.",
+ "title": "Eval content"
+ },
+ "OpenAI.EvalItemContentArray": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItem"
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "EvaluationComparison": "#/components/schemas/EvaluationComparisonInsightResult",
- "EvaluationRunClusterInsight": "#/components/schemas/EvaluationRunClusterInsightResult",
- "AgentClusterInsight": "#/components/schemas/AgentClusterInsightResult"
+ "description": "A list of inputs, each of which may be either an input text, output text, input\nimage, or input audio object.",
+ "title": "An array of Input text, Output text, Input image, and Input audio"
+ },
+ "OpenAI.EvalItemContentItem": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentText"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
}
- },
- "description": "The result of the insights.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ ],
+ "description": "A single content item: input text, output text, input image, or input audio.",
+ "title": "Eval content item"
},
- "InsightSample": {
+ "OpenAI.EvalItemContentItemObject": {
"type": "object",
"required": [
- "id",
- "type",
- "features",
- "correlationInfo"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique identifier for the analysis sample."
- },
"type": {
- "$ref": "#/components/schemas/SampleType",
- "description": "Sample type"
- },
- "features": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Features to help with additional filtering of data in UX."
- },
- "correlationInfo": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Info about the correlation for the analysis sample."
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObjectType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "EvaluationResultSample": "#/components/schemas/EvaluationResultSample"
+ "output_text": "#/components/schemas/OpenAI.EvalItemContentOutputText",
+ "input_image": "#/components/schemas/OpenAI.EvalItemInputImage",
+ "input_audio": "#/components/schemas/OpenAI.InputAudio",
+ "input_text": "#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent"
}
},
- "description": "A sample from the analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "A single content item: input text, output text, input image, or input audio.",
+ "title": "Eval content item"
},
- "InsightScheduleTask": {
+ "OpenAI.EvalItemContentItemObjectInputTextContent": {
"type": "object",
"required": [
"type",
- "insight"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "Insight"
- ]
+ "input_text"
+ ],
+ "description": "The type of the input item. Always `input_text`.",
+ "x-stainless-const": true,
+ "default": "input_text"
},
- "insight": {
- "$ref": "#/components/schemas/Insight",
- "description": "The insight payload."
+ "text": {
+ "type": "string",
+ "description": "The text input to the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/ScheduleTask"
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
}
],
- "description": "Insight task for the schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
- }
- },
- "InsightSummary": {
- "type": "object",
- "required": [
- "sampleCount",
- "uniqueSubclusterCount",
- "uniqueClusterCount",
- "method",
- "usage"
- ],
- "properties": {
- "sampleCount": {
- "type": "integer",
- "format": "int32",
- "description": "Total number of samples analyzed."
- },
- "uniqueSubclusterCount": {
- "type": "integer",
- "format": "int32",
- "description": "Total number of unique subcluster labels."
- },
- "uniqueClusterCount": {
- "type": "integer",
- "format": "int32",
- "description": "Total number of unique clusters."
- },
- "method": {
- "type": "string",
- "description": "Method used for clustering."
- },
- "usage": {
- "$ref": "#/components/schemas/ClusterTokenUsage",
- "description": "Token usage while performing clustering analysis"
- }
- },
- "description": "Summary of the error cluster analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "InsightType": {
+ "OpenAI.EvalItemContentItemObjectType": {
"anyOf": [
{
"type": "string"
@@ -25150,156 +47929,146 @@
{
"type": "string",
"enum": [
- "EvaluationRunClusterInsight",
- "AgentClusterInsight",
- "EvaluationComparison"
+ "input_text",
+ "output_text",
+ "input_image",
+ "input_audio"
]
}
- ],
- "description": "The request of the insights.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ ]
},
- "InsightsMetadata": {
+ "OpenAI.EvalItemContentOutputText": {
"type": "object",
"required": [
- "createdAt"
+ "type",
+ "text"
],
"properties": {
- "createdAt": {
+ "type": {
"type": "string",
- "format": "date-time",
- "description": "The timestamp when the insights were created."
+ "enum": [
+ "output_text"
+ ],
+ "description": "The type of the output text. Always `output_text`.",
+ "x-stainless-const": true
},
- "completedAt": {
+ "text": {
"type": "string",
- "format": "date-time",
- "description": "The timestamp when the insights were completed."
+ "description": "The text output from the model."
}
},
- "description": "Metadata about the insights.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "InvocationsProtocolConfiguration": {
- "type": "object",
- "description": "Configuration specific to the invocations protocol."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ }
+ ],
+ "description": "A text output from the model.",
+ "title": "Output text"
},
- "InvocationsWsProtocolConfiguration": {
- "type": "object",
- "description": "Configuration specific to the WebSocket-based invocations protocol."
+ "OpenAI.EvalItemContentText": {
+ "type": "string",
+ "description": "A text input to the model.",
+ "title": "Text input"
},
- "InvokeAgentInvocationsApiDispatchPayload": {
+ "OpenAI.EvalItemInputImage": {
"type": "object",
"required": [
"type",
- "input"
+ "image_url"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "invoke_agent_invocations_api"
+ "input_image"
],
- "description": "The manual dispatch payload type."
+ "description": "The type of the image input. Always `input_image`.",
+ "x-stainless-const": true
},
- "input": {
- "description": "The JSON value sent as the complete downstream invocations input. The value is passed through as-is and can be an object, string, number, boolean, array, or null."
+ "image_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the image input."
+ },
+ "detail": {
+ "type": "string",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/RoutineDispatchPayload"
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
}
],
- "description": "A manual payload used to test an invocations API routine dispatch.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
+ "description": "An image input block used within EvalItem content arrays.",
+ "title": "Input image"
},
- "InvokeAgentInvocationsApiRoutineAction": {
+ "OpenAI.EvalJsonlFileContentSource": {
"type": "object",
"required": [
- "type"
+ "type",
+ "content"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "invoke_agent_invocations_api"
+ "file_content"
],
- "description": "The action type."
- },
- "agent_name": {
- "type": "string",
- "maxLength": 256,
- "description": "The project-scoped agent name for routine dispatch."
- },
- "agent_endpoint_id": {
- "type": "string",
- "maxLength": 256,
- "description": "Legacy endpoint-scoped agent identifier for routine dispatch."
- },
- "input": {
- "description": "Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied."
+ "description": "The type of jsonl source. Always `file_content`.",
+ "x-stainless-const": true,
+ "default": "file_content"
},
- "session_id": {
- "type": "string",
- "maxLength": 256,
- "description": "An optional existing hosted-agent session identifier to continue during the downstream dispatch."
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent"
+ },
+ "description": "The content of the jsonl file."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/RoutineAction"
- }
+ "title": "EvalJsonlFileContentSource"
+ },
+ "OpenAI.EvalJsonlFileContentSourceContent": {
+ "type": "object",
+ "required": [
+ "item"
],
- "description": "Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "properties": {
+ "item": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "sample": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
}
},
- "InvokeAgentResponsesApiDispatchPayload": {
+ "OpenAI.EvalJsonlFileIdSource": {
"type": "object",
"required": [
"type",
- "input"
+ "id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "invoke_agent_responses_api"
+ "file_id"
],
- "description": "The manual dispatch payload type."
+ "description": "The type of jsonl source. Always `file_id`.",
+ "x-stainless-const": true,
+ "default": "file_id"
},
- "input": {
- "description": "The JSON value sent as the complete downstream responses input. The value is passed through as-is and can be an object, string, number, boolean, array, or null."
+ "id": {
+ "type": "string",
+ "description": "The identifier of the file."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/RoutineDispatchPayload"
- }
- ],
- "description": "A manual payload used to test a responses API routine dispatch.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
+ "title": "EvalJsonlFileIdSource"
},
- "InvokeAgentResponsesApiRoutineAction": {
+ "OpenAI.EvalResponsesSource": {
"type": "object",
"required": [
"type"
@@ -25308,559 +48077,562 @@
"type": {
"type": "string",
"enum": [
- "invoke_agent_responses_api"
+ "responses"
],
- "description": "The action type."
+ "description": "The type of run data source. Always `responses`."
},
- "agent_name": {
- "type": "string",
- "maxLength": 256,
- "description": "The project-scoped agent name for routine dispatch."
+ "metadata": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "agent_endpoint_id": {
- "type": "string",
- "maxLength": 256,
- "description": "Legacy endpoint-scoped agent identifier for routine dispatch."
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "input": {
- "description": "Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied."
+ "instructions_search": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "conversation": {
- "type": "string",
- "maxLength": 256,
- "description": "An optional existing conversation identifier to continue during the downstream dispatch."
+ "created_after": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "created_before": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional reasoning effort parameter. This is a query parameter used to select responses."
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "users": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tools": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/RoutineAction"
- }
- ],
- "description": "Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
+ "description": "A EvalResponsesSource object describing a run data source configuration.",
+ "title": "EvalResponsesSource",
+ "x-oaiMeta": {
+ "name": "The run data source object used to configure an individual run",
+ "group": "eval runs",
+ "example": "{\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"temperature\": 0.7,\n \"top_p\": 1.0,\n \"users\": [\"user1\", \"user2\"],\n \"tools\": [\"tool1\", \"tool2\"],\n \"instructions_search\": \"You are a coding assistant\"\n}\n"
}
},
- "ItemGenerationParams": {
+ "OpenAI.EvalRunOutputItemSample": {
"type": "object",
"required": [
- "type"
+ "input",
+ "output",
+ "finish_reason",
+ "model",
+ "usage",
+ "error",
+ "temperature",
+ "max_completion_tokens",
+ "top_p",
+ "seed"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/ItemGenerationParamsType",
- "description": "The type of item generation parameters to use."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "red_team": "#/components/schemas/RedTeamItemGenerationParams",
- "red_team_seed_prompts": "#/components/schemas/RedTeamSeedPromptsItemGenerationParams",
- "red_team_taxonomy": "#/components/schemas/RedTeamTaxonomyItemGenerationParams",
- "response_retrieval": "#/components/schemas/ResponseRetrievalItemGenerationParams",
- "conversation_gen_preview": "#/components/schemas/ConversationGenPreviewItemGenerationParams",
- "synthetic_data_gen_preview": "#/components/schemas/SyntheticDataGenerationPreviewItemGenerationParams"
- }
- },
- "description": "Represents the set of parameters used to control item generation operations."
- },
- "ItemGenerationParamsType": {
- "anyOf": [
- {
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunOutputItemSampleInput"
+ }
+ },
+ "output": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunOutputItemSampleOutput"
+ }
+ },
+ "finish_reason": {
"type": "string"
},
- {
- "type": "string",
- "enum": [
- "red_team",
- "response_retrieval",
- "red_team_seed_prompts",
- "red_team_taxonomy",
- "synthetic_data_gen_preview",
- "conversation_gen_preview"
- ]
+ "model": {
+ "type": "string"
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage"
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.EvalApiError"
+ },
+ "temperature": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "max_completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "top_p": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "seed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
+ }
+ },
+ "OpenAI.EvalRunOutputItemSampleUsage": {
+ "type": "object",
+ "required": [
+ "total_tokens",
+ "completion_tokens",
+ "prompt_tokens",
+ "cached_tokens"
],
- "description": "The types of parameters for red team item generation."
+ "properties": {
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
},
- "JobStatus": {
- "anyOf": [
- {
+ "OpenAI.EvalRunPerModelUsage": {
+ "type": "object",
+ "required": [
+ "model_name",
+ "invocation_count",
+ "prompt_tokens",
+ "completion_tokens",
+ "total_tokens",
+ "cached_tokens"
+ ],
+ "properties": {
+ "model_name": {
"type": "string"
},
- {
- "type": "string",
- "enum": [
- "queued",
- "in_progress",
- "succeeded",
- "failed",
- "cancelled"
- ]
+ "invocation_count": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "Extensible status values shared by Foundry jobs."
+ }
},
- "LoraConfig": {
+ "OpenAI.EvalRunPerTestingCriteriaResults": {
"type": "object",
+ "required": [
+ "testing_criteria",
+ "passed",
+ "failed"
+ ],
"properties": {
- "rank": {
- "type": "integer",
- "format": "int32",
- "description": "LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64."
+ "testing_criteria": {
+ "type": "string"
},
- "alpha": {
- "type": "integer",
- "format": "int32",
- "description": "LoRA scaling factor (α). Positive integer; typically 2× the rank."
+ "passed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "targetModules": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from adapter_config.json if omitted."
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "dropout": {
- "type": "number",
- "format": "float",
- "description": "Dropout rate used during training. Informational — not used at serving time."
+ "errored": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Number of tests that errored for this criteria."
+ },
+ "skipped": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Number of tests that were skipped for this criteria."
}
- },
- "description": "Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "MCPToolboxTool": {
+ "OpenAI.EvalRunResultCounts": {
"type": "object",
"required": [
- "type",
- "server_label"
+ "total",
+ "errored",
+ "failed",
+ "passed"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp"
- ]
+ "total": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "server_label": {
- "type": "string",
- "description": "A label for this MCP server, used to identify it in tool calls."
+ "errored": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "server_url": {
- "type": "string",
- "format": "uri",
- "description": "The URL for the MCP server. One of `server_url`, `connector_id`, or\n `tunnel_id` must be provided."
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "connector_id": {
+ "passed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "skipped": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Number of output items that were skipped during the evaluation."
+ }
+ }
+ },
+ "OpenAI.EvalStoredCompletionsSource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "connector_dropbox",
- "connector_gmail",
- "connector_googlecalendar",
- "connector_googledrive",
- "connector_microsoftteams",
- "connector_outlookcalendar",
- "connector_outlookemail",
- "connector_sharepoint"
+ "stored_completions"
],
- "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more\n about service connectors [here](/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`"
- },
- "tunnel_id": {
- "type": "string",
- "pattern": "^tunnel_[a-z0-9]{32}$",
- "description": "The Secure MCP Tunnel ID to use instead of a direct server URL. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided."
- },
- "authorization": {
- "type": "string",
- "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here."
- },
- "server_description": {
- "type": "string",
- "description": "Optional description of the MCP server, used to provide more context."
+ "description": "The type of source. Always `stored_completions`.",
+ "x-stainless-const": true,
+ "default": "stored_completions"
},
- "headers": {
+ "metadata": {
"anyOf": [
{
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- }
+ "$ref": "#/components/schemas/OpenAI.Metadata"
},
{
"type": "null"
}
]
},
- "allowed_tools": {
+ "model": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ "type": "null"
+ }
+ ]
+ },
+ "created_after": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
]
},
- "require_approval": {
+ "created_before": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
- "type": "string",
- "enum": [
- "always",
- "never"
- ]
+ "type": "null"
+ }
+ ]
+ },
+ "limit": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
- ],
- "default": "always"
- },
- "defer_loading": {
- "type": "boolean",
- "description": "Whether this MCP tool is deferred and discovered via tool search."
- },
- "project_connection_id": {
- "type": "string",
- "description": "The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server."
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/ToolboxTool"
- }
- ],
- "description": "An MCP tool stored in a toolbox."
+ "description": "A StoredCompletionsRunDataSource configuration describing a set of filters",
+ "title": "StoredCompletionsRunDataSource",
+ "x-oaiMeta": {
+ "name": "The stored completions data source object used to configure an individual run",
+ "group": "eval runs",
+ "example": "{\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o\",\n \"created_after\": 1668124800,\n \"created_before\": 1668124900,\n \"limit\": 100,\n \"metadata\": {}\n}\n"
+ }
},
- "ManagedAgentIdentityBlueprintReference": {
+ "OpenAI.FileCitationBody": {
"type": "object",
"required": [
"type",
- "blueprint_id"
+ "file_id",
+ "index",
+ "filename"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "ManagedAgentIdentityBlueprint"
- ]
+ "file_citation"
+ ],
+ "description": "The type of the file citation. Always `file_citation`.",
+ "x-stainless-const": true
},
- "blueprint_id": {
+ "file_id": {
"type": "string",
- "description": "The ID of the managed blueprint"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentBlueprintReference"
- }
- ]
- },
- "ManagedAzureAISearchIndex": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "description": "The ID of the file."
+ },
+ "index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the file in the list of files."
+ },
+ "filename": {
"type": "string",
- "enum": [
- "ManagedAzureSearch"
- ],
- "description": "Type of index"
+ "description": "The filename of the file cited."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/Index"
+ "$ref": "#/components/schemas/OpenAI.Annotation"
}
],
- "description": "Managed Azure AI Search Index Definition"
+ "description": "A citation to a file.",
+ "title": "File citation"
},
- "ManagedAzureAISearchIndexUpdate": {
+ "OpenAI.FileExpirationAfter": {
"type": "object",
"required": [
- "type"
+ "anchor",
+ "seconds"
],
"properties": {
- "type": {
+ "anchor": {
"type": "string",
"enum": [
- "ManagedAzureSearch"
+ "created_at"
],
- "description": "Type of index"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/IndexUpdate"
- }
- ],
- "description": "Managed Azure AI Search Index Definition"
- },
- "McpProtocolConfiguration": {
- "type": "object",
- "description": "Configuration specific to the MCP protocol."
- },
- "MemoryCommandToolCall": {
- "type": "object",
- "required": [
- "type",
- "call_id",
- "arguments",
- "status"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "memory_command_preview_call"
- ]
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the tool, including `action` (`remember` or `forget`) and `content`."
+ "description": "Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`.",
+ "x-stainless-const": true
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "minimum": 3600,
+ "maximum": 2592000,
+ "description": "The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days)."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "A memory command tool call."
+ "description": "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.",
+ "title": "File expiration policy"
},
- "MemoryCommandToolCallOutput": {
+ "OpenAI.FileInputDetail": {
+ "type": "string",
+ "enum": [
+ "low",
+ "high"
+ ]
+ },
+ "OpenAI.FilePath": {
"type": "object",
"required": [
"type",
- "call_id",
- "status"
+ "file_id",
+ "index"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "memory_command_preview_call_output"
- ]
+ "file_path"
+ ],
+ "description": "The type of the file path. Always `file_path`.",
+ "x-stainless-const": true
},
- "call_id": {
+ "file_id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The ID of the file."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the file in the list of files."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.Annotation"
}
],
- "description": "The output of a memory command tool call."
+ "description": "A path to a file.",
+ "title": "File path"
},
- "MemoryItem": {
- "type": "object",
- "required": [
- "memory_id",
- "updated_at",
- "scope",
- "content",
- "kind"
+ "OpenAI.FilePurpose": {
+ "type": "string",
+ "enum": [
+ "assistants",
+ "batch",
+ "fine-tune",
+ "vision",
+ "user_data",
+ "evals"
],
- "properties": {
- "memory_id": {
- "type": "string",
- "description": "The unique ID of the memory item."
- },
- "updated_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The last update time of the memory item."
- },
- "scope": {
- "type": "string",
- "description": "The namespace that logically groups and isolates memories, such as a user ID."
- },
- "content": {
- "type": "string",
- "description": "The content of the memory."
- },
- "kind": {
- "$ref": "#/components/schemas/MemoryItemKind",
- "description": "The kind of the memory item."
- }
- },
- "discriminator": {
- "propertyName": "kind",
- "mapping": {
- "user_profile": "#/components/schemas/UserProfileMemoryItem",
- "chat_summary": "#/components/schemas/ChatSummaryMemoryItem",
- "procedural": "#/components/schemas/ProceduralMemoryItem"
- }
- },
- "description": "A single memory item stored in the memory store, containing content and metadata.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "The intended purpose of the uploaded file. One of:\n- `assistants`: Used in the Assistants API\n- `batch`: Used in the Batch API\n- `fine-tune`: Used for fine-tuning\n- `vision`: Images used for vision fine-tuning\n- `user_data`: Flexible file type for any purpose\n- `evals`: Used for eval data sets"
},
- "MemoryItemKind": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "user_profile",
- "chat_summary",
- "procedural"
- ]
- }
+ "OpenAI.FileSearchRanker": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "default_2024_08_21"
],
- "description": "Memory item kind.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "The ranker to use for the file search. If not specified will use the `auto` ranker."
},
- "MemoryOperation": {
+ "OpenAI.FileSearchRankingOptions": {
"type": "object",
"required": [
- "kind",
- "memory_item"
+ "score_threshold"
],
"properties": {
- "kind": {
- "$ref": "#/components/schemas/MemoryOperationKind",
- "description": "The type of memory operation being performed."
- },
- "memory_item": {
- "$ref": "#/components/schemas/MemoryItem",
- "description": "The memory item to create, update, or delete."
- }
- },
- "description": "Represents a single memory operation (create, update, or delete) performed on a memory item.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
- },
- "MemoryOperationKind": {
- "anyOf": [
- {
- "type": "string"
+ "ranker": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchRanker"
},
- {
- "type": "string",
- "enum": [
- "create",
- "update",
- "delete"
- ]
- }
- ],
- "description": "Memory operation kind.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
- },
- "MemorySearchItem": {
- "type": "object",
- "required": [
- "memory_item"
- ],
- "properties": {
- "memory_item": {
- "$ref": "#/components/schemas/MemoryItem",
- "description": "Retrieved memory item."
- }
- },
- "description": "A retrieved memory item from memory search.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
- },
- "MemorySearchOptions": {
- "type": "object",
- "properties": {
- "max_memories": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of memory items to return."
+ "score_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1."
}
},
- "description": "Memory search options.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "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.\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.",
+ "title": "File search tool call ranking options"
},
- "MemorySearchPreviewTool": {
+ "OpenAI.FileSearchTool": {
"type": "object",
"required": [
"type",
- "memory_store_name",
- "scope"
+ "vector_store_ids"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "memory_search_preview"
+ "file_search"
],
- "description": "The type of the tool. Always `memory_search_preview`."
+ "description": "The type of the file search tool. Always `file_search`.",
+ "x-stainless-const": true
},
- "memory_store_name": {
- "type": "string",
- "description": "The name of the memory store to use."
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The IDs of the vector stores to search."
},
- "scope": {
- "type": "string",
- "description": "The namespace used to group and isolate memories, such as a user ID.\nLimits which memories can be retrieved or updated.\nUse special variable `{{$userId}}` to scope memories to the current signed-in user."
+ "max_num_results": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive."
},
- "search_options": {
- "$ref": "#/components/schemas/MemorySearchOptions",
- "description": "Options for searching the memory store."
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.RankingOptions",
+ "description": "Ranking options for search."
},
- "update_delay": {
- "type": "integer",
- "format": "int32",
- "description": "Time to wait before updating memories after inactivity (seconds). Default 300.",
- "default": 300
+ "filters": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Filters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
}
},
"allOf": [
@@ -25868,864 +48640,988 @@
"$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "A tool for integrating memories into the agent."
+ "description": "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).",
+ "title": "File search"
},
- "MemorySearchToolCall": {
+ "OpenAI.FileSearchToolCallResults": {
"type": "object",
- "required": [
- "type",
- "status"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "memory_search_call"
- ]
+ "file_id": {
+ "type": "string"
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "text": {
+ "type": "string"
},
- "memories": {
+ "filename": {
+ "type": "string"
+ },
+ "attributes": {
"anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MemoryItem"
- }
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
},
{
"type": "null"
}
- ],
- "description": "The results returned from the memory search."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ ]
+ },
+ "score": {
+ "type": "number",
+ "format": "float"
}
- ],
- "description": "A memory search tool call."
+ }
},
- "MemoryStoreDefaultDefinition": {
- "type": "object",
- "required": [
- "kind",
- "chat_model",
- "embedding_model"
- ],
- "properties": {
- "kind": {
- "type": "string",
- "enum": [
- "default"
- ],
- "description": "The kind of the memory store."
- },
- "chat_model": {
- "type": "string",
- "description": "The name or identifier of the chat completion model deployment used for memory processing."
- },
- "embedding_model": {
- "type": "string",
- "description": "The name or identifier of the embedding model deployment used for memory processing."
+ "OpenAI.Filters": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
},
- "options": {
- "$ref": "#/components/schemas/MemoryStoreDefaultOptions",
- "description": "Default memory store options."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/MemoryStoreDefinition"
+ "$ref": "#/components/schemas/OpenAI.CompoundFilter"
}
- ],
- "description": "Default memory store implementation.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ ]
},
- "MemoryStoreDefaultOptions": {
+ "OpenAI.FineTuneDPOHyperparameters": {
"type": "object",
- "required": [
- "user_profile_enabled",
- "chat_summary_enabled"
- ],
"properties": {
- "user_profile_enabled": {
- "type": "boolean",
- "description": "Whether to enable user profile extraction and storage. Default is true.",
- "default": true
- },
- "user_profile_details": {
- "type": "string",
- "description": "Specific categories or types of user profile information to extract and store."
+ "beta": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.",
+ "default": "auto"
},
- "chat_summary_enabled": {
- "type": "boolean",
- "description": "Whether to enable chat summary extraction and storage. Defaults to `true`.",
- "default": true
+ "batch_size": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
+ "default": "auto"
},
- "procedural_memory_enabled": {
- "type": "boolean",
- "description": "Whether to enable procedural memory extraction and storage. The service defaults to `true` if a value is not specified by the caller.",
- "default": true
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
+ "default": "auto"
},
- "default_ttl_seconds": {
- "type": "integer",
- "format": "int32",
- "description": "The default time-to-live for memories in seconds. A value of `0` indicates that memories do not expire. Defaults to `0`.",
- "default": 0
+ "n_epochs": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
+ "default": "auto"
}
},
- "description": "Default memory store configurations.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "The hyperparameters used for the DPO fine-tuning job."
},
- "MemoryStoreDefinition": {
+ "OpenAI.FineTuneDPOMethod": {
"type": "object",
- "required": [
- "kind"
- ],
"properties": {
- "kind": {
- "$ref": "#/components/schemas/MemoryStoreKind",
- "description": "The kind of the memory store."
- }
- },
- "discriminator": {
- "propertyName": "kind",
- "mapping": {
- "default": "#/components/schemas/MemoryStoreDefaultDefinition"
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneDPOHyperparameters"
}
},
- "description": "Base definition for memory store configurations.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "Configuration for the DPO fine-tuning method."
},
- "MemoryStoreDeleteScopeResponse": {
+ "OpenAI.FineTuneMethod": {
"type": "object",
"required": [
- "object",
- "name",
- "scope",
- "deleted"
+ "type"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "memory_store.scope.deleted"
+ "supervised",
+ "dpo",
+ "reinforcement"
],
- "description": "The object type. Always 'memory_store.scope.deleted'."
+ "description": "The type of method. Is either `supervised`, `dpo`, or `reinforcement`."
},
- "name": {
- "type": "string",
- "description": "The name of the memory store."
+ "supervised": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedMethod"
},
- "scope": {
- "type": "string",
- "description": "The scope from which memories were deleted."
+ "dpo": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneDPOMethod"
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the deletion operation was successful."
+ "reinforcement": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementMethod"
}
},
- "description": "Response for deleting memories from a scope.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
- },
- "MemoryStoreKind": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "default"
- ]
- }
- ],
- "description": "The type of memory store implementation to use.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "The method used for fine-tuning."
},
- "MemoryStoreObject": {
+ "OpenAI.FineTuneReinforcementHyperparameters": {
"type": "object",
- "required": [
- "object",
- "id",
- "created_at",
- "updated_at",
- "name",
- "definition"
- ],
"properties": {
- "object": {
- "type": "string",
- "enum": [
- "memory_store"
+ "batch_size": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
],
- "description": "The object type, which is always 'memory_store'."
- },
- "id": {
- "type": "string",
- "description": "The unique identifier of the memory store."
+ "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
+ "default": "auto"
},
- "created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The Unix timestamp (seconds) when the memory store was created."
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
+ "default": "auto"
},
- "updated_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The Unix timestamp (seconds) when the memory store was last updated."
+ "n_epochs": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
+ "default": "auto"
},
- "name": {
+ "reasoning_effort": {
"type": "string",
- "maxLength": 256,
- "description": "The name of the memory store."
+ "enum": [
+ "default",
+ "low",
+ "medium",
+ "high"
+ ],
+ "description": "Level of reasoning effort.",
+ "default": "default"
},
- "description": {
- "type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the memory store."
+ "compute_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "Multiplier on amount of compute used for exploring search space during training.",
+ "default": "auto"
},
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Arbitrary key-value metadata to associate with the memory store."
+ "eval_interval": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "The number of training steps between evaluation runs.",
+ "default": "auto"
},
- "definition": {
- "$ref": "#/components/schemas/MemoryStoreDefinition",
- "description": "The definition of the memory store."
+ "eval_samples": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "Number of evaluation samples to generate per training step.",
+ "default": "auto"
}
},
- "description": "A memory store that can store and retrieve user memories.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "The hyperparameters used for the reinforcement fine-tuning job."
},
- "MemoryStoreOperationUsage": {
+ "OpenAI.FineTuneReinforcementMethod": {
"type": "object",
"required": [
- "embedding_tokens",
- "input_tokens",
- "input_tokens_details",
- "output_tokens",
- "output_tokens_details",
- "total_tokens"
+ "grader"
],
"properties": {
- "embedding_tokens": {
- "type": "integer",
- "format": "int32",
- "description": "The number of embedding tokens."
- },
- "input_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The number of input tokens."
- },
- "input_tokens_details": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails",
- "description": "A detailed breakdown of the input tokens."
- },
- "output_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The number of output tokens."
- },
- "output_tokens_details": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails",
- "description": "A detailed breakdown of the output tokens."
+ "grader": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderMulti"
+ }
+ ],
+ "description": "The grader used for the fine-tuning job."
},
- "total_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The total number of tokens used."
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters"
}
},
- "description": "Usage statistics of a memory store operation.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "Configuration for the reinforcement fine-tuning method."
},
- "MemoryStoreSearchResponse": {
+ "OpenAI.FineTuneSupervisedHyperparameters": {
"type": "object",
- "required": [
- "search_id",
- "memories",
- "usage"
- ],
"properties": {
- "search_id": {
- "type": "string",
- "description": "The unique ID of this search request. Use this value as previous_search_id in subsequent requests to perform incremental searches."
- },
- "memories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MemorySearchItem"
- },
- "description": "Related memory items found during the search operation."
+ "batch_size": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
+ "default": "auto"
},
- "usage": {
- "$ref": "#/components/schemas/MemoryStoreOperationUsage",
- "description": "Usage statistics associated with the memory search operation."
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
+ "default": "auto"
+ },
+ "n_epochs": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
+ "default": "auto"
}
},
- "description": "Memory search response.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "The hyperparameters used for the fine-tuning job."
},
- "MemoryStoreUpdateCompletedResult": {
+ "OpenAI.FineTuneSupervisedMethod": {
"type": "object",
- "required": [
- "memory_operations",
- "usage"
- ],
"properties": {
- "memory_operations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MemoryOperation"
- },
- "description": "A list of individual memory operations that were performed during the update."
- },
- "usage": {
- "$ref": "#/components/schemas/MemoryStoreOperationUsage",
- "description": "Usage statistics associated with the memory update operation."
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters"
}
},
- "description": "Memory update result.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "Configuration for the supervised fine-tuning method."
},
- "MemoryStoreUpdateResponse": {
+ "OpenAI.FineTuningCheckpointPermission": {
"type": "object",
"required": [
- "update_id",
- "status"
+ "id",
+ "created_at",
+ "project_id",
+ "object"
],
"properties": {
- "update_id": {
+ "id": {
"type": "string",
- "description": "The unique ID of this update request. Use this value as previous_update_id in subsequent requests to perform incremental updates."
+ "description": "The permission identifier, which can be referenced in the API endpoints."
},
- "status": {
- "$ref": "#/components/schemas/MemoryStoreUpdateStatus",
- "description": "The status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", \"failed\", or \"superseded\"."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the permission was created."
},
- "superseded_by": {
+ "project_id": {
"type": "string",
- "description": "The update_id the operation was superseded by when status is \"superseded\"."
- },
- "result": {
- "$ref": "#/components/schemas/MemoryStoreUpdateCompletedResult",
- "description": "The result of memory store update operation when status is \"completed\"."
- },
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error",
- "description": "Error object that describes the error when status is \"failed\"."
- }
- },
- "description": "Provides the status of a memory store update operation.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
- },
- "MemoryStoreUpdateStatus": {
- "anyOf": [
- {
- "type": "string"
+ "description": "The project identifier that the permission is for."
},
- {
+ "object": {
"type": "string",
"enum": [
- "queued",
- "in_progress",
- "completed",
- "failed",
- "superseded"
- ]
+ "checkpoint.permission"
+ ],
+ "description": "The object type, which is always \"checkpoint.permission\".",
+ "x-stainless-const": true
}
- ],
- "description": "Status of a memory store update operation.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
+ },
+ "description": "The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.",
+ "title": "FineTuningCheckpointPermission",
+ "x-oaiMeta": {
+ "name": "The fine-tuned model checkpoint permission object",
+ "example": "{\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1712211699,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n}\n"
}
},
- "MicrosoftFabricPreviewTool": {
+ "OpenAI.FineTuningIntegration": {
"type": "object",
"required": [
"type",
- "fabric_dataagent_preview"
+ "wandb"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "fabric_dataagent_preview"
+ "wandb"
],
- "description": "The object type, which is always 'fabric_dataagent_preview'."
+ "description": "The type of the integration being enabled for the fine-tuning job",
+ "x-stainless-const": true
},
- "fabric_dataagent_preview": {
- "$ref": "#/components/schemas/FabricDataAgentToolParameters",
- "description": "The fabric data agent tool parameters."
+ "wandb": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningIntegrationWandb",
+ "description": "The settings for your integration with Weights and Biases. This payload specifies the project that\n metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags\n to your run, and set a default entity (team, username, etc) to be associated with your run."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "The input definition information for a Microsoft Fabric tool as used to configure an agent."
+ "title": "Fine-Tuning Job Integration"
},
- "ModelCredentialRequest": {
+ "OpenAI.FineTuningIntegrationWandb": {
"type": "object",
"required": [
- "blobUri"
+ "project"
],
"properties": {
- "blobUri": {
- "type": "string",
- "format": "uri",
- "description": "Blob URI of the model asset to fetch credentials for."
+ "project": {
+ "type": "string"
+ },
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "entity": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
- },
- "description": "Request to fetch credentials for a model asset.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "ModelDeployment": {
+ "OpenAI.FineTuningJob": {
"type": "object",
"required": [
- "type",
- "modelName",
- "modelVersion",
- "modelPublisher",
- "capabilities",
- "sku"
+ "id",
+ "created_at",
+ "error",
+ "fine_tuned_model",
+ "finished_at",
+ "hyperparameters",
+ "model",
+ "object",
+ "organization_id",
+ "result_files",
+ "status",
+ "trained_tokens",
+ "training_file",
+ "validation_file",
+ "seed"
],
"properties": {
- "type": {
+ "id": {
"type": "string",
- "enum": [
- "ModelDeployment"
+ "description": "The object identifier, which can be referenced in the API endpoints."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created."
+ },
+ "error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobError"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "fine_tuned_model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "finished_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of the deployment"
+ "type": "integer",
+ "format": "unixTimestamp"
},
- "modelName": {
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobHyperparameters",
+ "description": "The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs."
+ },
+ "model": {
"type": "string",
- "description": "Publisher-specific name of the deployed model",
- "readOnly": true
+ "description": "The base model that is being fine-tuned."
},
- "modelVersion": {
+ "object": {
"type": "string",
- "description": "Publisher-specific version of the deployed model",
- "readOnly": true
+ "enum": [
+ "fine_tuning.job"
+ ],
+ "description": "The object type, which is always \"fine_tuning.job\".",
+ "x-stainless-const": true
},
- "modelPublisher": {
+ "organization_id": {
"type": "string",
- "description": "Name of the deployed model's publisher",
- "readOnly": true
+ "description": "The organization that owns the fine-tuning job."
},
- "capabilities": {
- "type": "object",
- "unevaluatedProperties": {
+ "result_files": {
+ "type": "array",
+ "items": {
"type": "string"
},
- "description": "Capabilities of deployed model",
- "readOnly": true
- },
- "sku": {
- "$ref": "#/components/schemas/Sku",
- "description": "Sku of the model deployment",
- "readOnly": true
+ "description": "The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents)."
},
- "connectionName": {
- "type": "string",
- "description": "Name of the connection the deployment comes from",
- "readOnly": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/Deployment"
- }
- ],
- "description": "Model Deployment Definition"
- },
- "ModelPendingUploadRequest": {
- "type": "object",
- "required": [
- "pendingUploadType"
- ],
- "properties": {
- "pendingUploadId": {
+ "status": {
"type": "string",
- "description": "If PendingUploadId is not provided, a random GUID will be used."
+ "enum": [
+ "validating_files",
+ "queued",
+ "running",
+ "succeeded",
+ "failed",
+ "cancelled"
+ ],
+ "description": "The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`."
},
- "connectionName": {
- "type": "string",
- "description": "Azure Storage Account connection name to use for generating temporary SAS token"
+ "trained_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "pendingUploadType": {
+ "training_file": {
"type": "string",
- "enum": [
- "TemporaryBlobReference"
+ "description": "The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents)."
+ },
+ "validation_file": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "integrations": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningIntegration"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "seed": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The seed used for the fine-tuning job."
+ },
+ "estimated_finish": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of pending upload. Only TemporaryBlobReference is supported for models."
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "method": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneMethod"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "Represents a request for a pending upload of a model version.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
+ "description": "The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.",
+ "title": "FineTuningJob",
+ "x-oaiMeta": {
+ "name": "The fine-tuning job object",
+ "example": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n },\n \"metadata\": {\n \"key\": \"value\"\n }\n}\n"
}
},
- "ModelPendingUploadResponse": {
+ "OpenAI.FineTuningJobCheckpoint": {
"type": "object",
"required": [
- "blobReference",
- "pendingUploadId",
- "pendingUploadType"
+ "id",
+ "created_at",
+ "fine_tuned_model_checkpoint",
+ "step_number",
+ "metrics",
+ "fine_tuning_job_id",
+ "object"
],
"properties": {
- "blobReference": {
- "$ref": "#/components/schemas/BlobReference",
- "description": "Container-level read, write, list SAS."
+ "id": {
+ "type": "string",
+ "description": "The checkpoint identifier, which can be referenced in the API endpoints."
},
- "pendingUploadId": {
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the checkpoint was created."
+ },
+ "fine_tuned_model_checkpoint": {
"type": "string",
- "description": "ID for this upload request."
+ "description": "The name of the fine-tuned checkpoint model that is created."
},
- "version": {
+ "step_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The step number that the checkpoint was created at."
+ },
+ "metrics": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics",
+ "description": "Metrics at the step number during the fine-tuning job."
+ },
+ "fine_tuning_job_id": {
"type": "string",
- "description": "Version of asset to be created if user did not specify version when initially creating upload"
+ "description": "The name of the fine-tuning job that this checkpoint was created from."
},
- "pendingUploadType": {
+ "object": {
"type": "string",
"enum": [
- "TemporaryBlobReference"
+ "fine_tuning.job.checkpoint"
],
- "description": "The type of pending upload. Only TemporaryBlobReference is supported for models."
+ "description": "The object type, which is always \"fine_tuning.job.checkpoint\".",
+ "x-stainless-const": true
}
},
- "description": "Represents the response for a model pending upload request.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
+ "description": "The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.",
+ "title": "FineTuningJobCheckpoint",
+ "x-oaiMeta": {
+ "name": "The fine-tuning job checkpoint object",
+ "example": "{\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P\",\n \"created_at\": 1712211699,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88\",\n \"fine_tuning_job_id\": \"ftjob-fpbNQ3H1GrMehXRf8cO97xTN\",\n \"metrics\": {\n \"step\": 88,\n \"train_loss\": 0.478,\n \"train_mean_token_accuracy\": 0.924,\n \"valid_loss\": 10.112,\n \"valid_mean_token_accuracy\": 0.145,\n \"full_valid_loss\": 0.567,\n \"full_valid_mean_token_accuracy\": 0.944\n },\n \"step_number\": 88\n}\n"
}
},
- "ModelSamplingParams": {
+ "OpenAI.FineTuningJobCheckpointMetrics": {
"type": "object",
"properties": {
- "temperature": {
- "type": "number",
- "format": "float",
- "description": "The temperature parameter for sampling. Defaults to 1.0.",
- "default": 1
+ "step": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "top_p": {
- "type": "number",
- "format": "float",
- "description": "The top-p parameter for nucleus sampling. Defaults to 1.0.",
- "default": 1
+ "train_loss": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "seed": {
- "type": "integer",
- "format": "int32",
- "description": "The random seed for reproducibility. Defaults to 42.",
- "default": 42
+ "train_mean_token_accuracy": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "max_completion_tokens": {
- "type": "integer",
- "format": "int32",
- "description": "The maximum number of tokens allowed in the completion."
+ "valid_loss": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "valid_mean_token_accuracy": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "full_valid_loss": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "full_valid_mean_token_accuracy": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
}
- },
- "description": "Represents a set of parameters used to control the sampling behavior of a language model during text generation."
+ }
},
- "ModelSourceData": {
+ "OpenAI.FineTuningJobError": {
"type": "object",
+ "required": [
+ "code",
+ "message",
+ "param"
+ ],
"properties": {
- "sourceType": {
- "$ref": "#/components/schemas/FoundryModelSourceType",
- "description": "The source type of the model"
+ "code": {
+ "type": "string"
},
- "jobId": {
- "type": "string",
- "description": "The job ID that produced this model"
- }
- },
- "description": "Source information for the model",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
+ "message": {
+ "type": "string"
+ },
+ "param": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
}
},
- "ModelVersion": {
+ "OpenAI.FineTuningJobEvent": {
"type": "object",
"required": [
- "blobUri",
- "name",
- "version"
+ "object",
+ "id",
+ "created_at",
+ "level",
+ "message"
],
"properties": {
- "blobUri": {
- "type": "string",
- "format": "uri",
- "description": "URI of the model artifact in blob storage"
- },
- "weightType": {
- "$ref": "#/components/schemas/FoundryModelWeightType",
- "description": "The weight type of the model"
- },
- "baseModel": {
+ "object": {
"type": "string",
- "description": "Base model asset ID"
- },
- "source": {
- "$ref": "#/components/schemas/ModelSourceData",
- "description": "The source of the model"
- },
- "loraConfig": {
- "$ref": "#/components/schemas/LoraConfig",
- "description": "Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided values take precedence over auto-detected values."
- },
- "artifactProfile": {
- "$ref": "#/components/schemas/ArtifactProfile",
- "description": "The artifact profile of the model",
- "readOnly": true
- },
- "warnings": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/FoundryModelWarning"
- },
- "description": "Service-computed advisory warnings derived from the artifact profile.",
- "readOnly": true
+ "enum": [
+ "fine_tuning.job.event"
+ ],
+ "description": "The object type, which is always \"fine_tuning.job.event\".",
+ "x-stainless-const": true
},
"id": {
"type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
+ "description": "The object identifier."
},
- "name": {
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created."
+ },
+ "level": {
"type": "string",
- "description": "The name of the resource",
- "readOnly": true
+ "enum": [
+ "info",
+ "warn",
+ "error"
+ ],
+ "description": "The log level of the event."
},
- "version": {
+ "message": {
"type": "string",
- "description": "The version of the resource",
- "readOnly": true
+ "description": "The message of the event."
},
- "description": {
+ "type": {
"type": "string",
- "description": "The asset description text."
+ "enum": [
+ "message",
+ "metrics"
+ ],
+ "description": "The type of event."
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
+ "data": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobEventData",
+ "description": "The data associated with the event."
}
},
- "description": "Model Version Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
+ "description": "Fine-tuning job event object",
+ "x-oaiMeta": {
+ "name": "The fine-tuning job event object",
+ "example": "{\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ftevent-abc123\"\n \"created_at\": 1677610602,\n \"level\": \"info\",\n \"message\": \"Created fine-tuning job\",\n \"data\": {},\n \"type\": \"message\"\n}\n"
}
},
- "MonthlyRecurrenceSchedule": {
+ "OpenAI.FineTuningJobEventData": {
+ "type": "object"
+ },
+ "OpenAI.FineTuningJobHyperparameters": {
"type": "object",
- "required": [
- "type",
- "daysOfMonth"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "Monthly"
+ "batch_size": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "Monthly recurrence type."
+ "default": "auto"
},
- "daysOfMonth": {
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int32"
- },
- "description": "Days of the month for the recurrence schedule."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/RecurrenceSchedule"
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "default": "auto"
+ },
+ "n_epochs": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "default": "auto"
}
- ],
- "description": "Monthly recurrence schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
}
},
- "NoAuthenticationCredentials": {
+ "OpenAI.FunctionAndCustomToolCallOutput": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "None"
- ],
- "description": "The credential type ",
- "readOnly": true
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/BaseCredentials"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "input_text": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent",
+ "input_image": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent",
+ "input_file": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent"
}
- ],
- "description": "Credentials that do not require authentication"
+ }
},
- "OAuthConsentRequestOutputItem": {
+ "OpenAI.FunctionAndCustomToolCallOutputInputFileContent": {
"type": "object",
"required": [
- "id",
- "type",
- "consent_link",
- "server_label"
+ "type"
],
"properties": {
- "id": {
- "type": "string"
- },
"type": {
"type": "string",
"enum": [
- "oauth_consent_request"
+ "input_file"
+ ],
+ "description": "The type of the input item. Always `input_file`.",
+ "x-stainless-const": true,
+ "default": "input_file"
+ },
+ "file_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
},
- "consent_link": {
+ "filename": {
"type": "string",
- "description": "The link the user can use to perform OAuth consent."
+ "description": "The name of the file to be sent to the model."
},
- "server_label": {
+ "file_data": {
"type": "string",
- "description": "The server label for the OAuth consent request."
+ "description": "The content of the file to be sent to the model."
+ },
+ "file_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the file to be sent to the model."
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
}
],
- "description": "Request from the service for the user to perform OAuth consent."
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OneTimeTrigger": {
+ "OpenAI.FunctionAndCustomToolCallOutputInputImageContent": {
"type": "object",
"required": [
"type",
- "triggerAt"
+ "detail"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "OneTime"
+ "input_image"
+ ],
+ "description": "The type of the input item. Always `input_image`.",
+ "x-stainless-const": true,
+ "default": "input_image"
+ },
+ "image_url": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
]
},
- "triggerAt": {
- "type": "string",
- "description": "Date and time for the one-time trigger in ISO 8601 format."
+ "file_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "timeZone": {
- "type": "string",
- "description": "Time zone for the one-time trigger. Defaults to `UTC`.",
- "default": "UTC"
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/Trigger"
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
}
],
- "description": "One-time trigger.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
- }
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
+ "title": "Input image"
},
- "OpenAI.Annotation": {
+ "OpenAI.FunctionAndCustomToolCallOutputInputTextContent": {
"type": "object",
"required": [
- "type"
+ "type",
+ "text"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.AnnotationType"
+ "type": "string",
+ "enum": [
+ "input_text"
+ ],
+ "description": "The type of the input item. Always `input_text`.",
+ "x-stainless-const": true,
+ "default": "input_text"
+ },
+ "text": {
+ "type": "string",
+ "description": "The text input to the model."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "file_citation": "#/components/schemas/OpenAI.FileCitationBody",
- "url_citation": "#/components/schemas/OpenAI.UrlCitationBody",
- "container_file_citation": "#/components/schemas/OpenAI.ContainerFileCitationBody",
- "file_path": "#/components/schemas/OpenAI.FilePath"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
}
- },
- "description": "An annotation that applies to a span of output text."
+ ],
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.AnnotationType": {
+ "OpenAI.FunctionAndCustomToolCallOutputType": {
"anyOf": [
{
"type": "string"
@@ -26733,193 +49629,165 @@
{
"type": "string",
"enum": [
- "file_citation",
- "url_citation",
- "container_file_citation",
- "file_path"
+ "input_text",
+ "input_image",
+ "input_file"
]
}
]
},
- "OpenAI.ApplyPatchCallOutputStatus": {
+ "OpenAI.FunctionCallItemStatus": {
"type": "string",
"enum": [
+ "in_progress",
"completed",
- "failed"
+ "incomplete"
]
},
- "OpenAI.ApplyPatchCallOutputStatusParam": {
- "type": "string",
- "enum": [
- "completed",
- "failed"
- ],
- "description": "Outcome values reported for apply_patch tool call outputs.",
- "title": "Apply patch call output status"
- },
- "OpenAI.ApplyPatchCallStatus": {
+ "OpenAI.FunctionCallOutputStatusEnum": {
"type": "string",
"enum": [
"in_progress",
- "completed"
+ "completed",
+ "incomplete"
]
},
- "OpenAI.ApplyPatchCallStatusParam": {
+ "OpenAI.FunctionCallStatus": {
"type": "string",
"enum": [
"in_progress",
- "completed"
- ],
- "description": "Status values reported for apply_patch tool calls.",
- "title": "Apply patch call status"
+ "completed",
+ "incomplete"
+ ]
},
- "OpenAI.ApplyPatchCreateFileOperation": {
+ "OpenAI.FunctionObject": {
"type": "object",
"required": [
- "type",
- "path",
- "diff"
+ "name"
],
"properties": {
- "type": {
+ "description": {
"type": "string",
- "enum": [
- "create_file"
- ],
- "description": "Create a new file with the provided diff.",
- "x-stainless-const": true
+ "description": "A description of what the function does, used by the model to choose when and how to call the function."
},
- "path": {
+ "name": {
"type": "string",
- "description": "Path of the file to create."
+ "description": "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."
},
- "diff": {
- "type": "string",
- "description": "Diff to apply."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
+ "parameters": {
+ "$ref": "#/components/schemas/OpenAI.FunctionParameters"
+ },
+ "strict": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- ],
- "description": "Instruction describing how to create a file via the apply_patch tool.",
- "title": "Apply patch create file operation"
+ }
},
- "OpenAI.ApplyPatchCreateFileOperationParam": {
+ "OpenAI.FunctionParameters": {
"type": "object",
- "required": [
- "type",
- "path",
- "diff"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "create_file"
- ],
- "description": "The operation type. Always `create_file`.",
- "x-stainless-const": true
- },
- "path": {
- "type": "string",
- "minLength": 1,
- "description": "Path of the file to create relative to the workspace root."
- },
- "diff": {
- "type": "string",
- "maxLength": 10485760,
- "description": "Unified diff content to apply when creating the file."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
- }
- ],
- "description": "Instruction for creating a new file via the apply_patch tool.",
- "title": "Apply patch create file operation"
+ "unevaluatedProperties": {},
+ "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\nOmitting `parameters` defines a function with an empty parameter list."
},
- "OpenAI.ApplyPatchDeleteFileOperation": {
+ "OpenAI.FunctionShellAction": {
"type": "object",
"required": [
- "type",
- "path"
+ "commands",
+ "timeout_ms",
+ "max_output_length"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "delete_file"
- ],
- "description": "Delete the specified file.",
- "x-stainless-const": true
+ "commands": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "path": {
- "type": "string",
- "description": "Path of the file to delete."
+ "timeout_ms": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
- }
- ],
- "description": "Instruction describing how to delete a file via the apply_patch tool.",
- "title": "Apply patch delete file operation"
+ "description": "Execute a shell command.",
+ "title": "Shell exec action"
},
- "OpenAI.ApplyPatchDeleteFileOperationParam": {
+ "OpenAI.FunctionShellActionParam": {
"type": "object",
"required": [
- "type",
- "path"
+ "commands"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "delete_file"
- ],
- "description": "The operation type. Always `delete_file`.",
- "x-stainless-const": true
+ "commands": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Ordered shell commands for the execution environment to run."
+ },
+ "timeout_ms": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "path": {
- "type": "string",
- "minLength": 1,
- "description": "Path of the file to delete relative to the workspace root."
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
- }
- ],
- "description": "Instruction for deleting an existing file via the apply_patch tool.",
- "title": "Apply patch delete file operation"
+ "description": "Commands and limits describing how to run the shell tool call.",
+ "title": "Shell action"
},
- "OpenAI.ApplyPatchFileOperation": {
+ "OpenAI.FunctionShellCallEnvironment": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperationType"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironmentType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperation",
- "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation",
- "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation"
+ "local": "#/components/schemas/OpenAI.LocalEnvironmentResource",
+ "container_reference": "#/components/schemas/OpenAI.ContainerReferenceResource"
}
- },
- "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
- "title": "Apply patch operation"
+ }
},
- "OpenAI.ApplyPatchFileOperationType": {
+ "OpenAI.FunctionShellCallEnvironmentType": {
"anyOf": [
{
"type": "string"
@@ -26927,50 +49795,59 @@
{
"type": "string",
"enum": [
- "create_file",
- "delete_file",
- "update_file"
+ "local",
+ "container_reference"
]
}
]
},
- "OpenAI.ApplyPatchOperationParam": {
+ "OpenAI.FunctionShellCallItemParamEnvironment": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParamType"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperationParam",
- "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperationParam",
- "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperationParam"
+ "local": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam",
+ "container_reference": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam"
}
},
- "description": "One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.",
- "title": "Apply patch operation"
+ "description": "The environment to execute the shell commands in."
},
- "OpenAI.ApplyPatchOperationParamType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "container_id"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "create_file",
- "delete_file",
- "update_file"
- ]
+ "container_reference"
+ ],
+ "description": "References a container created with the /v1/containers endpoint",
+ "x-stainless-const": true,
+ "default": "container_reference"
+ },
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the referenced container."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
}
]
},
- "OpenAI.ApplyPatchToolParam": {
+ "OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam": {
"type": "object",
"required": [
"type"
@@ -26979,401 +49856,293 @@
"type": {
"type": "string",
"enum": [
- "apply_patch"
+ "local"
],
- "description": "The type of the tool. Always `apply_patch`.",
- "x-stainless-const": true
+ "description": "Use a local computer environment.",
+ "x-stainless-const": true,
+ "default": "local"
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.LocalSkillParam"
+ },
+ "maxItems": 200,
+ "description": "An optional list of skills."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
+ }
+ ]
+ },
+ "OpenAI.FunctionShellCallItemParamEnvironmentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "local",
+ "container_reference"
+ ]
}
+ ]
+ },
+ "OpenAI.FunctionShellCallItemStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
],
- "description": "Allows the assistant to create, delete, or update files using unified diffs.",
- "title": "Apply patch tool"
+ "description": "Status values reported for shell tool calls.",
+ "title": "Shell call status"
},
- "OpenAI.ApplyPatchUpdateFileOperation": {
+ "OpenAI.FunctionShellCallOutputContent": {
"type": "object",
"required": [
- "type",
- "path",
- "diff"
+ "stdout",
+ "stderr",
+ "outcome"
],
"properties": {
- "type": {
+ "stdout": {
"type": "string",
- "enum": [
- "update_file"
- ],
- "description": "Update an existing file with the provided diff.",
- "x-stainless-const": true
+ "description": "The standard output that was captured."
},
- "path": {
+ "stderr": {
"type": "string",
- "description": "Path of the file to update."
+ "description": "The standard error output that was captured."
},
- "diff": {
+ "outcome": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome",
+ "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.",
+ "title": "Shell call outcome"
+ },
+ "created_by": {
"type": "string",
- "description": "Diff to apply."
+ "description": "The identifier of the actor that created the item."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
- }
+ "description": "The content of a shell tool call output that was emitted.",
+ "title": "Shell call output content"
+ },
+ "OpenAI.FunctionShellCallOutputContentParam": {
+ "type": "object",
+ "required": [
+ "stdout",
+ "stderr",
+ "outcome"
],
- "description": "Instruction describing how to update a file via the apply_patch tool.",
- "title": "Apply patch update file operation"
+ "properties": {
+ "stdout": {
+ "type": "string",
+ "maxLength": 10485760,
+ "description": "Captured stdout output for the shell call."
+ },
+ "stderr": {
+ "type": "string",
+ "maxLength": 10485760,
+ "description": "Captured stderr output for the shell call."
+ },
+ "outcome": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam",
+ "description": "The exit or timeout outcome associated with this shell call."
+ }
+ },
+ "description": "Captured stdout and stderr for a portion of a shell tool call output.",
+ "title": "Shell output content"
},
- "OpenAI.ApplyPatchUpdateFileOperationParam": {
+ "OpenAI.FunctionShellCallOutputExitOutcome": {
"type": "object",
"required": [
"type",
- "path",
- "diff"
+ "exit_code"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "update_file"
+ "exit"
],
- "description": "The operation type. Always `update_file`.",
+ "description": "The outcome type. Always `exit`.",
"x-stainless-const": true
},
- "path": {
- "type": "string",
- "minLength": 1,
- "description": "Path of the file to update relative to the workspace root."
- },
- "diff": {
- "type": "string",
- "maxLength": 10485760,
- "description": "Unified diff content to apply to the existing file."
+ "exit_code": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Exit code from the shell process."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome"
}
],
- "description": "Instruction for updating an existing file via the apply_patch tool.",
- "title": "Apply patch update file operation"
+ "description": "Indicates that the shell commands finished and returned an exit code.",
+ "title": "Shell call exit outcome"
},
- "OpenAI.ApproximateLocation": {
+ "OpenAI.FunctionShellCallOutputExitOutcomeParam": {
"type": "object",
"required": [
- "type"
+ "type",
+ "exit_code"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "approximate"
+ "exit"
],
- "description": "The type of location approximation. Always `approximate`.",
- "x-stainless-const": true,
- "default": "approximate"
- },
- "country": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "region": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "city": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The outcome type. Always `exit`.",
+ "x-stainless-const": true
},
- "timezone": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "exit_code": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The exit code returned by the shell process."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam"
+ }
+ ],
+ "description": "Indicates that the shell commands finished and returned an exit code.",
+ "title": "Shell call exit outcome"
},
- "OpenAI.AutoCodeInterpreterToolParam": {
+ "OpenAI.FunctionShellCallOutputOutcome": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "auto"
- ],
- "description": "Always `auto`.",
- "x-stainless-const": true,
- "default": "auto"
- },
- "file_ids": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "maxItems": 50,
- "description": "An optional list of uploaded files to make available to your code."
- },
- "memory_limit": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit"
- },
- {
- "type": "null"
- }
- ]
- },
- "network_policy": {
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType"
}
},
- "description": "Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.",
- "title": "Automatic Code Interpreter Tool Parameters"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome",
+ "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome"
+ }
+ },
+ "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.",
+ "title": "Shell call outcome"
},
- "OpenAI.ChatCompletionTool": {
+ "OpenAI.FunctionShellCallOutputOutcomeParam": {
"type": "object",
"required": [
- "type",
- "function"
+ "type"
],
"properties": {
"type": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParamType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcomeParam",
+ "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcomeParam"
+ }
+ },
+ "description": "The exit or timeout outcome associated with this shell call.",
+ "title": "Shell call outcome"
+ },
+ "OpenAI.FunctionShellCallOutputOutcomeParamType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
"type": "string",
"enum": [
- "function"
- ],
- "description": "The type of the tool. Currently, only `function` is supported.",
- "x-stainless-const": true
- },
- "function": {
- "$ref": "#/components/schemas/OpenAI.FunctionObject"
+ "timeout",
+ "exit"
+ ]
}
- },
- "description": "A function tool that can be used to generate a response.",
- "title": "Function tool"
+ ]
},
- "OpenAI.ChatModel": {
- "type": "string",
- "enum": [
- "gpt-5.4",
- "gpt-5.4-mini",
- "gpt-5.4-nano",
- "gpt-5.4-mini-2026-03-17",
- "gpt-5.4-nano-2026-03-17",
- "gpt-5.3-chat-latest",
- "gpt-5.2",
- "gpt-5.2-2025-12-11",
- "gpt-5.2-chat-latest",
- "gpt-5.2-pro",
- "gpt-5.2-pro-2025-12-11",
- "gpt-5.1",
- "gpt-5.1-2025-11-13",
- "gpt-5.1-codex",
- "gpt-5.1-mini",
- "gpt-5.1-chat-latest",
- "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-5-chat-latest",
- "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",
- "o4-mini",
- "o4-mini-2025-04-16",
- "o3",
- "o3-2025-04-16",
- "o3-mini",
- "o3-mini-2025-01-31",
- "o1",
- "o1-2024-12-17",
- "o1-preview",
- "o1-preview-2024-09-12",
- "o1-mini",
- "o1-mini-2024-09-12",
- "gpt-4o",
- "gpt-4o-2024-11-20",
- "gpt-4o-2024-08-06",
- "gpt-4o-2024-05-13",
- "gpt-4o-audio-preview",
- "gpt-4o-audio-preview-2024-10-01",
- "gpt-4o-audio-preview-2024-12-17",
- "gpt-4o-audio-preview-2025-06-03",
- "gpt-4o-mini-audio-preview",
- "gpt-4o-mini-audio-preview-2024-12-17",
- "gpt-4o-search-preview",
- "gpt-4o-mini-search-preview",
- "gpt-4o-search-preview-2025-03-11",
- "gpt-4o-mini-search-preview-2025-03-11",
- "chatgpt-4o-latest",
- "codex-mini-latest",
- "gpt-4o-mini",
- "gpt-4o-mini-2024-07-18",
- "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-0301",
- "gpt-3.5-turbo-0613",
- "gpt-3.5-turbo-1106",
- "gpt-3.5-turbo-0125",
- "gpt-3.5-turbo-16k-0613"
+ "OpenAI.FunctionShellCallOutputOutcomeType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "timeout",
+ "exit"
+ ]
+ }
]
},
- "OpenAI.ClickButtonType": {
+ "OpenAI.FunctionShellCallOutputStatusEnum": {
"type": "string",
"enum": [
- "left",
- "right",
- "wheel",
- "back",
- "forward"
+ "in_progress",
+ "completed",
+ "incomplete"
]
},
- "OpenAI.ClickParam": {
+ "OpenAI.FunctionShellCallOutputTimeoutOutcome": {
"type": "object",
"required": [
- "type",
- "button",
- "x",
- "y"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "click"
+ "timeout"
],
- "description": "Specifies the event type. For a click action, this property is always `click`.",
+ "description": "The outcome type. Always `timeout`.",
"x-stainless-const": true
- },
- "button": {
- "$ref": "#/components/schemas/OpenAI.ClickButtonType",
- "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`."
- },
- "x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate where the click occurred."
- },
- "y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate where the click occurred."
- },
- "keys": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome"
}
],
- "description": "A click action.",
- "title": "Click"
+ "description": "Indicates that the shell call exceeded its configured time limit.",
+ "title": "Shell call timeout outcome"
},
- "OpenAI.CodeInterpreterOutputImage": {
+ "OpenAI.FunctionShellCallOutputTimeoutOutcomeParam": {
"type": "object",
"required": [
- "type",
- "url"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "image"
+ "timeout"
],
- "description": "The type of the output. Always `image`.",
- "x-stainless-const": true,
- "default": "image"
- },
- "url": {
- "type": "string",
- "format": "uri",
- "description": "The URL of the image output from the code interpreter."
+ "description": "The outcome type. Always `timeout`.",
+ "x-stainless-const": true
}
},
- "description": "The image output from the code interpreter.",
- "title": "Code interpreter output image"
- },
- "OpenAI.CodeInterpreterOutputLogs": {
- "type": "object",
- "required": [
- "type",
- "logs"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "logs"
- ],
- "description": "The type of the output. Always `logs`.",
- "x-stainless-const": true,
- "default": "logs"
- },
- "logs": {
- "type": "string",
- "description": "The logs output from the code interpreter."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam"
}
- },
- "description": "The logs output from the code interpreter.",
- "title": "Code interpreter output logs"
+ ],
+ "description": "Indicates that the shell call exceeded its configured time limit.",
+ "title": "Shell call timeout outcome"
},
- "OpenAI.CodeInterpreterTool": {
+ "OpenAI.FunctionShellCallStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ "OpenAI.FunctionShellToolParam": {
"type": "object",
"required": [
"type"
@@ -27382,11 +50151,21 @@
"type": {
"type": "string",
"enum": [
- "code_interpreter"
+ "shell"
],
- "description": "The type of the code interpreter tool. Always `code_interpreter`.",
+ "description": "The type of the shell tool. Always `shell`.",
"x-stainless-const": true
},
+ "environment": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
"name": {
"type": "string",
"description": "Deprecated. This property is deprecated and will be removed in a future version.",
@@ -27404,17 +50183,6 @@
},
"description": "Deprecated. This property is deprecated and will be removed in a future version.",
"deprecated": true
- },
- "container": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.AutoCodeInterpreterToolParam"
- }
- ],
- "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code, along with an\noptional `memory_limit` setting.\nIf not provided, the service assumes auto."
}
},
"allOf": [
@@ -27422,97 +50190,179 @@
"$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "A tool that runs Python code to help generate a response to a prompt.",
- "title": "Code interpreter"
+ "description": "A tool that allows the model to execute shell commands.",
+ "title": "Shell tool"
},
- "OpenAI.CompactResource": {
+ "OpenAI.FunctionShellToolParamEnvironment": {
"type": "object",
"required": [
- "id",
- "object",
- "output",
- "created_at",
- "usage"
+ "type"
],
"properties": {
- "id": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "local": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam",
+ "container_reference": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam",
+ "container_auto": "#/components/schemas/OpenAI.ContainerAutoParam"
+ }
+ }
+ },
+ "OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "container_id"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The unique identifier for the compacted response."
+ "enum": [
+ "container_reference"
+ ],
+ "description": "References a container created with the /v1/containers endpoint",
+ "x-stainless-const": true,
+ "default": "container_reference"
},
- "object": {
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the referenced container."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ }
+ ]
+ },
+ "OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "response.compaction"
+ "local"
],
- "description": "The object type. Always `response.compaction`.",
+ "description": "Use a local computer environment.",
"x-stainless-const": true,
- "default": "response.compaction"
+ "default": "local"
},
- "output": {
+ "skills": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.LocalSkillParam"
},
- "description": "The compacted list of output items."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) when the compacted conversation was created."
- },
- "usage": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsage",
- "description": "Token accounting for the compaction pass, including cached, reasoning, and total tokens."
+ "maxItems": 200,
+ "description": "An optional list of skills."
}
},
- "title": "The compacted response object"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ }
+ ]
},
- "OpenAI.CompactResponseMethodPublicBody": {
+ "OpenAI.FunctionShellToolParamEnvironmentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "container_auto",
+ "local",
+ "container_reference"
+ ]
+ }
+ ]
+ },
+ "OpenAI.FunctionTool": {
"type": "object",
"required": [
- "model"
+ "type",
+ "name",
+ "parameters",
+ "strict"
],
"properties": {
- "model": {
- "$ref": "#/components/schemas/OpenAI.ModelIdsCompaction"
+ "type": {
+ "type": "string",
+ "enum": [
+ "function"
+ ],
+ "description": "The type of the function tool. Always `function`.",
+ "x-stainless-const": true
},
- "input": {
+ "name": {
+ "type": "string",
+ "description": "The name of the function to call."
+ },
+ "description": {
"anyOf": [
{
"type": "string"
},
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- },
{
"type": "null"
}
]
},
- "previous_response_id": {
+ "parameters": {
"anyOf": [
{
- "type": "string"
+ "type": "object",
+ "unevaluatedProperties": {}
},
{
"type": "null"
}
]
},
- "instructions": {
+ "strict": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "prompt_cache_key": {
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this function is deferred and loaded via tool search."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "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).",
+ "title": "Function"
+ },
+ "OpenAI.FunctionToolParam": {
+ "type": "object",
+ "required": [
+ "name",
+ "type"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 128,
+ "pattern": "^[a-zA-Z0-9_-]+$"
+ },
+ "description": {
"anyOf": [
{
"type": "string"
@@ -27522,360 +50372,445 @@
}
]
},
- "prompt_cache_retention": {
+ "parameters": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.PromptCacheRetentionEnum"
+ "$ref": "#/components/schemas/OpenAI.EmptyModelParam"
},
{
"type": "null"
}
]
},
- "service_tier": {
+ "strict": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ServiceTierEnum"
+ "type": "boolean"
},
{
"type": "null"
}
]
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "function"
+ ],
+ "x-stainless-const": true,
+ "default": "function"
+ },
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this function should be deferred and discovered via tool search."
}
}
},
- "OpenAI.ComparisonFilter": {
+ "OpenAI.GraderLabelModel": {
"type": "object",
"required": [
"type",
- "key",
- "value"
+ "name",
+ "model",
+ "input",
+ "labels",
+ "passing_labels"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "eq",
- "ne",
- "gt",
- "gte",
- "lt",
- "lte",
- "in",
- "nin"
+ "label_model"
],
- "description": "Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.\n - `eq`: equals\n - `ne`: not equal\n - `gt`: greater than\n - `gte`: greater than or equal\n - `lt`: less than\n - `lte`: less than or equal\n - `in`: in\n - `nin`: not in",
- "default": "eq"
+ "description": "The object type, which is always `label_model`.",
+ "x-stainless-const": true
},
- "key": {
+ "name": {
"type": "string",
- "description": "The key to compare against the value."
+ "description": "The name of the grader."
},
- "value": {
+ "model": {
+ "type": "string",
+ "description": "The model to use for the evaluation. Must support structured outputs."
+ },
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ }
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels to assign to each item in the evaluation."
+ },
+ "passing_labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels that indicate a passing result. Must be a subset of labels."
+ }
+ },
+ "description": "A LabelModelGrader object which uses a model to assign labels to each item\nin the evaluation.",
+ "title": "LabelModelGrader",
+ "x-oaiMeta": {
+ "name": "Label Model Grader",
+ "group": "graders",
+ "example": "{\n \"name\": \"First label grader\",\n \"type\": \"label_model\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"input\": [\n {\n \"type\": \"message\",\n \"role\": \"system\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Classify the sentiment of the following statement as one of positive, neutral, or negative\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Statement: {{item.response}}\"\n }\n }\n ],\n \"passing_labels\": [\n \"positive\"\n ],\n \"labels\": [\n \"positive\",\n \"neutral\",\n \"negative\"\n ]\n}\n"
+ }
+ },
+ "OpenAI.GraderMulti": {
+ "type": "object",
+ "required": [
+ "type",
+ "name",
+ "graders",
+ "calculate_output"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "multi"
+ ],
+ "description": "The object type, which is always `multi`.",
+ "x-stainless-const": true,
+ "default": "multi"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "graders": {
"oneOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
},
{
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
},
{
- "type": "boolean"
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
},
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ]
- }
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderLabelModel"
}
- ],
- "description": "The value to compare against the attribute key; supports string, number, or boolean types."
+ ]
+ },
+ "calculate_output": {
+ "type": "string",
+ "description": "A formula to calculate the output based on grader results."
}
},
- "description": "A filter used to compare a specified attribute key to a given value using a defined comparison operation.",
- "title": "Comparison Filter",
+ "description": "A MultiGrader object combines the output of multiple graders to produce a single score.",
+ "title": "MultiGrader",
"x-oaiMeta": {
- "name": "ComparisonFilter"
+ "name": "Multi Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"multi\",\n \"name\": \"example multi grader\",\n \"graders\": [\n {\n \"type\": \"text_similarity\",\n \"name\": \"example text similarity grader\",\n \"input\": \"The graded text\",\n \"reference\": \"The reference text\",\n \"evaluation_metric\": \"fuzzy_match\"\n },\n {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n ],\n \"calculate_output\": \"0.5 * text_similarity_score + 0.5 * string_check_score)\"\n}\n"
}
},
- "OpenAI.CompoundFilter": {
+ "OpenAI.GraderPython": {
"type": "object",
"required": [
"type",
- "filters"
+ "name",
+ "source"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "and",
- "or"
+ "python"
],
- "description": "Type of operation: `and` or `or`."
+ "description": "The object type, which is always `python`.",
+ "x-stainless-const": true
},
- "filters": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
- },
- {}
- ]
- },
- "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`."
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "source": {
+ "type": "string",
+ "description": "The source code of the python script."
+ },
+ "image_tag": {
+ "type": "string",
+ "description": "The image tag to use for the python script."
}
},
- "description": "Combine multiple filters using `and` or `or`.",
- "title": "Compound Filter",
+ "description": "A PythonGrader object that runs a python script on the input.",
+ "title": "PythonGrader",
"x-oaiMeta": {
- "name": "CompoundFilter"
+ "name": "Python Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"python\",\n \"name\": \"Example python grader\",\n \"image_tag\": \"2025-05-08\",\n \"source\": \"\"\"\ndef grade(sample: dict, item: dict) -> float:\n \"\"\"\n Returns 1.0 if `output_text` equals `label`, otherwise 0.0.\n \"\"\"\n output = sample.get(\"output_text\")\n label = item.get(\"label\")\n return 1.0 if output == label else 0.0\n\"\"\",\n}\n"
}
},
- "OpenAI.ComputerAction": {
+ "OpenAI.GraderScoreModel": {
"type": "object",
"required": [
- "type"
+ "type",
+ "name",
+ "model",
+ "input"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "click": "#/components/schemas/OpenAI.ClickParam",
- "double_click": "#/components/schemas/OpenAI.DoubleClickAction",
- "drag": "#/components/schemas/OpenAI.DragParam",
- "keypress": "#/components/schemas/OpenAI.KeyPressAction",
- "move": "#/components/schemas/OpenAI.MoveParam",
- "screenshot": "#/components/schemas/OpenAI.ScreenshotParam",
- "scroll": "#/components/schemas/OpenAI.ScrollParam",
- "type": "#/components/schemas/OpenAI.TypeParam",
- "wait": "#/components/schemas/OpenAI.WaitParam"
- }
- }
- },
- "OpenAI.ComputerActionList": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- },
- "description": "Flattened batched actions for `computer_use`. Each action includes an\n`type` discriminator and action-specific fields.",
- "title": "Computer Action List"
- },
- "OpenAI.ComputerActionType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
"type": "string",
"enum": [
- "click",
- "double_click",
- "drag",
- "keypress",
- "move",
- "screenshot",
- "scroll",
- "type",
- "wait"
- ]
- }
- ]
- },
- "OpenAI.ComputerCallSafetyCheckParam": {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
+ "score_model"
+ ],
+ "description": "The object type, which is always `score_model`.",
+ "x-stainless-const": true
+ },
+ "name": {
"type": "string",
- "description": "The ID of the pending safety check."
+ "description": "The name of the grader."
},
- "code": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "model": {
+ "type": "string",
+ "description": "The model to use for the evaluation."
},
- "message": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "sampling_params": {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams",
+ "description": "The sampling parameters for the model."
+ },
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ },
+ "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings."
+ },
+ "range": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "description": "The range of the score. Defaults to `[0, 1]`."
}
},
- "description": "A pending safety check for the computer call."
- },
- "OpenAI.ComputerEnvironment": {
- "type": "string",
- "enum": [
- "windows",
- "mac",
- "linux",
- "ubuntu",
- "browser"
- ]
+ "description": "A ScoreModelGrader object that uses a model to assign a score to the input.",
+ "title": "ScoreModelGrader",
+ "x-oaiMeta": {
+ "name": "Score Model Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": (\n \"Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different.\"\n \" Return just a floating point score\n\n\"\n \" Reference answer: {{item.label}}\n\n\"\n \" Model answer: {{sample.output_text}}\"\n )\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/reference.png\",\n \"file_id\": null,\n \"detail\": \"auto\"\n }\n ],\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42,\n \"max_completions_tokens\": 32768,\n \"reasoning_effort\": \"medium\"\n },\n}\n"
+ }
},
- "OpenAI.ComputerScreenshotContent": {
+ "OpenAI.GraderStringCheck": {
"type": "object",
"required": [
"type",
- "image_url",
- "file_id",
- "detail"
+ "name",
+ "input",
+ "reference",
+ "operation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_screenshot"
+ "string_check"
],
- "description": "Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.",
+ "description": "The object type, which is always `string_check`.",
"x-stainless-const": true
},
- "image_url": {
- "anyOf": [
- {
- "type": "string",
- "format": "uri"
- },
- {
- "type": "null"
- }
- ]
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
},
- "file_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "input": {
+ "type": "string",
+ "description": "The input text. This may include template strings."
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
+ "reference": {
+ "type": "string",
+ "description": "The reference text. This may include template strings."
+ },
+ "operation": {
+ "type": "string",
+ "enum": [
+ "eq",
+ "ne",
+ "like",
+ "ilike"
+ ],
+ "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- }
- ],
- "description": "A screenshot of a computer.",
- "title": "Computer screenshot"
+ "description": "A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.",
+ "title": "StringCheckGrader",
+ "x-oaiMeta": {
+ "name": "String Check Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n}\n"
+ }
},
- "OpenAI.ComputerScreenshotImage": {
+ "OpenAI.GraderTextSimilarity": {
"type": "object",
"required": [
- "type"
+ "type",
+ "name",
+ "input",
+ "reference",
+ "evaluation_metric"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_screenshot"
+ "text_similarity"
],
- "description": "Specifies the event type. For a computer screenshot, this property is\n always set to `computer_screenshot`.",
+ "description": "The type of grader.",
"x-stainless-const": true,
- "default": "computer_screenshot"
+ "default": "text_similarity"
},
- "image_url": {
+ "name": {
"type": "string",
- "format": "uri",
- "description": "The URL of the screenshot image."
+ "description": "The name of the grader."
},
- "file_id": {
+ "input": {
"type": "string",
- "description": "The identifier of an uploaded file that contains the screenshot."
+ "description": "The text being graded."
+ },
+ "reference": {
+ "type": "string",
+ "description": "The text being graded against."
+ },
+ "evaluation_metric": {
+ "type": "string",
+ "enum": [
+ "cosine",
+ "fuzzy_match",
+ "bleu",
+ "gleu",
+ "meteor",
+ "rouge_1",
+ "rouge_2",
+ "rouge_3",
+ "rouge_4",
+ "rouge_5",
+ "rouge_l"
+ ],
+ "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`."
}
},
- "description": "A computer screenshot image used with the computer use tool."
+ "description": "A TextSimilarityGrader object which grades text based on similarity metrics.",
+ "title": "TextSimilarityGrader",
+ "x-oaiMeta": {
+ "name": "Text Similarity Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"text_similarity\",\n \"name\": \"Example text similarity grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"evaluation_metric\": \"fuzzy_match\"\n}\n"
+ }
},
- "OpenAI.ComputerTool": {
+ "OpenAI.GrammarSyntax1": {
+ "type": "string",
+ "enum": [
+ "lark",
+ "regex"
+ ]
+ },
+ "OpenAI.HybridSearchOptions": {
"type": "object",
"required": [
- "type"
+ "embedding_weight",
+ "text_weight"
],
"properties": {
- "type": {
+ "embedding_weight": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The weight of the embedding in the reciprocal ranking fusion."
+ },
+ "text_weight": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The weight of the text in the reciprocal ranking fusion."
+ }
+ }
+ },
+ "OpenAI.Image": {
+ "type": "object",
+ "properties": {
+ "b64_json": {
"type": "string",
- "enum": [
- "computer"
- ],
- "description": "The type of the computer tool. Always `computer`.",
- "x-stainless-const": true
+ "contentEncoding": "base64",
+ "description": "The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`."
+ },
+ "url": {
+ "type": "string",
+ "format": "uri",
+ "description": "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 the GPT image models."
+ },
+ "revised_prompt": {
+ "type": "string",
+ "description": "For `dall-e-3` only, the revised prompt that was used to generate the image."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).",
- "title": "Computer"
+ "description": "Represents the content or the URL of an image generated by the OpenAI API."
},
- "OpenAI.ComputerUsePreviewTool": {
+ "OpenAI.ImageDetail": {
+ "type": "string",
+ "enum": [
+ "low",
+ "high",
+ "auto",
+ "original"
+ ]
+ },
+ "OpenAI.ImageGenActionEnum": {
+ "type": "string",
+ "enum": [
+ "generate",
+ "edit",
+ "auto"
+ ]
+ },
+ "OpenAI.ImageGenInputUsageDetails": {
"type": "object",
"required": [
- "type",
- "environment",
- "display_width",
- "display_height"
+ "text_tokens",
+ "image_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_use_preview"
- ],
- "description": "The type of the computer use tool. Always `computer_use_preview`.",
- "x-stainless-const": true
- },
- "environment": {
- "$ref": "#/components/schemas/OpenAI.ComputerEnvironment",
- "description": "The type of computer environment to control."
- },
- "display_width": {
+ "text_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The width of the computer display."
+ "description": "The number of text tokens in the input prompt."
},
- "display_height": {
+ "image_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The height of the computer display."
+ "description": "The number of image tokens in the input prompt."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
+ "description": "The input tokens detailed information for the image generation.",
+ "title": "Input usage details"
+ },
+ "OpenAI.ImageGenOutputTokensDetails": {
+ "type": "object",
+ "required": [
+ "image_tokens",
+ "text_tokens"
],
- "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).",
- "title": "Computer use preview"
+ "properties": {
+ "image_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of image output tokens generated by the model."
+ },
+ "text_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of text output tokens generated by the model."
+ }
+ },
+ "description": "The output token details for the image generation.",
+ "title": "Image generation output token details"
},
- "OpenAI.ContainerAutoParam": {
+ "OpenAI.ImageGenTool": {
"type": "object",
"required": [
"type"
@@ -27884,433 +50819,454 @@
"type": {
"type": "string",
"enum": [
- "container_auto"
+ "image_generation"
],
- "description": "Automatically creates a container for this request",
+ "description": "The type of the image generation tool. Always `image_generation`.",
"x-stainless-const": true
},
- "file_ids": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "maxItems": 50,
- "description": "An optional list of uploaded files to make available to your code."
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "gpt-image-1",
+ "gpt-image-1-mini",
+ "gpt-image-1.5"
+ ]
+ }
+ ],
+ "default": "gpt-image-1"
},
- "memory_limit": {
+ "quality": {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high",
+ "auto"
+ ],
+ "description": "The quality of the generated image. One of `low`, `medium`, `high`,\n or `auto`. Default: `auto`.",
+ "default": "auto"
+ },
+ "size": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "1024x1024",
+ "1024x1536",
+ "1536x1024",
+ "auto"
+ ]
+ }
+ ],
+ "description": "The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.",
+ "default": "auto"
+ },
+ "output_format": {
+ "type": "string",
+ "enum": [
+ "png",
+ "webp",
+ "jpeg"
+ ],
+ "description": "The output format of the generated image. One of `png`, `webp`, or\n `jpeg`. Default: `png`.",
+ "default": "png"
+ },
+ "output_compression": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0,
+ "maximum": 100,
+ "description": "Compression level for the output image. Default: 100.",
+ "default": 100
+ },
+ "moderation": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "low"
+ ],
+ "description": "Moderation level for the generated image. Default: `auto`.",
+ "default": "auto"
+ },
+ "background": {
+ "type": "string",
+ "enum": [
+ "transparent",
+ "opaque",
+ "auto"
+ ],
+ "description": "Background type for the generated image. One of `transparent`,\n `opaque`, or `auto`. Default: `auto`.",
+ "default": "auto"
+ },
+ "input_fidelity": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFidelity"
},
{
"type": "null"
}
]
},
- "skills": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ContainerSkill"
- },
- "maxItems": 200,
- "description": "An optional list of skills referenced by id or inline data."
+ "input_image_mask": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenToolInputImageMask",
+ "description": "Optional mask for inpainting. Contains `image_url`\n (string, optional) and `file_id` (string, optional)."
},
- "network_policy": {
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
+ "partial_images": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0,
+ "maximum": 3,
+ "description": "Number of partial images to generate in streaming mode, from 0 (default value) to 3."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenActionEnum",
+ "description": "Whether to generate a new image or edit an existing image. Default: `auto`."
+ },
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
- ]
+ ],
+ "description": "A tool that generates images using the GPT image models.",
+ "title": "Image generation tool"
},
- "OpenAI.ContainerFileCitationBody": {
+ "OpenAI.ImageGenToolInputImageMask": {
"type": "object",
- "required": [
- "type",
- "container_id",
- "file_id",
- "start_index",
- "end_index",
- "filename"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "container_file_citation"
- ],
- "description": "The type of the container file citation. Always `container_file_citation`.",
- "x-stainless-const": true
- },
- "container_id": {
+ "image_url": {
"type": "string",
- "description": "The ID of the container file."
+ "format": "uri"
},
"file_id": {
- "type": "string",
- "description": "The ID of the file."
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.ImageGenUsage": {
+ "type": "object",
+ "required": [
+ "input_tokens",
+ "total_tokens",
+ "output_tokens",
+ "input_tokens_details"
+ ],
+ "properties": {
+ "input_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of tokens (images and text) in the input prompt."
},
- "start_index": {
+ "total_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the first character of the container file citation in the message."
+ "description": "The total number of tokens (images and text) used for the image generation."
},
- "end_index": {
+ "output_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the last character of the container file citation in the message."
+ "description": "The number of output tokens generated by the model."
},
- "filename": {
- "type": "string",
- "description": "The filename of the container file cited."
+ "output_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenOutputTokensDetails"
+ },
+ "input_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenInputUsageDetails"
}
},
- "allOf": [
+ "description": "For `gpt-image-1` only, the token usage information for the image generation.",
+ "title": "Image generation usage"
+ },
+ "OpenAI.ImageRefParam": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Annotation"
+ "type": "object",
+ "properties": {
+ "image_url": {
+ "type": "string",
+ "format": "uri",
+ "maxLength": 20971520
+ }
+ },
+ "required": [
+ "image_url"
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "file_id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "file_id"
+ ]
}
],
- "description": "A citation for a container file used to generate a model response.",
- "title": "Container file citation"
- },
- "OpenAI.ContainerMemoryLimit": {
- "type": "string",
- "enum": [
- "1g",
- "4g",
- "16g",
- "64g"
- ]
+ "description": "Reference an input image by either URL or uploaded file ID.\nProvide exactly one of `image_url` or `file_id`."
},
- "OpenAI.ContainerNetworkPolicyAllowlistParam": {
+ "OpenAI.ImagesResponse": {
"type": "object",
"required": [
- "type",
- "allowed_domains"
+ "created"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "allowlist"
- ],
- "description": "Allow outbound network access only to specified domains. Always `allowlist`.",
- "x-stainless-const": true
+ "created": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) of when the image was created."
},
- "allowed_domains": {
+ "data": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.Image"
},
- "minItems": 1,
- "description": "A list of allowed domains when type is `allowlist`."
+ "description": "The list of generated images."
+ },
+ "background": {
+ "type": "string",
+ "enum": [
+ "transparent",
+ "opaque"
+ ],
+ "description": "The background parameter used for the image generation. Either `transparent` or `opaque`."
+ },
+ "output_format": {
+ "type": "string",
+ "enum": [
+ "png",
+ "webp",
+ "jpeg"
+ ],
+ "description": "The output format of the image generation. Either `png`, `webp`, or `jpeg`."
+ },
+ "size": {
+ "type": "string",
+ "enum": [
+ "1024x1024",
+ "1024x1536",
+ "1536x1024"
+ ],
+ "description": "The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`."
+ },
+ "quality": {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high"
+ ],
+ "description": "The quality of the image generated. Either `low`, `medium`, or `high`."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenUsage"
}
},
- "allOf": [
+ "description": "The response from the image generation endpoint.",
+ "title": "Image generation response",
+ "x-oaiMeta": {
+ "name": "The image generation response",
+ "group": "images",
+ "example": "{\n \"created\": 1713833628,\n \"data\": [\n {\n \"b64_json\": \"...\"\n }\n ],\n \"background\": \"transparent\",\n \"output_format\": \"png\",\n \"size\": \"1024x1024\",\n \"quality\": \"high\",\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \"image_tokens\": 40\n }\n }\n}\n"
+ }
+ },
+ "OpenAI.IncludeEnum": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "file_search_call.results",
+ "web_search_call.results",
+ "web_search_call.action.sources",
+ "message.input_image.image_url",
+ "computer_call_output.output.image_url",
+ "code_interpreter_call.outputs",
+ "reasoning.encrypted_content",
+ "message.output_text.logprobs",
+ "memory_search_call.results"
+ ]
}
- ]
+ ],
+ "description": "Specify additional output data to include in the model response. Currently supported values are:\n- `web_search_call.results`: Include the search results of the web search tool call.\n- `web_search_call.action.sources`: Include the sources of the web search tool call.\n- `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.\n- `computer_call_output.output.image_url`: Include image urls from the computer call output.\n- `file_search_call.results`: Include the search results of the file search tool call.\n- `message.input_image.image_url`: Include image urls from the input message.\n- `message.output_text.logprobs`: Include logprobs with assistant messages.\n- `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)."
},
- "OpenAI.ContainerNetworkPolicyDisabledParam": {
+ "OpenAI.InlineSkillParam": {
"type": "object",
"required": [
- "type"
+ "type",
+ "name",
+ "description",
+ "source"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "disabled"
+ "inline"
],
- "description": "Disable outbound network access. Always `disabled`.",
+ "description": "Defines an inline skill for this request.",
"x-stainless-const": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the skill."
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the skill."
+ },
+ "source": {
+ "$ref": "#/components/schemas/OpenAI.InlineSkillSourceParam",
+ "description": "Inline skill payload"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
+ "$ref": "#/components/schemas/OpenAI.ContainerSkill"
}
]
},
- "OpenAI.ContainerNetworkPolicyParam": {
+ "OpenAI.InlineSkillSourceParam": {
"type": "object",
"required": [
- "type"
+ "type",
+ "media_type",
+ "data"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParamType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "disabled": "#/components/schemas/OpenAI.ContainerNetworkPolicyDisabledParam",
- "allowlist": "#/components/schemas/OpenAI.ContainerNetworkPolicyAllowlistParam"
- }
- },
- "description": "Network access policy for the container."
- },
- "OpenAI.ContainerNetworkPolicyParamType": {
- "anyOf": [
- {
- "type": "string"
+ "type": "string",
+ "enum": [
+ "base64"
+ ],
+ "description": "The type of the inline skill source. Must be `base64`.",
+ "x-stainless-const": true,
+ "default": "base64"
},
- {
+ "media_type": {
"type": "string",
"enum": [
- "disabled",
- "allowlist"
- ]
+ "application/zip"
+ ],
+ "description": "The media type of the inline skill payload. Must be `application/zip`.",
+ "x-stainless-const": true,
+ "default": "application/zip"
+ },
+ "data": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 70254592,
+ "description": "Base64-encoded skill zip bundle."
}
- ]
+ },
+ "description": "Inline skill payload"
},
- "OpenAI.ContainerReferenceResource": {
+ "OpenAI.InputAudio": {
"type": "object",
"required": [
"type",
- "container_id"
+ "input_audio"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "container_reference"
+ "input_audio"
],
- "description": "The environment type. Always `container_reference`.",
+ "description": "The type of the input item. Always `input_audio`.",
"x-stainless-const": true
},
- "container_id": {
- "type": "string"
+ "input_audio": {
+ "$ref": "#/components/schemas/OpenAI.InputAudioInputAudio"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
}
],
- "description": "Represents a container created with /v1/containers.",
- "title": "Container Reference"
+ "description": "An audio input to the model.",
+ "title": "Input audio"
},
- "OpenAI.ContainerSkill": {
+ "OpenAI.InputAudioInputAudio": {
"type": "object",
"required": [
- "type"
+ "data",
+ "format"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ContainerSkillType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "skill_reference": "#/components/schemas/OpenAI.SkillReferenceParam",
- "inline": "#/components/schemas/OpenAI.InlineSkillParam"
- }
- }
- },
- "OpenAI.ContainerSkillType": {
- "anyOf": [
- {
+ "data": {
"type": "string"
},
- {
+ "format": {
"type": "string",
"enum": [
- "skill_reference",
- "inline"
- ]
- }
- ]
- },
- "OpenAI.ContextManagementParam": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "description": "The context management entry type. Currently only 'compaction' is supported."
- },
- "compact_threshold": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
+ "mp3",
+ "wav"
]
}
}
},
- "OpenAI.ConversationItem": {
+ "OpenAI.InputContent": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ConversationItemType"
+ "$ref": "#/components/schemas/OpenAI.InputContentType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "message": "#/components/schemas/OpenAI.ConversationItemMessage",
- "function_call": "#/components/schemas/OpenAI.ConversationItemFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutput",
- "file_search_call": "#/components/schemas/OpenAI.ConversationItemFileSearchToolCall",
- "web_search_call": "#/components/schemas/OpenAI.ConversationItemWebSearchToolCall",
- "image_generation_call": "#/components/schemas/OpenAI.ConversationItemImageGenToolCall",
- "computer_call": "#/components/schemas/OpenAI.ConversationItemComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.ConversationItemComputerToolCallOutput",
- "tool_search_call": "#/components/schemas/OpenAI.ConversationItemToolSearchCall",
- "tool_search_output": "#/components/schemas/OpenAI.ConversationItemToolSearchOutput",
- "additional_tools": "#/components/schemas/OpenAI.ConversationItemAdditionalTools",
- "reasoning": "#/components/schemas/OpenAI.ConversationItemReasoningItem",
- "compaction": "#/components/schemas/OpenAI.ConversationItemCompactionBody",
- "code_interpreter_call": "#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.ConversationItemFunctionShellCall",
- "shell_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput",
- "apply_patch_call": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall",
- "apply_patch_call_output": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput",
- "mcp_list_tools": "#/components/schemas/OpenAI.ConversationItemMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource",
- "mcp_call": "#/components/schemas/OpenAI.ConversationItemMcpToolCall",
- "custom_tool_call": "#/components/schemas/OpenAI.ConversationItemCustomToolCallResource",
- "custom_tool_call_output": "#/components/schemas/OpenAI.ConversationItemCustomToolCallOutputResource"
- }
- },
- "description": "A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](/docs/api-reference/responses/object#responses/object-output).",
- "title": "Conversation item"
- },
- "OpenAI.ConversationItemAdditionalTools": {
- "type": "object",
- "required": [
- "type",
- "id",
- "role",
- "tools"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "additional_tools"
- ],
- "description": "The type of the item. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the additional tools item."
- },
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role that provided the additional tools."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The additional tool definitions made available at this item."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ]
- },
- "OpenAI.ConversationItemApplyPatchToolCall": {
- "type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "status",
- "operation"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "apply_patch_call"
- ],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
- },
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
- "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
- "title": "Apply patch operation"
- },
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "input_text": "#/components/schemas/OpenAI.InputContentInputTextContent",
+ "input_image": "#/components/schemas/OpenAI.InputContentInputImageContent",
+ "input_file": "#/components/schemas/OpenAI.InputContentInputFileContent"
}
- ],
- "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
- "title": "Apply patch tool call"
+ }
},
- "OpenAI.ConversationItemApplyPatchToolCallOutput": {
+ "OpenAI.InputContentInputFileContent": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "status"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call_output"
+ "input_file"
],
- "description": "The type of the item. Always `apply_patch_call_output`.",
+ "description": "The type of the input item. Always `input_file`.",
"x-stainless-const": true,
- "default": "apply_patch_call_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ "default": "input_file"
},
- "output": {
+ "file_id": {
"anyOf": [
{
"type": "string"
@@ -28320,685 +51276,581 @@
}
]
},
- "created_by": {
+ "filename": {
"type": "string",
- "description": "The ID of the entity that created this tool call output."
+ "description": "The name of the file to be sent to the model."
+ },
+ "file_data": {
+ "type": "string",
+ "description": "The content of the file to be sent to the model."
+ },
+ "file_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the file to be sent to the model."
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputContent"
}
],
- "description": "The output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OpenAI.ConversationItemCodeInterpreterToolCall": {
+ "OpenAI.InputContentInputImageContent": {
"type": "object",
"required": [
"type",
- "id",
- "status",
- "container_id",
- "code",
- "outputs"
+ "detail"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "code_interpreter_call"
+ "input_image"
],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "description": "The type of the input item. Always `input_image`.",
"x-stainless-const": true,
- "default": "code_interpreter_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the code interpreter tool call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
- ],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
- },
- "container_id": {
- "type": "string",
- "description": "The ID of the container used to run the code."
+ "default": "input_image"
},
- "code": {
+ "image_url": {
"anyOf": [
{
- "type": "string"
+ "type": "string",
+ "format": "uri"
},
{
"type": "null"
}
]
},
- "outputs": {
+ "file_id": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
- }
+ "type": "string"
},
{
"type": "null"
}
]
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputContent"
}
],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
+ "title": "Input image"
},
- "OpenAI.ConversationItemCompactionBody": {
+ "OpenAI.InputContentInputTextContent": {
"type": "object",
"required": [
"type",
- "id",
- "encrypted_content"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "compaction"
+ "input_text"
],
- "description": "The type of the item. Always `compaction`.",
+ "description": "The type of the input item. Always `input_text`.",
"x-stainless-const": true,
- "default": "compaction"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the compaction item."
- },
- "encrypted_content": {
- "type": "string",
- "description": "The encrypted content that was produced by compaction."
+ "default": "input_text"
},
- "created_by": {
+ "text": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "The text input to the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputContent"
}
],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.ConversationItemComputerToolCall": {
- "type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "pending_safety_checks",
- "status"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_call"
- ],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the computer call."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used when responding to the tool call with output."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- },
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
- },
- "pending_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The pending safety checks for the computer call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- }
- },
- "allOf": [
+ "OpenAI.InputContentType": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
- },
- "OpenAI.ConversationItemComputerToolCallOutput": {
- "type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "output"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_call_output"
- ],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
- "x-stainless-const": true,
- "default": "computer_call_output"
- },
- "id": {
- "type": "string",
- "description": "The ID of the computer tool call output.",
- "readOnly": true
- },
- "call_id": {
- "type": "string",
- "description": "The ID of the computer tool call that produced the output."
- },
- "acknowledged_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
- },
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "type": "string"
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "type": "string",
+ "enum": [
+ "input_text",
+ "input_image",
+ "input_file"
+ ]
}
+ ]
+ },
+ "OpenAI.InputFidelity": {
+ "type": "string",
+ "enum": [
+ "high",
+ "low"
],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ "description": "Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`."
},
- "OpenAI.ConversationItemCustomToolCallOutputResource": {
+ "OpenAI.InputFileContent": {
"type": "object",
"required": [
- "type",
- "call_id",
- "output",
- "status"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call_output"
+ "input_file"
],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
- },
- "call_id": {
- "type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ "description": "The type of the input item. Always `input_file`.",
+ "x-stainless-const": true,
+ "default": "input_file"
},
- "output": {
- "oneOf": [
+ "file_id": {
+ "anyOf": [
{
"type": "string"
},
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
+ "type": "null"
}
- ],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
+ ]
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "filename": {
+ "type": "string",
+ "description": "The name of the file to be sent to the model."
},
- "created_by": {
+ "file_data": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "The content of the file to be sent to the model."
+ },
+ "file_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the file to be sent to the model."
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "title": "ResponseCustomToolCallOutputItem"
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OpenAI.ConversationItemCustomToolCallResource": {
+ "OpenAI.InputFileContentParam": {
"type": "object",
"required": [
- "type",
- "call_id",
- "name",
- "input",
- "status"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call"
+ "input_file"
],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
+ "description": "The type of the input item. Always `input_file`.",
+ "x-stainless-const": true,
+ "default": "input_file"
},
- "namespace": {
- "type": "string",
- "description": "The namespace of the custom tool being called."
+ "file_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "name": {
- "type": "string",
- "description": "The name of the custom tool being called."
+ "filename": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "input": {
- "type": "string",
- "description": "The input for the custom tool call generated by the model."
+ "file_data": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "file_url": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "title": "ResponseCustomToolCallItem"
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OpenAI.ConversationItemFileSearchToolCall": {
+ "OpenAI.InputImageContent": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "queries"
+ "detail"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the file search tool call."
- },
"type": {
"type": "string",
"enum": [
- "file_search_call"
- ],
- "description": "The type of the file search tool call. Always `file_search_call`.",
- "x-stainless-const": true
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "incomplete",
- "failed"
+ "input_image"
],
- "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
+ "description": "The type of the input item. Always `input_image`.",
+ "x-stainless-const": true,
+ "default": "input_image"
},
- "queries": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The queries used to search for files."
+ "image_url": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "results": {
+ "file_id": {
"anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
- }
+ "type": "string"
},
{
"type": "null"
}
]
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
- "title": "File search tool call"
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
+ "title": "Input image"
},
- "OpenAI.ConversationItemFunctionShellCall": {
+ "OpenAI.InputImageContentParamAutoParam": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "action",
- "status",
- "environment"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call"
+ "input_image"
],
- "description": "The type of the item. Always `shell_call`.",
+ "description": "The type of the input item. Always `input_image`.",
"x-stainless-const": true,
- "default": "shell_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
- "description": "The shell commands and limits that describe how to run the tool call."
+ "default": "input_image"
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
- "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
+ "image_url": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "environment": {
+ "file_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
+ "detail": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.DetailEnum"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision)",
+ "title": "Input image"
+ },
+ "OpenAI.InputItem": {
+ "type": "object",
+ "required": [
+ "type"
],
- "description": "A tool call that executes one or more shell commands in a managed environment.",
- "title": "Shell tool call"
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.InputItemType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "message": "#/components/schemas/OpenAI.EasyInputMessage",
+ "item_reference": "#/components/schemas/OpenAI.ItemReferenceParam",
+ "output_message": "#/components/schemas/OpenAI.InputItemOutputMessage",
+ "file_search_call": "#/components/schemas/OpenAI.InputItemFileSearchToolCall",
+ "computer_call": "#/components/schemas/OpenAI.InputItemComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.InputItemComputerCallOutputItemParam",
+ "web_search_call": "#/components/schemas/OpenAI.InputItemWebSearchToolCall",
+ "function_call": "#/components/schemas/OpenAI.InputItemFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.InputItemFunctionCallOutputItemParam",
+ "tool_search_call": "#/components/schemas/OpenAI.InputItemToolSearchCallItemParam",
+ "tool_search_output": "#/components/schemas/OpenAI.InputItemToolSearchOutputItemParam",
+ "additional_tools": "#/components/schemas/OpenAI.InputItemAdditionalToolsItemParam",
+ "reasoning": "#/components/schemas/OpenAI.InputItemReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.InputItemCompactionSummaryItemParam",
+ "image_generation_call": "#/components/schemas/OpenAI.InputItemImageGenToolCall",
+ "code_interpreter_call": "#/components/schemas/OpenAI.InputItemCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.InputItemLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.InputItemLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.InputItemFunctionShellCallItemParam",
+ "shell_call_output": "#/components/schemas/OpenAI.InputItemFunctionShellCallOutputItemParam",
+ "apply_patch_call": "#/components/schemas/OpenAI.InputItemApplyPatchToolCallItemParam",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.InputItemApplyPatchToolCallOutputItemParam",
+ "mcp_list_tools": "#/components/schemas/OpenAI.InputItemMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.InputItemMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.InputItemMcpApprovalResponse",
+ "mcp_call": "#/components/schemas/OpenAI.InputItemMcpToolCall",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.InputItemCustomToolCallOutput",
+ "custom_tool_call": "#/components/schemas/OpenAI.InputItemCustomToolCall"
+ }
+ },
+ "description": "An item representing part of the context for the response to be\ngenerated by the model. Can contain text, images, and audio inputs,\nas well as previous assistant responses and tool call outputs."
},
- "OpenAI.ConversationItemFunctionShellCallOutput": {
+ "OpenAI.InputItemAdditionalToolsItemParam": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "output",
- "max_output_length"
+ "role",
+ "tools"
],
"properties": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
"type": {
"type": "string",
"enum": [
- "shell_call_output"
+ "additional_tools"
],
- "description": "The type of the shell call output. Always `shell_call_output`.",
+ "description": "The item type. Always `additional_tools`.",
"x-stainless-const": true,
- "default": "shell_call_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell call output. Populated when this item is returned via API."
+ "default": "additional_tools"
},
- "call_id": {
+ "role": {
"type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
- "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ "enum": [
+ "developer"
+ ],
+ "description": "The role that provided the additional tools. Only `developer` is supported.",
+ "x-stainless-const": true,
+ "default": "developer"
},
- "output": {
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
+ "$ref": "#/components/schemas/OpenAI.Tool"
},
- "description": "An array of shell call output contents"
- },
- "max_output_length": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "A list of additional tools made available at this item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
- ],
- "description": "The output of a shell tool call that was emitted.",
- "title": "Shell call output"
+ ]
},
- "OpenAI.ConversationItemFunctionToolCall": {
+ "OpenAI.InputItemApplyPatchToolCallItemParam": {
"type": "object",
"required": [
- "id",
"type",
"call_id",
- "name",
- "arguments"
+ "status",
+ "operation"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call"
+ "apply_patch_call"
],
- "description": "The type of the function tool call. Always `function_call`.",
- "x-stainless-const": true
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the function to run."
+ "description": "The type of the item. Always `apply_patch_call`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call"
},
- "name": {
- "type": "string",
- "description": "The name of the function to run."
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "arguments": {
+ "call_id": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the function."
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
"status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatusParam",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ },
+ "operation": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam",
+ "description": "The specific create, delete, or update instruction for the apply_patch tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
- "title": "Function tool call"
+ "description": "A tool call representing a request to create, delete, or update files using diff patches.",
+ "title": "Apply patch tool call"
},
- "OpenAI.ConversationItemFunctionToolCallOutput": {
+ "OpenAI.InputItemApplyPatchToolCallOutputItemParam": {
"type": "object",
"required": [
- "id",
"type",
"call_id",
- "output"
+ "status"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call_output"
+ "apply_patch_call_output"
],
- "description": "The type of the function tool call output. Always `function_call_output`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `apply_patch_call_output`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call_output"
+ },
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"call_id": {
"type": "string",
- "description": "The unique ID of the function tool call generated by the model."
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the apply patch tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
},
"output": {
- "oneOf": [
- {
- "type": "string"
- },
+ "anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
+ "type": "string"
+ },
+ {
+ "type": "null"
}
- ],
- "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
+ "description": "The streamed output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
},
- "OpenAI.ConversationItemImageGenToolCall": {
+ "OpenAI.InputItemCodeInterpreterToolCall": {
"type": "object",
"required": [
"type",
"id",
"status",
- "result"
+ "container_id",
+ "code",
+ "outputs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "image_generation_call"
+ "code_interpreter_call"
],
- "description": "The type of the image generation call. Always `image_generation_call`.",
- "x-stainless-const": true
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "x-stainless-const": true,
+ "default": "code_interpreter_call"
},
"id": {
"type": "string",
- "description": "The unique ID of the image generation call."
+ "description": "The unique ID of the code interpreter tool call."
},
"status": {
"type": "string",
"enum": [
"in_progress",
"completed",
- "generating",
+ "incomplete",
+ "interpreting",
"failed"
],
- "description": "The status of the image generation call."
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
},
- "result": {
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the container used to run the code."
+ },
+ "code": {
"anyOf": [
{
"type": "string"
@@ -29007,328 +51859,364 @@
"type": "null"
}
]
+ },
+ "outputs": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
},
- "OpenAI.ConversationItemList": {
+ "OpenAI.InputItemCompactionSummaryItemParam": {
"type": "object",
"required": [
- "object",
- "data",
- "has_more",
- "first_id",
- "last_id"
+ "type",
+ "encrypted_content"
],
"properties": {
- "object": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "type": {
"type": "string",
"enum": [
- "list"
+ "compaction"
],
- "description": "The type of object returned, must be `list`.",
- "x-stainless-const": true
- },
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- },
- "description": "A list of conversation items.",
- "x-ms-list-page-items": true
- },
- "has_more": {
- "type": "boolean",
- "description": "Whether there are more items available."
- },
- "first_id": {
- "type": "string",
- "description": "The ID of the first item in the list."
+ "description": "The type of the item. Always `compaction`.",
+ "x-stainless-const": true,
+ "default": "compaction"
},
- "last_id": {
+ "encrypted_content": {
"type": "string",
- "description": "The ID of the last item in the list.",
- "x-ms-list-continuation-token": true
+ "maxLength": 10485760,
+ "description": "The encrypted content of the compaction summary."
}
},
- "description": "A list of Conversation items.",
- "title": "The conversation item list",
- "x-oaiMeta": {
- "name": "The item list",
- "group": "conversations"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "OpenAI.ConversationItemLocalShellToolCall": {
+ "OpenAI.InputItemComputerCallOutputItemParam": {
"type": "object",
"required": [
- "type",
- "id",
"call_id",
- "action",
- "status"
+ "type",
+ "output"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "local_shell_call"
- ],
- "description": "The type of the local shell call. Always `local_shell_call`.",
- "x-stainless-const": true
- },
"id": {
- "type": "string",
- "description": "The unique ID of the local shell call."
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"call_id": {
"type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The ID of the computer tool call that produced the output."
},
- "status": {
+ "type": {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete"
+ "computer_call_output"
],
- "description": "The status of the local shell call."
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "x-stainless-const": true,
+ "default": "computer_call_output"
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ },
+ "acknowledged_safety_checks": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "status": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A tool call to run a command on the local shell.",
- "title": "Local shell call"
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "OpenAI.ConversationItemLocalShellToolCallOutput": {
+ "OpenAI.InputItemComputerToolCall": {
"type": "object",
"required": [
"type",
"id",
- "output"
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call_output"
+ "computer_call"
],
- "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
- "x-stainless-const": true
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
"id": {
"type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "description": "The unique ID of the computer call."
},
- "output": {
+ "call_id": {
"type": "string",
- "description": "A JSON string of the output of the local shell tool call."
+ "description": "An identifier used when responding to the tool call with output."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ },
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ },
+ "pending_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The pending safety checks for the computer call."
},
"status": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "The output of a local shell tool call.",
- "title": "Local shell call output"
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "OpenAI.ConversationItemMcpApprovalRequest": {
+ "OpenAI.InputItemCustomToolCall": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
+ "call_id",
"name",
- "arguments"
+ "input"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_request"
+ "custom_tool_call"
],
- "description": "The type of the item. Always `mcp_approval_request`.",
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
"x-stainless-const": true
},
"id": {
"type": "string",
- "description": "The unique ID of the approval request."
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
},
- "server_label": {
+ "call_id": {
"type": "string",
- "description": "The label of the MCP server making the request."
+ "description": "An identifier used to map this custom tool call to a tool call output."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the custom tool being called."
},
"name": {
"type": "string",
- "description": "The name of the tool to run."
+ "description": "The name of the custom tool being called."
},
- "arguments": {
+ "input": {
"type": "string",
- "description": "A JSON string of arguments for the tool."
+ "description": "The input for the custom tool call generated by the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A request for human approval of a tool invocation.",
- "title": "MCP approval request"
+ "description": "A call to a custom tool created by the model.",
+ "title": "Custom tool call"
},
- "OpenAI.ConversationItemMcpApprovalResponseResource": {
+ "OpenAI.InputItemCustomToolCallOutput": {
"type": "object",
"required": [
"type",
- "id",
- "approval_request_id",
- "approve"
+ "call_id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_response"
+ "custom_tool_call_output"
],
- "description": "The type of the item. Always `mcp_approval_response`.",
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
"x-stainless-const": true
},
"id": {
"type": "string",
- "description": "The unique ID of the approval response"
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
},
- "approval_request_id": {
+ "call_id": {
"type": "string",
- "description": "The ID of the approval request being answered."
- },
- "approve": {
- "type": "boolean",
- "description": "Whether the request was approved."
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
},
- "reason": {
- "anyOf": [
+ "output": {
+ "oneOf": [
{
"type": "string"
},
{
- "type": "null"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
}
- ]
+ ],
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A response to an MCP approval request.",
- "title": "MCP approval response"
+ "description": "The output of a custom tool call from your code, being sent back to the model.",
+ "title": "Custom tool call output"
},
- "OpenAI.ConversationItemMcpListTools": {
+ "OpenAI.InputItemFileSearchToolCall": {
"type": "object",
"required": [
- "type",
"id",
- "server_label",
- "tools"
+ "type",
+ "status",
+ "queries"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the file search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "mcp_list_tools"
+ "file_search_call"
],
- "description": "The type of the item. Always `mcp_list_tools`.",
+ "description": "The type of the file search tool call. Always `file_search_call`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the list."
- },
- "server_label": {
+ "status": {
"type": "string",
- "description": "The label of the MCP server."
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "incomplete",
+ "failed"
+ ],
+ "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
},
- "tools": {
+ "queries": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
+ "type": "string"
},
- "description": "The tools available on the server."
+ "description": "The queries used to search for files."
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "results": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A list of tools available on an MCP server.",
- "title": "MCP list tools"
+ "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
+ "title": "File search tool call"
},
- "OpenAI.ConversationItemMcpToolCall": {
+ "OpenAI.InputItemFunctionCallOutputItemParam": {
"type": "object",
"required": [
+ "call_id",
"type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "output"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp_call"
- ],
- "description": "The type of the item. Always `mcp_call`.",
- "x-stainless-const": true
- },
"id": {
- "type": "string",
- "description": "The unique ID of the tool call."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server running the tool."
- },
- "name": {
- "type": "string",
- "description": "The name of the tool that was run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments passed to the tool."
- },
- "output": {
"anyOf": [
{
"type": "string"
@@ -29338,75 +52226,49 @@
}
]
},
- "error": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
- "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the function tool call generated by the model."
},
- "approval_request_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "An invocation of a tool on an MCP server.",
- "title": "MCP tool call"
- },
- "OpenAI.ConversationItemMessage": {
- "type": "object",
- "required": [
- "type",
- "id",
- "status",
- "role",
- "content"
- ],
- "properties": {
"type": {
"type": "string",
"enum": [
- "message"
+ "function_call_output"
],
- "description": "The type of the message. Always set to `message`.",
+ "description": "The type of the function tool call output. Always `function_call_output`.",
"x-stainless-const": true,
- "default": "message"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the message."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MessageStatus",
- "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API."
- },
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`."
+ "default": "function_call_output"
},
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- },
- "description": "The content of the message"
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputTextContentParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputImageContentParamAutoParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFileContentParam"
+ }
+ ]
+ }
+ }
+ ],
+ "description": "Text, image, or file output of the function tool call."
},
- "phase": {
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
},
{
"type": "null"
@@ -29416,33 +52278,21 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A message to or from the model.",
- "title": "Message"
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
},
- "OpenAI.ConversationItemReasoningItem": {
+ "OpenAI.InputItemFunctionShellCallItemParam": {
"type": "object",
"required": [
+ "call_id",
"type",
- "id",
- "summary"
+ "action"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "reasoning"
- ],
- "description": "The type of the object. Always `reasoning`.",
- "x-stainless-const": true
- },
"id": {
- "type": "string",
- "description": "The unique identifier of the reasoning content."
- },
- "encrypted_content": {
"anyOf": [
{
"type": "string"
@@ -29452,119 +52302,63 @@
}
]
},
- "summary": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
- },
- "description": "Reasoning summary content."
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
- },
- "description": "Reasoning text content."
- },
- "status": {
+ "call_id": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
- },
- "OpenAI.ConversationItemToolSearchCall": {
- "type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "execution",
- "arguments",
- "status"
- ],
- "properties": {
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
"type": {
"type": "string",
"enum": [
- "tool_search_call"
+ "shell_call"
],
- "description": "The type of the item. Always `tool_search_call`.",
+ "description": "The type of the item. Always `shell_call`.",
"x-stainless-const": true,
- "default": "tool_search_call"
+ "default": "shell_call"
},
- "id": {
- "type": "string",
- "description": "The unique ID of the tool search call item."
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellActionParam",
+ "description": "The shell commands and limits that describe how to run the tool call."
},
- "call_id": {
+ "status": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
},
{
"type": "null"
}
]
},
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "arguments": {
- "description": "Arguments used for the tool search call."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the tool search call item that was recorded."
- },
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "environment": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
- ]
+ ],
+ "description": "A tool representing a request to execute one or more shell commands.",
+ "title": "Shell tool call"
},
- "OpenAI.ConversationItemToolSearchOutput": {
+ "OpenAI.InputItemFunctionShellCallOutputItemParam": {
"type": "object",
"required": [
- "type",
- "id",
"call_id",
- "execution",
- "tools",
- "status"
+ "type",
+ "output"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "tool_search_output"
- ],
- "description": "The type of the item. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
- },
"id": {
- "type": "string",
- "description": "The unique ID of the tool search output item."
- },
- "call_id": {
"anyOf": [
{
"type": "string"
@@ -29574,801 +52368,556 @@
}
]
},
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the shell tool call generated by the model."
},
- "tools": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "shell_call_output"
+ ],
+ "description": "The type of the item. Always `shell_call_output`.",
+ "x-stainless-const": true,
+ "default": "shell_call_output"
+ },
+ "output": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContentParam"
},
- "description": "The loaded tool definitions returned by tool search."
+ "description": "Captured chunks of stdout and stderr output, along with their associated outcomes."
},
"status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the tool search output item that was recorded."
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ]
- },
- "OpenAI.ConversationItemType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "message",
- "function_call",
- "function_call_output",
- "file_search_call",
- "web_search_call",
- "image_generation_call",
- "computer_call",
- "computer_call_output",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "reasoning",
- "compaction",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "mcp_call",
- "custom_tool_call",
- "custom_tool_call_output"
- ]
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
- ]
+ ],
+ "description": "The streamed output items emitted by a shell tool call.",
+ "title": "Shell tool call output"
},
- "OpenAI.ConversationItemWebSearchToolCall": {
+ "OpenAI.InputItemFunctionToolCall": {
"type": "object",
"required": [
"id",
"type",
- "status",
- "action"
+ "call_id",
+ "name",
+ "arguments"
],
"properties": {
"id": {
"type": "string",
- "description": "The unique ID of the web search tool call."
+ "description": "The unique ID of the function tool call.",
+ "readOnly": true
},
"type": {
"type": "string",
"enum": [
- "web_search_call"
+ "function_call"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
+ "description": "The type of the function tool call. Always `function_call`.",
"x-stainless-const": true
},
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the function to run."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the function to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the function."
+ },
"status": {
"type": "string",
"enum": [
"in_progress",
- "searching",
"completed",
- "failed",
"incomplete"
],
- "description": "The status of the web search tool call."
- },
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
- }
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
- },
- "OpenAI.ConversationParam": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ConversationParam-2"
- }
- ],
- "description": "The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.\nInput items and output items from this response are automatically added to this conversation after this response completes."
- },
- "OpenAI.ConversationParam-2": {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the conversation."
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
- },
- "description": "The conversation that this response belongs to.",
- "title": "Conversation object"
- },
- "OpenAI.ConversationReference": {
- "type": "object",
- "required": [
- "id"
],
- "properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the conversation that this response was associated with."
- }
- },
- "description": "The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.",
- "title": "Conversation"
+ "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
+ "title": "Function tool call"
},
- "OpenAI.ConversationResource": {
+ "OpenAI.InputItemImageGenToolCall": {
"type": "object",
"required": [
+ "type",
"id",
- "object",
- "metadata",
- "created_at"
+ "status",
+ "result"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the conversation."
- },
- "object": {
+ "type": {
"type": "string",
"enum": [
- "conversation"
+ "image_generation_call"
],
- "description": "The object type, which is always `conversation`.",
- "x-stainless-const": true,
- "default": "conversation"
- },
- "metadata": {
- "$ref": "#/components/schemas/OpenAI.Metadata",
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ "description": "The type of the image generation call. Always `image_generation_call`.",
+ "x-stainless-const": true
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The time at which the conversation was created, measured in seconds since the Unix epoch."
- }
- }
- },
- "OpenAI.CoordParam": {
- "type": "object",
- "required": [
- "x",
- "y"
- ],
- "properties": {
- "x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the image generation call."
},
- "y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate."
- }
- },
- "description": "An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.",
- "title": "Coordinate"
- },
- "OpenAI.CreateChatCompletionRequestResponseFormat": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "text": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText",
- "json_object": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject",
- "json_schema": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
- }
- },
- "description": "An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it."
- },
- "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "status": {
"type": "string",
"enum": [
- "json_object"
+ "in_progress",
+ "completed",
+ "generating",
+ "failed"
],
- "description": "The type of response format being defined. Always `json_object`.",
- "x-stainless-const": true
+ "description": "The status of the image generation call."
+ },
+ "result": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
- "title": "JSON object"
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
},
- "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText": {
+ "OpenAI.InputItemLocalShellToolCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "call_id",
+ "action",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "text"
+ "local_shell_call"
],
- "description": "The type of response format being defined. Always `text`.",
+ "description": "The type of the local shell call. Always `local_shell_call`.",
"x-stainless-const": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
- }
- ],
- "description": "Default response format. Used to generate text responses.",
- "title": "Text"
- },
- "OpenAI.CreateChatCompletionRequestResponseFormatType": {
- "anyOf": [
- {
- "type": "string"
},
- {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell call."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ },
+ "status": {
"type": "string",
"enum": [
- "text",
- "json_schema",
- "json_object"
- ]
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the local shell call."
}
- ]
- },
- "OpenAI.CreateConversationBody": {
- "type": "object",
- "properties": {
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
- },
- "items": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- },
- {
- "type": "null"
- }
- ]
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
- }
+ ],
+ "description": "A tool call to run a command on the local shell.",
+ "title": "Local shell call"
},
- "OpenAI.CreateEvalCompletionsRunDataSource": {
+ "OpenAI.InputItemLocalShellToolCallOutput": {
"type": "object",
"required": [
"type",
- "source"
+ "id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "completions"
- ],
- "description": "The type of run data source. Always `completions`.",
- "default": "completions"
- },
- "input_messages": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
- }
+ "local_shell_call_output"
],
- "description": "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."
+ "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "x-stainless-const": true
},
- "sampling_params": {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
},
- "model": {
+ "output": {
"type": "string",
- "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")."
+ "description": "A JSON string of the output of the local shell tool call."
},
- "source": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
- },
+ "status": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
},
{
- "$ref": "#/components/schemas/OpenAI.EvalStoredCompletionsSource"
+ "type": "null"
}
- ],
- "description": "Determines what populates the `item` namespace in this run's data source."
+ ]
}
},
- "description": "A CompletionsRunDataSource object describing a model sampling configuration.",
- "title": "CompletionsRunDataSource",
- "x-oaiMeta": {
- "name": "The completions data source object used to configure an individual run",
- "group": "eval runs",
- "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"completions\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "The output of a local shell tool call.",
+ "title": "Local shell call output"
},
- "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference": {
+ "OpenAI.InputItemMcpApprovalRequest": {
"type": "object",
"required": [
"type",
- "item_reference"
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "item_reference"
- ]
+ "mcp_approval_request"
+ ],
+ "description": "The type of the item. Always `mcp_approval_request`.",
+ "x-stainless-const": true
},
- "item_reference": {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the approval request."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server making the request."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tool to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of arguments for the tool."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A request for human approval of a tool invocation.",
+ "title": "MCP approval request"
},
- "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate": {
+ "OpenAI.InputItemMcpApprovalResponse": {
"type": "object",
"required": [
"type",
- "template"
+ "approval_request_id",
+ "approve"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "template"
- ]
+ "mcp_approval_response"
+ ],
+ "description": "The type of the item. Always `mcp_approval_response`.",
+ "x-stainless-const": true
},
- "template": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EasyInputMessage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- }
- ]
- }
- }
- }
- },
- "OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams": {
- "type": "object",
- "properties": {
- "reasoning_effort": {
+ "id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "temperature": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "default": 1
- },
- "max_completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- "top_p": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "default": 1
+ "approval_request_id": {
+ "type": "string",
+ "description": "The ID of the approval request being answered."
},
- "seed": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "default": 42
+ "approve": {
+ "type": "boolean",
+ "description": "Whether the request was approved."
},
- "response_format": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFormatText"
- },
+ "reason": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject"
+ "type": "null"
}
]
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ChatCompletionTool"
- }
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A response to an MCP approval request.",
+ "title": "MCP approval response"
},
- "OpenAI.CreateEvalCustomDataSourceConfig": {
+ "OpenAI.InputItemMcpListTools": {
"type": "object",
"required": [
"type",
- "item_schema"
+ "id",
+ "server_label",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom"
+ "mcp_list_tools"
],
- "description": "The type of data source. Always `custom`.",
- "x-stainless-const": true,
- "default": "custom"
+ "description": "The type of the item. Always `mcp_list_tools`.",
+ "x-stainless-const": true
},
- "item_schema": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The json schema for each row in the data source."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the list."
},
- "include_sample_schema": {
- "type": "boolean",
- "description": "Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)"
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
+ },
+ "description": "The tools available on the server."
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
},
- "description": "A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.\nThis schema is used to define the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run",
- "title": "CustomDataSourceConfig",
- "x-oaiMeta": {
- "name": "The eval file data source config object",
- "group": "evals",
- "example": "{\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"}\n },\n \"required\": [\"name\", \"age\"]\n },\n \"include_sample_schema\": true\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A list of tools available on an MCP server.",
+ "title": "MCP list tools"
},
- "OpenAI.CreateEvalJsonlRunDataSource": {
+ "OpenAI.InputItemMcpToolCall": {
"type": "object",
"required": [
"type",
- "source"
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "jsonl"
+ "mcp_call"
],
- "description": "The type of data source. Always `jsonl`.",
- "x-stainless-const": true,
- "default": "jsonl"
+ "description": "The type of the item. Always `mcp_call`.",
+ "x-stainless-const": true
},
- "source": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
- }
- ],
- "description": "Determines what populates the `item` namespace in the data source."
- }
- },
- "description": "A JsonlRunDataSource object with that specifies a JSONL file that matches the eval",
- "title": "JsonlRunDataSource",
- "x-oaiMeta": {
- "name": "The file data source object for the eval run configuration",
- "group": "evals",
- "example": "{\n \"type\": \"jsonl\",\n \"source\": {\n \"type\": \"file_id\",\n \"id\": \"file-9GYS6xbkWgWhmE7VoLUWFg\"\n }\n}\n"
- }
- },
- "OpenAI.CreateEvalLogsDataSourceConfig": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "id": {
"type": "string",
- "enum": [
- "logs"
- ],
- "description": "The type of data source. Always `logs`.",
- "x-stainless-const": true,
- "default": "logs"
+ "description": "The unique ID of the tool call."
},
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Metadata filters for the logs data source."
- }
- },
- "description": "A data source config which specifies the metadata property of your logs query.\nThis is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.",
- "title": "LogsDataSourceConfig",
- "x-oaiMeta": {
- "name": "The logs data source object for evals",
- "group": "evals",
- "example": "{\n \"type\": \"logs\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n"
- }
- },
- "OpenAI.CreateEvalResponsesRunDataSource": {
- "type": "object",
- "required": [
- "type",
- "source"
- ],
- "properties": {
- "type": {
+ "server_label": {
"type": "string",
- "enum": [
- "responses"
- ],
- "description": "The type of run data source. Always `responses`.",
- "default": "responses"
+ "description": "The label of the MCP server running the tool."
},
- "input_messages": {
- "oneOf": [
+ "name": {
+ "type": "string",
+ "description": "The name of the tool that was run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments passed to the tool."
+ },
+ "output": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference"
+ "type": "null"
}
- ],
- "description": "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."
+ ]
},
- "sampling_params": {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams"
+ "error": {
+ "type": "object",
+ "unevaluatedProperties": {}
},
- "model": {
- "type": "string",
- "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")."
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
+ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
},
- "source": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
- },
+ "approval_request_id": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.EvalResponsesSource"
+ "type": "null"
}
- ],
- "description": "Determines what populates the `item` namespace in this run's data source."
+ ]
}
},
- "description": "A ResponsesRunDataSource object describing a model sampling configuration.",
- "title": "ResponsesRunDataSource",
- "x-oaiMeta": {
- "name": "The completions data source object used to configure an individual run",
- "group": "eval runs",
- "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"responses\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "An invocation of a tool on an MCP server.",
+ "title": "MCP tool call"
},
- "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference": {
+ "OpenAI.InputItemOutputMessage": {
"type": "object",
"required": [
+ "id",
"type",
- "item_reference"
+ "role",
+ "content",
+ "status"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the output message."
+ },
"type": {
"type": "string",
"enum": [
- "item_reference"
- ]
+ "output_message"
+ ],
+ "description": "The type of the output message. Always `message`.",
+ "x-stainless-const": true
},
- "item_reference": {
- "type": "string"
- }
- }
- },
- "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate": {
- "type": "object",
- "required": [
- "type",
- "template"
- ],
- "properties": {
- "type": {
+ "role": {
"type": "string",
"enum": [
- "template"
- ]
+ "assistant"
+ ],
+ "description": "The role of the output message. Always `assistant`.",
+ "x-stainless-const": true
},
- "template": {
+ "content": {
"type": "array",
"items": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "role": {
- "type": "string"
- },
- "content": {
- "type": "string"
- }
- },
- "required": [
- "role",
- "content"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- }
- ]
- }
- }
- }
- },
- "OpenAI.CreateEvalResponsesRunDataSourceSamplingParams": {
- "type": "object",
- "properties": {
- "reasoning_effort": {
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ },
+ "description": "The content of the output message."
+ },
+ "phase": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
},
{
"type": "null"
}
]
},
- "temperature": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "default": 1
- },
- "max_completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- "top_p": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "default": 1
- },
- "seed": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "default": 42
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- },
- "text": {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText"
- }
- }
- },
- "OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText": {
- "type": "object",
- "properties": {
- "format": {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
- }
- }
- },
- "OpenAI.CreateEvalStoredCompletionsDataSourceConfig": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "status": {
"type": "string",
"enum": [
- "stored_completions"
- ],
- "description": "The type of data source. Always `stored_completions`.",
- "x-stainless-const": true,
- "default": "stored_completions"
- },
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Metadata filters for the stored completions data source."
- }
- },
- "description": "Deprecated in favor of LogsDataSourceConfig.",
- "title": "StoredCompletionsDataSourceConfig",
- "deprecated": true,
- "x-oaiMeta": {
- "name": "The stored completions data source object for evals",
- "group": "evals",
- "example": "{\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n"
- }
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "An output message from the model.",
+ "title": "Output message"
},
- "OpenAI.CreateFineTuningJobRequest": {
+ "OpenAI.InputItemReasoningItem": {
"type": "object",
"required": [
- "model",
- "training_file"
+ "type",
+ "id",
+ "summary"
],
"properties": {
- "model": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "babbage-002",
- "davinci-002",
- "gpt-3.5-turbo",
- "gpt-4o-mini"
- ]
- }
+ "type": {
+ "type": "string",
+ "enum": [
+ "reasoning"
],
- "description": "The name of the model to fine-tune. You can select one of the\n [supported models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned).",
- "x-oaiTypeLabel": "string"
+ "description": "The type of the object. Always `reasoning`.",
+ "x-stainless-const": true
},
- "training_file": {
+ "id": {
"type": "string",
- "description": "The ID of an uploaded file that contains training data.\n See [upload file](/docs/api-reference/files/create) for how to upload a file.\n Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.\n The contents of the file should differ depending on if the model uses the [chat](/docs/api-reference/fine-tuning/chat-input), [completions](/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](/docs/api-reference/fine-tuning/preference-input) format.\n See the [fine-tuning guide](/docs/guides/model-optimization) for more details."
- },
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters",
- "description": "The hyperparameters used for the fine-tuning job.\n This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter.",
- "deprecated": true
+ "description": "The unique identifier of the reasoning content."
},
- "suffix": {
+ "encrypted_content": {
"anyOf": [
{
"type": "string"
@@ -30376,12 +52925,48 @@
{
"type": "null"
}
- ],
- "minLength": 1,
- "maxLength": 64,
- "description": "A string of up to 64 characters that will be added to your fine-tuned model name.\n For example, a `suffix` of \"custom-model-name\" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`."
+ ]
},
- "validation_file": {
+ "summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
+ },
+ "description": "Reasoning summary content."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ },
+ "description": "Reasoning text content."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
+ },
+ "OpenAI.InputItemToolSearchCallItemParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "arguments"
+ ],
+ "properties": {
+ "id": {
"anyOf": [
{
"type": "string"
@@ -30389,127 +52974,60 @@
{
"type": "null"
}
- ],
- "description": "The ID of an uploaded file that contains validation data.\n If you provide this file, the data is used to generate validation\n metrics periodically during fine-tuning. These metrics can be viewed in\n the fine-tuning results file.\n The same data should not be present in both train and validation files.\n Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.\n See the [fine-tuning guide](/docs/guides/model-optimization) for more details."
+ ]
},
- "integrations": {
+ "call_id": {
"anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations"
- }
+ "type": "string"
},
{
"type": "null"
}
- ],
- "description": "A list of integrations to enable for your fine-tuning job."
+ ]
},
- "seed": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
+ "type": {
+ "type": "string",
+ "enum": [
+ "tool_search_call"
],
- "minimum": 0,
- "maximum": 2147483647,
- "description": "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.\n If a seed is not specified, one will be generated for you."
+ "description": "The item type. Always `tool_search_call`.",
+ "x-stainless-const": true,
+ "default": "tool_search_call"
},
- "method": {
- "$ref": "#/components/schemas/OpenAI.FineTuneMethod"
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
},
- "metadata": {
+ "arguments": {
+ "$ref": "#/components/schemas/OpenAI.EmptyModelParam",
+ "description": "The arguments supplied to the tool search call."
+ },
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
},
{
"type": "null"
}
]
}
- }
- },
- "OpenAI.CreateFineTuningJobRequestHyperparameters": {
- "type": "object",
- "properties": {
- "batch_size": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "default": "auto"
- },
- "learning_rate_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "default": "auto"
- },
- "n_epochs": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "default": "auto"
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
- }
+ ]
},
- "OpenAI.CreateFineTuningJobRequestIntegrations": {
+ "OpenAI.InputItemToolSearchOutputItemParam": {
"type": "object",
"required": [
"type",
- "wandb"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "wandb"
- ],
- "x-stainless-const": true
- },
- "wandb": {
- "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb"
- }
- }
- },
- "OpenAI.CreateFineTuningJobRequestIntegrationsWandb": {
- "type": "object",
- "required": [
- "project"
+ "tools"
],
"properties": {
- "project": {
- "type": "string"
- },
- "name": {
+ "id": {
"anyOf": [
{
"type": "string"
@@ -30519,7 +53037,7 @@
}
]
},
- "entity": {
+ "call_id": {
"anyOf": [
{
"type": "string"
@@ -30529,415 +53047,395 @@
}
]
},
- "tags": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "tool_search_output"
+ ],
+ "description": "The item type. Always `tool_search_output`.",
+ "x-stainless-const": true,
+ "default": "tool_search_output"
+ },
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "tools": {
"type": "array",
"items": {
- "type": "string"
- }
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The loaded tool definitions returned by the tool search output."
+ },
+ "status": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ]
},
- "OpenAI.CreateResponseStreamingResponse": {
+ "OpenAI.InputItemType": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCreatedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseErrorEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFailedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseIncompleteEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseTextDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseQueuedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseAudioDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCompletedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseContentPartDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseOutputItemDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseRefusalDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseTextDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent"
+ "type": "string",
+ "enum": [
+ "message",
+ "output_message",
+ "file_search_call",
+ "computer_call",
+ "computer_call_output",
+ "web_search_call",
+ "function_call",
+ "function_call_output",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "reasoning",
+ "compaction",
+ "image_generation_call",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "mcp_call",
+ "custom_tool_call_output",
+ "custom_tool_call",
+ "item_reference"
+ ]
}
]
},
- "OpenAI.CustomGrammarFormatParam": {
+ "OpenAI.InputItemWebSearchToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "syntax",
- "definition"
+ "status",
+ "action"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "grammar"
+ "web_search_call"
],
- "description": "Grammar format. Always `grammar`.",
+ "description": "The type of the web search tool call. Always `web_search_call`.",
"x-stainless-const": true
},
- "syntax": {
- "$ref": "#/components/schemas/OpenAI.GrammarSyntax1",
- "description": "The syntax of the grammar definition. One of `lark` or `regex`."
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
+ ],
+ "description": "The status of the web search tool call."
+ },
+ "action": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ }
+ ],
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
+ },
+ "OpenAI.InputMessageContentList": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputContent"
+ },
+ "description": "A list of one or many input items to the model, containing different content\ntypes.",
+ "title": "Input item content list"
+ },
+ "OpenAI.InputParam": {
+ "oneOf": [
+ {
+ "type": "string"
},
- "definition": {
- "type": "string",
- "description": "The grammar definition."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
}
],
- "description": "A grammar defined by the user.",
- "title": "Grammar format"
+ "description": "Text, image, or file inputs to the model, used to generate a response.\nLearn more:\n- [Text inputs and outputs](/docs/guides/text)\n- [Image inputs](/docs/guides/images)\n- [File inputs](/docs/guides/pdf-files)\n- [Conversation state](/docs/guides/conversation-state)\n- [Function calling](/docs/guides/function-calling)"
},
- "OpenAI.CustomTextFormatParam": {
+ "OpenAI.InputTextContent": {
"type": "object",
"required": [
- "type"
+ "type",
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "text"
+ "input_text"
],
- "description": "Unconstrained text format. Always `text`.",
- "x-stainless-const": true
+ "description": "The type of the input item. Always `input_text`.",
+ "x-stainless-const": true,
+ "default": "input_text"
+ },
+ "text": {
+ "type": "string",
+ "description": "The text input to the model."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat"
- }
- ],
- "description": "Unconstrained free-form text.",
- "title": "Text format"
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.CustomToolParam": {
+ "OpenAI.InputTextContentParam": {
"type": "object",
"required": [
"type",
- "name"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom"
+ "input_text"
],
- "description": "The type of the custom tool. Always `custom`.",
- "x-stainless-const": true
- },
- "name": {
- "type": "string",
- "description": "The name of the custom tool, used to identify it in tool calls."
+ "description": "The type of the input item. Always `input_text`.",
+ "x-stainless-const": true,
+ "default": "input_text"
},
- "description": {
+ "text": {
"type": "string",
- "description": "Optional description of the custom tool, used to provide more context."
- },
- "format": {
- "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat",
- "description": "The input format for the custom tool. Default is unconstrained text."
- },
- "defer_loading": {
- "type": "boolean",
- "description": "Whether this tool should be deferred and discovered via tool search."
+ "maxLength": 10485760,
+ "description": "The text input to the model."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)",
- "title": "Custom tool"
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.CustomToolParamFormat": {
+ "OpenAI.Item": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.CustomToolParamFormatType"
+ "$ref": "#/components/schemas/OpenAI.ItemType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "text": "#/components/schemas/OpenAI.CustomTextFormatParam",
- "grammar": "#/components/schemas/OpenAI.CustomGrammarFormatParam"
+ "message": "#/components/schemas/OpenAI.ItemInputMessage",
+ "output_message": "#/components/schemas/OpenAI.ItemOutputMessage",
+ "file_search_call": "#/components/schemas/OpenAI.ItemFileSearchToolCall",
+ "computer_call": "#/components/schemas/OpenAI.ItemComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.ItemComputerCallOutputItemParam",
+ "web_search_call": "#/components/schemas/OpenAI.ItemWebSearchToolCall",
+ "function_call": "#/components/schemas/OpenAI.ItemFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.ItemFunctionCallOutputItemParam",
+ "tool_search_call": "#/components/schemas/OpenAI.ItemToolSearchCallItemParam",
+ "tool_search_output": "#/components/schemas/OpenAI.ItemToolSearchOutputItemParam",
+ "additional_tools": "#/components/schemas/OpenAI.ItemAdditionalToolsItemParam",
+ "reasoning": "#/components/schemas/OpenAI.ItemReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.ItemCompactionSummaryItemParam",
+ "image_generation_call": "#/components/schemas/OpenAI.ItemImageGenToolCall",
+ "code_interpreter_call": "#/components/schemas/OpenAI.ItemCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.ItemLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.ItemLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.ItemFunctionShellCallItemParam",
+ "shell_call_output": "#/components/schemas/OpenAI.ItemFunctionShellCallOutputItemParam",
+ "apply_patch_call": "#/components/schemas/OpenAI.ItemApplyPatchToolCallItemParam",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.ItemApplyPatchToolCallOutputItemParam",
+ "mcp_list_tools": "#/components/schemas/OpenAI.ItemMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.ItemMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.ItemMcpApprovalResponse",
+ "mcp_call": "#/components/schemas/OpenAI.ItemMcpToolCall",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.ItemCustomToolCallOutput",
+ "custom_tool_call": "#/components/schemas/OpenAI.ItemCustomToolCall"
}
},
- "description": "The input format for the custom tool. Default is unconstrained text."
- },
- "OpenAI.CustomToolParamFormatType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "text",
- "grammar"
- ]
- }
- ]
+ "description": "Content item used to generate a response."
},
- "OpenAI.DeletedConversationResource": {
+ "OpenAI.ItemAdditionalToolsItemParam": {
"type": "object",
"required": [
- "object",
- "deleted",
- "id"
+ "type",
+ "role",
+ "tools"
],
"properties": {
- "object": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "type": {
"type": "string",
"enum": [
- "conversation.deleted"
+ "additional_tools"
],
+ "description": "The item type. Always `additional_tools`.",
"x-stainless-const": true,
- "default": "conversation.deleted"
+ "default": "additional_tools"
},
- "deleted": {
- "type": "boolean"
+ "role": {
+ "type": "string",
+ "enum": [
+ "developer"
+ ],
+ "description": "The role that provided the additional tools. Only `developer` is supported.",
+ "x-stainless-const": true,
+ "default": "developer"
},
- "id": {
- "type": "string"
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "A list of additional tools made available at this item."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- }
- },
- "OpenAI.DetailEnum": {
- "type": "string",
- "enum": [
- "low",
- "high",
- "auto",
- "original"
]
},
- "OpenAI.DoubleClickAction": {
+ "OpenAI.ItemApplyPatchToolCallItemParam": {
"type": "object",
"required": [
"type",
- "x",
- "y",
- "keys"
+ "call_id",
+ "status",
+ "operation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "double_click"
+ "apply_patch_call"
],
- "description": "Specifies the event type. For a double click action, this property is always set to `double_click`.",
- "x-stainless-const": true
- },
- "x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate where the double click occurred."
- },
- "y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate where the double click occurred."
+ "description": "The type of the item. Always `apply_patch_call`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call"
},
- "keys": {
+ "id": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
+ },
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the apply patch tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatusParam",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ },
+ "operation": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam",
+ "description": "The specific create, delete, or update instruction for the apply_patch tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "A double click action.",
- "title": "DoubleClick"
+ "description": "A tool call representing a request to create, delete, or update files using diff patches.",
+ "title": "Apply patch tool call"
},
- "OpenAI.DragParam": {
+ "OpenAI.ItemApplyPatchToolCallOutputItemParam": {
"type": "object",
"required": [
"type",
- "path"
+ "call_id",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "drag"
+ "apply_patch_call_output"
],
- "description": "Specifies the event type. For a drag action, this property is always set to `drag`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `apply_patch_call_output`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call_output"
},
- "path": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.CoordParam"
- },
- "description": "An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg\n ```\n [\n { x: 100, y: 200 },\n { x: 200, y: 300 }\n ]\n ```"
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "keys": {
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the apply patch tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ },
+ "output": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
@@ -30947,87 +53445,51 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "A drag action.",
- "title": "Drag"
+ "description": "The streamed output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
},
- "OpenAI.EasyInputMessage": {
+ "OpenAI.ItemCodeInterpreterToolCall": {
"type": "object",
"required": [
- "role",
- "content",
- "type"
+ "type",
+ "id",
+ "status",
+ "container_id",
+ "code",
+ "outputs"
],
"properties": {
- "role": {
+ "type": {
"type": "string",
"enum": [
- "user",
- "assistant",
- "system",
- "developer"
- ],
- "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`."
- },
- "content": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
- }
+ "code_interpreter_call"
],
- "description": "Text, image, or audio input to the model, used to generate a response.\n Can also contain previous assistant responses."
- },
- "phase": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "x-stainless-const": true,
+ "default": "code_interpreter_call"
},
- "type": {
+ "id": {
"type": "string",
- "enum": [
- "message"
- ],
- "description": "The type of the message input. Always `message`.",
- "x-stainless-const": true
+ "description": "The unique ID of the code interpreter tool call."
},
"status": {
"type": "string",
"enum": [
"in_progress",
"completed",
- "incomplete"
+ "incomplete",
+ "interpreting",
+ "failed"
],
- "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ],
- "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.",
- "title": "Input message"
- },
- "OpenAI.EmptyModelParam": {
- "type": "object"
- },
- "OpenAI.Error": {
- "type": "object",
- "required": [
- "code",
- "message"
- ],
- "properties": {
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
+ },
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the container used to run the code."
+ },
"code": {
"anyOf": [
{
@@ -31038,649 +53500,456 @@
}
]
},
- "message": {
- "type": "string"
- },
- "param": {
+ "outputs": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
- },
- "type": {
- "type": "string"
- },
- "details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Error"
- }
- },
- "additionalInfo": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "debugInfo": {
- "type": "object",
- "unevaluatedProperties": {}
- }
- }
- },
- "OpenAI.EvalApiError": {
- "type": "object",
- "required": [
- "code",
- "message"
- ],
- "properties": {
- "code": {
- "type": "string",
- "description": "The error code."
- },
- "message": {
- "type": "string",
- "description": "The error message."
}
},
- "description": "An object representing an error response from the Eval API.",
- "title": "EvalApiError",
- "x-oaiMeta": {
- "name": "The API error object",
- "group": "evals",
- "example": "{\n \"code\": \"internal_error\",\n \"message\": \"The eval run failed due to an internal error.\"\n}\n"
- }
- },
- "OpenAI.EvalGraderLabelModel": {
- "type": "object",
- "required": [
- "type",
- "name",
- "model",
- "input",
- "labels",
- "passing_labels"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "label_model"
- ],
- "description": "The object type, which is always `label_model`.",
- "x-stainless-const": true
- },
- "name": {
- "type": "string",
- "description": "The name of the grader."
- },
- "model": {
- "type": "string",
- "description": "The model to use for the evaluation. Must support structured outputs."
- },
- "input": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- }
- },
- "labels": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The labels to assign to each item in the evaluation."
- },
- "passing_labels": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The labels that indicate a passing result. Must be a subset of labels."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- },
- "title": "LabelModelGrader"
- },
- "OpenAI.EvalGraderPython": {
- "type": "object",
- "required": [
- "type",
- "name",
- "source"
],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "python"
- ],
- "description": "The object type, which is always `python`.",
- "x-stainless-const": true
- },
- "name": {
- "type": "string",
- "description": "The name of the grader."
- },
- "source": {
- "type": "string",
- "description": "The source code of the python script."
- },
- "image_tag": {
- "type": "string",
- "description": "The image tag to use for the python script."
- },
- "pass_threshold": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The threshold for the score."
- }
- },
- "title": "PythonGrader"
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
},
- "OpenAI.EvalGraderScoreModel": {
+ "OpenAI.ItemCompactionSummaryItemParam": {
"type": "object",
"required": [
"type",
- "name",
- "model",
- "input"
+ "encrypted_content"
],
"properties": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
"type": {
"type": "string",
"enum": [
- "score_model"
+ "compaction"
],
- "description": "The object type, which is always `score_model`.",
- "x-stainless-const": true
- },
- "name": {
- "type": "string",
- "description": "The name of the grader."
+ "description": "The type of the item. Always `compaction`.",
+ "x-stainless-const": true,
+ "default": "compaction"
},
- "model": {
+ "encrypted_content": {
"type": "string",
- "description": "The model to use for the evaluation."
- },
- "sampling_params": {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams",
- "description": "The sampling parameters for the model."
- },
- "input": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- },
- "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings."
- },
- "range": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "description": "The range of the score. Defaults to `[0, 1]`."
- },
- "pass_threshold": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The threshold for the score."
+ "maxLength": 10485760,
+ "description": "The encrypted content of the compaction summary."
}
},
- "title": "ScoreModelGrader"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "OpenAI.EvalGraderScoreModelSamplingParams": {
+ "OpenAI.ItemComputerCallOutputItemParam": {
"type": "object",
+ "required": [
+ "call_id",
+ "type",
+ "output"
+ ],
"properties": {
- "seed": {
+ "id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "top_p": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The ID of the computer tool call that produced the output."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "computer_call_output"
],
- "default": 1
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "x-stainless-const": true,
+ "default": "computer_call_output"
},
- "temperature": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ]
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
},
- "max_completions_tokens": {
+ "acknowledged_safety_checks": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ }
},
{
"type": "null"
}
]
},
- "reasoning_effort": {
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
},
{
"type": "null"
}
]
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "OpenAI.EvalGraderStringCheck": {
+ "OpenAI.ItemComputerToolCall": {
"type": "object",
"required": [
"type",
- "name",
- "input",
- "reference",
- "operation"
+ "id",
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "string_check"
+ "computer_call"
],
- "description": "The object type, which is always `string_check`.",
- "x-stainless-const": true
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The unique ID of the computer call."
},
- "input": {
+ "call_id": {
"type": "string",
- "description": "The input text. This may include template strings."
+ "description": "An identifier used when responding to the tool call with output."
},
- "reference": {
- "type": "string",
- "description": "The reference text. This may include template strings."
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
},
- "operation": {
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ },
+ "pending_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The pending safety checks for the computer call."
+ },
+ "status": {
"type": "string",
"enum": [
- "eq",
- "ne",
- "like",
- "ilike"
+ "in_progress",
+ "completed",
+ "incomplete"
],
- "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
- "title": "StringCheckGrader"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "OpenAI.EvalGraderTextSimilarity": {
+ "OpenAI.ItemCustomToolCall": {
"type": "object",
"required": [
"type",
+ "call_id",
"name",
- "input",
- "reference",
- "evaluation_metric",
- "pass_threshold"
+ "input"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "text_similarity"
+ "custom_tool_call"
],
- "description": "The type of grader.",
- "x-stainless-const": true,
- "default": "text_similarity"
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "x-stainless-const": true
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
},
- "input": {
+ "call_id": {
"type": "string",
- "description": "The text being graded."
+ "description": "An identifier used to map this custom tool call to a tool call output."
},
- "reference": {
+ "namespace": {
"type": "string",
- "description": "The text being graded against."
+ "description": "The namespace of the custom tool being called."
},
- "evaluation_metric": {
+ "name": {
"type": "string",
- "enum": [
- "cosine",
- "fuzzy_match",
- "bleu",
- "gleu",
- "meteor",
- "rouge_1",
- "rouge_2",
- "rouge_3",
- "rouge_4",
- "rouge_5",
- "rouge_l"
- ],
- "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`."
+ "description": "The name of the custom tool being called."
},
- "pass_threshold": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The threshold for the score."
+ "input": {
+ "type": "string",
+ "description": "The input for the custom tool call generated by the model."
}
},
- "title": "TextSimilarityGrader"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A call to a custom tool created by the model.",
+ "title": "Custom tool call"
},
- "OpenAI.EvalItem": {
+ "OpenAI.ItemCustomToolCallOutput": {
"type": "object",
"required": [
- "role",
- "content"
+ "type",
+ "call_id",
+ "output"
],
"properties": {
- "role": {
+ "type": {
"type": "string",
"enum": [
- "user",
- "assistant",
- "system",
- "developer"
+ "custom_tool_call_output"
],
- "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`."
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "x-stainless-const": true
},
- "content": {
- "$ref": "#/components/schemas/OpenAI.EvalItemContent"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
},
- "type": {
+ "call_id": {
"type": "string",
- "enum": [
- "message"
- ],
- "description": "The type of the message input. Always `message`.",
- "x-stainless-const": true
- }
- },
- "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.",
- "title": "Eval message object"
- },
- "OpenAI.EvalItemContent": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItem"
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
},
- {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentArray"
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
}
- ],
- "description": "Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.",
- "title": "Eval content"
- },
- "OpenAI.EvalItemContentArray": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItem"
},
- "description": "A list of inputs, each of which may be either an input text, output text, input\nimage, or input audio object.",
- "title": "An array of Input text, Output text, Input image, and Input audio"
- },
- "OpenAI.EvalItemContentItem": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentText"
- },
+ "allOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "A single content item: input text, output text, input image, or input audio.",
- "title": "Eval content item"
+ "description": "The output of a custom tool call from your code, being sent back to the model.",
+ "title": "Custom tool call output"
},
- "OpenAI.EvalItemContentItemObject": {
+ "OpenAI.ItemField": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObjectType"
+ "$ref": "#/components/schemas/OpenAI.ItemFieldType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "output_text": "#/components/schemas/OpenAI.EvalItemContentOutputText",
- "input_image": "#/components/schemas/OpenAI.EvalItemInputImage",
- "input_audio": "#/components/schemas/OpenAI.InputAudio",
- "input_text": "#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent"
+ "message": "#/components/schemas/OpenAI.ItemFieldMessage",
+ "function_call": "#/components/schemas/OpenAI.ItemFieldFunctionToolCall",
+ "tool_search_call": "#/components/schemas/OpenAI.ItemFieldToolSearchCall",
+ "tool_search_output": "#/components/schemas/OpenAI.ItemFieldToolSearchOutput",
+ "additional_tools": "#/components/schemas/OpenAI.ItemFieldAdditionalTools",
+ "function_call_output": "#/components/schemas/OpenAI.ItemFieldFunctionToolCallOutput",
+ "file_search_call": "#/components/schemas/OpenAI.ItemFieldFileSearchToolCall",
+ "web_search_call": "#/components/schemas/OpenAI.ItemFieldWebSearchToolCall",
+ "image_generation_call": "#/components/schemas/OpenAI.ItemFieldImageGenToolCall",
+ "computer_call": "#/components/schemas/OpenAI.ItemFieldComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.ItemFieldComputerToolCallOutput",
+ "reasoning": "#/components/schemas/OpenAI.ItemFieldReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.ItemFieldCompactionBody",
+ "code_interpreter_call": "#/components/schemas/OpenAI.ItemFieldCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.ItemFieldLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.ItemFieldLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.ItemFieldFunctionShellCall",
+ "shell_call_output": "#/components/schemas/OpenAI.ItemFieldFunctionShellCallOutput",
+ "apply_patch_call": "#/components/schemas/OpenAI.ItemFieldApplyPatchToolCall",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.ItemFieldApplyPatchToolCallOutput",
+ "mcp_list_tools": "#/components/schemas/OpenAI.ItemFieldMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.ItemFieldMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.ItemFieldMcpApprovalResponseResource",
+ "mcp_call": "#/components/schemas/OpenAI.ItemFieldMcpToolCall",
+ "custom_tool_call": "#/components/schemas/OpenAI.ItemFieldCustomToolCall",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.ItemFieldCustomToolCallOutput"
}
},
- "description": "A single content item: input text, output text, input image, or input audio.",
- "title": "Eval content item"
+ "description": "An item representing a message, tool call, tool output, reasoning, or other response element."
},
- "OpenAI.EvalItemContentItemObjectInputTextContent": {
+ "OpenAI.ItemFieldAdditionalTools": {
"type": "object",
"required": [
"type",
- "text"
+ "id",
+ "role",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_text"
+ "additional_tools"
],
- "description": "The type of the input item. Always `input_text`.",
+ "description": "The type of the item. Always `additional_tools`.",
"x-stainless-const": true,
- "default": "input_text"
+ "default": "additional_tools"
},
- "text": {
+ "id": {
"type": "string",
- "description": "The text input to the model."
+ "description": "The unique ID of the additional tools item."
+ },
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role that provided the additional tools."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The additional tool definitions made available at this item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
- }
- ],
- "description": "A text input to the model.",
- "title": "Input text"
- },
- "OpenAI.EvalItemContentItemObjectType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "input_text",
- "output_text",
- "input_image",
- "input_audio"
- ]
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
]
},
- "OpenAI.EvalItemContentOutputText": {
+ "OpenAI.ItemFieldApplyPatchToolCall": {
"type": "object",
"required": [
"type",
- "text"
+ "id",
+ "call_id",
+ "status",
+ "operation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "output_text"
+ "apply_patch_call"
],
- "description": "The type of the output text. Always `output_text`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `apply_patch_call`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call"
},
- "text": {
- "type": "string",
- "description": "The text output from the model."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
- }
- ],
- "description": "A text output from the model.",
- "title": "Output text"
- },
- "OpenAI.EvalItemContentText": {
- "type": "string",
- "description": "A text input to the model.",
- "title": "Text input"
- },
- "OpenAI.EvalItemInputImage": {
- "type": "object",
- "required": [
- "type",
- "image_url"
- ],
- "properties": {
- "type": {
+ "id": {
"type": "string",
- "enum": [
- "input_image"
- ],
- "description": "The type of the image input. Always `input_image`.",
- "x-stainless-const": true
+ "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
},
- "image_url": {
+ "call_id": {
"type": "string",
- "format": "uri",
- "description": "The URL of the image input."
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
- "detail": {
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ },
+ "operation": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
+ "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
+ "title": "Apply patch operation"
+ },
+ "created_by": {
"type": "string",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`."
+ "description": "The ID of the entity that created this tool call."
}
},
"allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
- }
- ],
- "description": "An image input block used within EvalItem content arrays.",
- "title": "Input image"
- },
- "OpenAI.EvalJsonlFileContentSource": {
- "type": "object",
- "required": [
- "type",
- "content"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "file_content"
- ],
- "description": "The type of jsonl source. Always `file_content`.",
- "x-stainless-const": true,
- "default": "file_content"
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent"
- },
- "description": "The content of the jsonl file."
- }
- },
- "title": "EvalJsonlFileContentSource"
- },
- "OpenAI.EvalJsonlFileContentSourceContent": {
- "type": "object",
- "required": [
- "item"
- ],
- "properties": {
- "item": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "sample": {
- "type": "object",
- "unevaluatedProperties": {}
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- }
+ ],
+ "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
+ "title": "Apply patch tool call"
},
- "OpenAI.EvalJsonlFileIdSource": {
+ "OpenAI.ItemFieldApplyPatchToolCallOutput": {
"type": "object",
"required": [
"type",
- "id"
+ "id",
+ "call_id",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "file_id"
+ "apply_patch_call_output"
],
- "description": "The type of jsonl source. Always `file_id`.",
+ "description": "The type of the item. Always `apply_patch_call_output`.",
"x-stainless-const": true,
- "default": "file_id"
+ "default": "apply_patch_call_output"
},
"id": {
"type": "string",
- "description": "The identifier of the file."
- }
- },
- "title": "EvalJsonlFileIdSource"
- },
- "OpenAI.EvalResponsesSource": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "responses"
- ],
- "description": "The type of run data source. Always `responses`."
+ "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
},
- "metadata": {
- "anyOf": [
- {
- "type": "object",
- "unevaluatedProperties": {}
- },
- {
- "type": "null"
- }
- ]
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
- "model": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
},
- "instructions_search": {
+ "output": {
"anyOf": [
{
"type": "string"
@@ -31690,76 +53959,81 @@
}
]
},
- "created_after": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call output."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "The output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
+ },
+ "OpenAI.ItemFieldCodeInterpreterToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "status",
+ "container_id",
+ "code",
+ "outputs"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "code_interpreter_call"
+ ],
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "x-stainless-const": true,
+ "default": "code_interpreter_call"
},
- "created_before": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the code interpreter tool call."
},
- "reasoning_effort": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
- },
- {
- "type": "null"
- }
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete",
+ "interpreting",
+ "failed"
],
- "description": "Optional reasoning effort parameter. This is a query parameter used to select responses."
- },
- "temperature": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
},
- "top_p": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ]
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the container used to run the code."
},
- "users": {
+ "code": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "tools": {
+ "outputs": {
"anyOf": [
{
"type": "array",
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
}
},
{
@@ -31768,832 +54042,586 @@
]
}
},
- "description": "A EvalResponsesSource object describing a run data source configuration.",
- "title": "EvalResponsesSource",
- "x-oaiMeta": {
- "name": "The run data source object used to configure an individual run",
- "group": "eval runs",
- "example": "{\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"temperature\": 0.7,\n \"top_p\": 1.0,\n \"users\": [\"user1\", \"user2\"],\n \"tools\": [\"tool1\", \"tool2\"],\n \"instructions_search\": \"You are a coding assistant\"\n}\n"
- }
- },
- "OpenAI.EvalRunOutputItemSample": {
- "type": "object",
- "required": [
- "input",
- "output",
- "finish_reason",
- "model",
- "usage",
- "error",
- "temperature",
- "max_completion_tokens",
- "top_p",
- "seed"
- ],
- "properties": {
- "input": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunOutputItemSampleInput"
- }
- },
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunOutputItemSampleOutput"
- }
- },
- "finish_reason": {
- "type": "string"
- },
- "model": {
- "type": "string"
- },
- "usage": {
- "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage"
- },
- "error": {
- "$ref": "#/components/schemas/OpenAI.EvalApiError"
- },
- "temperature": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "max_completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- "top_p": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "seed": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- }
- },
- "OpenAI.EvalRunOutputItemSampleUsage": {
- "type": "object",
- "required": [
- "total_tokens",
- "completion_tokens",
- "prompt_tokens",
- "cached_tokens"
],
- "properties": {
- "total_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- "completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- "prompt_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- "cached_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- }
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
},
- "OpenAI.EvalRunPerModelUsage": {
+ "OpenAI.ItemFieldCompactionBody": {
"type": "object",
"required": [
- "model_name",
- "invocation_count",
- "prompt_tokens",
- "completion_tokens",
- "total_tokens",
- "cached_tokens"
+ "type",
+ "id",
+ "encrypted_content"
],
"properties": {
- "model_name": {
- "type": "string"
- },
- "invocation_count": {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- "prompt_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": {
+ "type": "string",
+ "enum": [
+ "compaction"
+ ],
+ "description": "The type of the item. Always `compaction`.",
+ "x-stainless-const": true,
+ "default": "compaction"
},
- "completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the compaction item."
},
- "total_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "encrypted_content": {
+ "type": "string",
+ "description": "The encrypted content that was produced by compaction."
},
- "cached_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "OpenAI.EvalRunPerTestingCriteriaResults": {
+ "OpenAI.ItemFieldComputerToolCall": {
"type": "object",
"required": [
- "testing_criteria",
- "passed",
- "failed"
+ "type",
+ "id",
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
- "testing_criteria": {
- "type": "string"
- },
- "passed": {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- "failed": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": {
+ "type": "string",
+ "enum": [
+ "computer_call"
+ ],
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
- "errored": {
- "$ref": "#/components/schemas/integer",
- "description": "Number of tests that errored for this criteria."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the computer call."
},
- "skipped": {
- "$ref": "#/components/schemas/integer",
- "description": "Number of tests that were skipped for this criteria."
- }
- }
- },
- "OpenAI.EvalRunResultCounts": {
- "type": "object",
- "required": [
- "total",
- "errored",
- "failed",
- "passed"
- ],
- "properties": {
- "total": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used when responding to the tool call with output."
},
- "errored": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
},
- "failed": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
},
- "passed": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "pending_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The pending safety checks for the computer call."
},
- "skipped": {
- "$ref": "#/components/schemas/integer",
- "description": "Number of output items that were skipped during the evaluation."
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "OpenAI.EvalStoredCompletionsSource": {
+ "OpenAI.ItemFieldComputerToolCallOutput": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "call_id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "stored_completions"
+ "computer_call_output"
],
- "description": "The type of source. Always `stored_completions`.",
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
"x-stainless-const": true,
- "default": "stored_completions"
+ "default": "computer_call_output"
},
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The ID of the computer tool call output.",
+ "readOnly": true
},
- "model": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "call_id": {
+ "type": "string",
+ "description": "The ID of the computer tool call that produced the output."
},
- "created_after": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "acknowledged_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
},
- "created_before": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
},
- "limit": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
- "description": "A StoredCompletionsRunDataSource configuration describing a set of filters",
- "title": "StoredCompletionsRunDataSource",
- "x-oaiMeta": {
- "name": "The stored completions data source object used to configure an individual run",
- "group": "eval runs",
- "example": "{\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o\",\n \"created_after\": 1668124800,\n \"created_before\": 1668124900,\n \"limit\": 100,\n \"metadata\": {}\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "OpenAI.FileCitationBody": {
+ "OpenAI.ItemFieldCustomToolCall": {
"type": "object",
"required": [
"type",
- "file_id",
- "index",
- "filename"
+ "call_id",
+ "name",
+ "input"
],
"properties": {
"type": {
"type": "string",
- "enum": [
- "file_citation"
- ],
- "description": "The type of the file citation. Always `file_citation`.",
- "x-stainless-const": true
+ "enum": [
+ "custom_tool_call"
+ ],
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used to map this custom tool call to a tool call output."
},
- "file_id": {
+ "namespace": {
"type": "string",
- "description": "The ID of the file."
+ "description": "The namespace of the custom tool being called."
},
- "index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the file in the list of files."
+ "name": {
+ "type": "string",
+ "description": "The name of the custom tool being called."
},
- "filename": {
+ "input": {
"type": "string",
- "description": "The filename of the file cited."
+ "description": "The input for the custom tool call generated by the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Annotation"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "A citation to a file.",
- "title": "File citation"
- },
- "OpenAI.FileInputDetail": {
- "type": "string",
- "enum": [
- "low",
- "high"
- ]
+ "description": "A call to a custom tool created by the model.",
+ "title": "Custom tool call"
},
- "OpenAI.FilePath": {
+ "OpenAI.ItemFieldCustomToolCallOutput": {
"type": "object",
"required": [
"type",
- "file_id",
- "index"
+ "call_id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "file_path"
+ "custom_tool_call_output"
],
- "description": "The type of the file path. Always `file_path`.",
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
"x-stainless-const": true
},
- "file_id": {
+ "id": {
"type": "string",
- "description": "The ID of the file."
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
},
- "index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the file in the list of files."
+ "call_id": {
+ "type": "string",
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Annotation"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "A path to a file.",
- "title": "File path"
+ "description": "The output of a custom tool call from your code, being sent back to the model.",
+ "title": "Custom tool call output"
},
- "OpenAI.FileSearchTool": {
+ "OpenAI.ItemFieldFileSearchToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "vector_store_ids"
+ "status",
+ "queries"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the file search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "file_search"
+ "file_search_call"
],
- "description": "The type of the file search tool. Always `file_search`.",
+ "description": "The type of the file search tool call. Always `file_search_call`.",
"x-stainless-const": true
},
- "vector_store_ids": {
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "incomplete",
+ "failed"
+ ],
+ "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
+ },
+ "queries": {
"type": "array",
"items": {
"type": "string"
},
- "description": "The IDs of the vector stores to search."
- },
- "max_num_results": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive."
- },
- "ranking_options": {
- "$ref": "#/components/schemas/OpenAI.RankingOptions",
- "description": "Ranking options for search."
+ "description": "The queries used to search for files."
},
- "filters": {
+ "results": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Filters"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
+ }
},
{
"type": "null"
}
]
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "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).",
- "title": "File search"
+ "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
+ "title": "File search tool call"
},
- "OpenAI.FileSearchToolCallResults": {
+ "OpenAI.ItemFieldFunctionShellCall": {
"type": "object",
+ "required": [
+ "type",
+ "id",
+ "call_id",
+ "action",
+ "status",
+ "environment"
+ ],
"properties": {
- "file_id": {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "shell_call"
+ ],
+ "description": "The type of the item. Always `shell_call`.",
+ "x-stainless-const": true,
+ "default": "shell_call"
},
- "text": {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
},
- "filename": {
- "type": "string"
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the shell tool call generated by the model."
},
- "attributes": {
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
+ "description": "The shell commands and limits that describe how to run the tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
+ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
+ },
+ "environment": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
},
{
"type": "null"
}
]
},
- "score": {
- "type": "number",
- "format": "float"
- }
- }
- },
- "OpenAI.Filters": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CompoundFilter"
- }
- ]
- },
- "OpenAI.FineTuneDPOHyperparameters": {
- "type": "object",
- "properties": {
- "beta": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "description": "The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.",
- "default": "auto"
- },
- "batch_size": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
- "default": "auto"
- },
- "learning_rate_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
- "default": "auto"
- },
- "n_epochs": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
- "default": "auto"
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
- "description": "The hyperparameters used for the DPO fine-tuning job."
- },
- "OpenAI.FineTuneDPOMethod": {
- "type": "object",
- "properties": {
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.FineTuneDPOHyperparameters"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- },
- "description": "Configuration for the DPO fine-tuning method."
+ ],
+ "description": "A tool call that executes one or more shell commands in a managed environment.",
+ "title": "Shell tool call"
},
- "OpenAI.FineTuneMethod": {
+ "OpenAI.ItemFieldFunctionShellCallOutput": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "call_id",
+ "status",
+ "output",
+ "max_output_length"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "supervised",
- "dpo",
- "reinforcement"
- ],
- "description": "The type of method. Is either `supervised`, `dpo`, or `reinforcement`."
- },
- "supervised": {
- "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedMethod"
- },
- "dpo": {
- "$ref": "#/components/schemas/OpenAI.FineTuneDPOMethod"
- },
- "reinforcement": {
- "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementMethod"
- }
- },
- "description": "The method used for fine-tuning."
- },
- "OpenAI.FineTuneReinforcementHyperparameters": {
- "type": "object",
- "properties": {
- "batch_size": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
- "default": "auto"
- },
- "learning_rate_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
- "default": "auto"
- },
- "n_epochs": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
+ "shell_call_output"
],
- "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
- "default": "auto"
+ "description": "The type of the shell call output. Always `shell_call_output`.",
+ "x-stainless-const": true,
+ "default": "shell_call_output"
},
- "reasoning_effort": {
+ "id": {
"type": "string",
- "enum": [
- "default",
- "low",
- "medium",
- "high"
- ],
- "description": "Level of reasoning effort.",
- "default": "default"
+ "description": "The unique ID of the shell call output. Populated when this item is returned via API."
},
- "compute_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "description": "Multiplier on amount of compute used for exploring search space during training.",
- "default": "auto"
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the shell tool call generated by the model."
},
- "eval_interval": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "The number of training steps between evaluation runs.",
- "default": "auto"
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
+ "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
},
- "eval_samples": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "Number of evaluation samples to generate per training step.",
- "default": "auto"
- }
- },
- "description": "The hyperparameters used for the reinforcement fine-tuning job."
- },
- "OpenAI.FineTuneReinforcementMethod": {
- "type": "object",
- "required": [
- "grader"
- ],
- "properties": {
- "grader": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderPython"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderMulti"
- }
- ],
- "description": "The grader used for the fine-tuning job."
+ "output": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
+ },
+ "description": "An array of shell call output contents"
},
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters"
- }
- },
- "description": "Configuration for the reinforcement fine-tuning method."
- },
- "OpenAI.FineTuneSupervisedHyperparameters": {
- "type": "object",
- "properties": {
- "batch_size": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
+ "max_output_length": {
+ "anyOf": [
{
"$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
- "default": "auto"
- },
- "learning_rate_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
- "default": "auto"
- },
- "n_epochs": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
},
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "null"
}
- ],
- "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
- "default": "auto"
- }
- },
- "description": "The hyperparameters used for the fine-tuning job."
- },
- "OpenAI.FineTuneSupervisedMethod": {
- "type": "object",
- "properties": {
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters"
+ ]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "Configuration for the supervised fine-tuning method."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "The output of a shell tool call that was emitted.",
+ "title": "Shell call output"
},
- "OpenAI.FineTuningIntegration": {
+ "OpenAI.ItemFieldFunctionToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "wandb"
+ "call_id",
+ "name",
+ "arguments"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call.",
+ "readOnly": true
+ },
"type": {
"type": "string",
"enum": [
- "wandb"
+ "function_call"
],
- "description": "The type of the integration being enabled for the fine-tuning job",
+ "description": "The type of the function tool call. Always `function_call`.",
"x-stainless-const": true
},
- "wandb": {
- "$ref": "#/components/schemas/OpenAI.FineTuningIntegrationWandb",
- "description": "The settings for your integration with Weights and Biases. This payload specifies the project that\n metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags\n to your run, and set a default entity (team, username, etc) to be associated with your run."
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the function to run."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the function to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the function."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
- "title": "Fine-Tuning Job Integration"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
+ "title": "Function tool call"
},
- "OpenAI.FineTuningIntegrationWandb": {
+ "OpenAI.ItemFieldFunctionToolCallOutput": {
"type": "object",
"required": [
- "project"
+ "id",
+ "type",
+ "call_id",
+ "output"
],
"properties": {
- "project": {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
+ "readOnly": true
},
- "name": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": {
+ "type": "string",
+ "enum": [
+ "function_call_output"
+ ],
+ "description": "The type of the function tool call output. Always `function_call_output`.",
+ "x-stainless-const": true
},
- "entity": {
- "anyOf": [
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "output": {
+ "oneOf": [
{
"type": "string"
},
{
- "type": "null"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
}
- ]
+ ],
+ "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
},
- "OpenAI.FineTuningJob": {
+ "OpenAI.ItemFieldImageGenToolCall": {
"type": "object",
"required": [
+ "type",
"id",
- "created_at",
- "error",
- "fine_tuned_model",
- "finished_at",
- "hyperparameters",
- "model",
- "object",
- "organization_id",
- "result_files",
"status",
- "trained_tokens",
- "training_file",
- "validation_file",
- "seed"
+ "result"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The object identifier, which can be referenced in the API endpoints."
+ "enum": [
+ "image_generation_call"
+ ],
+ "description": "The type of the image generation call. Always `image_generation_call`.",
+ "x-stainless-const": true
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the image generation call."
},
- "error": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobError"
- },
- {
- "type": "null"
- }
- ]
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "generating",
+ "failed"
+ ],
+ "description": "The status of the image generation call."
},
- "fine_tuned_model": {
+ "result": {
"anyOf": [
{
"type": "string"
@@ -32602,120 +54630,96 @@
"type": "null"
}
]
- },
- "finished_at": {
- "anyOf": [
- {
- "type": "string",
- "format": "date-time"
- },
- {
- "type": "null"
- }
- ],
- "type": "integer",
- "format": "unixTimestamp"
- },
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobHyperparameters",
- "description": "The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs."
- },
- "model": {
- "type": "string",
- "description": "The base model that is being fine-tuned."
- },
- "object": {
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
+ },
+ "OpenAI.ItemFieldLocalShellToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "call_id",
+ "action",
+ "status"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "fine_tuning.job"
+ "local_shell_call"
],
- "description": "The object type, which is always \"fine_tuning.job\".",
+ "description": "The type of the local shell call. Always `local_shell_call`.",
"x-stainless-const": true
},
- "organization_id": {
+ "id": {
"type": "string",
- "description": "The organization that owns the fine-tuning job."
+ "description": "The unique ID of the local shell call."
},
- "result_files": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents)."
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
},
"status": {
"type": "string",
"enum": [
- "validating_files",
- "queued",
- "running",
- "succeeded",
- "failed",
- "cancelled"
+ "in_progress",
+ "completed",
+ "incomplete"
],
- "description": "The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`."
- },
- "trained_tokens": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "training_file": {
+ "description": "The status of the local shell call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A tool call to run a command on the local shell.",
+ "title": "Local shell call"
+ },
+ "OpenAI.ItemFieldLocalShellToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "output"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents)."
- },
- "validation_file": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "enum": [
+ "local_shell_call_output"
+ ],
+ "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "x-stainless-const": true
},
- "integrations": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FineTuningIntegration"
- }
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
},
- "seed": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The seed used for the fine-tuning job."
+ "output": {
+ "type": "string",
+ "description": "A JSON string of the output of the local shell tool call."
},
- "estimated_finish": {
+ "status": {
"anyOf": [
{
"type": "string",
- "format": "date-time"
- },
- {
- "type": "null"
- }
- ],
- "type": "integer",
- "format": "unixTimestamp"
- },
- "method": {
- "$ref": "#/components/schemas/OpenAI.FineTuneMethod"
- },
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
},
{
"type": "null"
@@ -32723,265 +54727,298 @@
]
}
},
- "description": "The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.",
- "title": "FineTuningJob",
- "x-oaiMeta": {
- "name": "The fine-tuning job object",
- "example": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n },\n \"metadata\": {\n \"key\": \"value\"\n }\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "The output of a local shell tool call.",
+ "title": "Local shell call output"
},
- "OpenAI.FineTuningJobCheckpoint": {
+ "OpenAI.ItemFieldMcpApprovalRequest": {
"type": "object",
"required": [
+ "type",
"id",
- "created_at",
- "fine_tuned_model_checkpoint",
- "step_number",
- "metrics",
- "fine_tuning_job_id",
- "object"
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The checkpoint identifier, which can be referenced in the API endpoints."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) for when the checkpoint was created."
+ "enum": [
+ "mcp_approval_request"
+ ],
+ "description": "The type of the item. Always `mcp_approval_request`.",
+ "x-stainless-const": true
},
- "fine_tuned_model_checkpoint": {
+ "id": {
"type": "string",
- "description": "The name of the fine-tuned checkpoint model that is created."
- },
- "step_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The step number that the checkpoint was created at."
+ "description": "The unique ID of the approval request."
},
- "metrics": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics",
- "description": "Metrics at the step number during the fine-tuning job."
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server making the request."
},
- "fine_tuning_job_id": {
+ "name": {
"type": "string",
- "description": "The name of the fine-tuning job that this checkpoint was created from."
+ "description": "The name of the tool to run."
},
- "object": {
+ "arguments": {
"type": "string",
- "enum": [
- "fine_tuning.job.checkpoint"
- ],
- "description": "The object type, which is always \"fine_tuning.job.checkpoint\".",
- "x-stainless-const": true
+ "description": "A JSON string of arguments for the tool."
}
},
- "description": "The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.",
- "title": "FineTuningJobCheckpoint",
- "x-oaiMeta": {
- "name": "The fine-tuning job checkpoint object",
- "example": "{\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P\",\n \"created_at\": 1712211699,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88\",\n \"fine_tuning_job_id\": \"ftjob-fpbNQ3H1GrMehXRf8cO97xTN\",\n \"metrics\": {\n \"step\": 88,\n \"train_loss\": 0.478,\n \"train_mean_token_accuracy\": 0.924,\n \"valid_loss\": 10.112,\n \"valid_mean_token_accuracy\": 0.145,\n \"full_valid_loss\": 0.567,\n \"full_valid_mean_token_accuracy\": 0.944\n },\n \"step_number\": 88\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A request for human approval of a tool invocation.",
+ "title": "MCP approval request"
},
- "OpenAI.FineTuningJobCheckpointMetrics": {
+ "OpenAI.ItemFieldMcpApprovalResponseResource": {
"type": "object",
+ "required": [
+ "type",
+ "id",
+ "approval_request_id",
+ "approve"
+ ],
"properties": {
- "step": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "train_loss": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "train_mean_token_accuracy": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp_approval_response"
+ ],
+ "description": "The type of the item. Always `mcp_approval_response`.",
+ "x-stainless-const": true
},
- "valid_loss": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the approval response"
},
- "valid_mean_token_accuracy": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "approval_request_id": {
+ "type": "string",
+ "description": "The ID of the approval request being answered."
},
- "full_valid_loss": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "approve": {
+ "type": "boolean",
+ "description": "Whether the request was approved."
},
- "full_valid_mean_token_accuracy": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "reason": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A response to an MCP approval request.",
+ "title": "MCP approval response"
},
- "OpenAI.FineTuningJobError": {
+ "OpenAI.ItemFieldMcpListTools": {
"type": "object",
"required": [
- "code",
- "message",
- "param"
+ "type",
+ "id",
+ "server_label",
+ "tools"
],
"properties": {
- "code": {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp_list_tools"
+ ],
+ "description": "The type of the item. Always `mcp_list_tools`.",
+ "x-stainless-const": true
},
- "message": {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the list."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
+ },
+ "description": "The tools available on the server."
},
- "param": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A list of tools available on an MCP server.",
+ "title": "MCP list tools"
},
- "OpenAI.FineTuningJobEvent": {
+ "OpenAI.ItemFieldMcpToolCall": {
"type": "object",
"required": [
- "object",
+ "type",
"id",
- "created_at",
- "level",
- "message"
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "fine_tuning.job.event"
+ "mcp_call"
],
- "description": "The object type, which is always \"fine_tuning.job.event\".",
+ "description": "The type of the item. Always `mcp_call`.",
"x-stainless-const": true
},
"id": {
"type": "string",
- "description": "The object identifier."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created."
+ "description": "The unique ID of the tool call."
},
- "level": {
+ "server_label": {
"type": "string",
- "enum": [
- "info",
- "warn",
- "error"
- ],
- "description": "The log level of the event."
+ "description": "The label of the MCP server running the tool."
},
- "message": {
+ "name": {
"type": "string",
- "description": "The message of the event."
+ "description": "The name of the tool that was run."
},
- "type": {
+ "arguments": {
"type": "string",
- "enum": [
- "message",
- "metrics"
- ],
- "description": "The type of event."
+ "description": "A JSON string of the arguments passed to the tool."
},
- "data": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobEventData",
- "description": "The data associated with the event."
- }
- },
- "description": "Fine-tuning job event object",
- "x-oaiMeta": {
- "name": "The fine-tuning job event object",
- "example": "{\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ftevent-abc123\"\n \"created_at\": 1677610602,\n \"level\": \"info\",\n \"message\": \"Created fine-tuning job\",\n \"data\": {},\n \"type\": \"message\"\n}\n"
- }
- },
- "OpenAI.FineTuningJobEventData": {
- "type": "object"
- },
- "OpenAI.FineTuningJobHyperparameters": {
- "type": "object",
- "properties": {
- "batch_size": {
+ "output": {
"anyOf": [
{
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
"type": "null"
}
- ],
- "default": "auto"
+ ]
},
- "learning_rate_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "default": "auto"
+ "error": {
+ "type": "object",
+ "unevaluatedProperties": {}
},
- "n_epochs": {
- "oneOf": [
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
+ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ },
+ "approval_request_id": {
+ "anyOf": [
{
- "type": "string",
- "enum": [
- "auto"
- ]
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "null"
}
- ],
- "default": "auto"
+ ]
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "An invocation of a tool on an MCP server.",
+ "title": "MCP tool call"
},
- "OpenAI.FunctionAndCustomToolCallOutput": {
+ "OpenAI.ItemFieldMessage": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "status",
+ "role",
+ "content"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType"
+ "type": "string",
+ "enum": [
+ "message"
+ ],
+ "description": "The type of the message. Always set to `message`.",
+ "x-stainless-const": true,
+ "default": "message"
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the message."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MessageStatus",
+ "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API."
+ },
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
+ },
+ "description": "The content of the message"
+ },
+ "phase": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "input_text": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent",
- "input_image": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent",
- "input_file": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- }
+ ],
+ "description": "A message to or from the model.",
+ "title": "Message"
},
- "OpenAI.FunctionAndCustomToolCallOutputInputFileContent": {
+ "OpenAI.ItemFieldReasoningItem": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "summary"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_file"
+ "reasoning"
],
- "description": "The type of the input item. Always `input_file`.",
- "x-stainless-const": true,
- "default": "input_file"
+ "description": "The type of the object. Always `reasoning`.",
+ "x-stainless-const": true
},
- "file_id": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the reasoning content."
+ },
+ "encrypted_content": {
"anyOf": [
{
"type": "string"
@@ -32991,60 +55028,63 @@
}
]
},
- "filename": {
- "type": "string",
- "description": "The name of the file to be sent to the model."
+ "summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
+ },
+ "description": "Reasoning summary content."
},
- "file_data": {
- "type": "string",
- "description": "The content of the file to be sent to the model."
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ },
+ "description": "Reasoning text content."
},
- "file_url": {
+ "status": {
"type": "string",
- "format": "uri",
- "description": "The URL of the file to be sent to the model."
- },
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "A file input to the model.",
- "title": "Input file"
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
},
- "OpenAI.FunctionAndCustomToolCallOutputInputImageContent": {
+ "OpenAI.ItemFieldToolSearchCall": {
"type": "object",
"required": [
"type",
- "detail"
+ "id",
+ "call_id",
+ "execution",
+ "arguments",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_image"
+ "tool_search_call"
],
- "description": "The type of the input item. Always `input_image`.",
+ "description": "The type of the item. Always `tool_search_call`.",
"x-stainless-const": true,
- "default": "input_image"
+ "default": "tool_search_call"
},
- "image_url": {
- "anyOf": [
- {
- "type": "string",
- "format": "uri"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool search call item."
},
- "file_id": {
+ "call_id": {
"anyOf": [
{
"type": "string"
@@ -33054,49 +55094,89 @@
}
]
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "arguments": {
+ "description": "Arguments used for the tool search call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the tool search call item that was recorded."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- ],
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
- "title": "Input image"
+ ]
},
- "OpenAI.FunctionAndCustomToolCallOutputInputTextContent": {
+ "OpenAI.ItemFieldToolSearchOutput": {
"type": "object",
"required": [
"type",
- "text"
+ "id",
+ "call_id",
+ "execution",
+ "tools",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_text"
+ "tool_search_output"
],
- "description": "The type of the input item. Always `input_text`.",
+ "description": "The type of the item. Always `tool_search_output`.",
"x-stainless-const": true,
- "default": "input_text"
+ "default": "tool_search_output"
},
- "text": {
+ "id": {
"type": "string",
- "description": "The text input to the model."
+ "description": "The unique ID of the tool search output item."
+ },
+ "call_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The loaded tool definitions returned by tool search."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the tool search output item that was recorded."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- ],
- "description": "A text input to the model.",
- "title": "Input text"
+ ]
},
- "OpenAI.FunctionAndCustomToolCallOutputType": {
+ "OpenAI.ItemFieldType": {
"anyOf": [
{
"type": "string"
@@ -33104,99 +55184,213 @@
{
"type": "string",
"enum": [
- "input_text",
- "input_image",
- "input_file"
+ "message",
+ "function_call",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "function_call_output",
+ "file_search_call",
+ "web_search_call",
+ "image_generation_call",
+ "computer_call",
+ "computer_call_output",
+ "reasoning",
+ "compaction",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "mcp_call",
+ "custom_tool_call",
+ "custom_tool_call_output"
]
}
]
},
- "OpenAI.FunctionCallItemStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- "OpenAI.FunctionCallOutputStatusEnum": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- "OpenAI.FunctionCallStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
+ "OpenAI.ItemFieldWebSearchToolCall": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "status",
+ "action"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_search_call"
+ ],
+ "description": "The type of the web search tool call. Always `web_search_call`.",
+ "x-stainless-const": true
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
+ ],
+ "description": "The status of the web search tool call."
+ },
+ "action": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ }
+ ],
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
},
- "OpenAI.FunctionObject": {
+ "OpenAI.ItemFileSearchToolCall": {
"type": "object",
"required": [
- "name"
+ "id",
+ "type",
+ "status",
+ "queries"
],
"properties": {
- "description": {
+ "id": {
"type": "string",
- "description": "A description of what the function does, used by the model to choose when and how to call the function."
+ "description": "The unique ID of the file search tool call."
},
- "name": {
+ "type": {
"type": "string",
- "description": "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."
+ "enum": [
+ "file_search_call"
+ ],
+ "description": "The type of the file search tool call. Always `file_search_call`.",
+ "x-stainless-const": true
},
- "parameters": {
- "$ref": "#/components/schemas/OpenAI.FunctionParameters"
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "incomplete",
+ "failed"
+ ],
+ "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
},
- "strict": {
+ "queries": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The queries used to search for files."
+ },
+ "results": {
"anyOf": [
{
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
+ }
},
{
"type": "null"
}
]
}
- }
- },
- "OpenAI.FunctionParameters": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\nOmitting `parameters` defines a function with an empty parameter list."
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
+ "title": "File search tool call"
},
- "OpenAI.FunctionShellAction": {
+ "OpenAI.ItemFunctionCallOutputItemParam": {
"type": "object",
"required": [
- "commands",
- "timeout_ms",
- "max_output_length"
+ "call_id",
+ "type",
+ "output"
],
"properties": {
- "commands": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "timeout_ms": {
+ "id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "max_output_length": {
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "function_call_output"
+ ],
+ "description": "The type of the function tool call output. Always `function_call_output`.",
+ "x-stainless-const": true,
+ "default": "function_call_output"
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputTextContentParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputImageContentParamAutoParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFileContentParam"
+ }
+ ]
+ }
+ }
+ ],
+ "description": "Text, image, or file output of the function tool call."
+ },
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
},
{
"type": "null"
@@ -33204,36 +55398,65 @@
]
}
},
- "description": "Execute a shell command.",
- "title": "Shell exec action"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
},
- "OpenAI.FunctionShellActionParam": {
+ "OpenAI.ItemFunctionShellCallItemParam": {
"type": "object",
"required": [
- "commands"
+ "call_id",
+ "type",
+ "action"
],
"properties": {
- "commands": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "Ordered shell commands for the execution environment to run."
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "timeout_ms": {
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "shell_call"
+ ],
+ "description": "The type of the item. Always `shell_call`.",
+ "x-stainless-const": true,
+ "default": "shell_call"
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellActionParam",
+ "description": "The shell commands and limits that describe how to run the tool call."
+ },
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
},
{
"type": "null"
}
]
},
- "max_output_length": {
+ "environment": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
},
{
"type": "null"
@@ -33241,546 +55464,513 @@
]
}
},
- "description": "Commands and limits describing how to run the shell tool call.",
- "title": "Shell action"
- },
- "OpenAI.FunctionShellCallEnvironment": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironmentType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "local": "#/components/schemas/OpenAI.LocalEnvironmentResource",
- "container_reference": "#/components/schemas/OpenAI.ContainerReferenceResource"
- }
- }
- },
- "OpenAI.FunctionShellCallEnvironmentType": {
- "anyOf": [
- {
- "type": "string"
- },
+ "allOf": [
{
- "type": "string",
- "enum": [
- "local",
- "container_reference"
- ]
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- ]
- },
- "OpenAI.FunctionShellCallItemParamEnvironment": {
- "type": "object",
- "required": [
- "type"
],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "local": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam",
- "container_reference": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam"
- }
- },
- "description": "The environment to execute the shell commands in."
+ "description": "A tool representing a request to execute one or more shell commands.",
+ "title": "Shell tool call"
},
- "OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam": {
+ "OpenAI.ItemFunctionShellCallOutputItemParam": {
"type": "object",
"required": [
+ "call_id",
"type",
- "container_id"
+ "output"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "container_reference"
- ],
- "description": "References a container created with the /v1/containers endpoint",
- "x-stainless-const": true,
- "default": "container_reference"
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "container_id": {
+ "call_id": {
"type": "string",
- "description": "The ID of the referenced container."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
- }
- ]
- },
- "OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
"type": {
"type": "string",
"enum": [
- "local"
+ "shell_call_output"
],
- "description": "Use a local computer environment.",
+ "description": "The type of the item. Always `shell_call_output`.",
"x-stainless-const": true,
- "default": "local"
+ "default": "shell_call_output"
},
- "skills": {
+ "output": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.LocalSkillParam"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContentParam"
},
- "maxItems": 200,
- "description": "An optional list of skills."
+ "description": "Captured chunks of stdout and stderr output, along with their associated outcomes."
+ },
+ "status": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
- }
- ]
- },
- "OpenAI.FunctionShellCallItemParamEnvironmentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "local",
- "container_reference"
- ]
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- ]
- },
- "OpenAI.FunctionShellCallItemStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
],
- "description": "Status values reported for shell tool calls.",
- "title": "Shell call status"
+ "description": "The streamed output items emitted by a shell tool call.",
+ "title": "Shell tool call output"
},
- "OpenAI.FunctionShellCallOutputContent": {
+ "OpenAI.ItemFunctionToolCall": {
"type": "object",
"required": [
- "stdout",
- "stderr",
- "outcome"
+ "id",
+ "type",
+ "call_id",
+ "name",
+ "arguments"
],
"properties": {
- "stdout": {
+ "id": {
"type": "string",
- "description": "The standard output that was captured."
+ "description": "The unique ID of the function tool call.",
+ "readOnly": true
},
- "stderr": {
+ "type": {
"type": "string",
- "description": "The standard error output that was captured."
+ "enum": [
+ "function_call"
+ ],
+ "description": "The type of the function tool call. Always `function_call`.",
+ "x-stainless-const": true
},
- "outcome": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome",
- "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.",
- "title": "Shell call outcome"
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
},
- "created_by": {
+ "namespace": {
"type": "string",
- "description": "The identifier of the actor that created the item."
- }
- },
- "description": "The content of a shell tool call output that was emitted.",
- "title": "Shell call output content"
- },
- "OpenAI.FunctionShellCallOutputContentParam": {
- "type": "object",
- "required": [
- "stdout",
- "stderr",
- "outcome"
- ],
- "properties": {
- "stdout": {
+ "description": "The namespace of the function to run."
+ },
+ "name": {
"type": "string",
- "maxLength": 10485760,
- "description": "Captured stdout output for the shell call."
+ "description": "The name of the function to run."
},
- "stderr": {
+ "arguments": {
"type": "string",
- "maxLength": 10485760,
- "description": "Captured stderr output for the shell call."
+ "description": "A JSON string of the arguments to pass to the function."
},
- "outcome": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam",
- "description": "The exit or timeout outcome associated with this shell call."
- }
- },
- "description": "Captured stdout and stderr for a portion of a shell tool call output.",
- "title": "Shell output content"
- },
- "OpenAI.FunctionShellCallOutputExitOutcome": {
- "type": "object",
- "required": [
- "type",
- "exit_code"
- ],
- "properties": {
- "type": {
+ "status": {
"type": "string",
"enum": [
- "exit"
+ "in_progress",
+ "completed",
+ "incomplete"
],
- "description": "The outcome type. Always `exit`.",
- "x-stainless-const": true
- },
- "exit_code": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "Exit code from the shell process."
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "Indicates that the shell commands finished and returned an exit code.",
- "title": "Shell call exit outcome"
+ "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
+ "title": "Function tool call"
},
- "OpenAI.FunctionShellCallOutputExitOutcomeParam": {
+ "OpenAI.ItemImageGenToolCall": {
"type": "object",
"required": [
"type",
- "exit_code"
+ "id",
+ "status",
+ "result"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "exit"
+ "image_generation_call"
],
- "description": "The outcome type. Always `exit`.",
+ "description": "The type of the image generation call. Always `image_generation_call`.",
"x-stainless-const": true
},
- "exit_code": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The exit code returned by the shell process."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the image generation call."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "generating",
+ "failed"
+ ],
+ "description": "The status of the image generation call."
+ },
+ "result": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "Indicates that the shell commands finished and returned an exit code.",
- "title": "Shell call exit outcome"
- },
- "OpenAI.FunctionShellCallOutputOutcome": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome",
- "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome"
- }
- },
- "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.",
- "title": "Shell call outcome"
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
},
- "OpenAI.FunctionShellCallOutputOutcomeParam": {
+ "OpenAI.ItemInputMessage": {
"type": "object",
"required": [
- "type"
+ "type",
+ "role",
+ "content",
+ "id"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParamType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcomeParam",
- "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcomeParam"
- }
- },
- "description": "The exit or timeout outcome associated with this shell call.",
- "title": "Shell call outcome"
- },
- "OpenAI.FunctionShellCallOutputOutcomeParamType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
"type": "string",
"enum": [
- "timeout",
- "exit"
- ]
- }
- ]
- },
- "OpenAI.FunctionShellCallOutputOutcomeType": {
- "anyOf": [
- {
- "type": "string"
+ "message"
+ ],
+ "description": "The type of the message input. Always set to `message`.",
+ "x-stainless-const": true,
+ "default": "message"
},
- {
- "type": "string",
- "enum": [
- "timeout",
- "exit"
- ]
- }
- ]
- },
- "OpenAI.FunctionShellCallOutputStatusEnum": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- "OpenAI.FunctionShellCallOutputTimeoutOutcome": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "role": {
"type": "string",
"enum": [
- "timeout"
+ "user",
+ "system",
+ "developer"
],
- "description": "The outcome type. Always `timeout`.",
- "x-stainless-const": true
+ "description": "The role of the message input. One of `user`, `system`, or `developer`."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "content": {
+ "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the message input.",
+ "readOnly": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "Indicates that the shell call exceeded its configured time limit.",
- "title": "Shell call timeout outcome"
+ "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role.",
+ "title": "Input message"
},
- "OpenAI.FunctionShellCallOutputTimeoutOutcomeParam": {
+ "OpenAI.ItemLocalShellToolCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "call_id",
+ "action",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "timeout"
+ "local_shell_call"
],
- "description": "The outcome type. Always `timeout`.",
+ "description": "The type of the local shell call. Always `local_shell_call`.",
"x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell call."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the local shell call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "Indicates that the shell call exceeded its configured time limit.",
- "title": "Shell call timeout outcome"
- },
- "OpenAI.FunctionShellCallStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
+ "description": "A tool call to run a command on the local shell.",
+ "title": "Local shell call"
},
- "OpenAI.FunctionShellToolParam": {
+ "OpenAI.ItemLocalShellToolCallOutput": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell"
+ "local_shell_call_output"
],
- "description": "The type of the shell tool. Always `shell`.",
+ "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
"x-stainless-const": true
},
- "environment": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "output": {
+ "type": "string",
+ "description": "A JSON string of the output of the local shell tool call."
+ },
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
},
{
"type": "null"
}
]
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "A tool that allows the model to execute shell commands.",
- "title": "Shell tool"
+ "description": "The output of a local shell tool call.",
+ "title": "Local shell call output"
},
- "OpenAI.FunctionShellToolParamEnvironment": {
+ "OpenAI.ItemMcpApprovalRequest": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentType"
+ "type": "string",
+ "enum": [
+ "mcp_approval_request"
+ ],
+ "description": "The type of the item. Always `mcp_approval_request`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the approval request."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server making the request."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tool to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of arguments for the tool."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "local": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam",
- "container_reference": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam",
- "container_auto": "#/components/schemas/OpenAI.ContainerAutoParam"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- }
+ ],
+ "description": "A request for human approval of a tool invocation.",
+ "title": "MCP approval request"
},
- "OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam": {
+ "OpenAI.ItemMcpApprovalResponse": {
"type": "object",
"required": [
"type",
- "container_id"
+ "approval_request_id",
+ "approve"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "container_reference"
+ "mcp_approval_response"
],
- "description": "References a container created with the /v1/containers endpoint",
- "x-stainless-const": true,
- "default": "container_reference"
+ "description": "The type of the item. Always `mcp_approval_response`.",
+ "x-stainless-const": true
},
- "container_id": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "approval_request_id": {
"type": "string",
- "description": "The ID of the referenced container."
+ "description": "The ID of the approval request being answered."
+ },
+ "approve": {
+ "type": "boolean",
+ "description": "Whether the request was approved."
+ },
+ "reason": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- ]
+ ],
+ "description": "A response to an MCP approval request.",
+ "title": "MCP approval response"
},
- "OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam": {
+ "OpenAI.ItemMcpListTools": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "server_label",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local"
+ "mcp_list_tools"
],
- "description": "Use a local computer environment.",
- "x-stainless-const": true,
- "default": "local"
+ "description": "The type of the item. Always `mcp_list_tools`.",
+ "x-stainless-const": true
},
- "skills": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the list."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server."
+ },
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.LocalSkillParam"
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
},
- "maxItems": 200,
- "description": "An optional list of skills."
+ "description": "The tools available on the server."
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
- }
- ]
- },
- "OpenAI.FunctionShellToolParamEnvironmentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "container_auto",
- "local",
- "container_reference"
- ]
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- ]
+ ],
+ "description": "A list of tools available on an MCP server.",
+ "title": "MCP list tools"
},
- "OpenAI.FunctionTool": {
+ "OpenAI.ItemMcpToolCall": {
"type": "object",
"required": [
"type",
+ "id",
+ "server_label",
"name",
- "parameters",
- "strict"
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "function"
+ "mcp_call"
],
- "description": "The type of the function tool. Always `function`.",
+ "description": "The type of the item. Always `mcp_call`.",
"x-stainless-const": true
},
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool call."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server running the tool."
+ },
"name": {
"type": "string",
- "description": "The name of the function to call."
+ "description": "The name of the tool that was run."
},
- "description": {
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments passed to the tool."
+ },
+ "output": {
"anyOf": [
{
"type": "string"
@@ -33790,54 +55980,119 @@
}
]
},
- "parameters": {
+ "error": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
+ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ },
+ "approval_request_id": {
"anyOf": [
{
- "type": "object",
- "unevaluatedProperties": {}
+ "type": "string"
},
{
"type": "null"
}
]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "An invocation of a tool on an MCP server.",
+ "title": "MCP tool call"
+ },
+ "OpenAI.ItemOutputMessage": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "role",
+ "content",
+ "status"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the output message."
},
- "strict": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "output_message"
+ ],
+ "description": "The type of the output message. Always `message`.",
+ "x-stainless-const": true
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "assistant"
+ ],
+ "description": "The role of the output message. Always `assistant`.",
+ "x-stainless-const": true
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ },
+ "description": "The content of the output message."
+ },
+ "phase": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
},
{
"type": "null"
}
]
},
- "defer_loading": {
- "type": "boolean",
- "description": "Whether this function is deferred and loaded via tool search."
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "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).",
- "title": "Function"
+ "description": "An output message from the model.",
+ "title": "Output message"
},
- "OpenAI.FunctionToolParam": {
+ "OpenAI.ItemReasoningItem": {
"type": "object",
"required": [
- "name",
- "type"
+ "type",
+ "id",
+ "summary"
],
"properties": {
- "name": {
+ "type": {
"type": "string",
- "minLength": 1,
- "maxLength": 128,
- "pattern": "^[a-zA-Z0-9_-]+$"
+ "enum": [
+ "reasoning"
+ ],
+ "description": "The type of the object. Always `reasoning`.",
+ "x-stainless-const": true
},
- "description": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the reasoning content."
+ },
+ "encrypted_content": {
"anyOf": [
{
"type": "string"
@@ -33847,1037 +56102,1254 @@
}
]
},
- "parameters": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EmptyModelParam"
- },
- {
- "type": "null"
- }
- ]
+ "summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
+ },
+ "description": "Reasoning summary content."
},
- "strict": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ },
+ "description": "Reasoning text content."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
+ },
+ "OpenAI.ItemReferenceParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "item_reference"
+ ],
+ "description": "The type of item to reference. Always `item_reference`.",
+ "x-stainless-const": true
},
+ "id": {
+ "type": "string",
+ "description": "The ID of the item to reference."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "An internal identifier for an item to reference.",
+ "title": "Item reference"
+ },
+ "OpenAI.ItemResource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ItemResourceType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "message": "#/components/schemas/OpenAI.ItemResourceInputMessage",
+ "output_message": "#/components/schemas/OpenAI.ItemResourceOutputMessage",
+ "file_search_call": "#/components/schemas/OpenAI.ItemResourceFileSearchToolCall",
+ "computer_call": "#/components/schemas/OpenAI.ItemResourceComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.ItemResourceComputerToolCallOutput",
+ "web_search_call": "#/components/schemas/OpenAI.ItemResourceWebSearchToolCall",
+ "function_call": "#/components/schemas/OpenAI.ItemResourceFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutput",
+ "tool_search_call": "#/components/schemas/OpenAI.ItemResourceToolSearchCall",
+ "tool_search_output": "#/components/schemas/OpenAI.ItemResourceToolSearchOutput",
+ "additional_tools": "#/components/schemas/OpenAI.ItemResourceAdditionalTools",
+ "reasoning": "#/components/schemas/OpenAI.ItemResourceReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.ItemResourceCompactionBody",
+ "image_generation_call": "#/components/schemas/OpenAI.ItemResourceImageGenToolCall",
+ "code_interpreter_call": "#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.ItemResourceFunctionShellCall",
+ "shell_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput",
+ "apply_patch_call": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput",
+ "mcp_list_tools": "#/components/schemas/OpenAI.ItemResourceMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource",
+ "mcp_call": "#/components/schemas/OpenAI.ItemResourceMcpToolCall",
+ "custom_tool_call": "#/components/schemas/OpenAI.ItemResourceCustomToolCallResource",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.ItemResourceCustomToolCallOutputResource"
+ }
+ },
+ "description": "Content item used to generate a response."
+ },
+ "OpenAI.ItemResourceAdditionalTools": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "role",
+ "tools"
+ ],
+ "properties": {
"type": {
"type": "string",
"enum": [
- "function"
+ "additional_tools"
],
+ "description": "The type of the item. Always `additional_tools`.",
"x-stainless-const": true,
- "default": "function"
+ "default": "additional_tools"
},
- "defer_loading": {
- "type": "boolean",
- "description": "Whether this function should be deferred and discovered via tool search."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the additional tools item."
+ },
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role that provided the additional tools."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The additional tool definitions made available at this item."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ]
},
- "OpenAI.GraderLabelModel": {
+ "OpenAI.ItemResourceApplyPatchToolCall": {
"type": "object",
"required": [
"type",
- "name",
- "model",
- "input",
- "labels",
- "passing_labels"
+ "id",
+ "call_id",
+ "status",
+ "operation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "label_model"
+ "apply_patch_call"
],
- "description": "The object type, which is always `label_model`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `apply_patch_call`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
},
- "model": {
+ "call_id": {
"type": "string",
- "description": "The model to use for the evaluation. Must support structured outputs."
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
- "input": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- }
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
},
- "labels": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The labels to assign to each item in the evaluation."
+ "operation": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
+ "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
+ "title": "Apply patch operation"
},
- "passing_labels": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The labels that indicate a passing result. Must be a subset of labels."
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
- "description": "A LabelModelGrader object which uses a model to assign labels to each item\nin the evaluation.",
- "title": "LabelModelGrader",
- "x-oaiMeta": {
- "name": "Label Model Grader",
- "group": "graders",
- "example": "{\n \"name\": \"First label grader\",\n \"type\": \"label_model\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"input\": [\n {\n \"type\": \"message\",\n \"role\": \"system\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Classify the sentiment of the following statement as one of positive, neutral, or negative\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Statement: {{item.response}}\"\n }\n }\n ],\n \"passing_labels\": [\n \"positive\"\n ],\n \"labels\": [\n \"positive\",\n \"neutral\",\n \"negative\"\n ]\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
+ "title": "Apply patch tool call"
},
- "OpenAI.GraderMulti": {
+ "OpenAI.ItemResourceApplyPatchToolCallOutput": {
"type": "object",
"required": [
"type",
- "name",
- "graders",
- "calculate_output"
+ "id",
+ "call_id",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "multi"
+ "apply_patch_call_output"
],
- "description": "The object type, which is always `multi`.",
+ "description": "The type of the item. Always `apply_patch_call_output`.",
"x-stainless-const": true,
- "default": "multi"
+ "default": "apply_patch_call_output"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
},
- "graders": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderPython"
- },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the apply patch tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ },
+ "output": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.GraderLabelModel"
+ "type": "null"
}
]
},
- "calculate_output": {
+ "created_by": {
"type": "string",
- "description": "A formula to calculate the output based on grader results."
+ "description": "The ID of the entity that created this tool call output."
}
},
- "description": "A MultiGrader object combines the output of multiple graders to produce a single score.",
- "title": "MultiGrader",
- "x-oaiMeta": {
- "name": "Multi Grader",
- "group": "graders",
- "example": "{\n \"type\": \"multi\",\n \"name\": \"example multi grader\",\n \"graders\": [\n {\n \"type\": \"text_similarity\",\n \"name\": \"example text similarity grader\",\n \"input\": \"The graded text\",\n \"reference\": \"The reference text\",\n \"evaluation_metric\": \"fuzzy_match\"\n },\n {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n ],\n \"calculate_output\": \"0.5 * text_similarity_score + 0.5 * string_check_score)\"\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "The output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
},
- "OpenAI.GraderPython": {
+ "OpenAI.ItemResourceCodeInterpreterToolCall": {
"type": "object",
"required": [
"type",
- "name",
- "source"
+ "id",
+ "status",
+ "container_id",
+ "code",
+ "outputs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "python"
+ "code_interpreter_call"
],
- "description": "The object type, which is always `python`.",
- "x-stainless-const": true
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "x-stainless-const": true,
+ "default": "code_interpreter_call"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The unique ID of the code interpreter tool call."
},
- "source": {
+ "status": {
"type": "string",
- "description": "The source code of the python script."
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete",
+ "interpreting",
+ "failed"
+ ],
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
},
- "image_tag": {
+ "container_id": {
"type": "string",
- "description": "The image tag to use for the python script."
+ "description": "The ID of the container used to run the code."
+ },
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "outputs": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "A PythonGrader object that runs a python script on the input.",
- "title": "PythonGrader",
- "x-oaiMeta": {
- "name": "Python Grader",
- "group": "graders",
- "example": "{\n \"type\": \"python\",\n \"name\": \"Example python grader\",\n \"image_tag\": \"2025-05-08\",\n \"source\": \"\"\"\ndef grade(sample: dict, item: dict) -> float:\n \"\"\"\n Returns 1.0 if `output_text` equals `label`, otherwise 0.0.\n \"\"\"\n output = sample.get(\"output_text\")\n label = item.get(\"label\")\n return 1.0 if output == label else 0.0\n\"\"\",\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
},
- "OpenAI.GraderScoreModel": {
+ "OpenAI.ItemResourceCompactionBody": {
"type": "object",
"required": [
"type",
- "name",
- "model",
- "input"
+ "id",
+ "encrypted_content"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "score_model"
+ "compaction"
],
- "description": "The object type, which is always `score_model`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `compaction`.",
+ "x-stainless-const": true,
+ "default": "compaction"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The unique ID of the compaction item."
},
- "model": {
+ "encrypted_content": {
"type": "string",
- "description": "The model to use for the evaluation."
- },
- "sampling_params": {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams",
- "description": "The sampling parameters for the model."
- },
- "input": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- },
- "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings."
+ "description": "The encrypted content that was produced by compaction."
},
- "range": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "description": "The range of the score. Defaults to `[0, 1]`."
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "A ScoreModelGrader object that uses a model to assign a score to the input.",
- "title": "ScoreModelGrader",
- "x-oaiMeta": {
- "name": "Score Model Grader",
- "group": "graders",
- "example": "{\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": (\n \"Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different.\"\n \" Return just a floating point score\n\n\"\n \" Reference answer: {{item.label}}\n\n\"\n \" Model answer: {{sample.output_text}}\"\n )\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/reference.png\",\n \"file_id\": null,\n \"detail\": \"auto\"\n }\n ],\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42,\n \"max_completions_tokens\": 32768,\n \"reasoning_effort\": \"medium\"\n },\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "OpenAI.GraderStringCheck": {
+ "OpenAI.ItemResourceComputerToolCall": {
"type": "object",
"required": [
"type",
- "name",
- "input",
- "reference",
- "operation"
+ "id",
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "string_check"
+ "computer_call"
],
- "description": "The object type, which is always `string_check`.",
- "x-stainless-const": true
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The unique ID of the computer call."
},
- "input": {
+ "call_id": {
"type": "string",
- "description": "The input text. This may include template strings."
+ "description": "An identifier used when responding to the tool call with output."
},
- "reference": {
- "type": "string",
- "description": "The reference text. This may include template strings."
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
},
- "operation": {
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ },
+ "pending_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The pending safety checks for the computer call."
+ },
+ "status": {
"type": "string",
"enum": [
- "eq",
- "ne",
- "like",
- "ilike"
+ "in_progress",
+ "completed",
+ "incomplete"
],
- "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
- "description": "A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.",
- "title": "StringCheckGrader",
- "x-oaiMeta": {
- "name": "String Check Grader",
- "group": "graders",
- "example": "{\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "OpenAI.GraderTextSimilarity": {
+ "OpenAI.ItemResourceComputerToolCallOutput": {
"type": "object",
"required": [
"type",
- "name",
- "input",
- "reference",
- "evaluation_metric"
+ "id",
+ "call_id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "text_similarity"
+ "computer_call_output"
],
- "description": "The type of grader.",
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
"x-stainless-const": true,
- "default": "text_similarity"
+ "default": "computer_call_output"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The ID of the computer tool call output.",
+ "readOnly": true
},
- "input": {
+ "call_id": {
"type": "string",
- "description": "The text being graded."
+ "description": "The ID of the computer tool call that produced the output."
},
- "reference": {
- "type": "string",
- "description": "The text being graded against."
+ "acknowledged_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
},
- "evaluation_metric": {
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ },
+ "status": {
"type": "string",
"enum": [
- "cosine",
- "fuzzy_match",
- "bleu",
- "gleu",
- "meteor",
- "rouge_1",
- "rouge_2",
- "rouge_3",
- "rouge_4",
- "rouge_5",
- "rouge_l"
+ "in_progress",
+ "completed",
+ "incomplete"
],
- "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`."
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
- "description": "A TextSimilarityGrader object which grades text based on similarity metrics.",
- "title": "TextSimilarityGrader",
- "x-oaiMeta": {
- "name": "Text Similarity Grader",
- "group": "graders",
- "example": "{\n \"type\": \"text_similarity\",\n \"name\": \"Example text similarity grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"evaluation_metric\": \"fuzzy_match\"\n}\n"
- }
- },
- "OpenAI.GrammarSyntax1": {
- "type": "string",
- "enum": [
- "lark",
- "regex"
- ]
- },
- "OpenAI.HybridSearchOptions": {
- "type": "object",
- "required": [
- "embedding_weight",
- "text_weight"
- ],
- "properties": {
- "embedding_weight": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The weight of the embedding in the reciprocal ranking fusion."
- },
- "text_weight": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The weight of the text in the reciprocal ranking fusion."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
- }
- },
- "OpenAI.ImageDetail": {
- "type": "string",
- "enum": [
- "low",
- "high",
- "auto",
- "original"
- ]
- },
- "OpenAI.ImageGenActionEnum": {
- "type": "string",
- "enum": [
- "generate",
- "edit",
- "auto"
- ]
+ ],
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "OpenAI.ImageGenTool": {
+ "OpenAI.ItemResourceCustomToolCallOutputResource": {
"type": "object",
"required": [
- "type"
+ "type",
+ "call_id",
+ "output",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "image_generation"
- ],
- "description": "The type of the image generation tool. Always `image_generation`.",
- "x-stainless-const": true
- },
- "model": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "gpt-image-1",
- "gpt-image-1-mini",
- "gpt-image-1.5"
- ]
- }
- ],
- "default": "gpt-image-1"
- },
- "quality": {
- "type": "string",
- "enum": [
- "low",
- "medium",
- "high",
- "auto"
+ "custom_tool_call_output"
],
- "description": "The quality of the generated image. One of `low`, `medium`, `high`,\n or `auto`. Default: `auto`.",
- "default": "auto"
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "x-stainless-const": true
},
- "size": {
- "anyOf": [
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ },
+ "output": {
+ "oneOf": [
{
"type": "string"
},
{
- "type": "string",
- "enum": [
- "1024x1024",
- "1024x1536",
- "1536x1024",
- "auto"
- ]
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
}
],
- "description": "The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.",
- "default": "auto"
- },
- "output_format": {
- "type": "string",
- "enum": [
- "png",
- "webp",
- "jpeg"
- ],
- "description": "The output format of the generated image. One of `png`, `webp`, or\n `jpeg`. Default: `png`.",
- "default": "png"
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
},
- "output_compression": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "minimum": 0,
- "maximum": 100,
- "description": "Compression level for the output image. Default: 100.",
- "default": 100
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
},
- "moderation": {
+ "created_by": {
"type": "string",
- "enum": [
- "auto",
- "low"
- ],
- "description": "Moderation level for the generated image. Default: `auto`.",
- "default": "auto"
- },
- "background": {
+ "description": "The identifier of the actor that created the item."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "title": "ResponseCustomToolCallOutputItem"
+ },
+ "OpenAI.ItemResourceCustomToolCallResource": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "input",
+ "status"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "transparent",
- "opaque",
- "auto"
+ "custom_tool_call"
],
- "description": "Background type for the generated image. One of `transparent`,\n `opaque`, or `auto`. Default: `auto`.",
- "default": "auto"
- },
- "input_fidelity": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputFidelity"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "x-stainless-const": true
},
- "input_image_mask": {
- "$ref": "#/components/schemas/OpenAI.ImageGenToolInputImageMask",
- "description": "Optional mask for inpainting. Contains `image_url`\n (string, optional) and `file_id` (string, optional)."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
},
- "partial_images": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "minimum": 0,
- "maximum": 3,
- "description": "Number of partial images to generate in streaming mode, from 0 (default value) to 3."
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used to map this custom tool call to a tool call output."
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.ImageGenActionEnum",
- "description": "Whether to generate a new image or edit an existing image. Default: `auto`."
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the custom tool being called."
},
"name": {
"type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The name of the custom tool being called."
},
- "description": {
+ "input": {
"type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The input for the custom tool call generated by the model."
},
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "A tool that generates images using the GPT image models.",
- "title": "Image generation tool"
+ "title": "ResponseCustomToolCallItem"
},
- "OpenAI.ImageGenToolInputImageMask": {
+ "OpenAI.ItemResourceFileSearchToolCall": {
"type": "object",
+ "required": [
+ "id",
+ "type",
+ "status",
+ "queries"
+ ],
"properties": {
- "image_url": {
+ "id": {
"type": "string",
- "format": "uri"
+ "description": "The unique ID of the file search tool call."
},
- "file_id": {
- "type": "string"
- }
- }
- },
- "OpenAI.IncludeEnum": {
- "anyOf": [
- {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "file_search_call"
+ ],
+ "description": "The type of the file search tool call. Always `file_search_call`.",
+ "x-stainless-const": true
},
- {
+ "status": {
"type": "string",
"enum": [
- "file_search_call.results",
- "web_search_call.results",
- "web_search_call.action.sources",
- "message.input_image.image_url",
- "computer_call_output.output.image_url",
- "code_interpreter_call.outputs",
- "reasoning.encrypted_content",
- "message.output_text.logprobs",
- "memory_search_call.results"
+ "in_progress",
+ "searching",
+ "completed",
+ "incomplete",
+ "failed"
+ ],
+ "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
+ },
+ "queries": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The queries used to search for files."
+ },
+ "results": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
+ }
+ },
+ {
+ "type": "null"
+ }
]
}
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
],
- "description": "Specify additional output data to include in the model response. Currently supported values are:\n- `web_search_call.results`: Include the search results of the web search tool call.\n- `web_search_call.action.sources`: Include the sources of the web search tool call.\n- `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.\n- `computer_call_output.output.image_url`: Include image urls from the computer call output.\n- `file_search_call.results`: Include the search results of the file search tool call.\n- `message.input_image.image_url`: Include image urls from the input message.\n- `message.output_text.logprobs`: Include logprobs with assistant messages.\n- `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)."
+ "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
+ "title": "File search tool call"
},
- "OpenAI.InlineSkillParam": {
+ "OpenAI.ItemResourceFunctionShellCall": {
"type": "object",
"required": [
"type",
- "name",
- "description",
- "source"
+ "id",
+ "call_id",
+ "action",
+ "status",
+ "environment"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "inline"
+ "shell_call"
],
- "description": "Defines an inline skill for this request.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `shell_call`.",
+ "x-stainless-const": true,
+ "default": "shell_call"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the skill."
+ "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
},
- "description": {
+ "call_id": {
"type": "string",
- "description": "The description of the skill."
+ "description": "The unique ID of the shell tool call generated by the model."
},
- "source": {
- "$ref": "#/components/schemas/OpenAI.InlineSkillSourceParam",
- "description": "Inline skill payload"
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
+ "description": "The shell commands and limits that describe how to run the tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
+ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
+ },
+ "environment": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ContainerSkill"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
- ]
+ ],
+ "description": "A tool call that executes one or more shell commands in a managed environment.",
+ "title": "Shell tool call"
},
- "OpenAI.InlineSkillSourceParam": {
+ "OpenAI.ItemResourceFunctionShellCallOutput": {
"type": "object",
"required": [
"type",
- "media_type",
- "data"
+ "id",
+ "call_id",
+ "status",
+ "output",
+ "max_output_length"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "base64"
+ "shell_call_output"
],
- "description": "The type of the inline skill source. Must be `base64`.",
+ "description": "The type of the shell call output. Always `shell_call_output`.",
"x-stainless-const": true,
- "default": "base64"
+ "default": "shell_call_output"
},
- "media_type": {
+ "id": {
"type": "string",
- "enum": [
- "application/zip"
- ],
- "description": "The media type of the inline skill payload. Must be `application/zip`.",
- "x-stainless-const": true,
- "default": "application/zip"
+ "description": "The unique ID of the shell call output. Populated when this item is returned via API."
},
- "data": {
+ "call_id": {
"type": "string",
- "minLength": 1,
- "maxLength": 70254592,
- "description": "Base64-encoded skill zip bundle."
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
+ "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ },
+ "output": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
+ },
+ "description": "An array of shell call output contents"
+ },
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "Inline skill payload"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "The output of a shell tool call that was emitted.",
+ "title": "Shell call output"
},
- "OpenAI.InputAudio": {
+ "OpenAI.ItemResourceFunctionToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "input_audio"
+ "call_id",
+ "name",
+ "arguments"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call.",
+ "readOnly": true
+ },
"type": {
"type": "string",
"enum": [
- "input_audio"
+ "function_call"
],
- "description": "The type of the input item. Always `input_audio`.",
+ "description": "The type of the function tool call. Always `function_call`.",
"x-stainless-const": true
},
- "input_audio": {
- "$ref": "#/components/schemas/OpenAI.InputAudioInputAudio"
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the function to run."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the function to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the function."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "An audio input to the model.",
- "title": "Input audio"
+ "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
+ "title": "Function tool call"
},
- "OpenAI.InputAudioInputAudio": {
+ "OpenAI.ItemResourceFunctionToolCallOutput": {
"type": "object",
"required": [
- "data",
- "format"
+ "id",
+ "type",
+ "call_id",
+ "output"
],
"properties": {
- "data": {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
+ "readOnly": true
},
- "format": {
+ "type": {
"type": "string",
"enum": [
- "mp3",
- "wav"
- ]
- }
- }
- },
- "OpenAI.InputContent": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.InputContentType"
+ "function_call_output"
+ ],
+ "description": "The type of the function tool call output. Always `function_call_output`.",
+ "x-stainless-const": true
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "input_text": "#/components/schemas/OpenAI.InputContentInputTextContent",
- "input_image": "#/components/schemas/OpenAI.InputContentInputImageContent",
- "input_file": "#/components/schemas/OpenAI.InputContentInputFileContent"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
- }
+ ],
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
},
- "OpenAI.InputContentInputFileContent": {
+ "OpenAI.ItemResourceImageGenToolCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "status",
+ "result"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_file"
+ "image_generation_call"
],
- "description": "The type of the input item. Always `input_file`.",
- "x-stainless-const": true,
- "default": "input_file"
+ "description": "The type of the image generation call. Always `image_generation_call`.",
+ "x-stainless-const": true
},
- "file_id": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the image generation call."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "generating",
+ "failed"
+ ],
+ "description": "The status of the image generation call."
+ },
+ "result": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
- }
- ]
- },
- "filename": {
- "type": "string",
- "description": "The name of the file to be sent to the model."
- },
- "file_data": {
- "type": "string",
- "description": "The content of the file to be sent to the model."
- },
- "file_url": {
- "type": "string",
- "format": "uri",
- "description": "The URL of the file to be sent to the model."
- },
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputContent"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "A file input to the model.",
- "title": "Input file"
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
},
- "OpenAI.InputContentInputImageContent": {
+ "OpenAI.ItemResourceInputMessage": {
"type": "object",
"required": [
"type",
- "detail"
+ "role",
+ "content",
+ "id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_image"
+ "message"
],
- "description": "The type of the input item. Always `input_image`.",
+ "description": "The type of the message input. Always set to `message`.",
"x-stainless-const": true,
- "default": "input_image"
+ "default": "message"
},
- "image_url": {
- "anyOf": [
- {
- "type": "string",
- "format": "uri"
- },
- {
- "type": "null"
- }
- ]
+ "role": {
+ "type": "string",
+ "enum": [
+ "user",
+ "system",
+ "developer"
+ ],
+ "description": "The role of the message input. One of `user`, `system`, or `developer`."
},
- "file_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
+ "content": {
+ "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the message input.",
+ "readOnly": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputContent"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
- "title": "Input image"
+ "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role.",
+ "title": "Input message"
},
- "OpenAI.InputContentInputTextContent": {
+ "OpenAI.ItemResourceLocalShellToolCall": {
"type": "object",
"required": [
"type",
- "text"
+ "id",
+ "call_id",
+ "action",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_text"
+ "local_shell_call"
],
- "description": "The type of the input item. Always `input_text`.",
- "x-stainless-const": true,
- "default": "input_text"
+ "description": "The type of the local shell call. Always `local_shell_call`.",
+ "x-stainless-const": true
},
- "text": {
+ "id": {
"type": "string",
- "description": "The text input to the model."
+ "description": "The unique ID of the local shell call."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the local shell call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputContent"
- }
- ],
- "description": "A text input to the model.",
- "title": "Input text"
- },
- "OpenAI.InputContentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "input_text",
- "input_image",
- "input_file"
- ]
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
- ]
- },
- "OpenAI.InputFidelity": {
- "type": "string",
- "enum": [
- "high",
- "low"
],
- "description": "Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`."
+ "description": "A tool call to run a command on the local shell.",
+ "title": "Local shell call"
},
- "OpenAI.InputFileContent": {
+ "OpenAI.ItemResourceLocalShellToolCallOutput": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_file"
+ "local_shell_call_output"
],
- "description": "The type of the input item. Always `input_file`.",
- "x-stainless-const": true,
- "default": "input_file"
+ "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "x-stainless-const": true
},
- "file_id": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "output": {
+ "type": "string",
+ "description": "A JSON string of the output of the local shell tool call."
+ },
+ "status": {
"anyOf": [
{
- "type": "string"
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
},
{
"type": "null"
}
]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "The output of a local shell tool call.",
+ "title": "Local shell call output"
+ },
+ "OpenAI.ItemResourceMcpApprovalRequest": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp_approval_request"
+ ],
+ "description": "The type of the item. Always `mcp_approval_request`.",
+ "x-stainless-const": true
},
- "filename": {
+ "id": {
"type": "string",
- "description": "The name of the file to be sent to the model."
+ "description": "The unique ID of the approval request."
},
- "file_data": {
+ "server_label": {
"type": "string",
- "description": "The content of the file to be sent to the model."
+ "description": "The label of the MCP server making the request."
},
- "file_url": {
+ "name": {
"type": "string",
- "format": "uri",
- "description": "The URL of the file to be sent to the model."
+ "description": "The name of the tool to run."
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of arguments for the tool."
}
},
- "description": "A file input to the model.",
- "title": "Input file"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "A request for human approval of a tool invocation.",
+ "title": "MCP approval request"
},
- "OpenAI.InputFileContentParam": {
+ "OpenAI.ItemResourceMcpApprovalResponseResource": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "approval_request_id",
+ "approve"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_file"
+ "mcp_approval_response"
],
- "description": "The type of the input item. Always `input_file`.",
- "x-stainless-const": true,
- "default": "input_file"
+ "description": "The type of the item. Always `mcp_approval_response`.",
+ "x-stainless-const": true
},
- "file_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the approval response"
},
- "filename": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "approval_request_id": {
+ "type": "string",
+ "description": "The ID of the approval request being answered."
},
- "file_data": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "approve": {
+ "type": "boolean",
+ "description": "Whether the request was approved."
},
- "file_url": {
+ "reason": {
"anyOf": [
{
- "type": "string",
- "format": "uri"
+ "type": "string"
},
{
"type": "null"
}
]
- },
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
- "description": "A file input to the model.",
- "title": "Input file"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "A response to an MCP approval request.",
+ "title": "MCP approval response"
},
- "OpenAI.InputImageContent": {
+ "OpenAI.ItemResourceMcpListTools": {
"type": "object",
"required": [
"type",
- "detail"
+ "id",
+ "server_label",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_image"
+ "mcp_list_tools"
],
- "description": "The type of the input item. Always `input_image`.",
- "x-stainless-const": true,
- "default": "input_image"
+ "description": "The type of the item. Always `mcp_list_tools`.",
+ "x-stainless-const": true
},
- "image_url": {
- "anyOf": [
- {
- "type": "string",
- "format": "uri"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the list."
},
- "file_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server."
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
+ },
+ "description": "The tools available on the server."
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
},
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
- "title": "Input image"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "A list of tools available on an MCP server.",
+ "title": "MCP list tools"
},
- "OpenAI.InputImageContentParamAutoParam": {
+ "OpenAI.ItemResourceMcpToolCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_image"
+ "mcp_call"
],
- "description": "The type of the input item. Always `input_image`.",
- "x-stainless-const": true,
- "default": "input_image"
+ "description": "The type of the item. Always `mcp_call`.",
+ "x-stainless-const": true
},
- "image_url": {
- "anyOf": [
- {
- "type": "string",
- "format": "uri"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool call."
},
- "file_id": {
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server running the tool."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tool that was run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments passed to the tool."
+ },
+ "output": {
"anyOf": [
{
"type": "string"
@@ -34887,10 +57359,18 @@
}
]
},
- "detail": {
+ "error": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
+ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ },
+ "approval_request_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.DetailEnum"
+ "type": "string"
},
{
"type": "null"
@@ -34898,123 +57378,100 @@
]
}
},
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision)",
- "title": "Input image"
- },
- "OpenAI.InputItem": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.InputItemType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "message": "#/components/schemas/OpenAI.EasyInputMessage",
- "item_reference": "#/components/schemas/OpenAI.ItemReferenceParam",
- "output_message": "#/components/schemas/OpenAI.InputItemOutputMessage",
- "file_search_call": "#/components/schemas/OpenAI.InputItemFileSearchToolCall",
- "computer_call": "#/components/schemas/OpenAI.InputItemComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.InputItemComputerCallOutputItemParam",
- "web_search_call": "#/components/schemas/OpenAI.InputItemWebSearchToolCall",
- "function_call": "#/components/schemas/OpenAI.InputItemFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.InputItemFunctionCallOutputItemParam",
- "tool_search_call": "#/components/schemas/OpenAI.InputItemToolSearchCallItemParam",
- "tool_search_output": "#/components/schemas/OpenAI.InputItemToolSearchOutputItemParam",
- "additional_tools": "#/components/schemas/OpenAI.InputItemAdditionalToolsItemParam",
- "reasoning": "#/components/schemas/OpenAI.InputItemReasoningItem",
- "compaction": "#/components/schemas/OpenAI.InputItemCompactionSummaryItemParam",
- "image_generation_call": "#/components/schemas/OpenAI.InputItemImageGenToolCall",
- "code_interpreter_call": "#/components/schemas/OpenAI.InputItemCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.InputItemLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.InputItemLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.InputItemFunctionShellCallItemParam",
- "shell_call_output": "#/components/schemas/OpenAI.InputItemFunctionShellCallOutputItemParam",
- "apply_patch_call": "#/components/schemas/OpenAI.InputItemApplyPatchToolCallItemParam",
- "apply_patch_call_output": "#/components/schemas/OpenAI.InputItemApplyPatchToolCallOutputItemParam",
- "mcp_list_tools": "#/components/schemas/OpenAI.InputItemMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.InputItemMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.InputItemMcpApprovalResponse",
- "mcp_call": "#/components/schemas/OpenAI.InputItemMcpToolCall",
- "custom_tool_call_output": "#/components/schemas/OpenAI.InputItemCustomToolCallOutput",
- "custom_tool_call": "#/components/schemas/OpenAI.InputItemCustomToolCall"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
- },
- "description": "An item representing part of the context for the response to be\ngenerated by the model. Can contain text, images, and audio inputs,\nas well as previous assistant responses and tool call outputs."
+ ],
+ "description": "An invocation of a tool on an MCP server.",
+ "title": "MCP tool call"
},
- "OpenAI.InputItemAdditionalToolsItemParam": {
+ "OpenAI.ItemResourceOutputMessage": {
"type": "object",
"required": [
+ "id",
"type",
"role",
- "tools"
+ "content",
+ "status"
],
"properties": {
"id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "description": "The unique ID of the output message."
},
"type": {
"type": "string",
"enum": [
- "additional_tools"
+ "output_message"
],
- "description": "The item type. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
+ "description": "The type of the output message. Always `message`.",
+ "x-stainless-const": true
},
"role": {
"type": "string",
"enum": [
- "developer"
+ "assistant"
],
- "description": "The role that provided the additional tools. Only `developer` is supported.",
- "x-stainless-const": true,
- "default": "developer"
+ "description": "The role of the output message. Always `assistant`.",
+ "x-stainless-const": true
},
- "tools": {
+ "content": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
},
- "description": "A list of additional tools made available at this item."
+ "description": "The content of the output message."
+ },
+ "phase": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
- ]
+ ],
+ "description": "An output message from the model.",
+ "title": "Output message"
},
- "OpenAI.InputItemApplyPatchToolCallItemParam": {
+ "OpenAI.ItemResourceReasoningItem": {
"type": "object",
"required": [
"type",
- "call_id",
- "status",
- "operation"
+ "id",
+ "summary"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call"
+ "reasoning"
],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
+ "description": "The type of the object. Always `reasoning`.",
+ "x-stainless-const": true
},
"id": {
+ "type": "string",
+ "description": "The unique identifier of the reasoning content."
+ },
+ "encrypted_content": {
"anyOf": [
{
"type": "string"
@@ -35024,47 +57481,63 @@
}
]
},
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
+ },
+ "description": "Reasoning summary content."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatusParam",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ },
+ "description": "Reasoning text content."
},
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam",
- "description": "The specific create, delete, or update instruction for the apply_patch tool call."
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "A tool call representing a request to create, delete, or update files using diff patches.",
- "title": "Apply patch tool call"
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
},
- "OpenAI.InputItemApplyPatchToolCallOutputItemParam": {
+ "OpenAI.ItemResourceToolSearchCall": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
+ "execution",
+ "arguments",
"status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call_output"
+ "tool_search_call"
],
- "description": "The type of the item. Always `apply_patch_call_output`.",
+ "description": "The type of the item. Always `tool_search_call`.",
"x-stainless-const": true,
- "default": "apply_patch_call_output"
+ "default": "tool_search_call"
},
"id": {
+ "type": "string",
+ "description": "The unique ID of the tool search call item."
+ },
+ "call_id": {
"anyOf": [
{
"type": "string"
@@ -35074,75 +57547,53 @@
}
]
},
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "arguments": {
+ "description": "Arguments used for the tool search call."
},
"status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the tool search call item that was recorded."
},
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
- ],
- "description": "The streamed output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
+ ]
},
- "OpenAI.InputItemCodeInterpreterToolCall": {
+ "OpenAI.ItemResourceToolSearchOutput": {
"type": "object",
"required": [
"type",
"id",
- "status",
- "container_id",
- "code",
- "outputs"
+ "call_id",
+ "execution",
+ "tools",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "code_interpreter_call"
+ "tool_search_output"
],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "description": "The type of the item. Always `tool_search_output`.",
"x-stainless-const": true,
- "default": "code_interpreter_call"
+ "default": "tool_search_output"
},
"id": {
"type": "string",
- "description": "The unique ID of the code interpreter tool call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
- ],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
- },
- "container_id": {
- "type": "string",
- "description": "The ID of the container used to run the code."
+ "description": "The unique ID of the tool search output item."
},
- "code": {
+ "call_id": {
"anyOf": [
{
"type": "string"
@@ -35152,81 +57603,155 @@
}
]
},
- "outputs": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The loaded tool definitions returned by tool search."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the tool search output item that was recorded."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
- ],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
+ ]
},
- "OpenAI.InputItemCompactionSummaryItemParam": {
+ "OpenAI.ItemResourceType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "message",
+ "output_message",
+ "file_search_call",
+ "computer_call",
+ "computer_call_output",
+ "web_search_call",
+ "function_call",
+ "function_call_output",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "reasoning",
+ "compaction",
+ "image_generation_call",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "mcp_call",
+ "custom_tool_call",
+ "custom_tool_call_output",
+ "structured_outputs",
+ "oauth_consent_request",
+ "memory_search_call",
+ "memory_command_preview_call",
+ "memory_command_preview_call_output",
+ "workflow_action",
+ "a2a_preview_call",
+ "a2a_preview_call_output",
+ "bing_grounding_call",
+ "bing_grounding_call_output",
+ "sharepoint_grounding_preview_call",
+ "sharepoint_grounding_preview_call_output",
+ "azure_ai_search_call",
+ "azure_ai_search_call_output",
+ "bing_custom_search_preview_call",
+ "bing_custom_search_preview_call_output",
+ "openapi_call",
+ "openapi_call_output",
+ "browser_automation_preview_call",
+ "browser_automation_preview_call_output",
+ "fabric_dataagent_preview_call",
+ "fabric_dataagent_preview_call_output",
+ "azure_function_call",
+ "azure_function_call_output"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ItemResourceWebSearchToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "encrypted_content"
+ "status",
+ "action"
],
"properties": {
"id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
},
"type": {
"type": "string",
"enum": [
- "compaction"
+ "web_search_call"
],
- "description": "The type of the item. Always `compaction`.",
- "x-stainless-const": true,
- "default": "compaction"
+ "description": "The type of the web search tool call. Always `web_search_call`.",
+ "x-stainless-const": true
},
- "encrypted_content": {
+ "status": {
"type": "string",
- "maxLength": 10485760,
- "description": "The encrypted content of the compaction summary."
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
+ ],
+ "description": "The status of the web search tool call."
+ },
+ "action": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ }
+ ],
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
},
- "OpenAI.InputItemComputerCallOutputItemParam": {
+ "OpenAI.ItemToolSearchCallItemParam": {
"type": "object",
"required": [
- "call_id",
"type",
- "output"
+ "arguments"
],
"properties": {
"id": {
@@ -35240,35 +57765,31 @@
]
},
"call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The ID of the computer tool call that produced the output."
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"type": {
"type": "string",
"enum": [
- "computer_call_output"
+ "tool_search_call"
],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "description": "The item type. Always `tool_search_call`.",
"x-stainless-const": true,
- "default": "computer_call_output"
+ "default": "tool_search_call"
},
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
},
- "acknowledged_safety_checks": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- }
- },
- {
- "type": "null"
- }
- ]
+ "arguments": {
+ "$ref": "#/components/schemas/OpenAI.EmptyModelParam",
+ "description": "The arguments supplied to the tool search call."
},
"status": {
"anyOf": [
@@ -35283,811 +57804,742 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- ],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ ]
},
- "OpenAI.InputItemComputerToolCall": {
+ "OpenAI.ItemToolSearchOutputItemParam": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "pending_safety_checks",
- "status"
+ "tools"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_call"
- ],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
- },
"id": {
- "type": "string",
- "description": "The unique ID of the computer call."
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"call_id": {
- "type": "string",
- "description": "An identifier used when responding to the tool call with output."
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "type": {
+ "type": "string",
+ "enum": [
+ "tool_search_output"
+ ],
+ "description": "The item type. Always `tool_search_output`.",
+ "x-stainless-const": true,
+ "default": "tool_search_output"
},
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
},
- "pending_safety_checks": {
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ "$ref": "#/components/schemas/OpenAI.Tool"
},
- "description": "The pending safety checks for the computer call."
+ "description": "The loaded tool definitions returned by the tool search output."
},
"status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- ],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
+ ]
},
- "OpenAI.InputItemCustomToolCall": {
- "type": "object",
- "required": [
- "type",
- "call_id",
- "name",
- "input"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "custom_tool_call"
- ],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the custom tool being called."
- },
- "name": {
- "type": "string",
- "description": "The name of the custom tool being called."
+ "OpenAI.ItemType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "input": {
- "type": "string",
- "description": "The input for the custom tool call generated by the model."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "type": "string",
+ "enum": [
+ "message",
+ "output_message",
+ "file_search_call",
+ "computer_call",
+ "computer_call_output",
+ "web_search_call",
+ "function_call",
+ "function_call_output",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "reasoning",
+ "compaction",
+ "image_generation_call",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "mcp_call",
+ "custom_tool_call_output",
+ "custom_tool_call",
+ "structured_outputs",
+ "oauth_consent_request",
+ "memory_search_call",
+ "memory_command_preview_call",
+ "memory_command_preview_call_output",
+ "workflow_action",
+ "a2a_preview_call",
+ "a2a_preview_call_output",
+ "bing_grounding_call",
+ "bing_grounding_call_output",
+ "sharepoint_grounding_preview_call",
+ "sharepoint_grounding_preview_call_output",
+ "azure_ai_search_call",
+ "azure_ai_search_call_output",
+ "bing_custom_search_preview_call",
+ "bing_custom_search_preview_call_output",
+ "openapi_call",
+ "openapi_call_output",
+ "browser_automation_preview_call",
+ "browser_automation_preview_call_output",
+ "fabric_dataagent_preview_call",
+ "fabric_dataagent_preview_call_output",
+ "azure_function_call",
+ "azure_function_call_output"
+ ]
}
- ],
- "description": "A call to a custom tool created by the model.",
- "title": "Custom tool call"
+ ]
},
- "OpenAI.InputItemCustomToolCallOutput": {
+ "OpenAI.ItemWebSearchToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "call_id",
- "output"
+ "status",
+ "action"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "custom_tool_call_output"
+ "web_search_call"
],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "description": "The type of the web search tool call. Always `web_search_call`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
- },
- "call_id": {
+ "status": {
"type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
+ ],
+ "description": "The status of the web search tool call."
},
- "output": {
+ "action": {
"oneOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
},
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
}
],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "The output of a custom tool call from your code, being sent back to the model.",
- "title": "Custom tool call output"
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
},
- "OpenAI.InputItemFileSearchToolCall": {
+ "OpenAI.KeyPressAction": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "queries"
+ "keys"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the file search tool call."
- },
"type": {
"type": "string",
"enum": [
- "file_search_call"
+ "keypress"
],
- "description": "The type of the file search tool call. Always `file_search_call`.",
+ "description": "Specifies the event type. For a keypress action, this property is always set to `keypress`.",
"x-stainless-const": true
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "incomplete",
- "failed"
- ],
- "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
- },
- "queries": {
+ "keys": {
"type": "array",
"items": {
"type": "string"
},
- "description": "The queries used to search for files."
- },
- "results": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
- }
- },
- {
- "type": "null"
- }
- ]
+ "description": "The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
- "title": "File search tool call"
+ "description": "A collection of keypresses the model would like to perform.",
+ "title": "KeyPress"
},
- "OpenAI.InputItemFunctionCallOutputItemParam": {
+ "OpenAI.KnownSpeakerNames": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 4,
+ "description": "Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported."
+ },
+ "OpenAI.KnownSpeakerReferences": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 4,
+ "description": "Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)) that contain known speaker references matching `known_speaker_names[]`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by `file`."
+ },
+ "OpenAI.ListAssistantsResponse": {
"type": "object",
"required": [
- "call_id",
- "type",
- "output"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "object": {
+ "type": "string"
},
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the function tool call generated by the model."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantObject"
+ },
+ "x-ms-list-page-items": true
},
- "type": {
- "type": "string",
- "enum": [
- "function_call_output"
- ],
- "description": "The type of the function tool call output. Always `function_call_output`.",
- "x-stainless-const": true,
- "default": "function_call_output"
+ "first_id": {
+ "type": "string"
},
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputTextContentParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputImageContentParamAutoParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputFileContentParam"
- }
- ]
- }
- }
- ],
- "description": "Text, image, or file output of the function tool call."
+ "last_id": {
+ "type": "string",
+ "x-ms-list-continuation-token": true
},
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
+ "has_more": {
+ "type": "boolean"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
+ "x-oaiMeta": {
+ "name": "List assistants response object",
+ "group": "chat",
+ "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1698982736,\n \"name\": \"Coding Tutor\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n },\n {\n \"id\": \"asst_abc456\",\n \"object\": \"assistant\",\n \"created_at\": 1698982718,\n \"name\": \"My Assistant\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n },\n {\n \"id\": \"asst_abc789\",\n \"object\": \"assistant\",\n \"created_at\": 1698982643,\n \"name\": null,\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n }\n ],\n \"first_id\": \"asst_abc123\",\n \"last_id\": \"asst_abc789\",\n \"has_more\": false\n}\n"
+ }
},
- "OpenAI.InputItemFunctionShellCallItemParam": {
+ "OpenAI.ListBatchesResponse": {
"type": "object",
"required": [
- "call_id",
- "type",
- "action"
+ "data",
+ "has_more",
+ "object"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Batch"
+ },
+ "x-ms-list-page-items": true
},
- "call_id": {
+ "first_id": {
+ "type": "string"
+ },
+ "last_id": {
"type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the shell tool call generated by the model."
+ "x-ms-list-continuation-token": true
},
- "type": {
+ "has_more": {
+ "type": "boolean"
+ },
+ "object": {
"type": "string",
"enum": [
- "shell_call"
+ "list"
],
- "description": "The type of the item. Always `shell_call`.",
- "x-stainless-const": true,
- "default": "shell_call"
+ "x-stainless-const": true
+ }
+ }
+ },
+ "OpenAI.ListFilesResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
+ ],
+ "properties": {
+ "object": {
+ "type": "string"
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellActionParam",
- "description": "The shell commands and limits that describe how to run the tool call."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.OpenAIFile"
+ },
+ "x-ms-list-page-items": true
},
- "status": {
+ "first_id": {
+ "type": "string"
+ },
+ "last_id": {
+ "type": "string",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
+ }
+ }
+ },
+ "OpenAI.ListFineTuningCheckpointPermissionResponse": {
+ "type": "object",
+ "required": [
+ "data",
+ "object",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningCheckpointPermission"
+ },
+ "x-ms-list-page-items": true
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "x-stainless-const": true
+ },
+ "first_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "environment": {
+ "last_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
+ "type": "string"
},
{
"type": "null"
}
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ ],
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "A tool representing a request to execute one or more shell commands.",
- "title": "Shell tool call"
+ }
},
- "OpenAI.InputItemFunctionShellCallOutputItemParam": {
+ "OpenAI.ListFineTuningJobCheckpointsResponse": {
"type": "object",
"required": [
- "call_id",
- "type",
- "output"
+ "data",
+ "object",
+ "has_more"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the shell tool call generated by the model."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpoint"
+ },
+ "x-ms-list-page-items": true
},
- "type": {
+ "object": {
"type": "string",
"enum": [
- "shell_call_output"
+ "list"
],
- "description": "The type of the item. Always `shell_call_output`.",
- "x-stainless-const": true,
- "default": "shell_call_output"
- },
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContentParam"
- },
- "description": "Captured chunks of stdout and stderr output, along with their associated outcomes."
+ "x-stainless-const": true
},
- "status": {
+ "first_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "max_output_length": {
+ "last_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
"type": "null"
}
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ ],
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "The streamed output items emitted by a shell tool call.",
- "title": "Shell tool call output"
+ }
},
- "OpenAI.InputItemFunctionToolCall": {
+ "OpenAI.ListFineTuningJobEventsResponse": {
"type": "object",
"required": [
- "id",
- "type",
- "call_id",
- "name",
- "arguments"
+ "data",
+ "object",
+ "has_more"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call.",
- "readOnly": true
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobEvent"
+ },
+ "x-ms-list-page-items": true
},
- "type": {
+ "object": {
"type": "string",
"enum": [
- "function_call"
+ "list"
],
- "description": "The type of the function tool call. Always `function_call`.",
"x-stainless-const": true
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
+ "has_more": {
+ "type": "boolean"
+ }
+ }
+ },
+ "OpenAI.ListMessagesResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
+ ],
+ "properties": {
+ "object": {
+ "type": "string"
},
- "namespace": {
- "type": "string",
- "description": "The namespace of the function to run."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MessageObject"
+ },
+ "x-ms-list-page-items": true
},
- "name": {
- "type": "string",
- "description": "The name of the function to run."
+ "first_id": {
+ "type": "string"
},
- "arguments": {
+ "last_id": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the function."
+ "x-ms-list-continuation-token": true
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
- "title": "Function tool call"
+ }
},
- "OpenAI.InputItemImageGenToolCall": {
+ "OpenAI.ListModelsResponse": {
"type": "object",
"required": [
- "type",
- "id",
- "status",
- "result"
+ "object",
+ "data"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "image_generation_call"
+ "list"
],
- "description": "The type of the image generation call. Always `image_generation_call`.",
"x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the image generation call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "generating",
- "failed"
- ],
- "description": "The status of the image generation call."
- },
- "result": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Model"
+ },
+ "x-ms-list-page-items": true
}
- ],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
+ }
},
- "OpenAI.InputItemLocalShellToolCall": {
+ "OpenAI.ListPaginatedFineTuningJobsResponse": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "action",
- "status"
+ "data",
+ "has_more",
+ "object"
],
"properties": {
- "type": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ },
+ "x-ms-list-page-items": true
+ },
+ "has_more": {
+ "type": "boolean"
+ },
+ "object": {
"type": "string",
"enum": [
- "local_shell_call"
+ "list"
],
- "description": "The type of the local shell call. Always `local_shell_call`.",
"x-stainless-const": true
+ }
+ }
+ },
+ "OpenAI.ListRunStepsResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
+ ],
+ "properties": {
+ "object": {
+ "type": "string"
},
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell call."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunStepObject"
+ },
+ "x-ms-list-page-items": true
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ "first_id": {
+ "type": "string"
},
- "status": {
+ "last_id": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the local shell call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "A tool call to run a command on the local shell.",
- "title": "Local shell call"
+ }
},
- "OpenAI.InputItemLocalShellToolCallOutput": {
+ "OpenAI.ListRunsResponse": {
"type": "object",
"required": [
- "type",
- "id",
- "output"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "local_shell_call_output"
- ],
- "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
- "x-stainless-const": true
+ "object": {
+ "type": "string"
},
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ },
+ "x-ms-list-page-items": true
},
- "output": {
+ "first_id": {
+ "type": "string"
+ },
+ "last_id": {
"type": "string",
- "description": "A JSON string of the output of the local shell tool call."
+ "x-ms-list-continuation-token": true
},
- "status": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "The output of a local shell tool call.",
- "title": "Local shell call output"
+ }
},
- "OpenAI.InputItemMcpApprovalRequest": {
+ "OpenAI.ListVectorStoreFilesFilter": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "OpenAI.ListVectorStoreFilesResponse": {
"type": "object",
"required": [
- "type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp_approval_request"
- ],
- "description": "The type of the item. Always `mcp_approval_request`.",
- "x-stainless-const": true
+ "object": {
+ "type": "string"
},
- "id": {
- "type": "string",
- "description": "The unique ID of the approval request."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject"
+ },
+ "x-ms-list-page-items": true
},
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server making the request."
+ "first_id": {
+ "type": "string"
},
- "name": {
+ "last_id": {
"type": "string",
- "description": "The name of the tool to run."
+ "x-ms-list-continuation-token": true
},
- "arguments": {
- "type": "string",
- "description": "A JSON string of arguments for the tool."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "A request for human approval of a tool invocation.",
- "title": "MCP approval request"
+ }
},
- "OpenAI.InputItemMcpApprovalResponse": {
+ "OpenAI.ListVectorStoresResponse": {
"type": "object",
"required": [
- "type",
- "approval_request_id",
- "approve"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp_approval_response"
- ],
- "description": "The type of the item. Always `mcp_approval_response`.",
- "x-stainless-const": true
+ "object": {
+ "type": "string"
},
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObject"
+ },
+ "x-ms-list-page-items": true
},
- "approval_request_id": {
- "type": "string",
- "description": "The ID of the approval request being answered."
+ "first_id": {
+ "type": "string"
},
- "approve": {
- "type": "boolean",
- "description": "Whether the request was approved."
+ "last_id": {
+ "type": "string",
+ "x-ms-list-continuation-token": true
},
- "reason": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "A response to an MCP approval request.",
- "title": "MCP approval response"
+ }
},
- "OpenAI.InputItemMcpListTools": {
+ "OpenAI.LocalEnvironmentResource": {
"type": "object",
"required": [
- "type",
- "id",
- "server_label",
- "tools"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_list_tools"
+ "local"
],
- "description": "The type of the item. Always `mcp_list_tools`.",
+ "description": "The environment type. Always `local`.",
"x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the list."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
- },
- "description": "The tools available on the server."
- },
- "error": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
}
],
- "description": "A list of tools available on an MCP server.",
- "title": "MCP list tools"
+ "description": "Represents the use of a local environment to perform shell actions.",
+ "title": "Local Environment"
},
- "OpenAI.InputItemMcpToolCall": {
+ "OpenAI.LocalShellExecAction": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "command",
+ "env"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_call"
+ "exec"
],
- "description": "The type of the item. Always `mcp_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the tool call."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server running the tool."
+ "description": "The type of the local shell action. Always `exec`.",
+ "x-stainless-const": true,
+ "default": "exec"
},
- "name": {
- "type": "string",
- "description": "The name of the tool that was run."
+ "command": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The command to run."
},
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments passed to the tool."
+ "timeout_ms": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "output": {
+ "working_directory": {
"anyOf": [
{
"type": "string"
@@ -36097,15 +58549,15 @@
}
]
},
- "error": {
+ "env": {
"type": "object",
- "unevaluatedProperties": {}
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
- "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Environment variables to set for the command.",
+ "x-oaiTypeLabel": "map"
},
- "approval_request_id": {
+ "user": {
"anyOf": [
{
"type": "string"
@@ -36116,159 +58568,115 @@
]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ],
- "description": "An invocation of a tool on an MCP server.",
- "title": "MCP tool call"
+ "description": "Execute a shell command on the server.",
+ "title": "Local shell exec action"
},
- "OpenAI.InputItemOutputMessage": {
+ "OpenAI.LocalShellToolParam": {
"type": "object",
"required": [
- "id",
- "type",
- "role",
- "content",
- "status"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the output message."
- },
"type": {
"type": "string",
"enum": [
- "output_message"
+ "local_shell"
],
- "description": "The type of the output message. Always `message`.",
+ "description": "The type of the local shell tool. Always `local_shell`.",
"x-stainless-const": true
},
- "role": {
+ "name": {
"type": "string",
- "enum": [
- "assistant"
- ],
- "description": "The role of the output message. Always `assistant`.",
- "x-stainless-const": true
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
- },
- "description": "The content of the output message."
- },
- "phase": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
- },
- {
- "type": "null"
- }
- ]
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- "status": {
+ "description": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "An output message from the model.",
- "title": "Output message"
+ "description": "A tool that allows the model to execute shell commands in a local environment.",
+ "title": "Local shell tool"
},
- "OpenAI.InputItemReasoningItem": {
+ "OpenAI.LocalSkillParam": {
"type": "object",
"required": [
- "type",
- "id",
- "summary"
+ "name",
+ "description",
+ "path"
],
"properties": {
- "type": {
+ "name": {
"type": "string",
- "enum": [
- "reasoning"
- ],
- "description": "The type of the object. Always `reasoning`.",
- "x-stainless-const": true
+ "description": "The name of the skill."
},
- "id": {
+ "description": {
"type": "string",
- "description": "The unique identifier of the reasoning content."
+ "description": "The description of the skill."
},
- "encrypted_content": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "path": {
+ "type": "string",
+ "description": "The path to the directory containing the skill."
+ }
+ }
+ },
+ "OpenAI.LogProb": {
+ "type": "object",
+ "required": [
+ "token",
+ "logprob",
+ "bytes",
+ "top_logprobs"
+ ],
+ "properties": {
+ "token": {
+ "type": "string"
},
- "summary": {
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "bytes": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
- },
- "description": "Reasoning summary content."
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
},
- "content": {
+ "top_logprobs": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
- },
- "description": "Reasoning text content."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
+ "$ref": "#/components/schemas/OpenAI.TopLogProb"
+ }
+ }
+ },
+ "description": "The log probability of a token.",
+ "title": "Log probability"
},
- "OpenAI.InputItemToolSearchCallItemParam": {
+ "OpenAI.MCPListToolsTool": {
"type": "object",
"required": [
- "type",
- "arguments"
+ "name",
+ "input_schema"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "name": {
+ "type": "string",
+ "description": "The name of the tool."
},
- "call_id": {
+ "description": {
"anyOf": [
{
"type": "string"
@@ -36278,27 +58686,14 @@
}
]
},
- "type": {
- "type": "string",
- "enum": [
- "tool_search_call"
- ],
- "description": "The item type. Always `tool_search_call`.",
- "x-stainless-const": true,
- "default": "tool_search_call"
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "arguments": {
- "$ref": "#/components/schemas/OpenAI.EmptyModelParam",
- "description": "The arguments supplied to the tool search call."
+ "input_schema": {
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsToolInputSchema",
+ "description": "The JSON schema describing the tool's input."
},
- "status": {
+ "annotations": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsToolAnnotations"
},
{
"type": "null"
@@ -36306,405 +58701,315 @@
]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ]
+ "description": "A tool available on an MCP server.",
+ "title": "MCP list tools tool"
},
- "OpenAI.InputItemToolSearchOutputItemParam": {
+ "OpenAI.MCPListToolsToolAnnotations": {
+ "type": "object"
+ },
+ "OpenAI.MCPListToolsToolInputSchema": {
+ "type": "object"
+ },
+ "OpenAI.MCPTool": {
"type": "object",
"required": [
"type",
- "tools"
+ "server_label"
],
"properties": {
- "id": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp"
+ ],
+ "description": "The type of the MCP tool. Always `mcp`.",
+ "x-stainless-const": true
+ },
+ "server_label": {
+ "type": "string",
+ "description": "A label for this MCP server, used to identify it in tool calls."
+ },
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL for the MCP server. One of `server_url`, `connector_id`, or\n `tunnel_id` must be provided."
+ },
+ "connector_id": {
+ "type": "string",
+ "enum": [
+ "connector_dropbox",
+ "connector_gmail",
+ "connector_googlecalendar",
+ "connector_googledrive",
+ "connector_microsoftteams",
+ "connector_outlookcalendar",
+ "connector_outlookemail",
+ "connector_sharepoint"
+ ],
+ "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more\n about service connectors [here](/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`"
+ },
+ "tunnel_id": {
+ "type": "string",
+ "pattern": "^tunnel_[a-z0-9]{32}$",
+ "description": "The Secure MCP Tunnel ID to use instead of a direct server URL. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided."
+ },
+ "authorization": {
+ "type": "string",
+ "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here."
+ },
+ "server_description": {
+ "type": "string",
+ "description": "Optional description of the MCP server, used to provide more context."
+ },
+ "headers": {
"anyOf": [
{
- "type": "string"
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
- "call_id": {
+ "allowed_tools": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
},
{
"type": "null"
}
]
},
- "type": {
- "type": "string",
- "enum": [
- "tool_search_output"
- ],
- "description": "The item type. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The loaded tool definitions returned by the tool search output."
- },
- "status": {
+ "require_approval": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "always",
+ "never"
+ ]
},
{
"type": "null"
}
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ]
- },
- "OpenAI.InputItemType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "message",
- "output_message",
- "file_search_call",
- "computer_call",
- "computer_call_output",
- "web_search_call",
- "function_call",
- "function_call_output",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "reasoning",
- "compaction",
- "image_generation_call",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "mcp_call",
- "custom_tool_call_output",
- "custom_tool_call",
- "item_reference"
- ]
- }
- ]
- },
- "OpenAI.InputItemWebSearchToolCall": {
- "type": "object",
- "required": [
- "id",
- "type",
- "status",
- "action"
- ],
- "properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the web search tool call."
- },
- "type": {
- "type": "string",
- "enum": [
- "web_search_call"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
- "x-stainless-const": true
+ "default": "always"
},
- "status": {
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this MCP tool is deferred and discovered via tool search."
+ },
+ "project_connection_id": {
"type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
- ],
- "description": "The status of the web search tool call."
+ "description": "The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server."
},
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
- }
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
- },
- "OpenAI.InputMessageContentList": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputContent"
- },
- "description": "A list of one or many input items to the model, containing different content\ntypes.",
- "title": "Input item content list"
+ "description": "Give the model access to additional tools via remote Model Context Protocol\n(MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).",
+ "title": "MCP tool"
},
- "OpenAI.InputParam": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- }
- ],
- "description": "Text, image, or file inputs to the model, used to generate a response.\nLearn more:\n- [Text inputs and outputs](/docs/guides/text)\n- [Image inputs](/docs/guides/images)\n- [File inputs](/docs/guides/pdf-files)\n- [Conversation state](/docs/guides/conversation-state)\n- [Function calling](/docs/guides/function-calling)"
+ "OpenAI.MCPToolCallStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete",
+ "calling",
+ "failed"
+ ]
},
- "OpenAI.InputTextContent": {
+ "OpenAI.MCPToolFilter": {
"type": "object",
- "required": [
- "type",
- "text"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "input_text"
- ],
- "description": "The type of the input item. Always `input_text`.",
- "x-stainless-const": true,
- "default": "input_text"
+ "tool_names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of allowed tool names.",
+ "title": "MCP allowed tools"
},
- "text": {
- "type": "string",
- "description": "The text input to the model."
+ "read_only": {
+ "type": "boolean",
+ "description": "Indicates whether or not a tool modifies data or is read-only. If an\n MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),\n it will match this filter."
}
},
- "description": "A text input to the model.",
- "title": "Input text"
+ "description": "A filter object to specify which tools are allowed.",
+ "title": "MCP tool filter"
},
- "OpenAI.InputTextContentParam": {
+ "OpenAI.MCPToolRequireApproval": {
"type": "object",
- "required": [
- "type",
- "text"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "input_text"
- ],
- "description": "The type of the input item. Always `input_text`.",
- "x-stainless-const": true,
- "default": "input_text"
+ "always": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
},
- "text": {
- "type": "string",
- "maxLength": 10485760,
- "description": "The text input to the model."
+ "never": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
}
- },
- "description": "A text input to the model.",
- "title": "Input text"
+ }
},
- "OpenAI.Item": {
+ "OpenAI.MessageContent": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ItemType"
+ "$ref": "#/components/schemas/OpenAI.MessageContentType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "message": "#/components/schemas/OpenAI.ItemInputMessage",
- "output_message": "#/components/schemas/OpenAI.ItemOutputMessage",
- "file_search_call": "#/components/schemas/OpenAI.ItemFileSearchToolCall",
- "computer_call": "#/components/schemas/OpenAI.ItemComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.ItemComputerCallOutputItemParam",
- "web_search_call": "#/components/schemas/OpenAI.ItemWebSearchToolCall",
- "function_call": "#/components/schemas/OpenAI.ItemFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.ItemFunctionCallOutputItemParam",
- "tool_search_call": "#/components/schemas/OpenAI.ItemToolSearchCallItemParam",
- "tool_search_output": "#/components/schemas/OpenAI.ItemToolSearchOutputItemParam",
- "additional_tools": "#/components/schemas/OpenAI.ItemAdditionalToolsItemParam",
- "reasoning": "#/components/schemas/OpenAI.ItemReasoningItem",
- "compaction": "#/components/schemas/OpenAI.ItemCompactionSummaryItemParam",
- "image_generation_call": "#/components/schemas/OpenAI.ItemImageGenToolCall",
- "code_interpreter_call": "#/components/schemas/OpenAI.ItemCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.ItemLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.ItemLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.ItemFunctionShellCallItemParam",
- "shell_call_output": "#/components/schemas/OpenAI.ItemFunctionShellCallOutputItemParam",
- "apply_patch_call": "#/components/schemas/OpenAI.ItemApplyPatchToolCallItemParam",
- "apply_patch_call_output": "#/components/schemas/OpenAI.ItemApplyPatchToolCallOutputItemParam",
- "mcp_list_tools": "#/components/schemas/OpenAI.ItemMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.ItemMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.ItemMcpApprovalResponse",
- "mcp_call": "#/components/schemas/OpenAI.ItemMcpToolCall",
- "custom_tool_call_output": "#/components/schemas/OpenAI.ItemCustomToolCallOutput",
- "custom_tool_call": "#/components/schemas/OpenAI.ItemCustomToolCall"
+ "text": "#/components/schemas/OpenAI.TextContent",
+ "computer_screenshot": "#/components/schemas/OpenAI.ComputerScreenshotContent",
+ "input_text": "#/components/schemas/OpenAI.MessageContentInputTextContent",
+ "output_text": "#/components/schemas/OpenAI.MessageContentOutputTextContent",
+ "reasoning_text": "#/components/schemas/OpenAI.MessageContentReasoningTextContent",
+ "refusal": "#/components/schemas/OpenAI.MessageContentRefusalContent",
+ "input_image": "#/components/schemas/OpenAI.MessageContentInputImageContent",
+ "input_file": "#/components/schemas/OpenAI.MessageContentInputFileContent",
+ "summary_text": "#/components/schemas/OpenAI.SummaryTextContent"
}
},
- "description": "Content item used to generate a response."
+ "description": "A content part that makes up an input or output item."
},
- "OpenAI.ItemAdditionalToolsItemParam": {
+ "OpenAI.MessageContentImageFileObject": {
"type": "object",
"required": [
"type",
- "role",
- "tools"
+ "image_file"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
"type": {
"type": "string",
"enum": [
- "additional_tools"
- ],
- "description": "The item type. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
- },
- "role": {
- "type": "string",
- "enum": [
- "developer"
+ "image_file"
],
- "description": "The role that provided the additional tools. Only `developer` is supported.",
- "x-stainless-const": true,
- "default": "developer"
+ "description": "Always `image_file`.",
+ "x-stainless-const": true
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "A list of additional tools made available at this item."
+ "image_file": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentImageFileObjectImageFile"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
}
- ]
+ ],
+ "description": "References an image [File](/docs/api-reference/files) in the content of a message.",
+ "title": "Image file"
},
- "OpenAI.ItemApplyPatchToolCallItemParam": {
+ "OpenAI.MessageContentImageFileObjectImageFile": {
+ "type": "object",
+ "required": [
+ "file_id"
+ ],
+ "properties": {
+ "file_id": {
+ "type": "string"
+ },
+ "detail": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "low",
+ "high"
+ ],
+ "default": "auto"
+ }
+ }
+ },
+ "OpenAI.MessageContentImageUrlObject": {
"type": "object",
"required": [
"type",
- "call_id",
- "status",
- "operation"
+ "image_url"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call"
+ "image_url"
],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
- },
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the apply patch tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatusParam",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ "description": "The type of the content part.",
+ "x-stainless-const": true
},
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam",
- "description": "The specific create, delete, or update instruction for the apply_patch tool call."
+ "image_url": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentImageUrlObjectImageUrl"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
}
],
- "description": "A tool call representing a request to create, delete, or update files using diff patches.",
- "title": "Apply patch tool call"
+ "description": "References an image URL in the content of a message.",
+ "title": "Image URL"
},
- "OpenAI.ItemApplyPatchToolCallOutputItemParam": {
+ "OpenAI.MessageContentImageUrlObjectImageUrl": {
"type": "object",
"required": [
- "type",
- "call_id",
- "status"
+ "url"
+ ],
+ "properties": {
+ "url": {
+ "type": "string",
+ "format": "uri"
+ },
+ "detail": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "low",
+ "high"
+ ],
+ "default": "auto"
+ }
+ }
+ },
+ "OpenAI.MessageContentInputFileContent": {
+ "type": "object",
+ "required": [
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call_output"
+ "input_file"
],
- "description": "The type of the item. Always `apply_patch_call_output`.",
+ "description": "The type of the input item. Always `input_file`.",
"x-stainless-const": true,
- "default": "apply_patch_call_output"
+ "default": "input_file"
},
- "id": {
+ "file_id": {
"anyOf": [
{
"type": "string"
@@ -36714,596 +59019,513 @@
}
]
},
- "call_id": {
+ "filename": {
"type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "description": "The name of the file to be sent to the model."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ "file_data": {
+ "type": "string",
+ "description": "The content of the file to be sent to the model."
},
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "file_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the file to be sent to the model."
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "The streamed output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OpenAI.ItemCodeInterpreterToolCall": {
+ "OpenAI.MessageContentInputImageContent": {
"type": "object",
"required": [
"type",
- "id",
- "status",
- "container_id",
- "code",
- "outputs"
+ "detail"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "code_interpreter_call"
+ "input_image"
],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "description": "The type of the input item. Always `input_image`.",
"x-stainless-const": true,
- "default": "code_interpreter_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the code interpreter tool call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
- ],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
- },
- "container_id": {
- "type": "string",
- "description": "The ID of the container used to run the code."
+ "default": "input_image"
},
- "code": {
+ "image_url": {
"anyOf": [
{
- "type": "string"
+ "type": "string",
+ "format": "uri"
},
{
"type": "null"
}
]
},
- "outputs": {
+ "file_id": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
- }
+ "type": "string"
},
{
"type": "null"
}
]
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
+ "title": "Input image"
},
- "OpenAI.ItemCompactionSummaryItemParam": {
+ "OpenAI.MessageContentInputTextContent": {
"type": "object",
"required": [
"type",
- "encrypted_content"
+ "text"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
"type": {
"type": "string",
"enum": [
- "compaction"
+ "input_text"
],
- "description": "The type of the item. Always `compaction`.",
+ "description": "The type of the input item. Always `input_text`.",
"x-stainless-const": true,
- "default": "compaction"
+ "default": "input_text"
},
- "encrypted_content": {
+ "text": {
"type": "string",
- "maxLength": 10485760,
- "description": "The encrypted content of the compaction summary."
+ "description": "The text input to the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.ItemComputerCallOutputItemParam": {
+ "OpenAI.MessageContentOutputTextContent": {
"type": "object",
"required": [
- "call_id",
"type",
- "output"
+ "text",
+ "annotations",
+ "logprobs"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The ID of the computer tool call that produced the output."
- },
"type": {
"type": "string",
"enum": [
- "computer_call_output"
+ "output_text"
],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "description": "The type of the output text. Always `output_text`.",
"x-stainless-const": true,
- "default": "computer_call_output"
+ "default": "output_text"
},
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "text": {
+ "type": "string",
+ "description": "The text output from the model."
},
- "acknowledged_safety_checks": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- }
- },
- {
- "type": "null"
- }
- ]
+ "annotations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Annotation"
+ },
+ "description": "The annotations of the text output."
},
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.LogProb"
+ }
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ "description": "A text output from the model.",
+ "title": "Output text"
},
- "OpenAI.ItemComputerToolCall": {
+ "OpenAI.MessageContentReasoningTextContent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "pending_safety_checks",
- "status"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_call"
+ "reasoning_text"
],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the computer call."
+ "description": "The type of the reasoning text. Always `reasoning_text`.",
+ "x-stainless-const": true,
+ "default": "reasoning_text"
},
- "call_id": {
+ "text": {
"type": "string",
- "description": "An identifier used when responding to the tool call with output."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- },
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
- },
- "pending_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The pending safety checks for the computer call."
- },
- "status": {
+ "description": "The reasoning text from the model."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
+ }
+ ],
+ "description": "Reasoning text from the model.",
+ "title": "Reasoning text"
+ },
+ "OpenAI.MessageContentRefusalContent": {
+ "type": "object",
+ "required": [
+ "type",
+ "refusal"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete"
+ "refusal"
],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The type of the refusal. Always `refusal`.",
+ "x-stainless-const": true,
+ "default": "refusal"
+ },
+ "refusal": {
+ "type": "string",
+ "description": "The refusal explanation from the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
+ "description": "A refusal from the model.",
+ "title": "Refusal"
},
- "OpenAI.ItemCustomToolCall": {
+ "OpenAI.MessageContentRefusalObject": {
"type": "object",
"required": [
"type",
- "call_id",
- "name",
- "input"
+ "refusal"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call"
+ "refusal"
],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "description": "Always `refusal`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the custom tool being called."
- },
- "name": {
- "type": "string",
- "description": "The name of the custom tool being called."
- },
- "input": {
- "type": "string",
- "description": "The input for the custom tool call generated by the model."
+ "refusal": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
}
],
- "description": "A call to a custom tool created by the model.",
- "title": "Custom tool call"
+ "description": "The refusal content generated by the assistant.",
+ "title": "Refusal"
},
- "OpenAI.ItemCustomToolCallOutput": {
+ "OpenAI.MessageContentTextAnnotationsFileCitationObject": {
"type": "object",
"required": [
"type",
- "call_id",
- "output"
+ "text",
+ "file_citation",
+ "start_index",
+ "end_index"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call_output"
+ "file_citation"
],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "description": "Always `file_citation`.",
"x-stainless-const": true
},
- "id": {
+ "text": {
"type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
+ "description": "The text in the message content that needs to be replaced."
},
- "call_id": {
- "type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ "file_citation": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation"
},
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
- }
- ],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
+ },
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.TextAnnotation"
}
],
- "description": "The output of a custom tool call from your code, being sent back to the model.",
- "title": "Custom tool call output"
+ "description": "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.",
+ "title": "File citation"
},
- "OpenAI.ItemField": {
+ "OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation": {
"type": "object",
"required": [
- "type"
+ "file_id"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ItemFieldType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "message": "#/components/schemas/OpenAI.ItemFieldMessage",
- "function_call": "#/components/schemas/OpenAI.ItemFieldFunctionToolCall",
- "tool_search_call": "#/components/schemas/OpenAI.ItemFieldToolSearchCall",
- "tool_search_output": "#/components/schemas/OpenAI.ItemFieldToolSearchOutput",
- "additional_tools": "#/components/schemas/OpenAI.ItemFieldAdditionalTools",
- "function_call_output": "#/components/schemas/OpenAI.ItemFieldFunctionToolCallOutput",
- "file_search_call": "#/components/schemas/OpenAI.ItemFieldFileSearchToolCall",
- "web_search_call": "#/components/schemas/OpenAI.ItemFieldWebSearchToolCall",
- "image_generation_call": "#/components/schemas/OpenAI.ItemFieldImageGenToolCall",
- "computer_call": "#/components/schemas/OpenAI.ItemFieldComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.ItemFieldComputerToolCallOutput",
- "reasoning": "#/components/schemas/OpenAI.ItemFieldReasoningItem",
- "compaction": "#/components/schemas/OpenAI.ItemFieldCompactionBody",
- "code_interpreter_call": "#/components/schemas/OpenAI.ItemFieldCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.ItemFieldLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.ItemFieldLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.ItemFieldFunctionShellCall",
- "shell_call_output": "#/components/schemas/OpenAI.ItemFieldFunctionShellCallOutput",
- "apply_patch_call": "#/components/schemas/OpenAI.ItemFieldApplyPatchToolCall",
- "apply_patch_call_output": "#/components/schemas/OpenAI.ItemFieldApplyPatchToolCallOutput",
- "mcp_list_tools": "#/components/schemas/OpenAI.ItemFieldMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.ItemFieldMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.ItemFieldMcpApprovalResponseResource",
- "mcp_call": "#/components/schemas/OpenAI.ItemFieldMcpToolCall",
- "custom_tool_call": "#/components/schemas/OpenAI.ItemFieldCustomToolCall",
- "custom_tool_call_output": "#/components/schemas/OpenAI.ItemFieldCustomToolCallOutput"
+ "file_id": {
+ "type": "string"
}
- },
- "description": "An item representing a message, tool call, tool output, reasoning, or other response element."
+ }
},
- "OpenAI.ItemFieldAdditionalTools": {
+ "OpenAI.MessageContentTextAnnotationsFilePathObject": {
"type": "object",
"required": [
"type",
- "id",
- "role",
- "tools"
+ "text",
+ "file_path",
+ "start_index",
+ "end_index"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "additional_tools"
+ "file_path"
],
- "description": "The type of the item. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
+ "description": "Always `file_path`.",
+ "x-stainless-const": true
},
- "id": {
+ "text": {
"type": "string",
- "description": "The unique ID of the additional tools item."
+ "description": "The text in the message content that needs to be replaced."
},
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role that provided the additional tools."
+ "file_path": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath"
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The additional tool definitions made available at this item."
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
+ },
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.TextAnnotation"
}
- ]
+ ],
+ "description": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.",
+ "title": "File path"
},
- "OpenAI.ItemFieldApplyPatchToolCall": {
+ "OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath": {
+ "type": "object",
+ "required": [
+ "file_id"
+ ],
+ "properties": {
+ "file_id": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.MessageContentTextObject": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "operation"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call"
+ "text"
],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
- },
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
- "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
- "title": "Apply patch operation"
+ "description": "Always `text`.",
+ "x-stainless-const": true
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
+ "text": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentTextObjectText"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
}
],
- "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
- "title": "Apply patch tool call"
+ "description": "The text content that is part of a message.",
+ "title": "Text"
},
- "OpenAI.ItemFieldApplyPatchToolCallOutput": {
+ "OpenAI.MessageContentTextObjectText": {
+ "type": "object",
+ "required": [
+ "value",
+ "annotations"
+ ],
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "annotations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TextAnnotation"
+ }
+ }
+ }
+ },
+ "OpenAI.MessageContentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "input_text",
+ "output_text",
+ "text",
+ "summary_text",
+ "reasoning_text",
+ "refusal",
+ "input_image",
+ "computer_screenshot",
+ "input_file"
+ ]
+ }
+ ]
+ },
+ "OpenAI.MessageObject": {
"type": "object",
"required": [
- "type",
"id",
- "call_id",
- "status"
+ "object",
+ "created_at",
+ "thread_id",
+ "status",
+ "incomplete_details",
+ "completed_at",
+ "incomplete_at",
+ "role",
+ "content",
+ "assistant_id",
+ "run_id",
+ "attachments",
+ "metadata"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "apply_patch_call_output"
+ "thread.message"
],
- "description": "The type of the item. Always `apply_patch_call_output`.",
- "x-stainless-const": true,
- "default": "apply_patch_call_output"
+ "description": "The object type, which is always `thread.message`.",
+ "x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the message was created."
},
- "call_id": {
+ "thread_id": {
"type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "description": "The [thread](/docs/api-reference/threads) ID that this message belongs to."
},
"status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "incomplete",
+ "completed"
+ ],
+ "description": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`."
},
- "output": {
+ "incomplete_details": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.MessageObjectIncompleteDetails"
},
{
"type": "null"
}
]
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call output."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
- }
- ],
- "description": "The output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
- },
- "OpenAI.ItemFieldCodeInterpreterToolCall": {
- "type": "object",
- "required": [
- "type",
- "id",
- "status",
- "container_id",
- "code",
- "outputs"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "code_interpreter_call"
+ "completed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
- "x-stainless-const": true,
- "default": "code_interpreter_call"
+ "type": "integer",
+ "format": "unixTimestamp"
},
- "id": {
- "type": "string",
- "description": "The unique ID of the code interpreter tool call."
+ "incomplete_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
},
- "status": {
+ "role": {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
+ "user",
+ "assistant"
],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
+ "description": "The entity that produced the message. One of `user` or `assistant`."
},
- "container_id": {
- "type": "string",
- "description": "The ID of the container used to run the code."
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
+ },
+ "description": "The content of the message in array of text and/or images."
},
- "code": {
+ "assistant_id": {
"anyOf": [
{
"type": "string"
@@ -37313,793 +59535,1249 @@
}
]
},
- "outputs": {
+ "run_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "attachments": {
"anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
+ "$ref": "#/components/schemas/OpenAI.MessageObjectAttachments"
}
},
{
"type": "null"
}
]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
+ "description": "Represents a message within a [thread](/docs/api-reference/threads).",
+ "title": "The message object",
+ "x-oaiMeta": {
+ "name": "The message object",
+ "beta": true,
+ "example": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1698983503,\n \"thread_id\": \"thread_abc123\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"Hi! How can I help you today?\",\n \"annotations\": []\n }\n }\n ],\n \"assistant_id\": \"asst_abc123\",\n \"run_id\": \"run_abc123\",\n \"attachments\": [],\n \"metadata\": {}\n}\n"
+ }
+ },
+ "OpenAI.MessageObjectAttachments": {
+ "type": "object",
+ "properties": {
+ "file_id": {
+ "type": "string"
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsCode"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "OpenAI.MessageObjectContent": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContentType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "image_url": "#/components/schemas/OpenAI.MessageContentImageUrlObject",
+ "text": "#/components/schemas/OpenAI.MessageContentTextObject",
+ "refusal": "#/components/schemas/OpenAI.MessageContentRefusalObject",
+ "image_file": "#/components/schemas/OpenAI.MessageContentImageFileObject"
+ }
+ }
+ },
+ "OpenAI.MessageObjectContentType": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "image_file",
+ "image_url",
+ "text",
+ "refusal"
+ ]
}
+ ]
+ },
+ "OpenAI.MessageObjectIncompleteDetails": {
+ "type": "object",
+ "required": [
+ "reason"
],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
+ "properties": {
+ "reason": {
+ "type": "string",
+ "enum": [
+ "content_filter",
+ "max_tokens",
+ "run_cancelled",
+ "run_expired",
+ "run_failed"
+ ]
+ }
+ }
},
- "OpenAI.ItemFieldCompactionBody": {
+ "OpenAI.MessagePhase": {
+ "type": "string",
+ "enum": [
+ "commentary",
+ "final_answer"
+ ],
+ "description": "Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).\nFor models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend\nphase on all assistant messages — dropping it can degrade performance. Not used for user messages."
+ },
+ "OpenAI.MessageRequestContentTextObject": {
"type": "object",
"required": [
"type",
- "id",
- "encrypted_content"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "compaction"
+ "text"
],
- "description": "The type of the item. Always `compaction`.",
- "x-stainless-const": true,
- "default": "compaction"
+ "description": "Always `text`.",
+ "x-stainless-const": true
},
+ "text": {
+ "type": "string",
+ "description": "Text content to be sent to the model"
+ }
+ },
+ "description": "The text content that is part of a message.",
+ "title": "Text"
+ },
+ "OpenAI.MessageRole": {
+ "type": "string",
+ "enum": [
+ "unknown",
+ "user",
+ "assistant",
+ "system",
+ "critic",
+ "discriminator",
+ "developer",
+ "tool"
+ ]
+ },
+ "OpenAI.MessageStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ "OpenAI.Metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "OpenAI.Model": {
+ "type": "object",
+ "required": [
+ "id",
+ "created",
+ "object",
+ "owned_by"
+ ],
+ "properties": {
"id": {
"type": "string",
- "description": "The unique ID of the compaction item."
+ "description": "The model identifier, which can be referenced in the API endpoints."
},
- "encrypted_content": {
+ "created": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) when the model was created."
+ },
+ "object": {
"type": "string",
- "description": "The encrypted content that was produced by compaction."
+ "enum": [
+ "model"
+ ],
+ "description": "The object type, which is always \"model\".",
+ "x-stainless-const": true
},
- "created_by": {
+ "owned_by": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "The organization that owns the model."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "description": "Describes an OpenAI model offering that can be used with the API.",
+ "title": "Model",
+ "x-oaiMeta": {
+ "name": "The model object",
+ "example": "{\n \"id\": \"VAR_chat_model_id\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"openai\"\n}\n"
+ }
+ },
+ "OpenAI.Moderation": {
+ "type": "object",
+ "required": [
+ "input",
+ "output"
+ ],
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.ModerationEntry",
+ "description": "Moderation for the response input."
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ModerationEntry",
+ "description": "Moderation for the response output."
}
+ },
+ "description": "Moderation results or errors for the response input and output.",
+ "title": "Moderation"
+ },
+ "OpenAI.ModerationCategoryInputType": {
+ "type": "string",
+ "enum": [
+ "text",
+ "image"
],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
+ "description": "The applied input type(s) for the category."
},
- "OpenAI.ItemFieldComputerToolCall": {
+ "OpenAI.ModerationEntry": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ModerationEntryType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "error": "#/components/schemas/OpenAI.ModerationErrorBody",
+ "moderation_result": "#/components/schemas/OpenAI.ModerationResultBody"
+ }
+ },
+ "description": "Moderation results or an error for a response moderation check."
+ },
+ "OpenAI.ModerationEntryType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "moderation_result",
+ "error"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ModerationErrorBody": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "pending_safety_checks",
- "status"
+ "code",
+ "message"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_call"
+ "error"
],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the computer call."
+ "description": "The object type, which was always `error` for moderation failures.",
+ "x-stainless-const": true
},
- "call_id": {
+ "code": {
"type": "string",
- "description": "An identifier used when responding to the tool call with output."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- },
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
- },
- "pending_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The pending safety checks for the computer call."
+ "description": "The error code."
},
- "status": {
+ "message": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The error message."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.ModerationEntry"
}
],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
+ "description": "An error produced while attempting moderation for the response input or output.",
+ "title": "Moderation error"
},
- "OpenAI.ItemFieldComputerToolCallOutput": {
+ "OpenAI.ModerationImageURLInput": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "output"
+ "image_url"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_call_output"
+ "image_url"
],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
- "x-stainless-const": true,
- "default": "computer_call_output"
- },
- "id": {
- "type": "string",
- "description": "The ID of the computer tool call output.",
- "readOnly": true
- },
- "call_id": {
- "type": "string",
- "description": "The ID of the computer tool call that produced the output."
- },
- "acknowledged_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
- },
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "description": "Always `image_url`.",
+ "x-stainless-const": true
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ "image_url": {
+ "$ref": "#/components/schemas/OpenAI.ModerationImageURLInputImageUrl",
+ "description": "Contains either an image URL or a data URL for a base64 encoded image."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequestInput"
}
],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ "description": "An object describing an image to classify."
},
- "OpenAI.ItemFieldCustomToolCall": {
+ "OpenAI.ModerationImageURLInputImageUrl": {
+ "type": "object",
+ "required": [
+ "url"
+ ],
+ "properties": {
+ "url": {
+ "type": "string",
+ "format": "uri"
+ }
+ }
+ },
+ "OpenAI.ModerationInputType": {
+ "type": "string",
+ "enum": [
+ "text",
+ "image"
+ ]
+ },
+ "OpenAI.ModerationParam": {
+ "type": "object",
+ "required": [
+ "model"
+ ],
+ "properties": {
+ "model": {
+ "type": "string",
+ "description": "The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'."
+ }
+ },
+ "description": "Configuration for running moderation on the input and output of this response."
+ },
+ "OpenAI.ModerationResultBody": {
"type": "object",
"required": [
"type",
- "call_id",
- "name",
- "input"
+ "model",
+ "flagged",
+ "categories",
+ "category_scores",
+ "category_applied_input_types"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call"
+ "moderation_result"
],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "description": "The object type, which was always `moderation_result` for successful moderation results.",
"x-stainless-const": true
},
- "id": {
+ "model": {
"type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
+ "description": "The moderation model that produced this result."
},
- "call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
+ "flagged": {
+ "type": "boolean",
+ "description": "A boolean indicating whether the content was flagged by any category."
},
- "namespace": {
- "type": "string",
- "description": "The namespace of the custom tool being called."
+ "categories": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "boolean"
+ },
+ "description": "A dictionary of moderation categories to booleans, True if the input is flagged under this category.",
+ "x-oaiTypeLabel": "map"
},
- "name": {
- "type": "string",
- "description": "The name of the custom tool being called."
+ "category_scores": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "description": "A dictionary of moderation categories to scores.",
+ "x-oaiTypeLabel": "map"
},
- "input": {
- "type": "string",
- "description": "The input for the custom tool call generated by the model."
+ "category_applied_input_types": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationInputType"
+ }
+ },
+ "description": "Which modalities of input are reflected by the score for each category.",
+ "x-oaiTypeLabel": "map"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.ModerationEntry"
}
],
- "description": "A call to a custom tool created by the model.",
- "title": "Custom tool call"
+ "description": "A moderation result produced for the response input or output.",
+ "title": "Moderation result"
},
- "OpenAI.ItemFieldCustomToolCallOutput": {
+ "OpenAI.ModerationTextInput": {
"type": "object",
"required": [
"type",
- "call_id",
- "output"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call_output"
+ "text"
],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "description": "Always `text`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
- },
- "call_id": {
+ "text": {
"type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
- },
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
- }
- ],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
+ "description": "A string of text to classify."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequestInput"
}
],
- "description": "The output of a custom tool call from your code, being sent back to the model.",
- "title": "Custom tool call output"
+ "description": "An object describing text to classify."
},
- "OpenAI.ItemFieldFileSearchToolCall": {
+ "OpenAI.ModifyAssistantRequest": {
"type": "object",
- "required": [
- "id",
- "type",
- "status",
- "queries"
- ],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the file search tool call."
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantSupportedModels"
+ }
+ ],
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them."
},
- "type": {
- "type": "string",
- "enum": [
- "file_search_call"
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ },
+ "maxItems": 128,
+ "description": "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`.",
+ "default": []
+ },
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ModifyAssistantRequestToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of the file search tool call. Always `file_search_call`.",
- "x-stainless-const": true
+ "default": 1
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "incomplete",
- "failed"
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
+ "default": 1
},
- "queries": {
+ "response_format": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.ModifyAssistantRequestToolResources": {
+ "type": "object",
+ "properties": {
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.ModifyAssistantRequestToolResourcesCodeInterpreter"
+ },
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.ModifyAssistantRequestToolResourcesFileSearch"
+ }
+ }
+ },
+ "OpenAI.ModifyAssistantRequestToolResourcesCodeInterpreter": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
"type": "array",
"items": {
"type": "string"
},
- "description": "The queries used to search for files."
+ "maxItems": 20
+ }
+ }
+ },
+ "OpenAI.ModifyAssistantRequestToolResourcesFileSearch": {
+ "type": "object",
+ "properties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 1
+ }
+ }
+ },
+ "OpenAI.ModifyMessageRequest": {
+ "type": "object",
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.ModifyRunRequest": {
+ "type": "object",
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.ModifyThreadRequest": {
+ "type": "object",
+ "properties": {
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "results": {
+ "metadata": {
"anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
- }
+ "$ref": "#/components/schemas/OpenAI.Metadata"
},
{
"type": "null"
}
]
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ },
+ "OpenAI.ModifyThreadRequestToolResources": {
+ "type": "object",
+ "properties": {
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter"
+ },
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesFileSearch"
}
- ],
- "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
- "title": "File search tool call"
+ }
},
- "OpenAI.ItemFieldFunctionShellCall": {
+ "OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 20
+ }
+ }
+ },
+ "OpenAI.ModifyThreadRequestToolResourcesFileSearch": {
+ "type": "object",
+ "properties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 1
+ }
+ }
+ },
+ "OpenAI.MoveParam": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "action",
- "status",
- "environment"
+ "x",
+ "y"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call"
+ "move"
],
- "description": "The type of the item. Always `shell_call`.",
- "x-stainless-const": true,
- "default": "shell_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
+ "description": "Specifies the event type. For a move action, this property is always set to `move`.",
+ "x-stainless-const": true
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
- "description": "The shell commands and limits that describe how to run the tool call."
+ "x": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The x-coordinate to move to."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
- "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
+ "y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The y-coordinate to move to."
},
- "environment": {
+ "keys": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
- },
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "A tool call that executes one or more shell commands in a managed environment.",
- "title": "Shell tool call"
+ "description": "A mouse move action.",
+ "title": "Move"
},
- "OpenAI.ItemFieldFunctionShellCallOutput": {
+ "OpenAI.NamespaceToolParam": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "output",
- "max_output_length"
+ "name",
+ "description",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call_output"
+ "namespace"
],
- "description": "The type of the shell call output. Always `shell_call_output`.",
- "x-stainless-const": true,
- "default": "shell_call_output"
+ "description": "The type of the tool. Always `namespace`.",
+ "x-stainless-const": true
},
- "id": {
+ "name": {
"type": "string",
- "description": "The unique ID of the shell call output. Populated when this item is returned via API."
+ "minLength": 1,
+ "description": "The namespace name used in tool calls (for example, `crm`)."
},
- "call_id": {
+ "description": {
"type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
- "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ "minLength": 1,
+ "description": "A description of the namespace shown to the model."
},
- "output": {
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionToolParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CustomToolParam"
+ }
+ ]
},
- "description": "An array of shell call output contents"
- },
- "max_output_length": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "minItems": 1,
+ "description": "The function/custom tools available inside this namespace."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "The output of a shell tool call that was emitted.",
- "title": "Shell call output"
+ "description": "Groups function/custom tools under a shared namespace.",
+ "title": "Namespace"
},
- "OpenAI.ItemFieldFunctionToolCall": {
+ "OpenAI.NoiseReductionType": {
+ "type": "string",
+ "enum": [
+ "near_field",
+ "far_field"
+ ],
+ "description": "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."
+ },
+ "OpenAI.OpenAIFile": {
"type": "object",
"required": [
"id",
- "type",
- "call_id",
- "name",
- "arguments"
+ "bytes",
+ "created_at",
+ "filename",
+ "object",
+ "purpose",
+ "status"
],
"properties": {
"id": {
"type": "string",
- "description": "The unique ID of the function tool call.",
- "readOnly": true
+ "description": "The file identifier, which can be referenced in the API endpoints."
},
- "type": {
+ "bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The size of the file, in bytes."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the file was created."
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the file will expire."
+ },
+ "filename": {
+ "type": "string",
+ "description": "The name of the file."
+ },
+ "object": {
"type": "string",
"enum": [
- "function_call"
+ "file"
],
- "description": "The type of the function tool call. Always `function_call`.",
+ "description": "The object type, which is always `file`.",
"x-stainless-const": true
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "namespace": {
+ "purpose": {
"type": "string",
- "description": "The namespace of the function to run."
+ "enum": [
+ "assistants",
+ "assistants_output",
+ "batch",
+ "batch_output",
+ "fine-tune",
+ "fine-tune-results",
+ "vision",
+ "user_data"
+ ],
+ "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`."
},
- "name": {
+ "status": {
"type": "string",
- "description": "The name of the function to run."
+ "enum": [
+ "uploaded",
+ "processed",
+ "error"
+ ],
+ "description": "Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.",
+ "deprecated": true
},
- "arguments": {
+ "status_details": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the function."
- },
- "status": {
+ "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.",
+ "deprecated": true
+ }
+ },
+ "description": "The `File` object represents a document that has been uploaded to OpenAI.",
+ "title": "OpenAIFile",
+ "x-oaiMeta": {
+ "name": "The file object",
+ "example": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1680202602,\n \"filename\": \"salesOverview.pdf\",\n \"purpose\": \"assistants\",\n}\n"
+ }
+ },
+ "OpenAI.OrderEnum": {
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ]
+ },
+ "OpenAI.OtherChunkingStrategyResponseParam": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete"
+ "other"
],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "Always `other`.",
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse"
}
],
- "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
- "title": "Function tool call"
+ "description": "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.",
+ "title": "Other Chunking Strategy"
},
- "OpenAI.ItemFieldFunctionToolCallOutput": {
+ "OpenAI.OutputContent": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.OutputContentType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "output_text": "#/components/schemas/OpenAI.OutputContentOutputTextContent",
+ "refusal": "#/components/schemas/OpenAI.OutputContentRefusalContent",
+ "reasoning_text": "#/components/schemas/OpenAI.OutputContentReasoningTextContent"
+ }
+ }
+ },
+ "OpenAI.OutputContentOutputTextContent": {
"type": "object",
"required": [
- "id",
"type",
- "call_id",
- "output"
+ "text",
+ "annotations",
+ "logprobs"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call_output"
+ "output_text"
],
- "description": "The type of the function tool call output. Always `function_call_output`.",
- "x-stainless-const": true
+ "description": "The type of the output text. Always `output_text`.",
+ "x-stainless-const": true,
+ "default": "output_text"
},
- "call_id": {
+ "text": {
"type": "string",
- "description": "The unique ID of the function tool call generated by the model."
+ "description": "The text output from the model."
},
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
- }
- ],
- "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
+ "annotations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Annotation"
+ },
+ "description": "The annotations of the text output."
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.LogProb"
+ }
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputContent"
}
],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
+ "description": "A text output from the model.",
+ "title": "Output text"
},
- "OpenAI.ItemFieldImageGenToolCall": {
+ "OpenAI.OutputContentReasoningTextContent": {
"type": "object",
"required": [
"type",
- "id",
- "status",
- "result"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "image_generation_call"
+ "reasoning_text"
],
- "description": "The type of the image generation call. Always `image_generation_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the image generation call."
+ "description": "The type of the reasoning text. Always `reasoning_text`.",
+ "x-stainless-const": true,
+ "default": "reasoning_text"
},
- "status": {
+ "text": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "generating",
- "failed"
- ],
- "description": "The status of the image generation call."
- },
- "result": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The reasoning text from the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputContent"
}
],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
+ "description": "Reasoning text from the model.",
+ "title": "Reasoning text"
},
- "OpenAI.ItemFieldLocalShellToolCall": {
+ "OpenAI.OutputContentRefusalContent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "action",
- "status"
+ "refusal"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call"
+ "refusal"
],
- "description": "The type of the local shell call. Always `local_shell_call`.",
- "x-stainless-const": true
+ "description": "The type of the refusal. Always `refusal`.",
+ "x-stainless-const": true,
+ "default": "refusal"
},
- "id": {
+ "refusal": {
"type": "string",
- "description": "The unique ID of the local shell call."
+ "description": "The refusal explanation from the model."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputContent"
+ }
+ ],
+ "description": "A refusal from the model.",
+ "title": "Refusal"
+ },
+ "OpenAI.OutputContentType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "call_id": {
+ {
"type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "enum": [
+ "output_text",
+ "refusal",
+ "reasoning_text"
+ ]
+ }
+ ]
+ },
+ "OpenAI.OutputItem": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.OutputItemType"
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ "agent_reference": {
+ "$ref": "#/components/schemas/AgentReference",
+ "description": "The agent that created the item."
},
- "status": {
+ "response_id": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the local shell call."
+ "description": "The response on which the item is created."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "structured_outputs": "#/components/schemas/StructuredOutputsOutputItem",
+ "workflow_action": "#/components/schemas/WorkflowActionOutputItem",
+ "oauth_consent_request": "#/components/schemas/OAuthConsentRequestOutputItem",
+ "bing_grounding_call": "#/components/schemas/BingGroundingToolCall",
+ "bing_grounding_call_output": "#/components/schemas/BingGroundingToolCallOutput",
+ "sharepoint_grounding_preview_call": "#/components/schemas/SharepointGroundingToolCall",
+ "sharepoint_grounding_preview_call_output": "#/components/schemas/SharepointGroundingToolCallOutput",
+ "azure_ai_search_call": "#/components/schemas/AzureAISearchToolCall",
+ "azure_ai_search_call_output": "#/components/schemas/AzureAISearchToolCallOutput",
+ "bing_custom_search_preview_call": "#/components/schemas/BingCustomSearchToolCall",
+ "bing_custom_search_preview_call_output": "#/components/schemas/BingCustomSearchToolCallOutput",
+ "openapi_call": "#/components/schemas/OpenApiToolCall",
+ "openapi_call_output": "#/components/schemas/OpenApiToolCallOutput",
+ "browser_automation_preview_call": "#/components/schemas/BrowserAutomationToolCall",
+ "browser_automation_preview_call_output": "#/components/schemas/BrowserAutomationToolCallOutput",
+ "fabric_dataagent_preview_call": "#/components/schemas/FabricDataAgentToolCall",
+ "fabric_dataagent_preview_call_output": "#/components/schemas/FabricDataAgentToolCallOutput",
+ "azure_function_call": "#/components/schemas/AzureFunctionToolCall",
+ "azure_function_call_output": "#/components/schemas/AzureFunctionToolCallOutput",
+ "a2a_preview_call": "#/components/schemas/A2AToolCall",
+ "a2a_preview_call_output": "#/components/schemas/A2AToolCallOutput",
+ "memory_search_call": "#/components/schemas/MemorySearchToolCall",
+ "memory_command_preview_call": "#/components/schemas/MemoryCommandToolCall",
+ "memory_command_preview_call_output": "#/components/schemas/MemoryCommandToolCallOutput",
+ "output_message": "#/components/schemas/OpenAI.OutputItemOutputMessage",
+ "file_search_call": "#/components/schemas/OpenAI.OutputItemFileSearchToolCall",
+ "function_call": "#/components/schemas/OpenAI.OutputItemFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.OutputItemFunctionToolCallOutput",
+ "web_search_call": "#/components/schemas/OpenAI.OutputItemWebSearchToolCall",
+ "computer_call": "#/components/schemas/OpenAI.OutputItemComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.OutputItemComputerToolCallOutput",
+ "reasoning": "#/components/schemas/OpenAI.OutputItemReasoningItem",
+ "tool_search_call": "#/components/schemas/OpenAI.OutputItemToolSearchCall",
+ "tool_search_output": "#/components/schemas/OpenAI.OutputItemToolSearchOutput",
+ "additional_tools": "#/components/schemas/OpenAI.OutputItemAdditionalTools",
+ "compaction": "#/components/schemas/OpenAI.OutputItemCompactionBody",
+ "image_generation_call": "#/components/schemas/OpenAI.OutputItemImageGenToolCall",
+ "code_interpreter_call": "#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.OutputItemLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.OutputItemLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.OutputItemFunctionShellCall",
+ "shell_call_output": "#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput",
+ "apply_patch_call": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCall",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput",
+ "mcp_call": "#/components/schemas/OpenAI.OutputItemMcpToolCall",
+ "mcp_list_tools": "#/components/schemas/OpenAI.OutputItemMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.OutputItemMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.OutputItemMcpApprovalResponseResource",
+ "custom_tool_call": "#/components/schemas/OpenAI.OutputItemCustomToolCallResource",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.OutputItemCustomToolCallOutputResource"
}
- ],
- "description": "A tool call to run a command on the local shell.",
- "title": "Local shell call"
+ }
},
- "OpenAI.ItemFieldLocalShellToolCallOutput": {
+ "OpenAI.OutputItemAdditionalTools": {
"type": "object",
"required": [
"type",
"id",
- "output"
+ "role",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call_output"
+ "additional_tools"
],
- "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `additional_tools`.",
+ "x-stainless-const": true,
+ "default": "additional_tools"
},
"id": {
"type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "description": "The unique ID of the additional tools item."
},
- "output": {
- "type": "string",
- "description": "A JSON string of the output of the local shell tool call."
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role that provided the additional tools."
},
- "status": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The additional tool definitions made available at this item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
- ],
- "description": "The output of a local shell tool call.",
- "title": "Local shell call output"
+ ]
},
- "OpenAI.ItemFieldMcpApprovalRequest": {
+ "OpenAI.OutputItemApplyPatchToolCall": {
"type": "object",
"required": [
"type",
"id",
- "server_label",
- "name",
- "arguments"
+ "call_id",
+ "status",
+ "operation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_request"
+ "apply_patch_call"
],
- "description": "The type of the item. Always `mcp_approval_request`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `apply_patch_call`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call"
},
"id": {
"type": "string",
- "description": "The unique ID of the approval request."
+ "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
},
- "server_label": {
+ "call_id": {
"type": "string",
- "description": "The label of the MCP server making the request."
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
- "name": {
- "type": "string",
- "description": "The name of the tool to run."
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
},
- "arguments": {
+ "operation": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
+ "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
+ "title": "Apply patch operation"
+ },
+ "created_by": {
"type": "string",
- "description": "A JSON string of arguments for the tool."
+ "description": "The ID of the entity that created this tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "A request for human approval of a tool invocation.",
- "title": "MCP approval request"
+ "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
+ "title": "Apply patch tool call"
},
- "OpenAI.ItemFieldMcpApprovalResponseResource": {
+ "OpenAI.OutputItemApplyPatchToolCallOutput": {
"type": "object",
"required": [
"type",
"id",
- "approval_request_id",
- "approve"
+ "call_id",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_response"
+ "apply_patch_call_output"
],
- "description": "The type of the item. Always `mcp_approval_response`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `apply_patch_call_output`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call_output"
},
"id": {
"type": "string",
- "description": "The unique ID of the approval response"
+ "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
},
- "approval_request_id": {
+ "call_id": {
"type": "string",
- "description": "The ID of the approval request being answered."
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
- "approve": {
- "type": "boolean",
- "description": "Whether the request was approved."
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
},
- "reason": {
+ "output": {
"anyOf": [
{
"type": "string"
@@ -38108,95 +60786,60 @@
"type": "null"
}
]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
- }
- ],
- "description": "A response to an MCP approval request.",
- "title": "MCP approval response"
- },
- "OpenAI.ItemFieldMcpListTools": {
- "type": "object",
- "required": [
- "type",
- "id",
- "server_label",
- "tools"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp_list_tools"
- ],
- "description": "The type of the item. Always `mcp_list_tools`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the list."
},
- "server_label": {
+ "created_by": {
"type": "string",
- "description": "The label of the MCP server."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
- },
- "description": "The tools available on the server."
- },
- "error": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "description": "The ID of the entity that created this tool call output."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "A list of tools available on an MCP server.",
- "title": "MCP list tools"
+ "description": "The output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
},
- "OpenAI.ItemFieldMcpToolCall": {
+ "OpenAI.OutputItemCodeInterpreterToolCall": {
"type": "object",
"required": [
"type",
"id",
- "server_label",
- "name",
- "arguments"
+ "status",
+ "container_id",
+ "code",
+ "outputs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_call"
+ "code_interpreter_call"
],
- "description": "The type of the item. Always `mcp_call`.",
- "x-stainless-const": true
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "x-stainless-const": true,
+ "default": "code_interpreter_call"
},
"id": {
"type": "string",
- "description": "The unique ID of the tool call."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server running the tool."
+ "description": "The unique ID of the code interpreter tool call."
},
- "name": {
+ "status": {
"type": "string",
- "description": "The name of the tool that was run."
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete",
+ "interpreting",
+ "failed"
+ ],
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
},
- "arguments": {
+ "container_id": {
"type": "string",
- "description": "A JSON string of the arguments passed to the tool."
+ "description": "The ID of the container used to run the code."
},
- "output": {
+ "code": {
"anyOf": [
{
"type": "string"
@@ -38206,18 +60849,20 @@
}
]
},
- "error": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
- "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
- },
- "approval_request_id": {
+ "outputs": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -38227,112 +60872,88 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "An invocation of a tool on an MCP server.",
- "title": "MCP tool call"
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
},
- "OpenAI.ItemFieldMessage": {
+ "OpenAI.OutputItemCompactionBody": {
"type": "object",
"required": [
"type",
"id",
- "status",
- "role",
- "content"
+ "encrypted_content"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "message"
+ "compaction"
],
- "description": "The type of the message. Always set to `message`.",
+ "description": "The type of the item. Always `compaction`.",
"x-stainless-const": true,
- "default": "message"
+ "default": "compaction"
},
"id": {
"type": "string",
- "description": "The unique ID of the message."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MessageStatus",
- "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API."
- },
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`."
+ "description": "The unique ID of the compaction item."
},
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- },
- "description": "The content of the message"
+ "encrypted_content": {
+ "type": "string",
+ "description": "The encrypted content that was produced by compaction."
},
- "phase": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
- },
- {
- "type": "null"
- }
- ]
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "A message to or from the model.",
- "title": "Message"
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "OpenAI.ItemFieldReasoningItem": {
+ "OpenAI.OutputItemComputerToolCall": {
"type": "object",
"required": [
"type",
"id",
- "summary"
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "reasoning"
+ "computer_call"
],
- "description": "The type of the object. Always `reasoning`.",
- "x-stainless-const": true
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
"id": {
"type": "string",
- "description": "The unique identifier of the reasoning content."
+ "description": "The unique ID of the computer call."
},
- "encrypted_content": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used when responding to the tool call with output."
},
- "summary": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
- },
- "description": "Reasoning summary content."
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
},
- "content": {
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ },
+ "pending_safety_checks": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
},
- "description": "Reasoning text content."
+ "description": "The pending safety checks for the computer call."
},
"status": {
"type": "string",
@@ -38346,116 +60967,109 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "OpenAI.ItemFieldToolSearchCall": {
+ "OpenAI.OutputItemComputerToolCallOutput": {
"type": "object",
"required": [
"type",
"id",
"call_id",
- "execution",
- "arguments",
- "status"
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_search_call"
+ "computer_call_output"
],
- "description": "The type of the item. Always `tool_search_call`.",
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
"x-stainless-const": true,
- "default": "tool_search_call"
+ "default": "computer_call_output"
},
"id": {
"type": "string",
- "description": "The unique ID of the tool search call item."
+ "description": "The ID of the computer tool call output.",
+ "readOnly": true
},
"call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "description": "The ID of the computer tool call that produced the output."
},
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
+ "acknowledged_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
},
- "arguments": {
- "description": "Arguments used for the tool search call."
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
},
"status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the tool search call item that was recorded."
- },
- "created_by": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
- ]
+ ],
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "OpenAI.ItemFieldToolSearchOutput": {
+ "OpenAI.OutputItemCustomToolCallOutputResource": {
"type": "object",
"required": [
"type",
- "id",
"call_id",
- "execution",
- "tools",
+ "output",
"status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_search_output"
+ "custom_tool_call_output"
],
- "description": "The type of the item. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "x-stainless-const": true
},
"id": {
"type": "string",
- "description": "The unique ID of the tool search output item."
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
},
"call_id": {
- "anyOf": [
+ "type": "string",
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ },
+ "output": {
+ "oneOf": [
{
"type": "string"
},
{
- "type": "null"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
}
- ]
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The loaded tool definitions returned by tool search."
+ ],
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
},
"status": {
"$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the tool search output item that was recorded."
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
},
"created_by": {
"type": "string",
@@ -38464,104 +61078,66 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
- }
- ]
- },
- "OpenAI.ItemFieldType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "message",
- "function_call",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "function_call_output",
- "file_search_call",
- "web_search_call",
- "image_generation_call",
- "computer_call",
- "computer_call_output",
- "reasoning",
- "compaction",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "mcp_call",
- "custom_tool_call",
- "custom_tool_call_output"
- ]
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
- ]
+ ],
+ "title": "ResponseCustomToolCallOutputItem"
},
- "OpenAI.ItemFieldWebSearchToolCall": {
+ "OpenAI.OutputItemCustomToolCallResource": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "action"
+ "call_id",
+ "name",
+ "input",
+ "status"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the web search tool call."
- },
"type": {
"type": "string",
"enum": [
- "web_search_call"
+ "custom_tool_call"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
"x-stainless-const": true
},
- "status": {
+ "id": {
"type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
- ],
- "description": "The status of the web search tool call."
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
},
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
- }
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used to map this custom tool call to a tool call output."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the custom tool being called."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom tool being called."
+ },
+ "input": {
+ "type": "string",
+ "description": "The input for the custom tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
+ "title": "ResponseCustomToolCallItem"
},
- "OpenAI.ItemFileSearchToolCall": {
+ "OpenAI.OutputItemFileSearchToolCall": {
"type": "object",
"required": [
"id",
@@ -38616,203 +61192,109 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
"title": "File search tool call"
},
- "OpenAI.ItemFunctionCallOutputItemParam": {
+ "OpenAI.OutputItemFunctionShellCall": {
"type": "object",
"required": [
- "call_id",
"type",
- "output"
+ "id",
+ "call_id",
+ "action",
+ "status",
+ "environment"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the function tool call generated by the model."
- },
"type": {
"type": "string",
"enum": [
- "function_call_output"
+ "shell_call"
],
- "description": "The type of the function tool call output. Always `function_call_output`.",
+ "description": "The type of the item. Always `shell_call`.",
"x-stainless-const": true,
- "default": "function_call_output"
- },
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputTextContentParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputImageContentParamAutoParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputFileContentParam"
- }
- ]
- }
- }
- ],
- "description": "Text, image, or file output of the function tool call."
+ "default": "shell_call"
},
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
- },
- "OpenAI.ItemFunctionShellCallItemParam": {
- "type": "object",
- "required": [
- "call_id",
- "type",
- "action"
- ],
- "properties": {
"id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
},
"call_id": {
"type": "string",
- "minLength": 1,
- "maxLength": 64,
"description": "The unique ID of the shell tool call generated by the model."
},
- "type": {
- "type": "string",
- "enum": [
- "shell_call"
- ],
- "description": "The type of the item. Always `shell_call`.",
- "x-stainless-const": true,
- "default": "shell_call"
- },
"action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellActionParam",
+ "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
"description": "The shell commands and limits that describe how to run the tool call."
},
"status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
+ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
},
"environment": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
},
{
"type": "null"
}
]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "A tool representing a request to execute one or more shell commands.",
+ "description": "A tool call that executes one or more shell commands in a managed environment.",
"title": "Shell tool call"
},
- "OpenAI.ItemFunctionShellCallOutputItemParam": {
+ "OpenAI.OutputItemFunctionShellCallOutput": {
"type": "object",
"required": [
- "call_id",
"type",
- "output"
+ "id",
+ "call_id",
+ "status",
+ "output",
+ "max_output_length"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the shell tool call generated by the model."
- },
"type": {
"type": "string",
"enum": [
"shell_call_output"
],
- "description": "The type of the item. Always `shell_call_output`.",
+ "description": "The type of the shell call output. Always `shell_call_output`.",
"x-stainless-const": true,
"default": "shell_call_output"
},
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the shell call output. Populated when this item is returned via API."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
+ "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ },
"output": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContentParam"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
},
- "description": "Captured chunks of stdout and stderr output, along with their associated outcomes."
- },
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
+ "description": "An array of shell call output contents"
},
"max_output_length": {
"anyOf": [
@@ -38823,17 +61305,21 @@
"type": "null"
}
]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "The streamed output items emitted by a shell tool call.",
- "title": "Shell tool call output"
+ "description": "The output of a shell tool call that was emitted.",
+ "title": "Shell call output"
},
- "OpenAI.ItemFunctionToolCall": {
+ "OpenAI.OutputItemFunctionToolCall": {
"type": "object",
"required": [
"id",
@@ -38884,116 +61370,121 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
"title": "Function tool call"
},
- "OpenAI.ItemImageGenToolCall": {
+ "OpenAI.OutputItemFunctionToolCallOutput": {
"type": "object",
"required": [
- "type",
"id",
- "status",
- "result"
+ "type",
+ "call_id",
+ "output"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
+ "readOnly": true
+ },
"type": {
"type": "string",
"enum": [
- "image_generation_call"
+ "function_call_output"
],
- "description": "The type of the image generation call. Always `image_generation_call`.",
+ "description": "The type of the function tool call output. Always `function_call_output`.",
"x-stainless-const": true
},
- "id": {
+ "call_id": {
"type": "string",
- "description": "The unique ID of the image generation call."
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
},
"status": {
"type": "string",
"enum": [
"in_progress",
"completed",
- "generating",
- "failed"
+ "incomplete"
],
- "description": "The status of the image generation call."
- },
- "result": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
},
- "OpenAI.ItemInputMessage": {
+ "OpenAI.OutputItemImageGenToolCall": {
"type": "object",
"required": [
"type",
- "role",
- "content",
- "id"
+ "id",
+ "status",
+ "result"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "message"
+ "image_generation_call"
],
- "description": "The type of the message input. Always set to `message`.",
- "x-stainless-const": true,
- "default": "message"
+ "description": "The type of the image generation call. Always `image_generation_call`.",
+ "x-stainless-const": true
},
- "role": {
+ "id": {
"type": "string",
- "enum": [
- "user",
- "system",
- "developer"
- ],
- "description": "The role of the message input. One of `user`, `system`, or `developer`."
+ "description": "The unique ID of the image generation call."
},
"status": {
"type": "string",
"enum": [
"in_progress",
"completed",
- "incomplete"
+ "generating",
+ "failed"
],
- "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- },
- "content": {
- "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
+ "description": "The status of the image generation call."
},
- "id": {
- "type": "string",
- "description": "The unique ID of the message input.",
- "readOnly": true
+ "result": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role.",
- "title": "Input message"
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
},
- "OpenAI.ItemLocalShellToolCall": {
+ "OpenAI.OutputItemLocalShellToolCall": {
"type": "object",
"required": [
"type",
@@ -39034,13 +61525,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A tool call to run a command on the local shell.",
"title": "Local shell call"
},
- "OpenAI.ItemLocalShellToolCallOutput": {
+ "OpenAI.OutputItemLocalShellToolCallOutput": {
"type": "object",
"required": [
"type",
@@ -39082,13 +61573,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "The output of a local shell tool call.",
"title": "Local shell call output"
},
- "OpenAI.ItemMcpApprovalRequest": {
+ "OpenAI.OutputItemMcpApprovalRequest": {
"type": "object",
"required": [
"type",
@@ -39125,16 +61616,17 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A request for human approval of a tool invocation.",
"title": "MCP approval request"
},
- "OpenAI.ItemMcpApprovalResponse": {
+ "OpenAI.OutputItemMcpApprovalResponseResource": {
"type": "object",
"required": [
"type",
+ "id",
"approval_request_id",
"approve"
],
@@ -39148,14 +61640,8 @@
"x-stainless-const": true
},
"id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "description": "The unique ID of the approval response"
},
"approval_request_id": {
"type": "string",
@@ -39178,13 +61664,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A response to an MCP approval request.",
"title": "MCP approval response"
},
- "OpenAI.ItemMcpListTools": {
+ "OpenAI.OutputItemMcpListTools": {
"type": "object",
"required": [
"type",
@@ -39222,13 +61708,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A list of tools available on an MCP server.",
"title": "MCP list tools"
},
- "OpenAI.ItemMcpToolCall": {
+ "OpenAI.OutputItemMcpToolCall": {
"type": "object",
"required": [
"type",
@@ -39293,13 +61779,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "An invocation of a tool on an MCP server.",
"title": "MCP tool call"
},
- "OpenAI.ItemOutputMessage": {
+ "OpenAI.OutputItemOutputMessage": {
"type": "object",
"required": [
"id",
@@ -39321,479 +61807,30 @@
"description": "The type of the output message. Always `message`.",
"x-stainless-const": true
},
- "role": {
- "type": "string",
- "enum": [
- "assistant"
- ],
- "description": "The role of the output message. Always `assistant`.",
- "x-stainless-const": true
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
- },
- "description": "The content of the output message."
- },
- "phase": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
- },
- {
- "type": "null"
- }
- ]
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "An output message from the model.",
- "title": "Output message"
- },
- "OpenAI.ItemReasoningItem": {
- "type": "object",
- "required": [
- "type",
- "id",
- "summary"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "reasoning"
- ],
- "description": "The type of the object. Always `reasoning`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique identifier of the reasoning content."
- },
- "encrypted_content": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "summary": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
- },
- "description": "Reasoning summary content."
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
- },
- "description": "Reasoning text content."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
- },
- "OpenAI.ItemReferenceParam": {
- "type": "object",
- "required": [
- "type",
- "id"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "item_reference"
- ],
- "description": "The type of item to reference. Always `item_reference`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The ID of the item to reference."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ],
- "description": "An internal identifier for an item to reference.",
- "title": "Item reference"
- },
- "OpenAI.ItemResource": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ItemResourceType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "message": "#/components/schemas/OpenAI.ItemResourceInputMessage",
- "output_message": "#/components/schemas/OpenAI.ItemResourceOutputMessage",
- "file_search_call": "#/components/schemas/OpenAI.ItemResourceFileSearchToolCall",
- "computer_call": "#/components/schemas/OpenAI.ItemResourceComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.ItemResourceComputerToolCallOutput",
- "web_search_call": "#/components/schemas/OpenAI.ItemResourceWebSearchToolCall",
- "function_call": "#/components/schemas/OpenAI.ItemResourceFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutput",
- "tool_search_call": "#/components/schemas/OpenAI.ItemResourceToolSearchCall",
- "tool_search_output": "#/components/schemas/OpenAI.ItemResourceToolSearchOutput",
- "additional_tools": "#/components/schemas/OpenAI.ItemResourceAdditionalTools",
- "reasoning": "#/components/schemas/OpenAI.ItemResourceReasoningItem",
- "compaction": "#/components/schemas/OpenAI.ItemResourceCompactionBody",
- "image_generation_call": "#/components/schemas/OpenAI.ItemResourceImageGenToolCall",
- "code_interpreter_call": "#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.ItemResourceFunctionShellCall",
- "shell_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput",
- "apply_patch_call": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall",
- "apply_patch_call_output": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput",
- "mcp_list_tools": "#/components/schemas/OpenAI.ItemResourceMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource",
- "mcp_call": "#/components/schemas/OpenAI.ItemResourceMcpToolCall",
- "custom_tool_call": "#/components/schemas/OpenAI.ItemResourceCustomToolCallResource",
- "custom_tool_call_output": "#/components/schemas/OpenAI.ItemResourceCustomToolCallOutputResource"
- }
- },
- "description": "Content item used to generate a response."
- },
- "OpenAI.ItemResourceAdditionalTools": {
- "type": "object",
- "required": [
- "type",
- "id",
- "role",
- "tools"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "additional_tools"
- ],
- "description": "The type of the item. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the additional tools item."
- },
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role that provided the additional tools."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The additional tool definitions made available at this item."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
- ]
- },
- "OpenAI.ItemResourceApplyPatchToolCall": {
- "type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "status",
- "operation"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "apply_patch_call"
- ],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
- },
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
- "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
- "title": "Apply patch operation"
- },
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
- ],
- "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
- "title": "Apply patch tool call"
- },
- "OpenAI.ItemResourceApplyPatchToolCallOutput": {
- "type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "status"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "apply_patch_call_output"
- ],
- "description": "The type of the item. Always `apply_patch_call_output`.",
- "x-stainless-const": true,
- "default": "apply_patch_call_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
- },
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call output."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
- ],
- "description": "The output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
- },
- "OpenAI.ItemResourceCodeInterpreterToolCall": {
- "type": "object",
- "required": [
- "type",
- "id",
- "status",
- "container_id",
- "code",
- "outputs"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "code_interpreter_call"
- ],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
- "x-stainless-const": true,
- "default": "code_interpreter_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the code interpreter tool call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
- ],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
- },
- "container_id": {
- "type": "string",
- "description": "The ID of the container used to run the code."
- },
- "code": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "outputs": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
- ],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
- },
- "OpenAI.ItemResourceCompactionBody": {
- "type": "object",
- "required": [
- "type",
- "id",
- "encrypted_content"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "compaction"
- ],
- "description": "The type of the item. Always `compaction`.",
- "x-stainless-const": true,
- "default": "compaction"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the compaction item."
- },
- "encrypted_content": {
- "type": "string",
- "description": "The encrypted content that was produced by compaction."
- },
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
- ],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
- },
- "OpenAI.ItemResourceComputerToolCall": {
- "type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "pending_safety_checks",
- "status"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_call"
- ],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the computer call."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used when responding to the tool call with output."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- },
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
- },
- "pending_safety_checks": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "assistant"
+ ],
+ "description": "The role of the output message. Always `assistant`.",
+ "x-stainless-const": true
+ },
+ "content": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
},
- "description": "The pending safety checks for the computer call."
+ "description": "The content of the output message."
+ },
+ "phase": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"status": {
"type": "string",
@@ -39802,53 +61839,60 @@
"completed",
"incomplete"
],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
+ "description": "An output message from the model.",
+ "title": "Output message"
},
- "OpenAI.ItemResourceComputerToolCallOutput": {
+ "OpenAI.OutputItemReasoningItem": {
"type": "object",
"required": [
"type",
"id",
- "call_id",
- "output"
+ "summary"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_call_output"
+ "reasoning"
],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
- "x-stainless-const": true,
- "default": "computer_call_output"
+ "description": "The type of the object. Always `reasoning`.",
+ "x-stainless-const": true
},
"id": {
"type": "string",
- "description": "The ID of the computer tool call output.",
- "readOnly": true
+ "description": "The unique identifier of the reasoning content."
},
- "call_id": {
- "type": "string",
- "description": "The ID of the computer tool call that produced the output."
+ "encrypted_content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "acknowledged_safety_checks": {
+ "summary": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
},
- "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
+ "description": "Reasoning summary content."
},
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ },
+ "description": "Reasoning text content."
},
"status": {
"type": "string",
@@ -39857,59 +61901,61 @@
"completed",
"incomplete"
],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
},
- "OpenAI.ItemResourceCustomToolCallOutputResource": {
+ "OpenAI.OutputItemToolSearchCall": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
- "output",
+ "execution",
+ "arguments",
"status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call_output"
+ "tool_search_call"
],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `tool_search_call`.",
+ "x-stainless-const": true,
+ "default": "tool_search_call"
},
"id": {
"type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
+ "description": "The unique ID of the tool search call item."
},
"call_id": {
- "type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
- },
- "output": {
- "oneOf": [
+ "anyOf": [
{
"type": "string"
},
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
+ "type": "null"
}
- ],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
+ ]
+ },
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "arguments": {
+ "description": "Arguments used for the tool search call."
},
"status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the tool search call item that was recorded."
},
"created_by": {
"type": "string",
@@ -39918,52 +61964,58 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
- ],
- "title": "ResponseCustomToolCallOutputItem"
+ ]
},
- "OpenAI.ItemResourceCustomToolCallResource": {
+ "OpenAI.OutputItemToolSearchOutput": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
- "name",
- "input",
+ "execution",
+ "tools",
"status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call"
+ "tool_search_output"
],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `tool_search_output`.",
+ "x-stainless-const": true,
+ "default": "tool_search_output"
},
"id": {
"type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
+ "description": "The unique ID of the tool search output item."
},
"call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the custom tool being called."
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "name": {
- "type": "string",
- "description": "The name of the custom tool being called."
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
},
- "input": {
- "type": "string",
- "description": "The input for the custom tool call generated by the model."
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The loaded tool definitions returned by tool search."
},
"status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the tool search output item that was recorded."
},
"created_by": {
"type": "string",
@@ -39972,30 +62024,91 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
- ],
- "title": "ResponseCustomToolCallItem"
+ ]
},
- "OpenAI.ItemResourceFileSearchToolCall": {
+ "OpenAI.OutputItemType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "output_message",
+ "file_search_call",
+ "function_call",
+ "function_call_output",
+ "web_search_call",
+ "computer_call",
+ "computer_call_output",
+ "reasoning",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "compaction",
+ "image_generation_call",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_call",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "custom_tool_call",
+ "custom_tool_call_output",
+ "structured_outputs",
+ "oauth_consent_request",
+ "memory_search_call",
+ "memory_command_preview_call",
+ "memory_command_preview_call_output",
+ "workflow_action",
+ "a2a_preview_call",
+ "a2a_preview_call_output",
+ "bing_grounding_call",
+ "bing_grounding_call_output",
+ "sharepoint_grounding_preview_call",
+ "sharepoint_grounding_preview_call_output",
+ "azure_ai_search_call",
+ "azure_ai_search_call_output",
+ "bing_custom_search_preview_call",
+ "bing_custom_search_preview_call_output",
+ "openapi_call",
+ "openapi_call_output",
+ "browser_automation_preview_call",
+ "browser_automation_preview_call_output",
+ "fabric_dataagent_preview_call",
+ "fabric_dataagent_preview_call_output",
+ "azure_function_call",
+ "azure_function_call_output"
+ ]
+ }
+ ]
+ },
+ "OpenAI.OutputItemWebSearchToolCall": {
"type": "object",
"required": [
"id",
"type",
"status",
- "queries"
+ "action"
],
"properties": {
"id": {
"type": "string",
- "description": "The unique ID of the file search tool call."
+ "description": "The unique ID of the web search tool call."
},
"type": {
"type": "string",
"enum": [
- "file_search_call"
+ "web_search_call"
],
- "description": "The type of the file search tool call. Always `file_search_call`.",
+ "description": "The type of the web search tool call. Always `web_search_call`.",
"x-stainless-const": true
},
"status": {
@@ -40004,245 +62117,168 @@
"in_progress",
"searching",
"completed",
- "incomplete",
- "failed"
+ "failed",
+ "incomplete"
],
- "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
- },
- "queries": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The queries used to search for files."
+ "description": "The status of the web search tool call."
},
- "results": {
- "anyOf": [
+ "action": {
+ "oneOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
- }
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
},
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
}
- ]
+ ],
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
- "title": "File search tool call"
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
},
- "OpenAI.ItemResourceFunctionShellCall": {
+ "OpenAI.OutputMessageContent": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "action",
- "status",
- "environment"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "shell_call"
- ],
- "description": "The type of the item. Always `shell_call`.",
- "x-stainless-const": true,
- "default": "shell_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
- "description": "The shell commands and limits that describe how to run the tool call."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
- "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
- },
- "environment": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
- },
- {
- "type": "null"
- }
- ]
- },
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContentType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "output_text": "#/components/schemas/OpenAI.OutputMessageContentOutputTextContent",
+ "refusal": "#/components/schemas/OpenAI.OutputMessageContentRefusalContent"
}
- ],
- "description": "A tool call that executes one or more shell commands in a managed environment.",
- "title": "Shell tool call"
+ }
},
- "OpenAI.ItemResourceFunctionShellCallOutput": {
+ "OpenAI.OutputMessageContentOutputTextContent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "output",
- "max_output_length"
+ "text",
+ "annotations",
+ "logprobs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call_output"
+ "output_text"
],
- "description": "The type of the shell call output. Always `shell_call_output`.",
+ "description": "The type of the output text. Always `output_text`.",
"x-stainless-const": true,
- "default": "shell_call_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell call output. Populated when this item is returned via API."
+ "default": "output_text"
},
- "call_id": {
+ "text": {
"type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
- "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ "description": "The text output from the model."
},
- "output": {
+ "annotations": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
+ "$ref": "#/components/schemas/OpenAI.Annotation"
},
- "description": "An array of shell call output contents"
- },
- "max_output_length": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The annotations of the text output."
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.LogProb"
+ }
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
}
],
- "description": "The output of a shell tool call that was emitted.",
- "title": "Shell call output"
+ "description": "A text output from the model.",
+ "title": "Output text"
},
- "OpenAI.ItemResourceFunctionToolCall": {
+ "OpenAI.OutputMessageContentRefusalContent": {
"type": "object",
"required": [
- "id",
"type",
- "call_id",
- "name",
- "arguments"
+ "refusal"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call"
+ "refusal"
],
- "description": "The type of the function tool call. Always `function_call`.",
- "x-stainless-const": true
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the function to run."
- },
- "name": {
- "type": "string",
- "description": "The name of the function to run."
+ "description": "The type of the refusal. Always `refusal`.",
+ "x-stainless-const": true,
+ "default": "refusal"
},
- "arguments": {
+ "refusal": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the function."
+ "description": "The refusal explanation from the model."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ }
+ ],
+ "description": "A refusal from the model.",
+ "title": "Refusal"
+ },
+ "OpenAI.OutputMessageContentType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "status": {
+ {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "output_text",
+ "refusal"
+ ]
}
- },
- "allOf": [
+ ]
+ },
+ "OpenAI.PartialImages": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
}
],
- "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
- "title": "Function tool call"
+ "minimum": 0,
+ "maximum": 3,
+ "description": "The number of partial images to generate. This parameter is used for\nstreaming responses that return partial images. Value must be between 0 and 3.\nWhen set to 0, the response will be a single image sent in one streaming event.\nNote that the final image may be sent before the full number of partial images\nare generated if the full image is generated more quickly."
},
- "OpenAI.ItemResourceFunctionToolCallOutput": {
+ "OpenAI.PredictionContent": {
"type": "object",
"required": [
- "id",
"type",
- "call_id",
- "output"
+ "content"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call_output"
+ "content"
],
- "description": "The type of the function tool call output. Always `function_call_output`.",
+ "description": "The type of the predicted content you want to provide. This type is\n currently always `content`.",
"x-stainless-const": true
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "output": {
+ "content": {
"oneOf": [
{
"type": "string"
@@ -40250,62 +62286,27 @@
{
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
}
- }
- ],
- "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "The content that should be matched when generating a model response.\n If generated tokens would match this content, the entire model response\n can be returned much more quickly."
}
- ],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
+ },
+ "description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.",
+ "title": "Static Content"
},
- "OpenAI.ItemResourceImageGenToolCall": {
+ "OpenAI.Prompt": {
"type": "object",
"required": [
- "type",
- "id",
- "status",
- "result"
+ "id"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "image_generation_call"
- ],
- "description": "The type of the image generation call. Always `image_generation_call`.",
- "x-stainless-const": true
- },
"id": {
"type": "string",
- "description": "The unique ID of the image generation call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "generating",
- "failed"
- ],
- "description": "The status of the image generation call."
+ "description": "The unique identifier of the prompt template to use."
},
- "result": {
+ "version": {
"anyOf": [
{
"type": "string"
@@ -40314,1108 +62315,1669 @@
"type": "null"
}
]
+ },
+ "variables": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponsePromptVariables"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "description": "Reference to a prompt template and its variables.\n[Learn more](/docs/guides/text?api-mode=responses#reusable-prompts)."
+ },
+ "OpenAI.PromptCacheRetentionEnum": {
+ "type": "string",
+ "enum": [
+ "in_memory",
+ "24h"
+ ]
+ },
+ "OpenAI.RankerVersionType": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "default-2024-11-15"
+ ]
+ },
+ "OpenAI.RankingOptions": {
+ "type": "object",
+ "properties": {
+ "ranker": {
+ "$ref": "#/components/schemas/OpenAI.RankerVersionType",
+ "description": "The ranker to use for the file search."
+ },
+ "score_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "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."
+ },
+ "hybrid_search": {
+ "$ref": "#/components/schemas/OpenAI.HybridSearchOptions",
+ "description": "Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled."
}
+ }
+ },
+ "OpenAI.RealtimeAudioFormats": {
+ "type": "object",
+ "required": [
+ "type"
],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormatsType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "audio/pcm": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcm",
+ "audio/pcmu": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcmu",
+ "audio/pcma": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcma"
+ }
+ }
},
- "OpenAI.ItemResourceInputMessage": {
+ "OpenAI.RealtimeAudioFormatsAudioPcm": {
"type": "object",
"required": [
- "type",
- "role",
- "content",
- "id"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "message"
- ],
- "description": "The type of the message input. Always set to `message`.",
- "x-stainless-const": true,
- "default": "message"
- },
- "role": {
- "type": "string",
- "enum": [
- "user",
- "system",
- "developer"
- ],
- "description": "The role of the message input. One of `user`, `system`, or `developer`."
+ "audio/pcm"
+ ]
},
- "status": {
- "type": "string",
+ "rate": {
+ "type": "number",
"enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- },
- "content": {
- "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the message input.",
- "readOnly": true
+ 24000
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
}
- ],
- "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role.",
- "title": "Input message"
+ ]
},
- "OpenAI.ItemResourceLocalShellToolCall": {
+ "OpenAI.RealtimeAudioFormatsAudioPcma": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "action",
- "status"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call"
- ],
- "description": "The type of the local shell call. Always `local_shell_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell call."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the local shell call."
+ "audio/pcma"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
}
- ],
- "description": "A tool call to run a command on the local shell.",
- "title": "Local shell call"
+ ]
},
- "OpenAI.ItemResourceLocalShellToolCallOutput": {
+ "OpenAI.RealtimeAudioFormatsAudioPcmu": {
"type": "object",
"required": [
- "type",
- "id",
- "output"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call_output"
- ],
- "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
- "x-stainless-const": true
+ "audio/pcmu"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
+ }
+ ]
+ },
+ "OpenAI.RealtimeAudioFormatsType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "id": {
+ {
"type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
- },
- "output": {
+ "enum": [
+ "audio/pcm",
+ "audio/pcmu",
+ "audio/pcma"
+ ]
+ }
+ ]
+ },
+ "OpenAI.RealtimeCallCreateRequest": {
+ "type": "object",
+ "properties": {
+ "sdp": {
"type": "string",
- "description": "A JSON string of the output of the local shell tool call."
+ "description": "WebRTC Session Description Protocol (SDP) offer generated by the caller."
},
- "status": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
+ "session": {
+ "allOf": [
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA"
}
- ]
+ ],
+ "description": "Optional session configuration to apply before the realtime session is\n created. Use the same parameters you would send in a [`create client secret`](/docs/api-reference/realtime-sessions/create-realtime-client-secret)\n request."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
- ],
- "description": "The output of a local shell tool call.",
- "title": "Local shell call output"
+ "required": [
+ "sdp"
+ ]
},
- "OpenAI.ItemResourceMcpApprovalRequest": {
+ "OpenAI.RealtimeCallReferRequest": {
"type": "object",
"required": [
- "type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "target_uri"
],
"properties": {
- "type": {
+ "target_uri": {
+ "type": "string",
+ "description": "URI that should appear in the SIP Refer-To header. Supports values like\n `tel:+14155550123` or `sip:agent\\@example.com`."
+ }
+ },
+ "description": "Parameters required to transfer a SIP call to a new destination using the\nRealtime API.",
+ "title": "Realtime call refer request"
+ },
+ "OpenAI.RealtimeCallRejectRequest": {
+ "type": "object",
+ "properties": {
+ "status_code": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "SIP response code to send back to the caller. Defaults to `603` (Decline)\n when omitted."
+ }
+ },
+ "description": "Parameters used to decline an incoming SIP call handled by the Realtime API.",
+ "title": "Realtime call reject request"
+ },
+ "OpenAI.RealtimeCreateClientSecretRequest": {
+ "type": "object",
+ "properties": {
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeCreateClientSecretRequestExpiresAfter",
+ "description": "Configuration for the client secret expiration. Expiration refers to the time after which\n a client secret will no longer be valid for creating sessions. The session itself may\n continue after that time once started. A secret can be used to create multiple sessions\n until it expires.",
+ "title": "Client secret expiration"
+ },
+ "session": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion",
+ "description": "Session configuration to use for the client secret. Choose either a realtime\n session or a transcription session.",
+ "title": "Session configuration"
+ }
+ },
+ "description": "Create a session and client secret for the Realtime API. The request can specify\neither a realtime or a transcription session configuration.\n[Learn more about the Realtime API](/docs/guides/realtime).",
+ "title": "Realtime client secret creation request"
+ },
+ "OpenAI.RealtimeCreateClientSecretRequestExpiresAfter": {
+ "type": "object",
+ "properties": {
+ "anchor": {
"type": "string",
"enum": [
- "mcp_approval_request"
+ "created_at"
],
- "description": "The type of the item. Always `mcp_approval_request`.",
- "x-stainless-const": true
+ "x-stainless-const": true,
+ "default": "created_at"
},
- "id": {
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "minimum": 10,
+ "maximum": 7200,
+ "default": 600
+ }
+ }
+ },
+ "OpenAI.RealtimeCreateClientSecretResponse": {
+ "type": "object",
+ "required": [
+ "value",
+ "expires_at",
+ "session"
+ ],
+ "properties": {
+ "value": {
"type": "string",
- "description": "The unique ID of the approval request."
+ "description": "The generated client secret value."
},
- "server_label": {
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Expiration timestamp for the client secret, in seconds since epoch."
+ },
+ "session": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion",
+ "description": "The session configuration for either a realtime or transcription session.",
+ "title": "Session configuration"
+ }
+ },
+ "description": "Response from creating a session and client secret for the Realtime API.",
+ "title": "Realtime session and client secret",
+ "x-oaiMeta": {
+ "name": "Session response object",
+ "group": "realtime",
+ "example": "{\n \"value\": \"ek_68af296e8e408191a1120ab6383263c2\",\n \"expires_at\": 1756310470,\n \"session\": {\n \"type\": \"realtime\",\n \"object\": \"realtime.session\",\n \"id\": \"sess_C9CiUVUzUzYIssh3ELY1d\",\n \"model\": \"gpt-realtime-2025-08-25\",\n \"output_modalities\": [\n \"audio\"\n ],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"auto\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": null,\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"expires_at\": 0,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": null,\n \"noise_reduction\": null,\n \"turn_detection\": {\n \"type\": \"server_vad\",\n \"threshold\": 0.5,\n \"prefix_padding_ms\": 300,\n \"silence_duration_ms\": 200,\n \"idle_timeout_ms\": null,\n \"create_response\": true,\n \"interrupt_response\": true\n }\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n },\n \"include\": null\n }\n}\n"
+ }
+ },
+ "OpenAI.RealtimeFunctionTool": {
+ "type": "object",
+ "properties": {
+ "type": {
"type": "string",
- "description": "The label of the MCP server making the request."
+ "enum": [
+ "function"
+ ],
+ "description": "The type of the tool, i.e. `function`.",
+ "x-stainless-const": true
},
"name": {
"type": "string",
- "description": "The name of the tool to run."
+ "description": "The name of the function."
},
- "arguments": {
+ "description": {
"type": "string",
- "description": "A JSON string of arguments for the tool."
+ "description": "The description of the function, including guidance on when and how\n to call it, and guidance about what to tell the user when calling\n (if anything)."
+ },
+ "parameters": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeFunctionToolParameters",
+ "description": "Parameters of the function in JSON Schema."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
+ "title": "Function tool"
+ },
+ "OpenAI.RealtimeFunctionToolParameters": {
+ "type": "object"
+ },
+ "OpenAI.RealtimeMCPError": {
+ "type": "object",
+ "required": [
+ "type"
],
- "description": "A request for human approval of a tool invocation.",
- "title": "MCP approval request"
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMcpErrorType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "protocol_error": "#/components/schemas/OpenAI.RealtimeMCPProtocolError",
+ "tool_execution_error": "#/components/schemas/OpenAI.RealtimeMCPToolExecutionError",
+ "http_error": "#/components/schemas/OpenAI.RealtimeMCPHTTPError"
+ }
+ }
},
- "OpenAI.ItemResourceMcpApprovalResponseResource": {
+ "OpenAI.RealtimeMCPHTTPError": {
"type": "object",
"required": [
"type",
- "id",
- "approval_request_id",
- "approve"
+ "code",
+ "message"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_response"
+ "http_error"
],
- "description": "The type of the item. Always `mcp_approval_response`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the approval response"
- },
- "approval_request_id": {
- "type": "string",
- "description": "The ID of the approval request being answered."
- },
- "approve": {
- "type": "boolean",
- "description": "Whether the request was approved."
+ "code": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "reason": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "message": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
],
- "description": "A response to an MCP approval request.",
- "title": "MCP approval response"
+ "title": "Realtime MCP HTTP error"
},
- "OpenAI.ItemResourceMcpListTools": {
+ "OpenAI.RealtimeMCPProtocolError": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "tools"
+ "code",
+ "message"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_list_tools"
+ "protocol_error"
],
- "description": "The type of the item. Always `mcp_list_tools`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the list."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
- },
- "description": "The tools available on the server."
+ "code": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "message": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
],
- "description": "A list of tools available on an MCP server.",
- "title": "MCP list tools"
+ "title": "Realtime MCP protocol error"
},
- "OpenAI.ItemResourceMcpToolCall": {
+ "OpenAI.RealtimeMCPToolExecutionError": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "message"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_call"
+ "tool_execution_error"
],
- "description": "The type of the item. Always `mcp_call`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the tool call."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server running the tool."
- },
- "name": {
- "type": "string",
- "description": "The name of the tool that was run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments passed to the tool."
- },
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "error": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
- "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
- },
- "approval_request_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "message": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
],
- "description": "An invocation of a tool on an MCP server.",
- "title": "MCP tool call"
+ "title": "Realtime MCP tool execution error"
},
- "OpenAI.ItemResourceOutputMessage": {
+ "OpenAI.RealtimeMcpErrorType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "protocol_error",
+ "tool_execution_error",
+ "http_error"
+ ]
+ }
+ ]
+ },
+ "OpenAI.RealtimeReasoning": {
+ "type": "object",
+ "properties": {
+ "effort": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeReasoningEffort"
+ }
+ },
+ "description": "Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.",
+ "title": "Realtime reasoning configuration"
+ },
+ "OpenAI.RealtimeReasoningEffort": {
+ "type": "string",
+ "enum": [
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
+ "description": "Constrains effort on reasoning for reasoning-capable Realtime models such as\n`gpt-realtime-2`."
+ },
+ "OpenAI.RealtimeSessionCreateRequest": {
"type": "object",
"required": [
- "id",
- "type",
- "role",
- "content",
- "status"
+ "client_secret"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the output message."
+ "client_secret": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestClientSecret",
+ "description": "Ephemeral key returned by the API."
},
- "type": {
+ "modalities": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
+ },
+ "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"].",
+ "default": [
+ "text",
+ "audio"
+ ]
+ },
+ "instructions": {
"type": "string",
- "enum": [
- "output_message"
- ],
- "description": "The type of the output message. Always `message`.",
- "x-stainless-const": true
+ "description": "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.\n 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."
+ },
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsOrCustomVoice",
+ "description": "The voice the model uses to respond. Supported built-in voices are\n `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`,\n `marin`, and `cedar`. You may also provide a custom voice object with an\n `id`, for example `{ \"id\": \"voice_1234\" }`. Voice cannot be changed during\n the session once the model has responded with audio at least once."
+ },
+ "input_audio_format": {
+ "type": "string",
+ "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`."
},
- "role": {
+ "output_audio_format": {
"type": "string",
- "enum": [
- "assistant"
+ "description": "The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`."
+ },
+ "input_audio_transcription": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestInputAudioTranscription",
+ "description": "Configuration for input audio transcription, defaults to off and can be\n set to `null` to turn off once on. Input audio transcription is not native\n to the model, since the model consumes audio directly. Transcription runs\n asynchronously and should be treated as rough guidance\n rather than the representation understood by the model."
+ },
+ "speed": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0.25,
+ "maximum": 1.5,
+ "description": "The speed of the model's spoken response. 1.0 is the default speed. 0.25 is\n the minimum speed. 1.5 is the maximum speed. This value can only be changed\n in between model turns, not while a response is in progress.",
+ "default": 1
+ },
+ "tracing": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "workflow_name": {
+ "type": "string"
+ },
+ "group_id": {
+ "type": "string"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
+ }
+ }
],
- "description": "The role of the output message. Always `assistant`.",
- "x-stainless-const": true
+ "description": "Configuration options for tracing. Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.",
+ "title": "Tracing Configuration",
+ "default": "auto"
},
- "content": {
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestTurnDetection",
+ "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech."
+ },
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestTools"
},
- "description": "The content of the output message."
+ "description": "Tools (functions) available to the model."
},
- "phase": {
- "anyOf": [
+ "tool_choice": {
+ "type": "string",
+ "description": "How the model chooses tools. Options are `auto`, `none`, `required`, or\n specify a function."
+ },
+ "temperature": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8."
+ },
+ "max_response_output_tokens": {
+ "oneOf": [
{
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
- "type": "null"
+ "type": "string",
+ "enum": [
+ "inf"
+ ]
}
- ]
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`."
+ },
+ "truncation": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTruncation"
+ },
+ "prompt": {
+ "$ref": "#/components/schemas/OpenAI.Prompt"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
+ "description": "A new Realtime session configuration, with an ephemeral key. Default TTL\nfor keys is one minute.",
+ "x-oaiMeta": {
+ "name": "The session object",
+ "group": "realtime",
+ "example": "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"model\": \"gpt-realtime-2025-08-25\",\n \"modalities\": [\"audio\", \"text\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"voice\": \"alloy\",\n \"input_audio_format\": \"pcm16\",\n \"output_audio_format\": \"pcm16\",\n \"input_audio_transcription\": {\n \"model\": \"whisper-1\"\n },\n \"turn_detection\": null,\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"temperature\": 0.7,\n \"speed\": 1.1,\n \"tracing\": \"auto\",\n \"max_response_output_tokens\": 200,\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"client_secret\": {\n \"value\": \"ek_abc123\",\n \"expires_at\": 1234567890\n }\n}\n"
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestClientSecret": {
+ "type": "object",
+ "required": [
+ "value",
+ "expires_at"
],
- "description": "An output message from the model.",
- "title": "Output message"
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime"
+ }
+ }
},
- "OpenAI.ItemResourceReasoningItem": {
+ "OpenAI.RealtimeSessionCreateRequestGA": {
"type": "object",
"required": [
- "type",
- "id",
- "summary"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "reasoning"
+ "realtime"
],
- "description": "The type of the object. Always `reasoning`.",
+ "description": "The type of session to create. Always `realtime` for the Realtime API.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique identifier of the reasoning content."
+ "output_modalities": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
+ },
+ "description": "The set of modalities the model can respond with. It defaults to `[\"audio\"]`, indicating\n that the model will respond with audio plus a transcript. `[\"text\"]` can be used to make\n the model respond with text only. It is not possible to request both `text` and `audio` at the same time.",
+ "default": [
+ "audio"
+ ]
},
- "encrypted_content": {
+ "model": {
"anyOf": [
{
"type": "string"
},
{
- "type": "null"
+ "type": "string",
+ "enum": [
+ "gpt-realtime",
+ "gpt-realtime-1.5",
+ "gpt-realtime-2",
+ "gpt-realtime-2025-08-28",
+ "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",
+ "gpt-realtime-mini",
+ "gpt-realtime-mini-2025-10-06",
+ "gpt-realtime-mini-2025-12-15",
+ "gpt-audio-1.5",
+ "gpt-audio-mini",
+ "gpt-audio-mini-2025-10-06",
+ "gpt-audio-mini-2025-12-15"
+ ]
}
- ]
+ ],
+ "description": "The Realtime model used for this session."
},
- "summary": {
+ "instructions": {
+ "type": "string",
+ "description": "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.\n 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."
+ },
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudio",
+ "description": "Configuration for input and output audio."
+ },
+ "include": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
+ "type": "string",
+ "enum": [
+ "item.input_audio_transcription.logprobs"
+ ]
},
- "description": "Reasoning summary content."
+ "description": "Additional fields to include in server outputs.\n `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription."
},
- "content": {
+ "tracing": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGATracing"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Realtime API can write session traces to the [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.",
+ "title": "Tracing Configuration",
+ "default": "auto"
+ },
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeFunctionTool"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPTool"
+ }
+ ]
},
- "description": "Reasoning text content."
+ "description": "Tools available to the model."
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
+ "tool_choice": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceFunction"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceMCP"
+ }
],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "How the model chooses tools. Provide one of the string modes or force a specific\n function/MCP tool.",
+ "default": "auto"
+ },
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether the model may call multiple tools in parallel. Only supported by\n reasoning Realtime models such as `gpt-realtime-2`."
+ },
+ "reasoning": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeReasoning"
+ },
+ "max_output_tokens": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "inf"
+ ]
+ }
+ ],
+ "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`."
+ },
+ "truncation": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTruncation"
+ },
+ "prompt": {
+ "$ref": "#/components/schemas/OpenAI.Prompt"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion"
}
],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
+ "description": "Realtime session object configuration.",
+ "title": "Realtime session configuration"
},
- "OpenAI.ItemResourceToolSearchCall": {
+ "OpenAI.RealtimeSessionCreateRequestGAAudio": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInput"
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioOutput"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestGAAudioInput": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
+ },
+ "transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscription"
+ },
+ "noise_reduction": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction"
+ },
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestGAAudioOutput": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
+ },
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsOrCustomVoice",
+ "default": "alloy"
+ },
+ "speed": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0.25,
+ "maximum": 1.5,
+ "default": 1
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestGATracing": {
+ "type": "object",
+ "properties": {
+ "workflow_name": {
+ "type": "string"
+ },
+ "group_id": {
+ "type": "string"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestInputAudioTranscription": {
+ "type": "object",
+ "properties": {
+ "model": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestTools": {
"type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "execution",
- "arguments",
- "status"
- ],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_search_call"
+ "function"
],
- "description": "The type of the item. Always `tool_search_call`.",
- "x-stainless-const": true,
- "default": "tool_search_call"
+ "x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the tool search call item."
+ "name": {
+ "type": "string"
},
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": {
+ "type": "string"
},
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
+ "parameters": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestToolsParameters"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestToolsParameters": {
+ "type": "object"
+ },
+ "OpenAI.RealtimeSessionCreateRequestTurnDetection": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
},
- "arguments": {
- "description": "Arguments used for the tool search call."
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the tool search call item that was recorded."
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestUnion": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnionType"
}
},
- "allOf": [
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "transcription": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGA",
+ "realtime": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestUnionType": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "realtime",
+ "transcription"
+ ]
}
]
},
- "OpenAI.ItemResourceToolSearchOutput": {
+ "OpenAI.RealtimeSessionCreateResponse": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "execution",
- "tools",
- "status"
+ "type"
],
"properties": {
- "type": {
+ "id": {
"type": "string",
- "enum": [
- "tool_search_output"
- ],
- "description": "The type of the item. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
+ "description": "Unique identifier for the session that looks like `sess_1234567890abcdef`."
},
- "id": {
+ "object": {
"type": "string",
- "description": "The unique ID of the tool search output item."
+ "description": "The object type. Always `realtime.session`."
},
- "call_id": {
- "anyOf": [
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Expiration timestamp for the session, in seconds since epoch."
+ },
+ "include": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "item.input_audio_transcription.logprobs"
+ ]
+ },
+ "description": "Additional fields to include in server outputs.\n - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription."
+ },
+ "model": {
+ "type": "string",
+ "description": "The Realtime model used for this session."
+ },
+ "output_modalities": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
+ },
+ "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"]."
+ },
+ "instructions": {
+ "type": "string",
+ "description": "The default system instructions (i.e. system message) prepended to model\n calls. This field allows the client to guide the model on desired\n responses. The model can be instructed on response content and format,\n (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good\n responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion\n into your voice\", \"laugh frequently\"). The instructions are not guaranteed\n to be followed by the model, but they provide guidance to the model on the\n desired behavior.\n Note that the server sets default instructions which will be used if this\n field is not set and are visible in the `session.created` event at the\n start of the session."
+ },
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudio",
+ "description": "Configuration for input and output audio for the session."
+ },
+ "tracing": {
+ "oneOf": [
{
- "type": "string"
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
},
{
- "type": "null"
+ "type": "object",
+ "properties": {
+ "workflow_name": {
+ "type": "string"
+ },
+ "group_id": {
+ "type": "string"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
+ }
}
- ]
+ ],
+ "description": "Configuration options for tracing. Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.",
+ "title": "Tracing Configuration",
+ "default": "auto"
},
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseTurnDetection",
+ "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech."
},
"tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.RealtimeFunctionTool"
},
- "description": "The loaded tool definitions returned by tool search."
+ "description": "Tools (functions) available to the model."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the tool search output item that was recorded."
+ "tool_choice": {
+ "type": "string",
+ "description": "How the model chooses tools. Options are `auto`, `none`, `required`, or\n specify a function."
},
- "created_by": {
+ "max_output_tokens": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "inf"
+ ]
+ }
+ ],
+ "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`."
+ },
+ "type": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "enum": [
+ "realtime"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion"
}
- ]
+ ],
+ "description": "A Realtime session configuration object.",
+ "title": "Realtime session configuration object",
+ "x-oaiMeta": {
+ "name": "The session object",
+ "group": "realtime",
+ "example": "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"expires_at\": 1742188264,\n \"model\": \"gpt-realtime\",\n \"output_modalities\": [\"audio\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": \"auto\",\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": { \"model\": \"whisper-1\" },\n \"noise_reduction\": null,\n \"turn_detection\": null\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n }\n}\n"
+ }
},
- "OpenAI.ItemResourceType": {
- "anyOf": [
- {
+ "OpenAI.RealtimeSessionCreateResponseAudio": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInput"
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioOutput"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseAudioInput": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
+ },
+ "transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscriptionResponse"
+ },
+ "noise_reduction": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction"
+ },
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection": {
+ "type": "object",
+ "properties": {
+ "type": {
"type": "string"
},
- {
- "type": "string",
- "enum": [
- "message",
- "output_message",
- "file_search_call",
- "computer_call",
- "computer_call_output",
- "web_search_call",
- "function_call",
- "function_call_output",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "reasoning",
- "compaction",
- "image_generation_call",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "mcp_call",
- "custom_tool_call",
- "custom_tool_call_output",
- "structured_outputs",
- "oauth_consent_request",
- "memory_search_call",
- "memory_command_preview_call",
- "memory_command_preview_call_output",
- "workflow_action",
- "a2a_preview_call",
- "a2a_preview_call_output",
- "bing_grounding_call",
- "bing_grounding_call_output",
- "sharepoint_grounding_preview_call",
- "sharepoint_grounding_preview_call_output",
- "azure_ai_search_call",
- "azure_ai_search_call_output",
- "bing_custom_search_preview_call",
- "bing_custom_search_preview_call_output",
- "openapi_call",
- "openapi_call_output",
- "browser_automation_preview_call",
- "browser_automation_preview_call_output",
- "fabric_dataagent_preview_call",
- "fabric_dataagent_preview_call_output",
- "azure_function_call",
- "azure_function_call_output"
- ]
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseAudioOutput": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
+ },
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsShared"
+ },
+ "speed": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
}
- ]
+ }
},
- "OpenAI.ItemResourceWebSearchToolCall": {
+ "OpenAI.RealtimeSessionCreateResponseTurnDetection": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseUnion": {
"type": "object",
"required": [
- "id",
- "type",
- "status",
- "action"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the web search tool call."
- },
"type": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnionType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "transcription": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse",
+ "realtime": "#/components/schemas/OpenAI.RealtimeSessionCreateResponse"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseUnionType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
"type": "string",
"enum": [
- "web_search_call"
- ],
- "description": "The type of the web search tool call. Always `web_search_call`.",
- "x-stainless-const": true
+ "realtime",
+ "transcription"
+ ]
+ }
+ ]
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequest": {
+ "type": "object",
+ "properties": {
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection",
+ "description": "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."
},
- "status": {
+ "input_audio_noise_reduction": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction",
+ "description": "Configuration for input audio noise reduction. This can be set to `null` to turn off.\n Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\n 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_format": {
"type": "string",
"enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
+ "pcm16",
+ "g711_ulaw",
+ "g711_alaw"
],
- "description": "The status of the web search tool call."
+ "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.\n For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate,\n single channel (mono), and little-endian byte order.",
+ "default": "pcm16"
},
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
- }
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ "input_audio_transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscription",
+ "description": "Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service."
+ },
+ "include": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "item.input_audio_transcription.logprobs"
+ ]
+ },
+ "description": "The set of items to include in the transcription. Current available items are:\n `item.input_audio_transcription.logprobs`"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
- ],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
+ "description": "Realtime transcription session object configuration.",
+ "title": "Realtime transcription session configuration"
},
- "OpenAI.ItemToolSearchCallItemParam": {
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestGA": {
"type": "object",
"required": [
- "type",
- "arguments"
+ "type"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
"type": {
"type": "string",
"enum": [
- "tool_search_call"
+ "transcription"
],
- "description": "The item type. Always `tool_search_call`.",
- "x-stainless-const": true,
- "default": "tool_search_call"
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
+ "description": "The type of session to create. Always `transcription` for transcription sessions.",
+ "x-stainless-const": true
},
- "arguments": {
- "$ref": "#/components/schemas/OpenAI.EmptyModelParam",
- "description": "The arguments supplied to the tool search call."
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudio",
+ "description": "Configuration for input and output audio."
},
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
+ "include": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "item.input_audio_transcription.logprobs"
+ ]
+ },
+ "description": "Additional fields to include in server outputs.\n `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion"
}
- ]
+ ],
+ "description": "Realtime transcription session object configuration.",
+ "title": "Realtime transcription session configuration"
},
- "OpenAI.ItemToolSearchOutputItemParam": {
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudio": {
"type": "object",
- "required": [
- "type",
- "tools"
- ],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInput"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInput": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
},
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscription"
+ },
+ "noise_reduction": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInputNoiseReduction"
},
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInputNoiseReduction": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection": {
+ "type": "object",
+ "properties": {
"type": {
"type": "string",
"enum": [
- "tool_search_output"
- ],
- "description": "The item type. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
+ "server_vad"
+ ]
},
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "tools": {
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateResponse": {
+ "type": "object",
+ "required": [
+ "client_secret",
+ "type"
+ ],
+ "properties": {
+ "client_secret": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret",
+ "description": "Ephemeral key returned by the API. Only present when the session is\n created on the server via REST API."
+ },
+ "modalities": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
},
- "description": "The loaded tool definitions returned by the tool search output."
+ "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"]."
},
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
+ "input_audio_format": {
+ "type": "string",
+ "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`."
+ },
+ "input_audio_transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscriptionResponse",
+ "description": "Configuration of the transcription model."
+ },
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection",
+ "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "transcription"
+ ],
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion"
}
- ]
+ ],
+ "description": "A new Realtime transcription session configuration.\nWhen a session is created on the server via REST API, the session object\nalso contains an ephemeral key. Default TTL for keys is 10 minutes. This\nproperty is not present when a session is updated via the WebSocket API.",
+ "x-oaiMeta": {
+ "name": "The transcription session object",
+ "group": "realtime",
+ "example": "{\n \"id\": \"sess_BBwZc7cFV3XizEyKGDCGL\",\n \"object\": \"realtime.transcription_session\",\n \"expires_at\": 1742188264,\n \"modalities\": [\"audio\", \"text\"],\n \"turn_detection\": {\n \"type\": \"server_vad\",\n \"threshold\": 0.5,\n \"prefix_padding_ms\": 300,\n \"silence_duration_ms\": 200\n },\n \"input_audio_format\": \"pcm16\",\n \"input_audio_transcription\": {\n \"model\": \"gpt-4o-transcribe\",\n \"language\": null,\n \"prompt\": \"\"\n },\n \"client_secret\": null\n}\n"
+ }
},
- "OpenAI.ItemType": {
- "anyOf": [
- {
+ "OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret": {
+ "type": "object",
+ "required": [
+ "value",
+ "expires_at"
+ ],
+ "properties": {
+ "value": {
"type": "string"
},
- {
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranslationClientSecretCreateRequest": {
+ "type": "object",
+ "required": [
+ "session"
+ ],
+ "properties": {
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationClientSecretCreateRequestExpiresAfter",
+ "description": "Configuration for the client secret expiration. Expiration refers to the time after which\n a client secret will no longer be valid for creating sessions. The session itself may\n continue after that time once started. A secret can be used to create multiple sessions\n until it expires.",
+ "title": "Client secret expiration"
+ },
+ "session": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequest"
+ }
+ },
+ "description": "Create a translation session and client secret for the Realtime API.",
+ "title": "Realtime translation client secret creation request"
+ },
+ "OpenAI.RealtimeTranslationClientSecretCreateRequestExpiresAfter": {
+ "type": "object",
+ "properties": {
+ "anchor": {
"type": "string",
"enum": [
- "message",
- "output_message",
- "file_search_call",
- "computer_call",
- "computer_call_output",
- "web_search_call",
- "function_call",
- "function_call_output",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "reasoning",
- "compaction",
- "image_generation_call",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "mcp_call",
- "custom_tool_call_output",
- "custom_tool_call",
- "structured_outputs",
- "oauth_consent_request",
- "memory_search_call",
- "memory_command_preview_call",
- "memory_command_preview_call_output",
- "workflow_action",
- "a2a_preview_call",
- "a2a_preview_call_output",
- "bing_grounding_call",
- "bing_grounding_call_output",
- "sharepoint_grounding_preview_call",
- "sharepoint_grounding_preview_call_output",
- "azure_ai_search_call",
- "azure_ai_search_call_output",
- "bing_custom_search_preview_call",
- "bing_custom_search_preview_call_output",
- "openapi_call",
- "openapi_call_output",
- "browser_automation_preview_call",
- "browser_automation_preview_call_output",
- "fabric_dataagent_preview_call",
- "fabric_dataagent_preview_call_output",
- "azure_function_call",
- "azure_function_call_output"
- ]
+ "created_at"
+ ],
+ "x-stainless-const": true,
+ "default": "created_at"
+ },
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "minimum": 10,
+ "maximum": 7200,
+ "default": 600
}
- ]
+ }
},
- "OpenAI.ItemWebSearchToolCall": {
+ "OpenAI.RealtimeTranslationClientSecretCreateResponse": {
+ "type": "object",
+ "required": [
+ "value",
+ "expires_at",
+ "session"
+ ],
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "The generated client secret value."
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Expiration timestamp for the client secret, in seconds since epoch."
+ },
+ "session": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSession"
+ }
+ },
+ "description": "Response from creating a translation session and client secret for the Realtime API.",
+ "title": "Realtime translation session and client secret",
+ "x-oaiMeta": {
+ "name": "Translation session response object",
+ "group": "realtime",
+ "example": "{\n \"value\": \"ek_68af296e8e408191a1120ab6383263c2\",\n \"expires_at\": 1756310470,\n \"session\": {\n \"id\": \"sess_C9CiUVUzUzYIssh3ELY1d\",\n \"type\": \"translation\",\n \"expires_at\": 1756310470,\n \"model\": \"gpt-realtime-translate\",\n \"audio\": {\n \"input\": {\n \"transcription\": null,\n \"noise_reduction\": null\n },\n \"output\": {\n \"language\": \"es\"\n }\n }\n }\n}\n"
+ }
+ },
+ "OpenAI.RealtimeTranslationSession": {
"type": "object",
"required": [
"id",
"type",
- "status",
- "action"
+ "expires_at",
+ "model",
+ "audio"
],
"properties": {
"id": {
"type": "string",
- "description": "The unique ID of the web search tool call."
+ "description": "Unique identifier for the session that looks like `sess_1234567890abcdef`."
},
"type": {
"type": "string",
"enum": [
- "web_search_call"
+ "translation"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
+ "description": "The session type. Always `translation` for Realtime translation sessions.",
"x-stainless-const": true
},
- "status": {
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Expiration timestamp for the session, in seconds since epoch."
+ },
+ "model": {
"type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
- ],
- "description": "The status of the web search tool call."
+ "description": "The Realtime translation model used for this session. This field is set at\n session creation and cannot be changed with `session.update`."
},
- "action": {
- "oneOf": [
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudio",
+ "description": "Configuration for translation input and output audio."
+ }
+ },
+ "description": "A Realtime translation session. Translation sessions continuously translate input\naudio into the configured output language.",
+ "title": "Realtime translation session",
+ "x-oaiMeta": {
+ "name": "The translation session object",
+ "group": "realtime",
+ "example": "{\n \"id\": \"sess_C9G5QPteg4UIbotdKLoYQ\",\n \"type\": \"translation\",\n \"expires_at\": 1756324625,\n \"model\": \"gpt-realtime-translate\",\n \"audio\": {\n \"input\": {\n \"transcription\": {\n \"model\": \"gpt-realtime-whisper\"\n },\n \"noise_reduction\": null\n },\n \"output\": {\n \"language\": \"es\"\n }\n }\n}\n"
+ }
+ },
+ "OpenAI.RealtimeTranslationSessionAudio": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInput"
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudioOutput"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranslationSessionAudioInput": {
+ "type": "object",
+ "properties": {
+ "transcription": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInputTranscription"
},
{
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ "type": "null"
+ }
+ ]
+ },
+ "noise_reduction": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInputNoiseReduction"
},
{
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ "type": "null"
}
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
+ ]
}
- ],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
+ }
},
- "OpenAI.KeyPressAction": {
+ "OpenAI.RealtimeTranslationSessionAudioInputNoiseReduction": {
"type": "object",
"required": [
- "type",
- "keys"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "keypress"
- ],
- "description": "Specifies the event type. For a keypress action, this property is always set to `keypress`.",
- "x-stainless-const": true
- },
- "keys": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
}
+ }
+ },
+ "OpenAI.RealtimeTranslationSessionAudioInputTranscription": {
+ "type": "object",
+ "required": [
+ "model"
],
- "description": "A collection of keypresses the model would like to perform.",
- "title": "KeyPress"
+ "properties": {
+ "model": {
+ "type": "string"
+ }
+ }
},
- "OpenAI.ListFineTuningJobCheckpointsResponse": {
+ "OpenAI.RealtimeTranslationSessionAudioOutput": {
+ "type": "object",
+ "properties": {
+ "language": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranslationSessionCreateRequest": {
"type": "object",
"required": [
- "data",
- "object",
- "has_more"
+ "model"
],
"properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpoint"
- },
- "x-ms-list-page-items": true
- },
- "object": {
+ "model": {
"type": "string",
- "enum": [
- "list"
- ],
- "x-stainless-const": true
+ "description": "The Realtime translation model used for this session."
},
- "first_id": {
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudio",
+ "description": "Configuration for translation input and output audio."
+ }
+ },
+ "description": "Realtime translation session configuration. Translation sessions stream source\naudio in and translated audio plus transcript deltas out continuously.",
+ "title": "Realtime translation session configuration"
+ },
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudio": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInput"
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioOutput"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudioInput": {
+ "type": "object",
+ "properties": {
+ "transcription": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInputTranscription"
},
{
"type": "null"
}
]
},
- "last_id": {
+ "noise_reduction": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInputNoiseReduction"
},
{
"type": "null"
}
- ],
- "x-ms-list-continuation-token": true
- },
- "has_more": {
- "type": "boolean"
+ ]
+ }
+ }
+ },
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudioInputNoiseReduction": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudioInputTranscription": {
+ "type": "object",
+ "required": [
+ "model"
+ ],
+ "properties": {
+ "model": {
+ "type": "string"
}
}
},
- "OpenAI.ListFineTuningJobEventsResponse": {
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudioOutput": {
"type": "object",
- "required": [
- "data",
- "object",
- "has_more"
- ],
"properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobEvent"
- },
- "x-ms-list-page-items": true
- },
- "object": {
+ "language": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.RealtimeTruncation": {
+ "oneOf": [
+ {
"type": "string",
"enum": [
- "list"
- ],
- "x-stainless-const": true
+ "auto",
+ "disabled"
+ ]
},
- "has_more": {
- "type": "boolean"
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "retention_ratio"
+ ],
+ "x-stainless-const": true
+ },
+ "retention_ratio": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1
+ },
+ "token_limits": {
+ "$ref": "#/components/schemas/OpenAI.TokenLimits"
+ }
+ },
+ "required": [
+ "type",
+ "retention_ratio"
+ ]
}
- }
+ ],
+ "description": "When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs.\nClients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost.\nTruncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate.\nTruncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit.",
+ "title": "Realtime Truncation Controls"
},
- "OpenAI.ListPaginatedFineTuningJobsResponse": {
+ "OpenAI.RealtimeTurnDetection": {
"type": "object",
"required": [
- "data",
- "has_more",
- "object"
+ "type"
],
"properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
- },
- "x-ms-list-page-items": true
- },
- "has_more": {
- "type": "boolean"
- },
- "object": {
- "type": "string",
- "enum": [
- "list"
- ],
- "x-stainless-const": true
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetectionType"
}
- }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "server_vad": "#/components/schemas/OpenAI.RealtimeTurnDetectionServerVad",
+ "semantic_vad": "#/components/schemas/OpenAI.RealtimeTurnDetectionSemanticVad"
+ }
+ },
+ "description": "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.\nServer 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.\nSemantic 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.\nFor `gpt-realtime-whisper` transcription sessions, turn detection must be\nset to `null`; VAD is not supported.",
+ "title": "Realtime Turn Detection"
},
- "OpenAI.LocalEnvironmentResource": {
+ "OpenAI.RealtimeTurnDetectionSemanticVad": {
"type": "object",
"required": [
"type"
@@ -41424,45 +63986,64 @@
"type": {
"type": "string",
"enum": [
- "local"
+ "semantic_vad"
+ ]
+ },
+ "eagerness": {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high",
+ "auto"
],
- "description": "The environment type. Always `local`.",
- "x-stainless-const": true
+ "default": "auto"
+ },
+ "create_response": {
+ "type": "boolean",
+ "default": true
+ },
+ "interrupt_response": {
+ "type": "boolean",
+ "default": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection"
}
- ],
- "description": "Represents the use of a local environment to perform shell actions.",
- "title": "Local Environment"
+ ]
},
- "OpenAI.LocalShellExecAction": {
+ "OpenAI.RealtimeTurnDetectionServerVad": {
"type": "object",
"required": [
- "type",
- "command",
- "env"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "exec"
- ],
- "description": "The type of the local shell action. Always `exec`.",
- "x-stainless-const": true,
- "default": "exec"
+ "server_vad"
+ ]
},
- "command": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The command to run."
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "timeout_ms": {
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "create_response": {
+ "type": "boolean",
+ "default": true
+ },
+ "interrupt_response": {
+ "type": "boolean",
+ "default": true
+ },
+ "idle_timeout_ms": {
"anyOf": [
{
"$ref": "#/components/schemas/OpenAI.integer"
@@ -41471,29 +64052,80 @@
"type": "null"
}
]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection"
+ }
+ ]
+ },
+ "OpenAI.RealtimeTurnDetectionType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "server_vad",
+ "semantic_vad"
+ ]
+ }
+ ]
+ },
+ "OpenAI.Reasoning": {
+ "type": "object",
+ "properties": {
+ "effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "working_directory": {
+ "summary": {
"anyOf": [
{
- "type": "string"
+ "type": "string",
+ "enum": [
+ "auto",
+ "concise",
+ "detailed"
+ ]
},
{
"type": "null"
}
]
},
- "env": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Environment variables to set for the command.",
- "x-oaiTypeLabel": "map"
+ "context": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "current_turn",
+ "all_turns"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "user": {
+ "generate_summary": {
"anyOf": [
{
- "type": "string"
+ "type": "string",
+ "enum": [
+ "auto",
+ "concise",
+ "detailed"
+ ]
},
{
"type": "null"
@@ -41501,115 +64133,140 @@
]
}
},
- "description": "Execute a shell command on the server.",
- "title": "Local shell exec action"
+ "description": "**gpt-5 and o-series models only**\nConfiguration options for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).",
+ "title": "Reasoning"
},
- "OpenAI.LocalShellToolParam": {
+ "OpenAI.ReasoningEffort": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "none",
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ]
+ }
+ ],
+ "description": "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\n- `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.\n- All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.\n- The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.\n- `xhigh` is supported for all models after `gpt-5.1-codex-max`."
+ },
+ "OpenAI.ReasoningTextContent": {
"type": "object",
"required": [
- "type"
+ "type",
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell"
+ "reasoning_text"
],
- "description": "The type of the local shell tool. Always `local_shell`.",
- "x-stainless-const": true
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The type of the reasoning text. Always `reasoning_text`.",
+ "x-stainless-const": true,
+ "default": "reasoning_text"
},
- "description": {
+ "text": {
"type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The reasoning text from the model."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "A tool that allows the model to execute shell commands in a local environment.",
- "title": "Local shell tool"
+ "description": "Reasoning text from the model.",
+ "title": "Reasoning text"
},
- "OpenAI.LocalSkillParam": {
+ "OpenAI.Response": {
"type": "object",
"required": [
- "name",
- "description",
- "path"
+ "id",
+ "object",
+ "created_at",
+ "error",
+ "incomplete_details",
+ "output",
+ "instructions",
+ "parallel_tool_calls",
+ "agent_reference"
],
"properties": {
- "name": {
- "type": "string",
- "description": "The name of the skill."
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "description": {
+ "top_logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "user": {
"type": "string",
- "description": "The description of the skill."
+ "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
+ "deprecated": true
},
- "path": {
+ "safety_identifier": {
"type": "string",
- "description": "The path to the directory containing the skill."
- }
- }
- },
- "OpenAI.LogProb": {
- "type": "object",
- "required": [
- "token",
- "logprob",
- "bytes",
- "top_logprobs"
- ],
- "properties": {
- "token": {
- "type": "string"
+ "maxLength": 64,
+ "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
},
- "logprob": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "prompt_cache_key": {
+ "type": "string",
+ "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
},
- "bytes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
+ "service_tier": {
+ "$ref": "#/components/schemas/OpenAI.ServiceTier"
},
- "top_logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.TopLogProb"
- }
- }
- },
- "description": "The log probability of a token.",
- "title": "Log probability"
- },
- "OpenAI.MCPListToolsTool": {
- "type": "object",
- "required": [
- "name",
- "input_schema"
- ],
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the tool."
+ "prompt_cache_retention": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "in_memory",
+ "24h"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "description": {
+ "previous_response_id": {
"anyOf": [
{
"type": "string"
@@ -41619,3255 +64276,2308 @@
}
]
},
- "input_schema": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsToolInputSchema",
- "description": "The JSON schema describing the tool's input."
+ "model": {
+ "type": "string",
+ "description": "The model deployment to use for the creation of this response."
},
- "annotations": {
+ "background": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.MCPListToolsToolAnnotations"
+ "type": "boolean"
},
{
"type": "null"
}
]
- }
- },
- "description": "A tool available on an MCP server.",
- "title": "MCP list tools tool"
- },
- "OpenAI.MCPListToolsToolAnnotations": {
- "type": "object"
- },
- "OpenAI.MCPListToolsToolInputSchema": {
- "type": "object"
- },
- "OpenAI.MCPTool": {
- "type": "object",
- "required": [
- "type",
- "server_label"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp"
- ],
- "description": "The type of the MCP tool. Always `mcp`.",
- "x-stainless-const": true
},
- "server_label": {
- "type": "string",
- "description": "A label for this MCP server, used to identify it in tool calls."
+ "max_tool_calls": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "server_url": {
- "type": "string",
- "format": "uri",
- "description": "The URL for the MCP server. One of `server_url`, `connector_id`, or\n `tunnel_id` must be provided."
+ "text": {
+ "$ref": "#/components/schemas/OpenAI.ResponseTextParam"
},
- "connector_id": {
- "type": "string",
- "enum": [
- "connector_dropbox",
- "connector_gmail",
- "connector_googlecalendar",
- "connector_googledrive",
- "connector_microsoftteams",
- "connector_outlookcalendar",
- "connector_outlookemail",
- "connector_sharepoint"
+ "tools": {
+ "$ref": "#/components/schemas/OpenAI.ToolsArray"
+ },
+ "tool_choice": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ }
+ ]
+ },
+ "prompt": {
+ "$ref": "#/components/schemas/OpenAI.Prompt"
+ },
+ "truncation": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "disabled"
+ ]
+ },
+ {
+ "type": "null"
+ }
],
- "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more\n about service connectors [here](/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`"
+ "default": "disabled"
},
- "tunnel_id": {
+ "id": {
"type": "string",
- "pattern": "^tunnel_[a-z0-9]{32}$",
- "description": "The Secure MCP Tunnel ID to use instead of a direct server URL. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided."
+ "description": "Unique identifier for this Response."
},
- "authorization": {
+ "object": {
"type": "string",
- "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here."
+ "enum": [
+ "response"
+ ],
+ "description": "The object type of this resource - always set to `response`.",
+ "x-stainless-const": true
},
- "server_description": {
+ "status": {
"type": "string",
- "description": "Optional description of the MCP server, used to provide more context."
+ "enum": [
+ "completed",
+ "failed",
+ "in_progress",
+ "cancelled",
+ "queued",
+ "incomplete"
+ ],
+ "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`."
},
- "headers": {
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) of when this Response was created."
+ },
+ "completed_at": {
"anyOf": [
{
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- }
+ "type": "string",
+ "format": "date-time"
},
{
"type": "null"
}
- ]
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
},
- "allowed_tools": {
+ "error": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ "$ref": "#/components/schemas/OpenAI.ResponseError"
},
{
"type": "null"
}
]
},
- "require_approval": {
+ "incomplete_details": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
- },
- {
- "type": "string",
- "enum": [
- "always",
- "never"
- ]
+ "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails"
},
{
"type": "null"
}
- ],
- "default": "always"
- },
- "defer_loading": {
- "type": "boolean",
- "description": "Whether this MCP tool is deferred and discovered via tool search."
- },
- "project_connection_id": {
- "type": "string",
- "description": "The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server."
+ ]
},
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "Give the model access to additional tools via remote Model Context Protocol\n(MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).",
- "title": "MCP tool"
- },
- "OpenAI.MCPToolCallStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "calling",
- "failed"
- ]
- },
- "OpenAI.MCPToolFilter": {
- "type": "object",
- "properties": {
- "tool_names": {
+ "output": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
},
- "description": "List of allowed tool names.",
- "title": "MCP allowed tools"
- },
- "read_only": {
- "type": "boolean",
- "description": "Indicates whether or not a tool modifies data or is read-only. If an\n MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),\n it will match this filter."
- }
- },
- "description": "A filter object to specify which tools are allowed.",
- "title": "MCP tool filter"
- },
- "OpenAI.MCPToolRequireApproval": {
- "type": "object",
- "properties": {
- "always": {
- "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs."
},
- "never": {
- "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
- }
- }
- },
- "OpenAI.MessageContent": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.MessageContentType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "text": "#/components/schemas/OpenAI.TextContent",
- "computer_screenshot": "#/components/schemas/OpenAI.ComputerScreenshotContent",
- "input_text": "#/components/schemas/OpenAI.MessageContentInputTextContent",
- "output_text": "#/components/schemas/OpenAI.MessageContentOutputTextContent",
- "reasoning_text": "#/components/schemas/OpenAI.MessageContentReasoningTextContent",
- "refusal": "#/components/schemas/OpenAI.MessageContentRefusalContent",
- "input_image": "#/components/schemas/OpenAI.MessageContentInputImageContent",
- "input_file": "#/components/schemas/OpenAI.MessageContentInputFileContent",
- "summary_text": "#/components/schemas/OpenAI.SummaryTextContent"
- }
- },
- "description": "A content part that makes up an input or output item."
- },
- "OpenAI.MessageContentInputFileContent": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "input_file"
- ],
- "description": "The type of the input item. Always `input_file`.",
- "x-stainless-const": true,
- "default": "input_file"
+ "reasoning": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Reasoning"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "file_id": {
+ "instructions": {
"anyOf": [
{
"type": "string"
},
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ },
{
"type": "null"
}
]
},
- "filename": {
- "type": "string",
- "description": "The name of the file to be sent to the model."
+ "output_text": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "file_data": {
- "type": "string",
- "description": "The content of the file to be sent to the model."
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsage"
},
- "file_url": {
- "type": "string",
- "format": "uri",
- "description": "The URL of the file to be sent to the model."
+ "moderation": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Moderation"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- }
- ],
- "description": "A file input to the model.",
- "title": "Input file"
- },
- "OpenAI.MessageContentInputImageContent": {
- "type": "object",
- "required": [
- "type",
- "detail"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "input_image"
- ],
- "description": "The type of the input item. Always `input_image`.",
- "x-stainless-const": true,
- "default": "input_image"
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether to allow the model to run tool calls in parallel.",
+ "default": true
},
- "image_url": {
+ "conversation": {
"anyOf": [
{
- "type": "string",
- "format": "uri"
+ "$ref": "#/components/schemas/OpenAI.ConversationReference"
},
{
"type": "null"
}
]
},
- "file_id": {
+ "max_output_tokens": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
]
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- }
- ],
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
- "title": "Input image"
- },
- "OpenAI.MessageContentInputTextContent": {
- "type": "object",
- "required": [
- "type",
- "text"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "input_text"
- ],
- "description": "The type of the input item. Always `input_text`.",
- "x-stainless-const": true,
- "default": "input_text"
- },
- "text": {
- "type": "string",
- "description": "The text input to the model."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- }
- ],
- "description": "A text input to the model.",
- "title": "Input text"
- },
- "OpenAI.MessageContentOutputTextContent": {
- "type": "object",
- "required": [
- "type",
- "text",
- "annotations",
- "logprobs"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "output_text"
+ "agent_reference": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/AgentReference"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of the output text. Always `output_text`.",
- "x-stainless-const": true,
- "default": "output_text"
- },
- "text": {
- "type": "string",
- "description": "The text output from the model."
+ "description": "The agent used for this response"
},
- "annotations": {
+ "content_filters": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.Annotation"
+ "$ref": "#/components/schemas/ContentFilterResult"
},
- "description": "The annotations of the text output."
- },
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.LogProb"
- }
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- }
- ],
- "description": "A text output from the model.",
- "title": "Output text"
- },
- "OpenAI.MessageContentReasoningTextContent": {
- "type": "object",
- "required": [
- "type",
- "text"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "reasoning_text"
- ],
- "description": "The type of the reasoning text. Always `reasoning_text`.",
- "x-stainless-const": true,
- "default": "reasoning_text"
- },
- "text": {
- "type": "string",
- "description": "The reasoning text from the model."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- }
- ],
- "description": "Reasoning text from the model.",
- "title": "Reasoning text"
- },
- "OpenAI.MessageContentRefusalContent": {
- "type": "object",
- "required": [
- "type",
- "refusal"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "refusal"
- ],
- "description": "The type of the refusal. Always `refusal`.",
- "x-stainless-const": true,
- "default": "refusal"
- },
- "refusal": {
- "type": "string",
- "description": "The refusal explanation from the model."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- }
- ],
- "description": "A refusal from the model.",
- "title": "Refusal"
- },
- "OpenAI.MessageContentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "input_text",
- "output_text",
- "text",
- "summary_text",
- "reasoning_text",
- "refusal",
- "input_image",
- "computer_screenshot",
- "input_file"
- ]
- }
- ]
- },
- "OpenAI.MessagePhase": {
- "type": "string",
- "enum": [
- "commentary",
- "final_answer"
- ],
- "description": "Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).\nFor models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend\nphase on all assistant messages — dropping it can degrade performance. Not used for user messages."
- },
- "OpenAI.MessageRole": {
- "type": "string",
- "enum": [
- "unknown",
- "user",
- "assistant",
- "system",
- "critic",
- "discriminator",
- "developer",
- "tool"
- ]
- },
- "OpenAI.MessageStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- "OpenAI.Metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
- },
- "OpenAI.ModelIdsCompaction": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ModelIdsResponses"
- },
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "description": "Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/docs/models) to browse and compare available models."
- },
- "OpenAI.ModelIdsResponses": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ModelIdsShared"
- },
- {
- "type": "string",
- "enum": [
- "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",
- "gpt-5-codex",
- "gpt-5-pro",
- "gpt-5-pro-2025-10-06",
- "gpt-5.1-codex-max"
- ]
- }
- ]
- },
- "OpenAI.ModelIdsShared": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ChatModel"
- }
- ]
- },
- "OpenAI.Moderation": {
- "type": "object",
- "required": [
- "input",
- "output"
- ],
- "properties": {
- "input": {
- "$ref": "#/components/schemas/OpenAI.ModerationEntry",
- "description": "Moderation for the response input."
- },
- "output": {
- "$ref": "#/components/schemas/OpenAI.ModerationEntry",
- "description": "Moderation for the response output."
- }
- },
- "description": "Moderation results or errors for the response input and output.",
- "title": "Moderation"
- },
- "OpenAI.ModerationEntry": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ModerationEntryType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "moderation_result": "#/components/schemas/OpenAI.ModerationResultBody",
- "error": "#/components/schemas/OpenAI.ModerationErrorBody"
- }
- },
- "description": "Moderation results or an error for a response moderation check."
- },
- "OpenAI.ModerationEntryType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "moderation_result",
- "error"
- ]
+ "description": "The content filter evaluation results."
}
- ]
+ },
+ "title": "The response object"
},
- "OpenAI.ModerationErrorBody": {
+ "OpenAI.ResponseAudioDeltaEvent": {
"type": "object",
"required": [
"type",
- "code",
- "message"
+ "sequence_number",
+ "delta"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "error"
+ "response.audio.delta"
],
- "description": "The object type, which was always `error` for moderation failures.",
+ "description": "The type of the event. Always `response.audio.delta`.",
"x-stainless-const": true
},
- "code": {
- "type": "string",
- "description": "The error code."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "A sequence number for this chunk of the stream response."
},
- "message": {
+ "delta": {
"type": "string",
- "description": "The error message."
+ "contentEncoding": "base64",
+ "description": "A chunk of Base64 encoded response audio bytes."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ModerationEntry"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "An error produced while attempting moderation for the response input or output.",
- "title": "Moderation error"
- },
- "OpenAI.ModerationInputType": {
- "type": "string",
- "enum": [
- "text",
- "image"
- ]
+ "description": "Emitted when there is a partial audio response.",
+ "x-oaiMeta": {
+ "name": "response.audio.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.audio.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \"base64encoded...\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.ModerationParam": {
+ "OpenAI.ResponseAudioDoneEvent": {
"type": "object",
"required": [
- "model"
+ "type",
+ "sequence_number"
],
"properties": {
- "model": {
+ "type": {
"type": "string",
- "description": "The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'."
+ "enum": [
+ "response.audio.done"
+ ],
+ "description": "The type of the event. Always `response.audio.done`.",
+ "x-stainless-const": true
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the delta."
}
},
- "description": "Configuration for running moderation on the input and output of this response."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when the audio response is complete.",
+ "x-oaiMeta": {
+ "name": "response.audio.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.audio.done\",\n \"response_id\": \"resp-123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.ModerationResultBody": {
+ "OpenAI.ResponseAudioTranscriptDeltaEvent": {
"type": "object",
"required": [
"type",
- "model",
- "flagged",
- "categories",
- "category_scores",
- "category_applied_input_types"
+ "delta",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "moderation_result"
+ "response.audio.transcript.delta"
],
- "description": "The object type, which was always `moderation_result` for successful moderation results.",
+ "description": "The type of the event. Always `response.audio.transcript.delta`.",
"x-stainless-const": true
},
- "model": {
+ "delta": {
"type": "string",
- "description": "The moderation model that produced this result."
- },
- "flagged": {
- "type": "boolean",
- "description": "A boolean indicating whether the content was flagged by any category."
- },
- "categories": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "boolean"
- },
- "description": "A dictionary of moderation categories to booleans, True if the input is flagged under this category.",
- "x-oaiTypeLabel": "map"
- },
- "category_scores": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "description": "A dictionary of moderation categories to scores.",
- "x-oaiTypeLabel": "map"
+ "description": "The partial transcript of the audio response."
},
- "category_applied_input_types": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ModerationInputType"
- }
- },
- "description": "Which modalities of input are reflected by the score for each category.",
- "x-oaiTypeLabel": "map"
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ModerationEntry"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A moderation result produced for the response input or output.",
- "title": "Moderation result"
+ "description": "Emitted when there is a partial transcript of audio.",
+ "x-oaiMeta": {
+ "name": "response.audio.transcript.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.audio.transcript.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \" ... partial transcript ... \",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.MoveParam": {
+ "OpenAI.ResponseAudioTranscriptDoneEvent": {
"type": "object",
"required": [
"type",
- "x",
- "y"
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "move"
+ "response.audio.transcript.done"
],
- "description": "Specifies the event type. For a move action, this property is always set to `move`.",
+ "description": "The type of the event. Always `response.audio.transcript.done`.",
"x-stainless-const": true
},
- "x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate to move to."
- },
- "y": {
+ "sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate to move to."
- },
- "keys": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A mouse move action.",
- "title": "Move"
+ "description": "Emitted when the full audio transcript is completed.",
+ "x-oaiMeta": {
+ "name": "response.audio.transcript.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.audio.transcript.done\",\n \"response_id\": \"resp_123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.NamespaceToolParam": {
+ "OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent": {
"type": "object",
"required": [
"type",
- "name",
- "description",
- "tools"
+ "output_index",
+ "item_id",
+ "delta",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "namespace"
+ "response.code_interpreter_call_code.delta"
],
- "description": "The type of the tool. Always `namespace`.",
+ "description": "The type of the event. Always `response.code_interpreter_call_code.delta`.",
"x-stainless-const": true
},
- "name": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code is being streamed."
+ },
+ "item_id": {
"type": "string",
- "minLength": 1,
- "description": "The namespace name used in tool calls (for example, `crm`)."
+ "description": "The unique identifier of the code interpreter tool call item."
},
- "description": {
+ "delta": {
"type": "string",
- "minLength": 1,
- "description": "A description of the namespace shown to the model."
+ "description": "The partial code snippet being streamed by the code interpreter."
},
- "tools": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionToolParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CustomToolParam"
- }
- ]
- },
- "minItems": 1,
- "description": "The function/custom tools available inside this namespace."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Groups function/custom tools under a shared namespace.",
- "title": "Namespace"
- },
- "OpenAI.OutputContent": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.OutputContentType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "output_text": "#/components/schemas/OpenAI.OutputContentOutputTextContent",
- "refusal": "#/components/schemas/OpenAI.OutputContentRefusalContent",
- "reasoning_text": "#/components/schemas/OpenAI.OutputContentReasoningTextContent"
- }
+ "description": "Emitted when a partial code snippet is streamed by the code interpreter.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call_code.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call_code.delta\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"delta\": \"print('Hello, world')\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.OutputContentOutputTextContent": {
+ "OpenAI.ResponseCodeInterpreterCallCodeDoneEvent": {
"type": "object",
"required": [
"type",
- "text",
- "annotations",
- "logprobs"
+ "output_index",
+ "item_id",
+ "code",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "output_text"
+ "response.code_interpreter_call_code.done"
],
- "description": "The type of the output text. Always `output_text`.",
- "x-stainless-const": true,
- "default": "output_text"
+ "description": "The type of the event. Always `response.code_interpreter_call_code.done`.",
+ "x-stainless-const": true
},
- "text": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code is finalized."
+ },
+ "item_id": {
"type": "string",
- "description": "The text output from the model."
+ "description": "The unique identifier of the code interpreter tool call item."
},
- "annotations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Annotation"
- },
- "description": "The annotations of the text output."
+ "code": {
+ "type": "string",
+ "description": "The final code snippet output by the code interpreter."
},
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.LogProb"
- }
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputContent"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A text output from the model.",
- "title": "Output text"
+ "description": "Emitted when the code snippet is finalized by the code interpreter.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call_code.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call_code.done\",\n \"output_index\": 3,\n \"item_id\": \"ci_12345\",\n \"code\": \"print('done')\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputContentReasoningTextContent": {
+ "OpenAI.ResponseCodeInterpreterCallCompletedEvent": {
"type": "object",
"required": [
"type",
- "text"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "reasoning_text"
+ "response.code_interpreter_call.completed"
],
- "description": "The type of the reasoning text. Always `reasoning_text`.",
- "x-stainless-const": true,
- "default": "reasoning_text"
+ "description": "The type of the event. Always `response.code_interpreter_call.completed`.",
+ "x-stainless-const": true
},
- "text": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code interpreter call is completed."
+ },
+ "item_id": {
"type": "string",
- "description": "The reasoning text from the model."
+ "description": "The unique identifier of the code interpreter tool call item."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputContent"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Reasoning text from the model.",
- "title": "Reasoning text"
+ "description": "Emitted when the code interpreter call is completed.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call.completed\",\n \"output_index\": 5,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputContentRefusalContent": {
+ "OpenAI.ResponseCodeInterpreterCallInProgressEvent": {
"type": "object",
"required": [
"type",
- "refusal"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "refusal"
+ "response.code_interpreter_call.in_progress"
],
- "description": "The type of the refusal. Always `refusal`.",
- "x-stainless-const": true,
- "default": "refusal"
+ "description": "The type of the event. Always `response.code_interpreter_call.in_progress`.",
+ "x-stainless-const": true
},
- "refusal": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code interpreter call is in progress."
+ },
+ "item_id": {
"type": "string",
- "description": "The refusal explanation from the model."
+ "description": "The unique identifier of the code interpreter tool call item."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputContent"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A refusal from the model.",
- "title": "Refusal"
- },
- "OpenAI.OutputContentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "output_text",
- "refusal",
- "reasoning_text"
- ]
- }
- ]
+ "description": "Emitted when a code interpreter call is in progress.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItem": {
+ "OpenAI.ResponseCodeInterpreterCallInterpretingEvent": {
"type": "object",
"required": [
- "type"
+ "type",
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.OutputItemType"
+ "type": "string",
+ "enum": [
+ "response.code_interpreter_call.interpreting"
+ ],
+ "description": "The type of the event. Always `response.code_interpreter_call.interpreting`.",
+ "x-stainless-const": true
},
- "agent_reference": {
- "$ref": "#/components/schemas/AgentReference",
- "description": "The agent that created the item."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code interpreter is interpreting code."
},
- "response_id": {
+ "item_id": {
"type": "string",
- "description": "The response on which the item is created."
+ "description": "The unique identifier of the code interpreter tool call item."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "structured_outputs": "#/components/schemas/StructuredOutputsOutputItem",
- "workflow_action": "#/components/schemas/WorkflowActionOutputItem",
- "oauth_consent_request": "#/components/schemas/OAuthConsentRequestOutputItem",
- "bing_grounding_call": "#/components/schemas/BingGroundingToolCall",
- "bing_grounding_call_output": "#/components/schemas/BingGroundingToolCallOutput",
- "sharepoint_grounding_preview_call": "#/components/schemas/SharepointGroundingToolCall",
- "sharepoint_grounding_preview_call_output": "#/components/schemas/SharepointGroundingToolCallOutput",
- "azure_ai_search_call": "#/components/schemas/AzureAISearchToolCall",
- "azure_ai_search_call_output": "#/components/schemas/AzureAISearchToolCallOutput",
- "bing_custom_search_preview_call": "#/components/schemas/BingCustomSearchToolCall",
- "bing_custom_search_preview_call_output": "#/components/schemas/BingCustomSearchToolCallOutput",
- "openapi_call": "#/components/schemas/OpenApiToolCall",
- "openapi_call_output": "#/components/schemas/OpenApiToolCallOutput",
- "browser_automation_preview_call": "#/components/schemas/BrowserAutomationToolCall",
- "browser_automation_preview_call_output": "#/components/schemas/BrowserAutomationToolCallOutput",
- "fabric_dataagent_preview_call": "#/components/schemas/FabricDataAgentToolCall",
- "fabric_dataagent_preview_call_output": "#/components/schemas/FabricDataAgentToolCallOutput",
- "azure_function_call": "#/components/schemas/AzureFunctionToolCall",
- "azure_function_call_output": "#/components/schemas/AzureFunctionToolCallOutput",
- "a2a_preview_call": "#/components/schemas/A2AToolCall",
- "a2a_preview_call_output": "#/components/schemas/A2AToolCallOutput",
- "memory_search_call": "#/components/schemas/MemorySearchToolCall",
- "memory_command_preview_call": "#/components/schemas/MemoryCommandToolCall",
- "memory_command_preview_call_output": "#/components/schemas/MemoryCommandToolCallOutput",
- "output_message": "#/components/schemas/OpenAI.OutputItemOutputMessage",
- "file_search_call": "#/components/schemas/OpenAI.OutputItemFileSearchToolCall",
- "function_call": "#/components/schemas/OpenAI.OutputItemFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.OutputItemFunctionToolCallOutput",
- "web_search_call": "#/components/schemas/OpenAI.OutputItemWebSearchToolCall",
- "computer_call": "#/components/schemas/OpenAI.OutputItemComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.OutputItemComputerToolCallOutput",
- "reasoning": "#/components/schemas/OpenAI.OutputItemReasoningItem",
- "tool_search_call": "#/components/schemas/OpenAI.OutputItemToolSearchCall",
- "tool_search_output": "#/components/schemas/OpenAI.OutputItemToolSearchOutput",
- "additional_tools": "#/components/schemas/OpenAI.OutputItemAdditionalTools",
- "compaction": "#/components/schemas/OpenAI.OutputItemCompactionBody",
- "image_generation_call": "#/components/schemas/OpenAI.OutputItemImageGenToolCall",
- "code_interpreter_call": "#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.OutputItemLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.OutputItemLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.OutputItemFunctionShellCall",
- "shell_call_output": "#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput",
- "apply_patch_call": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCall",
- "apply_patch_call_output": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput",
- "mcp_call": "#/components/schemas/OpenAI.OutputItemMcpToolCall",
- "mcp_list_tools": "#/components/schemas/OpenAI.OutputItemMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.OutputItemMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.OutputItemMcpApprovalResponseResource",
- "custom_tool_call": "#/components/schemas/OpenAI.OutputItemCustomToolCallResource",
- "custom_tool_call_output": "#/components/schemas/OpenAI.OutputItemCustomToolCallOutputResource"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
+ ],
+ "description": "Emitted when the code interpreter is actively interpreting the code snippet.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call.interpreting",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call.interpreting\",\n \"output_index\": 4,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.OutputItemAdditionalTools": {
+ "OpenAI.ResponseCompletedEvent": {
"type": "object",
"required": [
"type",
- "id",
- "role",
- "tools"
+ "response",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "additional_tools"
+ "response.completed"
],
- "description": "The type of the item. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the additional tools item."
+ "description": "The type of the event. Always `response.completed`.",
+ "x-stainless-const": true
},
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role that provided the additional tools."
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "Properties of the completed response."
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The additional tool definitions made available at this item."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number for this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
- ]
+ ],
+ "description": "Emitted when the model response is complete.",
+ "x-oaiMeta": {
+ "name": "response.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.completed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"completed\",\n \"completed_at\": 1740855870,\n \"error\": null,\n \"incomplete_details\": null,\n \"input\": [],\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [\n {\n \"id\": \"msg_123\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 0,\n \"output_tokens\": 0,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 0\n },\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemApplyPatchToolCall": {
+ "OpenAI.ResponseContentPartAddedEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "operation"
+ "item_id",
+ "output_index",
+ "content_index",
+ "part",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call"
+ "response.content_part.added"
],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
+ "description": "The type of the event. Always `response.content_part.added`.",
+ "x-stainless-const": true
},
- "id": {
+ "item_id": {
"type": "string",
- "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
+ "description": "The ID of the output item that the content part was added to."
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the content part was added to."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that was added."
},
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
- "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
- "title": "Apply patch operation"
+ "part": {
+ "$ref": "#/components/schemas/OpenAI.OutputContent",
+ "description": "The content part that was added."
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
- "title": "Apply patch tool call"
+ "description": "Emitted when a new content part is added.",
+ "x-oaiMeta": {
+ "name": "response.content_part.added",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.content_part.added\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"\",\n \"annotations\": []\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemApplyPatchToolCallOutput": {
+ "OpenAI.ResponseContentPartDoneEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status"
+ "item_id",
+ "output_index",
+ "content_index",
+ "sequence_number",
+ "part"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call_output"
+ "response.content_part.done"
],
- "description": "The type of the item. Always `apply_patch_call_output`.",
- "x-stainless-const": true,
- "default": "apply_patch_call_output"
+ "description": "The type of the event. Always `response.content_part.done`.",
+ "x-stainless-const": true
},
- "id": {
+ "item_id": {
"type": "string",
- "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
+ "description": "The ID of the output item that the content part was added to."
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the content part was added to."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that is done."
},
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call output."
+ "part": {
+ "$ref": "#/components/schemas/OpenAI.OutputContent",
+ "description": "The content part that is done."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
+ "description": "Emitted when a content part is done.",
+ "x-oaiMeta": {
+ "name": "response.content_part.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.content_part.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"sequence_number\": 1,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n}\n"
+ }
},
- "OpenAI.OutputItemCodeInterpreterToolCall": {
+ "OpenAI.ResponseCreatedEvent": {
"type": "object",
"required": [
"type",
- "id",
- "status",
- "container_id",
- "code",
- "outputs"
+ "response",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "code_interpreter_call"
- ],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
- "x-stainless-const": true,
- "default": "code_interpreter_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the code interpreter tool call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
+ "response.created"
],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
- },
- "container_id": {
- "type": "string",
- "description": "The ID of the container used to run the code."
+ "description": "The type of the event. Always `response.created`.",
+ "x-stainless-const": true
},
- "code": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The response that was created."
},
- "outputs": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number for this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
+ "description": "An event that is emitted when a response is created.",
+ "x-oaiMeta": {
+ "name": "response.created",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.created\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemCompactionBody": {
+ "OpenAI.ResponseCustomToolCallInputDeltaEvent": {
"type": "object",
"required": [
"type",
- "id",
- "encrypted_content"
+ "sequence_number",
+ "output_index",
+ "item_id",
+ "delta"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "compaction"
+ "response.custom_tool_call_input.delta"
],
- "description": "The type of the item. Always `compaction`.",
- "x-stainless-const": true,
- "default": "compaction"
+ "description": "The event type identifier.",
+ "x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the compaction item."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "encrypted_content": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output this delta applies to."
+ },
+ "item_id": {
"type": "string",
- "description": "The encrypted content that was produced by compaction."
+ "description": "Unique identifier for the API item associated with this event."
},
- "created_by": {
+ "delta": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "The incremental input data (delta) for the custom tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
+ "description": "Event representing a delta (partial update) to the input of a custom tool call.",
+ "title": "ResponseCustomToolCallInputDelta",
+ "x-oaiMeta": {
+ "name": "response.custom_tool_call_input.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.custom_tool_call_input.delta\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"delta\": \"partial input text\"\n}\n"
+ }
},
- "OpenAI.OutputItemComputerToolCall": {
+ "OpenAI.ResponseCustomToolCallInputDoneEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "pending_safety_checks",
- "status"
+ "sequence_number",
+ "output_index",
+ "item_id",
+ "input"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_call"
+ "response.custom_tool_call_input.done"
],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the computer call."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used when responding to the tool call with output."
+ "description": "The event type identifier.",
+ "x-stainless-const": true
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output this event applies to."
},
- "pending_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The pending safety checks for the computer call."
+ "item_id": {
+ "type": "string",
+ "description": "Unique identifier for the API item associated with this event."
},
- "status": {
+ "input": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The complete input data for the custom tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
+ "description": "Event indicating that input for a custom tool call is complete.",
+ "title": "ResponseCustomToolCallInputDone",
+ "x-oaiMeta": {
+ "name": "response.custom_tool_call_input.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.custom_tool_call_input.done\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"input\": \"final complete input text\"\n}\n"
+ }
},
- "OpenAI.OutputItemComputerToolCallOutput": {
+ "OpenAI.ResponseError": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "output"
+ "code",
+ "message"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_call_output"
- ],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
- "x-stainless-const": true,
- "default": "computer_call_output"
- },
- "id": {
- "type": "string",
- "description": "The ID of the computer tool call output.",
- "readOnly": true
- },
- "call_id": {
- "type": "string",
- "description": "The ID of the computer tool call that produced the output."
- },
- "acknowledged_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
- },
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "code": {
+ "$ref": "#/components/schemas/OpenAI.ResponseErrorCode"
},
- "status": {
+ "message": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ "description": "A human-readable description of the error."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
+ "description": "An error object returned when the model fails to generate a Response."
+ },
+ "OpenAI.ResponseErrorCode": {
+ "type": "string",
+ "enum": [
+ "server_error",
+ "rate_limit_exceeded",
+ "invalid_prompt",
+ "vector_store_timeout",
+ "invalid_image",
+ "invalid_image_format",
+ "invalid_base64_image",
+ "invalid_image_url",
+ "image_too_large",
+ "image_too_small",
+ "image_parse_error",
+ "image_content_policy_violation",
+ "invalid_image_mode",
+ "image_file_too_large",
+ "unsupported_image_media_type",
+ "empty_image_file",
+ "failed_to_download_image",
+ "image_file_not_found"
],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ "description": "The error code for the response."
},
- "OpenAI.OutputItemCustomToolCallOutputResource": {
+ "OpenAI.ResponseErrorEvent": {
"type": "object",
"required": [
"type",
- "call_id",
- "output",
- "status"
+ "code",
+ "message",
+ "param",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call_output"
+ "error"
],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "description": "The type of the event. Always `error`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "call_id": {
+ "message": {
"type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ "description": "The error message."
},
- "output": {
- "oneOf": [
+ "param": {
+ "anyOf": [
{
"type": "string"
},
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
+ "type": "null"
}
- ],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ ]
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "ResponseCustomToolCallOutputItem"
+ "description": "Emitted when an error occurs.",
+ "x-oaiMeta": {
+ "name": "error",
+ "group": "responses",
+ "example": "{\n \"type\": \"error\",\n \"code\": \"ERR_SOMETHING\",\n \"message\": \"Something went wrong\",\n \"param\": null,\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemCustomToolCallResource": {
+ "OpenAI.ResponseFailedEvent": {
"type": "object",
"required": [
"type",
- "call_id",
- "name",
- "input",
- "status"
+ "sequence_number",
+ "response"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call"
+ "response.failed"
],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "description": "The type of the event. Always `response.failed`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "namespace": {
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The response that failed."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "An event that is emitted when a response fails.",
+ "x-oaiMeta": {
+ "name": "response.failed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.failed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"failed\",\n \"completed_at\": null,\n \"error\": {\n \"code\": \"server_error\",\n \"message\": \"The model failed to generate a response.\"\n },\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n }\n}\n"
+ }
+ },
+ "OpenAI.ResponseFileSearchCallCompletedEvent": {
+ "type": "object",
+ "required": [
+ "type",
+ "output_index",
+ "item_id",
+ "sequence_number"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The namespace of the custom tool being called."
+ "enum": [
+ "response.file_search_call.completed"
+ ],
+ "description": "The type of the event. Always `response.file_search_call.completed`.",
+ "x-stainless-const": true
},
- "name": {
- "type": "string",
- "description": "The name of the custom tool being called."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the file search call is initiated."
},
- "input": {
+ "item_id": {
"type": "string",
- "description": "The input for the custom tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The ID of the output item that the file search call is initiated."
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "ResponseCustomToolCallItem"
+ "description": "Emitted when a file search call is completed (results found).",
+ "x-oaiMeta": {
+ "name": "response.file_search_call.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.file_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemFileSearchToolCall": {
+ "OpenAI.ResponseFileSearchCallInProgressEvent": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "queries"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the file search tool call."
- },
"type": {
"type": "string",
"enum": [
- "file_search_call"
+ "response.file_search_call.in_progress"
],
- "description": "The type of the file search tool call. Always `file_search_call`.",
+ "description": "The type of the event. Always `response.file_search_call.in_progress`.",
"x-stainless-const": true
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "incomplete",
- "failed"
- ],
- "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the file search call is initiated."
},
- "queries": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The queries used to search for files."
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the output item that the file search call is initiated."
},
- "results": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
- }
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
- "title": "File search tool call"
+ "description": "Emitted when a file search call is initiated.",
+ "x-oaiMeta": {
+ "name": "response.file_search_call.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.file_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemFunctionShellCall": {
+ "OpenAI.ResponseFileSearchCallSearchingEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "action",
- "status",
- "environment"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call"
+ "response.file_search_call.searching"
],
- "description": "The type of the item. Always `shell_call`.",
- "x-stainless-const": true,
- "default": "shell_call"
+ "description": "The type of the event. Always `response.file_search_call.searching`.",
+ "x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the file search call is searching."
},
- "call_id": {
+ "item_id": {
"type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
- "description": "The shell commands and limits that describe how to run the tool call."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
- "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
- },
- "environment": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The ID of the output item that the file search call is initiated."
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call that executes one or more shell commands in a managed environment.",
- "title": "Shell tool call"
+ "description": "Emitted when a file search is currently searching.",
+ "x-oaiMeta": {
+ "name": "response.file_search_call.searching",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.file_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemFunctionShellCallOutput": {
+ "OpenAI.ResponseFormatJsonObject": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "status",
- "output",
- "max_output_length"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call_output"
+ "json_object"
],
- "description": "The type of the shell call output. Always `shell_call_output`.",
- "x-stainless-const": true,
- "default": "shell_call_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell call output. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
- "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
- },
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
- },
- "description": "An array of shell call output contents"
- },
- "max_output_length": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "The type of response format being defined. Always `json_object`.",
+ "x-stainless-const": true
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "The output of a shell tool call that was emitted.",
- "title": "Shell call output"
+ "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
+ "title": "JSON object"
},
- "OpenAI.OutputItemFunctionToolCall": {
+ "OpenAI.ResponseFormatJsonSchema": {
"type": "object",
"required": [
- "id",
"type",
- "call_id",
- "name",
- "arguments"
+ "json_schema"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call"
+ "json_schema"
],
- "description": "The type of the function tool call. Always `function_call`.",
+ "description": "The type of response format being defined. Always `json_schema`.",
"x-stainless-const": true
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the function to run."
- },
- "name": {
- "type": "string",
- "description": "The name of the function to run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the function."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "json_schema": {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema",
+ "description": "Structured Outputs configuration options, including a JSON Schema.",
+ "title": "JSON schema"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
}
],
- "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
- "title": "Function tool call"
+ "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).",
+ "title": "JSON schema"
},
- "OpenAI.OutputItemFunctionToolCallOutput": {
+ "OpenAI.ResponseFormatJsonSchemaJsonSchema": {
"type": "object",
"required": [
- "id",
- "type",
- "call_id",
- "output"
+ "name"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
- "readOnly": true
+ "description": {
+ "type": "string"
},
- "type": {
- "type": "string",
- "enum": [
- "function_call_output"
- ],
- "description": "The type of the function tool call output. Always `function_call_output`.",
- "x-stainless-const": true
+ "name": {
+ "type": "string"
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema"
},
- "output": {
- "oneOf": [
+ "strict": {
+ "anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
+ "type": "null"
}
- ],
- "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
- },
- "status": {
+ ]
+ }
+ }
+ },
+ "OpenAI.ResponseFormatJsonSchemaSchema": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).",
+ "title": "JSON schema"
+ },
+ "OpenAI.ResponseFormatText": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete"
+ "text"
],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The type of response format being defined. Always `text`.",
+ "x-stainless-const": true
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
+ "description": "Default response format. Used to generate text responses.",
+ "title": "Text"
},
- "OpenAI.OutputItemImageGenToolCall": {
+ "OpenAI.ResponseFunctionCallArgumentsDeltaEvent": {
"type": "object",
"required": [
"type",
- "id",
- "status",
- "result"
+ "item_id",
+ "output_index",
+ "sequence_number",
+ "delta"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "image_generation_call"
+ "response.function_call_arguments.delta"
],
- "description": "The type of the image generation call. Always `image_generation_call`.",
+ "description": "The type of the event. Always `response.function_call_arguments.delta`.",
"x-stainless-const": true
},
- "id": {
+ "item_id": {
"type": "string",
- "description": "The unique ID of the image generation call."
+ "description": "The ID of the output item that the function-call arguments delta is added to."
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "generating",
- "failed"
- ],
- "description": "The status of the image generation call."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the function-call arguments delta is added to."
},
- "result": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
+ },
+ "delta": {
+ "type": "string",
+ "description": "The function-call arguments delta that is added."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
+ "description": "Emitted when there is a partial function-call arguments delta.",
+ "x-oaiMeta": {
+ "name": "response.function_call_arguments.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.function_call_arguments.delta\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"delta\": \"{ \"arg\":\"\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemLocalShellToolCall": {
+ "OpenAI.ResponseFunctionCallArgumentsDoneEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "action",
- "status"
+ "item_id",
+ "name",
+ "output_index",
+ "sequence_number",
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call"
+ "response.function_call_arguments.done"
],
- "description": "The type of the local shell call. Always `local_shell_call`.",
"x-stainless-const": true
},
- "id": {
+ "item_id": {
"type": "string",
- "description": "The unique ID of the local shell call."
+ "description": "The ID of the item."
},
- "call_id": {
+ "name": {
"type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "description": "The name of the function that was called."
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item."
},
- "status": {
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
+ },
+ "arguments": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the local shell call."
+ "description": "The function-call arguments."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call to run a command on the local shell.",
- "title": "Local shell call"
+ "description": "Emitted when function-call arguments are finalized.",
+ "x-oaiMeta": {
+ "name": "response.function_call_arguments.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.function_call_arguments.done\",\n \"item_id\": \"item-abc\",\n \"name\": \"get_weather\",\n \"output_index\": 1,\n \"arguments\": \"{ \"arg\": 123 }\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemLocalShellToolCallOutput": {
+ "OpenAI.ResponseImageGenCallCompletedEvent": {
"type": "object",
"required": [
"type",
- "id",
- "output"
+ "output_index",
+ "sequence_number",
+ "item_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call_output"
+ "response.image_generation_call.completed"
],
- "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "description": "The type of the event. Always 'response.image_generation_call.completed'.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "output": {
- "type": "string",
- "description": "A JSON string of the output of the local shell tool call."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "status": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "item_id": {
+ "type": "string",
+ "description": "The unique identifier of the image generation item being processed."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The output of a local shell tool call.",
- "title": "Local shell call output"
+ "description": "Emitted when an image generation tool call has completed and the final image is available.",
+ "title": "ResponseImageGenCallCompletedEvent",
+ "x-oaiMeta": {
+ "name": "response.image_generation_call.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.image_generation_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemMcpApprovalRequest": {
+ "OpenAI.ResponseImageGenCallGeneratingEvent": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_request"
+ "response.image_generation_call.generating"
],
- "description": "The type of the item. Always `mcp_approval_request`.",
+ "description": "The type of the event. Always 'response.image_generation_call.generating'.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the approval request."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server making the request."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "name": {
+ "item_id": {
"type": "string",
- "description": "The name of the tool to run."
+ "description": "The unique identifier of the image generation item being processed."
},
- "arguments": {
- "type": "string",
- "description": "A JSON string of arguments for the tool."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the image generation item being processed."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A request for human approval of a tool invocation.",
- "title": "MCP approval request"
+ "description": "Emitted when an image generation tool call is actively generating an image (intermediate state).",
+ "title": "ResponseImageGenCallGeneratingEvent",
+ "x-oaiMeta": {
+ "name": "response.image_generation_call.generating",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.image_generation_call.generating\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n"
+ }
},
- "OpenAI.OutputItemMcpApprovalResponseResource": {
+ "OpenAI.ResponseImageGenCallInProgressEvent": {
"type": "object",
"required": [
"type",
- "id",
- "approval_request_id",
- "approve"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_response"
+ "response.image_generation_call.in_progress"
],
- "description": "The type of the item. Always `mcp_approval_response`.",
+ "description": "The type of the event. Always 'response.image_generation_call.in_progress'.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the approval response"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "approval_request_id": {
+ "item_id": {
"type": "string",
- "description": "The ID of the approval request being answered."
- },
- "approve": {
- "type": "boolean",
- "description": "Whether the request was approved."
+ "description": "The unique identifier of the image generation item being processed."
},
- "reason": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the image generation item being processed."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A response to an MCP approval request.",
- "title": "MCP approval response"
+ "description": "Emitted when an image generation tool call is in progress.",
+ "title": "ResponseImageGenCallInProgressEvent",
+ "x-oaiMeta": {
+ "name": "response.image_generation_call.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.image_generation_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n"
+ }
},
- "OpenAI.OutputItemMcpListTools": {
+ "OpenAI.ResponseImageGenCallPartialImageEvent": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "tools"
+ "output_index",
+ "item_id",
+ "sequence_number",
+ "partial_image_index",
+ "partial_image_b64"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_list_tools"
+ "response.image_generation_call.partial_image"
],
- "description": "The type of the item. Always `mcp_list_tools`.",
+ "description": "The type of the event. Always 'response.image_generation_call.partial_image'.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the list."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "server_label": {
+ "item_id": {
"type": "string",
- "description": "The label of the MCP server."
+ "description": "The unique identifier of the image generation item being processed."
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
- },
- "description": "The tools available on the server."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the image generation item being processed."
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "partial_image_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "0-based index for the partial image (backend is 1-based, but this is 0-based for the user)."
+ },
+ "partial_image_b64": {
+ "type": "string",
+ "description": "Base64-encoded partial image data, suitable for rendering as an image."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A list of tools available on an MCP server.",
- "title": "MCP list tools"
+ "description": "Emitted when a partial image is available during image generation streaming.",
+ "title": "ResponseImageGenCallPartialImageEvent",
+ "x-oaiMeta": {
+ "name": "response.image_generation_call.partial_image",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.image_generation_call.partial_image\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0,\n \"partial_image_index\": 0,\n \"partial_image_b64\": \"...\"\n}\n"
+ }
},
- "OpenAI.OutputItemMcpToolCall": {
+ "OpenAI.ResponseInProgressEvent": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "response",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_call"
+ "response.in_progress"
],
- "description": "The type of the item. Always `mcp_call`.",
+ "description": "The type of the event. Always `response.in_progress`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the tool call."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server running the tool."
- },
- "name": {
- "type": "string",
- "description": "The name of the tool that was run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments passed to the tool."
- },
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "error": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
- "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The response that is in progress."
},
- "approval_request_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "An invocation of a tool on an MCP server.",
- "title": "MCP tool call"
+ "description": "Emitted when the response is in progress.",
+ "x-oaiMeta": {
+ "name": "response.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.in_progress\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemOutputMessage": {
+ "OpenAI.ResponseIncompleteDetails": {
+ "type": "object",
+ "properties": {
+ "reason": {
+ "type": "string",
+ "enum": [
+ "max_output_tokens",
+ "content_filter"
+ ]
+ }
+ }
+ },
+ "OpenAI.ResponseIncompleteEvent": {
"type": "object",
"required": [
- "id",
"type",
- "role",
- "content",
- "status"
+ "response",
+ "sequence_number"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the output message."
- },
"type": {
"type": "string",
"enum": [
- "output_message"
- ],
- "description": "The type of the output message. Always `message`.",
- "x-stainless-const": true
- },
- "role": {
- "type": "string",
- "enum": [
- "assistant"
+ "response.incomplete"
],
- "description": "The role of the output message. Always `assistant`.",
+ "description": "The type of the event. Always `response.incomplete`.",
"x-stainless-const": true
},
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
- },
- "description": "The content of the output message."
- },
- "phase": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
- },
- {
- "type": "null"
- }
- ]
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The response that was incomplete."
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "An output message from the model.",
- "title": "Output message"
+ "description": "An event that is emitted when a response finishes as incomplete.",
+ "x-oaiMeta": {
+ "name": "response.incomplete",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.incomplete\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"incomplete\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": {\n \"reason\": \"max_tokens\"\n },\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemReasoningItem": {
+ "OpenAI.ResponseLogProb": {
"type": "object",
"required": [
- "type",
- "id",
- "summary"
+ "token",
+ "logprob"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "reasoning"
- ],
- "description": "The type of the object. Always `reasoning`.",
- "x-stainless-const": true
- },
- "id": {
+ "token": {
"type": "string",
- "description": "The unique identifier of the reasoning content."
- },
- "encrypted_content": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "A possible text token."
},
- "summary": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
- },
- "description": "Reasoning summary content."
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The log probability of this token."
},
- "content": {
+ "top_logprobs": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ "$ref": "#/components/schemas/OpenAI.ResponseLogProbTopLogprobs"
},
- "description": "Reasoning text content."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The log probabilities of up to 20 of the most likely tokens."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "description": "A logprob is the logarithmic probability that the model assigns to producing\na particular token at a given position in the sequence. Less-negative (higher)\nlogprob values indicate greater model confidence in that token choice."
+ },
+ "OpenAI.ResponseLogProbTopLogprobs": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "type": "string"
+ },
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
}
- ],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
+ }
},
- "OpenAI.OutputItemToolSearchCall": {
+ "OpenAI.ResponseMCPCallArgumentsDeltaEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "execution",
- "arguments",
- "status"
+ "output_index",
+ "item_id",
+ "delta",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_search_call"
+ "response.mcp_call_arguments.delta"
],
- "description": "The type of the item. Always `tool_search_call`.",
- "x-stainless-const": true,
- "default": "tool_search_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the tool search call item."
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
+ "description": "The type of the event. Always 'response.mcp_call_arguments.delta'.",
+ "x-stainless-const": true
},
- "arguments": {
- "description": "Arguments used for the tool search call."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the tool search call item that was recorded."
+ "item_id": {
+ "type": "string",
+ "description": "The unique identifier of the MCP tool call item being processed."
},
- "created_by": {
+ "delta": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "A JSON string containing the partial update to the arguments for the MCP tool call."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
- ]
+ ],
+ "description": "Emitted when there is a delta (partial update) to the arguments of an MCP tool call.",
+ "title": "ResponseMCPCallArgumentsDeltaEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call_arguments.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call_arguments.delta\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"delta\": \"{\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemToolSearchOutput": {
+ "OpenAI.ResponseMCPCallArgumentsDoneEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "execution",
- "tools",
- "status"
+ "output_index",
+ "item_id",
+ "arguments",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_search_output"
+ "response.mcp_call_arguments.done"
],
- "description": "The type of the item. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the tool search output item."
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The loaded tool definitions returned by tool search."
+ "description": "The type of the event. Always 'response.mcp_call_arguments.done'.",
+ "x-stainless-const": true
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the tool search output item that was recorded."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "created_by": {
+ "item_id": {
"type": "string",
- "description": "The identifier of the actor that created the item."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ]
- },
- "OpenAI.OutputItemType": {
- "anyOf": [
- {
- "type": "string"
+ "description": "The unique identifier of the MCP tool call item being processed."
},
- {
+ "arguments": {
"type": "string",
- "enum": [
- "output_message",
- "file_search_call",
- "function_call",
- "function_call_output",
- "web_search_call",
- "computer_call",
- "computer_call_output",
- "reasoning",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "compaction",
- "image_generation_call",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_call",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "custom_tool_call",
- "custom_tool_call_output",
- "structured_outputs",
- "oauth_consent_request",
- "memory_search_call",
- "memory_command_preview_call",
- "memory_command_preview_call_output",
- "workflow_action",
- "a2a_preview_call",
- "a2a_preview_call_output",
- "bing_grounding_call",
- "bing_grounding_call_output",
- "sharepoint_grounding_preview_call",
- "sharepoint_grounding_preview_call_output",
- "azure_ai_search_call",
- "azure_ai_search_call_output",
- "bing_custom_search_preview_call",
- "bing_custom_search_preview_call_output",
- "openapi_call",
- "openapi_call_output",
- "browser_automation_preview_call",
- "browser_automation_preview_call_output",
- "fabric_dataagent_preview_call",
- "fabric_dataagent_preview_call_output",
- "azure_function_call",
- "azure_function_call_output"
- ]
+ "description": "A JSON string containing the finalized arguments for the MCP tool call."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
- ]
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when the arguments for an MCP tool call are finalized.",
+ "title": "ResponseMCPCallArgumentsDoneEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call_arguments.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call_arguments.done\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"arguments\": \"{\"arg1\": \"value1\", \"arg2\": \"value2\"}\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemWebSearchToolCall": {
+ "OpenAI.ResponseMCPCallCompletedEvent": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "action"
+ "item_id",
+ "output_index",
+ "sequence_number"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the web search tool call."
- },
"type": {
"type": "string",
"enum": [
- "web_search_call"
+ "response.mcp_call.completed"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
+ "description": "The type of the event. Always 'response.mcp_call.completed'.",
"x-stainless-const": true
},
- "status": {
+ "item_id": {
"type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
- ],
- "description": "The status of the web search tool call."
+ "description": "The ID of the MCP tool call item that completed."
},
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
- }
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that completed."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
- },
- "OpenAI.OutputMessageContent": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.OutputMessageContentType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "output_text": "#/components/schemas/OpenAI.OutputMessageContentOutputTextContent",
- "refusal": "#/components/schemas/OpenAI.OutputMessageContentRefusalContent"
- }
+ "description": "Emitted when an MCP tool call has completed successfully.",
+ "title": "ResponseMCPCallCompletedEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call.completed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n"
}
},
- "OpenAI.OutputMessageContentOutputTextContent": {
+ "OpenAI.ResponseMCPCallFailedEvent": {
"type": "object",
"required": [
"type",
- "text",
- "annotations",
- "logprobs"
+ "item_id",
+ "output_index",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "output_text"
+ "response.mcp_call.failed"
],
- "description": "The type of the output text. Always `output_text`.",
- "x-stainless-const": true,
- "default": "output_text"
+ "description": "The type of the event. Always 'response.mcp_call.failed'.",
+ "x-stainless-const": true
},
- "text": {
+ "item_id": {
"type": "string",
- "description": "The text output from the model."
+ "description": "The ID of the MCP tool call item that failed."
},
- "annotations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Annotation"
- },
- "description": "The annotations of the text output."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that failed."
},
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.LogProb"
- }
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A text output from the model.",
- "title": "Output text"
+ "description": "Emitted when an MCP tool call has failed.",
+ "title": "ResponseMCPCallFailedEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call.failed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call.failed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n"
+ }
},
- "OpenAI.OutputMessageContentRefusalContent": {
+ "OpenAI.ResponseMCPCallInProgressEvent": {
"type": "object",
"required": [
"type",
- "refusal"
+ "sequence_number",
+ "output_index",
+ "item_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "refusal"
+ "response.mcp_call.in_progress"
],
- "description": "The type of the refusal. Always `refusal`.",
- "x-stainless-const": true,
- "default": "refusal"
+ "description": "The type of the event. Always 'response.mcp_call.in_progress'.",
+ "x-stainless-const": true
},
- "refusal": {
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
+ },
+ "item_id": {
"type": "string",
- "description": "The refusal explanation from the model."
+ "description": "The unique identifier of the MCP tool call item being processed."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A refusal from the model.",
- "title": "Refusal"
- },
- "OpenAI.OutputMessageContentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "output_text",
- "refusal"
- ]
- }
- ]
+ "description": "Emitted when an MCP tool call is in progress.",
+ "title": "ResponseMCPCallInProgressEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\"\n}\n"
+ }
},
- "OpenAI.Prompt": {
+ "OpenAI.ResponseMCPListToolsCompletedEvent": {
"type": "object",
"required": [
- "id"
+ "type",
+ "item_id",
+ "output_index",
+ "sequence_number"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The unique identifier of the prompt template to use."
+ "enum": [
+ "response.mcp_list_tools.completed"
+ ],
+ "description": "The type of the event. Always 'response.mcp_list_tools.completed'.",
+ "x-stainless-const": true
},
- "version": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the MCP tool call item that produced this output."
},
- "variables": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponsePromptVariables"
- },
- {
- "type": "null"
- }
- ]
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that was processed."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
- "description": "Reference to a prompt template and its variables.\n[Learn more](/docs/guides/text?api-mode=responses#reusable-prompts)."
- },
- "OpenAI.PromptCacheRetentionEnum": {
- "type": "string",
- "enum": [
- "in_memory",
- "24h"
- ]
- },
- "OpenAI.RankerVersionType": {
- "type": "string",
- "enum": [
- "auto",
- "default-2024-11-15"
- ]
- },
- "OpenAI.RankingOptions": {
- "type": "object",
- "properties": {
- "ranker": {
- "$ref": "#/components/schemas/OpenAI.RankerVersionType",
- "description": "The ranker to use for the file search."
- },
- "score_threshold": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "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."
- },
- "hybrid_search": {
- "$ref": "#/components/schemas/OpenAI.HybridSearchOptions",
- "description": "Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
+ ],
+ "description": "Emitted when the list of available MCP tools has been successfully retrieved.",
+ "title": "ResponseMCPListToolsCompletedEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_list_tools.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_list_tools.completed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
}
},
- "OpenAI.RealtimeMCPError": {
+ "OpenAI.ResponseMCPListToolsFailedEvent": {
"type": "object",
"required": [
- "type"
+ "type",
+ "item_id",
+ "output_index",
+ "sequence_number"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMcpErrorType"
+ "type": "string",
+ "enum": [
+ "response.mcp_list_tools.failed"
+ ],
+ "description": "The type of the event. Always 'response.mcp_list_tools.failed'.",
+ "x-stainless-const": true
+ },
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the MCP tool call item that failed."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that failed."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "protocol_error": "#/components/schemas/OpenAI.RealtimeMCPProtocolError",
- "tool_execution_error": "#/components/schemas/OpenAI.RealtimeMCPToolExecutionError",
- "http_error": "#/components/schemas/OpenAI.RealtimeMCPHTTPError"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
+ ],
+ "description": "Emitted when the attempt to list available MCP tools has failed.",
+ "title": "ResponseMCPListToolsFailedEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_list_tools.failed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_list_tools.failed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
}
},
- "OpenAI.RealtimeMCPHTTPError": {
+ "OpenAI.ResponseMCPListToolsInProgressEvent": {
"type": "object",
"required": [
"type",
- "code",
- "message"
+ "item_id",
+ "output_index",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "http_error"
+ "response.mcp_list_tools.in_progress"
],
+ "description": "The type of the event. Always 'response.mcp_list_tools.in_progress'.",
"x-stainless-const": true
},
- "code": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the MCP tool call item that is being processed."
},
- "message": {
- "type": "string"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that is being processed."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "Realtime MCP HTTP error"
+ "description": "Emitted when the system is in the process of retrieving the list of available MCP tools.",
+ "title": "ResponseMCPListToolsInProgressEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_list_tools.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_list_tools.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
+ }
},
- "OpenAI.RealtimeMCPProtocolError": {
+ "OpenAI.ResponseModalities": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Output types that you would like the model to generate.\nMost models are capable of generating text, which is the default:\n`[\"text\"]`\nThe `gpt-4o-audio-preview` model can also be used to\n[generate audio](/docs/guides/audio). To request that this model generate\nboth text and audio responses, you can use:\n`[\"text\", \"audio\"]`"
+ },
+ "OpenAI.ResponseOutputItemAddedEvent": {
"type": "object",
"required": [
"type",
- "code",
- "message"
+ "output_index",
+ "sequence_number",
+ "item"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "protocol_error"
+ "response.output_item.added"
],
+ "description": "The type of the event. Always `response.output_item.added`.",
"x-stainless-const": true
},
- "code": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that was added."
},
- "message": {
- "type": "string"
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
+ },
+ "item": {
+ "$ref": "#/components/schemas/OpenAI.OutputItem",
+ "description": "The output item that was added."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "Realtime MCP protocol error"
+ "description": "Emitted when a new output item is added.",
+ "x-oaiMeta": {
+ "name": "response.output_item.added",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.output_item.added\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"in_progress\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": []\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.RealtimeMCPToolExecutionError": {
+ "OpenAI.ResponseOutputItemDoneEvent": {
"type": "object",
"required": [
"type",
- "message"
+ "output_index",
+ "sequence_number",
+ "item"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_execution_error"
+ "response.output_item.done"
],
+ "description": "The type of the event. Always `response.output_item.done`.",
"x-stainless-const": true
},
- "message": {
- "type": "string"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that was marked done."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
+ },
+ "item": {
+ "$ref": "#/components/schemas/OpenAI.OutputItem",
+ "description": "The output item that was marked done."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "Realtime MCP tool execution error"
- },
- "OpenAI.RealtimeMcpErrorType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "protocol_error",
- "tool_execution_error",
- "http_error"
- ]
- }
- ]
+ "description": "Emitted when an output item is marked done.",
+ "x-oaiMeta": {
+ "name": "response.output_item.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.output_item.done\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"completed\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n ]\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.Reasoning": {
+ "OpenAI.ResponseOutputTextAnnotationAddedEvent": {
"type": "object",
+ "required": [
+ "type",
+ "item_id",
+ "output_index",
+ "content_index",
+ "annotation_index",
+ "sequence_number",
+ "annotation"
+ ],
"properties": {
- "effort": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
- },
- {
- "type": "null"
- }
- ]
+ "type": {
+ "type": "string",
+ "enum": [
+ "response.output_text.annotation.added"
+ ],
+ "description": "The type of the event. Always 'response.output_text.annotation.added'.",
+ "x-stainless-const": true
},
- "summary": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "concise",
- "detailed"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "item_id": {
+ "type": "string",
+ "description": "The unique identifier of the item to which the annotation is being added."
},
- "context": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "current_turn",
- "all_turns"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
+ },
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part within the output item."
+ },
+ "annotation_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the annotation within the content part."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "generate_summary": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "concise",
- "detailed"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "annotation": {
+ "$ref": "#/components/schemas/OpenAI.Annotation",
+ "description": "The annotation object being added. (See annotation schema for details.)"
}
},
- "description": "**gpt-5 and o-series models only**\nConfiguration options for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).",
- "title": "Reasoning"
- },
- "OpenAI.ReasoningEffort": {
- "anyOf": [
- {
- "type": "string"
- },
+ "allOf": [
{
- "type": "string",
- "enum": [
- "none",
- "minimal",
- "low",
- "medium",
- "high",
- "xhigh"
- ]
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\n- `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.\n- All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.\n- The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.\n- `xhigh` is supported for all models after `gpt-5.1-codex-max`."
+ "description": "Emitted when an annotation is added to output text content.",
+ "title": "ResponseOutputTextAnnotationAddedEvent",
+ "x-oaiMeta": {
+ "name": "response.output_text.annotation.added",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.output_text.annotation.added\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"annotation_index\": 0,\n \"annotation\": {\n \"type\": \"text_annotation\",\n \"text\": \"This is a test annotation\",\n \"start\": 0,\n \"end\": 10\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.ReasoningTextContent": {
+ "OpenAI.ResponsePromptVariables": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputTextContent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputImageContent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFileContent"
+ }
+ ]
+ },
+ "description": "Optional map of values to substitute in for variables in your\nprompt. The substitution values can either be strings, or other\nResponse input types like images or files.",
+ "title": "Prompt Variables",
+ "x-oaiExpandable": true,
+ "x-oaiTypeLabel": "map"
+ },
+ "OpenAI.ResponseQueuedEvent": {
"type": "object",
"required": [
"type",
- "text"
+ "response",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "reasoning_text"
+ "response.queued"
],
- "description": "The type of the reasoning text. Always `reasoning_text`.",
- "x-stainless-const": true,
- "default": "reasoning_text"
+ "description": "The type of the event. Always 'response.queued'.",
+ "x-stainless-const": true
},
- "text": {
- "type": "string",
- "description": "The reasoning text from the model."
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The full response object that is queued."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number for this event."
}
},
- "description": "Reasoning text from the model.",
- "title": "Reasoning text"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when a response is queued and waiting to be processed.",
+ "title": "ResponseQueuedEvent",
+ "x-oaiMeta": {
+ "name": "response.queued",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.queued\",\n \"response\": {\n \"id\": \"res_123\",\n \"status\": \"queued\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.Response": {
+ "OpenAI.ResponseReasoningSummaryPartAddedEvent": {
"type": "object",
"required": [
- "id",
- "object",
- "created_at",
- "error",
- "incomplete_details",
- "output",
- "instructions",
- "parallel_tool_calls",
- "agent_reference"
+ "type",
+ "item_id",
+ "output_index",
+ "summary_index",
+ "sequence_number",
+ "part"
],
"properties": {
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
- },
- "top_logprobs": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "temperature": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "top_p": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "user": {
- "type": "string",
- "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
- "deprecated": true
- },
- "safety_identifier": {
- "type": "string",
- "maxLength": 64,
- "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
- },
- "prompt_cache_key": {
- "type": "string",
- "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
- },
- "service_tier": {
- "$ref": "#/components/schemas/OpenAI.ServiceTier"
- },
- "prompt_cache_retention": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_memory",
- "24h"
- ]
- },
- {
- "type": "null"
- }
- ]
- },
- "previous_response_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "model": {
- "type": "string",
- "description": "The model deployment to use for the creation of this response."
- },
- "background": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "max_tool_calls": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "text": {
- "$ref": "#/components/schemas/OpenAI.ResponseTextParam"
- },
- "tools": {
- "$ref": "#/components/schemas/OpenAI.ToolsArray"
- },
- "tool_choice": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ]
- },
- "prompt": {
- "$ref": "#/components/schemas/OpenAI.Prompt"
- },
- "truncation": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "disabled"
- ]
- },
- {
- "type": "null"
- }
- ],
- "default": "disabled"
- },
- "id": {
- "type": "string",
- "description": "Unique identifier for this Response."
- },
- "object": {
+ "type": {
"type": "string",
"enum": [
- "response"
+ "response.reasoning_summary_part.added"
],
- "description": "The object type of this resource - always set to `response`.",
+ "description": "The type of the event. Always `response.reasoning_summary_part.added`.",
"x-stainless-const": true
},
- "status": {
+ "item_id": {
"type": "string",
- "enum": [
- "completed",
- "failed",
- "in_progress",
- "cancelled",
- "queued",
- "incomplete"
- ],
- "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) of when this Response was created."
- },
- "completed_at": {
- "anyOf": [
- {
- "type": "string",
- "format": "date-time"
- },
- {
- "type": "null"
- }
- ],
- "type": "integer",
- "format": "unixTimestamp"
- },
- "error": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseError"
- },
- {
- "type": "null"
- }
- ]
- },
- "incomplete_details": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails"
- },
- {
- "type": "null"
- }
- ]
- },
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- },
- "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs."
- },
- "reasoning": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Reasoning"
- },
- {
- "type": "null"
- }
- ]
- },
- "instructions": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "output_text": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "usage": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsage"
- },
- "moderation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Moderation"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The ID of the item this summary part is associated with."
},
- "parallel_tool_calls": {
- "type": "boolean",
- "description": "Whether to allow the model to run tool calls in parallel.",
- "default": true
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item this summary part is associated with."
},
- "conversation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationReference"
- },
- {
- "type": "null"
- }
- ]
+ "summary_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the summary part within the reasoning summary."
},
- "max_output_tokens": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "agent_reference": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/AgentReference"
- },
- {
- "type": "null"
- }
+ "part": {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart",
+ "description": "The summary part that was added."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when a new reasoning summary part is added.",
+ "x-oaiMeta": {
+ "name": "response.reasoning_summary_part.added",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.reasoning_summary_part.added\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"\"\n },\n \"sequence_number\": 1\n}\n"
+ }
+ },
+ "OpenAI.ResponseReasoningSummaryPartAddedEventPart": {
+ "type": "object",
+ "required": [
+ "type",
+ "text"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "summary_text"
],
- "description": "The agent used for this response"
+ "x-stainless-const": true
},
- "content_filters": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ContentFilterResult"
- },
- "description": "The content filter evaluation results."
+ "text": {
+ "type": "string"
}
- },
- "title": "The response object"
+ }
},
- "OpenAI.ResponseAudioDeltaEvent": {
+ "OpenAI.ResponseReasoningSummaryPartDoneEvent": {
"type": "object",
"required": [
"type",
+ "item_id",
+ "output_index",
+ "summary_index",
"sequence_number",
- "delta"
+ "part"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.audio.delta"
+ "response.reasoning_summary_part.done"
],
- "description": "The type of the event. Always `response.audio.delta`.",
+ "description": "The type of the event. Always `response.reasoning_summary_part.done`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this summary part is associated with."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item this summary part is associated with."
+ },
+ "summary_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the summary part within the reasoning summary."
+ },
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "A sequence number for this chunk of the stream response."
+ "description": "The sequence number of this event."
},
- "delta": {
- "type": "string",
- "contentEncoding": "base64",
- "description": "A chunk of Base64 encoded response audio bytes."
+ "part": {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEventPart",
+ "description": "The completed summary part."
}
},
"allOf": [
@@ -44875,49 +66585,39 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when there is a partial audio response.",
+ "description": "Emitted when a reasoning summary part is completed.",
"x-oaiMeta": {
- "name": "response.audio.delta",
+ "name": "response.reasoning_summary_part.done",
"group": "responses",
- "example": "{\n \"type\": \"response.audio.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \"base64encoded...\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_summary_part.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\"\n },\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseAudioDoneEvent": {
+ "OpenAI.ResponseReasoningSummaryPartDoneEventPart": {
"type": "object",
"required": [
"type",
- "sequence_number"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.audio.done"
+ "summary_text"
],
- "description": "The type of the event. Always `response.audio.done`.",
"x-stainless-const": true
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the delta."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "text": {
+ "type": "string"
}
- ],
- "description": "Emitted when the audio response is complete.",
- "x-oaiMeta": {
- "name": "response.audio.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.audio.done\",\n \"response_id\": \"resp-123\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseAudioTranscriptDeltaEvent": {
+ "OpenAI.ResponseReasoningSummaryTextDeltaEvent": {
"type": "object",
"required": [
"type",
+ "item_id",
+ "output_index",
+ "summary_index",
"delta",
"sequence_number"
],
@@ -44925,14 +66625,26 @@
"type": {
"type": "string",
"enum": [
- "response.audio.transcript.delta"
+ "response.reasoning_summary_text.delta"
],
- "description": "The type of the event. Always `response.audio.transcript.delta`.",
+ "description": "The type of the event. Always `response.reasoning_summary_text.delta`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this summary text delta is associated with."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item this summary text delta is associated with."
+ },
+ "summary_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the summary part within the reasoning summary."
+ },
"delta": {
"type": "string",
- "description": "The partial transcript of the audio response."
+ "description": "The text delta that was added to the summary."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
@@ -44944,28 +66656,48 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when there is a partial transcript of audio.",
+ "description": "Emitted when a delta is added to a reasoning summary text.",
"x-oaiMeta": {
- "name": "response.audio.transcript.delta",
+ "name": "response.reasoning_summary_text.delta",
"group": "responses",
- "example": "{\n \"type\": \"response.audio.transcript.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \" ... partial transcript ... \",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_summary_text.delta\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"delta\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseAudioTranscriptDoneEvent": {
+ "OpenAI.ResponseReasoningSummaryTextDoneEvent": {
"type": "object",
"required": [
"type",
+ "item_id",
+ "output_index",
+ "summary_index",
+ "text",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.audio.transcript.done"
+ "response.reasoning_summary_text.done"
],
- "description": "The type of the event. Always `response.audio.transcript.done`.",
+ "description": "The type of the event. Always `response.reasoning_summary_text.done`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this summary text is associated with."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item this summary text is associated with."
+ },
+ "summary_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the summary part within the reasoning summary."
+ },
+ "text": {
+ "type": "string",
+ "description": "The full text of the completed reasoning summary."
+ },
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
"description": "The sequence number of this event."
@@ -44976,19 +66708,20 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when the full audio transcript is completed.",
+ "description": "Emitted when a reasoning summary text is completed.",
"x-oaiMeta": {
- "name": "response.audio.transcript.done",
+ "name": "response.reasoning_summary_text.done",
"group": "responses",
- "example": "{\n \"type\": \"response.audio.transcript.done\",\n \"response_id\": \"resp_123\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_summary_text.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"text\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent": {
+ "OpenAI.ResponseReasoningTextDeltaEvent": {
"type": "object",
"required": [
"type",
- "output_index",
"item_id",
+ "output_index",
+ "content_index",
"delta",
"sequence_number"
],
@@ -44996,26 +66729,30 @@
"type": {
"type": "string",
"enum": [
- "response.code_interpreter_call_code.delta"
+ "response.reasoning_text.delta"
],
- "description": "The type of the event. Always `response.code_interpreter_call_code.delta`.",
+ "description": "The type of the event. Always `response.reasoning_text.delta`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this reasoning text delta is associated with."
+ },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code is being streamed."
+ "description": "The index of the output item this reasoning text delta is associated with."
},
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the reasoning content part this delta is associated with."
},
"delta": {
"type": "string",
- "description": "The partial code snippet being streamed by the code interpreter."
+ "description": "The text delta that was added to the reasoning content."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "description": "The sequence number of this event."
}
},
"allOf": [
@@ -45023,46 +66760,51 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when a partial code snippet is streamed by the code interpreter.",
+ "description": "Emitted when a delta is added to a reasoning text.",
"x-oaiMeta": {
- "name": "response.code_interpreter_call_code.delta",
+ "name": "response.reasoning_text.delta",
"group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call_code.delta\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"delta\": \"print('Hello, world')\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_text.delta\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"The\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallCodeDoneEvent": {
+ "OpenAI.ResponseReasoningTextDoneEvent": {
"type": "object",
"required": [
"type",
- "output_index",
"item_id",
- "code",
+ "output_index",
+ "content_index",
+ "text",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.code_interpreter_call_code.done"
+ "response.reasoning_text.done"
],
- "description": "The type of the event. Always `response.code_interpreter_call_code.done`.",
+ "description": "The type of the event. Always `response.reasoning_text.done`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this reasoning text is associated with."
+ },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code is finalized."
+ "description": "The index of the output item this reasoning text is associated with."
},
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the reasoning content part."
},
- "code": {
+ "text": {
"type": "string",
- "description": "The final code snippet output by the code interpreter."
+ "description": "The full text of the completed reasoning content."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "description": "The sequence number of this event."
}
},
"allOf": [
@@ -45070,41 +66812,51 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when the code snippet is finalized by the code interpreter.",
+ "description": "Emitted when a reasoning text is completed.",
"x-oaiMeta": {
- "name": "response.code_interpreter_call_code.done",
+ "name": "response.reasoning_text.done",
"group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call_code.done\",\n \"output_index\": 3,\n \"item_id\": \"ci_12345\",\n \"code\": \"print('done')\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_text.done\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"The user is asking...\",\n \"sequence_number\": 4\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallCompletedEvent": {
+ "OpenAI.ResponseRefusalDeltaEvent": {
"type": "object",
"required": [
"type",
- "output_index",
"item_id",
+ "output_index",
+ "content_index",
+ "delta",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.code_interpreter_call.completed"
+ "response.refusal.delta"
],
- "description": "The type of the event. Always `response.code_interpreter_call.completed`.",
+ "description": "The type of the event. Always `response.refusal.delta`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the output item that the refusal text is added to."
+ },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code interpreter call is completed."
+ "description": "The index of the output item that the refusal text is added to."
},
- "item_id": {
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that the refusal text is added to."
+ },
+ "delta": {
"type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
+ "description": "The refusal text that is added."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "description": "The sequence number of this event."
}
},
"allOf": [
@@ -45112,41 +66864,51 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when the code interpreter call is completed.",
+ "description": "Emitted when there is a partial refusal text.",
"x-oaiMeta": {
- "name": "response.code_interpreter_call.completed",
+ "name": "response.refusal.delta",
"group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call.completed\",\n \"output_index\": 5,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.refusal.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"refusal text so far\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallInProgressEvent": {
+ "OpenAI.ResponseRefusalDoneEvent": {
"type": "object",
"required": [
"type",
- "output_index",
"item_id",
+ "output_index",
+ "content_index",
+ "refusal",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.code_interpreter_call.in_progress"
+ "response.refusal.done"
],
- "description": "The type of the event. Always `response.code_interpreter_call.in_progress`.",
+ "description": "The type of the event. Always `response.refusal.done`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the output item that the refusal text is finalized."
+ },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code interpreter call is in progress."
+ "description": "The index of the output item that the refusal text is finalized."
},
- "item_id": {
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that the refusal text is finalized."
+ },
+ "refusal": {
"type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
+ "description": "The refusal text that is finalized."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "description": "The sequence number of this event."
}
},
"allOf": [
@@ -45154,78 +66916,203 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when a code interpreter call is in progress.",
+ "description": "Emitted when refusal text is finalized.",
"x-oaiMeta": {
- "name": "response.code_interpreter_call.in_progress",
+ "name": "response.refusal.done",
"group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.refusal.done\",\n \"item_id\": \"item-abc\",\n \"output_index\": 1,\n \"content_index\": 2,\n \"refusal\": \"final refusal text\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallInterpretingEvent": {
+ "OpenAI.ResponseStreamEvent": {
"type": "object",
"required": [
- "type",
- "output_index",
- "item_id",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "response.code_interpreter_call.interpreting"
- ],
- "description": "The type of the event. Always `response.code_interpreter_call.interpreting`.",
- "x-stainless-const": true
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code interpreter is interpreting code."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEventType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "response.audio.done": "#/components/schemas/OpenAI.ResponseAudioDoneEvent",
+ "response.audio.transcript.delta": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent",
+ "response.audio.transcript.done": "#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent",
+ "response.code_interpreter_call_code.delta": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent",
+ "response.code_interpreter_call_code.done": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent",
+ "response.code_interpreter_call.completed": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent",
+ "response.code_interpreter_call.in_progress": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent",
+ "response.code_interpreter_call.interpreting": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent",
+ "response.completed": "#/components/schemas/OpenAI.ResponseCompletedEvent",
+ "response.content_part.added": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent",
+ "response.content_part.done": "#/components/schemas/OpenAI.ResponseContentPartDoneEvent",
+ "response.created": "#/components/schemas/OpenAI.ResponseCreatedEvent",
+ "response.custom_tool_call_input.delta": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent",
+ "response.custom_tool_call_input.done": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent",
+ "error": "#/components/schemas/OpenAI.ResponseErrorEvent",
+ "response.failed": "#/components/schemas/OpenAI.ResponseFailedEvent",
+ "response.file_search_call.completed": "#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent",
+ "response.file_search_call.in_progress": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent",
+ "response.file_search_call.searching": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent",
+ "response.function_call_arguments.delta": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent",
+ "response.function_call_arguments.done": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent",
+ "response.image_generation_call.completed": "#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent",
+ "response.image_generation_call.generating": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent",
+ "response.image_generation_call.in_progress": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent",
+ "response.image_generation_call.partial_image": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent",
+ "response.in_progress": "#/components/schemas/OpenAI.ResponseInProgressEvent",
+ "response.incomplete": "#/components/schemas/OpenAI.ResponseIncompleteEvent",
+ "response.mcp_call_arguments.delta": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent",
+ "response.mcp_call_arguments.done": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent",
+ "response.mcp_call.completed": "#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent",
+ "response.mcp_call.failed": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent",
+ "response.mcp_call.in_progress": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent",
+ "response.mcp_list_tools.completed": "#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent",
+ "response.mcp_list_tools.failed": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent",
+ "response.mcp_list_tools.in_progress": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent",
+ "response.output_item.added": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent",
+ "response.output_item.done": "#/components/schemas/OpenAI.ResponseOutputItemDoneEvent",
+ "response.output_text.annotation.added": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent",
+ "response.queued": "#/components/schemas/OpenAI.ResponseQueuedEvent",
+ "response.reasoning_summary_part.added": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent",
+ "response.reasoning_summary_part.done": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent",
+ "response.reasoning_summary_text.delta": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent",
+ "response.reasoning_summary_text.done": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent",
+ "response.reasoning_text.delta": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent",
+ "response.reasoning_text.done": "#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent",
+ "response.refusal.delta": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent",
+ "response.refusal.done": "#/components/schemas/OpenAI.ResponseRefusalDoneEvent",
+ "response.output_text.delta": "#/components/schemas/OpenAI.ResponseTextDeltaEvent",
+ "response.output_text.done": "#/components/schemas/OpenAI.ResponseTextDoneEvent",
+ "response.web_search_call.completed": "#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent",
+ "response.web_search_call.in_progress": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent",
+ "response.web_search_call.searching": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent",
+ "response.audio.delta": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent"
}
- ],
- "description": "Emitted when the code interpreter is actively interpreting the code snippet.",
- "x-oaiMeta": {
- "name": "response.code_interpreter_call.interpreting",
- "group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call.interpreting\",\n \"output_index\": 4,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCompletedEvent": {
+ "OpenAI.ResponseStreamEventType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "response.audio.delta",
+ "response.audio.done",
+ "response.audio.transcript.delta",
+ "response.audio.transcript.done",
+ "response.code_interpreter_call_code.delta",
+ "response.code_interpreter_call_code.done",
+ "response.code_interpreter_call.completed",
+ "response.code_interpreter_call.in_progress",
+ "response.code_interpreter_call.interpreting",
+ "response.completed",
+ "response.content_part.added",
+ "response.content_part.done",
+ "response.created",
+ "error",
+ "response.file_search_call.completed",
+ "response.file_search_call.in_progress",
+ "response.file_search_call.searching",
+ "response.function_call_arguments.delta",
+ "response.function_call_arguments.done",
+ "response.in_progress",
+ "response.failed",
+ "response.incomplete",
+ "response.output_item.added",
+ "response.output_item.done",
+ "response.reasoning_summary_part.added",
+ "response.reasoning_summary_part.done",
+ "response.reasoning_summary_text.delta",
+ "response.reasoning_summary_text.done",
+ "response.reasoning_text.delta",
+ "response.reasoning_text.done",
+ "response.refusal.delta",
+ "response.refusal.done",
+ "response.output_text.delta",
+ "response.output_text.done",
+ "response.web_search_call.completed",
+ "response.web_search_call.in_progress",
+ "response.web_search_call.searching",
+ "response.image_generation_call.completed",
+ "response.image_generation_call.generating",
+ "response.image_generation_call.in_progress",
+ "response.image_generation_call.partial_image",
+ "response.mcp_call_arguments.delta",
+ "response.mcp_call_arguments.done",
+ "response.mcp_call.completed",
+ "response.mcp_call.failed",
+ "response.mcp_call.in_progress",
+ "response.mcp_list_tools.completed",
+ "response.mcp_list_tools.failed",
+ "response.mcp_list_tools.in_progress",
+ "response.output_text.annotation.added",
+ "response.queued",
+ "response.custom_tool_call_input.delta",
+ "response.custom_tool_call_input.done"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ResponseStreamOptions": {
+ "type": "object",
+ "properties": {
+ "include_obfuscation": {
+ "type": "boolean",
+ "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API."
+ }
+ },
+ "description": "Options for streaming responses. Only set this when you set `stream: true`."
+ },
+ "OpenAI.ResponseTextDeltaEvent": {
"type": "object",
"required": [
"type",
- "response",
- "sequence_number"
+ "item_id",
+ "output_index",
+ "content_index",
+ "delta",
+ "sequence_number",
+ "logprobs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.completed"
+ "response.output_text.delta"
],
- "description": "The type of the event. Always `response.completed`.",
+ "description": "The type of the event. Always `response.output_text.delta`.",
"x-stainless-const": true
},
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "Properties of the completed response."
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the output item that the text delta was added to."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the text delta was added to."
+ },
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that the text delta was added to."
+ },
+ "delta": {
+ "type": "string",
+ "description": "The text delta that was added."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
"description": "The sequence number for this event."
+ },
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ResponseLogProb"
+ },
+ "description": "The log probabilities of the tokens in the delta."
}
},
"allOf": [
@@ -45233,51 +67120,59 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when the model response is complete.",
+ "description": "Emitted when there is an additional text delta.",
"x-oaiMeta": {
- "name": "response.completed",
+ "name": "response.output_text.delta",
"group": "responses",
- "example": "{\n \"type\": \"response.completed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"completed\",\n \"completed_at\": 1740855870,\n \"error\": null,\n \"incomplete_details\": null,\n \"input\": [],\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [\n {\n \"id\": \"msg_123\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 0,\n \"output_tokens\": 0,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 0\n },\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.output_text.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"In\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseContentPartAddedEvent": {
+ "OpenAI.ResponseTextDoneEvent": {
"type": "object",
"required": [
"type",
"item_id",
"output_index",
"content_index",
- "part",
- "sequence_number"
+ "text",
+ "sequence_number",
+ "logprobs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.content_part.added"
+ "response.output_text.done"
],
- "description": "The type of the event. Always `response.content_part.added`.",
+ "description": "The type of the event. Always `response.output_text.done`.",
"x-stainless-const": true
},
"item_id": {
"type": "string",
- "description": "The ID of the output item that the content part was added to."
+ "description": "The ID of the output item that the text content is finalized."
},
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the content part was added to."
+ "description": "The index of the output item that the text content is finalized."
},
"content_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that was added."
+ "description": "The index of the content part that the text content is finalized."
},
- "part": {
- "$ref": "#/components/schemas/OpenAI.OutputContent",
- "description": "The content part that was added."
+ "text": {
+ "type": "string",
+ "description": "The text content that is finalized."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "description": "The sequence number for this event."
+ },
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ResponseLogProb"
+ },
+ "description": "The log probabilities of the tokens in the delta."
}
},
"allOf": [
@@ -45285,51 +67180,108 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when a new content part is added.",
+ "description": "Emitted when text content is finalized.",
"x-oaiMeta": {
- "name": "response.content_part.added",
+ "name": "response.output_text.done",
"group": "responses",
- "example": "{\n \"type\": \"response.content_part.added\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"\",\n \"annotations\": []\n },\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.output_text.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"sequence_number\": 1\n}\n"
+ }
+ },
+ "OpenAI.ResponseTextParam": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
+ },
+ "verbosity": {
+ "$ref": "#/components/schemas/OpenAI.Verbosity"
+ }
+ },
+ "description": "Configuration options for a text response from the model. Can be plain\ntext or structured JSON data. Learn more:\n- [Text inputs and outputs](/docs/guides/text)\n- [Structured Outputs](/docs/guides/structured-outputs)"
+ },
+ "OpenAI.ResponseUsage": {
+ "type": "object",
+ "required": [
+ "input_tokens",
+ "input_tokens_details",
+ "output_tokens",
+ "output_tokens_details",
+ "total_tokens"
+ ],
+ "properties": {
+ "input_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of input tokens."
+ },
+ "input_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails",
+ "description": "A detailed breakdown of the input tokens."
+ },
+ "output_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of output tokens."
+ },
+ "output_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails",
+ "description": "A detailed breakdown of the output tokens."
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The total number of tokens used."
+ }
+ },
+ "description": "Represents token usage details including input tokens, output tokens,\na breakdown of output tokens, and the total tokens used."
+ },
+ "OpenAI.ResponseUsageInputTokensDetails": {
+ "type": "object",
+ "required": [
+ "cached_tokens"
+ ],
+ "properties": {
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.ResponseUsageOutputTokensDetails": {
+ "type": "object",
+ "required": [
+ "reasoning_tokens"
+ ],
+ "properties": {
+ "reasoning_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
}
},
- "OpenAI.ResponseContentPartDoneEvent": {
+ "OpenAI.ResponseWebSearchCallCompletedEvent": {
"type": "object",
"required": [
"type",
- "item_id",
"output_index",
- "content_index",
- "sequence_number",
- "part"
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.content_part.done"
+ "response.web_search_call.completed"
],
- "description": "The type of the event. Always `response.content_part.done`.",
+ "description": "The type of the event. Always `response.web_search_call.completed`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the content part was added to."
- },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the content part was added to."
+ "description": "The index of the output item that the web search call is associated with."
},
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that is done."
+ "item_id": {
+ "type": "string",
+ "description": "Unique ID for the output item associated with the web search call."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "part": {
- "$ref": "#/components/schemas/OpenAI.OutputContent",
- "description": "The content part that is done."
+ "description": "The sequence number of the web search call being processed."
}
},
"allOf": [
@@ -45337,36 +67289,41 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when a content part is done.",
+ "description": "Emitted when a web search call is completed.",
"x-oaiMeta": {
- "name": "response.content_part.done",
+ "name": "response.web_search_call.completed",
"group": "responses",
- "example": "{\n \"type\": \"response.content_part.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"sequence_number\": 1,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n}\n"
+ "example": "{\n \"type\": \"response.web_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
}
},
- "OpenAI.ResponseCreatedEvent": {
+ "OpenAI.ResponseWebSearchCallInProgressEvent": {
"type": "object",
"required": [
"type",
- "response",
+ "output_index",
+ "item_id",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.created"
+ "response.web_search_call.in_progress"
],
- "description": "The type of the event. Always `response.created`.",
+ "description": "The type of the event. Always `response.web_search_call.in_progress`.",
"x-stainless-const": true
},
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The response that was created."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the web search call is associated with."
+ },
+ "item_id": {
+ "type": "string",
+ "description": "Unique ID for the output item associated with the web search call."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number for this event."
+ "description": "The sequence number of the web search call being processed."
}
},
"allOf": [
@@ -45374,46 +67331,41 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "An event that is emitted when a response is created.",
+ "description": "Emitted when a web search call is initiated.",
"x-oaiMeta": {
- "name": "response.created",
+ "name": "response.web_search_call.in_progress",
"group": "responses",
- "example": "{\n \"type\": \"response.created\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.web_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
}
},
- "OpenAI.ResponseCustomToolCallInputDeltaEvent": {
+ "OpenAI.ResponseWebSearchCallSearchingEvent": {
"type": "object",
"required": [
"type",
- "sequence_number",
"output_index",
"item_id",
- "delta"
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.custom_tool_call_input.delta"
+ "response.web_search_call.searching"
],
- "description": "The event type identifier.",
+ "description": "The type of the event. Always `response.web_search_call.searching`.",
"x-stainless-const": true
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output this delta applies to."
+ "description": "The index of the output item that the web search call is associated with."
},
"item_id": {
"type": "string",
- "description": "Unique identifier for the API item associated with this event."
+ "description": "Unique ID for the output item associated with the web search call."
},
- "delta": {
- "type": "string",
- "description": "The incremental input data (delta) for the custom tool call."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the web search call being processed."
}
},
"allOf": [
@@ -45421,391 +67373,953 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Event representing a delta (partial update) to the input of a custom tool call.",
- "title": "ResponseCustomToolCallInputDelta",
+ "description": "Emitted when a web search call is executing.",
"x-oaiMeta": {
- "name": "response.custom_tool_call_input.delta",
+ "name": "response.web_search_call.searching",
"group": "responses",
- "example": "{\n \"type\": \"response.custom_tool_call_input.delta\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"delta\": \"partial input text\"\n}\n"
+ "example": "{\n \"type\": \"response.web_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
}
},
- "OpenAI.ResponseCustomToolCallInputDoneEvent": {
+ "OpenAI.RunCompletionUsage": {
+ "type": "object",
+ "required": [
+ "completion_tokens",
+ "prompt_tokens",
+ "total_tokens"
+ ],
+ "properties": {
+ "completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of completion tokens used over the course of the run."
+ },
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of prompt tokens used over the course of the run."
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Total number of tokens used (prompt + completion)."
+ }
+ },
+ "description": "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.)."
+ },
+ "OpenAI.RunGraderRequest": {
+ "type": "object",
+ "required": [
+ "grader",
+ "model_sample"
+ ],
+ "properties": {
+ "grader": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderMulti"
+ }
+ ],
+ "description": "The grader used for the fine-tuning job."
+ },
+ "item": {
+ "$ref": "#/components/schemas/OpenAI.RunGraderRequestItem",
+ "description": "The dataset item provided to the grader. This will be used to populate\n the `item` namespace. See [the guide](/docs/guides/graders) for more details."
+ },
+ "model_sample": {
+ "type": "string",
+ "description": "The model sample to be evaluated. This value will be used to populate\n the `sample` namespace. See [the guide](/docs/guides/graders) for more details.\n The `output_json` variable will be populated if the model sample is a\n valid JSON string."
+ }
+ },
+ "title": "RunGraderRequest"
+ },
+ "OpenAI.RunGraderRequestItem": {
+ "type": "object"
+ },
+ "OpenAI.RunGraderResponse": {
+ "type": "object",
+ "required": [
+ "reward",
+ "metadata",
+ "sub_rewards",
+ "model_grader_token_usage_per_model"
+ ],
+ "properties": {
+ "reward": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "metadata": {
+ "$ref": "#/components/schemas/OpenAI.RunGraderResponseMetadata"
+ },
+ "sub_rewards": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "model_grader_token_usage_per_model": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
+ }
+ },
+ "OpenAI.RunGraderResponseMetadata": {
"type": "object",
"required": [
+ "name",
"type",
- "sequence_number",
- "output_index",
- "item_id",
- "input"
+ "errors",
+ "execution_time",
+ "scores",
+ "token_usage",
+ "sampled_model_name"
],
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
+ "type": "string"
+ },
+ "errors": {
+ "$ref": "#/components/schemas/OpenAI.RunGraderResponseMetadataErrors"
+ },
+ "execution_time": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "scores": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "token_usage": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "sampled_model_name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.RunGraderResponseMetadataErrors": {
+ "type": "object",
+ "required": [
+ "formula_parse_error",
+ "sample_parse_error",
+ "truncated_observation_error",
+ "unresponsive_reward_error",
+ "invalid_variable_error",
+ "other_error",
+ "python_grader_server_error",
+ "python_grader_server_error_type",
+ "python_grader_runtime_error",
+ "python_grader_runtime_error_details",
+ "model_grader_server_error",
+ "model_grader_refusal_error",
+ "model_grader_parse_error",
+ "model_grader_server_error_details"
+ ],
+ "properties": {
+ "formula_parse_error": {
+ "type": "boolean"
+ },
+ "sample_parse_error": {
+ "type": "boolean"
+ },
+ "truncated_observation_error": {
+ "type": "boolean"
+ },
+ "unresponsive_reward_error": {
+ "type": "boolean"
+ },
+ "invalid_variable_error": {
+ "type": "boolean"
+ },
+ "other_error": {
+ "type": "boolean"
+ },
+ "python_grader_server_error": {
+ "type": "boolean"
+ },
+ "python_grader_server_error_type": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "python_grader_runtime_error": {
+ "type": "boolean"
+ },
+ "python_grader_runtime_error_details": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "model_grader_server_error": {
+ "type": "boolean"
+ },
+ "model_grader_refusal_error": {
+ "type": "boolean"
+ },
+ "model_grader_parse_error": {
+ "type": "boolean"
+ },
+ "model_grader_server_error_details": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.RunObject": {
+ "type": "object",
+ "required": [
+ "id",
+ "object",
+ "created_at",
+ "thread_id",
+ "assistant_id",
+ "status",
+ "required_action",
+ "last_error",
+ "expires_at",
+ "started_at",
+ "cancelled_at",
+ "failed_at",
+ "completed_at",
+ "incomplete_details",
+ "model",
+ "instructions",
+ "tools",
+ "metadata",
+ "usage",
+ "max_prompt_tokens",
+ "max_completion_tokens",
+ "truncation_strategy",
+ "tool_choice",
+ "parallel_tool_calls",
+ "response_format"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "response.custom_tool_call_input.done"
+ "thread.run"
],
- "description": "The event type identifier.",
+ "description": "The object type, which is always `thread.run`.",
"x-stainless-const": true
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the run was created."
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output this event applies to."
+ "thread_id": {
+ "type": "string",
+ "description": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run."
},
- "item_id": {
+ "assistant_id": {
"type": "string",
- "description": "Unique identifier for the API item associated with this event."
+ "description": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run."
},
- "input": {
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.RunStatus",
+ "description": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`."
+ },
+ "required_action": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunObjectRequiredAction"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Details on the action required to continue the run. Will be `null` if no action is required."
+ },
+ "last_error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunObjectLastError"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The last error associated with this run. Will be `null` if there are no errors."
+ },
+ "expires_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run will expire."
+ },
+ "started_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run was started."
+ },
+ "cancelled_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run was cancelled."
+ },
+ "failed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run failed."
+ },
+ "completed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run was completed."
+ },
+ "incomplete_details": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunObjectIncompleteDetails"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Details on why the run is incomplete. Will be `null` if the run is not incomplete."
+ },
+ "model": {
"type": "string",
- "description": "The complete input data for the custom tool call."
+ "description": "The model that the [assistant](/docs/api-reference/assistants) used for this run."
+ },
+ "instructions": {
+ "type": "string",
+ "description": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ },
+ "maxItems": 20,
+ "description": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.",
+ "default": []
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "usage": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunCompletionUsage"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The sampling temperature used for this run. If not set, defaults to 1."
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The nucleus sampling value used for this run. If not set, defaults to 1."
+ },
+ "max_prompt_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "The maximum number of prompt tokens specified to have been used over the course of the run."
+ },
+ "max_completion_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "The maximum number of completion tokens specified to have been used over the course of the run."
+ },
+ "truncation_strategy": {
+ "$ref": "#/components/schemas/OpenAI.TruncationObject"
+ },
+ "tool_choice": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption"
+ },
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
+ "default": true
+ },
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "description": "Represents an execution run on a [thread](/docs/api-reference/threads).",
+ "title": "A run on a thread",
+ "x-oaiMeta": {
+ "name": "The run object",
+ "beta": true,
+ "example": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1698107661,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699073476,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699073498,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [{\"type\": \"file_search\"}, {\"type\": \"code_interpreter\"}],\n \"metadata\": {},\n \"incomplete_details\": null,\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ }
+ },
+ "OpenAI.RunObjectIncompleteDetails": {
+ "type": "object",
+ "properties": {
+ "reason": {
+ "type": "string",
+ "enum": [
+ "max_completion_tokens",
+ "max_prompt_tokens"
+ ]
}
+ }
+ },
+ "OpenAI.RunObjectLastError": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
],
- "description": "Event indicating that input for a custom tool call is complete.",
- "title": "ResponseCustomToolCallInputDone",
- "x-oaiMeta": {
- "name": "response.custom_tool_call_input.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.custom_tool_call_input.done\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"input\": \"final complete input text\"\n}\n"
+ "properties": {
+ "code": {
+ "type": "string",
+ "enum": [
+ "server_error",
+ "rate_limit_exceeded",
+ "invalid_prompt"
+ ]
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.RunObjectRequiredAction": {
+ "type": "object",
+ "required": [
+ "type",
+ "submit_tool_outputs"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "submit_tool_outputs"
+ ],
+ "x-stainless-const": true
+ },
+ "submit_tool_outputs": {
+ "$ref": "#/components/schemas/OpenAI.RunObjectRequiredActionSubmitToolOutputs"
+ }
+ }
+ },
+ "OpenAI.RunObjectRequiredActionSubmitToolOutputs": {
+ "type": "object",
+ "required": [
+ "tool_calls"
+ ],
+ "properties": {
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunToolCallObject"
+ }
+ }
}
},
- "OpenAI.ResponseError": {
+ "OpenAI.RunStatus": {
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "requires_action",
+ "cancelling",
+ "cancelled",
+ "failed",
+ "completed",
+ "incomplete",
+ "expired"
+ ],
+ "description": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`."
+ },
+ "OpenAI.RunStepCompletionUsage": {
"type": "object",
"required": [
- "code",
- "message"
+ "completion_tokens",
+ "prompt_tokens",
+ "total_tokens"
],
"properties": {
- "code": {
- "$ref": "#/components/schemas/OpenAI.ResponseErrorCode"
+ "completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of completion tokens used over the course of the run step."
},
- "message": {
- "type": "string",
- "description": "A human-readable description of the error."
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of prompt tokens used over the course of the run step."
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Total number of tokens used (prompt + completion)."
}
},
- "description": "An error object returned when the model fails to generate a Response."
- },
- "OpenAI.ResponseErrorCode": {
- "type": "string",
- "enum": [
- "server_error",
- "rate_limit_exceeded",
- "invalid_prompt",
- "vector_store_timeout",
- "invalid_image",
- "invalid_image_format",
- "invalid_base64_image",
- "invalid_image_url",
- "image_too_large",
- "image_too_small",
- "image_parse_error",
- "image_content_policy_violation",
- "invalid_image_mode",
- "image_file_too_large",
- "unsupported_image_media_type",
- "empty_image_file",
- "failed_to_download_image",
- "image_file_not_found"
- ],
- "description": "The error code for the response."
+ "description": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`."
},
- "OpenAI.ResponseErrorEvent": {
+ "OpenAI.RunStepDetailsMessageCreationObject": {
"type": "object",
"required": [
"type",
- "code",
- "message",
- "param",
- "sequence_number"
+ "message_creation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "error"
+ "message_creation"
],
- "description": "The type of the event. Always `error`.",
+ "description": "Always `message_creation`.",
"x-stainless-const": true
},
- "code": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "message": {
- "type": "string",
- "description": "The error message."
- },
- "param": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "message_creation": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsMessageCreationObjectMessageCreation"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "description": "Details of the message creation by the run step.",
+ "title": "Message creation"
+ },
+ "OpenAI.RunStepDetailsMessageCreationObjectMessageCreation": {
+ "type": "object",
+ "required": [
+ "message_id"
+ ],
+ "properties": {
+ "message_id": {
+ "type": "string"
}
+ }
+ },
+ "OpenAI.RunStepDetailsToolCall": {
+ "type": "object",
+ "required": [
+ "type"
],
- "description": "Emitted when an error occurs.",
- "x-oaiMeta": {
- "name": "error",
- "group": "responses",
- "example": "{\n \"type\": \"error\",\n \"code\": \"ERR_SOMETHING\",\n \"message\": \"Something went wrong\",\n \"param\": null,\n \"sequence_number\": 1\n}\n"
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "code_interpreter": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObject",
+ "file_search": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObject",
+ "function": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObject"
+ }
}
},
- "OpenAI.ResponseFailedEvent": {
+ "OpenAI.RunStepDetailsToolCallType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "code_interpreter",
+ "file_search",
+ "function"
+ ]
+ }
+ ]
+ },
+ "OpenAI.RunStepDetailsToolCallsCodeObject": {
"type": "object",
"required": [
+ "id",
"type",
- "sequence_number",
- "response"
+ "code_interpreter"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call."
+ },
"type": {
"type": "string",
"enum": [
- "response.failed"
+ "code_interpreter"
],
- "description": "The type of the event. Always `response.failed`.",
+ "description": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.",
"x-stainless-const": true
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The response that failed."
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter",
+ "description": "The Code Interpreter tool call definition."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall"
}
],
- "description": "An event that is emitted when a response fails.",
- "x-oaiMeta": {
- "name": "response.failed",
- "group": "responses",
- "example": "{\n \"type\": \"response.failed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"failed\",\n \"completed_at\": null,\n \"error\": {\n \"code\": \"server_error\",\n \"message\": \"The model failed to generate a response.\"\n },\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n }\n}\n"
+ "description": "Details of the Code Interpreter tool call the run step was involved in.",
+ "title": "Code Interpreter tool call"
+ },
+ "OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter": {
+ "type": "object",
+ "required": [
+ "input",
+ "outputs"
+ ],
+ "properties": {
+ "input": {
+ "type": "string"
+ },
+ "outputs": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObject"
+ }
+ ]
+ }
+ }
}
},
- "OpenAI.ResponseFileSearchCallCompletedEvent": {
+ "OpenAI.RunStepDetailsToolCallsCodeOutputImageObject": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "image"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.file_search_call.completed"
+ "image"
],
- "description": "The type of the event. Always `response.file_search_call.completed`.",
+ "description": "Always `image`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the file search call is initiated."
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the file search call is initiated."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "image": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
+ "title": "Code Interpreter image output"
+ },
+ "OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage": {
+ "type": "object",
+ "required": [
+ "file_id"
],
- "description": "Emitted when a file search call is completed (results found).",
- "x-oaiMeta": {
- "name": "response.file_search_call.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.file_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
+ "properties": {
+ "file_id": {
+ "type": "string"
+ }
}
},
- "OpenAI.ResponseFileSearchCallInProgressEvent": {
+ "OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "logs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.file_search_call.in_progress"
+ "logs"
],
- "description": "The type of the event. Always `response.file_search_call.in_progress`.",
+ "description": "Always `logs`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the file search call is initiated."
- },
- "item_id": {
+ "logs": {
"type": "string",
- "description": "The ID of the output item that the file search call is initiated."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "description": "The text output from the Code Interpreter tool call."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Emitted when a file search call is initiated.",
- "x-oaiMeta": {
- "name": "response.file_search_call.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.file_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Text output from the Code Interpreter tool call as part of a run step.",
+ "title": "Code Interpreter log output"
},
- "OpenAI.ResponseFileSearchCallSearchingEvent": {
+ "OpenAI.RunStepDetailsToolCallsFileSearchObject": {
"type": "object",
"required": [
+ "id",
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "file_search"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call object."
+ },
"type": {
"type": "string",
"enum": [
- "response.file_search_call.searching"
+ "file_search"
],
- "description": "The type of the event. Always `response.file_search_call.searching`.",
+ "description": "The type of tool call. This is always going to be `file_search` for this type of tool call.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the file search call is searching."
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the file search call is initiated."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch",
+ "description": "For now, this is always going to be an empty object.",
+ "x-oaiTypeLabel": "map"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall"
}
],
- "description": "Emitted when a file search is currently searching.",
- "x-oaiMeta": {
- "name": "response.file_search_call.searching",
- "group": "responses",
- "example": "{\n \"type\": \"response.file_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
+ "title": "File search tool call"
+ },
+ "OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch": {
+ "type": "object",
+ "properties": {
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObject"
+ }
+ }
}
},
- "OpenAI.ResponseFormatJsonObject": {
+ "OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject": {
"type": "object",
"required": [
- "type"
+ "ranker",
+ "score_threshold"
+ ],
+ "properties": {
+ "ranker": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchRanker"
+ },
+ "score_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1."
+ }
+ },
+ "description": "The ranking options for the file search.",
+ "title": "File search tool call ranking options"
+ },
+ "OpenAI.RunStepDetailsToolCallsFileSearchResultObject": {
+ "type": "object",
+ "required": [
+ "file_id",
+ "file_name",
+ "score"
],
+ "properties": {
+ "file_id": {
+ "type": "string",
+ "description": "The ID of the file that result was found in."
+ },
+ "file_name": {
+ "type": "string",
+ "description": "The name of the file that result was found in."
+ },
+ "score": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The score of the result. All values must be a floating point number between 0 and 1."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent"
+ },
+ "description": "The content of the result that was found. The content is only included if requested via the include query parameter."
+ }
+ },
+ "description": "A result instance of the file search.",
+ "title": "File search tool call result",
+ "x-oaiTypeLabel": "map"
+ },
+ "OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent": {
+ "type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
- "json_object"
+ "text"
],
- "description": "The type of response format being defined. Always `json_object`.",
"x-stainless-const": true
+ },
+ "text": {
+ "type": "string"
}
- },
- "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
- "title": "JSON object"
+ }
},
- "OpenAI.ResponseFormatJsonSchema": {
+ "OpenAI.RunStepDetailsToolCallsFunctionObject": {
"type": "object",
"required": [
+ "id",
"type",
- "json_schema"
+ "function"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call object."
+ },
"type": {
"type": "string",
"enum": [
- "json_schema"
+ "function"
],
- "description": "The type of response format being defined. Always `json_schema`.",
+ "description": "The type of tool call. This is always going to be `function` for this type of tool call.",
"x-stainless-const": true
},
- "json_schema": {
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema",
- "description": "Structured Outputs configuration options, including a JSON Schema.",
- "title": "JSON schema"
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObjectFunction",
+ "description": "The definition of the function that was called."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall"
}
],
- "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).",
- "title": "JSON schema"
+ "title": "Function tool call"
},
- "OpenAI.ResponseFormatJsonSchemaJsonSchema": {
+ "OpenAI.RunStepDetailsToolCallsFunctionObjectFunction": {
"type": "object",
"required": [
- "name"
+ "name",
+ "arguments",
+ "output"
],
"properties": {
- "description": {
- "type": "string"
- },
"name": {
"type": "string"
},
- "schema": {
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema"
+ "arguments": {
+ "type": "string"
},
- "strict": {
+ "output": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
@@ -45814,2265 +68328,2188 @@
}
}
},
- "OpenAI.ResponseFormatJsonSchemaSchema": {
+ "OpenAI.RunStepDetailsToolCallsObject": {
"type": "object",
- "unevaluatedProperties": {},
- "description": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).",
- "title": "JSON schema"
+ "required": [
+ "type",
+ "tool_calls"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "tool_calls"
+ ],
+ "description": "Always `tool_calls`.",
+ "x-stainless-const": true
+ },
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall"
+ },
+ "description": "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`."
+ }
+ },
+ "description": "Details of the tool call.",
+ "title": "Tool calls"
},
- "OpenAI.ResponseFormatText": {
+ "OpenAI.RunStepObject": {
"type": "object",
"required": [
- "type"
+ "id",
+ "object",
+ "created_at",
+ "assistant_id",
+ "thread_id",
+ "run_id",
+ "type",
+ "status",
+ "step_details",
+ "last_error",
+ "expired_at",
+ "cancelled_at",
+ "failed_at",
+ "completed_at",
+ "metadata",
+ "usage"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier of the run step, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "text"
+ "thread.run.step"
],
- "description": "The type of response format being defined. Always `text`.",
+ "description": "The object type, which is always `thread.run.step`.",
"x-stainless-const": true
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the run step was created."
+ },
+ "assistant_id": {
+ "type": "string",
+ "description": "The ID of the [assistant](/docs/api-reference/assistants) associated with the run step."
+ },
+ "thread_id": {
+ "type": "string",
+ "description": "The ID of the [thread](/docs/api-reference/threads) that was run."
+ },
+ "run_id": {
+ "type": "string",
+ "description": "The ID of the [run](/docs/api-reference/runs) that this run step is a part of."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "message_creation",
+ "tool_calls"
+ ],
+ "description": "The type of run step, which can be either `message_creation` or `tool_calls`."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "cancelled",
+ "failed",
+ "completed",
+ "expired"
+ ],
+ "description": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`."
+ },
+ "step_details": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsMessageCreationObject"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsObject"
+ }
+ ],
+ "description": "The details of the run step."
+ },
+ "last_error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepObjectLastError"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "expired_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "cancelled_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "failed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "completed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.RunStepCompletionUsage"
+ }
+ },
+ "description": "Represents a step in execution of a run.",
+ "title": "Run steps",
+ "x-oaiMeta": {
+ "name": "The run step object",
+ "beta": true,
+ "example": "{\n \"id\": \"step_abc123\",\n \"object\": \"thread.run.step\",\n \"created_at\": 1699063291,\n \"run_id\": \"run_abc123\",\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"type\": \"message_creation\",\n \"status\": \"completed\",\n \"cancelled_at\": null,\n \"completed_at\": 1699063291,\n \"expired_at\": null,\n \"failed_at\": null,\n \"last_error\": null,\n \"step_details\": {\n \"type\": \"message_creation\",\n \"message_creation\": {\n \"message_id\": \"msg_abc123\"\n }\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n }\n}\n"
+ }
+ },
+ "OpenAI.RunStepObjectLastError": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "string",
+ "enum": [
+ "server_error",
+ "rate_limit_exceeded"
+ ]
+ },
+ "message": {
+ "type": "string"
}
- },
- "description": "Default response format. Used to generate text responses.",
- "title": "Text"
+ }
},
- "OpenAI.ResponseFunctionCallArgumentsDeltaEvent": {
+ "OpenAI.RunToolCallObject": {
"type": "object",
"required": [
+ "id",
"type",
- "item_id",
- "output_index",
- "sequence_number",
- "delta"
+ "function"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "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](/docs/api-reference/runs/submitToolOutputs) endpoint."
+ },
"type": {
"type": "string",
"enum": [
- "response.function_call_arguments.delta"
+ "function"
],
- "description": "The type of the event. Always `response.function_call_arguments.delta`.",
+ "description": "The type of tool call the output is required for. For now, this is always `function`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the function-call arguments delta is added to."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the function-call arguments delta is added to."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "delta": {
- "type": "string",
- "description": "The function-call arguments delta that is added."
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.RunToolCallObjectFunction",
+ "description": "The function definition."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Emitted when there is a partial function-call arguments delta.",
- "x-oaiMeta": {
- "name": "response.function_call_arguments.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.function_call_arguments.delta\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"delta\": \"{ \"arg\":\"\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Tool call objects"
},
- "OpenAI.ResponseFunctionCallArgumentsDoneEvent": {
+ "OpenAI.RunToolCallObjectFunction": {
"type": "object",
"required": [
- "type",
- "item_id",
"name",
- "output_index",
- "sequence_number",
"arguments"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "response.function_call_arguments.done"
- ],
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the item."
- },
"name": {
- "type": "string",
- "description": "The name of the function that was called."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "type": "string"
},
"arguments": {
- "type": "string",
- "description": "The function-call arguments."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "type": "string"
}
- ],
- "description": "Emitted when function-call arguments are finalized.",
- "x-oaiMeta": {
- "name": "response.function_call_arguments.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.function_call_arguments.done\",\n \"item_id\": \"item-abc\",\n \"name\": \"get_weather\",\n \"output_index\": 1,\n \"arguments\": \"{ \"arg\": 123 }\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseImageGenCallCompletedEvent": {
+ "OpenAI.ScreenshotParam": {
"type": "object",
"required": [
- "type",
- "output_index",
- "sequence_number",
- "item_id"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.image_generation_call.completed"
+ "screenshot"
],
- "description": "The type of the event. Always 'response.image_generation_call.completed'.",
+ "description": "Specifies the event type. For a screenshot action, this property is always set to `screenshot`.",
"x-stainless-const": true
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the image generation item being processed."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "Emitted when an image generation tool call has completed and the final image is available.",
- "title": "ResponseImageGenCallCompletedEvent",
- "x-oaiMeta": {
- "name": "response.image_generation_call.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.image_generation_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "A screenshot action.",
+ "title": "Screenshot"
},
- "OpenAI.ResponseImageGenCallGeneratingEvent": {
+ "OpenAI.ScrollParam": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "x",
+ "y",
+ "scroll_x",
+ "scroll_y"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.image_generation_call.generating"
+ "scroll"
],
- "description": "The type of the event. Always 'response.image_generation_call.generating'.",
+ "description": "Specifies the event type. For a scroll action, this property is always set to `scroll`.",
"x-stainless-const": true
},
- "output_index": {
+ "x": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
+ "description": "The x-coordinate where the scroll occurred."
},
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the image generation item being processed."
+ "y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The y-coordinate where the scroll occurred."
},
- "sequence_number": {
+ "scroll_x": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the image generation item being processed."
+ "description": "The horizontal scroll distance."
+ },
+ "scroll_y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The vertical scroll distance."
+ },
+ "keys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "Emitted when an image generation tool call is actively generating an image (intermediate state).",
- "title": "ResponseImageGenCallGeneratingEvent",
- "x-oaiMeta": {
- "name": "response.image_generation_call.generating",
- "group": "responses",
- "example": "{\n \"type\": \"response.image_generation_call.generating\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n"
- }
+ "description": "A scroll action.",
+ "title": "Scroll"
},
- "OpenAI.ResponseImageGenCallInProgressEvent": {
- "type": "object",
- "required": [
- "type",
- "output_index",
- "item_id",
- "sequence_number"
- ],
- "properties": {
- "type": {
+ "OpenAI.SearchContentType": {
+ "type": "string",
+ "enum": [
+ "text",
+ "image"
+ ]
+ },
+ "OpenAI.SearchContextSize": {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high"
+ ]
+ },
+ "OpenAI.ServiceTier": {
+ "anyOf": [
+ {
"type": "string",
"enum": [
- "response.image_generation_call.in_progress"
- ],
- "description": "The type of the event. Always 'response.image_generation_call.in_progress'.",
- "x-stainless-const": true
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the image generation item being processed."
+ "auto",
+ "default",
+ "flex",
+ "scale",
+ "priority"
+ ]
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the image generation item being processed."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "type": "null"
}
],
- "description": "Emitted when an image generation tool call is in progress.",
- "title": "ResponseImageGenCallInProgressEvent",
- "x-oaiMeta": {
- "name": "response.image_generation_call.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.image_generation_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n"
- }
+ "description": "Specifies the processing type used for serving the request.\n- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n- If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.\n- When not set, the default behavior is 'auto'.\nWhen 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."
},
- "OpenAI.ResponseImageGenCallPartialImageEvent": {
+ "OpenAI.ServiceTierEnum": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "default",
+ "flex",
+ "priority"
+ ]
+ },
+ "OpenAI.SkillReferenceParam": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "sequence_number",
- "partial_image_index",
- "partial_image_b64"
+ "skill_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.image_generation_call.partial_image"
+ "skill_reference"
],
- "description": "The type of the event. Always 'response.image_generation_call.partial_image'.",
+ "description": "References a skill created with the /v1/skills endpoint.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "item_id": {
+ "skill_id": {
"type": "string",
- "description": "The unique identifier of the image generation item being processed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the image generation item being processed."
- },
- "partial_image_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "0-based index for the partial image (backend is 1-based, but this is 0-based for the user)."
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The ID of the referenced skill."
},
- "partial_image_b64": {
+ "version": {
"type": "string",
- "description": "Base64-encoded partial image data, suitable for rendering as an image."
+ "description": "Optional skill version. Use a positive integer or 'latest'. Omit for default."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ContainerSkill"
}
- ],
- "description": "Emitted when a partial image is available during image generation streaming.",
- "title": "ResponseImageGenCallPartialImageEvent",
- "x-oaiMeta": {
- "name": "response.image_generation_call.partial_image",
- "group": "responses",
- "example": "{\n \"type\": \"response.image_generation_call.partial_image\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0,\n \"partial_image_index\": 0,\n \"partial_image_b64\": \"...\"\n}\n"
- }
+ ]
},
- "OpenAI.ResponseInProgressEvent": {
+ "OpenAI.SpecificApplyPatchParam": {
"type": "object",
"required": [
- "type",
- "response",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.in_progress"
+ "apply_patch"
],
- "description": "The type of the event. Always `response.in_progress`.",
+ "description": "The tool to call. Always `apply_patch`.",
"x-stainless-const": true
- },
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The response that is in progress."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when the response is in progress.",
- "x-oaiMeta": {
- "name": "response.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.in_progress\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
- }
- },
- "OpenAI.ResponseIncompleteDetails": {
- "type": "object",
- "properties": {
- "reason": {
- "type": "string",
- "enum": [
- "max_output_tokens",
- "content_filter"
- ]
- }
- }
+ "description": "Forces the model to call the apply_patch tool when executing a tool call.",
+ "title": "Specific apply patch tool choice"
},
- "OpenAI.ResponseIncompleteEvent": {
+ "OpenAI.SpecificFunctionShellParam": {
"type": "object",
"required": [
- "type",
- "response",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.incomplete"
+ "shell"
],
- "description": "The type of the event. Always `response.incomplete`.",
+ "description": "The tool to call. Always `shell`.",
"x-stainless-const": true
- },
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The response that was incomplete."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "An event that is emitted when a response finishes as incomplete.",
- "x-oaiMeta": {
- "name": "response.incomplete",
- "group": "responses",
- "example": "{\n \"type\": \"response.incomplete\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"incomplete\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": {\n \"reason\": \"max_tokens\"\n },\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Forces the model to call the shell tool when a tool call is required.",
+ "title": "Specific shell tool choice"
},
- "OpenAI.ResponseLogProb": {
+ "OpenAI.StaticChunkingStrategy": {
"type": "object",
"required": [
- "token",
- "logprob"
+ "max_chunk_size_tokens",
+ "chunk_overlap_tokens"
],
"properties": {
- "token": {
- "type": "string",
- "description": "A possible text token."
- },
- "logprob": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The log probability of this token."
- },
- "top_logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ResponseLogProbTopLogprobs"
- },
- "description": "The log probabilities of up to 20 of the most likely tokens."
- }
- },
- "description": "A logprob is the logarithmic probability that the model assigns to producing\na particular token at a given position in the sequence. Less-negative (higher)\nlogprob values indicate greater model confidence in that token choice."
- },
- "OpenAI.ResponseLogProbTopLogprobs": {
- "type": "object",
- "properties": {
- "token": {
- "type": "string"
+ "max_chunk_size_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 100,
+ "maximum": 4096,
+ "description": "The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`."
},
- "logprob": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "chunk_overlap_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of tokens that overlap between chunks. The default value is `400`.\n Note that the overlap must not exceed half of `max_chunk_size_tokens`."
}
}
},
- "OpenAI.ResponseMCPCallArgumentsDeltaEvent": {
+ "OpenAI.StaticChunkingStrategyRequestParam": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "delta",
- "sequence_number"
+ "static"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_call_arguments.delta"
+ "static"
],
- "description": "The type of the event. Always 'response.mcp_call_arguments.delta'.",
+ "description": "Always `static`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the MCP tool call item being processed."
- },
- "delta": {
- "type": "string",
- "description": "A JSON string containing the partial update to the arguments for the MCP tool call."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "static": {
+ "$ref": "#/components/schemas/OpenAI.StaticChunkingStrategy"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam"
}
],
- "description": "Emitted when there is a delta (partial update) to the arguments of an MCP tool call.",
- "title": "ResponseMCPCallArgumentsDeltaEvent",
- "x-oaiMeta": {
- "name": "response.mcp_call_arguments.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call_arguments.delta\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"delta\": \"{\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Customize your own chunking strategy by setting chunk size and chunk overlap.",
+ "title": "Static Chunking Strategy"
},
- "OpenAI.ResponseMCPCallArgumentsDoneEvent": {
+ "OpenAI.StaticChunkingStrategyResponseParam": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "arguments",
- "sequence_number"
+ "static"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_call_arguments.done"
+ "static"
],
- "description": "The type of the event. Always 'response.mcp_call_arguments.done'.",
+ "description": "Always `static`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the MCP tool call item being processed."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string containing the finalized arguments for the MCP tool call."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "static": {
+ "$ref": "#/components/schemas/OpenAI.StaticChunkingStrategy"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse"
}
],
- "description": "Emitted when the arguments for an MCP tool call are finalized.",
- "title": "ResponseMCPCallArgumentsDoneEvent",
- "x-oaiMeta": {
- "name": "response.mcp_call_arguments.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call_arguments.done\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"arguments\": \"{\"arg1\": \"value1\", \"arg2\": \"value2\"}\",\n \"sequence_number\": 1\n}\n"
- }
+ "title": "Static Chunking Strategy"
},
- "OpenAI.ResponseMCPCallCompletedEvent": {
+ "OpenAI.StopConfiguration": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ ],
+ "description": "Not supported with latest reasoning models `o3` and `o4-mini`.\nUp to 4 sequences where the API will stop generating further tokens. The\nreturned text will not contain the stop sequence."
+ },
+ "OpenAI.SubmitToolOutputsRunRequest": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "sequence_number"
+ "tool_outputs"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "response.mcp_call.completed"
- ],
- "description": "The type of the event. Always 'response.mcp_call.completed'.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the MCP tool call item that completed."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that completed."
+ "tool_outputs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SubmitToolOutputsRunRequestToolOutputs"
+ },
+ "description": "A list of tools for which the outputs are being submitted."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.SubmitToolOutputsRunRequestToolOutputs": {
+ "type": "object",
+ "properties": {
+ "tool_call_id": {
+ "type": "string"
+ },
+ "output": {
+ "type": "string"
}
- ],
- "description": "Emitted when an MCP tool call has completed successfully.",
- "title": "ResponseMCPCallCompletedEvent",
- "x-oaiMeta": {
- "name": "response.mcp_call.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call.completed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n"
}
},
- "OpenAI.ResponseMCPCallFailedEvent": {
+ "OpenAI.SummaryTextContent": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "sequence_number"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_call.failed"
+ "summary_text"
],
- "description": "The type of the event. Always 'response.mcp_call.failed'.",
+ "description": "The type of the object. Always `summary_text`.",
"x-stainless-const": true
},
- "item_id": {
+ "text": {
"type": "string",
- "description": "The ID of the MCP tool call item that failed."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that failed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "description": "A summary of the reasoning output from the model so far."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "Emitted when an MCP tool call has failed.",
- "title": "ResponseMCPCallFailedEvent",
- "x-oaiMeta": {
- "name": "response.mcp_call.failed",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call.failed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n"
- }
+ "description": "A summary text from the model.",
+ "title": "Summary text"
},
- "OpenAI.ResponseMCPCallInProgressEvent": {
+ "OpenAI.TextAnnotation": {
"type": "object",
"required": [
- "type",
- "sequence_number",
- "output_index",
- "item_id"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "response.mcp_call.in_progress"
- ],
- "description": "The type of the event. Always 'response.mcp_call.in_progress'.",
- "x-stainless-const": true
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the MCP tool call item being processed."
+ "$ref": "#/components/schemas/OpenAI.TextAnnotationType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "file_citation": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObject",
+ "file_path": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObject"
}
- ],
- "description": "Emitted when an MCP tool call is in progress.",
- "title": "ResponseMCPCallInProgressEvent",
- "x-oaiMeta": {
- "name": "response.mcp_call.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\"\n}\n"
}
},
- "OpenAI.ResponseMCPListToolsCompletedEvent": {
+ "OpenAI.TextAnnotationType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "file_citation",
+ "file_path"
+ ]
+ }
+ ]
+ },
+ "OpenAI.TextContent": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "sequence_number"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_list_tools.completed"
+ "text"
],
- "description": "The type of the event. Always 'response.mcp_list_tools.completed'.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the MCP tool call item that produced this output."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that was processed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "text": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "Emitted when the list of available MCP tools has been successfully retrieved.",
- "title": "ResponseMCPListToolsCompletedEvent",
- "x-oaiMeta": {
- "name": "response.mcp_list_tools.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_list_tools.completed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
- }
+ "description": "A text content.",
+ "title": "Text Content"
},
- "OpenAI.ResponseMCPListToolsFailedEvent": {
+ "OpenAI.TextResponseFormatConfiguration": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "response.mcp_list_tools.failed"
- ],
- "description": "The type of the event. Always 'response.mcp_list_tools.failed'.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the MCP tool call item that failed."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that failed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfigurationType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "json_schema": "#/components/schemas/OpenAI.TextResponseFormatJsonSchema",
+ "text": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText",
+ "json_object": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject"
}
- ],
- "description": "Emitted when the attempt to list available MCP tools has failed.",
- "title": "ResponseMCPListToolsFailedEvent",
- "x-oaiMeta": {
- "name": "response.mcp_list_tools.failed",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_list_tools.failed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
- }
+ },
+ "description": "An object specifying the format that the model must output.\nConfiguring `{ \"type\": \"json_schema\" }` enables Structured Outputs,\nwhich ensures the model will match your supplied JSON schema. Learn more in the\n[Structured Outputs guide](/docs/guides/structured-outputs).\nThe default format is `{ \"type\": \"text\" }` with no additional options.\n*Not recommended for gpt-4o and newer models:**\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it."
},
- "OpenAI.ResponseMCPListToolsInProgressEvent": {
+ "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_list_tools.in_progress"
+ "json_object"
],
- "description": "The type of the event. Always 'response.mcp_list_tools.in_progress'.",
+ "description": "The type of response format being defined. Always `json_object`.",
"x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the MCP tool call item that is being processed."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that is being processed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
}
],
- "description": "Emitted when the system is in the process of retrieving the list of available MCP tools.",
- "title": "ResponseMCPListToolsInProgressEvent",
- "x-oaiMeta": {
- "name": "response.mcp_list_tools.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_list_tools.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
- }
+ "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
+ "title": "JSON object"
},
- "OpenAI.ResponseOutputItemAddedEvent": {
+ "OpenAI.TextResponseFormatConfigurationResponseFormatText": {
"type": "object",
"required": [
- "type",
- "output_index",
- "sequence_number",
- "item"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.output_item.added"
+ "text"
],
- "description": "The type of the event. Always `response.output_item.added`.",
+ "description": "The type of response format being defined. Always `text`.",
"x-stainless-const": true
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that was added."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "item": {
- "$ref": "#/components/schemas/OpenAI.OutputItem",
- "description": "The output item that was added."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
}
],
- "description": "Emitted when a new output item is added.",
- "x-oaiMeta": {
- "name": "response.output_item.added",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_item.added\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"in_progress\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": []\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Default response format. Used to generate text responses.",
+ "title": "Text"
},
- "OpenAI.ResponseOutputItemDoneEvent": {
+ "OpenAI.TextResponseFormatConfigurationType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "text",
+ "json_schema",
+ "json_object"
+ ]
+ }
+ ]
+ },
+ "OpenAI.TextResponseFormatJsonSchema": {
"type": "object",
"required": [
"type",
- "output_index",
- "sequence_number",
- "item"
+ "name",
+ "schema"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.output_item.done"
+ "json_schema"
],
- "description": "The type of the event. Always `response.output_item.done`.",
+ "description": "The type of response format being defined. Always `json_schema`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that was marked done."
+ "description": {
+ "type": "string",
+ "description": "A description of what the response format is for, used by the model to\n determine how to respond in the format."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "name": {
+ "type": "string",
+ "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\n underscores and dashes, with a maximum length of 64."
},
- "item": {
- "$ref": "#/components/schemas/OpenAI.OutputItem",
- "description": "The output item that was marked done."
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema"
+ },
+ "strict": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
}
],
- "description": "Emitted when an output item is marked done.",
- "x-oaiMeta": {
- "name": "response.output_item.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_item.done\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"completed\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n ]\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).",
+ "title": "JSON schema"
},
- "OpenAI.ResponseOutputTextAnnotationAddedEvent": {
+ "OpenAI.ThreadObject": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "annotation_index",
- "sequence_number",
- "annotation"
+ "id",
+ "object",
+ "created_at",
+ "tool_resources",
+ "metadata"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "response.output_text.annotation.added"
+ "thread"
],
- "description": "The type of the event. Always 'response.output_text.annotation.added'.",
+ "description": "The object type, which is always `thread`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the item to which the annotation is being added."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part within the output item."
- },
- "annotation_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the annotation within the content part."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the thread was created."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "annotation": {
- "$ref": "#/components/schemas/OpenAI.Annotation",
- "description": "The annotation object being added. (See annotation schema for details.)"
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Emitted when an annotation is added to output text content.",
- "title": "ResponseOutputTextAnnotationAddedEvent",
+ "description": "Represents a thread that contains [messages](/docs/api-reference/messages).",
+ "title": "Thread",
"x-oaiMeta": {
- "name": "response.output_text.annotation.added",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_text.annotation.added\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"annotation_index\": 0,\n \"annotation\": {\n \"type\": \"text_annotation\",\n \"text\": \"This is a test annotation\",\n \"start\": 0,\n \"end\": 10\n },\n \"sequence_number\": 1\n}\n"
+ "name": "The thread object",
+ "beta": true,
+ "example": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1698107661,\n \"metadata\": {}\n}\n"
}
},
- "OpenAI.ResponsePromptVariables": {
+ "OpenAI.ThreadObjectToolResources": {
"type": "object",
- "unevaluatedProperties": {
- "anyOf": [
- {
+ "properties": {
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResourcesCodeInterpreter"
+ },
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResourcesFileSearch"
+ }
+ }
+ },
+ "OpenAI.ThreadObjectToolResourcesCodeInterpreter": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
"type": "string"
},
- {
- "$ref": "#/components/schemas/OpenAI.InputTextContent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputImageContent"
+ "maxItems": 20
+ }
+ }
+ },
+ "OpenAI.ThreadObjectToolResourcesFileSearch": {
+ "type": "object",
+ "properties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
},
- {
- "$ref": "#/components/schemas/OpenAI.InputFileContent"
- }
- ]
- },
- "description": "Optional map of values to substitute in for variables in your\nprompt. The substitution values can either be strings, or other\nResponse input types like images or files.",
- "title": "Prompt Variables",
- "x-oaiExpandable": true,
- "x-oaiTypeLabel": "map"
+ "maxItems": 1
+ }
+ }
},
- "OpenAI.ResponseQueuedEvent": {
+ "OpenAI.TokenLimits": {
+ "type": "object",
+ "properties": {
+ "post_instructions": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
+ }
+ }
+ },
+ "OpenAI.Tool": {
"type": "object",
"required": [
- "type",
- "response",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "response.queued"
- ],
- "description": "The type of the event. Always 'response.queued'.",
- "x-stainless-const": true
- },
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The full response object that is queued."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number for this event."
+ "$ref": "#/components/schemas/OpenAI.ToolType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "bing_grounding": "#/components/schemas/BingGroundingTool",
+ "fabric_dataagent_preview": "#/components/schemas/MicrosoftFabricPreviewTool",
+ "sharepoint_grounding_preview": "#/components/schemas/SharepointPreviewTool",
+ "azure_ai_search": "#/components/schemas/AzureAISearchTool",
+ "openapi": "#/components/schemas/OpenApiTool",
+ "bing_custom_search_preview": "#/components/schemas/BingCustomSearchPreviewTool",
+ "browser_automation_preview": "#/components/schemas/BrowserAutomationPreviewTool",
+ "azure_function": "#/components/schemas/AzureFunctionTool",
+ "capture_structured_outputs": "#/components/schemas/CaptureStructuredOutputsTool",
+ "a2a_preview": "#/components/schemas/A2APreviewTool",
+ "work_iq_preview": "#/components/schemas/WorkIQPreviewTool",
+ "fabric_iq_preview": "#/components/schemas/FabricIQPreviewTool",
+ "web_iq_preview": "#/components/schemas/WebIQPreviewTool",
+ "memory_search_preview": "#/components/schemas/MemorySearchPreviewTool",
+ "code_interpreter": "#/components/schemas/OpenAI.CodeInterpreterTool",
+ "function": "#/components/schemas/OpenAI.FunctionTool",
+ "file_search": "#/components/schemas/OpenAI.FileSearchTool",
+ "computer_use_preview": "#/components/schemas/OpenAI.ComputerUsePreviewTool",
+ "web_search": "#/components/schemas/OpenAI.WebSearchTool",
+ "mcp": "#/components/schemas/OpenAI.MCPTool",
+ "image_generation": "#/components/schemas/OpenAI.ImageGenTool",
+ "local_shell": "#/components/schemas/OpenAI.LocalShellToolParam",
+ "shell": "#/components/schemas/OpenAI.FunctionShellToolParam",
+ "custom": "#/components/schemas/OpenAI.CustomToolParam",
+ "web_search_preview": "#/components/schemas/OpenAI.WebSearchPreviewTool",
+ "apply_patch": "#/components/schemas/OpenAI.ApplyPatchToolParam",
+ "computer": "#/components/schemas/OpenAI.ComputerTool",
+ "namespace": "#/components/schemas/OpenAI.NamespaceToolParam",
+ "tool_search": "#/components/schemas/OpenAI.ToolSearchToolParam"
}
- ],
- "description": "Emitted when a response is queued and waiting to be processed.",
- "title": "ResponseQueuedEvent",
- "x-oaiMeta": {
- "name": "response.queued",
- "group": "responses",
- "example": "{\n \"type\": \"response.queued\",\n \"response\": {\n \"id\": \"res_123\",\n \"status\": \"queued\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n },\n \"sequence_number\": 1\n}\n"
- }
+ },
+ "description": "A tool that can be used to generate a response."
},
- "OpenAI.ResponseReasoningSummaryPartAddedEvent": {
+ "OpenAI.ToolChoiceAllowed": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "summary_index",
- "sequence_number",
- "part"
+ "mode",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_summary_part.added"
+ "allowed_tools"
],
- "description": "The type of the event. Always `response.reasoning_summary_part.added`.",
+ "description": "Allowed tool configuration type. Always `allowed_tools`.",
"x-stainless-const": true
},
- "item_id": {
+ "mode": {
"type": "string",
- "description": "The ID of the item this summary part is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this summary part is associated with."
- },
- "summary_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the summary part within the reasoning summary."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "enum": [
+ "auto",
+ "required"
+ ],
+ "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools."
},
- "part": {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart",
- "description": "The summary part that was added."
+ "tools": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "description": "A list of tool definitions that the model should be allowed to call.\n For the Responses API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"name\": \"get_weather\" },\n { \"type\": \"mcp\", \"server_label\": \"deepwiki\" },\n { \"type\": \"image_generation\" }\n ]\n ```"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a new reasoning summary part is added.",
- "x-oaiMeta": {
- "name": "response.reasoning_summary_part.added",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_summary_part.added\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"\"\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Constrains the tools available to the model to a pre-defined set.",
+ "title": "Allowed tools"
},
- "OpenAI.ResponseReasoningSummaryPartAddedEventPart": {
+ "OpenAI.ToolChoiceCodeInterpreter": {
"type": "object",
"required": [
- "type",
- "text"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "summary_text"
- ],
- "x-stainless-const": true
- },
- "text": {
- "type": "string"
+ "code_interpreter"
+ ]
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ }
+ ],
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseReasoningSummaryPartDoneEvent": {
+ "OpenAI.ToolChoiceComputer": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "summary_index",
- "sequence_number",
- "part"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_summary_part.done"
- ],
- "description": "The type of the event. Always `response.reasoning_summary_part.done`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the item this summary part is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this summary part is associated with."
- },
- "summary_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the summary part within the reasoning summary."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "part": {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEventPart",
- "description": "The completed summary part."
+ "computer"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a reasoning summary part is completed.",
- "x-oaiMeta": {
- "name": "response.reasoning_summary_part.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_summary_part.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\"\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseReasoningSummaryPartDoneEventPart": {
+ "OpenAI.ToolChoiceComputerUse": {
"type": "object",
"required": [
- "type",
- "text"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "summary_text"
- ],
- "x-stainless-const": true
- },
- "text": {
- "type": "string"
+ "computer_use"
+ ]
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ }
+ ],
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseReasoningSummaryTextDeltaEvent": {
+ "OpenAI.ToolChoiceComputerUsePreview": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "summary_index",
- "delta",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_summary_text.delta"
- ],
- "description": "The type of the event. Always `response.reasoning_summary_text.delta`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the item this summary text delta is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this summary text delta is associated with."
- },
- "summary_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the summary part within the reasoning summary."
- },
- "delta": {
- "type": "string",
- "description": "The text delta that was added to the summary."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "computer_use_preview"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a delta is added to a reasoning summary text.",
- "x-oaiMeta": {
- "name": "response.reasoning_summary_text.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_summary_text.delta\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"delta\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseReasoningSummaryTextDoneEvent": {
+ "OpenAI.ToolChoiceCustom": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "summary_index",
- "text",
- "sequence_number"
+ "name"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_summary_text.done"
+ "custom"
],
- "description": "The type of the event. Always `response.reasoning_summary_text.done`.",
+ "description": "For custom tool calling, the type is always `custom`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the item this summary text is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this summary text is associated with."
- },
- "summary_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the summary part within the reasoning summary."
- },
- "text": {
+ "name": {
"type": "string",
- "description": "The full text of the completed reasoning summary."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "description": "The name of the custom tool to call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a reasoning summary text is completed.",
- "x-oaiMeta": {
- "name": "response.reasoning_summary_text.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_summary_text.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"text\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Use this option to force the model to call a specific custom tool.",
+ "title": "Custom tool"
},
- "OpenAI.ResponseReasoningTextDeltaEvent": {
+ "OpenAI.ToolChoiceFileSearch": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "delta",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_text.delta"
- ],
- "description": "The type of the event. Always `response.reasoning_text.delta`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the item this reasoning text delta is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this reasoning text delta is associated with."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the reasoning content part this delta is associated with."
- },
- "delta": {
- "type": "string",
- "description": "The text delta that was added to the reasoning content."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "file_search"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a delta is added to a reasoning text.",
- "x-oaiMeta": {
- "name": "response.reasoning_text.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_text.delta\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"The\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseReasoningTextDoneEvent": {
+ "OpenAI.ToolChoiceFunction": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "content_index",
- "text",
- "sequence_number"
+ "name"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_text.done"
+ "function"
],
- "description": "The type of the event. Always `response.reasoning_text.done`.",
+ "description": "For function calling, the type is always `function`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the item this reasoning text is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this reasoning text is associated with."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the reasoning content part."
- },
- "text": {
+ "name": {
"type": "string",
- "description": "The full text of the completed reasoning content."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "description": "The name of the function to call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a reasoning text is completed.",
- "x-oaiMeta": {
- "name": "response.reasoning_text.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_text.done\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"The user is asking...\",\n \"sequence_number\": 4\n}\n"
- }
+ "description": "Use this option to force the model to call a specific function.",
+ "title": "Function tool"
},
- "OpenAI.ResponseRefusalDeltaEvent": {
+ "OpenAI.ToolChoiceImageGeneration": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "delta",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.refusal.delta"
- ],
- "description": "The type of the event. Always `response.refusal.delta`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the refusal text is added to."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the refusal text is added to."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that the refusal text is added to."
- },
- "delta": {
- "type": "string",
- "description": "The refusal text that is added."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "image_generation"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when there is a partial refusal text.",
- "x-oaiMeta": {
- "name": "response.refusal.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.refusal.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"refusal text so far\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseRefusalDoneEvent": {
+ "OpenAI.ToolChoiceMCP": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "content_index",
- "refusal",
- "sequence_number"
+ "server_label"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.refusal.done"
+ "mcp"
],
- "description": "The type of the event. Always `response.refusal.done`.",
+ "description": "For MCP tools, the type is always `mcp`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the refusal text is finalized."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the refusal text is finalized."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that the refusal text is finalized."
- },
- "refusal": {
+ "server_label": {
"type": "string",
- "description": "The refusal text that is finalized."
+ "description": "The label of the MCP server to use."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when refusal text is finalized.",
- "x-oaiMeta": {
- "name": "response.refusal.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.refusal.done\",\n \"item_id\": \"item-abc\",\n \"output_index\": 1,\n \"content_index\": 2,\n \"refusal\": \"final refusal text\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Use this option to force the model to call a specific tool on a remote MCP server.",
+ "title": "MCP tool"
},
- "OpenAI.ResponseStreamEvent": {
+ "OpenAI.ToolChoiceOptions": {
+ "type": "string",
+ "enum": [
+ "none",
+ "auto",
+ "required"
+ ],
+ "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or\nmore tools.\n`required` means the model must call one or more tools.",
+ "title": "Tool choice mode"
+ },
+ "OpenAI.ToolChoiceParam": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEventType"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParamType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "response.audio.transcript.delta": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent",
- "response.code_interpreter_call_code.delta": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent",
- "response.code_interpreter_call.in_progress": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent",
- "response.code_interpreter_call.interpreting": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent",
- "response.content_part.added": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent",
- "response.created": "#/components/schemas/OpenAI.ResponseCreatedEvent",
- "error": "#/components/schemas/OpenAI.ResponseErrorEvent",
- "response.file_search_call.in_progress": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent",
- "response.file_search_call.searching": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent",
- "response.function_call_arguments.delta": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent",
- "response.in_progress": "#/components/schemas/OpenAI.ResponseInProgressEvent",
- "response.failed": "#/components/schemas/OpenAI.ResponseFailedEvent",
- "response.incomplete": "#/components/schemas/OpenAI.ResponseIncompleteEvent",
- "response.output_item.added": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent",
- "response.reasoning_summary_part.added": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent",
- "response.reasoning_summary_text.delta": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent",
- "response.reasoning_text.delta": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent",
- "response.refusal.delta": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent",
- "response.output_text.delta": "#/components/schemas/OpenAI.ResponseTextDeltaEvent",
- "response.web_search_call.in_progress": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent",
- "response.web_search_call.searching": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent",
- "response.image_generation_call.generating": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent",
- "response.image_generation_call.in_progress": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent",
- "response.image_generation_call.partial_image": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent",
- "response.mcp_call_arguments.delta": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent",
- "response.mcp_call.failed": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent",
- "response.mcp_call.in_progress": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent",
- "response.mcp_list_tools.failed": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent",
- "response.mcp_list_tools.in_progress": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent",
- "response.output_text.annotation.added": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent",
- "response.queued": "#/components/schemas/OpenAI.ResponseQueuedEvent",
- "response.custom_tool_call_input.delta": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent",
- "response.audio.done": "#/components/schemas/OpenAI.ResponseAudioDoneEvent",
- "response.audio.transcript.done": "#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent",
- "response.code_interpreter_call_code.done": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent",
- "response.code_interpreter_call.completed": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent",
- "response.completed": "#/components/schemas/OpenAI.ResponseCompletedEvent",
- "response.content_part.done": "#/components/schemas/OpenAI.ResponseContentPartDoneEvent",
- "response.file_search_call.completed": "#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent",
- "response.function_call_arguments.done": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent",
- "response.output_item.done": "#/components/schemas/OpenAI.ResponseOutputItemDoneEvent",
- "response.reasoning_summary_part.done": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent",
- "response.reasoning_summary_text.done": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent",
- "response.reasoning_text.done": "#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent",
- "response.refusal.done": "#/components/schemas/OpenAI.ResponseRefusalDoneEvent",
- "response.output_text.done": "#/components/schemas/OpenAI.ResponseTextDoneEvent",
- "response.web_search_call.completed": "#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent",
- "response.image_generation_call.completed": "#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent",
- "response.mcp_call_arguments.done": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent",
- "response.mcp_call.completed": "#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent",
- "response.mcp_list_tools.completed": "#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent",
- "response.custom_tool_call_input.done": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent",
- "response.audio.delta": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent"
- }
- }
- },
- "OpenAI.ResponseStreamEventType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "response.audio.delta",
- "response.audio.done",
- "response.audio.transcript.delta",
- "response.audio.transcript.done",
- "response.code_interpreter_call_code.delta",
- "response.code_interpreter_call_code.done",
- "response.code_interpreter_call.completed",
- "response.code_interpreter_call.in_progress",
- "response.code_interpreter_call.interpreting",
- "response.completed",
- "response.content_part.added",
- "response.content_part.done",
- "response.created",
- "error",
- "response.file_search_call.completed",
- "response.file_search_call.in_progress",
- "response.file_search_call.searching",
- "response.function_call_arguments.delta",
- "response.function_call_arguments.done",
- "response.in_progress",
- "response.failed",
- "response.incomplete",
- "response.output_item.added",
- "response.output_item.done",
- "response.reasoning_summary_part.added",
- "response.reasoning_summary_part.done",
- "response.reasoning_summary_text.delta",
- "response.reasoning_summary_text.done",
- "response.reasoning_text.delta",
- "response.reasoning_text.done",
- "response.refusal.delta",
- "response.refusal.done",
- "response.output_text.delta",
- "response.output_text.done",
- "response.web_search_call.completed",
- "response.web_search_call.in_progress",
- "response.web_search_call.searching",
- "response.image_generation_call.completed",
- "response.image_generation_call.generating",
- "response.image_generation_call.in_progress",
- "response.image_generation_call.partial_image",
- "response.mcp_call_arguments.delta",
- "response.mcp_call_arguments.done",
- "response.mcp_call.completed",
- "response.mcp_call.failed",
- "response.mcp_call.in_progress",
- "response.mcp_list_tools.completed",
- "response.mcp_list_tools.failed",
- "response.mcp_list_tools.in_progress",
- "response.output_text.annotation.added",
- "response.queued",
- "response.custom_tool_call_input.delta",
- "response.custom_tool_call_input.done"
+ "allowed_tools": "#/components/schemas/OpenAI.ToolChoiceAllowed",
+ "function": "#/components/schemas/OpenAI.ToolChoiceFunction",
+ "mcp": "#/components/schemas/OpenAI.ToolChoiceMCP",
+ "custom": "#/components/schemas/OpenAI.ToolChoiceCustom",
+ "apply_patch": "#/components/schemas/OpenAI.SpecificApplyPatchParam",
+ "shell": "#/components/schemas/OpenAI.SpecificFunctionShellParam",
+ "file_search": "#/components/schemas/OpenAI.ToolChoiceFileSearch",
+ "web_search_preview": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview",
+ "computer_use_preview": "#/components/schemas/OpenAI.ToolChoiceComputerUsePreview",
+ "web_search_preview_2025_03_11": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311",
+ "image_generation": "#/components/schemas/OpenAI.ToolChoiceImageGeneration",
+ "code_interpreter": "#/components/schemas/OpenAI.ToolChoiceCodeInterpreter",
+ "computer": "#/components/schemas/OpenAI.ToolChoiceComputer",
+ "computer_use": "#/components/schemas/OpenAI.ToolChoiceComputerUse"
+ }
+ },
+ "description": "How the model should select which tool (or tools) to use when generating\na response. See the `tools` parameter to see how to specify which tools\nthe model can call."
+ },
+ "OpenAI.ToolChoiceParamType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "allowed_tools",
+ "function",
+ "mcp",
+ "custom",
+ "apply_patch",
+ "shell",
+ "file_search",
+ "web_search_preview",
+ "computer_use_preview",
+ "web_search_preview_2025_03_11",
+ "image_generation",
+ "code_interpreter",
+ "computer",
+ "computer_use"
]
}
]
},
- "OpenAI.ResponseStreamOptions": {
+ "OpenAI.ToolChoiceWebSearchPreview": {
"type": "object",
+ "required": [
+ "type"
+ ],
"properties": {
- "include_obfuscation": {
- "type": "boolean",
- "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API."
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_search_preview"
+ ]
}
},
- "description": "Options for streaming responses. Only set this when you set `stream: true`."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ }
+ ],
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseTextDeltaEvent": {
+ "OpenAI.ToolChoiceWebSearchPreview20250311": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "delta",
- "sequence_number",
- "logprobs"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.output_text.delta"
- ],
- "description": "The type of the event. Always `response.output_text.delta`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the text delta was added to."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the text delta was added to."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that the text delta was added to."
- },
- "delta": {
- "type": "string",
- "description": "The text delta that was added."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number for this event."
- },
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ResponseLogProb"
- },
- "description": "The log probabilities of the tokens in the delta."
+ "web_search_preview_2025_03_11"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when there is an additional text delta.",
- "x-oaiMeta": {
- "name": "response.output_text.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_text.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"In\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseTextDoneEvent": {
+ "OpenAI.ToolSearchExecutionType": {
+ "type": "string",
+ "enum": [
+ "server",
+ "client"
+ ]
+ },
+ "OpenAI.ToolSearchToolParam": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "text",
- "sequence_number",
- "logprobs"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.output_text.done"
+ "tool_search"
],
- "description": "The type of the event. Always `response.output_text.done`.",
+ "description": "The type of the tool. Always `tool_search`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the text content is finalized."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the text content is finalized."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that the text content is finalized."
- },
- "text": {
- "type": "string",
- "description": "The text content that is finalized."
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search is executed by the server or by the client."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number for this event."
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ResponseLogProb"
- },
- "description": "The log probabilities of the tokens in the delta."
+ "parameters": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EmptyModelParam"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "Emitted when text content is finalized.",
- "x-oaiMeta": {
- "name": "response.output_text.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_text.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Hosted or BYOT tool search configuration for deferred tools.",
+ "title": "Tool search tool"
},
- "OpenAI.ResponseTextParam": {
- "type": "object",
- "properties": {
- "format": {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
+ "OpenAI.ToolType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "verbosity": {
- "$ref": "#/components/schemas/OpenAI.Verbosity"
+ {
+ "type": "string",
+ "enum": [
+ "function",
+ "file_search",
+ "computer",
+ "computer_use_preview",
+ "web_search",
+ "mcp",
+ "code_interpreter",
+ "image_generation",
+ "local_shell",
+ "shell",
+ "custom",
+ "namespace",
+ "tool_search",
+ "web_search_preview",
+ "apply_patch",
+ "a2a_preview",
+ "bing_custom_search_preview",
+ "browser_automation_preview",
+ "fabric_dataagent_preview",
+ "sharepoint_grounding_preview",
+ "memory_search_preview",
+ "work_iq_preview",
+ "fabric_iq_preview",
+ "web_iq_preview",
+ "toolbox_search_preview",
+ "azure_ai_search",
+ "azure_function",
+ "bing_grounding",
+ "capture_structured_outputs",
+ "openapi"
+ ]
}
+ ]
+ },
+ "OpenAI.ToolsArray": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
},
- "description": "Configuration options for a text response from the model. Can be plain\ntext or structured JSON data. Learn more:\n- [Text inputs and outputs](/docs/guides/text)\n- [Structured Outputs](/docs/guides/structured-outputs)"
+ "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\nWe support the following categories of tools:\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\nmodel's capabilities, like [web search](/docs/guides/tools-web-search)\nor [file search](/docs/guides/tools-file-search). Learn more about\n[built-in tools](/docs/guides/tools).\n- **MCP Tools**: Integrations with third-party systems via custom MCP servers\nor predefined connectors such as Google Drive and SharePoint. Learn more about\n[MCP Tools](/docs/guides/tools-connectors-mcp).\n- **Function calls (custom tools)**: Functions that are defined by you,\nenabling the model to call your own code with strongly typed arguments\nand outputs. Learn more about\n[function calling](/docs/guides/function-calling). You can also use\ncustom tools to call your own code."
},
- "OpenAI.ResponseUsage": {
+ "OpenAI.TopLogProb": {
"type": "object",
"required": [
- "input_tokens",
- "input_tokens_details",
- "output_tokens",
- "output_tokens_details",
- "total_tokens"
+ "token",
+ "logprob",
+ "bytes"
],
"properties": {
- "input_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The number of input tokens."
- },
- "input_tokens_details": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails",
- "description": "A detailed breakdown of the input tokens."
- },
- "output_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The number of output tokens."
+ "token": {
+ "type": "string"
},
- "output_tokens_details": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails",
- "description": "A detailed breakdown of the output tokens."
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "total_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The total number of tokens used."
+ "bytes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
}
},
- "description": "Represents token usage details including input tokens, output tokens,\na breakdown of output tokens, and the total tokens used."
- },
- "OpenAI.ResponseUsageInputTokensDetails": {
- "type": "object",
- "required": [
- "cached_tokens"
- ],
- "properties": {
- "cached_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- }
- },
- "OpenAI.ResponseUsageOutputTokensDetails": {
- "type": "object",
- "required": [
- "reasoning_tokens"
- ],
- "properties": {
- "reasoning_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- }
+ "description": "The top log probability of a token.",
+ "title": "Top log probability"
},
- "OpenAI.ResponseWebSearchCallCompletedEvent": {
+ "OpenAI.TranscriptTextUsageDuration": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "seconds"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.web_search_call.completed"
+ "duration"
],
- "description": "The type of the event. Always `response.web_search_call.completed`.",
+ "description": "The type of the usage object. Always `duration` for this variant.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the web search call is associated with."
- },
- "item_id": {
- "type": "string",
- "description": "Unique ID for the output item associated with the web search call."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the web search call being processed."
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Duration of the input audio in seconds.",
+ "x-ms-duration": "seconds"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage"
}
],
- "description": "Emitted when a web search call is completed.",
- "x-oaiMeta": {
- "name": "response.web_search_call.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.web_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
- }
+ "description": "Usage statistics for models billed by audio input duration.",
+ "title": "Duration Usage"
},
- "OpenAI.ResponseWebSearchCallInProgressEvent": {
+ "OpenAI.TranscriptTextUsageTokens": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "input_tokens",
+ "output_tokens",
+ "total_tokens"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.web_search_call.in_progress"
+ "tokens"
],
- "description": "The type of the event. Always `response.web_search_call.in_progress`.",
+ "description": "The type of the usage object. Always `tokens` for this variant.",
"x-stainless-const": true
},
- "output_index": {
+ "input_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the web search call is associated with."
+ "description": "Number of input tokens billed for this request."
},
- "item_id": {
- "type": "string",
- "description": "Unique ID for the output item associated with the web search call."
+ "input_token_details": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptTextUsageTokensInputTokenDetails",
+ "description": "Details about the input tokens billed for this request."
},
- "sequence_number": {
+ "output_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the web search call being processed."
+ "description": "Number of output tokens generated."
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Total number of tokens used (input + output)."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage"
}
],
- "description": "Emitted when a web search call is initiated.",
- "x-oaiMeta": {
- "name": "response.web_search_call.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.web_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
+ "description": "Usage statistics for models billed by token usage.",
+ "title": "Token Usage"
+ },
+ "OpenAI.TranscriptTextUsageTokensInputTokenDetails": {
+ "type": "object",
+ "properties": {
+ "text_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "audio_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
}
},
- "OpenAI.ResponseWebSearchCallSearchingEvent": {
+ "OpenAI.TranscriptionDiarizedSegment": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "id",
+ "start",
+ "end",
+ "text",
+ "speaker"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.web_search_call.searching"
+ "transcript.text.segment"
],
- "description": "The type of the event. Always `response.web_search_call.searching`.",
+ "description": "The type of the segment. Always `transcript.text.segment`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the web search call is associated with."
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the segment."
},
- "item_id": {
+ "start": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Start timestamp of the segment in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "end": {
+ "type": "integer",
+ "format": "int64",
+ "description": "End timestamp of the segment in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "text": {
"type": "string",
- "description": "Unique ID for the output item associated with the web search call."
+ "description": "Transcript text for this segment."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the web search call being processed."
+ "speaker": {
+ "type": "string",
+ "description": "Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...)."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Emitted when a web search call is executing.",
- "x-oaiMeta": {
- "name": "response.web_search_call.searching",
- "group": "responses",
- "example": "{\n \"type\": \"response.web_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
- }
+ "description": "A segment of diarized transcript text with speaker metadata."
},
- "OpenAI.ScreenshotParam": {
+ "OpenAI.TranscriptionInclude": {
+ "type": "string",
+ "enum": [
+ "logprobs"
+ ]
+ },
+ "OpenAI.TranscriptionSegment": {
"type": "object",
"required": [
- "type"
+ "id",
+ "seek",
+ "start",
+ "end",
+ "text",
+ "tokens",
+ "temperature",
+ "avg_logprob",
+ "compression_ratio",
+ "no_speech_prob"
],
"properties": {
- "type": {
+ "id": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Unique identifier of the segment."
+ },
+ "seek": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Seek offset of the segment."
+ },
+ "start": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Start time of the segment in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "end": {
+ "type": "integer",
+ "format": "int64",
+ "description": "End time of the segment in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "text": {
"type": "string",
- "enum": [
- "screenshot"
- ],
- "description": "Specifies the event type. For a screenshot action, this property is always set to `screenshot`.",
- "x-stainless-const": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "description": "Text content of the segment."
+ },
+ "tokens": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "description": "Array of token IDs for the text content."
+ },
+ "temperature": {
+ "type": "number",
+ "format": "float",
+ "description": "Temperature parameter used for generating the segment."
+ },
+ "avg_logprob": {
+ "type": "number",
+ "format": "float",
+ "description": "Average logprob of the segment. If the value is lower than -1, consider the logprobs failed."
+ },
+ "compression_ratio": {
+ "type": "number",
+ "format": "float",
+ "description": "Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed."
+ },
+ "no_speech_prob": {
+ "type": "number",
+ "format": "float",
+ "description": "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."
}
- ],
- "description": "A screenshot action.",
- "title": "Screenshot"
+ }
},
- "OpenAI.ScrollParam": {
+ "OpenAI.TranscriptionWord": {
"type": "object",
"required": [
- "type",
- "x",
- "y",
- "scroll_x",
- "scroll_y"
+ "word",
+ "start",
+ "end"
],
"properties": {
- "type": {
+ "word": {
"type": "string",
- "enum": [
- "scroll"
- ],
- "description": "Specifies the event type. For a scroll action, this property is always set to `scroll`.",
- "x-stainless-const": true
- },
- "x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate where the scroll occurred."
- },
- "y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate where the scroll occurred."
- },
- "scroll_x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The horizontal scroll distance."
+ "description": "The text content of the word."
},
- "scroll_y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The vertical scroll distance."
+ "start": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Start time of the word in seconds.",
+ "x-ms-duration": "seconds"
},
- "keys": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "end": {
+ "type": "integer",
+ "format": "int64",
+ "description": "End time of the word in seconds.",
+ "x-ms-duration": "seconds"
}
- ],
- "description": "A scroll action.",
- "title": "Scroll"
- },
- "OpenAI.SearchContentType": {
- "type": "string",
- "enum": [
- "text",
- "image"
- ]
- },
- "OpenAI.SearchContextSize": {
- "type": "string",
- "enum": [
- "low",
- "medium",
- "high"
- ]
+ }
},
- "OpenAI.ServiceTier": {
- "anyOf": [
- {
+ "OpenAI.TruncationObject": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
"auto",
- "default",
- "flex",
- "scale",
- "priority"
- ]
+ "last_messages"
+ ],
+ "description": "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": "null"
+ "last_messages": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- ],
- "description": "Specifies the processing type used for serving the request.\n- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n- If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.\n- When not set, the default behavior is 'auto'.\nWhen 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."
- },
- "OpenAI.ServiceTierEnum": {
- "type": "string",
- "enum": [
- "auto",
- "default",
- "flex",
- "priority"
- ]
+ },
+ "description": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.",
+ "title": "Thread Truncation Controls"
},
- "OpenAI.SkillReferenceParam": {
+ "OpenAI.TypeParam": {
"type": "object",
"required": [
"type",
- "skill_id"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "skill_reference"
+ "type"
],
- "description": "References a skill created with the /v1/skills endpoint.",
+ "description": "Specifies the event type. For a type action, this property is always set to `type`.",
"x-stainless-const": true
},
- "skill_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The ID of the referenced skill."
- },
- "version": {
+ "text": {
"type": "string",
- "description": "Optional skill version. Use a positive integer or 'latest'. Omit for default."
+ "description": "The text to type."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ContainerSkill"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
- ]
+ ],
+ "description": "An action to type in text.",
+ "title": "Type"
},
- "OpenAI.SpecificApplyPatchParam": {
+ "OpenAI.UpdateChatCompletionParametersBody": {
"type": "object",
"required": [
- "type"
+ "metadata"
],
"properties": {
- "type": {
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.UpdateConversationBody": {
+ "type": "object",
+ "required": [
+ "metadata"
+ ],
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ }
+ }
+ },
+ "OpenAI.UpdateVectorStoreFileAttributesRequest": {
+ "type": "object",
+ "required": [
+ "attributes"
+ ],
+ "properties": {
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Update vector store file attributes request"
+ }
+ },
+ "OpenAI.UpdateVectorStoreRequest": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The name of the vector store."
+ },
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.Upload": {
+ "type": "object",
+ "required": [
+ "id",
+ "created_at",
+ "filename",
+ "bytes",
+ "purpose",
+ "status",
+ "expires_at"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The Upload unique identifier, which can be referenced in API endpoints."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the Upload was created."
+ },
+ "filename": {
+ "type": "string",
+ "description": "The name of the file to be uploaded."
+ },
+ "bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The intended number of bytes to be uploaded."
+ },
+ "purpose": {
+ "type": "string",
+ "description": "The intended purpose of the file. [Please refer here](/docs/api-reference/files/object#files/object-purpose) for acceptable values."
+ },
+ "status": {
"type": "string",
"enum": [
- "apply_patch"
+ "pending",
+ "completed",
+ "cancelled",
+ "expired"
],
- "description": "The tool to call. Always `apply_patch`.",
+ "description": "The status of the Upload."
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the Upload will expire."
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "upload"
+ ],
+ "description": "The object type, which is always \"upload\".",
"x-stainless-const": true
+ },
+ "file": {
+ "$ref": "#/components/schemas/OpenAI.OpenAIFile"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Forces the model to call the apply_patch tool when executing a tool call.",
- "title": "Specific apply patch tool choice"
+ "description": "The Upload object can accept byte chunks in the form of Parts.",
+ "title": "Upload",
+ "x-oaiMeta": {
+ "name": "The upload object",
+ "example": "{\n \"id\": \"upload_abc123\",\n \"object\": \"upload\",\n \"bytes\": 2147483648,\n \"created_at\": 1719184911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n \"status\": \"completed\",\n \"expires_at\": 1719127296,\n \"file\": {\n \"id\": \"file-xyz321\",\n \"object\": \"file\",\n \"bytes\": 2147483648,\n \"created_at\": 1719186911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n }\n}\n"
+ }
},
- "OpenAI.SpecificFunctionShellParam": {
+ "OpenAI.UploadPart": {
"type": "object",
"required": [
- "type"
+ "id",
+ "created_at",
+ "upload_id",
+ "object"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The upload Part unique identifier, which can be referenced in API endpoints."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the Part was created."
+ },
+ "upload_id": {
+ "type": "string",
+ "description": "The ID of the Upload object that this Part was added to."
+ },
+ "object": {
"type": "string",
"enum": [
- "shell"
+ "upload.part"
],
- "description": "The tool to call. Always `shell`.",
+ "description": "The object type, which is always `upload.part`.",
"x-stainless-const": true
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Forces the model to call the shell tool when a tool call is required.",
- "title": "Specific shell tool choice"
+ "description": "The upload Part represents a chunk of bytes we can add to an Upload object.",
+ "title": "UploadPart",
+ "x-oaiMeta": {
+ "name": "The upload part object",
+ "example": "{\n \"id\": \"part_def456\",\n \"object\": \"upload.part\",\n \"created_at\": 1719186911,\n \"upload_id\": \"upload_abc123\"\n}\n"
+ }
},
- "OpenAI.SummaryTextContent": {
+ "OpenAI.UrlCitationBody": {
"type": "object",
"required": [
"type",
- "text"
+ "url",
+ "start_index",
+ "end_index",
+ "title"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "summary_text"
+ "url_citation"
],
- "description": "The type of the object. Always `summary_text`.",
+ "description": "The type of the URL citation. Always `url_citation`.",
"x-stainless-const": true
},
- "text": {
+ "url": {
"type": "string",
- "description": "A summary of the reasoning output from the model so far."
+ "format": "uri",
+ "description": "The URL of the web resource."
+ },
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the first character of the URL citation in the message."
+ },
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the last character of the URL citation in the message."
+ },
+ "title": {
+ "type": "string",
+ "description": "The title of the web resource."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.MessageContent"
+ "$ref": "#/components/schemas/OpenAI.Annotation"
}
],
- "description": "A summary text from the model.",
- "title": "Summary text"
+ "description": "A citation for a web resource used to generate a model response.",
+ "title": "URL citation"
},
- "OpenAI.TextContent": {
+ "OpenAI.VadConfig": {
"type": "object",
"required": [
- "type",
- "text"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "text"
+ "server_vad"
],
- "x-stainless-const": true
+ "description": "Must be set to `server_vad` to enable manual chunking using server side VAD."
},
- "text": {
- "type": "string"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Amount of audio to include before the VAD detected speech (in\n milliseconds).",
+ "default": 300
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Duration of silence to detect speech stop (in milliseconds).\n With shorter values the model will respond more quickly,\n but may jump in on short pauses from the user.",
+ "default": 200
+ },
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "Sensitivity threshold (0.0 to 1.0) for voice activity detection. A\n higher threshold will require louder audio to activate the model, and\n thus might perform better in noisy environments.",
+ "default": 0.5
}
- ],
- "description": "A text content.",
- "title": "Text Content"
+ }
},
- "OpenAI.TextResponseFormatConfiguration": {
+ "OpenAI.ValidateGraderRequest": {
"type": "object",
"required": [
- "type"
+ "grader"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfigurationType"
+ "grader": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderMulti"
+ }
+ ],
+ "description": "The grader used for the fine-tuning job."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "json_schema": "#/components/schemas/OpenAI.TextResponseFormatJsonSchema",
- "text": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText",
- "json_object": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject"
+ "title": "ValidateGraderRequest"
+ },
+ "OpenAI.ValidateGraderResponse": {
+ "type": "object",
+ "properties": {
+ "grader": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderMulti"
+ }
+ ],
+ "description": "The grader used for the fine-tuning job."
}
},
- "description": "An object specifying the format that the model must output.\nConfiguring `{ \"type\": \"json_schema\" }` enables Structured Outputs,\nwhich ensures the model will match your supplied JSON schema. Learn more in the\n[Structured Outputs guide](/docs/guides/structured-outputs).\nThe default format is `{ \"type\": \"text\" }` with no additional options.\n*Not recommended for gpt-4o and newer models:**\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it."
+ "title": "ValidateGraderResponse"
},
- "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject": {
+ "OpenAI.VectorStoreExpirationAfter": {
"type": "object",
"required": [
- "type"
+ "anchor",
+ "days"
],
"properties": {
- "type": {
+ "anchor": {
"type": "string",
"enum": [
- "json_object"
+ "last_active_at"
],
- "description": "The type of response format being defined. Always `json_object`.",
+ "description": "Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.",
"x-stainless-const": true
+ },
+ "days": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 1,
+ "maximum": 365,
+ "description": "The number of days after the anchor time that the vector store will expire."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
- }
- ],
- "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
- "title": "JSON object"
+ "description": "The expiration policy for a vector store.",
+ "title": "Vector store expiration policy"
},
- "OpenAI.TextResponseFormatConfigurationResponseFormatText": {
+ "OpenAI.VectorStoreFileAttributes": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard. Keys are strings\nwith a maximum length of 64 characters. Values are strings with a maximum\nlength of 512 characters, booleans, or numbers.",
+ "x-oaiTypeLabel": "map"
+ },
+ "OpenAI.VectorStoreFileBatchObject": {
"type": "object",
"required": [
- "type"
+ "id",
+ "object",
+ "created_at",
+ "vector_store_id",
+ "status",
+ "file_counts"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "text"
+ "vector_store.files_batch"
],
- "description": "The type of response format being defined. Always `text`.",
+ "description": "The object type, which is always `vector_store.file_batch`.",
"x-stainless-const": true
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the vector store files batch was created."
+ },
+ "vector_store_id": {
+ "type": "string",
+ "description": "The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) is attached to."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "cancelled",
+ "failed"
+ ],
+ "description": "The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`."
+ },
+ "file_counts": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObjectFileCounts"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
- }
- ],
- "description": "Default response format. Used to generate text responses.",
- "title": "Text"
+ "description": "A batch of files attached to a vector store.",
+ "title": "Vector store file batch",
+ "x-oaiMeta": {
+ "name": "The vector store files batch object",
+ "beta": true,
+ "example": "{\n \"id\": \"vsfb_123\",\n \"object\": \"vector_store.files_batch\",\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 100\n }\n}\n"
+ }
},
- "OpenAI.TextResponseFormatConfigurationType": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.VectorStoreFileBatchObjectFileCounts": {
+ "type": "object",
+ "required": [
+ "in_progress",
+ "completed",
+ "failed",
+ "cancelled",
+ "total"
+ ],
+ "properties": {
+ "in_progress": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- {
- "type": "string",
- "enum": [
- "text",
- "json_schema",
- "json_object"
- ]
+ "completed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "cancelled": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "total": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ]
+ }
},
- "OpenAI.TextResponseFormatJsonSchema": {
+ "OpenAI.VectorStoreFileContentResponse": {
"type": "object",
"required": [
- "type",
- "name",
- "schema"
+ "object",
+ "data",
+ "has_more",
+ "next_page"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "json_schema"
+ "vector_store.file_content.page"
],
- "description": "The type of response format being defined. Always `json_schema`.",
+ "description": "The object type, which is always `vector_store.file_content.page`",
"x-stainless-const": true
},
- "description": {
- "type": "string",
- "description": "A description of what the response format is for, used by the model to\n determine how to respond in the format."
- },
- "name": {
- "type": "string",
- "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\n underscores and dashes, with a maximum length of 64."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileContentResponseData"
+ },
+ "description": "Parsed content of the file."
},
- "schema": {
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema"
+ "has_more": {
+ "type": "boolean",
+ "description": "Indicates if there are more content pages to fetch."
},
- "strict": {
+ "next_page": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
@@ -48080,296 +70517,418 @@
]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
- }
- ],
- "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).",
- "title": "JSON schema"
+ "description": "Represents the parsed content of a vector store file."
},
- "OpenAI.Tool": {
+ "OpenAI.VectorStoreFileContentResponseData": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ToolType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "bing_grounding": "#/components/schemas/BingGroundingTool",
- "fabric_dataagent_preview": "#/components/schemas/MicrosoftFabricPreviewTool",
- "sharepoint_grounding_preview": "#/components/schemas/SharepointPreviewTool",
- "azure_ai_search": "#/components/schemas/AzureAISearchTool",
- "openapi": "#/components/schemas/OpenApiTool",
- "bing_custom_search_preview": "#/components/schemas/BingCustomSearchPreviewTool",
- "browser_automation_preview": "#/components/schemas/BrowserAutomationPreviewTool",
- "azure_function": "#/components/schemas/AzureFunctionTool",
- "capture_structured_outputs": "#/components/schemas/CaptureStructuredOutputsTool",
- "a2a_preview": "#/components/schemas/A2APreviewTool",
- "work_iq_preview": "#/components/schemas/WorkIQPreviewTool",
- "fabric_iq_preview": "#/components/schemas/FabricIQPreviewTool",
- "memory_search_preview": "#/components/schemas/MemorySearchPreviewTool",
- "code_interpreter": "#/components/schemas/OpenAI.CodeInterpreterTool",
- "file_search": "#/components/schemas/OpenAI.FileSearchTool",
- "web_search": "#/components/schemas/OpenAI.WebSearchTool",
- "mcp": "#/components/schemas/OpenAI.MCPTool",
- "function": "#/components/schemas/OpenAI.FunctionTool",
- "computer_use_preview": "#/components/schemas/OpenAI.ComputerUsePreviewTool",
- "image_generation": "#/components/schemas/OpenAI.ImageGenTool",
- "local_shell": "#/components/schemas/OpenAI.LocalShellToolParam",
- "shell": "#/components/schemas/OpenAI.FunctionShellToolParam",
- "custom": "#/components/schemas/OpenAI.CustomToolParam",
- "web_search_preview": "#/components/schemas/OpenAI.WebSearchPreviewTool",
- "apply_patch": "#/components/schemas/OpenAI.ApplyPatchToolParam",
- "computer": "#/components/schemas/OpenAI.ComputerTool",
- "namespace": "#/components/schemas/OpenAI.NamespaceToolParam",
- "tool_search": "#/components/schemas/OpenAI.ToolSearchToolParam"
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
}
- },
- "description": "A tool that can be used to generate a response."
+ }
},
- "OpenAI.ToolChoiceAllowed": {
+ "OpenAI.VectorStoreFileObject": {
"type": "object",
"required": [
- "type",
- "mode",
- "tools"
+ "id",
+ "object",
+ "usage_bytes",
+ "created_at",
+ "vector_store_id",
+ "status",
+ "last_error"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "allowed_tools"
+ "vector_store.file"
],
- "description": "Allowed tool configuration type. Always `allowed_tools`.",
+ "description": "The object type, which is always `vector_store.file`.",
"x-stainless-const": true
},
- "mode": {
+ "usage_bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The total vector store usage in bytes. Note that this may be different from the original file size."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the vector store file was created."
+ },
+ "vector_store_id": {
+ "type": "string",
+ "description": "The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) is attached to."
+ },
+ "status": {
"type": "string",
"enum": [
- "auto",
- "required"
+ "in_progress",
+ "completed",
+ "cancelled",
+ "failed"
],
- "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools."
+ "description": "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."
},
- "tools": {
- "type": "array",
- "items": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "description": "A list of tool definitions that the model should be allowed to call.\n For the Responses API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"name\": \"get_weather\" },\n { \"type\": \"mcp\", \"server_label\": \"deepwiki\" },\n { \"type\": \"image_generation\" }\n ]\n ```"
+ "last_error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObjectLastError"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "chunking_strategy": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Constrains the tools available to the model to a pre-defined set.",
- "title": "Allowed tools"
+ "description": "A list of files attached to a vector store.",
+ "title": "Vector store files",
+ "x-oaiMeta": {
+ "name": "The vector store file object",
+ "beta": true,
+ "example": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"usage_bytes\": 1234,\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"last_error\": null,\n \"chunking_strategy\": {\n \"type\": \"static\",\n \"static\": {\n \"max_chunk_size_tokens\": 800,\n \"chunk_overlap_tokens\": 400\n }\n }\n}\n"
+ }
},
- "OpenAI.ToolChoiceCodeInterpreter": {
+ "OpenAI.VectorStoreFileObjectLastError": {
"type": "object",
"required": [
- "type"
+ "code",
+ "message"
],
"properties": {
- "type": {
+ "code": {
"type": "string",
"enum": [
- "code_interpreter"
+ "server_error",
+ "unsupported_file",
+ "invalid_file"
]
+ },
+ "message": {
+ "type": "string"
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ }
},
- "OpenAI.ToolChoiceComputer": {
+ "OpenAI.VectorStoreObject": {
"type": "object",
"required": [
- "type"
+ "id",
+ "object",
+ "created_at",
+ "name",
+ "usage_bytes",
+ "file_counts",
+ "status",
+ "last_active_at",
+ "metadata"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "computer"
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
- },
- "OpenAI.ToolChoiceComputerUse": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "vector_store"
+ ],
+ "description": "The object type, which is always `vector_store`.",
+ "x-stainless-const": true
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the vector store was created."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the vector store."
+ },
+ "usage_bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The total number of bytes used by the files in the vector store."
+ },
+ "file_counts": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObjectFileCounts"
+ },
+ "status": {
"type": "string",
"enum": [
- "computer_use"
+ "expired",
+ "in_progress",
+ "completed"
+ ],
+ "description": "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."
+ },
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter"
+ },
+ "expires_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "last_active_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ "description": "A vector store is a collection of processed files can be used by the `file_search` tool.",
+ "title": "Vector store",
+ "x-oaiMeta": {
+ "name": "The vector store object",
+ "example": "{\n \"id\": \"vs_123\",\n \"object\": \"vector_store\",\n \"created_at\": 1698107661,\n \"usage_bytes\": 123456,\n \"last_active_at\": 1698107661,\n \"name\": \"my_vector_store\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"cancelled\": 0,\n \"failed\": 0,\n \"total\": 100\n },\n \"last_used_at\": 1698107661\n}\n"
+ }
},
- "OpenAI.ToolChoiceComputerUsePreview": {
+ "OpenAI.VectorStoreObjectFileCounts": {
"type": "object",
"required": [
- "type"
+ "in_progress",
+ "completed",
+ "failed",
+ "cancelled",
+ "total"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_use_preview"
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ "in_progress": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "completed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "cancelled": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "total": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ }
},
- "OpenAI.ToolChoiceCustom": {
+ "OpenAI.VectorStoreSearchRequest": {
"type": "object",
"required": [
- "type",
- "name"
+ "query"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "custom"
+ "query": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
],
- "description": "For custom tool calling, the type is always `custom`.",
- "x-stainless-const": true
+ "description": "A query string for a search"
},
- "name": {
- "type": "string",
- "description": "The name of the custom tool to call."
+ "rewrite_query": {
+ "type": "boolean",
+ "description": "Whether to rewrite the natural language query for vector search."
+ },
+ "max_num_results": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 1,
+ "maximum": 50,
+ "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive.",
+ "default": 10
+ },
+ "filters": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CompoundFilter"
+ }
+ ],
+ "description": "A filter to apply based on file attributes."
+ },
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequestRankingOptions",
+ "description": "Ranking options for search."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Use this option to force the model to call a specific custom tool.",
- "title": "Custom tool"
+ "x-oaiMeta": {
+ "name": "Vector store search request"
+ }
},
- "OpenAI.ToolChoiceFileSearch": {
+ "OpenAI.VectorStoreSearchRequestRankingOptions": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
+ "ranker": {
"type": "string",
"enum": [
- "file_search"
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ "none",
+ "auto",
+ "default-2024-11-15"
+ ],
+ "default": "auto"
+ },
+ "score_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1
}
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ }
},
- "OpenAI.ToolChoiceFunction": {
+ "OpenAI.VectorStoreSearchResultContentObject": {
"type": "object",
"required": [
"type",
- "name"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "function"
+ "text"
],
- "description": "For function calling, the type is always `function`.",
- "x-stainless-const": true
+ "description": "The type of content."
},
- "name": {
+ "text": {
"type": "string",
- "description": "The name of the function to call."
+ "description": "The text content returned from search."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Use this option to force the model to call a specific function.",
- "title": "Function tool"
+ "x-oaiMeta": {
+ "name": "Vector store search result content object"
+ }
},
- "OpenAI.ToolChoiceImageGeneration": {
+ "OpenAI.VectorStoreSearchResultItem": {
"type": "object",
"required": [
- "type"
+ "file_id",
+ "filename",
+ "score",
+ "attributes",
+ "content"
],
"properties": {
- "type": {
+ "file_id": {
"type": "string",
- "enum": [
- "image_generation"
+ "description": "The ID of the vector store file."
+ },
+ "filename": {
+ "type": "string",
+ "description": "The name of the vector store file."
+ },
+ "score": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The similarity score for the result."
+ },
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultContentObject"
+ },
+ "description": "Content chunks from the file."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ "x-oaiMeta": {
+ "name": "Vector store search result item"
+ }
},
- "OpenAI.ToolChoiceMCP": {
+ "OpenAI.VectorStoreSearchResultsPage": {
"type": "object",
"required": [
- "type",
- "server_label"
+ "object",
+ "search_query",
+ "data",
+ "has_more",
+ "next_page"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "mcp"
+ "vector_store.search_results.page"
],
- "description": "For MCP tools, the type is always `mcp`.",
+ "description": "The object type, which is always `vector_store.search_results.page`",
"x-stainless-const": true
},
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server to use."
+ "search_query": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "name": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultItem"
+ },
+ "description": "The list of search result items."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Indicates if there are more results to fetch."
+ },
+ "next_page": {
"anyOf": [
{
"type": "string"
@@ -48380,147 +70939,97 @@
]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Use this option to force the model to call a specific tool on a remote MCP server.",
- "title": "MCP tool"
- },
- "OpenAI.ToolChoiceOptions": {
- "type": "string",
- "enum": [
- "none",
- "auto",
- "required"
- ],
- "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or\nmore tools.\n`required` means the model must call one or more tools.",
- "title": "Tool choice mode"
- },
- "OpenAI.ToolChoiceParam": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParamType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "allowed_tools": "#/components/schemas/OpenAI.ToolChoiceAllowed",
- "function": "#/components/schemas/OpenAI.ToolChoiceFunction",
- "mcp": "#/components/schemas/OpenAI.ToolChoiceMCP",
- "custom": "#/components/schemas/OpenAI.ToolChoiceCustom",
- "apply_patch": "#/components/schemas/OpenAI.SpecificApplyPatchParam",
- "shell": "#/components/schemas/OpenAI.SpecificFunctionShellParam",
- "file_search": "#/components/schemas/OpenAI.ToolChoiceFileSearch",
- "web_search_preview": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview",
- "computer_use_preview": "#/components/schemas/OpenAI.ToolChoiceComputerUsePreview",
- "web_search_preview_2025_03_11": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311",
- "image_generation": "#/components/schemas/OpenAI.ToolChoiceImageGeneration",
- "code_interpreter": "#/components/schemas/OpenAI.ToolChoiceCodeInterpreter",
- "computer": "#/components/schemas/OpenAI.ToolChoiceComputer",
- "computer_use": "#/components/schemas/OpenAI.ToolChoiceComputerUse"
- }
- },
- "description": "How the model should select which tool (or tools) to use when generating\na response. See the `tools` parameter to see how to specify which tools\nthe model can call."
+ "x-oaiMeta": {
+ "name": "Vector store search results page"
+ }
},
- "OpenAI.ToolChoiceParamType": {
+ "OpenAI.Verbosity": {
"anyOf": [
{
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "allowed_tools",
- "function",
- "mcp",
- "custom",
- "apply_patch",
- "shell",
- "file_search",
- "web_search_preview",
- "computer_use_preview",
- "web_search_preview_2025_03_11",
- "image_generation",
- "code_interpreter",
- "computer",
- "computer_use"
- ]
- }
- ]
- },
- "OpenAI.ToolChoiceWebSearchPreview": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
"type": "string",
"enum": [
- "web_search_preview"
+ "low",
+ "medium",
+ "high"
]
- }
- },
- "allOf": [
+ },
{
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ "type": "null"
}
],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ "description": "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\nCurrently supported values are `low`, `medium`, and `high`."
},
- "OpenAI.ToolChoiceWebSearchPreview20250311": {
+ "OpenAI.VideoCharacterResource": {
"type": "object",
"required": [
- "type"
+ "id",
+ "name",
+ "created_at"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "web_search_preview_2025_03_11"
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the character was created."
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ }
},
- "OpenAI.ToolSearchExecutionType": {
+ "OpenAI.VideoContentVariant": {
"type": "string",
"enum": [
- "server",
- "client"
+ "video",
+ "thumbnail",
+ "spritesheet"
]
},
- "OpenAI.ToolSearchToolParam": {
+ "OpenAI.VideoListResource": {
"type": "object",
"required": [
- "type"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "tool_search"
+ "list"
],
- "description": "The type of the tool. Always `tool_search`.",
- "x-stainless-const": true
+ "description": "The type of object returned, must be `list`.",
+ "x-stainless-const": true,
+ "default": "list"
},
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search is executed by the server or by the client."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ },
+ "description": "A list of items",
+ "x-ms-list-page-items": true
},
- "description": {
+ "first_id": {
"anyOf": [
{
"type": "string"
@@ -48530,26 +71039,24 @@
}
]
},
- "parameters": {
+ "last_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.EmptyModelParam"
+ "type": "string"
},
{
"type": "null"
}
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ ],
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Whether there are more items available."
}
- ],
- "description": "Hosted or BYOT tool search configuration for deferred tools.",
- "title": "Tool search tool"
+ }
},
- "OpenAI.ToolType": {
+ "OpenAI.VideoModel": {
"anyOf": [
{
"type": "string"
@@ -48557,194 +71064,218 @@
{
"type": "string",
"enum": [
- "function",
- "file_search",
- "computer",
- "computer_use_preview",
- "web_search",
- "mcp",
- "code_interpreter",
- "image_generation",
- "local_shell",
- "shell",
- "custom",
- "namespace",
- "tool_search",
- "web_search_preview",
- "apply_patch",
- "a2a_preview",
- "bing_custom_search_preview",
- "browser_automation_preview",
- "fabric_dataagent_preview",
- "sharepoint_grounding_preview",
- "memory_search_preview",
- "work_iq_preview",
- "fabric_iq_preview",
- "toolbox_search_preview",
- "azure_ai_search",
- "azure_function",
- "bing_grounding",
- "capture_structured_outputs",
- "openapi"
+ "sora-2",
+ "sora-2-pro",
+ "sora-2-2025-10-06",
+ "sora-2-pro-2025-10-06",
+ "sora-2-2025-12-08"
]
}
]
},
- "OpenAI.ToolsArray": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\nWe support the following categories of tools:\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\nmodel's capabilities, like [web search](/docs/guides/tools-web-search)\nor [file search](/docs/guides/tools-file-search). Learn more about\n[built-in tools](/docs/guides/tools).\n- **MCP Tools**: Integrations with third-party systems via custom MCP servers\nor predefined connectors such as Google Drive and SharePoint. Learn more about\n[MCP Tools](/docs/guides/tools-connectors-mcp).\n- **Function calls (custom tools)**: Functions that are defined by you,\nenabling the model to call your own code with strongly typed arguments\nand outputs. Learn more about\n[function calling](/docs/guides/function-calling). You can also use\ncustom tools to call your own code."
+ "OpenAI.VideoPrompt": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32000
},
- "OpenAI.TopLogProb": {
+ "OpenAI.VideoReferenceInputParam": {
"type": "object",
"required": [
- "token",
- "logprob",
- "bytes"
+ "id"
],
"properties": {
- "token": {
- "type": "string"
- },
- "logprob": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "bytes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
+ "id": {
+ "type": "string",
+ "description": "The identifier of the completed video."
}
},
- "description": "The top log probability of a token.",
- "title": "Top log probability"
+ "description": "Reference to the completed video."
},
- "OpenAI.TypeParam": {
+ "OpenAI.VideoResource": {
"type": "object",
"required": [
- "type",
- "text"
+ "id",
+ "object",
+ "model",
+ "status",
+ "progress",
+ "created_at",
+ "completed_at",
+ "expires_at",
+ "prompt",
+ "size",
+ "seconds",
+ "remixed_from_video_id",
+ "error"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the video job."
+ },
+ "object": {
"type": "string",
"enum": [
- "type"
+ "video"
],
- "description": "Specifies the event type. For a type action, this property is always set to `type`.",
- "x-stainless-const": true
+ "description": "The object type, which is always `video`.",
+ "x-stainless-const": true,
+ "default": "video"
},
- "text": {
- "type": "string",
- "description": "The text to type."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- }
- ],
- "description": "An action to type in text.",
- "title": "Type"
- },
- "OpenAI.UpdateConversationBody": {
- "type": "object",
- "required": [
- "metadata"
- ],
- "properties": {
- "metadata": {
+ "model": {
+ "$ref": "#/components/schemas/OpenAI.VideoModel",
+ "description": "The video generation model that produced the job."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.VideoStatus",
+ "description": "Current lifecycle status of the video job."
+ },
+ "progress": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Approximate completion percentage for the generation task."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (seconds) for when the job was created."
+ },
+ "completed_at": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "type": "string",
+ "format": "date-time"
},
{
"type": "null"
}
],
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
- }
- }
- },
- "OpenAI.UrlCitationBody": {
- "type": "object",
- "required": [
- "type",
- "url",
- "start_index",
- "end_index",
- "title"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "url_citation"
- ],
- "description": "The type of the URL citation. Always `url_citation`.",
- "x-stainless-const": true
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "Unix timestamp (seconds) for when the job completed, if finished."
},
- "url": {
- "type": "string",
- "format": "uri",
- "description": "The URL of the web resource."
+ "expires_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "Unix timestamp (seconds) for when the downloadable assets expire, if set."
},
- "start_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the first character of the URL citation in the message."
+ "prompt": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "end_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the last character of the URL citation in the message."
+ "size": {
+ "$ref": "#/components/schemas/OpenAI.VideoSize",
+ "description": "The resolution of the generated video."
},
- "title": {
+ "seconds": {
"type": "string",
- "description": "The title of the web resource."
+ "description": "Duration of the generated clip in seconds. For extensions, this is the stitched total duration."
+ },
+ "remixed_from_video_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Error-2"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
+ "description": "Structured information describing a generated video job.",
+ "title": "Video job"
+ },
+ "OpenAI.VideoSeconds": {
+ "type": "string",
+ "enum": [
+ "4",
+ "8",
+ "12"
+ ]
+ },
+ "OpenAI.VideoSize": {
+ "type": "string",
+ "enum": [
+ "720x1280",
+ "1280x720",
+ "1024x1792",
+ "1792x1024"
+ ]
+ },
+ "OpenAI.VideoStatus": {
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "completed",
+ "failed"
+ ]
+ },
+ "OpenAI.VoiceIdsOrCustomVoice": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Annotation"
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsShared"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ]
}
],
- "description": "A citation for a web resource used to generate a model response.",
- "title": "URL citation"
- },
- "OpenAI.VectorStoreFileAttributes": {
- "type": "object",
- "unevaluatedProperties": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "boolean"
- }
- ]
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard. Keys are strings\nwith a maximum length of 64 characters. Values are strings with a maximum\nlength of 512 characters, booleans, or numbers.",
- "x-oaiTypeLabel": "map"
+ "description": "A built-in voice name or a custom voice reference.",
+ "title": "Voice"
},
- "OpenAI.Verbosity": {
+ "OpenAI.VoiceIdsShared": {
"anyOf": [
+ {
+ "type": "string"
+ },
{
"type": "string",
"enum": [
- "low",
- "medium",
- "high"
+ "alloy",
+ "ash",
+ "ballad",
+ "coral",
+ "echo",
+ "sage",
+ "shimmer",
+ "verse",
+ "marin",
+ "cedar"
]
- },
- {
- "type": "null"
}
- ],
- "description": "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\nCurrently supported values are `low`, `medium`, and `high`."
+ ]
},
"OpenAI.WaitParam": {
"type": "object",
@@ -48946,6 +71477,38 @@
"description": "The approximate location of the user.",
"title": "Web search approximate location"
},
+ "OpenAI.WebSearchContextSize": {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high"
+ ],
+ "description": "High level guidance for the amount of context window space to use for the\nsearch. One of `low`, `medium`, or `high`. `medium` is the default."
+ },
+ "OpenAI.WebSearchLocation": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string",
+ "description": "The two-letter\n [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,\n e.g. `US`."
+ },
+ "region": {
+ "type": "string",
+ "description": "Free text input for the region of the user, e.g. `California`."
+ },
+ "city": {
+ "type": "string",
+ "description": "Free text input for the city of the user, e.g. `San Francisco`."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The [IANA timezone](https://timeapi.io/documentation/iana-timezones)\n of the user, e.g. `America/Los_Angeles`."
+ }
+ },
+ "description": "Approximate location parameters for the search.",
+ "title": "Web search location"
+ },
"OpenAI.WebSearchPreviewTool": {
"type": "object",
"required": [
@@ -49893,6 +72456,12 @@
"evaluation_level": {
"$ref": "#/components/schemas/EvaluationLevel",
"description": "Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for per-conversation multi-turn simulation scoring."
+ },
+ "max_stalls": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 1,
+ "description": "Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the score does not improve — so no full validation-set evaluation is triggered. The counter resets whenever a minibatch passes and its full-validation score beats the current best. Only a sustained plateau of `max_stalls` consecutive minibatch failures triggers the stop. When omitted, the optimizer uses its internal default. Must be >= 1 when set."
}
},
"description": "Tuning knobs and run-mode for an optimization job.",
@@ -50994,7 +73563,12 @@
"$ref": "#/components/schemas/ToolboxTool"
}
],
- "description": "A reminder tool stored in a toolbox."
+ "description": "A reminder tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"ResponseRetrievalItemGenerationParams": {
"type": "object",
@@ -51496,6 +74070,112 @@
]
}
},
+ "RubricGenerationInputQualityWarning": {
+ "type": "object",
+ "required": [
+ "code",
+ "severity",
+ "message",
+ "source"
+ ],
+ "properties": {
+ "code": {
+ "$ref": "#/components/schemas/RubricGenerationInputQualityWarningCode",
+ "description": "Stable searchable machine-readable warning code."
+ },
+ "severity": {
+ "$ref": "#/components/schemas/RubricGenerationInputQualityWarningSeverity",
+ "description": "Advisory severity. Initial values: `warning`."
+ },
+ "message": {
+ "type": "string",
+ "description": "Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, instruction, dataset, or trace text."
+ },
+ "source": {
+ "$ref": "#/components/schemas/RubricGenerationInputQualityWarningSource",
+ "description": "Which source category the warning applies to. `aggregate` is used only for cross-source warnings."
+ },
+ "source_index": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "description": "Zero-based index into `EvaluatorGenerationJob.inputs.sources` when the warning applies to a specific source. Omitted for aggregate warnings and for warnings not tied to one source."
+ }
+ },
+ "description": "A non-fatal advisory produced during rubric evaluator generation when resolved inputs are technically valid but likely too weak to produce a high-quality rubric. Read-only; service-generated. Persisted with the terminal EvaluatorGenerationJob.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "RubricGenerationInputQualityWarningCode": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "empty_prompt",
+ "short_prompt",
+ "empty_agent_instructions",
+ "short_agent_instructions",
+ "empty_dataset_content",
+ "short_dataset_content",
+ "low_trace_count",
+ "insufficient_total_input"
+ ]
+ }
+ ],
+ "description": "Stable searchable machine-readable warning code for a rubric-generation input-quality warning. Values are `snake_case`; clients must tolerate additional service-defined identifiers.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "RubricGenerationInputQualityWarningSeverity": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "warning"
+ ]
+ }
+ ],
+ "description": "Advisory severity for a rubric-generation input-quality warning. Initial value set: `warning`.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "RubricGenerationInputQualityWarningSource": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "prompt",
+ "agent",
+ "dataset",
+ "aggregate"
+ ]
+ }
+ ],
+ "description": "Warning source attribution for a rubric-generation input-quality warning. Per-source values (`prompt`, `agent`, `dataset`) match the source category visible to the generation runtime. `aggregate` is a synthetic value used only for warnings computed across successfully resolved sources. `traces` is not exposed because trace sources resolve into dataset content upstream.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
"SASCredentials": {
"type": "object",
"required": [
@@ -51948,7 +74628,12 @@
"$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "A SharePoint grounding tool call."
+ "description": "A SharePoint grounding tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"SharepointGroundingToolCallOutput": {
"type": "object",
@@ -51982,7 +74667,12 @@
"$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "The output of a SharePoint grounding tool call."
+ "description": "The output of a SharePoint grounding tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"SharepointGroundingToolParameters": {
"type": "object",
@@ -51996,7 +74686,12 @@
"description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
}
},
- "description": "The sharepoint grounding tool parameters."
+ "description": "The sharepoint grounding tool parameters.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"SharepointPreviewTool": {
"type": "object",
@@ -52022,7 +74717,12 @@
"$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "The input definition information for a sharepoint tool as used to configure an agent."
+ "description": "The input definition information for a sharepoint tool as used to configure an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"SimpleQnADataGenerationJobOptions": {
"type": "object",
@@ -52869,6 +75569,27 @@
},
"description": "A project connection resource."
},
+ "ToolSearchToolboxTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "toolbox_search"
+ ],
+ "description": "The type of the tool. Always `toolbox_search`."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A toolbox search tool stored in a toolbox."
+ },
"ToolUseFineTuningDataGenerationJobOptions": {
"type": "object",
"required": [
@@ -52948,7 +75669,12 @@
"$ref": "#/components/schemas/ToolboxTool"
}
],
- "description": "A toolbox search tool stored in a toolbox."
+ "description": "A toolbox search tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"ToolboxSkill": {
"type": "object",
@@ -53039,7 +75765,9 @@
"reminder_preview": "#/components/schemas/ReminderPreviewToolboxTool",
"work_iq_preview": "#/components/schemas/WorkIQPreviewToolboxTool",
"fabric_iq_preview": "#/components/schemas/FabricIQPreviewToolboxTool",
- "toolbox_search_preview": "#/components/schemas/ToolboxSearchPreviewToolboxTool"
+ "web_iq_preview": "#/components/schemas/WebIQPreviewToolboxTool",
+ "toolbox_search_preview": "#/components/schemas/ToolboxSearchPreviewToolboxTool",
+ "toolbox_search": "#/components/schemas/ToolSearchToolboxTool"
}
},
"description": "An abstract representation of a tool stored in a toolbox."
@@ -53058,6 +75786,8 @@
"reminder_preview",
"work_iq_preview",
"fabric_iq_preview",
+ "web_iq_preview",
+ "toolbox_search",
"toolbox_search_preview"
],
"description": "Supported tool types for tools stored in a toolbox."
@@ -53739,6 +76469,115 @@
}
}
},
+ "WebIQPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "project_connection_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_iq_preview"
+ ],
+ "description": "The object type, which is always 'web_iq_preview'."
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the WebIQ project connection."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the WebIQ MCP server to connect to."
+ },
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the WebIQ MCP server. If not provided, the URL from the project connection will be used."
+ },
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Whether the agent requires approval before executing actions. Default is always.",
+ "default": "always"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A WebIQ server-side tool.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "WebIQPreviewToolboxTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "project_connection_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_iq_preview"
+ ]
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the WebIQ project connection."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the WebIQ MCP server to connect to."
+ },
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the WebIQ MCP server. If not provided, the URL from the project connection will be used."
+ },
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Whether the agent requires approval before executing actions. Default is always.",
+ "default": "always"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A WebIQ tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
"WebSearchConfiguration": {
"type": "object",
"required": [
@@ -53869,7 +76708,12 @@
"$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "A WorkIQ server-side tool."
+ "description": "A WorkIQ server-side tool.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"WorkIQPreviewToolboxTool": {
"type": "object",
@@ -53894,7 +76738,12 @@
"$ref": "#/components/schemas/ToolboxTool"
}
],
- "description": "A WorkIQ tool stored in a toolbox."
+ "description": "A WorkIQ tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"WorkflowActionOutputItem": {
"type": "object",
diff --git a/specification/ai-foundry/data-plane/Foundry/openapi3/v1/microsoft-foundry-openapi3.yaml b/specification/ai-foundry/data-plane/Foundry/openapi3/v1/microsoft-foundry-openapi3.yaml
index b06e14b7af18..720205714c00 100644
--- a/specification/ai-foundry/data-plane/Foundry/openapi3/v1/microsoft-foundry-openapi3.yaml
+++ b/specification/ai-foundry/data-plane/Foundry/openapi3/v1/microsoft-foundry-openapi3.yaml
@@ -3,7 +3,6 @@ info:
title: Microsoft Foundry
version: v1
tags:
- - name: Fine-Tuning
- name: Responses Root
description: Responses
- name: Responses
@@ -94,7 +93,7 @@ tags:
parent: Platform APIs
summary: Agent optimization jobs
- name: EvaluatorGenerationJobs
- parent: Platform APIs
+ parent: Evaluations
summary: Evaluator generation jobs
- name: Evaluations
- name: Evals
@@ -116,8 +115,8 @@ paths:
/agent_optimization_jobs:
post:
operationId: AgentOptimizationJobs_create
- summary: Creates an agent optimization job.
- description: Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry.
+ summary: Create an agent optimization job
+ description: Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry.
parameters:
- name: Foundry-Features
in: header
@@ -184,8 +183,8 @@ paths:
- AgentsOptimization=V2Preview
get:
operationId: AgentOptimizationJobs_list
- summary: Returns a list of agent optimization jobs.
- description: List optimization jobs. Supports cursor pagination and optional status / agent_name filters.
+ summary: List agent optimization jobs
+ description: Lists optimization jobs with cursor pagination and optional status or agent name filters.
parameters:
- name: Foundry-Features
in: header
@@ -302,8 +301,8 @@ paths:
/agent_optimization_jobs/{jobId}:
get:
operationId: AgentOptimizationJobs_get
- summary: Get info about an agent optimization job.
- description: Get an optimization job by id.
+ summary: Get an agent optimization job
+ description: Retrieves an optimization job by its identifier.
parameters:
- name: Foundry-Features
in: header
@@ -359,8 +358,8 @@ paths:
- AgentsOptimization=V2Preview
delete:
operationId: AgentOptimizationJobs_delete
- summary: Deletes an agent optimization job.
- description: Delete the job and its candidate artifacts. Cancels first if non-terminal.
+ summary: Delete an agent optimization job
+ description: Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal.
parameters:
- name: Foundry-Features
in: header
@@ -406,8 +405,8 @@ paths:
/agent_optimization_jobs/{jobId}:cancel:
post:
operationId: AgentOptimizationJobs_cancel
- summary: Cancels an agent optimization job.
- description: Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state.
+ summary: Cancel an agent optimization job
+ description: Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state.
parameters:
- name: Foundry-Features
in: header
@@ -531,6 +530,7 @@ paths:
encoding:
metadata:
contentType: application/json
+ description: The content multipart request content.
get:
operationId: Agents_listAgents
summary: List agents
@@ -740,6 +740,7 @@ paths:
encoding:
metadata:
contentType: application/json
+ description: The content multipart request content.
delete:
operationId: Agents_deleteAgent
summary: Delete an agent
@@ -1873,6 +1874,7 @@ paths:
encoding:
metadata:
contentType: application/json
+ description: The content multipart request content.
get:
operationId: Agents_listAgentVersions
summary: List agent versions
@@ -2095,6 +2097,106 @@ paths:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- Agent Versions
+ /agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.json:
+ get:
+ operationId: AgentInvocations_getAgentInvocationAsyncApiSpecJson
+ description: |-
+ Retrieves the AsyncAPI (JSON) specification for an agent version's event-driven
+ invocation contract (e.g. the `invocations_ws` WebSocket protocol). AsyncAPI is the
+ companion to OpenAPI for streaming/bidirectional surfaces that OpenAPI cannot express.
+ Returns 404 if the agent does not publish an AsyncAPI specification. Publishing is
+ optional; when published, both JSON and YAML representations are available.
+ parameters:
+ - name: agent_name
+ in: path
+ required: true
+ description: The name of the agent.
+ schema:
+ type: string
+ - name: agent_version
+ in: path
+ required: true
+ description: The version of the agent.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ unevaluatedProperties: {}
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Agent Invocations
+ /agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.yaml:
+ get:
+ operationId: AgentInvocations_getAgentInvocationAsyncApiSpecYaml
+ description: |-
+ Retrieves the AsyncAPI (YAML) specification for an agent version's event-driven
+ invocation contract. Companion to `getAgentInvocationAsyncApiSpecJson`; the path
+ extension is authoritative for the returned content type (no `Accept` negotiation).
+ Returns 404 if the agent does not publish an AsyncAPI specification.
+ parameters:
+ - name: agent_name
+ in: path
+ required: true
+ description: The name of the agent.
+ schema:
+ type: string
+ - name: agent_version
+ in: path
+ required: true
+ description: The version of the agent.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/yaml:
+ schema:
+ type: string
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Agent Invocations
/agents/{agent_name}/versions/{agent_version}/sessions/{session_id}:logstream:
get:
operationId: Agents_getSessionLogStream
@@ -2261,6 +2363,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Agents
/agents/{agent_name}:enable:
post:
operationId: Agents_enableAgent
@@ -2297,6 +2401,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Agents
/agents:import:
post:
operationId: Agents_createAgentFromManifest
@@ -3084,7 +3190,7 @@ paths:
post:
operationId: Datasets_getCredentials
summary: Get dataset credentials
- description: Gets the SAS credential to access the storage account associated with a Dataset version.
+ description: Retrieves the SAS credential to access the storage account associated with a dataset version.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: name
@@ -3263,7 +3369,7 @@ paths:
get:
operationId: Deployments_get
summary: Get a deployment
- description: Gets a deployed model.
+ description: Retrieves a deployed model.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: name
@@ -3760,7 +3866,7 @@ paths:
patch:
operationId: EvaluationTaxonomies_update
summary: Update an evaluation taxonomy
- description: Update an evaluation taxonomy.
+ description: Modifies the specified evaluation taxonomy with the provided changes.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: Foundry-Features
@@ -4156,7 +4262,7 @@ paths:
get:
operationId: Evaluators_listLatestVersions
summary: List latest evaluator versions
- description: Lists the latest version of each evaluator
+ description: Lists the latest version of each evaluator.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: type
@@ -4551,6 +4657,7 @@ paths:
- name: name
in: path
required: true
+ description: The name path parameter.
schema:
type: string
- name: version
@@ -4614,6 +4721,7 @@ paths:
- name: name
in: path
required: true
+ description: The name path parameter.
schema:
type: string
- name: version
@@ -6275,7 +6383,7 @@ paths:
delete:
operationId: Models_deleteVersion
summary: Delete a model version
- description: Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist.
+ description: Removes the specified model version. Returns 200 whether the version existed or not.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: name
@@ -6333,7 +6441,7 @@ paths:
patch:
operationId: Models_updateVersion
summary: Update a model version
- description: Update an existing ModelVersion with the given version id
+ description: Updates an existing model version identified by its version ID.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: name
@@ -6559,6 +6667,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ModelCredentialRequest'
+ description: The credential request request body.
x-ms-foundry-meta:
required_previews:
- Models=V1Preview
@@ -6628,111 +6737,41 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ModelPendingUploadRequest'
+ description: The pending upload request request body.
x-ms-foundry-meta:
required_previews:
- Models=V1Preview
- /openai/v1/conversations:
- post:
- operationId: createConversation
- summary: Create a conversation
- description: Creates a new conversation resource.
- parameters:
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Conversations
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.CreateConversationBody'
+ /openai/v1/assistants:
get:
- operationId: listConversations
- summary: List conversations
- description: Returns the conversations available in the current project.
+ operationId: Assistants_listAssistants
+ summary: List assistants
+ description: Lists assistants matching the request filters.
parameters:
- name: limit
in: query
required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
schema:
- type: integer
- format: int32
+ $ref: '#/components/schemas/integer'
default: 20
- explode: false
- name: order
in: query
required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
- name: after
in: query
required: false
- description: |-
- 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.
+ description: 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.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
- name: before
in: query
required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: agent_name
- in: query
- required: false
- description: Filter by agent name. If provided, only items associated with the specified agent will be returned.
- schema:
- type: string
- explode: false
- - name: agent_id
- in: query
- required: false
- description: Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.
- schema:
- type: string
- explode: false
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ description: 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.
schema:
type: string
responses:
@@ -6741,26 +6780,7 @@ paths:
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ListAssistantsResponse'
4XX:
description: Client error
content:
@@ -6774,32 +6794,168 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- /openai/v1/conversations/{conversation_id}:
+ - Assistants
+ deprecated: true
+ x-oaiMeta:
+ name: List assistants
+ group: assistants
+ examples:
+ request:
+ curl: |
+ curl "https://api.openai.com/v1/assistants?order=desc&limit=20" \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.assistants.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistants = await openai.beta.assistants.list({
+ order: "desc",
+ limit: "20",
+ });
+
+ console.log(myAssistants.data);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const assistant of client.beta.assistants.list()) {
+ console.log(assistant.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Assistants.List(context.TODO(), openai.BetaAssistantListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.AssistantListPage;
+ import com.openai.models.beta.assistants.AssistantListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantListPage page = client.beta().assistants().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.assistants.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698982736,
+ "name": "Coding Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc456",
+ "object": "assistant",
+ "created_at": 1698982718,
+ "name": "My Assistant",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc789",
+ "object": "assistant",
+ "created_at": 1698982643,
+ "name": null,
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ ],
+ "first_id": "asst_abc123",
+ "last_id": "asst_abc789",
+ "has_more": false
+ }
+ x-ms-list: true
post:
- operationId: updateConversation
- summary: Update a conversation
- description: Modifies the specified conversation's properties.
- parameters:
- - name: conversation_id
- in: path
- required: true
- description: The id of the conversation to update.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
+ operationId: Assistants_createAssistant
+ summary: Create an assistant
+ description: Creates an assistant from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
+ $ref: '#/components/schemas/OpenAI.AssistantObject'
4XX:
description: Client error
content:
@@ -6813,28 +6969,289 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
+ - Assistants
requestBody:
required: true
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.UpdateConversationBody'
- get:
- operationId: getConversation
- summary: Retrieve a conversation
- description: Retrieves the specified conversation and its metadata.
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequest'
+ description: The request body.
+ deprecated: true
+ x-oaiMeta:
+ name: Create assistant
+ group: assistants
+ examples:
+ - title: Code Interpreter
+ request:
+ curl: |
+ curl "https://api.openai.com/v1/assistants" \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ "name": "Math Tutor",
+ "tools": [{"type": "code_interpreter"}],
+ "model": "gpt-4o"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.create(
+ model="gpt-4o",
+ )
+ print(assistant.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistant = await openai.beta.assistants.create({
+ instructions:
+ "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ name: "Math Tutor",
+ tools: [{ type: "code_interpreter" }],
+ model: "gpt-4o",
+ });
+
+ console.log(myAssistant);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.create({ model: 'gpt-4o' });
+
+ console.log(assistant.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{
+ Model: shared.ChatModelGPT4o,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantCreateParams params = AssistantCreateParams.builder()
+ .model(ChatModel.GPT_4O)
+ .build();
+ Assistant assistant = client.beta().assistants().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.create(model: :"gpt-4o")
+
+ puts(assistant)
+ response: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698984975,
+ "name": "Math Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ - title: Files
+ request:
+ curl: |
+ curl https://api.openai.com/v1/assistants \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ "tools": [{"type": "file_search"}],
+ "tool_resources": {"file_search": {"vector_store_ids": ["vs_123"]}},
+ "model": "gpt-4o"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.create(
+ model="gpt-4o",
+ )
+ print(assistant.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistant = await openai.beta.assistants.create({
+ instructions:
+ "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ name: "HR Helper",
+ tools: [{ type: "file_search" }],
+ tool_resources: {
+ file_search: {
+ vector_store_ids: ["vs_123"]
+ }
+ },
+ model: "gpt-4o"
+ });
+
+ console.log(myAssistant);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.create({ model: 'gpt-4o' });
+
+ console.log(assistant.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{
+ Model: shared.ChatModelGPT4o,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantCreateParams params = AssistantCreateParams.builder()
+ .model(ChatModel.GPT_4O)
+ .build();
+ Assistant assistant = client.beta().assistants().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.create(model: :"gpt-4o")
+
+ puts(assistant)
+ response: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1699009403,
+ "name": "HR Helper",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "tool_resources": {
+ "file_search": {
+ "vector_store_ids": ["vs_123"]
+ }
+ },
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ /openai/v1/assistants/{assistant_id}:
+ delete:
+ operationId: Assistants_deleteAssistant
+ summary: Delete an assistant
+ description: Deletes an assistant by its identifier.
parameters:
- - name: conversation_id
+ - name: assistant_id
in: path
required: true
- description: The id of the conversation to retrieve.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ description: The ID of the assistant to delete.
schema:
type: string
responses:
@@ -6843,7 +7260,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
+ $ref: '#/components/schemas/OpenAI.DeleteAssistantResponse'
4XX:
description: Client error
content:
@@ -6857,22 +7274,113 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- delete:
- operationId: deleteConversation
- summary: Delete a conversation
- description: Removes the specified conversation resource from the current project.
+ - Assistants
+ deprecated: true
+ x-oaiMeta:
+ name: Delete assistant
+ group: assistants
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/assistants/asst_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X DELETE
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant_deleted = client.beta.assistants.delete(
+ "assistant_id",
+ )
+ print(assistant_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const response = await openai.beta.assistants.delete("asst_abc123");
+
+ console.log(response);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistantDeleted = await client.beta.assistants.delete('assistant_id');
+
+ console.log(assistantDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistantDeleted, err := client.Beta.Assistants.Delete(context.TODO(), "assistant_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistantDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.AssistantDeleteParams;
+ import com.openai.models.beta.assistants.AssistantDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantDeleted assistantDeleted = client.beta().assistants().delete("assistant_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant_deleted = openai.beta.assistants.delete("assistant_id")
+
+ puts(assistant_deleted)
+ response: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Assistants_getAssistant
+ summary: Get an assistant
+ description: Retrieves an assistant by its identifier.
parameters:
- - name: conversation_id
+ - name: assistant_id
in: path
required: true
- description: The id of the conversation to delete.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ description: The ID of the assistant to retrieve.
schema:
type: string
responses:
@@ -6881,7 +7389,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.DeletedConversationResource'
+ $ref: '#/components/schemas/OpenAI.AssistantObject'
4XX:
description: Client error
content:
@@ -6895,34 +7403,128 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- /openai/v1/conversations/{conversation_id}/items:
+ - Assistants
+ deprecated: true
+ x-oaiMeta:
+ name: Retrieve assistant
+ group: assistants
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/assistants/asst_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.retrieve(
+ "assistant_id",
+ )
+ print(assistant.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistant = await openai.beta.assistants.retrieve(
+ "asst_abc123"
+ );
+
+ console.log(myAssistant);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.retrieve('assistant_id');
+
+ console.log(assistant.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.Get(context.TODO(), "assistant_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Assistant assistant = client.beta().assistants().retrieve("assistant_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.retrieve("assistant_id")
+
+ puts(assistant)
+ response: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1699009709,
+ "name": "HR Helper",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
post:
- operationId: createConversationItems
- summary: Create conversation items
- description: Adds one or more items to the specified conversation.
+ operationId: Assistants_modifyAssistant
+ summary: Update an assistant
+ description: Updates an assistant with the supplied changes.
parameters:
- - name: conversation_id
+ - name: assistant_id
in: path
required: true
- description: The id of the conversation on which the item needs to be created.
- schema:
- type: string
- - name: include
- in: query
- required: false
- description: |-
- Additional fields to include in the response.
- See the `include` parameter for listing Conversation items for more information.
- schema:
- type: array
- items:
- type: string
- explode: false
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ description: The ID of the assistant to modify.
schema:
type: string
responses:
@@ -6931,7 +7533,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ConversationItemList'
+ $ref: '#/components/schemas/OpenAI.AssistantObject'
4XX:
description: Client error
content:
@@ -6945,112 +7547,166 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
+ - Assistants
requestBody:
required: true
content:
application/json:
schema:
- type: object
- properties:
- items:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Item'
- maxItems: 20
- description: The items to add to the conversation. You may add up to 20 items at a time.
- required:
- - items
- get:
- operationId: listConversationItems
- summary: List conversation items
- description: Returns the items belonging to the specified conversation.
- parameters:
- - name: conversation_id
- in: path
- required: true
- description: The id of the conversation on which the items needs to be listed.
- schema:
- type: string
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- - name: after
- in: query
- required: false
- description: |-
- 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.
- schema:
- type: string
- explode: false
- - name: before
- in: query
- required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: item_type
- in: query
- required: false
- description: Filter by item type. If provided, only items of the specified type will be returned.
- schema:
- $ref: '#/components/schemas/OpenAI.ItemType'
- explode: false
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ModifyAssistantRequest'
+ description: The request body.
+ deprecated: true
+ x-oaiMeta:
+ name: Modify assistant
+ group: assistants
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/assistants/asst_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
+ "tools": [{"type": "file_search"}],
+ "model": "gpt-4o"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.update(
+ assistant_id="assistant_id",
+ )
+ print(assistant.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myUpdatedAssistant = await openai.beta.assistants.update(
+ "asst_abc123",
+ {
+ instructions:
+ "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
+ name: "HR Helper",
+ tools: [{ type: "file_search" }],
+ model: "gpt-4o"
+ }
+ );
+
+ console.log(myUpdatedAssistant);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.update('assistant_id');
+
+ console.log(assistant.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.Update(
+ context.TODO(),
+ "assistant_id",
+ openai.BetaAssistantUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Assistant assistant = client.beta().assistants().update("assistant_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.update("assistant_id")
+
+ puts(assistant)
+ response: |
+ {
+ "id": "asst_123",
+ "object": "assistant",
+ "created_at": 1699009709,
+ "name": "HR Helper",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "tool_resources": {
+ "file_search": {
+ "vector_store_ids": []
+ }
+ },
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ /openai/v1/audio/speech:
+ post:
+ operationId: Audio_createSpeech
+ summary: Create a speech
+ description: Creates a speech from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ Transfer-Encoding:
+ required: false
+ description: The TransferEncoding header.
+ schema:
+ type: string
+ content:
+ application/octet-stream:
+ schema:
+ contentMediaType: application/octet-stream
4XX:
description: Client error
content:
@@ -7064,38 +7720,278 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- /openai/v1/conversations/{conversation_id}/items/{item_id}:
- get:
- operationId: getConversationItem
- summary: Get a conversation item
- description: Retrieves a specific item from the specified conversation.
- parameters:
- - name: conversation_id
- in: path
- required: true
- description: The ID of the conversation that contains the item.
- schema:
- type: string
- - name: item_id
- in: path
- required: true
- description: The id of the conversation item to retrieve.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
+ - Audio
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateSpeechRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create speech
+ group: audio
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/speech \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "gpt-4o-mini-tts",
+ "input": "The quick brown fox jumped over the lazy dog.",
+ "voice": "alloy"
+ }' \
+ --output speech.mp3
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ speech = client.audio.speech.create(
+ input="input",
+ model="tts-1",
+ voice="alloy",
+ )
+ print(speech)
+ content = speech.read()
+ print(content)
+ javascript: |
+ import fs from "fs";
+ import path from "path";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const speechFile = path.resolve("./speech.mp3");
+
+ async function main() {
+ const mp3 = await openai.audio.speech.create({
+ model: "gpt-4o-mini-tts",
+ voice: "alloy",
+ input: "Today is a wonderful day to build something people love!",
+ });
+ console.log(speechFile);
+ const buffer = Buffer.from(await mp3.arrayBuffer());
+ await fs.promises.writeFile(speechFile, buffer);
+ }
+ main();
+ csharp: |
+ using System;
+ using System.IO;
+
+ using OpenAI.Audio;
+
+ AudioClient client = new(
+ model: "gpt-4o-mini-tts",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ BinaryData speech = client.GenerateSpeech(
+ text: "The quick brown fox jumped over the lazy dog.",
+ voice: GeneratedSpeechVoice.Alloy
+ );
+
+ using FileStream stream = File.OpenWrite("speech.mp3");
+ speech.ToStream().CopyTo(stream);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const speech = await client.audio.speech.create({
+ input: 'input',
+ model: 'tts-1',
+ voice: 'alloy',
+ });
+
+ console.log(speech);
+
+ const content = await speech.blob();
+ console.log(content);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ speech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{
+ Input: "input",
+ Model: openai.SpeechModelTTS1,
+ Voice: openai.AudioSpeechNewParamsVoiceUnion{
+ OfAudioSpeechNewsVoiceString2: openai.String("alloy"),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", speech)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.audio.speech.SpeechCreateParams;
+ import com.openai.models.audio.speech.SpeechModel;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ SpeechCreateParams params = SpeechCreateParams.builder()
+ .input("input")
+ .model(SpeechModel.TTS_1)
+ .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)
+ .build();
+ HttpResponse speech = client.audio().speech().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ speech = openai.audio.speech.create(input: "input", model: :"tts-1", voice: :alloy)
+
+ puts(speech)
+ - title: SSE Stream Format
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/speech \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "gpt-4o-mini-tts",
+ "input": "The quick brown fox jumped over the lazy dog.",
+ "voice": "alloy",
+ "stream_format": "sse"
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const speech = await client.audio.speech.create({
+ input: 'input',
+ model: 'tts-1',
+ voice: 'alloy',
+ });
+
+ console.log(speech);
+
+ const content = await speech.blob();
+ console.log(content);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ speech = client.audio.speech.create(
+ input="input",
+ model="tts-1",
+ voice="alloy",
+ )
+ print(speech)
+ content = speech.read()
+ print(content)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ speech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{
+ Input: "input",
+ Model: openai.SpeechModelTTS1,
+ Voice: openai.AudioSpeechNewParamsVoiceUnion{
+ OfAudioSpeechNewsVoiceString2: openai.String("alloy"),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", speech)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.audio.speech.SpeechCreateParams;
+ import com.openai.models.audio.speech.SpeechModel;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ SpeechCreateParams params = SpeechCreateParams.builder()
+ .input("input")
+ .model(SpeechModel.TTS_1)
+ .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)
+ .build();
+ HttpResponse speech = client.audio().speech().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ speech = openai.audio.speech.create(input: "input", model: :"tts-1", voice: :alloy)
+
+ puts(speech)
+ /openai/v1/audio/transcriptions:
+ post:
+ operationId: Audio_createTranscription
+ summary: Create a transcription
+ description: Creates a transcription from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.OutputItem'
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJson'
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseDiarizedJson'
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseVerboseJson'
4XX:
description: Client error
content:
@@ -7109,37 +8005,996 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- delete:
- operationId: deleteConversationItem
- summary: Delete a conversation item
- description: Removes the specified item from a conversation.
- parameters:
- - name: conversation_id
- in: path
- required: true
- description: The id of the conversation on which the item needs to be deleted from.
- schema:
- type: string
- - name: item_id
- in: path
- required: true
- description: The id of the conversation item to delete.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
+ - Audio
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionRequest'
+ encoding:
+ model:
+ contentType: text/plain
+ response_format:
+ contentType: application/json
+ temperature:
+ contentType: text/plain
+ include:
+ contentType: application/json
+ timestamp_granularities:
+ contentType: application/json
+ stream:
+ contentType: application/json
+ chunking_strategy:
+ contentType: application/json
+ known_speaker_names:
+ contentType: application/json
+ known_speaker_references:
+ contentType: application/json
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Create transcription
+ group: audio
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F model="gpt-4o-transcribe"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "gpt-4o-transcribe",
+ });
+
+ console.log(transcription.text);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Audio;
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "gpt-4o-transcribe",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath);
+
+ Console.WriteLine($"{transcription.Text}");
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.",
+ "usage": {
+ "type": "tokens",
+ "input_tokens": 14,
+ "input_token_details": {
+ "text_tokens": 0,
+ "audio_tokens": 14
+ },
+ "output_tokens": 45,
+ "total_tokens": 59
+ }
+ }
+ - title: Diarization
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/meeting.wav" \
+ -F model="gpt-4o-transcribe-diarize" \
+ -F response_format="diarized_json" \
+ -F chunking_strategy=auto \
+ -F 'known_speaker_names[]=agent' \
+ -F 'known_speaker_references[]=data:audio/wav;base64,AAA...'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const speakerRef = fs.readFileSync("agent.wav").toString("base64");
+
+ const transcript = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("meeting.wav"),
+ model: "gpt-4o-transcribe-diarize",
+ response_format: "diarized_json",
+ chunking_strategy: "auto",
+ extra_body: {
+ known_speaker_names: ["agent"],
+ known_speaker_references: [`data:audio/wav;base64,${speakerRef}`],
+ },
+ });
+
+ console.log(transcript.segments);
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "task": "transcribe",
+ "duration": 27.4,
+ "text": "Agent: Thanks for calling OpenAI support.
+ A: Hi, I'm trying to enable diarization.
+ Agent: Happy to walk you through the steps.",
+ "segments": [
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_001",
+ "start": 0.0,
+ "end": 4.7,
+ "text": "Thanks for calling OpenAI support.",
+ "speaker": "agent"
+ },
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_002",
+ "start": 4.7,
+ "end": 11.8,
+ "text": "Hi, I'm trying to enable diarization.",
+ "speaker": "A"
+ },
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_003",
+ "start": 12.1,
+ "end": 18.5,
+ "text": "Happy to walk you through the steps.",
+ "speaker": "agent"
+ }
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 27
+ }
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F model="gpt-4o-mini-transcribe" \
+ -F stream=true
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const stream = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "gpt-4o-mini-transcribe",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ data: {"type":"transcript.text.delta","delta":"I","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]}]}
+
+ data: {"type":"transcript.text.delta","delta":" see","logprobs":[{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" skies","logprobs":[{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]}]}
+
+ data: {"type":"transcript.text.delta","delta":" blue","logprobs":[{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" clouds","logprobs":[{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]}]}
+
+ data: {"type":"transcript.text.delta","delta":" white","logprobs":[{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0014890312,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" bright","logprobs":[{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]}]}
+
+ data: {"type":"transcript.text.delta","delta":" blessed","logprobs":[{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" days","logprobs":[{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.00001700133,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" dark","logprobs":[{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]}]}
+
+ data: {"type":"transcript.text.delta","delta":" sacred","logprobs":[{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" nights","logprobs":[{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0036910512,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" I","logprobs":[{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]}]}
+
+ data: {"type":"transcript.text.delta","delta":" think","logprobs":[{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]}]}
+
+ data: {"type":"transcript.text.delta","delta":" to","logprobs":[{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]}]}
+
+ data: {"type":"transcript.text.delta","delta":" myself","logprobs":[{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.29254505,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" what","logprobs":[{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]}]}
+
+ data: {"type":"transcript.text.delta","delta":" a","logprobs":[{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]}]}
+
+ data: {"type":"transcript.text.delta","delta":" wonderful","logprobs":[{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]}]}
+
+ data: {"type":"transcript.text.delta","delta":" world","logprobs":[{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":".","logprobs":[{"token":".","logprob":-0.014231676,"bytes":[46]}]}
+
+ data: {"type":"transcript.text.done","text":"I see skies of blue and clouds of white, the bright blessed days, the dark sacred nights, and I think to myself, what a wonderful world.","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]},{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]},{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]},{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]},{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]},{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]},{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]},{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]},{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]},{"token":",","logprob":-0.0014890312,"bytes":[44]},{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]},{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]},{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]},{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]},{"token":",","logprob":-0.00001700133,"bytes":[44]},{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]},{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]},{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]},{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]},{"token":",","logprob":-0.0036910512,"bytes":[44]},{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]},{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]},{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]},{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]},{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]},{"token":",","logprob":-0.29254505,"bytes":[44]},{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]},{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]},{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]},{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]},{"token":".","logprob":-0.014231676,"bytes":[46]}],"usage":{"input_tokens":14,"input_token_details":{"text_tokens":0,"audio_tokens":14},"output_tokens":45,"total_tokens":59}}
+ - title: Logprobs
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F "include[]=logprobs" \
+ -F model="gpt-4o-transcribe" \
+ -F response_format="json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "gpt-4o-transcribe",
+ response_format: "json",
+ include: ["logprobs"]
+ });
+
+ console.log(transcription);
+ }
+ main();
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "text": "Hey, my knee is hurting and I want to see the doctor tomorrow ideally.",
+ "logprobs": [
+ { "token": "Hey", "logprob": -1.0415299, "bytes": [72, 101, 121] },
+ { "token": ",", "logprob": -9.805982e-5, "bytes": [44] },
+ { "token": " my", "logprob": -0.00229799, "bytes": [32, 109, 121] },
+ {
+ "token": " knee",
+ "logprob": -4.7159858e-5,
+ "bytes": [32, 107, 110, 101, 101]
+ },
+ { "token": " is", "logprob": -0.043909557, "bytes": [32, 105, 115] },
+ {
+ "token": " hurting",
+ "logprob": -1.1041146e-5,
+ "bytes": [32, 104, 117, 114, 116, 105, 110, 103]
+ },
+ { "token": " and", "logprob": -0.011076359, "bytes": [32, 97, 110, 100] },
+ { "token": " I", "logprob": -5.3193703e-6, "bytes": [32, 73] },
+ {
+ "token": " want",
+ "logprob": -0.0017156356,
+ "bytes": [32, 119, 97, 110, 116]
+ },
+ { "token": " to", "logprob": -7.89631e-7, "bytes": [32, 116, 111] },
+ { "token": " see", "logprob": -5.5122365e-7, "bytes": [32, 115, 101, 101] },
+ { "token": " the", "logprob": -0.0040786397, "bytes": [32, 116, 104, 101] },
+ {
+ "token": " doctor",
+ "logprob": -2.3392786e-6,
+ "bytes": [32, 100, 111, 99, 116, 111, 114]
+ },
+ {
+ "token": " tomorrow",
+ "logprob": -7.89631e-7,
+ "bytes": [32, 116, 111, 109, 111, 114, 114, 111, 119]
+ },
+ {
+ "token": " ideally",
+ "logprob": -0.5800861,
+ "bytes": [32, 105, 100, 101, 97, 108, 108, 121]
+ },
+ { "token": ".", "logprob": -0.00011093382, "bytes": [46] }
+ ],
+ "usage": {
+ "type": "tokens",
+ "input_tokens": 14,
+ "input_token_details": {
+ "text_tokens": 0,
+ "audio_tokens": 14
+ },
+ "output_tokens": 45,
+ "total_tokens": 59
+ }
+ }
+ - title: Word timestamps
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F "timestamp_granularities[]=word" \
+ -F model="whisper-1" \
+ -F response_format="verbose_json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "whisper-1",
+ response_format: "verbose_json",
+ timestamp_granularities: ["word"]
+ });
+
+ console.log(transcription.text);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Audio;
+
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "whisper-1",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscriptionOptions options = new()
+ {
+ ResponseFormat = AudioTranscriptionFormat.Verbose,
+ TimestampGranularities = AudioTimestampGranularities.Word,
+ };
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);
+
+ Console.WriteLine($"{transcription.Text}");
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "task": "transcribe",
+ "language": "english",
+ "duration": 8.470000267028809,
+ "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
+ "words": [
+ {
+ "word": "The",
+ "start": 0.0,
+ "end": 0.23999999463558197
+ },
+ ...
+ {
+ "word": "volleyball",
+ "start": 7.400000095367432,
+ "end": 7.900000095367432
+ }
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 9
+ }
+ }
+ - title: Segment timestamps
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F "timestamp_granularities[]=segment" \
+ -F model="whisper-1" \
+ -F response_format="verbose_json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "whisper-1",
+ response_format: "verbose_json",
+ timestamp_granularities: ["segment"]
+ });
+
+ console.log(transcription.text);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Audio;
+
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "whisper-1",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscriptionOptions options = new()
+ {
+ ResponseFormat = AudioTranscriptionFormat.Verbose,
+ TimestampGranularities = AudioTimestampGranularities.Segment,
+ };
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);
+
+ Console.WriteLine($"{transcription.Text}");
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "task": "transcribe",
+ "language": "english",
+ "duration": 8.470000267028809,
+ "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
+ "segments": [
+ {
+ "id": 0,
+ "seek": 0,
+ "start": 0.0,
+ "end": 3.319999933242798,
+ "text": " The beach was a popular spot on a hot summer day.",
+ "tokens": [
+ 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530
+ ],
+ "temperature": 0.0,
+ "avg_logprob": -0.2860786020755768,
+ "compression_ratio": 1.2363636493682861,
+ "no_speech_prob": 0.00985979475080967
+ },
+ ...
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 9
+ }
+ }
+ /openai/v1/audio/translations:
+ post:
+ operationId: Audio_createTranslation
+ summary: Create a translation
+ description: Creates a translation from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateTranslationResponseJson'
+ - $ref: '#/components/schemas/OpenAI.CreateTranslationResponseVerboseJson'
4XX:
description: Client error
content:
@@ -7153,77 +9008,175 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- /openai/v1/evals:
+ - Audio
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateTranslationRequest'
+ encoding:
+ model:
+ contentType: text/plain
+ temperature:
+ contentType: text/plain
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Create translation
+ group: audio
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/translations \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/german.m4a" \
+ -F model="whisper-1"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ translation = client.audio.translations.create(
+ file=b"Example data",
+ model="whisper-1",
+ )
+ print(translation)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const translation = await openai.audio.translations.create({
+ file: fs.createReadStream("speech.mp3"),
+ model: "whisper-1",
+ });
+
+ console.log(translation.text);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Audio;
+
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "whisper-1",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath);
+
+ Console.WriteLine($"{transcription.Text}");
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const translation = await client.audio.translations.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'whisper-1',
+ });
+
+ console.log(translation);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ translation, err := client.Audio.Translations.New(context.TODO(), openai.AudioTranslationNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelWhisper1,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", translation)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.translations.TranslationCreateParams;
+ import com.openai.models.audio.translations.TranslationCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranslationCreateParams params = TranslationCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.WHISPER_1)
+ .build();
+ TranslationCreateResponse translation = client.audio().translations().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ translation = openai.audio.translations.create(file: StringIO.new("Example data"), model: :"whisper-1")
+
+ puts(translation)
+ response: |
+ {
+ "text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?"
+ }
+ /openai/v1/batches:
get:
- operationId: Evals_listEvals
- summary: List evaluations
- description: Returns the evaluations configured in the current project.
+ operationId: Batches_listBatches
+ summary: List batches
+ description: Lists batches matching the request filters.
parameters:
- name: after
in: query
required: false
- description: Identifier for the last run from the previous pagination request.
+ description: 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.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
- name: limit
in: query
required: false
- description: Number of runs to retrieve.
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
schema:
$ref: '#/components/schemas/integer'
default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
- schema:
- type: string
- enum:
- - asc
- - desc
- default: asc
- explode: false
- - name: order_by
- in: query
- required: false
- description: |-
- Evals can be ordered by creation time or last updated time.
- Use `created_at` for creation time or `updated_at` for last updated time.
- schema:
- type: string
- enum:
- - created_at
- - updated_at
- default: created_at
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Eval'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ListBatchesResponse'
4XX:
description: Client error
content:
@@ -7237,61 +9190,150 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- post:
- operationId: Evals_createEval
- summary: Create an evaluation
- description: |-
- Creates 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).
- parameters: []
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Eval'
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Evals
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CreateEvalRequest'
- /openai/v1/evals/{eval_id}:
- delete:
- operationId: Evals_deleteEval
- summary: Delete an evaluation
- description: Removes the specified evaluation and its associated data.
- parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to delete.
- schema:
- type: string
+ - Batch
+ x-oaiMeta:
+ name: List batches
+ group: batch
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/batches?limit=2 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.batches.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.batches.list();
+
+ for await (const batch of list) {
+ console.log(batch);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const batch of client.batches.list()) {
+ console.log(batch.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Batches.List(context.TODO(), openai.BatchListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.BatchListPage;
+ import com.openai.models.batches.BatchListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ BatchListPage page = client.batches().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.batches.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/chat/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "completed",
+ "output_file_id": "file-cvaTdG",
+ "error_file_id": "file-HOWS94",
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": 1711493133,
+ "completed_at": 1711493163,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 95,
+ "failed": 5
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly job",
+ }
+ },
+ { ... },
+ ],
+ "first_id": "batch_abc123",
+ "last_id": "batch_abc456",
+ "has_more": true
+ }
+ x-ms-list: true
+ post:
+ operationId: Batches_createBatch
+ summary: Create a batch
+ description: Creates a batch from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteEvalResponse'
+ $ref: '#/components/schemas/OpenAI.Batch'
4XX:
description: Client error
content:
@@ -7305,16 +9347,171 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Batch
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateBatchParametersBody'
+ description: The request body.
+ x-oaiMeta:
+ name: Create batch
+ group: batch
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/batches \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "input_file_id": "file-abc123",
+ "endpoint": "/v1/chat/completions",
+ "completion_window": "24h"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ batch = client.batches.create(
+ completion_window="24h",
+ endpoint="/v1/responses",
+ input_file_id="input_file_id",
+ )
+ print(batch.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const batch = await openai.batches.create({
+ input_file_id: "file-abc123",
+ endpoint: "/v1/chat/completions",
+ completion_window: "24h"
+ });
+
+ console.log(batch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const batch = await client.batches.create({
+ completion_window: '24h',
+ endpoint: '/v1/responses',
+ input_file_id: 'input_file_id',
+ });
+
+ console.log(batch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ batch, err := client.Batches.New(context.TODO(), openai.BatchNewParams{
+ CompletionWindow: openai.BatchNewParamsCompletionWindow24h,
+ Endpoint: openai.BatchNewParamsEndpointV1Responses,
+ InputFileID: "input_file_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", batch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.Batch;
+ import com.openai.models.batches.BatchCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ BatchCreateParams params = BatchCreateParams.builder()
+ .completionWindow(BatchCreateParams.CompletionWindow._24H)
+ .endpoint(BatchCreateParams.Endpoint.V1_RESPONSES)
+ .inputFileId("input_file_id")
+ .build();
+ Batch batch = client.batches().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ batch = openai.batches.create(
+ completion_window: :"24h",
+ endpoint: :"/v1/responses",
+ input_file_id: "input_file_id"
+ )
+
+ puts(batch)
+ response: |
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/chat/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "validating",
+ "output_file_id": null,
+ "error_file_id": null,
+ "created_at": 1711471533,
+ "in_progress_at": null,
+ "expires_at": null,
+ "finalizing_at": null,
+ "completed_at": null,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 0,
+ "completed": 0,
+ "failed": 0
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+ /openai/v1/batches/{batch_id}:
get:
- operationId: Evals_getEval
- summary: Get an evaluation
- description: Retrieves the specified evaluation and its configuration.
+ operationId: Batches_retrieveBatch
+ summary: Get a batch
+ description: Retrieves a batch by its identifier.
parameters:
- - name: eval_id
+ - name: batch_id
in: path
required: true
- description: The ID of the evaluation to retrieve.
+ description: The ID of the batch to retrieve.
schema:
type: string
responses:
@@ -7323,7 +9520,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/Eval'
+ $ref: '#/components/schemas/OpenAI.Batch'
4XX:
description: Client error
content:
@@ -7337,16 +9534,136 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Batch
+ x-oaiMeta:
+ name: Retrieve batch
+ group: batch
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/batches/batch_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ batch = client.batches.retrieve(
+ "batch_id",
+ )
+ print(batch.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const batch = await openai.batches.retrieve("batch_abc123");
+
+ console.log(batch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const batch = await client.batches.retrieve('batch_id');
+
+ console.log(batch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ batch, err := client.Batches.Get(context.TODO(), "batch_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", batch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.Batch;
+ import com.openai.models.batches.BatchRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Batch batch = client.batches().retrieve("batch_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ batch = openai.batches.retrieve("batch_id")
+
+ puts(batch)
+ response: |
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "completed",
+ "output_file_id": "file-cvaTdG",
+ "error_file_id": "file-HOWS94",
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": 1711493133,
+ "completed_at": 1711493163,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 95,
+ "failed": 5
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+ /openai/v1/batches/{batch_id}/cancel:
post:
- operationId: Evals_updateEval
- summary: Update an evaluation
- description: Updates certain properties of an evaluation.
+ operationId: Batches_cancelBatch
+ summary: Cancel a batch
+ description: Cancels a batch by its identifier.
parameters:
- - name: eval_id
+ - name: batch_id
in: path
required: true
- description: The ID of the evaluation to update.
+ description: The ID of the batch to cancel.
schema:
type: string
responses:
@@ -7355,7 +9672,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/Eval'
+ $ref: '#/components/schemas/OpenAI.Batch'
4XX:
description: Client error
content:
@@ -7369,90 +9686,177 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UpdateEvalParametersBody'
- /openai/v1/evals/{eval_id}/runs:
+ - Batch
+ x-oaiMeta:
+ name: Cancel batch
+ group: batch
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/batches/batch_abc123/cancel \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -X POST
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ batch = client.batches.cancel(
+ "batch_id",
+ )
+ print(batch.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const batch = await openai.batches.cancel("batch_abc123");
+
+ console.log(batch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const batch = await client.batches.cancel('batch_id');
+
+ console.log(batch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ batch, err := client.Batches.Cancel(context.TODO(), "batch_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", batch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.Batch;
+ import com.openai.models.batches.BatchCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Batch batch = client.batches().cancel("batch_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ batch = openai.batches.cancel("batch_id")
+
+ puts(batch)
+ response: |
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/chat/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "cancelling",
+ "output_file_id": null,
+ "error_file_id": null,
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": null,
+ "completed_at": null,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": 1711475133,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 23,
+ "failed": 1
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+ /openai/v1/chat/completions:
get:
- operationId: Evals_listRuns
- summary: List evaluation runs
- description: Returns the runs associated with the specified evaluation.
+ operationId: Chat_listChatCompletions
+ summary: List chat completions
+ description: Lists chat completions matching the request filters.
parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to retrieve runs for.
+ - name: model
+ in: query
+ required: false
+ description: The model used to generate the Chat Completions.
schema:
type: string
+ - name: metadata
+ in: query
+ required: false
+ description: |-
+ A list of metadata keys to filter the Chat Completions by. Example:
+ `metadata[key1]=value1&metadata[key2]=value2`
+ schema:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
- name: after
in: query
required: false
- description: Identifier for the last run from the previous pagination request.
+ description: Identifier for the last chat completion from the previous pagination request.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
- name: limit
in: query
required: false
- description: Number of runs to retrieve.
+ description: Number of Chat Completions to retrieve.
schema:
$ref: '#/components/schemas/integer'
default: 20
- explode: false
- name: order
in: query
required: false
- description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
+ description: Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
- type: string
- enum:
- - asc
- - desc
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
default: asc
- explode: false
- - name: status
- in: query
- required: false
- description: Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.
- schema:
- type: string
- enum:
- - queued
- - in_progress
- - completed
- - canceled
- - failed
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/EvalRun'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ChatCompletionList'
4XX:
description: Client error
content:
@@ -7466,25 +9870,146 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Chat
+ x-oaiMeta:
+ name: List Chat Completions
+ group: chat
+ path: list
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.chat.completions.list()
+ page = page.data[0]
+ print(page.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const chatCompletion of client.chat.completions.list()) {
+ console.log(chatCompletion.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Chat.Completions.List(context.TODO(), openai.ChatCompletionListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.ChatCompletionListPage;
+ import com.openai.models.chat.completions.ChatCompletionListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionListPage page = client.chat().completions().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.chat.completions.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "model": "gpt-5.4",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {},
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "has_more": false
+ }
+ x-ms-list: true
post:
- operationId: Evals_createEvalRun
- summary: Create an evaluation run
- description: Creates an evaluation run for the specified evaluation.
- parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to create a run for.
- schema:
- type: string
+ operationId: Chat_createChatCompletion
+ summary: Create a chat completion
+ description: Creates a chat completion from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/EvalRun'
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponse'
4XX:
description: Client error
content:
@@ -7498,29 +10023,1174 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Chat
requestBody:
required: true
content:
application/json:
schema:
- $ref: '#/components/schemas/CreateEvalRunRequest'
- /openai/v1/evals/{eval_id}/runs/{run_id}:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create chat completion
+ group: chat
+ path: create
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_chat_model_id",
+ "messages": [
+ {
+ "role": "developer",
+ "content": "You are a helpful assistant."
+ },
+ {
+ "role": "user",
+ "content": "Hello!"
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ messages: [{ role: "developer", content: "You are a helpful assistant." }],
+ model: "VAR_chat_model_id",
+ store: true,
+ });
+
+ console.log(completion.choices[0]);
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new SystemChatMessage("You are a helpful assistant."),
+ new UserChatMessage("Hello!")
+ ];
+
+ ChatCompletion completion = client.CompleteChat(messages);
+
+ Console.WriteLine(completion.Content[0].Text);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {
+ "id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT",
+ "object": "chat.completion",
+ "created": 1741569952,
+ "model": "gpt-5.4",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "Hello! How can I assist you today?",
+ "refusal": null,
+ "annotations": []
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 19,
+ "completion_tokens": 10,
+ "total_tokens": 29,
+ "prompt_tokens_details": {
+ "cached_tokens": 0,
+ "audio_tokens": 0
+ },
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "audio_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "service_tier": "default"
+ }
+ - title: Image input
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "messages": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": "What is in this image?"
+ },
+ {
+ "type": "image_url",
+ "image_url": {
+ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
+ }
+ }
+ ]
+ }
+ ],
+ "max_tokens": 300
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const response = await openai.chat.completions.create({
+ model: "gpt-5.4",
+ messages: [
+ {
+ role: "user",
+ content: [
+ { type: "text", text: "What's in this image?" },
+ {
+ type: "image_url",
+ image_url: {
+ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
+ },
+ }
+ ],
+ },
+ ],
+ });
+ console.log(response.choices[0]);
+ }
+ main();
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new UserChatMessage(
+ [
+ ChatMessageContentPart.CreateTextPart("What's in this image?"),
+ ChatMessageContentPart.CreateImagePart(new Uri("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"))
+ ])
+ ];
+
+ ChatCompletion completion = client.CompleteChat(messages);
+
+ Console.WriteLine(completion.Content[0].Text);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {
+ "id": "chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG",
+ "object": "chat.completion",
+ "created": 1741570283,
+ "model": "gpt-5.4",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.",
+ "refusal": null,
+ "annotations": []
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 1117,
+ "completion_tokens": 46,
+ "total_tokens": 1163,
+ "prompt_tokens_details": {
+ "cached_tokens": 0,
+ "audio_tokens": 0
+ },
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "audio_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "service_tier": "default"
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_chat_model_id",
+ "messages": [
+ {
+ "role": "developer",
+ "content": "You are a helpful assistant."
+ },
+ {
+ "role": "user",
+ "content": "Hello!"
+ }
+ ],
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ model: "VAR_chat_model_id",
+ messages: [
+ {"role": "developer", "content": "You are a helpful assistant."},
+ {"role": "user", "content": "Hello!"}
+ ],
+ stream: true,
+ });
+
+ for await (const chunk of completion) {
+ console.log(chunk.choices[0].delta.content);
+ }
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.ClientModel;
+ using System.Collections.Generic;
+ using System.Threading.Tasks;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new SystemChatMessage("You are a helpful assistant."),
+ new UserChatMessage("Hello!")
+ ];
+
+ AsyncCollectionResult completionUpdates = client.CompleteChatStreamingAsync(messages);
+
+ await foreach (StreamingChatCompletionUpdate completionUpdate in completionUpdates)
+ {
+ if (completionUpdate.ContentUpdate.Count > 0)
+ {
+ Console.Write(completionUpdate.ContentUpdate[0].Text);
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
+
+ {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}]}
+
+ ....
+
+ {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
+ - title: Functions
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "messages": [
+ {
+ "role": "user",
+ "content": "What is the weather like in Boston today?"
+ }
+ ],
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "tool_choice": "auto"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ const response = await openai.chat.completions.create({
+ model: "gpt-5.4",
+ messages: messages,
+ tools: tools,
+ tool_choice: "auto",
+ });
+
+ console.log(response);
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ChatTool getCurrentWeatherTool = ChatTool.CreateFunctionTool(
+ functionName: "get_current_weather",
+ functionDescription: "Get the current weather in a given location",
+ functionParameters: BinaryData.FromString("""
+ {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": [ "celsius", "fahrenheit" ]
+ }
+ },
+ "required": [ "location" ]
+ }
+ """)
+ );
+
+ List messages =
+ [
+ new UserChatMessage("What's the weather like in Boston today?"),
+ ];
+
+ ChatCompletionOptions options = new()
+ {
+ Tools =
+ {
+ getCurrentWeatherTool
+ },
+ ToolChoice = ChatToolChoice.CreateAutoChoice(),
+ };
+
+ ChatCompletion completion = client.CompleteChat(messages, options);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {
+ "id": "chatcmpl-abc123",
+ "object": "chat.completion",
+ "created": 1699896916,
+ "model": "gpt-4o-mini",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": null,
+ "tool_calls": [
+ {
+ "id": "call_abc123",
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "arguments": "{
+ "location": "Boston, MA"
+ }"
+ }
+ }
+ ]
+ },
+ "logprobs": null,
+ "finish_reason": "tool_calls"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 82,
+ "completion_tokens": 17,
+ "total_tokens": 99,
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ }
+ }
+ - title: Logprobs
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_chat_model_id",
+ "messages": [
+ {
+ "role": "user",
+ "content": "Hello!"
+ }
+ ],
+ "logprobs": true,
+ "top_logprobs": 2
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ messages: [{ role: "user", content: "Hello!" }],
+ model: "VAR_chat_model_id",
+ logprobs: true,
+ top_logprobs: 2,
+ });
+
+ console.log(completion.choices[0]);
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new UserChatMessage("Hello!")
+ ];
+
+ ChatCompletionOptions options = new()
+ {
+ IncludeLogProbabilities = true,
+ TopLogProbabilityCount = 2
+ };
+
+ ChatCompletion completion = client.CompleteChat(messages, options);
+
+ Console.WriteLine(completion.Content[0].Text);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {
+ "id": "chatcmpl-123",
+ "object": "chat.completion",
+ "created": 1702685778,
+ "model": "gpt-4o-mini",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "Hello! How can I assist you today?"
+ },
+ "logprobs": {
+ "content": [
+ {
+ "token": "Hello",
+ "logprob": -0.31725305,
+ "bytes": [72, 101, 108, 108, 111],
+ "top_logprobs": [
+ {
+ "token": "Hello",
+ "logprob": -0.31725305,
+ "bytes": [72, 101, 108, 108, 111]
+ },
+ {
+ "token": "Hi",
+ "logprob": -1.3190403,
+ "bytes": [72, 105]
+ }
+ ]
+ },
+ {
+ "token": "!",
+ "logprob": -0.02380986,
+ "bytes": [
+ 33
+ ],
+ "top_logprobs": [
+ {
+ "token": "!",
+ "logprob": -0.02380986,
+ "bytes": [33]
+ },
+ {
+ "token": " there",
+ "logprob": -3.787621,
+ "bytes": [32, 116, 104, 101, 114, 101]
+ }
+ ]
+ },
+ {
+ "token": " How",
+ "logprob": -0.000054669687,
+ "bytes": [32, 72, 111, 119],
+ "top_logprobs": [
+ {
+ "token": " How",
+ "logprob": -0.000054669687,
+ "bytes": [32, 72, 111, 119]
+ },
+ {
+ "token": "<|end|>",
+ "logprob": -10.953937,
+ "bytes": null
+ }
+ ]
+ },
+ {
+ "token": " can",
+ "logprob": -0.015801601,
+ "bytes": [32, 99, 97, 110],
+ "top_logprobs": [
+ {
+ "token": " can",
+ "logprob": -0.015801601,
+ "bytes": [32, 99, 97, 110]
+ },
+ {
+ "token": " may",
+ "logprob": -4.161023,
+ "bytes": [32, 109, 97, 121]
+ }
+ ]
+ },
+ {
+ "token": " I",
+ "logprob": -3.7697225e-6,
+ "bytes": [
+ 32,
+ 73
+ ],
+ "top_logprobs": [
+ {
+ "token": " I",
+ "logprob": -3.7697225e-6,
+ "bytes": [32, 73]
+ },
+ {
+ "token": " assist",
+ "logprob": -13.596657,
+ "bytes": [32, 97, 115, 115, 105, 115, 116]
+ }
+ ]
+ },
+ {
+ "token": " assist",
+ "logprob": -0.04571125,
+ "bytes": [32, 97, 115, 115, 105, 115, 116],
+ "top_logprobs": [
+ {
+ "token": " assist",
+ "logprob": -0.04571125,
+ "bytes": [32, 97, 115, 115, 105, 115, 116]
+ },
+ {
+ "token": " help",
+ "logprob": -3.1089056,
+ "bytes": [32, 104, 101, 108, 112]
+ }
+ ]
+ },
+ {
+ "token": " you",
+ "logprob": -5.4385737e-6,
+ "bytes": [32, 121, 111, 117],
+ "top_logprobs": [
+ {
+ "token": " you",
+ "logprob": -5.4385737e-6,
+ "bytes": [32, 121, 111, 117]
+ },
+ {
+ "token": " today",
+ "logprob": -12.807695,
+ "bytes": [32, 116, 111, 100, 97, 121]
+ }
+ ]
+ },
+ {
+ "token": " today",
+ "logprob": -0.0040071653,
+ "bytes": [32, 116, 111, 100, 97, 121],
+ "top_logprobs": [
+ {
+ "token": " today",
+ "logprob": -0.0040071653,
+ "bytes": [32, 116, 111, 100, 97, 121]
+ },
+ {
+ "token": "?",
+ "logprob": -5.5247097,
+ "bytes": [63]
+ }
+ ]
+ },
+ {
+ "token": "?",
+ "logprob": -0.0008108172,
+ "bytes": [63],
+ "top_logprobs": [
+ {
+ "token": "?",
+ "logprob": -0.0008108172,
+ "bytes": [63]
+ },
+ {
+ "token": "?
+ ",
+ "logprob": -7.184561,
+ "bytes": [63, 10]
+ }
+ ]
+ }
+ ]
+ },
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 9,
+ "completion_tokens": 9,
+ "total_tokens": 18,
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "system_fingerprint": null
+ }
+ /openai/v1/chat/completions/{completion_id}:
delete:
- operationId: Evals_deleteEvalRun
- summary: Delete an evaluation run
- description: Removes the specified evaluation run.
+ operationId: Chat_deleteChatCompletion
+ summary: Delete a chat completion
+ description: Deletes a chat completion by its identifier.
parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to delete the run from.
- schema:
- type: string
- - name: run_id
+ - name: completion_id
in: path
required: true
- description: The ID of the run to delete.
+ description: The ID of the chat completion to delete.
schema:
type: string
responses:
@@ -7529,7 +11199,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteEvalRunResponse'
+ $ref: '#/components/schemas/OpenAI.ChatCompletionDeleted'
4XX:
description: Client error
content:
@@ -7543,22 +11213,99 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Chat
+ x-oaiMeta:
+ name: Delete chat completion
+ group: chat
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/chat/completions/chat_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ chat_completion_deleted = client.chat.completions.delete(
+ "completion_id",
+ )
+ print(chat_completion_deleted.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletionDeleted = await client.chat.completions.delete('completion_id');
+
+ console.log(chatCompletionDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletionDeleted, err := client.Chat.Completions.Delete(context.TODO(), "completion_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletionDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.ChatCompletionDeleteParams;
+ import com.openai.models.chat.completions.ChatCompletionDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionDeleted chatCompletionDeleted = client.chat().completions().delete("completion_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion_deleted = openai.chat.completions.delete("completion_id")
+
+ puts(chat_completion_deleted)
+ response: |
+ {
+ "object": "chat.completion.deleted",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "deleted": true
+ }
get:
- operationId: Evals_getEvalRun
- summary: Get an evaluation run
- description: Retrieves the specified evaluation run and its current status.
+ operationId: Chat_getChatCompletion
+ summary: Get a chat completion
+ description: Retrieves a chat completion by its identifier.
parameters:
- - name: eval_id
+ - name: completion_id
in: path
required: true
- description: The ID of the evaluation to retrieve runs for.
- schema:
- type: string
- - name: run_id
- in: path
- required: true
- description: The ID of the run to retrieve.
+ description: The ID of the chat completion to retrieve.
schema:
type: string
responses:
@@ -7567,7 +11314,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/EvalRun'
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponse'
4XX:
description: Client error
content:
@@ -7581,22 +11328,133 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Chat
+ x-oaiMeta:
+ name: Get chat completion
+ group: chat
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions/chatcmpl-abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ chat_completion = client.chat.completions.retrieve(
+ "completion_id",
+ )
+ print(chat_completion.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.retrieve('completion_id');
+
+ console.log(chatCompletion.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.Get(context.TODO(), "completion_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletion chatCompletion = client.chat().completions().retrieve("completion_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.retrieve("completion_id")
+
+ puts(chat_completion)
+ response: |
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-abc123",
+ "model": "gpt-4o-2024-08-06",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {},
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
post:
- operationId: Evals_cancelEvalRun
- summary: Cancel an evaluation run
- description: Cancels an ongoing evaluation run.
+ operationId: Chat_updateChatCompletion
+ summary: Update a chat completion
+ description: Updates a chat completion with the supplied changes.
parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation whose run you want to cancel.
- schema:
- type: string
- - name: run_id
+ - name: completion_id
in: path
required: true
- description: The ID of the run to cancel.
+ description: The ID of the chat completion to update.
schema:
type: string
responses:
@@ -7605,7 +11463,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/EvalRun'
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponse'
4XX:
description: Client error
content:
@@ -7619,87 +11477,195 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- /openai/v1/evals/{eval_id}/runs/{run_id}/output_items:
+ - Chat
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.UpdateChatCompletionParametersBody'
+ description: The request body.
+ x-oaiMeta:
+ name: Update chat completion
+ group: chat
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/chat/completions/chat_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"metadata": {"foo": "bar"}}'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ chat_completion = client.chat.completions.update(
+ completion_id="completion_id",
+ metadata={
+ "foo": "string"
+ },
+ )
+ print(chat_completion.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.update('completion_id', {
+ metadata: { foo: 'string' },
+ });
+
+ console.log(chatCompletion.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.Update(
+ context.TODO(),
+ "completion_id",
+ openai.ChatCompletionUpdateParams{
+ Metadata: shared.Metadata{
+ "foo": "string",
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionUpdateParams params = ChatCompletionUpdateParams.builder()
+ .completionId("completion_id")
+ .metadata(ChatCompletionUpdateParams.Metadata.builder()
+ .putAdditionalProperty("foo", JsonValue.from("string"))
+ .build())
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.update("completion_id", metadata: {foo: "string"})
+
+ puts(chat_completion)
+ response: |
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "model": "gpt-4o-2024-08-06",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {
+ "foo": "bar"
+ },
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
+ /openai/v1/chat/completions/{completion_id}/messages:
get:
- operationId: Evals_getEvalRunOutputItems
- summary: List evaluation run output items
- description: Returns the output items produced by the specified evaluation run.
+ operationId: Chat_getChatCompletionMessages
+ summary: Get chat completion messages
+ description: Retrieves chat completion messages by its identifier.
parameters:
- - name: eval_id
- in: path
- required: true
- schema:
- type: string
- - name: run_id
+ - name: completion_id
in: path
required: true
- description: The ID of the run to retrieve output items for.
+ description: The ID of the chat completion to retrieve messages from.
schema:
type: string
- name: after
in: query
required: false
- description: Identifier for the last run from the previous pagination request.
+ description: Identifier for the last message from the previous pagination request.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
- name: limit
in: query
required: false
- description: Number of runs to retrieve.
+ description: Number of messages to retrieve.
schema:
$ref: '#/components/schemas/integer'
default: 20
- explode: false
- name: order
in: query
required: false
- description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
+ description: Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
- type: string
- enum:
- - asc
- - desc
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
default: asc
- explode: false
- - name: status
- in: query
- required: false
- description: |-
- Filter output items by status. Use `failed` to filter by failed output
- items or `pass` to filter by passed output items.
- schema:
- type: string
- enum:
- - fail
- - pass
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/EvalRunOutputItem'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageList'
4XX:
description: Client error
content:
@@ -7713,38 +11679,122 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- /openai/v1/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}:
- get:
- operationId: Evals_getEvalRunOutputItem
- summary: Get an output item of an evaluation run
- description: Retrieves a single output item from the specified evaluation run.
- parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to retrieve runs for.
- schema:
- type: string
- - name: run_id
- in: path
- required: true
- description: The ID of the run to retrieve.
- schema:
- type: string
- - name: output_item_id
- in: path
- required: true
- description: The ID of the output item to retrieve.
- schema:
- type: string
+ - Chat
+ x-oaiMeta:
+ name: Get chat messages
+ group: chat
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions/chat_abc123/messages \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.chat.completions.messages.list(
+ completion_id="completion_id",
+ )
+ page = page.data[0]
+ print(page)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const chatCompletionStoreMessage of client.chat.completions.messages.list(
+ 'completion_id',
+ )) {
+ console.log(chatCompletionStoreMessage);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Chat.Completions.Messages.List(
+ context.TODO(),
+ "completion_id",
+ openai.ChatCompletionMessageListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.messages.MessageListPage;
+ import com.openai.models.chat.completions.messages.MessageListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageListPage page = client.chat().completions().messages().list("completion_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.chat.completions.messages.list("completion_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "role": "user",
+ "content": "write a haiku about ai",
+ "name": null,
+ "content_parts": null
+ }
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/completions:
+ post:
+ operationId: Completions_createCompletion
+ summary: Create a completion
+ description: Creates a completion from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/EvalRunOutputItem'
+ $ref: '#/components/schemas/OpenAI.CreateCompletionResponse'
4XX:
description: Client error
content:
@@ -7758,32 +11808,318 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- /openai/v1/fine_tuning/jobs:
- post:
- operationId: createFineTuningJob
- summary: Create a fine-tuning job
- description: |-
- Creates a fine-tuning job which begins the process of creating a new model from a given dataset.
+ - Completions
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateCompletionRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create completion
+ group: completions
+ legacy: true
+ examples:
+ - title: No streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_completion_model_id",
+ "prompt": "Say this is a test",
+ "max_tokens": 7,
+ "temperature": 0
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.completions.create(
+ model="gpt-3.5-turbo-instruct",
+ prompt="This is a test.",
+ ):
+ print(completion)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.completions.create({
+ model: "VAR_completion_model_id",
+ prompt: "Say this is a test.",
+ max_tokens: 7,
+ temperature: 0,
+ });
+
+ console.log(completion);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const completion = await client.completions.create({
+ model: 'gpt-3.5-turbo-instruct',
+ prompt: 'This is a test.',
+ });
+
+ console.log(completion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ completion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{
+ Model: openai.CompletionNewParamsModelGPT3_5TurboInstruct,
+ Prompt: openai.CompletionNewParamsPromptUnion{
+ OfString: openai.String("This is a test."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", completion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.completions.Completion;
+ import com.openai.models.completions.CompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ CompletionCreateParams params = CompletionCreateParams.builder()
+ .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)
+ .prompt("This is a test.")
+ .build();
+ Completion completion = client.completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ completion = openai.completions.create(model: :"gpt-3.5-turbo-instruct", prompt: "This is a test.")
+
+ puts(completion)
+ response: |
+ {
+ "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
+ "object": "text_completion",
+ "created": 1589478378,
+ "model": "VAR_completion_model_id",
+ "system_fingerprint": "fp_44709d6fcb",
+ "choices": [
+ {
+ "text": "
+
+ This is indeed a test",
+ "index": 0,
+ "logprobs": null,
+ "finish_reason": "length"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 5,
+ "completion_tokens": 7,
+ "total_tokens": 12
+ }
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_completion_model_id",
+ "prompt": "Say this is a test",
+ "max_tokens": 7,
+ "temperature": 0,
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.completions.create(
+ model="gpt-3.5-turbo-instruct",
+ prompt="This is a test.",
+ ):
+ print(completion)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.completions.create({
+ model: "VAR_completion_model_id",
+ prompt: "Say this is a test.",
+ stream: true,
+ });
+
+ for await (const chunk of stream) {
+ console.log(chunk.choices[0].text)
+ }
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const completion = await client.completions.create({
+ model: 'gpt-3.5-turbo-instruct',
+ prompt: 'This is a test.',
+ });
+
+ console.log(completion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
- Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ completion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{
+ Model: openai.CompletionNewParamsModelGPT3_5TurboInstruct,
+ Prompt: openai.CompletionNewParamsPromptUnion{
+ OfString: openai.String("This is a test."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", completion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.completions.Completion;
+ import com.openai.models.completions.CompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ CompletionCreateParams params = CompletionCreateParams.builder()
+ .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)
+ .prompt("This is a test.")
+ .build();
+ Completion completion = client.completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
- [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
+ completion = openai.completions.create(model: :"gpt-3.5-turbo-instruct", prompt: "This is a test.")
+
+ puts(completion)
+ response: |
+ {
+ "id": "cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe",
+ "object": "text_completion",
+ "created": 1690759702,
+ "choices": [
+ {
+ "text": "This",
+ "index": 0,
+ "logprobs": null,
+ "finish_reason": null
+ }
+ ],
+ "model": "gpt-3.5-turbo-instruct"
+ "system_fingerprint": "fp_44709d6fcb",
+ }
+ /openai/v1/containers:
+ get:
+ operationId: Containers_listContainers
+ summary: List containers
+ description: Lists containers matching the request filters.
parameters:
- - name: api-version
+ - name: limit
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: name
+ in: query
+ required: false
+ description: Filter results by container name.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ $ref: '#/components/schemas/OpenAI.ContainerListResource'
4XX:
description: Client error
content:
@@ -7797,48 +12133,119 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequest'
- get:
- operationId: listPaginatedFineTuningJobs
- summary: List fine-tuning jobs
- description: Returns the fine-tuning jobs for the current organization.
- parameters:
- - name: after
- in: query
- required: false
- description: Identifier for the last job from the previous pagination request.
- schema:
- type: string
- explode: false
- - name: limit
- in: query
- required: false
- description: Number of fine-tuning jobs to retrieve.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Containers
+ x-oaiMeta:
+ name: List containers
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const containerListResponse of client.containers.list()) {
+ console.log(containerListResponse.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.containers.list()
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Containers.List(context.TODO(), openai.ContainerListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerListPage;
+ import com.openai.models.containers.ContainerListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContainerListPage page = client.containers().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.containers.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container",
+ "created_at": 1747844794,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747844794,
+ "memory_limit": "4g",
+ "name": "My Container"
+ }
+ ],
+ "first_id": "container_123",
+ "last_id": "container_123",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: Containers_createContainer
+ summary: Create a container
+ description: Creates a container from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse'
+ $ref: '#/components/schemas/OpenAI.ContainerResource'
4XX:
description: Client error
content:
@@ -7852,36 +12259,149 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}:
- get:
- operationId: retrieveFineTuningJob
- summary: Get a fine-tuning job
- description: |-
- Gets info about a fine-tuning job.
+ - Containers
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateContainerBody'
+ description: The request body.
+ x-oaiMeta:
+ name: Create container
+ group: containers
+ path: post
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "My Container",
+ "memory_limit": "4g",
+ "skills": [
+ {
+ "type": "skill_reference",
+ "skill_id": "skill_4db6f1a2c9e73508b41f9da06e2c7b5f"
+ },
+ {
+ "type": "skill_reference",
+ "skill_id": "openai-spreadsheets",
+ "version": "latest"
+ }
+ ],
+ "network_policy": {
+ "type": "allowlist",
+ "allowed_domains": ["api.buildkite.com"]
+ }
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const container = await client.containers.create({ name: 'name' });
+
+ console.log(container.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ container = client.containers.create(
+ name="name",
+ )
+ print(container.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
- [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ container, err := client.Containers.New(context.TODO(), openai.ContainerNewParams{
+ Name: "name",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", container.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerCreateParams;
+ import com.openai.models.containers.ContainerCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContainerCreateParams params = ContainerCreateParams.builder()
+ .name("name")
+ .build();
+ ContainerCreateResponse container = client.containers().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ container = openai.containers.create(name: "name")
+
+ puts(container)
+ response: |
+ {
+ "id": "cntr_682e30645a488191b6363a0cbefc0f0a025ec61b66250591",
+ "object": "container",
+ "created_at": 1747857508,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747857508,
+ "network_policy": {
+ "type": "allowlist",
+ "allowed_domains": ["api.buildkite.com"]
+ },
+ "memory_limit": "4g",
+ "name": "My Container"
+ }
+ /openai/v1/containers/{container_id}:
+ delete:
+ operationId: Containers_deleteContainer
+ summary: Delete a container
+ description: Deletes a container by its identifier.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job.
- schema:
- type: string
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the container to delete.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -7895,33 +12415,101 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel:
- post:
- operationId: cancelFineTuningJob
- summary: Cancel a fine-tuning job
- description: Immediately cancels the specified fine-tuning job.
+ - Containers
+ x-oaiMeta:
+ name: Delete a container
+ group: containers
+ path: delete
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ await client.containers.delete('container_id');
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ client.containers.delete(
+ "container_id",
+ )
+ go: |
+ package main
+
+ import (
+ "context"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ err := client.Containers.Delete(context.TODO(), "container_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ client.containers().delete("container_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ result = openai.containers.delete("container_id")
+
+ puts(result)
+ response: |
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Containers_retrieveContainer
+ summary: Get a container
+ description: Retrieves a container by its identifier.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to cancel.
- schema:
- type: string
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the container.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ $ref: '#/components/schemas/OpenAI.ContainerResource'
4XX:
description: Client error
content:
@@ -7935,49 +12523,138 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints:
+ - Containers
+ x-oaiMeta:
+ name: Retrieve container
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const container = await client.containers.retrieve('container_id');
+
+ console.log(container.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ container = client.containers.retrieve(
+ "container_id",
+ )
+ print(container.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ container, err := client.Containers.Get(context.TODO(), "container_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", container.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerRetrieveParams;
+ import com.openai.models.containers.ContainerRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContainerRetrieveResponse container = client.containers().retrieve("container_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ container = openai.containers.retrieve("container_id")
+
+ puts(container)
+ response: |
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container",
+ "created_at": 1747844794,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747844794,
+ "memory_limit": "4g",
+ "name": "My Container"
+ }
+ /openai/v1/containers/{container_id}/files:
get:
- operationId: listFineTuningJobCheckpoints
- summary: List fine-tuning job checkpoints
- description: Returns the checkpoints saved during the specified fine-tuning job.
+ operationId: Containers_listContainerFiles
+ summary: List container files
+ description: Lists container files matching the request filters.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to get checkpoints for.
+ description: The ID of the container.
schema:
type: string
- - name: after
+ - name: limit
in: query
required: false
- description: Identifier for the last checkpoint ID from the previous pagination request.
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
schema:
- type: string
- explode: false
- - name: limit
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
in: query
required: false
- description: Number of checkpoints to retrieve.
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
schema:
- type: integer
- format: int32
- default: 10
- explode: false
- - name: api-version
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: 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.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse'
+ $ref: '#/components/schemas/OpenAI.ContainerFileListResource'
4XX:
description: Client error
content:
@@ -7991,49 +12668,127 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/events:
- get:
- operationId: listFineTuningJobEvents
- summary: List fine-tuning job events
- description: Returns the status events emitted during the specified fine-tuning job.
+ - Containers
+ x-oaiMeta:
+ name: List container files
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fileListResponse of client.containers.files.list('container_id')) {
+ console.log(fileListResponse.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.containers.files.list(
+ container_id="container_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Containers.Files.List(
+ context.TODO(),
+ "container_id",
+ openai.ContainerFileListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileListPage;
+ import com.openai.models.containers.files.FileListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileListPage page = client.containers().files().list("container_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.containers.files.list("container_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+ ],
+ "first_id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "has_more": false,
+ "last_id": "cfile_682e0e8a43c88191a7978f477a09bdf5"
+ }
+ x-ms-list: true
+ post:
+ operationId: Containers_createContainerFileMultipart_Containers_createContainerFileJson
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to get events for.
- schema:
- type: string
- - name: after
- in: query
- required: false
- description: Identifier for the last event from the previous pagination request.
- schema:
- type: string
- explode: false
- - name: limit
- in: query
- required: false
- description: Number of events to retrieve.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the container.
schema:
type: string
- explode: false
+ description: Creates a container file multipart from the supplied request. Creates a container file json from the supplied request.
+ summary: Create a container file multipart Create a container file json
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ListFineTuningJobEventsResponse'
+ $ref: '#/components/schemas/OpenAI.ContainerFileResource'
4XX:
description: Client error
content:
@@ -8046,34 +12801,258 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause:
- post:
- operationId: pauseFineTuningJob
- summary: Pause a fine-tuning job
- description: Pauses the specified fine-tuning job while it is running.
+ x-ms-request-body-description-override: The request body.
+ x-oaiMeta:
+ name: Create container file
+ group: containers
+ path: post
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F file="@example.txt"
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const file = await client.containers.files.create('container_id');
+
+ console.log(file.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file = client.containers.files.create(
+ container_id="container_id",
+ )
+ print(file.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ file, err := client.Containers.Files.New(
+ context.TODO(),
+ "container_id",
+ openai.ContainerFileNewParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", file.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileCreateParams;
+ import com.openai.models.containers.files.FileCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateResponse file = client.containers().files().create("container_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file = openai.containers.files.create("container_id")
+
+ puts(file)
+ response: |
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+ tags:
+ - Containers
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateContainerFileBody'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateContainerFileBody'
+ description: The multipart request body. The request body.
+ /openai/v1/containers/{container_id}/files/{file_id}:
+ delete:
+ operationId: Containers_deleteContainerFile
+ summary: Delete a container file
+ description: Deletes a container file by its identifier.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to pause.
+ description: The ID of the container.
schema:
type: string
- - name: api-version
- in: query
+ - name: file_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the file.
schema:
type: string
- explode: false
+ x-ms-description-override: The ID of the file.
responses:
'200':
description: The request has succeeded.
+ 4XX:
+ description: Client error
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Containers
+ x-oaiMeta:
+ name: Delete a container file
+ group: containers
+ path: delete
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863/files/cfile_682e0e8a43c88191a7978f477a09bdf5 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ await client.containers.files.delete('file_id', { container_id: 'container_id' });
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ client.containers.files.delete(
+ file_id="file_id",
+ container_id="container_id",
+ )
+ go: |
+ package main
+
+ import (
+ "context"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ err := client.Containers.Files.Delete(
+ context.TODO(),
+ "container_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileDeleteParams params = FileDeleteParams.builder()
+ .containerId("container_id")
+ .fileId("file_id")
+ .build();
+ client.containers().files().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ result = openai.containers.files.delete("file_id", container_id: "container_id")
+
+ puts(result)
+ response: |
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Containers_retrieveContainerFile
+ summary: Get a container file
+ description: Retrieves a container file by its identifier.
+ parameters:
+ - name: container_id
+ in: path
+ required: true
+ description: The ID of the container.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file.
+ schema:
+ type: string
+ x-ms-description-override: The ID of the file.
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ContainerFileResource'
4XX:
description: Client error
content:
@@ -8087,33 +13066,253 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume:
- post:
- operationId: resumeFineTuningJob
- summary: Resume a fine-tuning job
- description: Resumes the specified fine-tuning job after it has been paused.
+ - Containers
+ x-oaiMeta:
+ name: Retrieve container file
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/container_123/files/file_456 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const file = await client.containers.files.retrieve('file_id', { container_id: 'container_id' });
+
+ console.log(file.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file = client.containers.files.retrieve(
+ file_id="file_id",
+ container_id="container_id",
+ )
+ print(file.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ file, err := client.Containers.Files.Get(
+ context.TODO(),
+ "container_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", file.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileRetrieveParams;
+ import com.openai.models.containers.files.FileRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileRetrieveParams params = FileRetrieveParams.builder()
+ .containerId("container_id")
+ .fileId("file_id")
+ .build();
+ FileRetrieveResponse file = client.containers().files().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file = openai.containers.files.retrieve("file_id", container_id: "container_id")
+
+ puts(file)
+ response: |
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+ /openai/v1/containers/{container_id}/files/{file_id}/content:
+ get:
+ operationId: Containers_retrieveContainerFileContent
+ summary: Get a container file content
+ description: Retrieves a container file content by its identifier.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to resume.
+ description: The ID of the container.
schema:
type: string
- - name: api-version
- in: query
+ - name: file_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the file.
schema:
type: string
- explode: false
+ x-ms-description-override: The ID of the file.
responses:
'200':
description: The request has succeeded.
+ 4XX:
+ description: Client error
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Containers
+ x-oaiMeta:
+ name: Retrieve container file content
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/container_123/files/cfile_456/content \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const content = await client.containers.files.content.retrieve('file_id', {
+ container_id: 'container_id',
+ });
+
+ console.log(content);
+
+ const data = await content.blob();
+ console.log(data);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ content = client.containers.files.content.retrieve(
+ file_id="file_id",
+ container_id="container_id",
+ )
+ print(content)
+ data = content.read()
+ print(data)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ content, err := client.Containers.Files.Content.Get(
+ context.TODO(),
+ "container_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", content)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.containers.files.content.ContentRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContentRetrieveParams params = ContentRetrieveParams.builder()
+ .containerId("container_id")
+ .fileId("file_id")
+ .build();
+ HttpResponse content = client.containers().files().content().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ content = openai.containers.files.content.retrieve("file_id", container_id: "container_id")
+
+ puts(content)
+ response: |
+
+ /openai/v1/conversations:
+ post:
+ operationId: createConversation
+ summary: Create a conversation
+ description: Creates a new conversation resource.
+ parameters:
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
4XX:
description: Client error
content:
@@ -8127,13 +13326,204 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/responses:
- post:
- operationId: createResponse
- summary: Create a model response
- description: Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response.
+ - Conversations
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateConversationBody'
+ x-oaiMeta:
+ name: Create a conversation
+ group: conversations
+ path: create
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "metadata": {"topic": "demo"},
+ "items": [
+ {
+ "type": "message",
+ "role": "user",
+ "content": "Hello!"
+ }
+ ]
+ }'
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const conversation = await client.conversations.create({
+ metadata: { topic: "demo" },
+ items: [
+ { type: "message", role: "user", content: "Hello!" }
+ ],
+ });
+ console.log(conversation);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.create()
+ print(conversation.id)
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation conversation = client.CreateConversation(
+ new CreateConversationOptions
+ {
+ Metadata = new Dictionary
+ {
+ { "topic", "demo" }
+ },
+ Items =
+ {
+ new ConversationMessageInput
+ {
+ Role = "user",
+ Content = "Hello!",
+ }
+ }
+ }
+ );
+ Console.WriteLine(conversation.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.create();
+
+ console.log(conversation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.New(context.TODO(), conversations.ConversationNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.ConversationCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Conversation conversation = client.conversations().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.create
+
+ puts(conversation)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "demo"}
+ }
+ get:
+ operationId: listConversations
+ summary: List conversations
+ description: Returns the conversations available in the current project.
parameters:
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: agent_name
+ in: query
+ required: false
+ description: Filter by agent name. If provided, only items associated with the specified agent will be returned.
+ schema:
+ type: string
+ explode: false
+ - name: agent_id
+ in: query
+ required: false
+ description: Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.
+ schema:
+ type: string
+ explode: false
- name: x-ms-user-identity
in: header
required: false
@@ -8143,201 +13533,68 @@ paths:
responses:
'200':
description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
content:
application/json:
schema:
type: object
+ required:
+ - data
+ - has_more
properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- top_logprobs:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- user:
- type: string
- description: |-
- 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](/docs/guides/safety-best-practices#safety-identifiers).
- deprecated: true
- safety_identifier:
- type: string
- maxLength: 64
- description: |-
- 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
- prompt_cache_key:
- type: string
- description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
- service_tier:
- $ref: '#/components/schemas/OpenAI.ServiceTier'
- prompt_cache_retention:
- anyOf:
- - type: string
- enum:
- - in_memory
- - 24h
- - type: 'null'
- previous_response_id:
- anyOf:
- - type: string
- - type: 'null'
- model:
- type: string
- description: The model deployment to use for the creation of this response.
- background:
- anyOf:
- - type: boolean
- - type: 'null'
- max_tool_calls:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- text:
- $ref: '#/components/schemas/OpenAI.ResponseTextParam'
- tools:
- $ref: '#/components/schemas/OpenAI.ToolsArray'
- tool_choice:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- prompt:
- $ref: '#/components/schemas/OpenAI.Prompt'
- truncation:
- anyOf:
- - type: string
- enum:
- - auto
- - disabled
- - type: 'null'
- default: disabled
- id:
- type: string
- description: Unique identifier for this Response.
- object:
- type: string
- enum:
- - response
- description: The object type of this resource - always set to `response`.
- x-stainless-const: true
- status:
- type: string
- enum:
- - completed
- - failed
- - in_progress
- - cancelled
- - queued
- - incomplete
- description: |-
- The status of the response generation. One of `completed`, `failed`,
- `in_progress`, `cancelled`, `queued`, or `incomplete`.
- created_at:
- type: integer
- format: unixtime
- description: Unix timestamp (in seconds) of when this Response was created.
- completed_at:
- anyOf:
- - type: string
- format: date-time
- - type: 'null'
- type: integer
- format: unixTimestamp
- error:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseError'
- - type: 'null'
- incomplete_details:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails'
- - type: 'null'
- output:
+ data:
type: array
items:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- An array of content items generated by the model.
- - The length and order of items in the `output` array is dependent
- on the model's response.
- - Rather than accessing the first item in the `output` array and
- assuming it's an `assistant` message with the content generated by
- the model, you might consider using the `output_text` property where
- supported in SDKs.
- reasoning:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Reasoning'
- - type: 'null'
- instructions:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputItem'
- - type: 'null'
- output_text:
- anyOf:
- - type: string
- - type: 'null'
- usage:
- $ref: '#/components/schemas/OpenAI.ResponseUsage'
- moderation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Moderation'
- - type: 'null'
- parallel_tool_calls:
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
type: boolean
- description: Whether to allow the model to run tool calls in parallel.
- default: true
- conversation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ConversationReference'
- - type: 'null'
- max_output_tokens:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- agent_reference:
- anyOf:
- - $ref: '#/components/schemas/AgentReference'
- - type: 'null'
- description: The agent used for this response
- content_filters:
- type: array
- items:
- $ref: '#/components/schemas/ContentFilterResult'
- description: The content filter evaluation results.
- required:
- - id
- - object
- - created_at
- - error
- - incomplete_details
- - output
- - instructions
- - parallel_tool_calls
- - agent_reference
- text/event-stream:
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
schema:
- $ref: '#/components/schemas/OpenAI.CreateResponseStreamingResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Conversations
+ /openai/v1/conversations/{conversation_id}:
+ post:
+ operationId: updateConversation
+ summary: Update a conversation
+ description: Modifies the specified conversation's properties.
+ parameters:
+ - name: conversation_id
+ in: path
+ required: true
+ description: The id of the conversation to update.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
4XX:
description: Client error
content:
@@ -8351,156 +13608,719 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
+ - Conversations
requestBody:
required: true
content:
application/json:
schema:
- type: object
- properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- top_logprobs:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- user:
- type: string
- description: |-
- 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](/docs/guides/safety-best-practices#safety-identifiers).
- deprecated: true
- safety_identifier:
- type: string
- maxLength: 64
- description: |-
- 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
- prompt_cache_key:
- type: string
- description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
- service_tier:
- $ref: '#/components/schemas/OpenAI.ServiceTier'
- prompt_cache_retention:
- anyOf:
- - type: string
- enum:
- - in_memory
- - 24h
- - type: 'null'
- previous_response_id:
- anyOf:
- - type: string
- - type: 'null'
- model:
- type: string
- description: The model deployment to use for the creation of this response.
- background:
- anyOf:
- - type: boolean
- - type: 'null'
- max_tool_calls:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- text:
- $ref: '#/components/schemas/OpenAI.ResponseTextParam'
- tools:
- $ref: '#/components/schemas/OpenAI.ToolsArray'
- tool_choice:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- prompt:
- $ref: '#/components/schemas/OpenAI.Prompt'
- truncation:
- anyOf:
- - type: string
- enum:
- - auto
- - disabled
- - type: 'null'
- deprecated: true
- default: disabled
- reasoning:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Reasoning'
- - type: 'null'
- input:
- $ref: '#/components/schemas/OpenAI.InputParam'
- include:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.IncludeEnum'
- - type: 'null'
- parallel_tool_calls:
- anyOf:
- - type: boolean
- - type: 'null'
- default: true
- store:
- anyOf:
- - type: boolean
- - type: 'null'
- default: true
- instructions:
- anyOf:
- - type: string
- - type: 'null'
- moderation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ModerationParam'
- - type: 'null'
- stream:
- anyOf:
- - type: boolean
- - type: 'null'
- stream_options:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamOptions'
- - type: 'null'
- conversation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ConversationParam'
- - type: 'null'
- context_management:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.ContextManagementParam'
- - type: 'null'
- description: Context management configuration for this request.
- max_output_tokens:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- agent_reference:
- $ref: '#/components/schemas/AgentReference'
- description: The agent to use for generating the response.
- structured_inputs:
- type: object
- unevaluatedProperties: {}
- description: The structured inputs to the response that can participate in prompt template substitution or tool argument bindings.
+ $ref: '#/components/schemas/OpenAI.UpdateConversationBody'
+ x-oaiMeta:
+ name: Update a conversation
+ group: conversations
+ path: update
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations/conv_123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "metadata": {"topic": "project-x"}
+ }'
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const updated = await client.conversations.update(
+ "conv_123",
+ { metadata: { topic: "project-x" } }
+ );
+ console.log(updated);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.update(
+ conversation_id="conv_123",
+ metadata={
+ "foo": "string"
+ },
+ )
+ print(conversation.id)
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation updated = client.UpdateConversation(
+ conversationId: "conv_123",
+ new UpdateConversationOptions
+ {
+ Metadata = new Dictionary
+ {
+ { "topic", "project-x" }
+ }
+ }
+ );
+ Console.WriteLine(updated.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.update('conv_123', { metadata: { foo: 'string' } });
+
+ console.log(conversation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.Update(
+ context.TODO(),
+ "conv_123",
+ conversations.ConversationUpdateParams{
+ Metadata: shared.Metadata{
+ "foo": "string",
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.ConversationUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ConversationUpdateParams params = ConversationUpdateParams.builder()
+ .conversationId("conv_123")
+ .metadata(ConversationUpdateParams.Metadata.builder()
+ .putAdditionalProperty("foo", JsonValue.from("string"))
+ .build())
+ .build();
+ Conversation conversation = client.conversations().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.update("conv_123", metadata: {foo: "string"})
+
+ puts(conversation)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "project-x"}
+ }
get:
- operationId: listResponses
- summary: List responses
- description: Returns a collection of all stored responses matching specified filter criteria.
+ operationId: getConversation
+ summary: Retrieve a conversation
+ description: Retrieves the specified conversation and its metadata.
+ parameters:
+ - name: conversation_id
+ in: path
+ required: true
+ description: The id of the conversation to retrieve.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Conversations
+ x-oaiMeta:
+ name: Retrieve a conversation
+ group: conversations
+ path: retrieve
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations/conv_123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const conversation = await client.conversations.retrieve("conv_123");
+ console.log(conversation);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.retrieve(
+ "conv_123",
+ )
+ print(conversation.id)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation conversation = client.GetConversation("conv_123");
+ Console.WriteLine(conversation.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.retrieve('conv_123');
+
+ console.log(conversation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.Get(context.TODO(), "conv_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.ConversationRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Conversation conversation = client.conversations().retrieve("conv_123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.retrieve("conv_123")
+
+ puts(conversation)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "demo"}
+ }
+ delete:
+ operationId: deleteConversation
+ summary: Delete a conversation
+ description: Removes the specified conversation resource from the current project.
+ parameters:
+ - name: conversation_id
+ in: path
+ required: true
+ description: The id of the conversation to delete.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeletedConversationResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Conversations
+ x-oaiMeta:
+ name: Delete a conversation
+ group: conversations
+ path: delete
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/conversations/conv_123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const deleted = await client.conversations.delete("conv_123");
+ console.log(deleted);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation_deleted_resource = client.conversations.delete(
+ "conv_123",
+ )
+ print(conversation_deleted_resource.id)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ DeletedConversation deleted = client.DeleteConversation("conv_123");
+ Console.WriteLine(deleted.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversationDeletedResource = await client.conversations.delete('conv_123');
+
+ console.log(conversationDeletedResource.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversationDeletedResource, err := client.Conversations.Delete(context.TODO(), "conv_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversationDeletedResource.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.ConversationDeleteParams;
+ import com.openai.models.conversations.ConversationDeletedResource;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ConversationDeletedResource conversationDeletedResource = client.conversations().delete("conv_123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation_deleted_resource = openai.conversations.delete("conv_123")
+
+ puts(conversation_deleted_resource)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation.deleted",
+ "deleted": true
+ }
+ /openai/v1/conversations/{conversation_id}/items:
+ post:
+ operationId: createConversationItems
+ summary: Create conversation items
+ description: Adds one or more items to the specified conversation.
+ parameters:
+ - name: conversation_id
+ in: path
+ required: true
+ description: The id of the conversation on which the item needs to be created.
+ schema:
+ type: string
+ - name: include
+ in: query
+ required: false
+ description: |-
+ Additional fields to include in the response.
+ See the `include` parameter for listing Conversation items for more information.
+ schema:
+ type: array
+ items:
+ type: string
+ explode: false
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ConversationItemList'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Conversations
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Item'
+ maxItems: 20
+ description: The items to add to the conversation. You may add up to 20 items at a time.
+ required:
+ - items
+ x-oaiMeta:
+ name: Create items
+ group: conversations
+ path: create-item
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations/conv_123/items \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "items": [
+ {
+ "type": "message",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "How are you?"}
+ ]
+ }
+ ]
+ }'
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const items = await client.conversations.items.create(
+ "conv_123",
+ {
+ items: [
+ {
+ type: "message",
+ role: "user",
+ content: [{ type: "input_text", text: "Hello!" }],
+ },
+ {
+ type: "message",
+ role: "user",
+ content: [{ type: "input_text", text: "How are you?" }],
+ },
+ ],
+ }
+ );
+ console.log(items.data);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation_item_list = client.conversations.items.create(
+ conversation_id="conv_123",
+ items=[{
+ "content": "string",
+ "role": "user",
+ "type": "message",
+ }],
+ )
+ print(conversation_item_list.first_id)
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ConversationItemList created = client.ConversationItems.Create(
+ conversationId: "conv_123",
+ new CreateConversationItemsOptions
+ {
+ Items = new List
+ {
+ new ConversationMessage
+ {
+ Role = "user",
+ Content =
+ {
+ new ConversationInputText { Text = "Hello!" }
+ }
+ },
+ new ConversationMessage
+ {
+ Role = "user",
+ Content =
+ {
+ new ConversationInputText { Text = "How are you?" }
+ }
+ }
+ }
+ }
+ );
+ Console.WriteLine(created.Data.Count);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversationItemList = await client.conversations.items.create('conv_123', {
+ items: [
+ {
+ content: 'string',
+ role: 'user',
+ type: 'message',
+ },
+ ],
+ });
+
+ console.log(conversationItemList.first_id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversationItemList, err := client.Conversations.Items.New(
+ context.TODO(),
+ "conv_123",
+ conversations.ItemNewParams{
+ Items: []responses.ResponseInputItemUnionParam{{
+ OfMessage: &responses.EasyInputMessageParam{
+ Content: responses.EasyInputMessageContentUnionParam{
+ OfString: openai.String("string"),
+ },
+ Role: responses.EasyInputMessageRoleUser,
+ Type: responses.EasyInputMessageTypeMessage,
+ },
+ }},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversationItemList.FirstID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.items.ConversationItemList;
+ import com.openai.models.conversations.items.ItemCreateParams;
+ import com.openai.models.responses.EasyInputMessage;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemCreateParams params = ItemCreateParams.builder()
+ .conversationId("conv_123")
+ .addItem(EasyInputMessage.builder()
+ .content("string")
+ .role(EasyInputMessage.Role.USER)
+ .type(EasyInputMessage.Type.MESSAGE)
+ .build())
+ .build();
+ ConversationItemList conversationItemList = client.conversations().items().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation_item_list = openai.conversations.items.create("conv_123", items: [{content: "string", role: :user, type: :message}])
+
+ puts(conversation_item_list)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "type": "message",
+ "id": "msg_abc",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ },
+ {
+ "type": "message",
+ "id": "msg_def",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "How are you?"}
+ ]
+ }
+ ],
+ "first_id": "msg_abc",
+ "last_id": "msg_def",
+ "has_more": false
+ }
+ get:
+ operationId: listConversationItems
+ summary: List conversation items
+ description: Returns the items belonging to the specified conversation.
parameters:
+ - name: conversation_id
+ in: path
+ required: true
+ description: The id of the conversation on which the items needs to be listed.
+ schema:
+ type: string
- name: limit
in: query
required: false
@@ -8541,26 +14361,12 @@ paths:
schema:
type: string
explode: false
- - name: agent_name
- in: query
- required: false
- description: Filter by agent name. If provided, only items associated with the specified agent will be returned.
- schema:
- type: string
- explode: false
- - name: agent_id
- in: query
- required: false
- description: Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.
- schema:
- type: string
- explode: false
- - name: conversation_id
+ - name: item_type
in: query
required: false
- description: Filter by conversation ID. If provided, only responses associated with the specified conversation will be returned.
+ description: Filter by item type. If provided, only items of the specified type will be returned.
schema:
- type: string
+ $ref: '#/components/schemas/OpenAI.ItemType'
explode: false
- name: x-ms-user-identity
in: header
@@ -8582,7 +14388,7 @@ paths:
data:
type: array
items:
- $ref: '#/components/schemas/OpenAI.Response'
+ $ref: '#/components/schemas/OpenAI.OutputItem'
description: The requested list of items.
first_id:
type: string
@@ -8607,20 +14413,160 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
- /openai/v1/responses/compact:
- post:
- operationId: compactResponseConversation
- summary: Compact a conversation
- description: Compacts a conversation into a response object suitable for long-running and zero-data-retention scenarios.
- parameters: []
+ - Conversations
+ x-oaiMeta:
+ name: List items
+ group: conversations
+ path: list-items
+ examples:
+ request:
+ curl: |
+ curl "https://api.openai.com/v1/conversations/conv_123/items?limit=10" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const items = await client.conversations.items.list("conv_123", { limit: 10 });
+ console.log(items.data);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.conversations.items.list(
+ conversation_id="conv_123",
+ )
+ page = page.data[0]
+ print(page)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ConversationItemList items = client.ConversationItems.List(
+ conversationId: "conv_123",
+ new ListConversationItemsOptions { Limit = 10 }
+ );
+ Console.WriteLine(items.Data.Count);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const conversationItem of client.conversations.items.list('conv_123')) {
+ console.log(conversationItem);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Conversations.Items.List(
+ context.TODO(),
+ "conv_123",
+ conversations.ItemListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.items.ItemListPage;
+ import com.openai.models.conversations.items.ItemListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemListPage page = client.conversations().items().list("conv_123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.conversations.items.list("conv_123")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "type": "message",
+ "id": "msg_abc",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ }
+ ],
+ "first_id": "msg_abc",
+ "last_id": "msg_abc",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/conversations/{conversation_id}/items/{item_id}:
+ get:
+ operationId: getConversationItem
+ summary: Get a conversation item
+ description: Retrieves a specific item from the specified conversation.
+ parameters:
+ - name: conversation_id
+ in: path
+ required: true
+ description: The ID of the conversation that contains the item.
+ schema:
+ type: string
+ - name: item_id
+ in: path
+ required: true
+ description: The id of the conversation item to retrieve.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.CompactResource'
+ $ref: '#/components/schemas/OpenAI.OutputItem'
4XX:
description: Client error
content:
@@ -8634,91 +14580,144 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.CompactResponseMethodPublicBody'
- /openai/v1/responses/{response_id}:
- get:
- operationId: getResponse
- summary: Retrieve a model response
- description: Retrieves a model response with the given ID.
+ - Conversations
+ x-oaiMeta:
+ name: Retrieve an item
+ group: conversations
+ path: get-item
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations/conv_123/items/msg_abc \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const item = await client.conversations.items.retrieve(
+ "conv_123",
+ "msg_abc"
+ );
+ console.log(item);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation_item = client.conversations.items.retrieve(
+ item_id="msg_abc",
+ conversation_id="conv_123",
+ )
+ print(conversation_item)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ConversationItem item = client.ConversationItems.Get(
+ conversationId: "conv_123",
+ itemId: "msg_abc"
+ );
+ Console.WriteLine(item.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversationItem = await client.conversations.items.retrieve('msg_abc', {
+ conversation_id: 'conv_123',
+ });
+
+ console.log(conversationItem);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversationItem, err := client.Conversations.Items.Get(
+ context.TODO(),
+ "conv_123",
+ "msg_abc",
+ conversations.ItemGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversationItem)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.items.ConversationItem;
+ import com.openai.models.conversations.items.ItemRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemRetrieveParams params = ItemRetrieveParams.builder()
+ .conversationId("conv_123")
+ .itemId("msg_abc")
+ .build();
+ ConversationItem conversationItem = client.conversations().items().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation_item = openai.conversations.items.retrieve("msg_abc", conversation_id: "conv_123")
+
+ puts(conversation_item)
+ response: |
+ {
+ "type": "message",
+ "id": "msg_abc",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ }
+ delete:
+ operationId: deleteConversationItem
+ summary: Delete a conversation item
+ description: Removes the specified item from a conversation.
parameters:
- - name: response_id
+ - name: conversation_id
in: path
required: true
+ description: The id of the conversation on which the item needs to be deleted from.
schema:
type: string
- - name: include[]
- in: query
- required: false
- schema:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.IncludeEnum'
- default: []
- - name: stream
- in: query
- required: false
- schema:
- type: boolean
- default: false
- explode: false
- - name: starting_after
- in: query
- required: false
- schema:
- type: integer
- format: int32
- explode: false
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
- responses:
- '200':
- description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.Response'
- text/event-stream:
- schema:
- $ref: '#/components/schemas/OpenAI.CreateResponseStreamingResponse'
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Responses
- delete:
- operationId: deleteResponse
- summary: Delete a model response
- description: Deletes a model response.
- parameters:
- - name: response_id
+ - name: item_id
in: path
required: true
- description: The ID of the response to delete.
+ description: The id of the conversation item to delete.
schema:
type: string
- name: x-ms-user-identity
@@ -8730,16 +14729,10 @@ paths:
responses:
'200':
description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteResponseResult'
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
4XX:
description: Client error
content:
@@ -8753,38 +14746,137 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
- /openai/v1/responses/{response_id}/cancel:
+ - Conversations
+ x-oaiMeta:
+ name: Delete an item
+ group: conversations
+ path: delete-item
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/conversations/conv_123/items/msg_abc \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const conversation = await client.conversations.items.delete(
+ "conv_123",
+ "msg_abc"
+ );
+ console.log(conversation);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.items.delete(
+ item_id="msg_abc",
+ conversation_id="conv_123",
+ )
+ print(conversation.id)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation conversation = client.ConversationItems.Delete(
+ conversationId: "conv_123",
+ itemId: "msg_abc"
+ );
+ Console.WriteLine(conversation.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.items.delete('msg_abc', {
+ conversation_id: 'conv_123',
+ });
+
+ console.log(conversation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.Items.Delete(
+ context.TODO(),
+ "conv_123",
+ "msg_abc",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.items.ItemDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemDeleteParams params = ItemDeleteParams.builder()
+ .conversationId("conv_123")
+ .itemId("msg_abc")
+ .build();
+ Conversation conversation = client.conversations().items().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.items.delete("msg_abc", conversation_id: "conv_123")
+
+ puts(conversation)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "demo"}
+ }
+ /openai/v1/embeddings:
post:
- operationId: cancelResponse
- summary: Cancel a model response
- description: Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.
- parameters:
- - name: response_id
- in: path
- required: true
- description: The ID of the response to cancel.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
+ operationId: Embeddings_createEmbedding
+ summary: Create an embedding
+ description: Creates an embedding from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.Response'
+ $ref: '#/components/schemas/OpenAI.CreateEmbeddingResponse'
4XX:
description: Client error
content:
@@ -8798,73 +14890,214 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
- /openai/v1/responses/{response_id}/input_items:
+ - Embeddings
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateEmbeddingRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create embeddings
+ group: embeddings
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/embeddings \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "input": "The food was delicious and the waiter...",
+ "model": "text-embedding-ada-002",
+ "encoding_format": "float"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ create_embedding_response = client.embeddings.create(
+ input="The quick brown fox jumped over the lazy dog",
+ model="text-embedding-3-small",
+ )
+ print(create_embedding_response.data)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const embedding = await openai.embeddings.create({
+ model: "text-embedding-ada-002",
+ input: "The quick brown fox jumped over the lazy dog",
+ encoding_format: "float",
+ });
+
+ console.log(embedding);
+ }
+
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Embeddings;
+
+ EmbeddingClient client = new(
+ model: "text-embedding-3-small",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ OpenAIEmbedding embedding = client.GenerateEmbedding(input: "The quick brown fox jumped over the lazy dog");
+ ReadOnlyMemory vector = embedding.ToFloats();
+
+ for (int i = 0; i < vector.Length; i++)
+ {
+ Console.WriteLine($" [{i,4}] = {vector.Span[i]}");
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const createEmbeddingResponse = await client.embeddings.create({
+ input: 'The quick brown fox jumped over the lazy dog',
+ model: 'text-embedding-3-small',
+ });
+
+ console.log(createEmbeddingResponse.data);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ createEmbeddingResponse, err := client.Embeddings.New(context.TODO(), openai.EmbeddingNewParams{
+ Input: openai.EmbeddingNewParamsInputUnion{
+ OfString: openai.String("The quick brown fox jumped over the lazy dog"),
+ },
+ Model: openai.EmbeddingModelTextEmbedding3Small,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", createEmbeddingResponse.Data)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.embeddings.CreateEmbeddingResponse;
+ import com.openai.models.embeddings.EmbeddingCreateParams;
+ import com.openai.models.embeddings.EmbeddingModel;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EmbeddingCreateParams params = EmbeddingCreateParams.builder()
+ .input("The quick brown fox jumped over the lazy dog")
+ .model(EmbeddingModel.TEXT_EMBEDDING_3_SMALL)
+ .build();
+ CreateEmbeddingResponse createEmbeddingResponse = client.embeddings().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ create_embedding_response = openai.embeddings.create(
+ input: "The quick brown fox jumped over the lazy dog",
+ model: :"text-embedding-3-small"
+ )
+
+ puts(create_embedding_response)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "embedding",
+ "embedding": [
+ 0.0023064255,
+ -0.009327292,
+ .... (1536 floats total for ada-002)
+ -0.0028842222,
+ ],
+ "index": 0
+ }
+ ],
+ "model": "text-embedding-ada-002",
+ "usage": {
+ "prompt_tokens": 8,
+ "total_tokens": 8
+ }
+ }
+ /openai/v1/evals:
get:
- operationId: listInputItems
- summary: List input items for a response
- description: Retrieves the input items associated with the specified response.
+ operationId: Evals_listEvals
+ summary: List evaluations
+ description: Returns the evaluations configured in the current project.
parameters:
- - name: response_id
- in: path
- required: true
+ - name: after
+ in: query
+ required: false
+ description: Identifier for the last run from the previous pagination request.
schema:
type: string
+ explode: false
- name: limit
in: query
required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
+ description: Number of runs to retrieve.
schema:
- type: integer
- format: int32
+ $ref: '#/components/schemas/integer'
default: 20
explode: false
- name: order
in: query
required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- - name: after
- in: query
- required: false
- description: |-
- 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.
+ description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
type: string
+ enum:
+ - asc
+ - desc
+ default: asc
explode: false
- - name: before
+ - name: order_by
in: query
required: false
description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ Evals can be ordered by creation time or last updated time.
+ Use `created_at` for creation time or `updated_at` for last updated time.
schema:
type: string
+ enum:
+ - created_at
+ - updated_at
+ default: created_at
responses:
'200':
description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
content:
application/json:
schema:
@@ -8876,7 +15109,7 @@ paths:
data:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ItemResource'
+ $ref: '#/components/schemas/Eval'
description: The requested list of items.
first_id:
type: string
@@ -8901,137 +15134,544 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
- /redTeams/runs:
- get:
- operationId: RedTeams_list
- summary: List redteams
- description: Returns the redteams available in the current project.
- parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - RedTeams=V1Preview
+ - Evals
+ x-oaiMeta:
+ name: List evals
+ group: evals
+ path: list
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals?limit=1 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.evals.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const evals = await openai.evals.list({ limit: 1 });
+ console.log(evals);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const evalListResponse of client.evals.list()) {
+ console.log(evalListResponse.id);
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalListPage;
+ import com.openai.models.evals.EvalListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalListPage page = client.evals().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.evals.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "object": "eval",
+ "data_source_config": {
+ "type": "stored_completions",
+ "metadata": {
+ "usecase": "push_notifications_summarizer"
+ },
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object"
+ },
+ "sample": {
+ "type": "object"
+ }
+ },
+ "required": [
+ "item",
+ "sample"
+ ]
+ }
+ },
+ "testing_criteria": [
+ {
+ "name": "Push Notification Summary Grader",
+ "id": "Push Notification Summary Grader-9b876f24-4762-4be9-aff4-db7a9b31c673",
+ "type": "label_model",
+ "model": "o3-mini",
+ "input": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "
+ Label the following push notification summary as either correct or incorrect.
+ The push notification and the summary will be provided below.
+ A good push notificiation summary is concise and snappy.
+ If it is good, then label it as correct, if not, then incorrect.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "
+ Push notifications: {{item.input}}
+ Summary: {{sample.output_text}}
+ "
+ }
+ }
+ ],
+ "passing_labels": [
+ "correct"
+ ],
+ "labels": [
+ "correct",
+ "incorrect"
+ ],
+ "sampling_params": null
+ }
+ ],
+ "name": "Push Notification Summary Grader",
+ "created_at": 1739314509,
+ "metadata": {
+ "description": "A stored completions eval for push notification summaries"
+ }
+ }
+ ],
+ "first_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "last_id": "eval_67aa884cf6688190b58f657d4441c8b7",
+ "has_more": true
+ }
+ x-ms-list: true
+ post:
+ operationId: Evals_createEval
+ summary: Create an evaluation
+ description: |-
+ Creates 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).
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/PagedRedTeam'
+ $ref: '#/components/schemas/Eval'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Redteams
- /redTeams/runs/{name}:
- get:
- operationId: RedTeams_get
- summary: Get a redteam
- description: Retrieves the specified redteam and its configuration.
+ - Evals
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateEvalRequest'
+ x-oaiMeta:
+ name: Create eval
+ group: evals
+ path: post
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "Sentiment",
+ "data_source_config": {
+ "type": "stored_completions",
+ "metadata": {
+ "usecase": "chatbot"
+ }
+ },
+ "testing_criteria": [
+ {
+ "type": "label_model",
+ "model": "o3-mini",
+ "input": [
+ {
+ "role": "developer",
+ "content": "Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'"
+ },
+ {
+ "role": "user",
+ "content": "Statement: {{item.input}}"
+ }
+ ],
+ "passing_labels": [
+ "positive"
+ ],
+ "labels": [
+ "positive",
+ "neutral",
+ "negative"
+ ],
+ "name": "Example label grader"
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.create(
+ data_source_config={
+ "item_schema": {
+ "foo": "bar"
+ },
+ "type": "custom",
+ },
+ testing_criteria=[{
+ "input": [{
+ "content": "content",
+ "role": "role",
+ }],
+ "labels": ["string"],
+ "model": "model",
+ "name": "name",
+ "passing_labels": ["string"],
+ "type": "label_model",
+ }],
+ )
+ print(eval.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const evalObj = await openai.evals.create({
+ name: "Sentiment",
+ data_source_config: {
+ type: "stored_completions",
+ metadata: { usecase: "chatbot" }
+ },
+ testing_criteria: [
+ {
+ type: "label_model",
+ model: "o3-mini",
+ input: [
+ { role: "developer", content: "Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'" },
+ { role: "user", content: "Statement: {{item.input}}" }
+ ],
+ passing_labels: ["positive"],
+ labels: ["positive", "neutral", "negative"],
+ name: "Example label grader"
+ }
+ ]
+ });
+ console.log(evalObj);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.create({
+ data_source_config: {
+ item_schema: { foo: 'bar' },
+ type: 'custom',
+ },
+ testing_criteria: [
+ {
+ input: [{ content: 'content', role: 'role' }],
+ labels: ['string'],
+ model: 'model',
+ name: 'name',
+ passing_labels: ['string'],
+ type: 'label_model',
+ },
+ ],
+ });
+
+ console.log(_eval.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.evals.EvalCreateParams;
+ import com.openai.models.evals.EvalCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalCreateParams params = EvalCreateParams.builder()
+ .customDataSourceConfig(EvalCreateParams.DataSourceConfig.Custom.ItemSchema.builder()
+ .putAdditionalProperty("foo", JsonValue.from("bar"))
+ .build())
+ .addTestingCriterion(EvalCreateParams.TestingCriterion.LabelModel.builder()
+ .addInput(EvalCreateParams.TestingCriterion.LabelModel.Input.SimpleInputMessage.builder()
+ .content("content")
+ .role("role")
+ .build())
+ .addLabel("string")
+ .model("model")
+ .name("name")
+ .addPassingLabel("string")
+ .build())
+ .build();
+ EvalCreateResponse eval = client.evals().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.create(
+ data_source_config: {item_schema: {foo: "bar"}, type: :custom},
+ testing_criteria: [
+ {
+ input: [{content: "content", role: "role"}],
+ labels: ["string"],
+ model: "model",
+ name: "name",
+ passing_labels: ["string"],
+ type: :label_model
+ }
+ ]
+ )
+
+ puts(eval_)
+ response: |
+ {
+ "object": "eval",
+ "id": "eval_67b7fa9a81a88190ab4aa417e397ea21",
+ "data_source_config": {
+ "type": "stored_completions",
+ "metadata": {
+ "usecase": "chatbot"
+ },
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object"
+ },
+ "sample": {
+ "type": "object"
+ }
+ },
+ "required": [
+ "item",
+ "sample"
+ ]
+ },
+ "testing_criteria": [
+ {
+ "name": "Example label grader",
+ "type": "label_model",
+ "model": "o3-mini",
+ "input": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Classify the sentiment of the following statement as one of positive, neutral, or negative"
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "Statement: {{item.input}}"
+ }
+ }
+ ],
+ "passing_labels": [
+ "positive"
+ ],
+ "labels": [
+ "positive",
+ "neutral",
+ "negative"
+ ]
+ }
+ ],
+ "name": "Sentiment",
+ "created_at": 1740110490,
+ "metadata": {
+ "description": "An eval for sentiment analysis"
+ }
+ }
+ /openai/v1/evals/{eval_id}:
+ delete:
+ operationId: Evals_deleteEval
+ summary: Delete an evaluation
+ description: Removes the specified evaluation and its associated data.
parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: name
+ - name: eval_id
in: path
required: true
- description: Identifier of the red team run.
- schema:
- type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the evaluation to delete.
schema:
type: string
- enum:
- - RedTeams=V1Preview
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/RedTeam'
+ $ref: '#/components/schemas/DeleteEvalResponse'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Redteams
- /redTeams/runs:run:
- post:
- operationId: RedTeams_create
- summary: Create a redteam run
- description: Submits a new redteam run for execution with the provided configuration.
+ - Evals
+ x-oaiMeta:
+ name: Delete an eval
+ group: evals
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_abc123 \
+ -X DELETE \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.delete(
+ "eval_id",
+ )
+ print(eval.eval_id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const deleted = await openai.evals.delete("eval_abc123");
+ console.log(deleted);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.delete('eval_id');
+
+ console.log(_eval.eval_id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalDeleteParams;
+ import com.openai.models.evals.EvalDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalDeleteResponse eval = client.evals().delete("eval_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.delete("eval_id")
+
+ puts(eval_)
+ response: |
+ {
+ "object": "eval.deleted",
+ "deleted": true,
+ "eval_id": "eval_abc123"
+ }
+ get:
+ operationId: Evals_getEval
+ summary: Get an evaluation
+ description: Retrieves the specified evaluation and its configuration.
parameters:
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - RedTeams=V1Preview
- - name: api-version
- in: query
+ - name: eval_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the evaluation to retrieve.
schema:
type: string
- explode: false
responses:
- '201':
- description: The request has succeeded and a new resource has been created as a result.
+ '200':
+ description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/RedTeam'
+ $ref: '#/components/schemas/Eval'
4XX:
description: Client error
content:
@@ -9045,111 +15685,132 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Redteams
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RedTeam'
- description: Redteam to be run
- /routines:
- get:
- operationId: listRoutines
- summary: List routines
- description: Returns the routines available in the current project.
- parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/ListRoutinesParameters.limit'
- - $ref: '#/components/parameters/ListRoutinesParameters.after'
- - $ref: '#/components/parameters/ListRoutinesParameters.before'
- - $ref: '#/components/parameters/ListRoutinesParameters.order'
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Routine'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}:
- put:
- operationId: createOrUpdateRoutine
- summary: Create or update a routine
- description: Creates a new routine or replaces an existing routine with the supplied definition.
+ - Evals
+ x-oaiMeta:
+ name: Get an eval
+ group: evals
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.retrieve(
+ "eval_id",
+ )
+ print(eval.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const evalObj = await openai.evals.retrieve("eval_67abd54d9b0081909a86353f6fb9317a");
+ console.log(evalObj);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.retrieve('eval_id');
+
+ console.log(_eval.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalRetrieveParams;
+ import com.openai.models.evals.EvalRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalRetrieveResponse eval = client.evals().retrieve("eval_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.retrieve("eval_id")
+
+ puts(eval_)
+ response: |
+ {
+ "object": "eval",
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "data_source_config": {
+ "type": "custom",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "type": "string"
+ },
+ "ground_truth": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "input",
+ "ground_truth"
+ ]
+ }
+ },
+ "required": [
+ "item"
+ ]
+ }
+ },
+ "testing_criteria": [
+ {
+ "name": "String check",
+ "id": "String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2",
+ "type": "string_check",
+ "input": "{{item.input}}",
+ "reference": "{{item.ground_truth}}",
+ "operation": "eq"
+ }
+ ],
+ "name": "External Data Eval",
+ "created_at": 1739314509,
+ "metadata": {},
+ }
+ post:
+ operationId: Evals_updateEval
+ summary: Update an evaluation
+ description: Updates certain properties of an evaluation.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/CreateOrUpdateRoutineParameters.routine_name'
- - name: api-version
- in: query
+ - name: eval_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the evaluation to update.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Routine'
+ $ref: '#/components/schemas/Eval'
4XX:
description: Client error
content:
@@ -9163,128 +15824,177 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
+ - Evals
requestBody:
required: true
content:
application/json:
schema:
- $ref: '#/components/schemas/RoutineCreateOrUpdateRequest'
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
+ $ref: '#/components/schemas/UpdateEvalParametersBody'
+ x-oaiMeta:
+ name: Update an eval
+ group: evals
+ path: update
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"name": "Updated Eval", "metadata": {"description": "Updated description"}}'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.update(
+ eval_id="eval_id",
+ )
+ print(eval.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const updatedEval = await openai.evals.update(
+ "eval_67abd54d9b0081909a86353f6fb9317a",
+ {
+ name: "Updated Eval",
+ metadata: { description: "Updated description" }
+ }
+ );
+ console.log(updatedEval);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.update('eval_id');
+
+ console.log(_eval.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalUpdateParams;
+ import com.openai.models.evals.EvalUpdateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalUpdateResponse eval = client.evals().update("eval_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.update("eval_id")
+
+ puts(eval_)
+ response: |
+ {
+ "object": "eval",
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "data_source_config": {
+ "type": "custom",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "type": "string"
+ },
+ "ground_truth": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "input",
+ "ground_truth"
+ ]
+ }
+ },
+ "required": [
+ "item"
+ ]
+ }
+ },
+ "testing_criteria": [
+ {
+ "name": "String check",
+ "id": "String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2",
+ "type": "string_check",
+ "input": "{{item.input}}",
+ "reference": "{{item.ground_truth}}",
+ "operation": "eq"
+ }
+ ],
+ "name": "Updated Eval",
+ "created_at": 1739314509,
+ "metadata": {"description": "Updated description"},
+ }
+ /openai/v1/evals/{eval_id}/runs:
get:
- operationId: getRoutine
- summary: Get a routine
- description: Retrieves the specified routine and its current configuration.
+ operationId: Evals_listRuns
+ summary: List evaluation runs
+ description: Returns the runs associated with the specified evaluation.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/GetRoutineParameters'
- - name: api-version
- in: query
+ - name: eval_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the evaluation to retrieve runs for.
schema:
type: string
- explode: false
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Routine'
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- delete:
- operationId: deleteRoutine
- summary: Delete a routine
- description: Deletes the specified routine.
- parameters:
- - name: Foundry-Features
- in: header
+ - name: after
+ in: query
required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: Identifier for the last run from the previous pagination request.
schema:
type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/DeleteRoutineParameters'
- - name: api-version
+ explode: false
+ - name: limit
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: Number of runs to retrieve.
schema:
- type: string
+ $ref: '#/components/schemas/integer'
+ default: 20
explode: false
- responses:
- '204':
- description: There is no content to send for this request, but the headers may be useful.
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}/runs:
- get:
- operationId: listRoutineRuns
- summary: List prior runs for a routine
- description: Returns prior runs recorded for the specified routine.
- parameters:
- - name: Foundry-Features
- in: header
+ - name: order
+ in: query
required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
type: string
enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/ListRoutineRunsParameters.routine_name'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.filter'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.limit'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.after'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.before'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.order'
- - name: api-version
+ - asc
+ - desc
+ default: asc
+ explode: false
+ - name: status
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.
schema:
type: string
+ enum:
+ - queued
+ - in_progress
+ - completed
+ - canceled
+ - failed
explode: false
responses:
'200':
@@ -9300,7 +16010,7 @@ paths:
data:
type: array
items:
- $ref: '#/components/schemas/RoutineRun'
+ $ref: '#/components/schemas/EvalRun'
description: The requested list of items.
first_id:
type: string
@@ -9325,39 +16035,25 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}:disable:
+ - Evals
post:
- operationId: disableRoutine
- summary: Disable a routine
- description: Disables the specified routine so it no longer runs.
+ operationId: Evals_createEvalRun
+ summary: Create an evaluation run
+ description: Creates an evaluation run for the specified evaluation.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/DisableRoutineParameters'
- - name: api-version
- in: query
+ - name: eval_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the evaluation to create a run for.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Routine'
+ $ref: '#/components/schemas/EvalRun'
4XX:
description: Client error
content:
@@ -9371,39 +16067,338 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}:dispatch_async:
- post:
- operationId: dispatchRoutineAsync
- summary: Queue an asynchronous routine dispatch
- description: Queues an asynchronous dispatch for the specified routine.
+ - Evals
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateEvalRunRequest'
+ x-oaiMeta:
+ name: Create eval run
+ group: evals
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67e579652b548190aaa83ada4b125f47/runs \
+ -X POST \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"gpt-4o-mini","data_source":{"type":"completions","input_messages":{"type":"template","template":[{"role":"developer","content":"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "} , {"role":"user","content":"{{item.input}}"}]} ,"sampling_params":{"temperature":1,"max_completions_tokens":2048,"top_p":1,"seed":42},"model":"gpt-4o-mini","source":{"type":"file_content","content":[{"item":{"input":"Tech Company Launches Advanced Artificial Intelligence Platform","ground_truth":"Technology"}}]}}'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.evals.runs.create(
+ eval_id="eval_id",
+ data_source={
+ "source": {
+ "content": [{
+ "item": {
+ "foo": "bar"
+ }
+ }],
+ "type": "file_content",
+ },
+ "type": "jsonl",
+ },
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const run = await openai.evals.runs.create(
+ "eval_67e579652b548190aaa83ada4b125f47",
+ {
+ name: "gpt-4o-mini",
+ data_source: {
+ type: "completions",
+ input_messages: {
+ type: "template",
+ template: [
+ {
+ role: "developer",
+ content: "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ },
+ {
+ role: "user",
+ content: "{{item.input}}"
+ }
+ ]
+ },
+ sampling_params: {
+ temperature: 1,
+ max_completions_tokens: 2048,
+ top_p: 1,
+ seed: 42
+ },
+ model: "gpt-4o-mini",
+ source: {
+ type: "file_content",
+ content: [
+ {
+ item: {
+ input: "Tech Company Launches Advanced Artificial Intelligence Platform",
+ ground_truth: "Technology"
+ }
+ }
+ ]
+ }
+ }
+ }
+ );
+ console.log(run);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.evals.runs.create('eval_id', {
+ data_source: {
+ source: { content: [{ item: { foo: 'bar' } }], type: 'file_content' },
+ type: 'jsonl',
+ },
+ });
+
+ console.log(run.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.evals.runs.CreateEvalJsonlRunDataSource;
+ import com.openai.models.evals.runs.RunCreateParams;
+ import com.openai.models.evals.runs.RunCreateResponse;
+ import java.util.List;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .evalId("eval_id")
+ .dataSource(CreateEvalJsonlRunDataSource.builder()
+ .fileContentSource(List.of(CreateEvalJsonlRunDataSource.Source.FileContent.Content.builder()
+ .item(CreateEvalJsonlRunDataSource.Source.FileContent.Content.Item.builder()
+ .putAdditionalProperty("foo", JsonValue.from("bar"))
+ .build())
+ .build()))
+ .build())
+ .build();
+ RunCreateResponse run = client.evals().runs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.evals.runs.create(
+ "eval_id",
+ data_source: {source: {content: [{item: {foo: "bar"}}], type: :file_content}, type: :jsonl}
+ )
+
+ puts(run)
+ response: |
+ {
+ "object": "eval.run",
+ "id": "evalrun_67e57965b480819094274e3a32235e4c",
+ "eval_id": "eval_67e579652b548190aaa83ada4b125f47",
+ "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47&run_id=evalrun_67e57965b480819094274e3a32235e4c",
+ "status": "queued",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+ /openai/v1/evals/{eval_id}/runs/{run_id}:
+ delete:
+ operationId: Evals_deleteEvalRun
+ summary: Delete an evaluation run
+ description: Removes the specified evaluation run.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ - name: eval_id
+ in: path
+ required: true
+ description: The ID of the evaluation to delete the run from.
schema:
type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/DispatchRoutineAsyncParameters.routine_name'
- - name: api-version
- in: query
+ - name: run_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the run to delete.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/DispatchRoutineResponse'
+ $ref: '#/components/schemas/DeleteEvalRunResponse'
4XX:
description: Client error
content:
@@ -9417,45 +16412,109 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DispatchRoutineRequest'
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}:enable:
- post:
- operationId: enableRoutine
- summary: Enable a routine
- description: Enables the specified routine so it can be dispatched.
+ - Evals
+ x-oaiMeta:
+ name: Delete eval run
+ group: evals
+ path: delete
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_123abc/runs/evalrun_abc456 \
+ -X DELETE \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.evals.runs.delete(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ print(run.run_id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const deleted = await openai.evals.runs.delete(
+ "eval_123abc",
+ "evalrun_abc456"
+ );
+ console.log(deleted);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.evals.runs.delete('run_id', { eval_id: 'eval_id' });
+
+ console.log(run.run_id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.RunDeleteParams;
+ import com.openai.models.evals.runs.RunDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunDeleteParams params = RunDeleteParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ RunDeleteResponse run = client.evals().runs().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.evals.runs.delete("run_id", eval_id: "eval_id")
+
+ puts(run)
+ response: |
+ {
+ "object": "eval.run.deleted",
+ "deleted": true,
+ "run_id": "evalrun_abc456"
+ }
+ get:
+ operationId: Evals_getEvalRun
+ summary: Get an evaluation run
+ description: Retrieves the specified evaluation run and its current status.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ - name: eval_id
+ in: path
+ required: true
+ description: The ID of the evaluation to retrieve runs for.
schema:
type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/EnableRoutineParameters'
- - name: api-version
- in: query
+ - name: run_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the run to retrieve.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Routine'
+ $ref: '#/components/schemas/EvalRun'
4XX:
description: Client error
content:
@@ -9469,349 +16528,1229 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /schedules:
- get:
- operationId: Schedules_list
- summary: List schedules
- description: Returns schedules that match the supplied type and enabled filters.
- parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: type
- in: query
- required: false
- description: Filter by the type of schedule.
- schema:
- $ref: '#/components/schemas/ScheduleTaskType'
- explode: false
- - name: enabled
- in: query
- required: false
- description: Filter by the enabled status.
+ - Evals
+ x-oaiMeta:
+ name: Get an eval run
+ group: evals
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.evals.runs.retrieve(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const run = await openai.evals.runs.retrieve(
+ "evalrun_67abd54d60ec8190832b46859da808f7",
+ { eval_id: "eval_67abd54d9b0081909a86353f6fb9317a" }
+ );
+ console.log(run);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.evals.runs.retrieve('run_id', { eval_id: 'eval_id' });
+
+ console.log(run.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.RunRetrieveParams;
+ import com.openai.models.evals.runs.RunRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunRetrieveParams params = RunRetrieveParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ RunRetrieveResponse run = client.evals().runs().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.evals.runs.retrieve("run_id", eval_id: "eval_id")
+
+ puts(run)
+ response: |
+ {
+ "object": "eval.run",
+ "id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "report_url": "https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7",
+ "status": "queued",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Summit Addresses Climate Change Strategies",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Major Retailer Reports Record-Breaking Holiday Sales",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "National Team Qualifies for World Championship Finals",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Manufacturer Announces Merger with Competitor",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Breakthrough in Renewable Energy Technology Unveiled",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "World Leaders Sign Historic Climate Agreement",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Professional Athlete Sets New Record in Championship Event",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Financial Institutions Adapt to New Regulatory Requirements",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Tech Conference Showcases Advances in Artificial Intelligence",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Markets Respond to Oil Price Fluctuations",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Cooperation Strengthened Through New Treaty",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Sports League Announces Revised Schedule for Upcoming Season",
+ "ground_truth": "Sports"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+ post:
+ operationId: Evals_cancelEvalRun
+ summary: Cancel an evaluation run
+ description: Cancels an ongoing evaluation run.
+ parameters:
+ - name: eval_id
+ in: path
+ required: true
+ description: The ID of the evaluation whose run you want to cancel.
schema:
- type: boolean
- explode: false
- - name: Foundry-Features
- in: header
+ type: string
+ - name: run_id
+ in: path
required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the run to cancel.
schema:
type: string
- enum:
- - Schedules=V1Preview
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/PagedSchedule'
+ $ref: '#/components/schemas/EvalRun'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- /schedules/{id}:
- delete:
- operationId: Schedules_delete
- summary: Delete a schedule
- description: Deletes the specified schedule resource.
+ - Evals
+ x-oaiMeta:
+ name: Cancel eval run
+ group: evals
+ path: post
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/cancel \
+ -X POST \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.evals.runs.cancel(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ print(response.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const canceledRun = await openai.evals.runs.cancel(
+ "evalrun_67abd54d60ec8190832b46859da808f7",
+ { eval_id: "eval_67abd54d9b0081909a86353f6fb9317a" }
+ );
+ console.log(canceledRun);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.evals.runs.cancel('run_id', { eval_id: 'eval_id' });
+
+ console.log(response.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.RunCancelParams;
+ import com.openai.models.evals.runs.RunCancelResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCancelParams params = RunCancelParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ RunCancelResponse response = client.evals().runs().cancel(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.evals.runs.cancel("run_id", eval_id: "eval_id")
+
+ puts(response)
+ response: |
+ {
+ "object": "eval.run",
+ "id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "report_url": "https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7",
+ "status": "canceled",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Summit Addresses Climate Change Strategies",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Major Retailer Reports Record-Breaking Holiday Sales",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "National Team Qualifies for World Championship Finals",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Manufacturer Announces Merger with Competitor",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Breakthrough in Renewable Energy Technology Unveiled",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "World Leaders Sign Historic Climate Agreement",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Professional Athlete Sets New Record in Championship Event",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Financial Institutions Adapt to New Regulatory Requirements",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Tech Conference Showcases Advances in Artificial Intelligence",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Markets Respond to Oil Price Fluctuations",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Cooperation Strengthened Through New Treaty",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Sports League Announces Revised Schedule for Upcoming Season",
+ "ground_truth": "Sports"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+ /openai/v1/evals/{eval_id}/runs/{run_id}/output_items:
+ get:
+ operationId: Evals_getEvalRunOutputItems
+ summary: List evaluation run output items
+ description: Returns the output items produced by the specified evaluation run.
parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: id
+ - name: eval_id
in: path
required: true
- description: Identifier of the schedule.
+ description: The eval id path parameter.
schema:
type: string
- - name: Foundry-Features
- in: header
+ - name: run_id
+ in: path
required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the run to retrieve output items for.
schema:
type: string
- enum:
- - Schedules=V1Preview
- responses:
- '204':
- description: There is no content to send for this request, but the headers may be useful.
- 4XX:
- description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
- 5XX:
- description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
- tags:
- - Schedules
- get:
- operationId: Schedules_get
- summary: Get a schedule
- description: Retrieves the specified schedule resource.
- parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: id
- in: path
- required: true
- description: Identifier of the schedule.
+ - name: after
+ in: query
+ required: false
+ description: Identifier for the last run from the previous pagination request.
schema:
type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ explode: false
+ - name: limit
+ in: query
+ required: false
+ description: Number of runs to retrieve.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
type: string
enum:
- - Schedules=V1Preview
+ - asc
+ - desc
+ default: asc
+ explode: false
+ - name: status
+ in: query
+ required: false
+ description: |-
+ Filter output items by status. Use `failed` to filter by failed output
+ items or `pass` to filter by passed output items.
+ schema:
+ type: string
+ enum:
+ - fail
+ - pass
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Schedule'
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunOutputItem'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- put:
- operationId: Schedules_createOrUpdate
- summary: Create or update a schedule
- description: Creates a new schedule or updates an existing schedule with the supplied definition.
+ - Evals
+ x-oaiMeta:
+ name: Get eval run output items
+ group: evals
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/egroup_67abd54d9b0081909a86353f6fb9317a/runs/erun_67abd54d60ec8190832b46859da808f7/output_items \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.evals.runs.output_items.list(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const outputItems = await openai.evals.runs.outputItems.list(
+ "egroup_67abd54d9b0081909a86353f6fb9317a",
+ "erun_67abd54d60ec8190832b46859da808f7"
+ );
+ console.log(outputItems);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const outputItemListResponse of client.evals.runs.outputItems.list('run_id', {
+ eval_id: 'eval_id',
+ })) {
+ console.log(outputItemListResponse.id);
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.outputitems.OutputItemListPage;
+ import com.openai.models.evals.runs.outputitems.OutputItemListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ OutputItemListParams params = OutputItemListParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ OutputItemListPage page = client.evals().runs().outputItems().list(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.evals.runs.output_items.list("run_id", eval_id: "eval_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "eval.run.output_item",
+ "id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "created_at": 1743092076,
+ "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "status": "pass",
+ "datasource_item_id": 5,
+ "datasource_item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ },
+ "results": [
+ {
+ "name": "String check-a2486074-d803-4445-b431-ad2262e85d47",
+ "sample": null,
+ "passed": true,
+ "score": 1.0
+ }
+ ],
+ "sample": {
+ "input": [
+ {
+ "role": "developer",
+ "content": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ ",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ },
+ {
+ "role": "user",
+ "content": "Stock Markets Rally After Positive Economic Data Released",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "output": [
+ {
+ "role": "assistant",
+ "content": "Markets",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "finish_reason": "stop",
+ "model": "gpt-4o-mini-2024-07-18",
+ "usage": {
+ "total_tokens": 325,
+ "completion_tokens": 2,
+ "prompt_tokens": 323,
+ "cached_tokens": 0
+ },
+ "error": null,
+ "temperature": 1.0,
+ "max_completion_tokens": 2048,
+ "top_p": 1.0,
+ "seed": 42
+ }
+ }
+ ],
+ "first_id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "last_id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "has_more": true
+ }
+ x-ms-list: true
+ /openai/v1/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}:
+ get:
+ operationId: Evals_getEvalRunOutputItem
+ summary: Get an output item of an evaluation run
+ description: Retrieves a single output item from the specified evaluation run.
parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: id
+ - name: eval_id
in: path
required: true
- description: Identifier of the schedule.
+ description: The ID of the evaluation to retrieve runs for.
schema:
type: string
- - name: Foundry-Features
- in: header
+ - name: run_id
+ in: path
required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the run to retrieve.
+ schema:
+ type: string
+ - name: output_item_id
+ in: path
+ required: true
+ description: The ID of the output item to retrieve.
schema:
type: string
- enum:
- - Schedules=V1Preview
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Schedule'
- '201':
- description: The request has succeeded and a new resource has been created as a result.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Schedule'
+ $ref: '#/components/schemas/EvalRunOutputItem'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Schedule'
- description: The resource instance.
- /schedules/{id}/runs:
+ - Evals
+ x-oaiMeta:
+ name: Get an output item of an eval run
+ group: evals
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/output_items/outputitem_67abd55eb6548190bb580745d5644a33 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ output_item = client.evals.runs.output_items.retrieve(
+ output_item_id="output_item_id",
+ eval_id="eval_id",
+ run_id="run_id",
+ )
+ print(output_item.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const outputItem = await openai.evals.runs.outputItems.retrieve(
+ "outputitem_67abd55eb6548190bb580745d5644a33",
+ {
+ eval_id: "eval_67abd54d9b0081909a86353f6fb9317a",
+ run_id: "evalrun_67abd54d60ec8190832b46859da808f7",
+ }
+ );
+ console.log(outputItem);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const outputItem = await client.evals.runs.outputItems.retrieve('output_item_id', {
+ eval_id: 'eval_id',
+ run_id: 'run_id',
+ });
+
+ console.log(outputItem.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.outputitems.OutputItemRetrieveParams;
+ import com.openai.models.evals.runs.outputitems.OutputItemRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ OutputItemRetrieveParams params = OutputItemRetrieveParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .outputItemId("output_item_id")
+ .build();
+ OutputItemRetrieveResponse outputItem = client.evals().runs().outputItems().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ output_item = openai.evals.runs.output_items.retrieve("output_item_id", eval_id: "eval_id", run_id: "run_id")
+
+ puts(output_item)
+ response: |
+ {
+ "object": "eval.run.output_item",
+ "id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "created_at": 1743092076,
+ "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "status": "pass",
+ "datasource_item_id": 5,
+ "datasource_item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ },
+ "results": [
+ {
+ "name": "String check-a2486074-d803-4445-b431-ad2262e85d47",
+ "sample": null,
+ "passed": true,
+ "score": 1.0
+ }
+ ],
+ "sample": {
+ "input": [
+ {
+ "role": "developer",
+ "content": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ ",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ },
+ {
+ "role": "user",
+ "content": "Stock Markets Rally After Positive Economic Data Released",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "output": [
+ {
+ "role": "assistant",
+ "content": "Markets",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "finish_reason": "stop",
+ "model": "gpt-4o-mini-2024-07-18",
+ "usage": {
+ "total_tokens": 325,
+ "completion_tokens": 2,
+ "prompt_tokens": 323,
+ "cached_tokens": 0
+ },
+ "error": null,
+ "temperature": 1.0,
+ "max_completion_tokens": 2048,
+ "top_p": 1.0,
+ "seed": 42
+ }
+ }
+ /openai/v1/files:
get:
- operationId: Schedules_listRuns
- summary: List schedule runs
- description: Returns schedule runs that match the supplied filters.
+ operationId: Files_listFiles
+ summary: List files
+ description: Lists files matching the request filters.
parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: id
- in: path
- required: true
- description: Identifier of the schedule.
+ - name: purpose
+ in: query
+ required: false
+ description: Only return files with the given purpose.
schema:
type: string
- - name: type
+ - name: limit
in: query
required: false
- description: Filter by the type of schedule.
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.
schema:
- $ref: '#/components/schemas/ScheduleTaskType'
- explode: false
- - name: enabled
+ $ref: '#/components/schemas/integer'
+ default: 10000
+ - name: order
in: query
required: false
- description: Filter by the enabled status.
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
schema:
- type: boolean
- explode: false
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
schema:
type: string
- enum:
- - Schedules=V1Preview
+ x-ms-list-continuation-token: true
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/PagedScheduleRun'
+ $ref: '#/components/schemas/OpenAI.ListFilesResponse'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- /schedules/{schedule_id}/runs/{run_id}:
- get:
- operationId: Schedules_getRun
- summary: Get a schedule run
- description: Retrieves the specified run for a schedule.
- parameters:
- - name: schedule_id
- in: path
- required: true
- description: The unique identifier of the schedule.
- schema:
- type: string
- - name: run_id
- in: path
- required: true
- description: The unique identifier of the schedule run.
- schema:
- type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Schedules=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Files
+ x-oaiMeta:
+ name: List files
+ group: files
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.files.list()
+ page = page.data[0]
+ print(page)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.files.list();
+
+ for await (const file of list) {
+ console.log(file);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fileObject of client.files.list()) {
+ console.log(fileObject);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Files.List(context.TODO(), openai.FileListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileListPage;
+ import com.openai.models.files.FileListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileListPage page = client.files().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.files.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 175,
+ "created_at": 1613677385,
+ "expires_at": 1677614202,
+ "filename": "salesOverview.pdf",
+ "purpose": "assistants",
+ },
+ {
+ "id": "file-abc456",
+ "object": "file",
+ "bytes": 140,
+ "created_at": 1613779121,
+ "expires_at": 1677614202,
+ "filename": "puppy.jsonl",
+ "purpose": "fine-tune",
+ }
+ ],
+ "first_id": "file-abc123",
+ "last_id": "file-abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: Files_createFile
+ summary: Create a file
+ description: Creates a file from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ScheduleRun'
+ $ref: '#/components/schemas/OpenAI.OpenAIFile'
4XX:
description: Client error
content:
@@ -9825,94 +17764,166 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- /skills:
- get:
- operationId: Skills_listSkills
- summary: List skills
- description: Returns the skills available in the current project.
+ - Files
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateFileRequest'
+ encoding:
+ purpose:
+ contentType: application/json
+ expires_after:
+ contentType: application/json
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Upload file
+ group: files
+ description: |
+ Uploads a file for later use across OpenAI APIs. Uploads to this endpoint are rate-limited to 1,000 requests per minute per authenticated user. For Retrieval or `file_search` ingestion, upload files here first. If you need to attach multiple uploaded files to the same vector store, use vector store file batches instead of attaching them one by one.
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F purpose="fine-tune" \
+ -F file="@mydata.jsonl"
+ -F expires_after[anchor]="created_at"
+ -F expires_after[seconds]=2592000
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file_object = client.files.create(
+ file=b"Example data",
+ purpose="assistants",
+ )
+ print(file_object.id)
+ javascript: |-
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.create({
+ file: fs.createReadStream("mydata.jsonl"),
+ purpose: "fine-tune",
+ expires_after: {
+ anchor: "created_at",
+ seconds: 2592000
+ }
+ });
+
+ console.log(file);
+ }
+
+ main();
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fileObject = await client.files.create({
+ file: fs.createReadStream('fine-tune.jsonl'),
+ purpose: 'assistants',
+ });
+
+ console.log(fileObject.id);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fileObject, err := client.Files.New(context.TODO(), openai.FileNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Purpose: openai.FilePurposeAssistants,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fileObject.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileCreateParams;
+ import com.openai.models.files.FileObject;
+ import com.openai.models.files.FilePurpose;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateParams params = FileCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .purpose(FilePurpose.ASSISTANTS)
+ .build();
+ FileObject fileObject = client.files().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file_object = openai.files.create(file: StringIO.new("Example data"), purpose: :assistants)
+
+ puts(file_object)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 120000,
+ "created_at": 1677610602,
+ "expires_at": 1677614202,
+ "filename": "mydata.jsonl",
+ "purpose": "fine-tune",
+ }
+ /openai/v1/files/{file_id}:
+ delete:
+ operationId: Files_deleteFile
+ summary: Delete a file
+ description: Deletes a file by its identifier.
parameters:
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- - name: after
- in: query
- required: false
- description: |-
- 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.
- schema:
- type: string
- explode: false
- - name: before
- in: query
- required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
+ - name: file_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the file to use for this request.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Skill'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.DeleteFileResponse'
4XX:
description: Client error
content:
@@ -9926,44 +17937,120 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}:
+ - Files
+ x-oaiMeta:
+ name: Delete file
+ group: files
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files/file-abc123 \
+ -X DELETE \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file_deleted = client.files.delete(
+ "file_id",
+ )
+ print(file_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.delete("file-abc123");
+
+ console.log(file);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fileDeleted = await client.files.delete('file_id');
+
+ console.log(fileDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fileDeleted, err := client.Files.Delete(context.TODO(), "file_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fileDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileDeleteParams;
+ import com.openai.models.files.FileDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileDeleted fileDeleted = client.files().delete("file_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file_deleted = openai.files.delete("file_id")
+
+ puts(file_deleted)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "deleted": true
+ }
get:
- operationId: Skills_getSkill
- summary: Retrieve a skill
- description: Retrieves the specified skill and its current configuration.
+ operationId: Files_retrieveFile
+ summary: Get a file
+ description: Retrieves a file by its identifier.
parameters:
- - name: name
+ - name: file_id
in: path
required: true
- description: The unique name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the file to use for this request.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Skill'
+ $ref: '#/components/schemas/OpenAI.OpenAIFile'
4XX:
description: Client error
content:
@@ -9977,43 +18064,124 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- post:
- operationId: updateSkill
- summary: Update a skill
- description: Modifies the specified skill's configuration.
+ - Files
+ x-oaiMeta:
+ name: Retrieve file
+ group: files
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files/file-abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file_object = client.files.retrieve(
+ "file_id",
+ )
+ print(file_object.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.retrieve("file-abc123");
+
+ console.log(file);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fileObject = await client.files.retrieve('file_id');
+
+ console.log(fileObject.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fileObject, err := client.Files.Get(context.TODO(), "file_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fileObject.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileObject;
+ import com.openai.models.files.FileRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileObject fileObject = client.files().retrieve("file_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file_object = openai.files.retrieve("file_id")
+
+ puts(file_object)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 120000,
+ "created_at": 1677610602,
+ "expires_at": 1677614202,
+ "filename": "mydata.jsonl",
+ "purpose": "fine-tune",
+ }
+ /openai/v1/files/{file_id}/content:
+ get:
+ operationId: Files_downloadFile
+ summary: Download a file
+ description: Downloads a file.
parameters:
- - name: name
+ - name: file_id
in: path
required: true
- description: The name of the skill to update.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the file to use for this request.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
- application/json:
+ text/plain:
schema:
- $ref: '#/components/schemas/Skill'
+ type: string
4XX:
description: Client error
content:
@@ -10027,55 +18195,114 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- default_version:
- type: string
- description: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest.
- required:
- - default_version
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- delete:
- operationId: Skills_deleteSkill
- summary: Delete a skill
- description: Removes the specified skill and its associated versions.
- parameters:
- - name: name
- in: path
- required: true
- description: The unique name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Files
+ x-oaiMeta:
+ name: Retrieve file content
+ group: files
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files/file-abc123/content \
+ -H "Authorization: Bearer $OPENAI_API_KEY" > file.jsonl
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.files.content(
+ "file_id",
+ )
+ print(response)
+ content = response.read()
+ print(content)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.content("file-abc123");
+
+ console.log(file);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.files.content('file_id');
+
+ console.log(response);
+
+ const content = await response.blob();
+ console.log(content);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Files.Content(context.TODO(), "file_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.files.FileContentParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ HttpResponse response = client.files().content("file_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.files.content("file_id")
+
+ puts(response)
+ response: ''
+ /openai/v1/fine_tuning/alpha/graders/run:
+ post:
+ operationId: Graders_runGrader
+ summary: Run a grader
+ description: Runs a grader.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteSkillResponse'
+ $ref: '#/components/schemas/OpenAI.RunGraderResponse'
4XX:
description: Client error
content:
@@ -10089,44 +18316,543 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}/content:
- get:
- operationId: getSkillContent
- summary: Download the zip content for the default version of a skill
- description: Downloads the zip content for the default version of a skill.
- parameters:
- - name: name
- in: path
- required: true
- description: The name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Fine-tuning
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunGraderRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Run grader
+ beta: true
+ group: graders
+ examples:
+ - title: Score text alignment
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "grader": {
+ "type": "score_model",
+ "name": "Example score model grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.
+
+ Reference answer: {{item.reference_answer}}
+
+ Model answer: {{sample.output_text}}"
+ }
+ ]
+ }
+ ],
+ "model": "gpt-5-mini",
+ "sampling_params": {
+ "temperature": 1,
+ "top_p": 1,
+ "seed": 42
+ }
+ },
+ "item": {
+ "reference_answer": "fuzzy wuzzy was a bear"
+ },
+ "model_sample": "fuzzy wuzzy was a bear"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.run(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ model_sample="model_sample",
+ )
+ print(response.metadata)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const result = await openai.fineTuning.alpha.graders.run({
+ grader: {
+ type: "score_model",
+ name: "Example score model grader",
+ input: [
+ {
+ role: "user",
+ content: [
+ {
+ type: "input_text",
+ text: "Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.
+
+ Reference answer: {{item.reference_answer}}
+
+ Model answer: {{sample.output_text}}",
+ },
+ ],
+ },
+ ],
+ model: "gpt-5-mini",
+ sampling_params: { temperature: 1, top_p: 1, seed: 42 },
+ },
+ item: { reference_answer: "fuzzy wuzzy was a bear" },
+ model_sample: "fuzzy wuzzy was a bear",
+ });
+ console.log(result);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.run({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ model_sample: 'model_sample',
+ });
+
+ console.log(response.metadata);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{
+ Grader: openai.FineTuningAlphaGraderRunParamsGraderUnion{
+ OfStringCheck: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ ModelSample: "model_sample",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Metadata)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderRunParams;
+ import com.openai.models.finetuning.alpha.graders.GraderRunResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderRunParams params = GraderRunParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .modelSample("model_sample")
+ .build();
+ GraderRunResponse response = client.fineTuning().alpha().graders().run(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.run(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check},
+ model_sample: "model_sample"
+ )
+
+ puts(response)
+ response: |
+ {
+ "reward": 1.0,
+ "metadata": {
+ "name": "Example score model grader",
+ "type": "score_model",
+ "errors": {
+ "formula_parse_error": false,
+ "sample_parse_error": false,
+ "truncated_observation_error": false,
+ "unresponsive_reward_error": false,
+ "invalid_variable_error": false,
+ "other_error": false,
+ "python_grader_server_error": false,
+ "python_grader_server_error_type": null,
+ "python_grader_runtime_error": false,
+ "python_grader_runtime_error_details": null,
+ "model_grader_server_error": false,
+ "model_grader_refusal_error": false,
+ "model_grader_parse_error": false,
+ "model_grader_server_error_details": null
+ },
+ "execution_time": 4.365238428115845,
+ "scores": {},
+ "token_usage": {
+ "prompt_tokens": 190,
+ "total_tokens": 324,
+ "completion_tokens": 134,
+ "cached_tokens": 0
+ },
+ "sampled_model_name": "gpt-4o-2024-08-06"
+ },
+ "sub_rewards": {},
+ "model_grader_token_usage_per_model": {
+ "gpt-4o-2024-08-06": {
+ "prompt_tokens": 190,
+ "total_tokens": 324,
+ "completion_tokens": 134,
+ "cached_tokens": 0
+ }
+ }
+ }
+ - title: Score an image caption
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "grader": {
+ "type": "score_model",
+ "name": "Image caption grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Score how well the provided caption matches the image on a 0-1 scale. Only return the score.
+
+ Caption: {{sample.output_text}}"
+ },
+ {
+ "type": "input_image",
+ "image_url": "https://example.com/dog-catching-ball.png",
+ "file_id": null,
+ "detail": "high"
+ }
+ ]
+ }
+ ],
+ "model": "gpt-5-mini",
+ "sampling_params": {
+ "temperature": 0.2
+ }
+ },
+ "item": {
+ "expected_caption": "A golden retriever jumps to catch a tennis ball"
+ },
+ "model_sample": "A dog leaps to grab a tennis ball mid-air"
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.run({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ model_sample: 'model_sample',
+ });
+
+ console.log(response.metadata);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.run(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ model_sample="model_sample",
+ )
+ print(response.metadata)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{
+ Grader: openai.FineTuningAlphaGraderRunParamsGraderUnion{
+ OfStringCheck: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ ModelSample: "model_sample",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Metadata)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderRunParams;
+ import com.openai.models.finetuning.alpha.graders.GraderRunResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderRunParams params = GraderRunParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .modelSample("model_sample")
+ .build();
+ GraderRunResponse response = client.fineTuning().alpha().graders().run(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.run(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check},
+ model_sample: "model_sample"
+ )
+
+ puts(response)
+ - title: Score an audio response
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "grader": {
+ "type": "score_model",
+ "name": "Audio clarity grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Listen to the clip and return a confidence score from 0 to 1 that the speaker said: {{item.target_phrase}}"
+ },
+ {
+ "type": "input_audio",
+ "input_audio": {
+ "data": "{{item.audio_clip_b64}}",
+ "format": "mp3"
+ }
+ }
+ ]
+ }
+ ],
+ "model": "gpt-audio",
+ "sampling_params": {
+ "temperature": 0.2,
+ "top_p": 1,
+ "seed": 123
+ }
+ },
+ "item": {
+ "target_phrase": "Please deliver the package on Tuesday",
+ "audio_clip_b64": ""
+ },
+ "model_sample": "Please deliver the package on Tuesday"
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.run({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ model_sample: 'model_sample',
+ });
+
+ console.log(response.metadata);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.run(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ model_sample="model_sample",
+ )
+ print(response.metadata)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{
+ Grader: openai.FineTuningAlphaGraderRunParamsGraderUnion{
+ OfStringCheck: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ ModelSample: "model_sample",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Metadata)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderRunParams;
+ import com.openai.models.finetuning.alpha.graders.GraderRunResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderRunParams params = GraderRunParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .modelSample("model_sample")
+ .build();
+ GraderRunResponse response = client.fineTuning().alpha().graders().run(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.run(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check},
+ model_sample: "model_sample"
+ )
+
+ puts(response)
+ /openai/v1/fine_tuning/alpha/graders/validate:
+ post:
+ operationId: Graders_validateGrader
+ summary: Validate a grader
+ description: Validates a grader.
+ parameters: []
responses:
'200':
- description: The response body for downloading a skill package.
+ description: The request has succeeded.
content:
- application/zip:
+ application/json:
schema:
- contentMediaType: application/zip
+ $ref: '#/components/schemas/OpenAI.ValidateGraderResponse'
4XX:
description: Client error
content:
@@ -10140,176 +18866,194 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}/versions:
- post:
- operationId: createSkillVersion_createSkillVersionFromFiles
- parameters:
- - name: name
- in: path
- required: true
- description: The name of the skill. If the skill does not exist, it will be created.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
- description: Creates a new version of a skill. If the skill does not exist, it will be created. Creates a new version of a skill from uploaded files via multipart form data.
- summary: Create a new version of a skill Create a skill version from uploaded files
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SkillVersion'
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- x-ms-description-override: Creates a new version of a skill. If the skill does not exist, it will be created.
- x-ms-summary-override: Create a new version of a skill
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- tags:
- - Skills
+ - Fine-tuning
requestBody:
required: true
content:
application/json:
schema:
- type: object
- properties:
- inline_content:
- $ref: '#/components/schemas/SkillInlineContent'
- description: Inline skill content for simple skills without file uploads. Foundry-specific extension.
- default:
- type: boolean
- description: Whether to set this version as the default.
- multipart/form-data:
- schema:
- $ref: '#/components/schemas/CreateSkillVersionFromFilesBody'
- encoding:
- files:
- contentType: '*/*'
- default:
- contentType: text/plain
+ $ref: '#/components/schemas/OpenAI.ValidateGraderRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Validate grader
+ beta: true
+ group: graders
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/alpha/graders/validate \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ }
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.validate({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ });
+
+ console.log(response.grader);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.validate(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ )
+ print(response.grader)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Validate(context.TODO(), openai.FineTuningAlphaGraderValidateParams{
+ Grader: openai.FineTuningAlphaGraderValidateParamsGraderUnion{
+ OfStringCheckGrader: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Grader)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderValidateParams;
+ import com.openai.models.finetuning.alpha.graders.GraderValidateResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderValidateParams params = GraderValidateParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .build();
+ GraderValidateResponse response = client.fineTuning().alpha().graders().validate(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.validate(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check}
+ )
+
+ puts(response)
+ response: |
+ {
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ }
+ }
+ /openai/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions:
get:
- operationId: listSkillVersions
- summary: List skill versions
- description: Returns the available versions for the specified skill.
+ operationId: FineTuning_listFineTuningCheckpointPermissions
+ summary: List fine tuning checkpoint permissions
+ description: Lists fine tuning checkpoint permissions matching the request filters.
parameters:
- - name: name
+ - name: fine_tuned_model_checkpoint
in: path
required: true
- description: The name of the skill to list versions for.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
+ description: The ID of the fine-tuned model checkpoint to get permissions for.
schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
+ type: string
+ - name: project_id
in: query
required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
+ description: The ID of the project to get permissions for.
schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
+ type: string
- name: after
in: query
required: false
- description: |-
- 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.
+ description: Identifier for the last permission ID from the previous pagination request.
schema:
type: string
- explode: false
- - name: before
+ x-ms-list-continuation-token: true
+ - name: limit
in: query
required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: Number of permissions to retrieve.
schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
+ $ref: '#/components/schemas/integer'
+ default: 10
+ - name: order
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: The order in which to retrieve permissions.
schema:
type: string
- explode: false
+ enum:
+ - ascending
+ - descending
+ default: descending
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/SkillVersion'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse'
4XX:
description: Client error
content:
@@ -10323,50 +19067,129 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}/versions/{version}:
- get:
- operationId: getSkillVersion
- summary: Retrieve a specific version of a skill
- description: Retrieves the specified version of a skill by name and version identifier.
+ - Fine-tuning
+ x-oaiMeta:
+ name: List checkpoint permissions
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const permission = await client.fineTuning.checkpoints.permissions.retrieve(
+ 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
+ );
+
+ console.log(permission.first_id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ permission = client.fine_tuning.checkpoints.permissions.retrieve(
+ fine_tuned_model_checkpoint="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(permission.first_id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ permission, err := client.FineTuning.Checkpoints.Permissions.Get(
+ context.TODO(),
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ openai.FineTuningCheckpointPermissionGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", permission.FirstID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveParams;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PermissionRetrieveResponse permission = client.fineTuning().checkpoints().permissions().retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ permission = openai.fine_tuning.checkpoints.permissions.retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(permission)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1721764867,
+ "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"
+ },
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_enQCFmOTGj3syEpYVhBRLTSy",
+ "created_at": 1721764800,
+ "project_id": "proj_iqGMw1llN8IrBb6SvvY5A1oF"
+ },
+ ],
+ "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "last_id": "cp_enQCFmOTGj3syEpYVhBRLTSy",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: FineTuning_createFineTuningCheckpointPermission
+ summary: Create a fine tuning checkpoint permission
+ description: Creates a fine tuning checkpoint permission from the supplied request.
parameters:
- - name: name
- in: path
- required: true
- description: The name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: version
+ - name: fine_tuned_model_checkpoint
in: path
required: true
- description: The version identifier to retrieve.
- schema:
- type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuned model checkpoint to create a permission for.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/SkillVersion'
+ $ref: '#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse'
4XX:
description: Client error
content:
@@ -10380,49 +19203,150 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
+ - Fine-tuning
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create checkpoint permissions
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ -d '{"project_ids": ["proj_abGMw1llN8IrBb6SvvY5A1iH"]}'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const permissionCreateResponse of client.fineTuning.checkpoints.permissions.create(
+ 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd',
+ { project_ids: ['string'] },
+ )) {
+ console.log(permissionCreateResponse.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.checkpoints.permissions.create(
+ fine_tuned_model_checkpoint="ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ project_ids=["string"],
+ )
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Checkpoints.Permissions.New(
+ context.TODO(),
+ "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ openai.FineTuningCheckpointPermissionNewParams{
+ ProjectIDs: []string{"string"},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionCreatePage;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PermissionCreateParams params = PermissionCreateParams.builder()
+ .fineTunedModelCheckpoint("ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd")
+ .addProjectId("string")
+ .build();
+ PermissionCreatePage page = client.fineTuning().checkpoints().permissions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.checkpoints.permissions.create(
+ "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ project_ids: ["string"]
+ )
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1721764867,
+ "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"
+ }
+ ],
+ "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "last_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "has_more": false
+ }
+ /openai/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}:
delete:
- operationId: deleteSkillVersion
- summary: Delete a specific version of a skill
- description: Removes the specified version of a skill.
+ operationId: FineTuning_deleteFineTuningCheckpointPermission
+ summary: Delete a fine tuning checkpoint permission
+ description: Deletes a fine tuning checkpoint permission by its identifier.
parameters:
- - name: name
+ - name: fine_tuned_model_checkpoint
in: path
required: true
- description: The name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: version
- in: path
- required: true
- description: The version identifier to delete.
- schema:
- type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the fine-tuned model checkpoint to delete a permission for.
schema:
type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
+ - name: permission_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuned model checkpoint permission to delete.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteSkillVersionResponse'
+ $ref: '#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse'
4XX:
description: Client error
content:
@@ -10436,186 +19360,141 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}/versions/{version}/content:
+ - Fine-tuning
+ x-oaiMeta:
+ name: Delete checkpoint permission
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions/cp_zc4Q7MP6XxulcVzj4MZdwsAB \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const permission = await client.fineTuning.checkpoints.permissions.delete(
+ 'cp_zc4Q7MP6XxulcVzj4MZdwsAB',
+ { fine_tuned_model_checkpoint: 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd' },
+ );
+
+ console.log(permission.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ permission = client.fine_tuning.checkpoints.permissions.delete(
+ permission_id="cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ fine_tuned_model_checkpoint="ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ )
+ print(permission.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ permission, err := client.FineTuning.Checkpoints.Permissions.Delete(
+ context.TODO(),
+ "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", permission.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteParams;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PermissionDeleteParams params = PermissionDeleteParams.builder()
+ .fineTunedModelCheckpoint("ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd")
+ .permissionId("cp_zc4Q7MP6XxulcVzj4MZdwsAB")
+ .build();
+ PermissionDeleteResponse permission = client.fineTuning().checkpoints().permissions().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ permission = openai.fine_tuning.checkpoints.permissions.delete(
+ "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ fine_tuned_model_checkpoint: "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd"
+ )
+
+ puts(permission)
+ response: |
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "deleted": true
+ }
+ /openai/v1/fine_tuning/jobs:
get:
- operationId: getSkillVersionContent
- summary: Download the zip content for a specific version of a skill
- description: Downloads the zip content for a specific version of a skill.
+ operationId: FineTuning_listPaginatedFineTuningJobs
+ summary: List paginated fine tuning jobs
+ description: Lists paginated fine tuning jobs matching the request filters.
parameters:
- - name: name
- in: path
- required: true
- description: The name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: version
- in: path
- required: true
- description: The version to download content for.
- schema:
- type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
+ - name: after
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: Identifier for the last job from the previous pagination request.
schema:
type: string
- explode: false
- responses:
- '200':
- description: The response body for downloading a skill package.
- content:
- application/zip:
- schema:
- contentMediaType: application/zip
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /toolboxes:
- get:
- operationId: listToolboxes
- summary: List toolboxes
- description: Returns the toolboxes available in the current project.
- parameters:
+ x-ms-list-continuation-token: true
- name: limit
in: query
required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
+ description: Number of fine-tuning jobs to retrieve.
schema:
- type: integer
- format: int32
+ $ref: '#/components/schemas/integer'
default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- - name: after
- in: query
- required: false
- description: |-
- 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.
- schema:
- type: string
- explode: false
- - name: before
+ - name: metadata
in: query
required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/ToolboxObject'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Toolboxes
- /toolboxes/{name}:
- get:
- operationId: getToolbox
- summary: Retrieve a toolbox
- description: Retrieves the specified toolbox and its current configuration.
- parameters:
- - name: name
- in: path
- required: true
- description: The name of the toolbox to retrieve.
+ description: Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to indicate no metadata.
schema:
- type: string
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ type: string
+ - type: 'null'
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ToolboxObject'
+ $ref: '#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse'
4XX:
description: Client error
content:
@@ -10629,27 +19508,133 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- patch:
- operationId: updateToolbox
- summary: Update a toolbox to point to a specific version
- description: Updates the toolbox's default version pointer to the specified version.
- parameters:
- - $ref: '#/components/parameters/UpdateToolboxRequest.name'
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Fine-tuning
+ x-oaiMeta:
+ name: List fine-tuning jobs
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs?limit=2&metadata[key]=value \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.jobs.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.fineTuning.jobs.list();
+
+ for await (const fineTune of list) {
+ console.log(fineTune);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fineTuningJob of client.fineTuning.jobs.list()) {
+ console.log(fineTuningJob.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Jobs.List(context.TODO(), openai.FineTuningJobListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.JobListPage;
+ import com.openai.models.finetuning.jobs.JobListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobListPage page = client.fineTuning().jobs().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.jobs.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "metadata": {
+ "key": "value"
+ }
+ },
+ { ... },
+ { ... }
+ ], "has_more": true
+ }
+ x-ms-list: true
+ post:
+ operationId: FineTuning_createFineTuningJob
+ summary: Create a fine tuning job
+ description: Creates a fine tuning job from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ToolboxObject'
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -10663,34 +19648,879 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
+ - Fine-tuning
requestBody:
required: true
content:
application/json:
schema:
- $ref: '#/components/schemas/UpdateToolboxRequest'
- delete:
- operationId: deleteToolbox
- summary: Delete a toolbox
- description: Removes the specified toolbox along with all of its versions.
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create fine-tuning job
+ group: fine-tuning
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-BK7bzQj3FfZFXr7DbL6xJwfo",
+ "model": "gpt-4o-mini"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123"
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ }
+ }
+ },
+ "metadata": null
+ }
+ - title: Epochs
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc123",
+ "model": "gpt-4o-mini",
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "n_epochs": 2
+ }
+ }
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ javascript: |
+ import OpenAI from "openai";
+ import { SupervisedMethod, SupervisedHyperparameters } from "openai/resources/fine-tuning/methods";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123",
+ model: "gpt-4o-mini",
+ method: {
+ type: "supervised",
+ supervised: {
+ hyperparameters: {
+ n_epochs: 2
+ }
+ }
+ }
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": 2
+ },
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": 2
+ }
+ }
+ },
+ "metadata": null,
+ "error": {
+ "code": null,
+ "message": null,
+ "param": null
+ },
+ "finished_at": null,
+ "seed": 683058546,
+ "trained_tokens": null,
+ "estimated_finish": null,
+ "integrations": [],
+ "user_provided_suffix": null,
+ "usage_metrics": null,
+ "shared_with_openai": false
+ }
+ - title: DPO
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc123",
+ "validation_file": "file-abc123",
+ "model": "gpt-4o-mini",
+ "method": {
+ "type": "dpo",
+ "dpo": {
+ "hyperparameters": {
+ "beta": 0.1
+ }
+ }
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc",
+ "model": "gpt-4o-mini",
+ "created_at": 1746130590,
+ "fine_tuned_model": null,
+ "organization_id": "org-abc",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-123",
+ "training_file": "file-abc",
+ "method": {
+ "type": "dpo",
+ "dpo": {
+ "hyperparameters": {
+ "beta": 0.1,
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto"
+ }
+ }
+ },
+ "metadata": null,
+ "error": {
+ "code": null,
+ "message": null,
+ "param": null
+ },
+ "finished_at": null,
+ "hyperparameters": null,
+ "seed": 1036326793,
+ "estimated_finish": null,
+ "integrations": [],
+ "user_provided_suffix": null,
+ "usage_metrics": null,
+ "shared_with_openai": false
+ }
+ - title: Reinforcement
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc",
+ "validation_file": "file-123",
+ "model": "o4-mini",
+ "method": {
+ "type": "reinforcement",
+ "reinforcement": {
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ },
+ "hyperparameters": {
+ "reasoning_effort": "medium"
+ }
+ }
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |+
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "o4-mini",
+ "created_at": 1721764800,
+ "finished_at": null,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "validating_files",
+ "validation_file": "file-123",
+ "training_file": "file-abc",
+ "trained_tokens": null,
+ "error": {},
+ "user_provided_suffix": null,
+ "seed": 950189191,
+ "estimated_finish": null,
+ "integrations": [],
+ "method": {
+ "type": "reinforcement",
+ "reinforcement": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ "eval_interval": "auto",
+ "eval_samples": "auto",
+ "compute_multiplier": "auto",
+ "reasoning_effort": "medium"
+ },
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ },
+ "response_format": null
+ }
+ },
+ "metadata": null,
+ "usage_metrics": null,
+ "shared_with_openai": false
+ }
+
+ - title: Validation file
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc123",
+ "validation_file": "file-abc123",
+ "model": "gpt-4o-mini"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123",
+ validation_file: "file-abc123"
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123",
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ }
+ }
+ },
+ "metadata": null
+ }
+ - title: W&B Integration
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc123",
+ "validation_file": "file-abc123",
+ "model": "gpt-4o-mini",
+ "integrations": [
+ {
+ "type": "wandb",
+ "wandb": {
+ "project": "my-wandb-project",
+ "name": "ft-run-display-name"
+ "tags": [
+ "first-experiment", "v2"
+ ]
+ }
+ }
+ ]
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123",
+ "integrations": [
+ {
+ "type": "wandb",
+ "wandb": {
+ "project": "my-wandb-project",
+ "entity": None,
+ "run_id": "ftjob-abc123"
+ }
+ }
+ ],
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ }
+ }
+ },
+ "metadata": null
+ }
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}:
+ get:
+ operationId: FineTuning_retrieveFineTuningJob
+ summary: Get a fine tuning job
+ description: Retrieves a fine tuning job by its identifier.
parameters:
- - name: name
+ - name: fine_tuning_job_id
in: path
required: true
- description: The name of the toolbox to delete.
- schema:
- type: string
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuning job.
schema:
type: string
- explode: false
responses:
- '204':
- description: 'There is no content to send for this request, but the headers may be useful. '
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -10704,34 +20534,149 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- /toolboxes/{name}/versions:
+ - Fine-tuning
+ x-oaiMeta:
+ name: Retrieve fine-tuning job
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.retrieve(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.retrieve("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.retrieve('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Get(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "davinci-002",
+ "created_at": 1692661014,
+ "finished_at": 1692661190,
+ "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
+ "organization_id": "org-123",
+ "result_files": [
+ "file-abc123"
+ ],
+ "status": "succeeded",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ },
+ "trained_tokens": 5768,
+ "integrations": [],
+ "seed": 0,
+ "estimated_finish": 0,
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ }
+ }
+ }
+ }
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel:
post:
- operationId: createToolboxVersion
- summary: Create a new version of a toolbox
- description: Creates a new toolbox version, provisioning the toolbox itself if it does not already exist.
+ operationId: FineTuning_cancelFineTuningJob
+ summary: Cancel a fine tuning job
+ description: Cancels a fine tuning job by its identifier.
parameters:
- - name: name
+ - name: fine_tuning_job_id
in: path
required: true
- description: The name of the toolbox. If the toolbox does not exist, it will be created.
- schema:
- type: string
- maxLength: 256
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuning job to cancel.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ToolboxVersionObject'
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -10745,122 +20690,140 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the toolbox.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Arbitrary key-value metadata to associate with the toolbox.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/ToolboxTool'
- description: The list of tools to include in this version.
- skills:
- type: array
- items:
- $ref: '#/components/schemas/ToolboxSkill'
- description: The list of skill sources to include in this version. A skill reference specifies a skill name and optionally a version. If version is omitted, the skill's default version is used.
- policies:
- $ref: '#/components/schemas/ToolboxPolicies'
- description: Policy configuration for this toolbox version.
- required:
- - tools
+ - Fine-tuning
+ x-oaiMeta:
+ name: Cancel fine-tuning
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/cancel \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.cancel(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.cancel("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.cancel('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Cancel(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().cancel("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.cancel("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "cancelled",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123"
+ }
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints:
get:
- operationId: listToolboxVersions
- summary: List toolbox versions
- description: Returns the available versions for the specified toolbox.
+ operationId: FineTuning_listFineTuningJobCheckpoints
+ summary: List fine tuning job checkpoints
+ description: Lists fine tuning job checkpoints matching the request filters.
parameters:
- - name: name
+ - name: fine_tuning_job_id
in: path
required: true
- description: The name of the toolbox to list versions for.
+ description: The ID of the fine-tuning job to get checkpoints for.
schema:
type: string
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- name: after
in: query
required: false
- description: |-
- 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.
+ description: Identifier for the last checkpoint ID from the previous pagination request.
schema:
type: string
- explode: false
- - name: before
+ x-ms-list-continuation-token: true
+ - name: limit
in: query
required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: Number of checkpoints to retrieve.
schema:
- type: string
- explode: false
+ $ref: '#/components/schemas/integer'
+ default: 10
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/ToolboxVersionObject'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse'
4XX:
description: Client error
content:
@@ -10874,39 +20837,158 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- /toolboxes/{name}/versions/{version}:
+ - Fine-tuning
+ x-oaiMeta:
+ name: List fine-tuning checkpoints
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/checkpoints \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list(
+ 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
+ )) {
+ console.log(fineTuningJobCheckpoint.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.jobs.checkpoints.list(
+ fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Jobs.Checkpoints.List(
+ context.TODO(),
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ openai.FineTuningJobCheckpointListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.checkpoints.CheckpointListPage;
+ import com.openai.models.finetuning.jobs.checkpoints.CheckpointListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ CheckpointListPage page = client.fineTuning().jobs().checkpoints().list("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.jobs.checkpoints.list("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "fine_tuning.job.checkpoint",
+ "id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1721764867,
+ "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000",
+ "metrics": {
+ "full_valid_loss": 0.134,
+ "full_valid_mean_token_accuracy": 0.874
+ },
+ "fine_tuning_job_id": "ftjob-abc123",
+ "step_number": 2000
+ },
+ {
+ "object": "fine_tuning.job.checkpoint",
+ "id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",
+ "created_at": 1721764800,
+ "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000",
+ "metrics": {
+ "full_valid_loss": 0.167,
+ "full_valid_mean_token_accuracy": 0.781
+ },
+ "fine_tuning_job_id": "ftjob-abc123",
+ "step_number": 1000
+ }
+ ],
+ "first_id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "last_id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",
+ "has_more": true
+ }
+ x-ms-list: true
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/events:
get:
- operationId: getToolboxVersion
- summary: Retrieve a specific version of a toolbox
- description: Retrieves the specified version of a toolbox by name and version identifier.
+ operationId: FineTuning_listFineTuningEvents
+ summary: List fine tuning events
+ description: Lists fine tuning events matching the request filters.
parameters:
- - name: name
+ - name: fine_tuning_job_id
in: path
required: true
- description: The name of the toolbox.
+ description: The ID of the fine-tuning job to get events for.
schema:
type: string
- - name: version
- in: path
- required: true
- description: The version identifier to retrieve.
+ - name: after
+ in: query
+ required: false
+ description: Identifier for the last event from the previous pagination request.
schema:
type: string
- - name: api-version
+ x-ms-list-continuation-token: true
+ - name: limit
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: Number of events to retrieve.
schema:
- type: string
- explode: false
+ $ref: '#/components/schemas/integer'
+ default: 20
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ToolboxVersionObject'
+ $ref: '#/components/schemas/OpenAI.ListFineTuningJobEventsResponse'
4XX:
description: Client error
content:
@@ -10920,34 +21002,150 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- delete:
- operationId: deleteToolboxVersion
- summary: Delete a specific version of a toolbox
- description: Removes the specified version of a toolbox.
+ - Fine-tuning
+ x-oaiMeta:
+ name: List fine-tuning events
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/events \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.jobs.list_events(
+ fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.fineTuning.list_events(id="ftjob-abc123", limit=2);
+
+ for await (const fineTune of list) {
+ console.log(fineTune);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fineTuningJobEvent of client.fineTuning.jobs.listEvents(
+ 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
+ )) {
+ console.log(fineTuningJobEvent.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Jobs.ListEvents(
+ context.TODO(),
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ openai.FineTuningJobListEventsParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.JobListEventsPage;
+ import com.openai.models.finetuning.jobs.JobListEventsParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobListEventsPage page = client.fineTuning().jobs().listEvents("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.jobs.list_events("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "fine_tuning.job.event",
+ "id": "ft-event-ddTJfwuMVpfLXseO0Am0Gqjm",
+ "created_at": 1721764800,
+ "level": "info",
+ "message": "Fine tuning job successfully completed",
+ "data": null,
+ "type": "message"
+ },
+ {
+ "object": "fine_tuning.job.event",
+ "id": "ft-event-tyiGuB72evQncpH87xe505Sv",
+ "created_at": 1721764800,
+ "level": "info",
+ "message": "New fine-tuned model created: ft:gpt-4o-mini:openai::7p4lURel",
+ "data": null,
+ "type": "message"
+ }
+ ],
+ "has_more": true
+ }
+ x-ms-list: true
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause:
+ post:
+ operationId: FineTuning_pauseFineTuningJob
+ summary: Pause a fine tuning job
+ description: Pauses a fine tuning job.
parameters:
- - name: name
- in: path
- required: true
- description: The name of the toolbox.
- schema:
- type: string
- - name: version
+ - name: fine_tuning_job_id
in: path
required: true
- description: The version identifier to delete.
- schema:
- type: string
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuning job to pause.
schema:
type: string
- explode: false
responses:
- '204':
- description: 'There is no content to send for this request, but the headers may be useful. '
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -10961,28 +21159,16596 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
-security:
- - OAuth2Auth:
- - https://ai.azure.com/.default
-components:
- parameters:
- Azure.Core.ClientRequestIdHeader:
- name: x-ms-client-request-id
- in: header
- required: false
- description: An opaque, globally-unique, client-generated string identifier for the request.
- schema:
- $ref: '#/components/schemas/Azure.Core.uuid'
- Azure.Core.Foundations.ApiVersionParameter:
- name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- minLength: 1
- explode: false
+ - Fine-tuning
+ x-oaiMeta:
+ name: Pause fine-tuning
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/pause \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.pause(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.pause("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.pause('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Pause(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobPauseParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().pause("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.pause("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "paused",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123"
+ }
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume:
+ post:
+ operationId: FineTuning_resumeFineTuningJob
+ summary: Resume a fine tuning job
+ description: Resumes a fine tuning job.
+ parameters:
+ - name: fine_tuning_job_id
+ in: path
+ required: true
+ description: The ID of the fine-tuning job to resume.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Fine-tuning
+ x-oaiMeta:
+ name: Resume fine-tuning
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/resume \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.resume(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.resume("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.resume('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Resume(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobResumeParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().resume("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.resume("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123"
+ }
+ /openai/v1/images/edits:
+ post:
+ operationId: Images_createImageEditMultipart_Images_createImageEditJson
+ parameters: []
+ description: Creates an image edit multipart from the supplied request. Creates an image edit json from the supplied request.
+ summary: Create an image edit multipart Create an image edit json
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ImagesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ x-ms-request-body-description-override: The request body.
+ x-oaiMeta:
+ name: Create image edit
+ group: images
+ examples:
+ - title: Edit image
+ request:
+ curl: |
+ curl -s -D >(grep -i x-request-id >&2) \
+ -o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) \
+ -X POST "https://api.openai.com/v1/images/edits" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F "model=gpt-image-1.5" \
+ -F "image[]=@body-lotion.png" \
+ -F "image[]=@bath-bomb.png" \
+ -F "image[]=@incense-kit.png" \
+ -F "image[]=@soap.png" \
+ -F 'prompt=Create a lovely gift basket with these four items in it'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.edit(
+ image=b"Example data",
+ prompt="A cute baby sea otter wearing a beret",
+ ):
+ print(image)
+ javascript: |
+ import fs from "fs";
+ import OpenAI, { toFile } from "openai";
+
+ const client = new OpenAI();
+
+ const imageFiles = [
+ "bath-bomb.png",
+ "body-lotion.png",
+ "incense-kit.png",
+ "soap.png",
+ ];
+
+ const images = await Promise.all(
+ imageFiles.map(async (file) =>
+ await toFile(fs.createReadStream(file), null, {
+ type: "image/png",
+ })
+ ),
+ );
+
+ const rsp = await client.images.edit({
+ model: "gpt-image-1.5",
+ image: images,
+ prompt: "Create a lovely gift basket with these four items in it",
+ });
+
+ // Save the image to a file
+ const image_base64 = rsp.data[0].b64_json;
+ const image_bytes = Buffer.from(image_base64, "base64");
+ fs.writeFileSync("basket.png", image_bytes);
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.edit({
+ image: fs.createReadStream('path/to/file'),
+ prompt: 'A cute baby sea otter wearing a beret',
+ });
+
+ console.log(imagesResponse);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{
+ Image: openai.ImageEditParamsImageUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ Prompt: "A cute baby sea otter wearing a beret",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageEditParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageEditParams params = ImageEditParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .prompt("A cute baby sea otter wearing a beret")
+ .build();
+ ImagesResponse imagesResponse = client.images().edit(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.edit(image: StringIO.new("Example data"), prompt: "A cute baby sea otter wearing a beret")
+
+ puts(images_response)
+ - title: Streaming
+ request:
+ curl: |
+ curl -s -N -X POST "https://api.openai.com/v1/images/edits" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F "model=gpt-image-1.5" \
+ -F "image[]=@body-lotion.png" \
+ -F "image[]=@bath-bomb.png" \
+ -F "image[]=@incense-kit.png" \
+ -F "image[]=@soap.png" \
+ -F 'prompt=Create a lovely gift basket with these four items in it' \
+ -F "stream=true"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.edit(
+ image=b"Example data",
+ prompt="A cute baby sea otter wearing a beret",
+ ):
+ print(image)
+ javascript: |
+ import fs from "fs";
+ import OpenAI, { toFile } from "openai";
+
+ const client = new OpenAI();
+
+ const imageFiles = [
+ "bath-bomb.png",
+ "body-lotion.png",
+ "incense-kit.png",
+ "soap.png",
+ ];
+
+ const images = await Promise.all(
+ imageFiles.map(async (file) =>
+ await toFile(fs.createReadStream(file), null, {
+ type: "image/png",
+ })
+ ),
+ );
+
+ const stream = await client.images.edit({
+ model: "gpt-image-1.5",
+ image: images,
+ prompt: "Create a lovely gift basket with these four items in it",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.edit({
+ image: fs.createReadStream('path/to/file'),
+ prompt: 'A cute baby sea otter wearing a beret',
+ });
+
+ console.log(imagesResponse);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{
+ Image: openai.ImageEditParamsImageUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ Prompt: "A cute baby sea otter wearing a beret",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageEditParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageEditParams params = ImageEditParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .prompt("A cute baby sea otter wearing a beret")
+ .build();
+ ImagesResponse imagesResponse = client.images().edit(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.edit(image: StringIO.new("Example data"), prompt: "A cute baby sea otter wearing a beret")
+
+ puts(images_response)
+ response: |
+ event: image_edit.partial_image
+ data: {"type":"image_edit.partial_image","b64_json":"...","partial_image_index":0}
+
+ event: image_edit.completed
+ data: {"type":"image_edit.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}}
+ tags:
+ - Images
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateImageEditRequest'
+ encoding:
+ image:
+ contentType: application/octet-stream, application/json
+ background:
+ contentType: application/json
+ model:
+ contentType: application/json
+ 'n':
+ contentType: application/json
+ size:
+ contentType: application/json
+ response_format:
+ contentType: application/json
+ output_format:
+ contentType: application/json
+ output_compression:
+ contentType: application/json
+ input_fidelity:
+ contentType: application/json
+ stream:
+ contentType: application/json
+ partial_images:
+ contentType: application/json
+ quality:
+ contentType: application/json
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.EditImageBodyJsonParam'
+ description: The multipart request body. The request body.
+ /openai/v1/images/generations:
+ post:
+ operationId: Images_createImage
+ summary: Create an image
+ description: Creates an image from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ImagesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Images
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateImageRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create image
+ group: images
+ examples:
+ - title: Generate image
+ request:
+ curl: |
+ curl https://api.openai.com/v1/images/generations \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-image-1.5",
+ "prompt": "A cute baby sea otter",
+ "n": 1,
+ "size": "1024x1024"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.generate(
+ prompt="A cute baby sea otter",
+ ):
+ print(image)
+ javascript: |
+ import OpenAI from "openai";
+ import { writeFile } from "fs/promises";
+
+ const client = new OpenAI();
+
+ const img = await client.images.generate({
+ model: "gpt-image-1.5",
+ prompt: "A cute baby sea otter",
+ n: 1,
+ size: "1024x1024"
+ });
+
+ const imageBuffer = Buffer.from(img.data[0].b64_json, "base64");
+ await writeFile("output.png", imageBuffer);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });
+
+ console.log(imagesResponse);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{
+ Prompt: "A cute baby sea otter",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageGenerateParams;
+ import com.openai.models.images.ImagesResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageGenerateParams params = ImageGenerateParams.builder()
+ .prompt("A cute baby sea otter")
+ .build();
+ ImagesResponse imagesResponse = client.images().generate(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.generate(prompt: "A cute baby sea otter")
+
+ puts(images_response)
+ response: |
+ {
+ "created": 1713833628,
+ "data": [
+ {
+ "b64_json": "..."
+ }
+ ],
+ "usage": {
+ "total_tokens": 100,
+ "input_tokens": 50,
+ "output_tokens": 50,
+ "input_tokens_details": {
+ "text_tokens": 10,
+ "image_tokens": 40
+ }
+ }
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/images/generations \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-image-1.5",
+ "prompt": "A cute baby sea otter",
+ "n": 1,
+ "size": "1024x1024",
+ "stream": true
+ }' \
+ --no-buffer
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.generate(
+ prompt="A cute baby sea otter",
+ ):
+ print(image)
+ javascript: |
+ import OpenAI from "openai";
+
+ const client = new OpenAI();
+
+ const stream = await client.images.generate({
+ model: "gpt-image-1.5",
+ prompt: "A cute baby sea otter",
+ n: 1,
+ size: "1024x1024",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });
+
+ console.log(imagesResponse);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{
+ Prompt: "A cute baby sea otter",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageGenerateParams;
+ import com.openai.models.images.ImagesResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageGenerateParams params = ImageGenerateParams.builder()
+ .prompt("A cute baby sea otter")
+ .build();
+ ImagesResponse imagesResponse = client.images().generate(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.generate(prompt: "A cute baby sea otter")
+
+ puts(images_response)
+ response: |
+ event: image_generation.partial_image
+ data: {"type":"image_generation.partial_image","b64_json":"...","partial_image_index":0}
+
+ event: image_generation.completed
+ data: {"type":"image_generation.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}}
+ /openai/v1/images/variations:
+ post:
+ operationId: Images_createImageVariation
+ summary: Create an image variation
+ description: Creates an image variation from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ImagesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Images
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateImageVariationRequest'
+ encoding:
+ model:
+ contentType: application/json
+ 'n':
+ contentType: application/json
+ response_format:
+ contentType: application/json
+ size:
+ contentType: application/json
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Create image variation
+ group: images
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/images/variations \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F image="@otter.png" \
+ -F n=2 \
+ -F size="1024x1024"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ images_response = client.images.create_variation(
+ image=b"Example data",
+ )
+ print(images_response.created)
+ javascript: |-
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const image = await openai.images.createVariation({
+ image: fs.createReadStream("otter.png"),
+ });
+
+ console.log(image.data);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Images;
+
+ ImageClient client = new(
+ model: "dall-e-2",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ GeneratedImage image = client.GenerateImageVariation(imageFilePath: "otter.png");
+
+ Console.WriteLine(image.ImageUri);
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.createVariation({
+ image: fs.createReadStream('otter.png'),
+ });
+
+ console.log(imagesResponse.created);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.NewVariation(context.TODO(), openai.ImageNewVariationParams{
+ Image: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse.Created)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageCreateVariationParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageCreateVariationParams params = ImageCreateVariationParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ ImagesResponse imagesResponse = client.images().createVariation(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.create_variation(image: StringIO.new("Example data"))
+
+ puts(images_response)
+ response: |
+ {
+ "created": 1589478378,
+ "data": [
+ {
+ "url": "https://..."
+ },
+ {
+ "url": "https://..."
+ }
+ ]
+ }
+ /openai/v1/models:
+ get:
+ operationId: OpenAIModels_listModels
+ summary: List models
+ description: Lists models matching the request filters.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListModelsResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Models
+ x-oaiMeta:
+ name: List models
+ group: models
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/models \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.models.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.models.list();
+
+ for await (const model of list) {
+ console.log(model);
+ }
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Models;
+
+ OpenAIModelClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ foreach (var model in client.GetModels().Value)
+ {
+ Console.WriteLine(model.Id);
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const model of client.models.list()) {
+ console.log(model.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Models.List(context.TODO())
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.models.ModelListPage;
+ import com.openai.models.models.ModelListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModelListPage page = client.models().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.models.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "model-id-0",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "organization-owner"
+ },
+ {
+ "id": "model-id-1",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "organization-owner",
+ },
+ {
+ "id": "model-id-2",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "openai"
+ },
+ ]
+ }
+ x-ms-list: true
+ /openai/v1/models/{model}:
+ delete:
+ operationId: OpenAIModels_deleteModel
+ summary: Delete a model
+ description: Deletes a model by its identifier.
+ parameters:
+ - name: model
+ in: path
+ required: true
+ description: The model to delete
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteModelResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Models
+ x-oaiMeta:
+ name: Delete a fine-tuned model
+ group: models
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/models/ft:gpt-4o-mini:acemeco:suffix:abc123 \
+ -X DELETE \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ model_deleted = client.models.delete(
+ "ft:gpt-4o-mini:acemeco:suffix:abc123",
+ )
+ print(model_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const model = await openai.models.delete("ft:gpt-4o-mini:acemeco:suffix:abc123");
+
+ console.log(model);
+ }
+ main();
+ csharp: |
+ using System;
+ using System.ClientModel;
+
+ using OpenAI.Models;
+
+ OpenAIModelClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ClientResult success = client.DeleteModel("ft:gpt-4o-mini:acemeco:suffix:abc123");
+ Console.WriteLine(success);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const modelDeleted = await client.models.delete('ft:gpt-4o-mini:acemeco:suffix:abc123');
+
+ console.log(modelDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ modelDeleted, err := client.Models.Delete(context.TODO(), "ft:gpt-4o-mini:acemeco:suffix:abc123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", modelDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.models.ModelDeleteParams;
+ import com.openai.models.models.ModelDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModelDeleted modelDeleted = client.models().delete("ft:gpt-4o-mini:acemeco:suffix:abc123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ model_deleted = openai.models.delete("ft:gpt-4o-mini:acemeco:suffix:abc123")
+
+ puts(model_deleted)
+ response: |
+ {
+ "id": "ft:gpt-4o-mini:acemeco:suffix:abc123",
+ "object": "model",
+ "deleted": true
+ }
+ get:
+ operationId: OpenAIModels_retrieveModel
+ summary: Get a model
+ description: Retrieves a model by its identifier.
+ parameters:
+ - name: model
+ in: path
+ required: true
+ description: The ID of the model to use for this request
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Model'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Models
+ x-oaiMeta:
+ name: Retrieve model
+ group: models
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/models/VAR_chat_model_id \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ model = client.models.retrieve(
+ "gpt-4o-mini",
+ )
+ print(model.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const model = await openai.models.retrieve("VAR_chat_model_id");
+
+ console.log(model);
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.ClientModel;
+
+ using OpenAI.Models;
+
+ OpenAIModelClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ClientResult model = client.GetModel("babbage-002");
+ Console.WriteLine(model.Value.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const model = await client.models.retrieve('gpt-4o-mini');
+
+ console.log(model.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ model, err := client.Models.Get(context.TODO(), "gpt-4o-mini")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", model.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.models.Model;
+ import com.openai.models.models.ModelRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Model model = client.models().retrieve("gpt-4o-mini");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ model = openai.models.retrieve("gpt-4o-mini")
+
+ puts(model)
+ response: |
+ {
+ "id": "VAR_chat_model_id",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "openai"
+ }
+ /openai/v1/moderations:
+ post:
+ operationId: Moderations_createModeration
+ summary: Create a moderation
+ description: Creates a moderation from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Moderations
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateModerationRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create moderation
+ group: moderations
+ examples:
+ - title: Single string
+ request:
+ curl: |
+ curl https://api.openai.com/v1/moderations \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "input": "I want to kill them."
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ moderation = client.moderations.create(
+ input="I want to kill them.",
+ )
+ print(moderation.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const moderation = await openai.moderations.create({ input: "I want to kill them." });
+
+ console.log(moderation);
+ }
+ main();
+ csharp: |
+ using System;
+ using System.ClientModel;
+
+ using OpenAI.Moderations;
+
+ ModerationClient client = new(
+ model: "omni-moderation-latest",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ClientResult moderation = client.ClassifyText("I want to kill them.");
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const moderation = await client.moderations.create({ input: 'I want to kill them.' });
+
+ console.log(moderation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ moderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{
+ Input: openai.ModerationNewParamsInputUnion{
+ OfString: openai.String("I want to kill them."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", moderation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.moderations.ModerationCreateParams;
+ import com.openai.models.moderations.ModerationCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModerationCreateParams params = ModerationCreateParams.builder()
+ .input("I want to kill them.")
+ .build();
+ ModerationCreateResponse moderation = client.moderations().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ moderation = openai.moderations.create(input: "I want to kill them.")
+
+ puts(moderation)
+ response: |
+ {
+ "id": "modr-AB8CjOTu2jiq12hp1AQPfeqFWaORR",
+ "model": "text-moderation-007",
+ "results": [
+ {
+ "flagged": true,
+ "categories": {
+ "sexual": false,
+ "hate": false,
+ "harassment": true,
+ "self-harm": false,
+ "sexual/minors": false,
+ "hate/threatening": false,
+ "violence/graphic": false,
+ "self-harm/intent": false,
+ "self-harm/instructions": false,
+ "harassment/threatening": true,
+ "violence": true
+ },
+ "category_scores": {
+ "sexual": 0.000011726012417057063,
+ "hate": 0.22706663608551025,
+ "harassment": 0.5215635299682617,
+ "self-harm": 2.227119921371923e-6,
+ "sexual/minors": 7.107352217872176e-8,
+ "hate/threatening": 0.023547329008579254,
+ "violence/graphic": 0.00003391829886822961,
+ "self-harm/intent": 1.646940972932498e-6,
+ "self-harm/instructions": 1.1198755256458526e-9,
+ "harassment/threatening": 0.5694745779037476,
+ "violence": 0.9971134662628174
+ }
+ }
+ ]
+ }
+ - title: Image and text
+ request:
+ curl: |
+ curl https://api.openai.com/v1/moderations \
+ -X POST \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "omni-moderation-latest",
+ "input": [
+ { "type": "text", "text": "...text to classify goes here..." },
+ {
+ "type": "image_url",
+ "image_url": {
+ "url": "https://example.com/image.png"
+ }
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ moderation = client.moderations.create(
+ input="I want to kill them.",
+ )
+ print(moderation.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ const moderation = await openai.moderations.create({
+ model: "omni-moderation-latest",
+ input: [
+ { type: "text", text: "...text to classify goes here..." },
+ {
+ type: "image_url",
+ image_url: {
+ url: "https://example.com/image.png"
+ // can also use base64 encoded image URLs
+ // url: "data:image/jpeg;base64,abcdefg..."
+ }
+ }
+ ],
+ });
+
+ console.log(moderation);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const moderation = await client.moderations.create({ input: 'I want to kill them.' });
+
+ console.log(moderation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ moderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{
+ Input: openai.ModerationNewParamsInputUnion{
+ OfString: openai.String("I want to kill them."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", moderation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.moderations.ModerationCreateParams;
+ import com.openai.models.moderations.ModerationCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModerationCreateParams params = ModerationCreateParams.builder()
+ .input("I want to kill them.")
+ .build();
+ ModerationCreateResponse moderation = client.moderations().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ moderation = openai.moderations.create(input: "I want to kill them.")
+
+ puts(moderation)
+ response: |
+ {
+ "id": "modr-0d9740456c391e43c445bf0f010940c7",
+ "model": "omni-moderation-latest",
+ "results": [
+ {
+ "flagged": true,
+ "categories": {
+ "harassment": true,
+ "harassment/threatening": true,
+ "sexual": false,
+ "hate": false,
+ "hate/threatening": false,
+ "illicit": false,
+ "illicit/violent": false,
+ "self-harm/intent": false,
+ "self-harm/instructions": false,
+ "self-harm": false,
+ "sexual/minors": false,
+ "violence": true,
+ "violence/graphic": true
+ },
+ "category_scores": {
+ "harassment": 0.8189693396524255,
+ "harassment/threatening": 0.804985420696006,
+ "sexual": 1.573112165348997e-6,
+ "hate": 0.007562942636942845,
+ "hate/threatening": 0.004208854591835476,
+ "illicit": 0.030535955153511665,
+ "illicit/violent": 0.008925306722380033,
+ "self-harm/intent": 0.00023023930975076432,
+ "self-harm/instructions": 0.0002293869201073356,
+ "self-harm": 0.012598046106750154,
+ "sexual/minors": 2.212566909570261e-8,
+ "violence": 0.9999992735124786,
+ "violence/graphic": 0.843064871157054
+ },
+ "category_applied_input_types": {
+ "harassment": [
+ "text"
+ ],
+ "harassment/threatening": [
+ "text"
+ ],
+ "sexual": [
+ "text",
+ "image"
+ ],
+ "hate": [
+ "text"
+ ],
+ "hate/threatening": [
+ "text"
+ ],
+ "illicit": [
+ "text"
+ ],
+ "illicit/violent": [
+ "text"
+ ],
+ "self-harm/intent": [
+ "text",
+ "image"
+ ],
+ "self-harm/instructions": [
+ "text",
+ "image"
+ ],
+ "self-harm": [
+ "text",
+ "image"
+ ],
+ "sexual/minors": [
+ "text"
+ ],
+ "violence": [
+ "text",
+ "image"
+ ],
+ "violence/graphic": [
+ "text",
+ "image"
+ ]
+ }
+ }
+ ]
+ }
+ /openai/v1/realtime/calls:
+ post:
+ operationId: Realtime_create-realtime-call
+ summary: Create a Realtime call
+ description: Creates a Realtime API call over WebRTC and returns the SDP answer needed to complete the peer connection.
+ parameters: []
+ responses:
+ '201':
+ description: The request has succeeded and a new resource has been created as a result.
+ headers:
+ location:
+ required: false
+ description: The location request header.
+ schema:
+ type: string
+ content:
+ application/sdp:
+ schema:
+ type: string
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Realtime
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RealtimeCallCreateRequest'
+ encoding:
+ session:
+ contentType: application/json
+ description: The request body.
+ x-oaiMeta:
+ name: Create call
+ group: realtime
+ returns: |-
+ Returns `201 Created` with the SDP answer in the response body. The
+ `Location` response header includes the call ID for follow-up requests,
+ e.g., establishing a monitoring WebSocket or hanging up the call.
+ examples:
+ request:
+ curl: |-
+ curl -X POST https://api.openai.com/v1/realtime/calls \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F "sdp= inputItems =
+ [
+ ResponseItem.CreateUserMessageItem(
+ [
+ ResponseContentPart.CreateInputTextPart("What is in this image?"),
+ ResponseContentPart.CreateInputImagePart(new Uri("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"))
+ ]
+ )
+ ];
+
+ OpenAIResponse response = client.CreateResponse(inputItems);
+
+ Console.WriteLine(response.GetOutputText());
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
+ "object": "response",
+ "created_at": 1741476777,
+ "status": "completed",
+ "completed_at": 1741476778,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 328,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 52,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 380
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: File input
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "what is in this file?"},
+ {
+ "type": "input_file",
+ "file_url": "https://www.berkshirehathaway.com/letters/2024ltr.pdf"
+ }
+ ]
+ }
+ ]
+ }'
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ input: [
+ {
+ role: "user",
+ content: [
+ { type: "input_text", text: "what is in this file?" },
+ {
+ type: "input_file",
+ file_url: "https://www.berkshirehathaway.com/letters/2024ltr.pdf",
+ },
+ ],
+ },
+ ],
+ });
+
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86",
+ "object": "response",
+ "created_at": 1752100704,
+ "status": "completed",
+ "completed_at": 1752100705,
+ "background": false,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "max_tool_calls": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "id": "msg_686eef60d3e081a29283bdcbc4322fd90e34c516d176ff86",
+ "type": "message",
+ "status": "completed",
+ "content": [
+ {
+ "type": "output_text",
+ "annotations": [],
+ "logprobs": [],
+ "text": "The file seems to contain excerpts from a letter to the shareholders of Berkshire Hathaway Inc., likely written by Warren Buffett. It covers several topics:
+
+ 1. **Communication Philosophy**: Buffett emphasizes the importance of transparency and candidness in reporting mistakes and successes to shareholders.
+
+ 2. **Mistakes and Learnings**: The letter acknowledges past mistakes in business assessments and management hires, highlighting the importance of correcting errors promptly.
+
+ 3. **CEO Succession**: Mention of Greg Abel stepping in as the new CEO and continuing the tradition of honest communication.
+
+ 4. **Pete Liegl Story**: A detailed account of acquiring Forest River and the relationship with its founder, highlighting trust and effective business decisions.
+
+ 5. **2024 Performance**: Overview of business performance, particularly in insurance and investment activities, with a focus on GEICO's improvement.
+
+ 6. **Tax Contributions**: Discussion of significant tax payments to the U.S. Treasury, credited to shareholders' reinvestments.
+
+ 7. **Investment Strategy**: A breakdown of Berkshire\u2019s investments in both controlled subsidiaries and marketable equities, along with a focus on long-term holding strategies.
+
+ 8. **American Capitalism**: Reflections on America\u2019s economic development and Berkshire\u2019s role within it.
+
+ 9. **Property-Casualty Insurance**: Insights into the P/C insurance business model and its challenges and benefits.
+
+ 10. **Japanese Investments**: Information about Berkshire\u2019s investments in Japanese companies and future plans.
+
+ 11. **Annual Meeting**: Details about the upcoming annual gathering in Omaha, including schedule changes and new book releases.
+
+ 12. **Personal Anecdotes**: Light-hearted stories about family and interactions, conveying Buffett's personable approach.
+
+ 13. **Financial Performance Data**: Tables comparing Berkshire\u2019s annual performance to the S&P 500, showing impressive long-term gains.
+
+ Overall, the letter reinforces Berkshire Hathaway's commitment to transparency, investment in both its businesses and the wider economy, and emphasizes strong leadership and prudent financial management."
+ }
+ ],
+ "role": "assistant"
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "service_tier": "default",
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_logprobs": 0,
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 8438,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 398,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 8836
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: Web search
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "tools": [{ "type": "web_search_preview" }],
+ "input": "What was a positive news story from today?"
+ }'
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ tools: [{ type: "web_search_preview" }],
+ input: "What was a positive news story from today?",
+ });
+
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ csharp: |
+ using System;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "What was a positive news story from today?";
+
+ ResponseCreationOptions options = new()
+ {
+ Tools =
+ {
+ ResponseTool.CreateWebSearchTool()
+ },
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ Console.WriteLine(response.GetOutputText());
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c",
+ "object": "response",
+ "created_at": 1741484430,
+ "status": "completed",
+ "completed_at": 1741484431,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "web_search_call",
+ "id": "ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c",
+ "status": "completed"
+ },
+ {
+ "type": "message",
+ "id": "msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "As of today, March 9, 2025, one notable positive news story...",
+ "annotations": [
+ {
+ "type": "url_citation",
+ "start_index": 442,
+ "end_index": 557,
+ "url": "https://.../?utm_source=chatgpt.com",
+ "title": "..."
+ },
+ {
+ "type": "url_citation",
+ "start_index": 962,
+ "end_index": 1077,
+ "url": "https://.../?utm_source=chatgpt.com",
+ "title": "..."
+ },
+ {
+ "type": "url_citation",
+ "start_index": 1336,
+ "end_index": 1451,
+ "url": "https://.../?utm_source=chatgpt.com",
+ "title": "..."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [
+ {
+ "type": "web_search_preview",
+ "domains": [],
+ "search_context_size": "medium",
+ "user_location": {
+ "type": "approximate",
+ "city": null,
+ "country": "US",
+ "region": null,
+ "timezone": null
+ }
+ }
+ ],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 328,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 356,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 684
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: File search
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "tools": [{
+ "type": "file_search",
+ "vector_store_ids": ["vs_1234567890"],
+ "max_num_results": 20
+ }],
+ "input": "What are the attributes of an ancient brown dragon?"
+ }'
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ tools: [{
+ type: "file_search",
+ vector_store_ids: ["vs_1234567890"],
+ max_num_results: 20
+ }],
+ input: "What are the attributes of an ancient brown dragon?",
+ });
+
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ csharp: |
+ using System;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "What are the attributes of an ancient brown dragon?";
+
+ ResponseCreationOptions options = new()
+ {
+ Tools =
+ {
+ ResponseTool.CreateFileSearchTool(
+ vectorStoreIds: ["vs_1234567890"],
+ maxResultCount: 20
+ )
+ },
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ Console.WriteLine(response.GetOutputText());
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7",
+ "object": "response",
+ "created_at": 1741485253,
+ "status": "completed",
+ "completed_at": 1741485254,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "file_search_call",
+ "id": "fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7",
+ "status": "completed",
+ "queries": [
+ "attributes of an ancient brown dragon"
+ ],
+ "results": null
+ },
+ {
+ "type": "message",
+ "id": "msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "The attributes of an ancient brown dragon include...",
+ "annotations": [
+ {
+ "type": "file_citation",
+ "index": 320,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 576,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 815,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 815,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1030,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1030,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1156,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1225,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [
+ {
+ "type": "file_search",
+ "filters": null,
+ "max_num_results": 20,
+ "ranking_options": {
+ "ranker": "auto",
+ "score_threshold": 0.0
+ },
+ "vector_store_ids": [
+ "vs_1234567890"
+ ]
+ }
+ ],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 18307,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 348,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 18655
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "instructions": "You are a helpful assistant.",
+ "input": "Hello!",
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ instructions: "You are a helpful assistant.",
+ input: "Hello!",
+ stream: true,
+ });
+
+ for await (const event of response) {
+ console.log(event);
+ }
+ csharp: |
+ using System;
+ using System.ClientModel;
+ using System.Threading.Tasks;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "Hello!";
+
+ ResponseCreationOptions options = new()
+ {
+ Instructions = "You are a helpful assistant.",
+ };
+
+ AsyncCollectionResult responseUpdates = client.CreateResponseStreamingAsync(userInputText, options);
+
+ await foreach (StreamingResponseUpdate responseUpdate in responseUpdates)
+ {
+ if (responseUpdate is StreamingResponseOutputTextDeltaUpdate outputTextDeltaUpdate)
+ {
+ Console.Write(outputTextDeltaUpdate.Delta);
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ event: response.created
+ data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
+
+ event: response.in_progress
+ data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
+
+ event: response.output_item.added
+ data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}}
+
+ event: response.content_part.added
+ data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}
+
+ event: response.output_text.delta
+ data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"Hi"}
+
+ ...
+
+ event: response.output_text.done
+ data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"Hi there! How can I assist you today?"}
+
+ event: response.content_part.done
+ data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}}
+
+ event: response.output_item.done
+ data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}}
+
+ event: response.completed
+ data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}}
+ - title: Functions
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "input": "What is the weather like in Boston today?",
+ "tools": [
+ {
+ "type": "function",
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location", "unit"]
+ }
+ }
+ ],
+ "tool_choice": "auto"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const tools = [
+ {
+ type: "function",
+ name: "get_current_weather",
+ description: "Get the current weather in a given location",
+ parameters: {
+ type: "object",
+ properties: {
+ location: {
+ type: "string",
+ description: "The city and state, e.g. San Francisco, CA",
+ },
+ unit: { type: "string", enum: ["celsius", "fahrenheit"] },
+ },
+ required: ["location", "unit"],
+ },
+ },
+ ];
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ tools: tools,
+ input: "What is the weather like in Boston today?",
+ tool_choice: "auto",
+ });
+
+ console.log(response);
+ csharp: |
+ using System;
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ResponseTool getCurrentWeatherFunctionTool = ResponseTool.CreateFunctionTool(
+ functionName: "get_current_weather",
+ functionDescription: "Get the current weather in a given location",
+ functionParameters: BinaryData.FromString("""
+ {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
+ },
+ "required": ["location", "unit"]
+ }
+ """
+ )
+ );
+
+ string userInputText = "What is the weather like in Boston today?";
+
+ ResponseCreationOptions options = new()
+ {
+ Tools =
+ {
+ getCurrentWeatherFunctionTool
+ },
+ ToolChoice = ResponseToolChoice.CreateAutoChoice(),
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0",
+ "object": "response",
+ "created_at": 1741294021,
+ "status": "completed",
+ "completed_at": 1741294022,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "function_call",
+ "id": "fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0",
+ "call_id": "call_unLAR8MvFNptuiZK6K6HCy5k",
+ "name": "get_current_weather",
+ "arguments": "{"location":"Boston, MA","unit":"celsius"}",
+ "status": "completed"
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [
+ {
+ "type": "function",
+ "description": "Get the current weather in a given location",
+ "name": "get_current_weather",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": [
+ "celsius",
+ "fahrenheit"
+ ]
+ }
+ },
+ "required": [
+ "location",
+ "unit"
+ ]
+ },
+ "strict": true
+ }
+ ],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 291,
+ "output_tokens": 23,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 314
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: Reasoning
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "o3-mini",
+ "input": "How much wood would a woodchuck chuck?",
+ "reasoning": {
+ "effort": "high"
+ }
+ }'
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "o3-mini",
+ input: "How much wood would a woodchuck chuck?",
+ reasoning: {
+ effort: "high"
+ }
+ });
+
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ csharp: |
+ using System;
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "o3-mini",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "How much wood would a woodchuck chuck?";
+
+ ResponseCreationOptions options = new()
+ {
+ ReasoningOptions = new()
+ {
+ ReasoningEffortLevel = ResponseReasoningEffortLevel.High,
+ },
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ Console.WriteLine(response.GetOutputText());
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808",
+ "object": "response",
+ "created_at": 1741477868,
+ "status": "completed",
+ "completed_at": 1741477869,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "o1-2024-12-17",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "The classic tongue twister...",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": "high",
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 81,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 1035,
+ "output_tokens_details": {
+ "reasoning_tokens": 832
+ },
+ "total_tokens": 1116
+ },
+ "user": null,
+ "metadata": {}
+ }
+ get:
+ operationId: listResponses
+ summary: List responses
+ description: Returns a collection of all stored responses matching specified filter criteria.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: agent_name
+ in: query
+ required: false
+ description: Filter by agent name. If provided, only items associated with the specified agent will be returned.
+ schema:
+ type: string
+ explode: false
+ - name: agent_id
+ in: query
+ required: false
+ description: Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.
+ schema:
+ type: string
+ explode: false
+ - name: conversation_id
+ in: query
+ required: false
+ description: Filter by conversation ID. If provided, only responses associated with the specified conversation will be returned.
+ schema:
+ type: string
+ explode: false
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ /openai/v1/responses/compact:
+ post:
+ operationId: Compactconversation
+ summary: Compact a conversation
+ description: Compacts a conversation into a response object suitable for long-running and zero-data-retention scenarios.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CompactResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CompactResponseMethodPublicBody'
+ x-oaiMeta:
+ name: Compact a response
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/responses/compact \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.1-codex-max",
+ "input": [
+ {
+ "role": "user",
+ "content": "Create a simple landing page for a dog petting café."
+ },
+ {
+ "id": "msg_001",
+ "type": "message",
+ "status": "completed",
+ "content": [
+ {
+ "type": "output_text",
+ "annotations": [],
+ "logprobs": [],
+ "text": "Below is a single file, ready-to-use landing page for a dog petting café:..."
+ }
+ ],
+ "role": "assistant"
+ }
+ ]
+ }'
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ // Compact the previous response if you are running out of tokens
+ const compactedResponse = await openai.responses.compact({
+ model: "gpt-5.1-codex-max",
+ input: [
+ {
+ role: "user",
+ content: "Create a simple landing page for a dog petting café.",
+ },
+ // All items returned from previous requests are included here, like reasoning, message, function call, etc.
+ {
+ id: "msg_030d085c0b53e67e0069332e3a72d4819c96c6f2c4adc15d33",
+ type: "message",
+ status: "completed",
+ content: [
+ {
+ type: "output_text",
+ annotations: [],
+ logprobs: [],
+ text: "Below is a single file, ready-to-use landing page for a dog petting café:...",
+ },
+ ],
+ role: "assistant",
+ },
+ ],
+ });
+
+ // Pass the compactedResponse.output as input to the next request
+ console.log(compactedResponse);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ compacted_response = client.responses.compact(
+ model="gpt-5.4",
+ )
+ print(compacted_response.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const compactedResponse = await client.responses.compact({ model: 'gpt-5.4' });
+
+ console.log(compactedResponse.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ compactedResponse, err := client.Responses.Compact(context.TODO(), responses.ResponseCompactParams{
+ Model: responses.ResponseCompactParamsModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", compactedResponse.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.CompactedResponse;
+ import com.openai.models.responses.ResponseCompactParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ResponseCompactParams params = ResponseCompactParams.builder()
+ .model(ResponseCompactParams.Model.GPT_5_4)
+ .build();
+ CompactedResponse compactedResponse = client.responses().compact(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ compacted_response = openai.responses.compact(model: :"gpt-5.4")
+
+ puts(compacted_response)
+ response: |
+ {
+ "id": "resp_001",
+ "object": "response.compaction",
+ "created_at": 1764967971,
+ "output": [
+ {
+ "id": "msg_000",
+ "type": "message",
+ "status": "completed",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Create a simple landing page for a dog petting cafe."
+ }
+ ],
+ "role": "user"
+ },
+ {
+ "id": "cmp_001",
+ "type": "compaction",
+ "encrypted_content": "gAAAAABpM0Yj-...="
+ }
+ ],
+ "usage": {
+ "input_tokens": 139,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 438,
+ "output_tokens_details": {
+ "reasoning_tokens": 64
+ },
+ "total_tokens": 577
+ }
+ }
+ /openai/v1/responses/{response_id}:
+ get:
+ operationId: getResponse
+ summary: Retrieve a model response
+ description: Retrieves a model response with the given ID.
+ parameters:
+ - name: response_id
+ in: path
+ required: true
+ description: The response id path parameter.
+ schema:
+ type: string
+ - name: include[]
+ in: query
+ required: false
+ description: The includables query parameter.
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.IncludeEnum'
+ default: []
+ - name: stream
+ in: query
+ required: false
+ description: The stream query parameter.
+ schema:
+ type: boolean
+ default: false
+ explode: false
+ - name: starting_after
+ in: query
+ required: false
+ description: The sequence number of the event after which to start streaming.
+ schema:
+ type: integer
+ format: int32
+ explode: false
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ x-agent-session-id:
+ required: false
+ description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Response'
+ text/event-stream:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateResponseStreamingResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ x-oaiMeta:
+ name: Get a model response
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses/resp_123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.retrieve("resp_123");
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.retrieve(
+ response_id="resp_677efb5139a88190b512bc3fef8e535d",
+ ):
+ print(response)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.retrieve('resp_677efb5139a88190b512bc3fef8e535d');
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.Get(
+ context.TODO(),
+ "resp_677efb5139a88190b512bc3fef8e535d",
+ responses.ResponseGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().retrieve("resp_677efb5139a88190b512bc3fef8e535d");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.retrieve("resp_677efb5139a88190b512bc3fef8e535d")
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44",
+ "object": "response",
+ "created_at": 1741386163,
+ "status": "completed",
+ "completed_at": 1741386164,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "Silent circuits hum,
+ Thoughts emerge in data streams—
+ Digital dawn breaks.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 32,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 18,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 50
+ },
+ "user": null,
+ "metadata": {}
+ }
+ delete:
+ operationId: deleteResponse
+ summary: Delete a model response
+ description: Deletes a model response.
+ parameters:
+ - name: response_id
+ in: path
+ required: true
+ description: The ID of the response to delete.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ x-agent-session-id:
+ required: false
+ description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DeleteResponseResult'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ x-oaiMeta:
+ name: Delete a model response
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/responses/resp_123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.delete("resp_123");
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ client.responses.delete(
+ "resp_677efb5139a88190b512bc3fef8e535d",
+ )
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ await client.responses.delete('resp_677efb5139a88190b512bc3fef8e535d');
+ go: |
+ package main
+
+ import (
+ "context"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ err := client.Responses.Delete(context.TODO(), "resp_677efb5139a88190b512bc3fef8e535d")
+ if err != nil {
+ panic(err.Error())
+ }
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.ResponseDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ client.responses().delete("resp_677efb5139a88190b512bc3fef8e535d");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ result = openai.responses.delete("resp_677efb5139a88190b512bc3fef8e535d")
+
+ puts(result)
+ response: |
+ {
+ "id": "resp_6786a1bec27481909a17d673315b29f6",
+ "object": "response",
+ "deleted": true
+ }
+ /openai/v1/responses/{response_id}/cancel:
+ post:
+ operationId: cancelResponse
+ summary: Cancel a model response
+ description: Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.
+ parameters:
+ - name: response_id
+ in: path
+ required: true
+ description: The ID of the response to cancel.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ x-agent-session-id:
+ required: false
+ description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Response'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ x-oaiMeta:
+ name: Cancel a response
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/responses/resp_123/cancel \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.cancel("resp_123");
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.responses.cancel(
+ "resp_677efb5139a88190b512bc3fef8e535d",
+ )
+ print(response.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.cancel('resp_677efb5139a88190b512bc3fef8e535d');
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.Cancel(context.TODO(), "resp_677efb5139a88190b512bc3fef8e535d")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().cancel("resp_677efb5139a88190b512bc3fef8e535d");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.cancel("resp_677efb5139a88190b512bc3fef8e535d")
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44",
+ "object": "response",
+ "created_at": 1741386163,
+ "status": "cancelled",
+ "background": true,
+ "completed_at": null,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44",
+ "status": "in_progress",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "Silent circuits hum,
+ Thoughts emerge in data streams—
+ Digital dawn breaks.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ }
+ /openai/v1/responses/{response_id}/input_items:
+ get:
+ operationId: listInputItems
+ summary: List input items for a response
+ description: Retrieves the input items associated with the specified response.
+ parameters:
+ - name: response_id
+ in: path
+ required: true
+ description: The response id path parameter.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ x-agent-session-id:
+ required: false
+ description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ x-oaiMeta:
+ name: List input items
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses/resp_abc123/input_items \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.inputItems.list("resp_123");
+ console.log(response.data);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.responses.input_items.list(
+ response_id="response_id",
+ )
+ page = page.data[0]
+ print(page)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const responseItem of client.responses.inputItems.list('response_id')) {
+ console.log(responseItem);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Responses.InputItems.List(
+ context.TODO(),
+ "response_id",
+ responses.InputItemListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.inputitems.InputItemListPage;
+ import com.openai.models.responses.inputitems.InputItemListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ InputItemListPage page = client.responses().inputItems().list("response_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.responses.input_items.list("response_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "msg_abc123",
+ "type": "message",
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Tell me a three sentence bedtime story about a unicorn."
+ }
+ ]
+ }
+ ],
+ "first_id": "msg_abc123",
+ "last_id": "msg_abc123",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/threads:
+ post:
+ operationId: Threads_createThread
+ summary: Create a thread
+ description: Creates a thread from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ThreadObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create thread
+ group: threads
+ beta: true
+ examples:
+ - title: Empty
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d ''
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.create()
+ print(thread.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const emptyThread = await openai.beta.threads.create();
+
+ console.log(emptyThread);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.create();
+
+ console.log(thread.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.create
+
+ puts(thread)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699012949,
+ "metadata": {},
+ "tool_resources": {}
+ }
+ - title: Messages
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "messages": [{
+ "role": "user",
+ "content": "Hello, what is AI?"
+ }, {
+ "role": "user",
+ "content": "How does AI work? Explain it in simple terms."
+ }]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.create()
+ print(thread.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const messageThread = await openai.beta.threads.create({
+ messages: [
+ {
+ role: "user",
+ content: "Hello, what is AI?"
+ },
+ {
+ role: "user",
+ content: "How does AI work? Explain it in simple terms.",
+ },
+ ],
+ });
+
+ console.log(messageThread);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.create();
+
+ console.log(thread.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.create
+
+ puts(thread)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699014083,
+ "metadata": {},
+ "tool_resources": {}
+ }
+ /openai/v1/threads/runs:
+ post:
+ operationId: Threads_createThreadAndRun
+ summary: Create a thread and run
+ description: Creates a thread and run from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create thread and run
+ group: threads
+ beta: true
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_abc123",
+ "thread": {
+ "messages": [
+ {"role": "user", "content": "Explain deep learning to a 5 year old."}
+ ]
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for thread in client.beta.threads.create_and_run(
+ assistant_id="assistant_id",
+ ):
+ print(thread)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.createAndRun({
+ assistant_id: "asst_abc123",
+ thread: {
+ messages: [
+ { role: "user", content: "Explain deep learning to a 5 year old." },
+ ],
+ },
+ });
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{
+ AssistantID: "assistant_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadCreateAndRunParams;
+ import com.openai.models.beta.threads.runs.Run;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().createAndRun(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.create_and_run(assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699076792,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "queued",
+ "started_at": null,
+ "expires_at": 1699077392,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": null,
+ "required_action": null,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant.",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completion_tokens": null,
+ "max_prompt_tokens": null,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "incomplete_details": null,
+ "usage": null,
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_123",
+ "thread": {
+ "messages": [
+ {"role": "user", "content": "Hello"}
+ ]
+ },
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for thread in client.beta.threads.create_and_run(
+ assistant_id="assistant_id",
+ ):
+ print(thread)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.beta.threads.createAndRun({
+ assistant_id: "asst_123",
+ thread: {
+ messages: [
+ { role: "user", content: "Hello" },
+ ],
+ },
+ stream: true
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{
+ AssistantID: "assistant_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadCreateAndRunParams;
+ import com.openai.models.beta.threads.runs.Run;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().createAndRun(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.create_and_run(assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ event: thread.created
+ data: {"id":"thread_123","object":"thread","created_at":1710348075,"metadata":{}}
+
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[], "metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[], "metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}], "metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}}
+
+ event: thread.run.completed
+ {"id":"run_123","object":"thread.run","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1713226836,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1713226837,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":345,"completion_tokens":11,"total_tokens":356},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: done
+ data: [DONE]
+ - title: Streaming with Functions
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_abc123",
+ "thread": {
+ "messages": [
+ {"role": "user", "content": "What is the weather like in San Francisco?"}
+ ]
+ },
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for thread in client.beta.threads.create_and_run(
+ assistant_id="assistant_id",
+ ):
+ print(thread)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ async function main() {
+ const stream = await openai.beta.threads.createAndRun({
+ assistant_id: "asst_123",
+ thread: {
+ messages: [
+ { role: "user", content: "What is the weather like in San Francisco?" },
+ ],
+ },
+ tools: tools,
+ stream: true
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{
+ AssistantID: "assistant_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadCreateAndRunParams;
+ import com.openai.models.beta.threads.runs.Run;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().createAndRun(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.create_and_run(assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ event: thread.created
+ data: {"id":"thread_123","object":"thread","created_at":1710351818,"metadata":{}}
+
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710351818,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710351819,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710352418,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710351819,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710352418,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"id":"call_XXNp8YGaFrjrSjgqxtC8JJ1B","type":"function","function":{"name":"get_current_weather","arguments":"","output":null}}]}}}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"{""}}]}}}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"location"}}]}}}
+
+ ...
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"ahrenheit"}}]}}}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":""}"}}]}}}
+
+ event: thread.run.requires_action
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"requires_action","started_at":1710351818,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":{"type":"submit_tool_outputs","submit_tool_outputs":{"tool_calls":[{"id":"call_XXNp8YGaFrjrSjgqxtC8JJ1B","type":"function","function":{"name":"get_current_weather","arguments":"{"location":"San Francisco, CA","unit":"fahrenheit"}"}}]}},"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":345,"completion_tokens":11,"total_tokens":356},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+ /openai/v1/threads/{thread_id}:
+ delete:
+ operationId: Threads_deleteThread
+ summary: Delete a thread
+ description: Deletes a thread by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteThreadResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Delete thread
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X DELETE
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread_deleted = client.beta.threads.delete(
+ "thread_id",
+ )
+ print(thread_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const response = await openai.beta.threads.delete("thread_abc123");
+
+ console.log(response);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const threadDeleted = await client.beta.threads.delete('thread_id');
+
+ console.log(threadDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ threadDeleted, err := client.Beta.Threads.Delete(context.TODO(), "thread_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", threadDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadDeleteParams;
+ import com.openai.models.beta.threads.ThreadDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadDeleted threadDeleted = client.beta().threads().delete("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread_deleted = openai.beta.threads.delete("thread_id")
+
+ puts(thread_deleted)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Threads_getThread
+ summary: Get a thread
+ description: Retrieves a thread by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ThreadObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Retrieve thread
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.retrieve(
+ "thread_id",
+ )
+ print(thread.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myThread = await openai.beta.threads.retrieve(
+ "thread_abc123"
+ );
+
+ console.log(myThread);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.retrieve('thread_id');
+
+ console.log(thread.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.Get(context.TODO(), "thread_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().retrieve("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.retrieve("thread_id")
+
+ puts(thread)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699014083,
+ "metadata": {},
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": []
+ }
+ }
+ }
+ post:
+ operationId: Threads_modifyThread
+ summary: Update a thread
+ description: Updates a thread with the supplied changes.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to modify. Only the `metadata` can be modified.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ThreadObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ModifyThreadRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Modify thread
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.update(
+ thread_id="thread_id",
+ )
+ print(thread.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const updatedThread = await openai.beta.threads.update(
+ "thread_abc123",
+ {
+ metadata: { modified: "true", user: "abc123" },
+ }
+ );
+
+ console.log(updatedThread);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.update('thread_id');
+
+ console.log(thread.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.Update(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().update("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.update("thread_id")
+
+ puts(thread)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699014083,
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ },
+ "tool_resources": {}
+ }
+ /openai/v1/threads/{thread_id}/messages:
+ get:
+ operationId: Threads_listMessages
+ summary: List messages
+ description: Lists messages matching the request filters.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) the messages belong to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ - name: run_id
+ in: query
+ required: false
+ description: Filter messages by the run ID that generated them.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListMessagesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: List messages
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/messages \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.threads.messages.list(
+ thread_id="thread_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const threadMessages = await openai.beta.threads.messages.list(
+ "thread_abc123"
+ );
+
+ console.log(threadMessages.data);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const message of client.beta.threads.messages.list('thread_id')) {
+ console.log(message.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Threads.Messages.List(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadMessageListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.MessageListPage;
+ import com.openai.models.beta.threads.messages.MessageListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageListPage page = client.beta().threads().messages().list("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.threads.messages.list("thread_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1699016383,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ },
+ {
+ "id": "msg_abc456",
+ "object": "thread.message",
+ "created_at": 1699016383,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "Hello, what is AI?",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ }
+ ],
+ "first_id": "msg_abc123",
+ "last_id": "msg_abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: Threads_createMessage
+ summary: Create a message
+ description: Creates a message from the supplied request.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) to create a message for.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.MessageObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateMessageRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create message
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/messages \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "role": "user",
+ "content": "How does AI work? Explain it in simple terms."
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message = client.beta.threads.messages.create(
+ thread_id="thread_id",
+ content="string",
+ role="user",
+ )
+ print(message.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const threadMessages = await openai.beta.threads.messages.create(
+ "thread_abc123",
+ { role: "user", content: "How does AI work? Explain it in simple terms." }
+ );
+
+ console.log(threadMessages);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const message = await client.beta.threads.messages.create('thread_id', {
+ content: 'string',
+ role: 'user',
+ });
+
+ console.log(message.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ message, err := client.Beta.Threads.Messages.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadMessageNewParams{
+ Content: openai.BetaThreadMessageNewParamsContentUnion{
+ OfString: openai.String("string"),
+ },
+ Role: openai.BetaThreadMessageNewParamsRoleUser,
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", message.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.Message;
+ import com.openai.models.beta.threads.messages.MessageCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageCreateParams params = MessageCreateParams.builder()
+ .threadId("thread_id")
+ .content("string")
+ .role(MessageCreateParams.Role.USER)
+ .build();
+ Message message = client.beta().threads().messages().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message = openai.beta.threads.messages.create("thread_id", content: "string", role: :user)
+
+ puts(message)
+ response: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1713226573,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ }
+ /openai/v1/threads/{thread_id}/messages/{message_id}:
+ delete:
+ operationId: Threads_deleteMessage
+ summary: Delete a message
+ description: Deletes a message by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to which this message belongs.
+ schema:
+ type: string
+ - name: message_id
+ in: path
+ required: true
+ description: The ID of the message to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteMessageResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Delete message
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message_deleted = client.beta.threads.messages.delete(
+ message_id="message_id",
+ thread_id="thread_id",
+ )
+ print(message_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedMessage = await openai.beta.threads.messages.delete(
+ "msg_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(deletedMessage);
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const messageDeleted = await client.beta.threads.messages.delete('message_id', {
+ thread_id: 'thread_id',
+ });
+
+ console.log(messageDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ messageDeleted, err := client.Beta.Threads.Messages.Delete(
+ context.TODO(),
+ "thread_id",
+ "message_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", messageDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.MessageDeleteParams;
+ import com.openai.models.beta.threads.messages.MessageDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageDeleteParams params = MessageDeleteParams.builder()
+ .threadId("thread_id")
+ .messageId("message_id")
+ .build();
+ MessageDeleted messageDeleted = client.beta().threads().messages().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message_deleted = openai.beta.threads.messages.delete("message_id", thread_id: "thread_id")
+
+ puts(message_deleted)
+ response: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Threads_getMessage
+ summary: Get a message
+ description: Retrieves a message by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) to which this message belongs.
+ schema:
+ type: string
+ - name: message_id
+ in: path
+ required: true
+ description: The ID of the message to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.MessageObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Retrieve message
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message = client.beta.threads.messages.retrieve(
+ message_id="message_id",
+ thread_id="thread_id",
+ )
+ print(message.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const message = await openai.beta.threads.messages.retrieve(
+ "msg_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(message);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const message = await client.beta.threads.messages.retrieve('message_id', {
+ thread_id: 'thread_id',
+ });
+
+ console.log(message.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ message, err := client.Beta.Threads.Messages.Get(
+ context.TODO(),
+ "thread_id",
+ "message_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", message.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.Message;
+ import com.openai.models.beta.threads.messages.MessageRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageRetrieveParams params = MessageRetrieveParams.builder()
+ .threadId("thread_id")
+ .messageId("message_id")
+ .build();
+ Message message = client.beta().threads().messages().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message = openai.beta.threads.messages.retrieve("message_id", thread_id: "thread_id")
+
+ puts(message)
+ response: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1699017614,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ }
+ post:
+ operationId: Threads_modifyMessage
+ summary: Update a message
+ description: Updates a message with the supplied changes.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to which this message belongs.
+ schema:
+ type: string
+ - name: message_id
+ in: path
+ required: true
+ description: The ID of the message to modify.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.MessageObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ModifyMessageRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Modify message
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message = client.beta.threads.messages.update(
+ message_id="message_id",
+ thread_id="thread_id",
+ )
+ print(message.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const message = await openai.beta.threads.messages.update(
+ "thread_abc123",
+ "msg_abc123",
+ {
+ metadata: {
+ modified: "true",
+ user: "abc123",
+ },
+ }
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const message = await client.beta.threads.messages.update('message_id', { thread_id: 'thread_id' });
+
+ console.log(message.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ message, err := client.Beta.Threads.Messages.Update(
+ context.TODO(),
+ "thread_id",
+ "message_id",
+ openai.BetaThreadMessageUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", message.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.Message;
+ import com.openai.models.beta.threads.messages.MessageUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageUpdateParams params = MessageUpdateParams.builder()
+ .threadId("thread_id")
+ .messageId("message_id")
+ .build();
+ Message message = client.beta().threads().messages().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message = openai.beta.threads.messages.update("message_id", thread_id: "thread_id")
+
+ puts(message)
+ response: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1699017614,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "file_ids": [],
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ }
+ }
+ /openai/v1/threads/{thread_id}/runs:
+ get:
+ operationId: Threads_listRuns
+ summary: List runs
+ description: Lists runs matching the request filters.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread the run belongs to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListRunsResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: List runs
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.threads.runs.list(
+ thread_id="thread_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const runs = await openai.beta.threads.runs.list(
+ "thread_abc123"
+ );
+
+ console.log(runs);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const run of client.beta.threads.runs.list('thread_id')) {
+ console.log(run.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Threads.Runs.List(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.RunListPage;
+ import com.openai.models.beta.threads.runs.RunListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunListPage page = client.beta().threads().runs().list("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.threads.runs.list("thread_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699075072,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699075072,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699075073,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": [
+ "file-abc123",
+ "file-abc456"
+ ]
+ }
+ },
+ "metadata": {},
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ },
+ {
+ "id": "run_abc456",
+ "object": "thread.run",
+ "created_at": 1699063290,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699063290,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699063291,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": [
+ "file-abc123",
+ "file-abc456"
+ ]
+ }
+ },
+ "metadata": {},
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ ],
+ "first_id": "run_abc123",
+ "last_id": "run_abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: Threads_createRun
+ summary: Create a run
+ description: Creates a run from the supplied request.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to run.
+ schema:
+ type: string
+ - name: include[]
+ in: query
+ required: false
+ description: |-
+ 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
+ schema:
+ type: array
+ items:
+ type: string
+ enum:
+ - step_details.tool_calls[*].file_search.results[*].content
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateRunRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create run
+ group: threads
+ beta: true
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_abc123"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.create(
+ thread_id="thread_id",
+ assistant_id="assistant_id",
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.create(
+ "thread_abc123",
+ { assistant_id: "asst_abc123" }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunNewParams{
+ AssistantID: "assistant_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .threadId("thread_id")
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().runs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.create("thread_id", assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699063290,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "queued",
+ "started_at": 1699063290,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699063291,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "usage": null,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_123/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_123",
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.create(
+ thread_id="thread_id",
+ assistant_id="assistant_id",
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.beta.threads.runs.create(
+ "thread_123",
+ { assistant_id: "asst_123", stream: true }
+ );
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunNewParams{
+ AssistantID: "assistant_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .threadId("thread_id")
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().runs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.create("thread_id", assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710330641,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710330642,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710330642,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}}
+
+ event: thread.run.completed
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710330641,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710330642,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+ - title: Streaming with Functions
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_abc123",
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.create(
+ thread_id="thread_id",
+ assistant_id="assistant_id",
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ async function main() {
+ const stream = await openai.beta.threads.runs.create(
+ "thread_abc123",
+ {
+ assistant_id: "asst_abc123",
+ tools: tools,
+ stream: true
+ }
+ );
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunNewParams{
+ AssistantID: "assistant_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .threadId("thread_id")
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().runs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.create("thread_id", assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710348075,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}}
+
+ event: thread.run.completed
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710348075,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710348077,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+ /openai/v1/threads/{thread_id}/runs/{run_id}:
+ get:
+ operationId: Threads_getRun
+ summary: Get a run
+ description: Retrieves a run by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) that was run.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Retrieve run
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.beta.threads.runs.retrieve(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.retrieve(
+ "run_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.retrieve('run_id', { thread_id: 'thread_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.Get(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunRetrieveParams params = RunRetrieveParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ Run run = client.beta().threads().runs().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.retrieve("run_id", thread_id: "thread_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699075072,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699075072,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699075073,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ post:
+ operationId: Threads_modifyRun
+ summary: Update a run
+ description: Updates a run with the supplied changes.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) that was run.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run to modify.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ModifyRunRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Modify run
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "metadata": {
+ "user_id": "user_abc123"
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.beta.threads.runs.update(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.update(
+ "run_abc123",
+ {
+ thread_id: "thread_abc123",
+ metadata: {
+ user_id: "user_abc123",
+ },
+ }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.update('run_id', { thread_id: 'thread_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.Update(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunUpdateParams params = RunUpdateParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ Run run = client.beta().threads().runs().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.update("run_id", thread_id: "thread_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699075072,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699075072,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699075073,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": [
+ "file-abc123",
+ "file-abc456"
+ ]
+ }
+ },
+ "metadata": {
+ "user_id": "user_abc123"
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ /openai/v1/threads/{thread_id}/runs/{run_id}/cancel:
+ post:
+ operationId: Threads_cancelRun
+ summary: Cancel a run
+ description: Cancels a run by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to which this run belongs.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run to cancel.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Cancel a run
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X POST
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.beta.threads.runs.cancel(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.cancel(
+ "run_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.cancel('run_id', { thread_id: 'thread_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.Cancel(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCancelParams params = RunCancelParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ Run run = client.beta().threads().runs().cancel(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.cancel("run_id", thread_id: "thread_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699076126,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "cancelling",
+ "started_at": 1699076126,
+ "expires_at": 1699076726,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": null,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": "You summarize books.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "tool_resources": {
+ "file_search": {
+ "vector_store_ids": ["vs_123"]
+ }
+ },
+ "metadata": {},
+ "usage": null,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ /openai/v1/threads/{thread_id}/runs/{run_id}/steps:
+ get:
+ operationId: Threads_listRunSteps
+ summary: List run steps
+ description: Lists run steps matching the request filters.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread the run and run steps belong to.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run the run steps belong to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ - name: include[]
+ in: query
+ required: false
+ description: |-
+ 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
+ schema:
+ type: array
+ items:
+ type: string
+ enum:
+ - step_details.tool_calls[*].file_search.results[*].content
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListRunStepsResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: List run steps
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.threads.runs.steps.list(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const runStep = await openai.beta.threads.runs.steps.list(
+ "run_abc123",
+ { thread_id: "thread_abc123" }
+ );
+ console.log(runStep);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const runStep of client.beta.threads.runs.steps.list('run_id', {
+ thread_id: 'thread_id',
+ })) {
+ console.log(runStep.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Threads.Runs.Steps.List(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunStepListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.steps.StepListPage;
+ import com.openai.models.beta.threads.runs.steps.StepListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ StepListParams params = StepListParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ StepListPage page = client.beta().threads().runs().steps().list(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.threads.runs.steps.list("run_id", thread_id: "thread_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "step_abc123",
+ "object": "thread.run.step",
+ "created_at": 1699063291,
+ "run_id": "run_abc123",
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "type": "message_creation",
+ "status": "completed",
+ "cancelled_at": null,
+ "completed_at": 1699063291,
+ "expired_at": null,
+ "failed_at": null,
+ "last_error": null,
+ "step_details": {
+ "type": "message_creation",
+ "message_creation": {
+ "message_id": "msg_abc123"
+ }
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ }
+ }
+ ],
+ "first_id": "step_abc123",
+ "last_id": "step_abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}:
+ get:
+ operationId: Threads_getRunStep
+ summary: Get a run step
+ description: Retrieves a run step by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to which the run and run step belongs.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run to which the run step belongs.
+ schema:
+ type: string
+ - name: step_id
+ in: path
+ required: true
+ description: The ID of the run step to retrieve.
+ schema:
+ type: string
+ - name: include[]
+ in: query
+ required: false
+ description: |-
+ 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
+ schema:
+ type: array
+ items:
+ type: string
+ enum:
+ - step_details.tool_calls[*].file_search.results[*].content
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunStepObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Retrieve run step
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run_step = client.beta.threads.runs.steps.retrieve(
+ step_id="step_id",
+ thread_id="thread_id",
+ run_id="run_id",
+ )
+ print(run_step.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const runStep = await openai.beta.threads.runs.steps.retrieve(
+ "step_abc123",
+ { thread_id: "thread_abc123", run_id: "run_abc123" }
+ );
+ console.log(runStep);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const runStep = await client.beta.threads.runs.steps.retrieve('step_id', {
+ thread_id: 'thread_id',
+ run_id: 'run_id',
+ });
+
+ console.log(runStep.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ runStep, err := client.Beta.Threads.Runs.Steps.Get(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ "step_id",
+ openai.BetaThreadRunStepGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", runStep.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.steps.RunStep;
+ import com.openai.models.beta.threads.runs.steps.StepRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ StepRetrieveParams params = StepRetrieveParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .stepId("step_id")
+ .build();
+ RunStep runStep = client.beta().threads().runs().steps().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run_step = openai.beta.threads.runs.steps.retrieve("step_id", thread_id: "thread_id", run_id: "run_id")
+
+ puts(run_step)
+ response: |
+ {
+ "id": "step_abc123",
+ "object": "thread.run.step",
+ "created_at": 1699063291,
+ "run_id": "run_abc123",
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "type": "message_creation",
+ "status": "completed",
+ "cancelled_at": null,
+ "completed_at": 1699063291,
+ "expired_at": null,
+ "failed_at": null,
+ "last_error": null,
+ "step_details": {
+ "type": "message_creation",
+ "message_creation": {
+ "message_id": "msg_abc123"
+ }
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ }
+ }
+ /openai/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs:
+ post:
+ operationId: Threads_submitToolOuputsToRun
+ summary: Create a tool ouputs to run
+ description: Creates a tool ouputs to run from the supplied request.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) to which this run belongs.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run that requires the tool output submission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.SubmitToolOutputsRunRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Submit tool outputs to run
+ group: threads
+ beta: true
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "tool_outputs": [
+ {
+ "tool_call_id": "call_001",
+ "output": "70 degrees and sunny."
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.submit_tool_outputs(
+ run_id="run_id",
+ thread_id="thread_id",
+ tool_outputs=[{}],
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.submitToolOutputs(
+ "run_123",
+ {
+ thread_id: "thread_123",
+ tool_outputs: [
+ {
+ tool_call_id: "call_001",
+ output: "70 degrees and sunny.",
+ },
+ ],
+ }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.submitToolOutputs('run_id', {
+ thread_id: 'thread_id',
+ tool_outputs: [{}],
+ });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.SubmitToolOutputs(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunSubmitToolOutputsParams{
+ ToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())
+ .build();
+ Run run = client.beta().threads().runs().submitToolOutputs(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.submit_tool_outputs("run_id", thread_id: "thread_id", tool_outputs: [{}])
+
+ puts(run)
+ response: |
+ {
+ "id": "run_123",
+ "object": "thread.run",
+ "created_at": 1699075592,
+ "assistant_id": "asst_123",
+ "thread_id": "thread_123",
+ "status": "queued",
+ "started_at": 1699075592,
+ "expires_at": 1699076192,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": null,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "metadata": {},
+ "usage": null,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "tool_outputs": [
+ {
+ "tool_call_id": "call_001",
+ "output": "70 degrees and sunny."
+ }
+ ],
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.submit_tool_outputs(
+ run_id="run_id",
+ thread_id="thread_id",
+ tool_outputs=[{}],
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.beta.threads.runs.submitToolOutputs(
+ "run_123",
+ {
+ thread_id: "thread_123",
+ tool_outputs: [
+ {
+ tool_call_id: "call_001",
+ output: "70 degrees and sunny.",
+ },
+ ],
+ }
+ );
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.submitToolOutputs('run_id', {
+ thread_id: 'thread_id',
+ tool_outputs: [{}],
+ });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.SubmitToolOutputs(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunSubmitToolOutputsParams{
+ ToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())
+ .build();
+ Run run = client.beta().threads().runs().submitToolOutputs(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.submit_tool_outputs("run_id", thread_id: "thread_id", tool_outputs: [{}])
+
+ puts(run)
+ response: |
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710352449,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"completed","cancelled_at":null,"completed_at":1710352475,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[{"id":"call_iWr0kQ2EaYMaxNdl0v3KYkx7","type":"function","function":{"name":"get_current_weather","arguments":"{"location":"San Francisco, CA","unit":"fahrenheit"}","output":"70 degrees and sunny."}}]},"usage":{"prompt_tokens":291,"completion_tokens":24,"total_tokens":315}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":1710352448,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710352475,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"The","annotations":[]}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" current"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" weather"}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" sunny"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"."}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710352477,"role":"assistant","content":[{"type":"text","text":{"value":"The current weather in San Francisco, CA is 70 degrees Fahrenheit and sunny.","annotations":[]}}],"metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710352477,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":{"prompt_tokens":329,"completion_tokens":18,"total_tokens":347}}
+
+ event: thread.run.completed
+ data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710352475,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710352477,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+ /openai/v1/uploads:
+ post:
+ operationId: Uploads_createUpload
+ summary: Create an upload
+ description: Creates an upload from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Upload'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Uploads
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateUploadRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create upload
+ group: uploads
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/uploads \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "purpose": "fine-tune",
+ "filename": "training_examples.jsonl",
+ "bytes": 2147483648,
+ "mime_type": "text/jsonl",
+ "expires_after": {
+ "anchor": "created_at",
+ "seconds": 3600
+ }
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const upload = await client.uploads.create({
+ bytes: 0,
+ filename: 'filename',
+ mime_type: 'mime_type',
+ purpose: 'assistants',
+ });
+
+ console.log(upload.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload = client.uploads.create(
+ bytes=0,
+ filename="filename",
+ mime_type="mime_type",
+ purpose="assistants",
+ )
+ print(upload.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ upload, err := client.Uploads.New(context.TODO(), openai.UploadNewParams{
+ Bytes: 0,
+ Filename: "filename",
+ MimeType: "mime_type",
+ Purpose: openai.FilePurposeAssistants,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", upload.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FilePurpose;
+ import com.openai.models.uploads.Upload;
+ import com.openai.models.uploads.UploadCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ UploadCreateParams params = UploadCreateParams.builder()
+ .bytes(0L)
+ .filename("filename")
+ .mimeType("mime_type")
+ .purpose(FilePurpose.ASSISTANTS)
+ .build();
+ Upload upload = client.uploads().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload = openai.uploads.create(bytes: 0, filename: "filename", mime_type: "mime_type", purpose: :assistants)
+
+ puts(upload)
+ response: |
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "pending",
+ "expires_at": 1719127296
+ }
+ /openai/v1/uploads/{upload_id}/cancel:
+ post:
+ operationId: Uploads_cancelUpload
+ summary: Cancel an upload
+ description: Cancels an upload by its identifier.
+ parameters:
+ - name: upload_id
+ in: path
+ required: true
+ description: The ID of the Upload.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Upload'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Uploads
+ x-oaiMeta:
+ name: Cancel upload
+ group: uploads
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/uploads/upload_abc123/cancel
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const upload = await client.uploads.cancel('upload_abc123');
+
+ console.log(upload.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload = client.uploads.cancel(
+ "upload_abc123",
+ )
+ print(upload.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ upload, err := client.Uploads.Cancel(context.TODO(), "upload_abc123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", upload.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.uploads.Upload;
+ import com.openai.models.uploads.UploadCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Upload upload = client.uploads().cancel("upload_abc123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload = openai.uploads.cancel("upload_abc123")
+
+ puts(upload)
+ response: |
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "cancelled",
+ "expires_at": 1719127296
+ }
+ /openai/v1/uploads/{upload_id}/complete:
+ post:
+ operationId: Uploads_completeUpload
+ summary: Create an upload
+ description: Creates an upload from the supplied request.
+ parameters:
+ - name: upload_id
+ in: path
+ required: true
+ description: The ID of the Upload.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Upload'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Uploads
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CompleteUploadRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Complete upload
+ group: uploads
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/uploads/upload_abc123/complete
+ -d '{
+ "part_ids": ["part_def456", "part_ghi789"]
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const upload = await client.uploads.complete('upload_abc123', { part_ids: ['string'] });
+
+ console.log(upload.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload = client.uploads.complete(
+ upload_id="upload_abc123",
+ part_ids=["string"],
+ )
+ print(upload.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ upload, err := client.Uploads.Complete(
+ context.TODO(),
+ "upload_abc123",
+ openai.UploadCompleteParams{
+ PartIDs: []string{"string"},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", upload.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.uploads.Upload;
+ import com.openai.models.uploads.UploadCompleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ UploadCompleteParams params = UploadCompleteParams.builder()
+ .uploadId("upload_abc123")
+ .addPartId("string")
+ .build();
+ Upload upload = client.uploads().complete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload = openai.uploads.complete("upload_abc123", part_ids: ["string"])
+
+ puts(upload)
+ response: |
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "completed",
+ "expires_at": 1719127296,
+ "file": {
+ "id": "file-xyz321",
+ "object": "file",
+ "bytes": 2147483648,
+ "created_at": 1719186911,
+ "expires_at": 1719127296,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ }
+ }
+ /openai/v1/uploads/{upload_id}/parts:
+ post:
+ operationId: Uploads_addUploadPart
+ summary: Add an upload part
+ description: Adds an upload part to the parent resource.
+ parameters:
+ - name: upload_id
+ in: path
+ required: true
+ description: The ID of the Upload.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.UploadPart'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Uploads
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.AddUploadPartRequest'
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Add upload part
+ group: uploads
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/uploads/upload_abc123/parts
+ -F data="aHR0cHM6Ly9hcGkub3BlbmFpLmNvbS92MS91cGxvYWRz..."
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const uploadPart = await client.uploads.parts.create('upload_abc123', {
+ data: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(uploadPart.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload_part = client.uploads.parts.create(
+ upload_id="upload_abc123",
+ data=b"Example data",
+ )
+ print(upload_part.id)
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ uploadPart, err := client.Uploads.Parts.New(
+ context.TODO(),
+ "upload_abc123",
+ openai.UploadPartNewParams{
+ Data: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", uploadPart.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.uploads.parts.PartCreateParams;
+ import com.openai.models.uploads.parts.UploadPart;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PartCreateParams params = PartCreateParams.builder()
+ .uploadId("upload_abc123")
+ .data(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ UploadPart uploadPart = client.uploads().parts().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload_part = openai.uploads.parts.create("upload_abc123", data: StringIO.new("Example data"))
+
+ puts(upload_part)
+ response: |
+ {
+ "id": "part_def456",
+ "object": "upload.part",
+ "created_at": 1719185911,
+ "upload_id": "upload_abc123"
+ }
+ /openai/v1/vector_stores:
+ get:
+ operationId: VectorStores_listVectorStores
+ summary: List vector stores
+ description: Lists vector stores matching the request filters.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoresResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: List vector stores
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStores = await openai.vectorStores.list();
+ console.log(vectorStores);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStore of client.vectorStores.list()) {
+ console.log(vectorStore.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.List(context.TODO(), openai.VectorStoreListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStoreListPage;
+ import com.openai.models.vectorstores.VectorStoreListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreListPage page = client.vectorStores().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ",
+ "description": "Contains commonly asked questions and answers, organized by topic.",
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ },
+ {
+ "id": "vs_abc456",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ v2",
+ "description": null,
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ }
+ ],
+ "first_id": "vs_abc123",
+ "last_id": "vs_abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: VectorStores_createVectorStore
+ summary: Create a vector store
+ description: Creates a vector store from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVectorStoreRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "name": "Support FAQ"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store = client.vector_stores.create()
+ print(vector_store.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStore = await openai.vectorStores.create({
+ name: "Support FAQ"
+ });
+ console.log(vectorStore);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStore = await client.vectorStores.create();
+
+ console.log(vectorStore.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStore, err := client.VectorStores.New(context.TODO(), openai.VectorStoreNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStore.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStore;
+ import com.openai.models.vectorstores.VectorStoreCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStore vectorStore = client.vectorStores().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store = openai.vector_stores.create
+
+ puts(vector_store)
+ response: |
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ",
+ "description": "Contains commonly asked questions and answers, organized by topic.",
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}:
+ delete:
+ operationId: VectorStores_deleteVectorStore
+ summary: Delete a vector store
+ description: Deletes a vector store by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteVectorStoreResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Delete vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X DELETE
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_deleted = client.vector_stores.delete(
+ "vector_store_id",
+ )
+ print(vector_store_deleted.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedVectorStore = await openai.vectorStores.delete(
+ "vs_abc123"
+ );
+ console.log(deletedVectorStore);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreDeleted = await client.vectorStores.delete('vector_store_id');
+
+ console.log(vectorStoreDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreDeleted, err := client.VectorStores.Delete(context.TODO(), "vector_store_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStoreDeleteParams;
+ import com.openai.models.vectorstores.VectorStoreDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreDeleted vectorStoreDeleted = client.vectorStores().delete("vector_store_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_deleted = openai.vector_stores.delete("vector_store_id")
+
+ puts(vector_store_deleted)
+ response: |
+ {
+ id: "vs_abc123",
+ object: "vector_store.deleted",
+ deleted: true
+ }
+ get:
+ operationId: VectorStores_getVectorStore
+ summary: Get a vector store
+ description: Retrieves a vector store by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Retrieve vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store = client.vector_stores.retrieve(
+ "vector_store_id",
+ )
+ print(vector_store.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStore = await openai.vectorStores.retrieve(
+ "vs_abc123"
+ );
+ console.log(vectorStore);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStore = await client.vectorStores.retrieve('vector_store_id');
+
+ console.log(vectorStore.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStore, err := client.VectorStores.Get(context.TODO(), "vector_store_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStore.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStore;
+ import com.openai.models.vectorstores.VectorStoreRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStore vectorStore = client.vectorStores().retrieve("vector_store_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store = openai.vector_stores.retrieve("vector_store_id")
+
+ puts(vector_store)
+ response: |
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776
+ }
+ post:
+ operationId: VectorStores_modifyVectorStore
+ summary: Update a vector store
+ description: Updates a vector store with the supplied changes.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store to modify.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.UpdateVectorStoreRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Modify vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ -d '{
+ "name": "Support FAQ"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store = client.vector_stores.update(
+ vector_store_id="vector_store_id",
+ )
+ print(vector_store.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStore = await openai.vectorStores.update(
+ "vs_abc123",
+ {
+ name: "Support FAQ"
+ }
+ );
+ console.log(vectorStore);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStore = await client.vectorStores.update('vector_store_id');
+
+ console.log(vectorStore.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStore, err := client.VectorStores.Update(
+ context.TODO(),
+ "vector_store_id",
+ openai.VectorStoreUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStore.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStore;
+ import com.openai.models.vectorstores.VectorStoreUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStore vectorStore = client.vectorStores().update("vector_store_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store = openai.vector_stores.update("vector_store_id")
+
+ puts(vector_store)
+ response: |
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ",
+ "description": "Contains commonly asked questions and answers, organized by topic.",
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}/file_batches:
+ post:
+ operationId: VectorStores_createVectorStoreFileBatch
+ summary: Create a vector store file batch
+ description: Creates a vector store file batch from the supplied request.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store for which to create a File Batch.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileBatchRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create vector store file batch
+ group: vector_stores
+ description: |
+ Attaches multiple files to a vector store in one request. This is the recommended approach for multi-file ingestion, especially because per-vector-store file attach writes are rate-limited (300 requests/minute shared with `/vector_stores/{vector_store_id}/files`).
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "files": [
+ {
+ "file_id": "file-abc123",
+ "attributes": {"category": "finance"}
+ },
+ {
+ "file_id": "file-abc456",
+ "chunking_strategy": {
+ "type": "static",
+ "max_chunk_size_tokens": 1200,
+ "chunk_overlap_tokens": 200
+ }
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_batch = client.vector_stores.file_batches.create(
+ vector_store_id="vs_abc123",
+ )
+ print(vector_store_file_batch.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const myVectorStoreFileBatch = await openai.vectorStores.fileBatches.create(
+ "vs_abc123",
+ {
+ files: [
+ {
+ file_id: "file-abc123",
+ attributes: { category: "finance" },
+ },
+ {
+ file_id: "file-abc456",
+ chunking_strategy: {
+ type: "static",
+ max_chunk_size_tokens: 1200,
+ chunk_overlap_tokens: 200,
+ },
+ },
+ ]
+ }
+ );
+ console.log(myVectorStoreFileBatch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileBatch = await client.vectorStores.fileBatches.create('vs_abc123');
+
+ console.log(vectorStoreFileBatch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileBatch, err := client.VectorStores.FileBatches.New(
+ context.TODO(),
+ "vs_abc123",
+ openai.VectorStoreFileBatchNewParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileBatch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchCreateParams;
+ import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().create("vs_abc123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_batch = openai.vector_stores.file_batches.create("vs_abc123")
+
+ puts(vector_store_file_batch)
+ response: |
+ {
+ "id": "vsfb_abc123",
+ "object": "vector_store.file_batch",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123",
+ "status": "in_progress",
+ "file_counts": {
+ "in_progress": 1,
+ "completed": 1,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 0,
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}:
+ get:
+ operationId: VectorStores_getVectorStoreFileBatch
+ summary: Get a vector store file batch
+ description: Retrieves a vector store file batch by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the file batch belongs to.
+ schema:
+ type: string
+ - name: batch_id
+ in: path
+ required: true
+ description: The ID of the file batch being retrieved.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Retrieve vector store file batch
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches/vsfb_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_batch = client.vector_stores.file_batches.retrieve(
+ batch_id="vsfb_abc123",
+ vector_store_id="vs_abc123",
+ )
+ print(vector_store_file_batch.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFileBatch = await openai.vectorStores.fileBatches.retrieve(
+ "vsfb_abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(vectorStoreFileBatch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileBatch = await client.vectorStores.fileBatches.retrieve('vsfb_abc123', {
+ vector_store_id: 'vs_abc123',
+ });
+
+ console.log(vectorStoreFileBatch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileBatch, err := client.VectorStores.FileBatches.Get(
+ context.TODO(),
+ "vs_abc123",
+ "vsfb_abc123",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileBatch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchRetrieveParams;
+ import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileBatchRetrieveParams params = FileBatchRetrieveParams.builder()
+ .vectorStoreId("vs_abc123")
+ .batchId("vsfb_abc123")
+ .build();
+ VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_batch = openai.vector_stores.file_batches.retrieve("vsfb_abc123", vector_store_id: "vs_abc123")
+
+ puts(vector_store_file_batch)
+ response: |
+ {
+ "id": "vsfb_abc123",
+ "object": "vector_store.file_batch",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123",
+ "status": "in_progress",
+ "file_counts": {
+ "in_progress": 1,
+ "completed": 1,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 0,
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel:
+ post:
+ operationId: VectorStores_cancelVectorStoreFileBatch
+ summary: Cancel a vector store file batch
+ description: Cancels a vector store file batch by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the file batch belongs to.
+ schema:
+ type: string
+ - name: batch_id
+ in: path
+ required: true
+ description: The ID of the file batch to cancel.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Cancel vector store file batch
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/cancel \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X POST
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_batch = client.vector_stores.file_batches.cancel(
+ batch_id="batch_id",
+ vector_store_id="vector_store_id",
+ )
+ print(vector_store_file_batch.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedVectorStoreFileBatch = await openai.vectorStores.fileBatches.cancel(
+ "vsfb_abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(deletedVectorStoreFileBatch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileBatch = await client.vectorStores.fileBatches.cancel('batch_id', {
+ vector_store_id: 'vector_store_id',
+ });
+
+ console.log(vectorStoreFileBatch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileBatch, err := client.VectorStores.FileBatches.Cancel(
+ context.TODO(),
+ "vector_store_id",
+ "batch_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileBatch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchCancelParams;
+ import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileBatchCancelParams params = FileBatchCancelParams.builder()
+ .vectorStoreId("vector_store_id")
+ .batchId("batch_id")
+ .build();
+ VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().cancel(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_batch = openai.vector_stores.file_batches.cancel("batch_id", vector_store_id: "vector_store_id")
+
+ puts(vector_store_file_batch)
+ response: |
+ {
+ "id": "vsfb_abc123",
+ "object": "vector_store.file_batch",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123",
+ "status": "in_progress",
+ "file_counts": {
+ "in_progress": 12,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 15,
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files:
+ get:
+ operationId: VectorStores_listFilesInVectorStoreBatch
+ summary: List files in vector store batch
+ description: Lists files in vector store batch matching the request filters.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the files belong to.
+ schema:
+ type: string
+ - name: batch_id
+ in: path
+ required: true
+ description: The ID of the file batch that the files belong to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ - name: filter
+ in: query
+ required: false
+ description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesFilter'
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: List vector store files in a batch
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.file_batches.list_files(
+ batch_id="batch_id",
+ vector_store_id="vector_store_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFiles = await openai.vectorStores.fileBatches.listFiles(
+ "vsfb_abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(vectorStoreFiles);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStoreFile of client.vectorStores.fileBatches.listFiles('batch_id', {
+ vector_store_id: 'vector_store_id',
+ })) {
+ console.log(vectorStoreFile.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.FileBatches.ListFiles(
+ context.TODO(),
+ "vector_store_id",
+ "batch_id",
+ openai.VectorStoreFileBatchListFilesParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchListFilesPage;
+ import com.openai.models.vectorstores.filebatches.FileBatchListFilesParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileBatchListFilesParams params = FileBatchListFilesParams.builder()
+ .vectorStoreId("vector_store_id")
+ .batchId("batch_id")
+ .build();
+ FileBatchListFilesPage page = client.vectorStores().fileBatches().listFiles(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.file_batches.list_files("batch_id", vector_store_id: "vector_store_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ },
+ {
+ "id": "file-abc456",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ }
+ ],
+ "first_id": "file-abc123",
+ "last_id": "file-abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/vector_stores/{vector_store_id}/files:
+ get:
+ operationId: VectorStores_listVectorStoreFiles
+ summary: List vector store files
+ description: Lists vector store files matching the request filters.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the files belong to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ - name: filter
+ in: query
+ required: false
+ description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesFilter'
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: List vector store files
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.files.list(
+ vector_store_id="vector_store_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFiles = await openai.vectorStores.files.list(
+ "vs_abc123"
+ );
+ console.log(vectorStoreFiles);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStoreFile of client.vectorStores.files.list('vector_store_id')) {
+ console.log(vectorStoreFile.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.Files.List(
+ context.TODO(),
+ "vector_store_id",
+ openai.VectorStoreFileListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileListPage;
+ import com.openai.models.vectorstores.files.FileListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileListPage page = client.vectorStores().files().list("vector_store_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.files.list("vector_store_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ },
+ {
+ "id": "file-abc456",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ }
+ ],
+ "first_id": "file-abc123",
+ "last_id": "file-abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: VectorStores_createVectorStoreFile
+ summary: Create a vector store file
+ description: Creates a vector store file from the supplied request.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store for which to create a File.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create vector store file
+ group: vector_stores
+ description: |
+ Attaches one file to a vector store. File attach writes are rate-limited per vector store (300 requests/minute shared with `/vector_stores/{vector_store_id}/file_batches`), so use file batches when uploading multiple files.
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "file_id": "file-abc123"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file = client.vector_stores.files.create(
+ vector_store_id="vs_abc123",
+ file_id="file_id",
+ )
+ print(vector_store_file.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const myVectorStoreFile = await openai.vectorStores.files.create(
+ "vs_abc123",
+ {
+ file_id: "file-abc123"
+ }
+ );
+ console.log(myVectorStoreFile);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFile = await client.vectorStores.files.create('vs_abc123', { file_id: 'file_id' });
+
+ console.log(vectorStoreFile.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFile, err := client.VectorStores.Files.New(
+ context.TODO(),
+ "vs_abc123",
+ openai.VectorStoreFileNewParams{
+ FileID: "file_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFile.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileCreateParams;
+ import com.openai.models.vectorstores.files.VectorStoreFile;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateParams params = FileCreateParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file_id")
+ .build();
+ VectorStoreFile vectorStoreFile = client.vectorStores().files().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file = openai.vector_stores.files.create("vs_abc123", file_id: "file_id")
+
+ puts(vector_store_file)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "usage_bytes": 1234,
+ "vector_store_id": "vs_abcd",
+ "status": "completed",
+ "last_error": null
+ }
+ /openai/v1/vector_stores/{vector_store_id}/files/{file_id}:
+ delete:
+ operationId: VectorStores_deleteVectorStoreFile
+ summary: Delete a vector store file
+ description: Deletes a vector store file by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the file belongs to.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteVectorStoreFileResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Delete vector store file
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X DELETE
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_deleted = client.vector_stores.files.delete(
+ file_id="file_id",
+ vector_store_id="vector_store_id",
+ )
+ print(vector_store_file_deleted.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedVectorStoreFile = await openai.vectorStores.files.delete(
+ "file-abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(deletedVectorStoreFile);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileDeleted = await client.vectorStores.files.delete('file_id', {
+ vector_store_id: 'vector_store_id',
+ });
+
+ console.log(vectorStoreFileDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileDeleted, err := client.VectorStores.Files.Delete(
+ context.TODO(),
+ "vector_store_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileDeleteParams;
+ import com.openai.models.vectorstores.files.VectorStoreFileDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileDeleteParams params = FileDeleteParams.builder()
+ .vectorStoreId("vector_store_id")
+ .fileId("file_id")
+ .build();
+ VectorStoreFileDeleted vectorStoreFileDeleted = client.vectorStores().files().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_deleted = openai.vector_stores.files.delete("file_id", vector_store_id: "vector_store_id")
+
+ puts(vector_store_file_deleted)
+ response: |
+ {
+ id: "file-abc123",
+ object: "vector_store.file.deleted",
+ deleted: true
+ }
+ get:
+ operationId: VectorStores_getVectorStoreFile
+ summary: Get a vector store file
+ description: Retrieves a vector store file by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the file belongs to.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file being retrieved.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Retrieve vector store file
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file = client.vector_stores.files.retrieve(
+ file_id="file-abc123",
+ vector_store_id="vs_abc123",
+ )
+ print(vector_store_file.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFile = await openai.vectorStores.files.retrieve(
+ "file-abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(vectorStoreFile);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFile = await client.vectorStores.files.retrieve('file-abc123', {
+ vector_store_id: 'vs_abc123',
+ });
+
+ console.log(vectorStoreFile.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFile, err := client.VectorStores.Files.Get(
+ context.TODO(),
+ "vs_abc123",
+ "file-abc123",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFile.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileRetrieveParams;
+ import com.openai.models.vectorstores.files.VectorStoreFile;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileRetrieveParams params = FileRetrieveParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file-abc123")
+ .build();
+ VectorStoreFile vectorStoreFile = client.vectorStores().files().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file = openai.vector_stores.files.retrieve("file-abc123", vector_store_id: "vs_abc123")
+
+ puts(vector_store_file)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abcd",
+ "status": "completed",
+ "last_error": null
+ }
+ post:
+ operationId: VectorStores_updateVectorStoreFileAttributes
+ summary: Update vector store file attributes
+ description: Updates vector store file attributes with the supplied changes.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store the file belongs to.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file to update attributes.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.UpdateVectorStoreFileAttributesRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Update vector store file attributes
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id} \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"attributes": {"key1": "value1", "key2": 2}}'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFile = await client.vectorStores.files.update('file-abc123', {
+ vector_store_id: 'vs_abc123',
+ attributes: { foo: 'string' },
+ });
+
+ console.log(vectorStoreFile.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file = client.vector_stores.files.update(
+ file_id="file-abc123",
+ vector_store_id="vs_abc123",
+ attributes={
+ "foo": "string"
+ },
+ )
+ print(vector_store_file.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFile, err := client.VectorStores.Files.Update(
+ context.TODO(),
+ "vs_abc123",
+ "file-abc123",
+ openai.VectorStoreFileUpdateParams{
+ Attributes: map[string]openai.VectorStoreFileUpdateParamsAttributeUnion{
+ "foo": {
+ OfString: openai.String("string"),
+ },
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFile.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.vectorstores.files.FileUpdateParams;
+ import com.openai.models.vectorstores.files.VectorStoreFile;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileUpdateParams params = FileUpdateParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file-abc123")
+ .attributes(FileUpdateParams.Attributes.builder()
+ .putAdditionalProperty("foo", JsonValue.from("string"))
+ .build())
+ .build();
+ VectorStoreFile vectorStoreFile = client.vectorStores().files().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file = openai.vector_stores.files.update(
+ "file-abc123",
+ vector_store_id: "vs_abc123",
+ attributes: {foo: "string"}
+ )
+
+ puts(vector_store_file)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "usage_bytes": 1234,
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abcd",
+ "status": "completed",
+ "last_error": null,
+ "chunking_strategy": {...},
+ "attributes": {"key1": "value1", "key2": 2}
+ }
+ /openai/v1/vector_stores/{vector_store_id}/files/{file_id}/content:
+ get:
+ operationId: VectorStores_retrieveVectorStoreFileContent
+ summary: Get a vector store file content
+ description: Retrieves a vector store file content by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file within the vector store.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileContentResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Retrieve vector store file content
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl \
+ https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123/content \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fileContentResponse of client.vectorStores.files.content('file-abc123', {
+ vector_store_id: 'vs_abc123',
+ })) {
+ console.log(fileContentResponse.text);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.files.content(
+ file_id="file-abc123",
+ vector_store_id="vs_abc123",
+ )
+ page = page.data[0]
+ print(page.text)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.Files.Content(
+ context.TODO(),
+ "vs_abc123",
+ "file-abc123",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileContentPage;
+ import com.openai.models.vectorstores.files.FileContentParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileContentParams params = FileContentParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file-abc123")
+ .build();
+ FileContentPage page = client.vectorStores().files().content(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.files.content("file-abc123", vector_store_id: "vs_abc123")
+
+ puts(page)
+ response: |
+ {
+ "file_id": "file-abc123",
+ "filename": "example.txt",
+ "attributes": {"key": "value"},
+ "content": [
+ {"type": "text", "text": "..."},
+ ...
+ ]
+ }
+ /openai/v1/vector_stores/{vector_store_id}/search:
+ post:
+ operationId: VectorStores_searchVectorStore
+ summary: Search a vector store
+ description: Searchs a vector store.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store to search.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultsPage'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Search vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl -X POST \
+ https://api.openai.com/v1/vector_stores/vs_abc123/search \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"query": "What is the return policy?", "filters": {...}}'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStoreSearchResponse of client.vectorStores.search('vs_abc123', {
+ query: 'string',
+ })) {
+ console.log(vectorStoreSearchResponse.file_id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.search(
+ vector_store_id="vs_abc123",
+ query="string",
+ )
+ page = page.data[0]
+ print(page.file_id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.Search(
+ context.TODO(),
+ "vs_abc123",
+ openai.VectorStoreSearchParams{
+ Query: openai.VectorStoreSearchParamsQueryUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStoreSearchPage;
+ import com.openai.models.vectorstores.VectorStoreSearchParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreSearchParams params = VectorStoreSearchParams.builder()
+ .vectorStoreId("vs_abc123")
+ .query("string")
+ .build();
+ VectorStoreSearchPage page = client.vectorStores().search(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.search("vs_abc123", query: "string")
+
+ puts(page)
+ response: |
+ {
+ "object": "vector_store.search_results.page",
+ "search_query": "What is the return policy?",
+ "data": [
+ {
+ "file_id": "file_123",
+ "filename": "document.pdf",
+ "score": 0.95,
+ "attributes": {
+ "author": "John Doe",
+ "date": "2023-01-01"
+ },
+ "content": [
+ {
+ "type": "text",
+ "text": "Relevant chunk"
+ }
+ ]
+ },
+ {
+ "file_id": "file_456",
+ "filename": "notes.txt",
+ "score": 0.89,
+ "attributes": {
+ "author": "Jane Smith",
+ "date": "2023-01-02"
+ },
+ "content": [
+ {
+ "type": "text",
+ "text": "Sample text content from the vector store."
+ }
+ ]
+ }
+ ],
+ "has_more": false,
+ "next_page": null
+ }
+ /openai/v1/videos:
+ get:
+ operationId: VideoGeneration_listVideos
+ summary: List videos
+ description: Lists videos matching the request filters.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: Number of items to retrieve
+ schema:
+ $ref: '#/components/schemas/integer'
+ minimum: 0
+ maximum: 100
+ - name: order
+ in: query
+ required: false
+ description: Sort order of results by timestamp. Use `asc` for ascending order or `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ - name: after
+ in: query
+ required: false
+ description: Identifier for the last item from the previous pagination request
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoListResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ name: List videos
+ group: videos
+ path: list for the organization.
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/videos \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from 'openai';
+
+ const openai = new OpenAI();
+
+ // Automatically fetches more pages as needed.
+ for await (const video of openai.videos.list()) {
+ console.log(video.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.videos.list()
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Videos.List(context.TODO(), openai.VideoListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.videos.list
+
+ puts(page)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoListPage;
+ import com.openai.models.videos.VideoListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoListPage page = client.videos().list();
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const video of client.videos.list()) {
+ console.log(video.id);
+ }
+ response: |
+ {
+ "data": [
+ {
+ "id": "video_123",
+ "object": "video",
+ "model": "sora-2",
+ "status": "completed"
+ }
+ ],
+ "object": "list"
+ }
+ x-ms-list: true
+ post:
+ operationId: VideoGeneration_createVideo
+ summary: Create a video
+ description: Creates a video from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoMultipartBody'
+ encoding:
+ model:
+ contentType: text/plain
+ input_reference:
+ contentType: application/octet-stream, application/json
+ seconds:
+ contentType: application/json
+ size:
+ contentType: application/json
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Create video
+ group: videos
+ path: create
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/videos \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F "model=sora-2" \
+ -F "prompt=A calico cat playing a piano on stage"
+ javascript: |
+ import OpenAI from 'openai';
+
+ const openai = new OpenAI();
+
+ const video = await openai.videos.create({ prompt: 'A calico cat playing a piano on stage' });
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.create(
+ prompt="x",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.New(context.TODO(), openai.VideoNewParams{
+ Prompt: "x",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.create(prompt: "x")
+
+ puts(video)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoCreateParams params = VideoCreateParams.builder()
+ .prompt("x")
+ .build();
+ Video video = client.videos().create(params);
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.create({ prompt: 'x' });
+
+ console.log(video.id);
+ response: |
+ {
+ "id": "video_123",
+ "object": "video",
+ "model": "sora-2",
+ "status": "queued",
+ "progress": 0,
+ "created_at": 1712697600,
+ "size": "1024x1792",
+ "seconds": "8",
+ "quality": "standard"
+ }
+ /openai/v1/videos/characters:
+ post:
+ operationId: VideoGeneration_createVideoCharacter
+ summary: Create a video character
+ description: Creates a video character from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoCharacterResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoCharacterBody'
+ description: The multipart request body.
+ x-oaiMeta:
+ examples:
+ response: ''
+ request:
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.videos.createCharacter({
+ name: 'x',
+ video: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(response.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.videos.create_character(
+ name="x",
+ video=b"Example data",
+ )
+ print(response.id)
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Videos.NewCharacter(context.TODO(), openai.VideoNewCharacterParams{
+ Name: "x",
+ Video: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoCreateCharacterParams;
+ import com.openai.models.videos.VideoCreateCharacterResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoCreateCharacterParams params = VideoCreateCharacterParams.builder()
+ .name("x")
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ VideoCreateCharacterResponse response = client.videos().createCharacter(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.videos.create_character(name: "x", video: StringIO.new("Example data"))
+
+ puts(response)
+ /openai/v1/videos/characters/{character_id}:
+ get:
+ operationId: VideoGeneration_getVideoCharacter
+ summary: Get a video character
+ description: Retrieves a video character by its identifier.
+ parameters:
+ - name: character_id
+ in: path
+ required: true
+ description: The identifier of the character to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoCharacterResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ examples:
+ response: ''
+ request:
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.videos.getCharacter('char_123');
+
+ console.log(response.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.videos.get_character(
+ "char_123",
+ )
+ print(response.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Videos.GetCharacter(context.TODO(), "char_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoGetCharacterParams;
+ import com.openai.models.videos.VideoGetCharacterResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoGetCharacterResponse response = client.videos().getCharacter("char_123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.videos.get_character("char_123")
+
+ puts(response)
+ /openai/v1/videos/edits:
+ post:
+ operationId: VideoGeneration_createVideoEditMultipart_VideoGeneration_createVideoEditJson
+ parameters: []
+ description: Creates a video edit from the supplied request. Creates a video edit from the supplied request.
+ summary: Create a video edit Create a video edit
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ x-ms-request-body-description-override: The request body.
+ x-ms-description-override: Creates a video edit from the supplied request.
+ x-ms-summary-override: Create a video edit
+ x-oaiMeta:
+ examples:
+ response: ''
+ request:
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.edit({ prompt: 'x', video: fs.createReadStream('path/to/file') });
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.edit(
+ prompt="x",
+ video=b"Example data",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Edit(context.TODO(), openai.VideoEditParams{
+ Prompt: "x",
+ Video: openai.VideoEditParamsVideoUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoEditParams;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoEditParams params = VideoEditParams.builder()
+ .prompt("x")
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ Video video = client.videos().edit(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.edit(prompt: "x", video: StringIO.new("Example data"))
+
+ puts(video)
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoEditMultipartBody'
+ encoding:
+ video:
+ contentType: application/octet-stream, application/json
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoEditJsonBody'
+ description: The multipart request body. The request body.
+ /openai/v1/videos/extensions:
+ post:
+ operationId: VideoGeneration_createVideoExtendMultipart_VideoGeneration_createVideoExtendJson
+ parameters: []
+ description: Extends a video from the supplied request. Extends a video from the supplied request.
+ summary: Extend a video Extend a video
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ x-ms-request-body-description-override: The request body.
+ x-ms-description-override: Extends a video from the supplied request.
+ x-ms-summary-override: Extend a video
+ x-oaiMeta:
+ examples:
+ response: ''
+ request:
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.extend({
+ prompt: 'x',
+ seconds: '4',
+ video: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.extend(
+ prompt="x",
+ seconds="4",
+ video=b"Example data",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Extend(context.TODO(), openai.VideoExtendParams{
+ Prompt: "x",
+ Seconds: openai.VideoSeconds4,
+ Video: openai.VideoExtendParamsVideoUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoExtendParams;
+ import com.openai.models.videos.VideoSeconds;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoExtendParams params = VideoExtendParams.builder()
+ .prompt("x")
+ .seconds(VideoSeconds._4)
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ Video video = client.videos().extend(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.extend_(prompt: "x", seconds: :"4", video: StringIO.new("Example data"))
+
+ puts(video)
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoExtendMultipartBody'
+ encoding:
+ video:
+ contentType: application/json, application/octet-stream
+ seconds:
+ contentType: application/json
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoExtendJsonBody'
+ description: The multipart request body. The request body.
+ /openai/v1/videos/{video_id}:
+ delete:
+ operationId: VideoGeneration_deleteVideo
+ summary: Delete a video
+ description: Deletes a video by its identifier.
+ parameters:
+ - name: video_id
+ in: path
+ required: true
+ description: The identifier of the video to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeletedVideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ name: Delete video
+ group: videos
+ path: delete
+ examples:
+ response: ''
+ request:
+ javascript: |
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const video = await client.videos.delete('video_123');
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.delete(
+ "video_123",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Delete(context.TODO(), "video_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.delete("video_123")
+
+ puts(video)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoDeleteParams;
+ import com.openai.models.videos.VideoDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoDeleteResponse video = client.videos().delete("video_123");
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.delete('video_123');
+
+ console.log(video.id);
+ get:
+ operationId: VideoGeneration_getVideo
+ summary: Get a video
+ description: Retrieves a video by its identifier.
+ parameters:
+ - name: video_id
+ in: path
+ required: true
+ description: The identifier of the video to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ name: Retrieve video
+ group: videos
+ path: retrieve matching the provided identifier.
+ examples:
+ response: ''
+ request:
+ javascript: |
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const video = await client.videos.retrieve('video_123');
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.retrieve(
+ "video_123",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Get(context.TODO(), "video_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.retrieve("video_123")
+
+ puts(video)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Video video = client.videos().retrieve("video_123");
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.retrieve('video_123');
+
+ console.log(video.id);
+ /openai/v1/videos/{video_id}/content:
+ get:
+ operationId: VideoGeneration_retrieveVideoContent
+ summary: Get a video content
+ description: Retrieves a video content by its identifier.
+ parameters:
+ - name: video_id
+ in: path
+ required: true
+ description: The identifier of the video whose media to download.
+ schema:
+ type: string
+ - name: variant
+ in: query
+ required: false
+ description: Which downloadable asset to return. Defaults to the MP4 video.
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoContentVariant'
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ video/mp4:
+ schema:
+ contentMediaType: video/mp4
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ name: Retrieve video content
+ group: videos
+ path: content
+ examples:
+ response: ''
+ request:
+ javascript: |
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const response = await client.videos.downloadContent('video_123');
+
+ console.log(response);
+
+ const content = await response.blob();
+ console.log(content);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.videos.download_content(
+ video_id="video_123",
+ )
+ print(response)
+ content = response.read()
+ print(content)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Videos.DownloadContent(
+ context.TODO(),
+ "video_123",
+ openai.VideoDownloadContentParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.videos.download_content("video_123")
+
+ puts(response)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.videos.VideoDownloadContentParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ HttpResponse response = client.videos().downloadContent("video_123");
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.videos.downloadContent('video_123');
+
+ console.log(response);
+
+ const content = await response.blob();
+ console.log(content);
+ /openai/v1/videos/{video_id}/remix:
+ post:
+ operationId: VideoGeneration_createVideoRemix
+ summary: Create a video remix
+ description: Creates a video remix from the supplied request.
+ parameters:
+ - name: video_id
+ in: path
+ required: true
+ description: The identifier of the completed video to remix.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoRemixBody'
+ encoding:
+ prompt:
+ contentType: text/plain
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Remix video
+ group: videos
+ path: remix using the provided prompt.
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/videos/video_123/remix \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "prompt": "Extend the scene with the cat taking a bow to the cheering audience"
+ }'
+ javascript: |
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const video = await client.videos.remix('video_123', { prompt: 'Extend the scene with the cat taking a bow to the cheering audience' });
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.remix(
+ video_id="video_123",
+ prompt="x",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Remix(
+ context.TODO(),
+ "video_123",
+ openai.VideoRemixParams{
+ Prompt: "x",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.remix("video_123", prompt: "x")
+
+ puts(video)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoRemixParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoRemixParams params = VideoRemixParams.builder()
+ .videoId("video_123")
+ .prompt("x")
+ .build();
+ Video video = client.videos().remix(params);
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.remix('video_123', { prompt: 'x' });
+
+ console.log(video.id);
+ response: |
+ {
+ "id": "video_456",
+ "object": "video",
+ "model": "sora-2",
+ "status": "queued",
+ "progress": 0,
+ "created_at": 1712698600,
+ "size": "720x1280",
+ "seconds": "8",
+ "remixed_from_video_id": "video_123"
+ }
+ /redTeams/runs:
+ get:
+ operationId: RedTeams_list
+ summary: List redteams
+ description: Returns the redteams available in the current project.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - RedTeams=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PagedRedTeam'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Redteams
+ /redTeams/runs/{name}:
+ get:
+ operationId: RedTeams_get
+ summary: Get a redteam
+ description: Retrieves the specified redteam and its configuration.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: name
+ in: path
+ required: true
+ description: Identifier of the red team run.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - RedTeams=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RedTeam'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Redteams
+ /redTeams/runs:run:
+ post:
+ operationId: RedTeams_create
+ summary: Create a redteam run
+ description: Submits a new redteam run for execution with the provided configuration.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - RedTeams=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '201':
+ description: The request has succeeded and a new resource has been created as a result.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RedTeam'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Redteams
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RedTeam'
+ description: Redteam to be run
+ /routines:
+ get:
+ operationId: listRoutines
+ summary: List routines
+ description: Returns the routines available in the current project.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/ListRoutinesParameters.limit'
+ - $ref: '#/components/parameters/ListRoutinesParameters.after'
+ - $ref: '#/components/parameters/ListRoutinesParameters.before'
+ - $ref: '#/components/parameters/ListRoutinesParameters.order'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/Routine'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}:
+ put:
+ operationId: createOrUpdateRoutine
+ summary: Create or update a routine
+ description: Creates a new routine or replaces an existing routine with the supplied definition.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/CreateOrUpdateRoutineParameters.routine_name'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Routine'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RoutineCreateOrUpdateRequest'
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ get:
+ operationId: getRoutine
+ summary: Get a routine
+ description: Retrieves the specified routine and its current configuration.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/GetRoutineParameters'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Routine'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ delete:
+ operationId: deleteRoutine
+ summary: Delete a routine
+ description: Deletes the specified routine.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/DeleteRoutineParameters'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '204':
+ description: There is no content to send for this request, but the headers may be useful.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}/runs:
+ get:
+ operationId: listRoutineRuns
+ summary: List prior runs for a routine
+ description: Returns prior runs recorded for the specified routine.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.routine_name'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.filter'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.limit'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.after'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.before'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.order'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/RoutineRun'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}:disable:
+ post:
+ operationId: disableRoutine
+ summary: Disable a routine
+ description: Disables the specified routine so it no longer runs.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/DisableRoutineParameters'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Routine'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}:dispatch_async:
+ post:
+ operationId: dispatchRoutineAsync
+ summary: Queue an asynchronous routine dispatch
+ description: Queues an asynchronous dispatch for the specified routine.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/DispatchRoutineAsyncParameters.routine_name'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DispatchRoutineResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DispatchRoutineRequest'
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}:enable:
+ post:
+ operationId: enableRoutine
+ summary: Enable a routine
+ description: Enables the specified routine so it can be dispatched.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/EnableRoutineParameters'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Routine'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /schedules:
+ get:
+ operationId: Schedules_list
+ summary: List schedules
+ description: Returns schedules that match the supplied type and enabled filters.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: type
+ in: query
+ required: false
+ description: Filter by the type of schedule.
+ schema:
+ $ref: '#/components/schemas/ScheduleTaskType'
+ explode: false
+ - name: enabled
+ in: query
+ required: false
+ description: Filter by the enabled status.
+ schema:
+ type: boolean
+ explode: false
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PagedSchedule'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ /schedules/{id}:
+ delete:
+ operationId: Schedules_delete
+ summary: Delete a schedule
+ description: Deletes the specified schedule resource.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: id
+ in: path
+ required: true
+ description: Identifier of the schedule.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '204':
+ description: There is no content to send for this request, but the headers may be useful.
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ get:
+ operationId: Schedules_get
+ summary: Get a schedule
+ description: Retrieves the specified schedule resource.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: id
+ in: path
+ required: true
+ description: Identifier of the schedule.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Schedule'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ put:
+ operationId: Schedules_createOrUpdate
+ summary: Create or update a schedule
+ description: Creates a new schedule or updates an existing schedule with the supplied definition.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: id
+ in: path
+ required: true
+ description: Identifier of the schedule.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Schedule'
+ '201':
+ description: The request has succeeded and a new resource has been created as a result.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Schedule'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Schedule'
+ description: The resource instance.
+ /schedules/{id}/runs:
+ get:
+ operationId: Schedules_listRuns
+ summary: List schedule runs
+ description: Returns schedule runs that match the supplied filters.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: id
+ in: path
+ required: true
+ description: Identifier of the schedule.
+ schema:
+ type: string
+ - name: type
+ in: query
+ required: false
+ description: Filter by the type of schedule.
+ schema:
+ $ref: '#/components/schemas/ScheduleTaskType'
+ explode: false
+ - name: enabled
+ in: query
+ required: false
+ description: Filter by the enabled status.
+ schema:
+ type: boolean
+ explode: false
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PagedScheduleRun'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ /schedules/{schedule_id}/runs/{run_id}:
+ get:
+ operationId: Schedules_getRun
+ summary: Get a schedule run
+ description: Retrieves the specified run for a schedule.
+ parameters:
+ - name: schedule_id
+ in: path
+ required: true
+ description: The unique identifier of the schedule.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The unique identifier of the schedule run.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ScheduleRun'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Schedules
+ /skills:
+ get:
+ operationId: Skills_listSkills
+ summary: List skills
+ description: Returns the skills available in the current project.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/Skill'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}:
+ get:
+ operationId: Skills_getSkill
+ summary: Retrieve a skill
+ description: Retrieves the specified skill and its current configuration.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The unique name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Skill'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ post:
+ operationId: updateSkill
+ summary: Update a skill
+ description: Modifies the specified skill's configuration.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill to update.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Skill'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ default_version:
+ type: string
+ description: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest.
+ required:
+ - default_version
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ delete:
+ operationId: Skills_deleteSkill
+ summary: Delete a skill
+ description: Removes the specified skill and its associated versions.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The unique name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DeleteSkillResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}/content:
+ get:
+ operationId: getSkillContent
+ summary: Download the zip content for the default version of a skill
+ description: Downloads the zip content for the default version of a skill.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The response body for downloading a skill package.
+ content:
+ application/zip:
+ schema:
+ contentMediaType: application/zip
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}/versions:
+ post:
+ operationId: createSkillVersion_createSkillVersionFromFiles
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill. If the skill does not exist, it will be created.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ description: Creates a new version of a skill. If the skill does not exist, it will be created. Creates a new version of a skill from uploaded files via multipart form data.
+ summary: Create a new version of a skill Create a skill version from uploaded files
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SkillVersion'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ x-ms-description-override: Creates a new version of a skill. If the skill does not exist, it will be created.
+ x-ms-summary-override: Create a new version of a skill
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ tags:
+ - Skills
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ inline_content:
+ $ref: '#/components/schemas/SkillInlineContent'
+ description: Inline skill content for simple skills without file uploads. Foundry-specific extension.
+ default:
+ type: boolean
+ description: Whether to set this version as the default.
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/CreateSkillVersionFromFilesBody'
+ encoding:
+ files:
+ contentType: '*/*'
+ default:
+ contentType: text/plain
+ description: The multipart request content.
+ get:
+ operationId: listSkillVersions
+ summary: List skill versions
+ description: Returns the available versions for the specified skill.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill to list versions for.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/SkillVersion'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}/versions/{version}:
+ get:
+ operationId: getSkillVersion
+ summary: Retrieve a specific version of a skill
+ description: Retrieves the specified version of a skill by name and version identifier.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: version
+ in: path
+ required: true
+ description: The version identifier to retrieve.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SkillVersion'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ delete:
+ operationId: deleteSkillVersion
+ summary: Delete a specific version of a skill
+ description: Removes the specified version of a skill.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: version
+ in: path
+ required: true
+ description: The version identifier to delete.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DeleteSkillVersionResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}/versions/{version}/content:
+ get:
+ operationId: getSkillVersionContent
+ summary: Download the zip content for a specific version of a skill
+ description: Downloads the zip content for a specific version of a skill.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: version
+ in: path
+ required: true
+ description: The version to download content for.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The response body for downloading a skill package.
+ content:
+ application/zip:
+ schema:
+ contentMediaType: application/zip
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /toolboxes:
+ get:
+ operationId: listToolboxes
+ summary: List toolboxes
+ description: Returns the toolboxes available in the current project.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolboxObject'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ /toolboxes/{name}:
+ get:
+ operationId: getToolbox
+ summary: Retrieve a toolbox
+ description: Retrieves the specified toolbox and its current configuration.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox to retrieve.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ToolboxObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ patch:
+ operationId: updateToolbox
+ summary: Update a toolbox to point to a specific version
+ description: Updates the toolbox's default version pointer to the specified version.
+ parameters:
+ - $ref: '#/components/parameters/UpdateToolboxRequest.name'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ToolboxObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateToolboxRequest'
+ delete:
+ operationId: deleteToolbox
+ summary: Delete a toolbox
+ description: Removes the specified toolbox along with all of its versions.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox to delete.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '204':
+ description: 'There is no content to send for this request, but the headers may be useful. '
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ /toolboxes/{name}/versions:
+ post:
+ operationId: createToolboxVersion
+ summary: Create a new version of a toolbox
+ description: Creates a new toolbox version, provisioning the toolbox itself if it does not already exist.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox. If the toolbox does not exist, it will be created.
+ schema:
+ type: string
+ maxLength: 256
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ToolboxVersionObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the toolbox.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Arbitrary key-value metadata to associate with the toolbox.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolboxTool'
+ description: The list of tools to include in this version.
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolboxSkill'
+ description: The list of skill sources to include in this version. A skill reference specifies a skill name and optionally a version. If version is omitted, the skill's default version is used.
+ policies:
+ $ref: '#/components/schemas/ToolboxPolicies'
+ description: Policy configuration for this toolbox version.
+ required:
+ - tools
+ get:
+ operationId: listToolboxVersions
+ summary: List toolbox versions
+ description: Returns the available versions for the specified toolbox.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox to list versions for.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolboxVersionObject'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ /toolboxes/{name}/versions/{version}:
+ get:
+ operationId: getToolboxVersion
+ summary: Retrieve a specific version of a toolbox
+ description: Retrieves the specified version of a toolbox by name and version identifier.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox.
+ schema:
+ type: string
+ - name: version
+ in: path
+ required: true
+ description: The version identifier to retrieve.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ToolboxVersionObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ delete:
+ operationId: deleteToolboxVersion
+ summary: Delete a specific version of a toolbox
+ description: Removes the specified version of a toolbox.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox.
+ schema:
+ type: string
+ - name: version
+ in: path
+ required: true
+ description: The version identifier to delete.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '204':
+ description: 'There is no content to send for this request, but the headers may be useful. '
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+security:
+ - OAuth2Auth:
+ - https://ai.azure.com/.default
+components:
+ parameters:
+ Azure.Core.ClientRequestIdHeader:
+ name: x-ms-client-request-id
+ in: header
+ required: false
+ description: An opaque, globally-unique, client-generated string identifier for the request.
+ schema:
+ $ref: '#/components/schemas/Azure.Core.uuid'
+ Azure.Core.Foundations.ApiVersionParameter:
+ name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ minLength: 1
+ explode: false
CreateOrUpdateRoutineParameters.routine_name:
name: routine_name
in: path
@@ -11120,445 +37886,6211 @@ components:
description: The name of the toolbox to update.
schema:
type: string
- schemas:
- A2APreviewTool:
+ schemas:
+ A2APreviewTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - a2a_preview
+ description: The type of the tool. Always `"a2a_preview`.
+ base_url:
+ type: string
+ format: uri
+ description: Base URL of the agent.
+ agent_card_path:
+ type: string
+ description: |-
+ The path to the agent card relative to the `base_url`.
+ If not provided, defaults to `/.well-known/agent-card.json`
+ project_connection_id:
+ type: string
+ description: |-
+ The connection ID in the project for the A2A server.
+ The connection stores authentication and other connection details needed to connect to the A2A server.
+ send_credentials_for_agent_card:
+ type: boolean
+ description: |-
+ When `true`, Foundry sends its credentials when fetching the remote
+ agent's Agent Card. The service defaults to `false` if a value is not
+ specified by the caller (anonymous fetch).
+ default: false
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: An agent implementing the A2A protocol.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ A2APreviewToolboxTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - a2a_preview
+ base_url:
+ type: string
+ format: uri
+ description: Base URL of the agent.
+ agent_card_path:
+ type: string
+ description: |-
+ The path to the agent card relative to the `base_url`.
+ If not provided, defaults to `/.well-known/agent-card.json`
+ project_connection_id:
+ type: string
+ description: |-
+ The connection ID in the project for the A2A server.
+ The connection stores authentication and other connection details needed to connect to the A2A server.
+ send_credentials_for_agent_card:
+ type: boolean
+ description: |-
+ When `true`, Foundry sends its credentials when fetching the remote
+ agent's Agent Card. The service defaults to `false` if a value is not
+ specified by the caller (anonymous fetch).
+ default: false
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: An A2A tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ A2AProtocolConfiguration:
+ type: object
+ description: Configuration specific to the A2A protocol.
+ A2AToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - a2a_preview_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ name:
+ type: string
+ description: The name of the A2A agent card being called.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: An A2A (Agent-to-Agent) tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ A2AToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - a2a_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ name:
+ type: string
+ description: The name of the A2A agent card that was called.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the A2A tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of an A2A (Agent-to-Agent) tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ AISearchIndexResource:
+ type: object
+ properties:
+ project_connection_id:
+ type: string
+ description: An index connection ID in an IndexResource attached to this agent.
+ index_name:
+ type: string
+ description: The name of an index in an IndexResource attached to this agent.
+ query_type:
+ $ref: '#/components/schemas/AzureAISearchQueryType'
+ description: Type of query in an AIIndexResource attached to this agent.
+ top_k:
+ type: integer
+ format: int32
+ description: Number of documents to retrieve from search and present to the model.
+ filter:
+ type: string
+ description: filter string for search resource. [Learn more here](https://learn.microsoft.com/azure/search/search-filters).
+ index_asset_id:
+ type: string
+ description: Index asset id for search resource.
+ description: A AI Search Index resource.
+ ActivityProtocolConfiguration:
+ type: object
+ properties:
+ enable_m365_public_endpoint:
+ type: boolean
+ description: Whether to enable the M365 public endpoint for the activity protocol.
+ description: Configuration specific to the activity protocol.
+ AgentBlueprintReference:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/AgentBlueprintReferenceType'
+ discriminator:
+ propertyName: type
+ mapping:
+ ManagedAgentIdentityBlueprint: '#/components/schemas/ManagedAgentIdentityBlueprintReference'
+ AgentBlueprintReferenceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - ManagedAgentIdentityBlueprint
+ AgentCard:
+ type: object
+ required:
+ - version
+ - skills
+ properties:
+ version:
+ type: string
+ minLength: 1
+ maxLength: 32
+ description: The version of the agent card.
+ description:
+ type: string
+ maxLength: 2048
+ description: The description of the agent card.
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentCardSkill'
+ minItems: 1
+ maxItems: 16
+ description: The set of skills that an agent can perform.
+ AgentCardSkill:
+ type: object
+ required:
+ - id
+ - name
+ properties:
+ id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: a unique identifier for the skill
+ name:
+ type: string
+ minLength: 1
+ maxLength: 128
+ description: The name of the skill
+ description:
+ type: string
+ maxLength: 2048
+ description: A description of the skill
+ tags:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentCardSkillTag'
+ maxItems: 5
+ description: set of tagwords describing classes of capabilities for the skill
+ examples:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentCardSkillExample'
+ maxItems: 5
+ description: A list of example scenarios that the skill can perform.
+ AgentCardSkillExample:
+ type: string
+ maxLength: 1024
+ description: A skill example string with a maximum length of 1024 characters.
+ AgentCardSkillTag:
+ type: string
+ maxLength: 32
+ AgentCardUpdate:
+ type: object
+ properties:
+ version:
+ type: string
+ minLength: 1
+ maxLength: 32
+ description: The version of the agent card.
+ description:
+ type: string
+ maxLength: 2048
+ description: The description of the agent card.
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentCardSkill'
+ minItems: 1
+ maxItems: 16
+ description: The set of skills that an agent can perform.
+ AgentClusterInsightRequest:
+ type: object
+ required:
+ - type
+ - agentName
+ properties:
+ type:
+ type: string
+ enum:
+ - AgentClusterInsight
+ description: The type of request.
+ agentName:
+ type: string
+ description: Identifier for the agent.
+ modelConfiguration:
+ $ref: '#/components/schemas/InsightModelConfiguration'
+ description: Configuration of the model used in the insight generation.
+ allOf:
+ - $ref: '#/components/schemas/InsightRequest'
+ description: Insights on set of Agent Evaluation Results
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ AgentClusterInsightResult:
+ type: object
+ required:
+ - type
+ - clusterInsight
+ properties:
+ type:
+ type: string
+ enum:
+ - AgentClusterInsight
+ description: The type of insights result.
+ clusterInsight:
+ $ref: '#/components/schemas/ClusterInsightResult'
+ allOf:
+ - $ref: '#/components/schemas/InsightResult'
+ description: Insights from the agent cluster analysis.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ AgentDataGenerationJobSource:
+ type: object
+ required:
+ - type
+ - agent_name
+ properties:
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ type:
+ type: string
+ enum:
+ - agent
+ description: The source type for this source, which is Agent.
+ agent_name:
+ type: string
+ description: The agent name to fetch instructions from.
+ agent_version:
+ type: string
+ description: The agent version. If not specified, the latest version is used.
+ allOf:
+ - $ref: '#/components/schemas/DataGenerationJobSource'
+ description: Agent source for data generation jobs — references an agent to fetch instructions and metadata from.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ AgentDefinition:
+ type: object
+ required:
+ - kind
+ properties:
+ kind:
+ $ref: '#/components/schemas/AgentKind'
+ rai_config:
+ $ref: '#/components/schemas/RaiConfig'
+ description: Configuration for Responsible AI (RAI) content filtering and safety features.
+ discriminator:
+ propertyName: kind
+ mapping:
+ hosted: '#/components/schemas/HostedAgentDefinition'
+ prompt: '#/components/schemas/PromptAgentDefinition'
+ workflow: '#/components/schemas/WorkflowAgentDefinition'
+ external: '#/components/schemas/ExternalAgentDefinition'
+ AgentDefinitionOptInKeys:
+ type: string
+ enum:
+ - WorkflowAgents=V1Preview
+ - ExternalAgents=V1Preview
+ - DraftAgents=V1Preview
+ description: Feature opt-in keys for agent definition operations supporting hosted or workflow agents.
+ AgentEndpointAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/AgentEndpointAuthorizationSchemeType'
+ discriminator:
+ propertyName: type
+ mapping:
+ Entra: '#/components/schemas/EntraAuthorizationScheme'
+ BotService: '#/components/schemas/BotServiceAuthorizationScheme'
+ BotServiceRbac: '#/components/schemas/BotServiceRbacAuthorizationScheme'
+ BotServiceTenant: '#/components/schemas/BotServiceTenantAuthorizationScheme'
+ AgentEndpointAuthorizationSchemeType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - Entra
+ - BotService
+ - BotServiceRbac
+ - BotServiceTenant
+ AgentEndpointConfig:
+ type: object
+ properties:
+ version_selector:
+ $ref: '#/components/schemas/VersionSelector'
+ description: The version selector of the agent endpoint determines how traffic is routed to different versions of the agent.
+ protocol_configuration:
+ $ref: '#/components/schemas/ProtocolConfiguration'
+ description: Per-protocol configuration for the agent endpoint.
+ authorization_schemes:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ description: The authorization schemes supported by the agent endpoint
+ AgentEndpointConfigUpdate:
+ type: object
+ properties:
+ version_selector:
+ $ref: '#/components/schemas/VersionSelectorUpdate'
+ description: The version selector of the agent endpoint determines how traffic is routed to different versions of the agent.
+ protocol_configuration:
+ $ref: '#/components/schemas/ProtocolConfiguration'
+ description: Per-protocol configuration for the agent endpoint.
+ authorization_schemes:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ description: The authorization schemes supported by the agent endpoint
+ AgentEndpointProtocol:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - activity
+ - responses
+ - a2a
+ - mcp
+ - invocations
+ - invocations_ws
+ AgentEvaluatorGenerationJobSource:
+ type: object
+ required:
+ - type
+ - agent_name
+ properties:
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ type:
+ type: string
+ enum:
+ - agent
+ description: The source type for this source, which is Agent.
+ agent_name:
+ type: string
+ description: The agent name to fetch instructions from.
+ agent_version:
+ type: string
+ description: The agent version. If not specified, the latest version is used.
+ allOf:
+ - $ref: '#/components/schemas/EvaluatorGenerationJobSource'
+ description: Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ AgentFilterTraceSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - agent_filter
+ description: The type of trace source, always `agent_filter`.
+ agent_id:
+ type: string
+ description: The identifier of the agent to filter traces by.
+ agent_name:
+ type: string
+ description: The name of the agent to filter traces by.
+ agent_version:
+ type: string
+ description: The version of the agent to filter traces by.
+ start_time:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: Start time for the trace query window, expressed as a Unix timestamp (seconds).
+ end_time:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: End time for the trace query window, expressed as a Unix timestamp (seconds).
+ max_traces:
+ type: integer
+ format: int32
+ description: Maximum number of traces to sample. Must be greater than 0.
+ filter_strategy:
+ $ref: '#/components/schemas/FilterStrategyType'
+ description: The strategy used to filter traces.
+ allOf:
+ - $ref: '#/components/schemas/TraceSource'
+ description: A trace source that selects traces by agent reference with time-based filtering.
+ AgentIdentity:
+ type: object
+ required:
+ - principal_id
+ - client_id
+ properties:
+ principal_id:
+ type: string
+ description: The principal ID of the agent instance
+ client_id:
+ type: string
+ description: The client ID of the agent instance. Also referred to as the instance ID
+ status:
+ $ref: '#/components/schemas/AgentIdentityStatus'
+ description: The status of the agent identity. Present for both the agent instance identity and the agent blueprint.
+ AgentIdentityStatus:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - active
+ - disabled
+ description: The status of an agent identity, applicable to both the agent instance identity and the agent blueprint.
+ AgentKind:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - hosted
+ - workflow
+ - external
+ AgentObject:
+ type: object
+ required:
+ - object
+ - id
+ - name
+ - state
+ - versions
+ properties:
+ object:
+ type: string
+ enum:
+ - agent
+ description: The object type, which is always 'agent'.
+ id:
+ type: string
+ description: The unique identifier of the agent.
+ name:
+ type: string
+ maxLength: 63
+ description: The name of the agent.
+ state:
+ $ref: '#/components/schemas/AgentState'
+ description: The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests.
+ readOnly: true
+ versions:
+ type: object
+ properties:
+ latest:
+ $ref: '#/components/schemas/AgentVersionObject'
+ required:
+ - latest
+ description: The latest version of the agent.
+ agent_endpoint:
+ $ref: '#/components/schemas/AgentEndpointConfig'
+ description: The endpoint configuration for the agent
+ instance_identity:
+ $ref: '#/components/schemas/AgentIdentity'
+ description: The instance identity of the agent
+ readOnly: true
+ blueprint:
+ $ref: '#/components/schemas/AgentIdentity'
+ description: The blueprint for the agent
+ readOnly: true
+ blueprint_reference:
+ $ref: '#/components/schemas/AgentBlueprintReference'
+ description: The blueprint for the agent
+ readOnly: true
+ agent_card:
+ $ref: '#/components/schemas/AgentCard'
+ AgentReference:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ type:
+ type: string
+ enum:
+ - agent_reference
+ name:
+ type: string
+ maxLength: 256
+ description: The name of the agent.
+ version:
+ type: string
+ description: The version identifier of the agent.
+ AgentSessionResource:
+ type: object
+ required:
+ - agent_session_id
+ - version_indicator
+ - status
+ - created_at
+ - last_accessed_at
+ - expires_at
+ properties:
+ agent_session_id:
+ type: string
+ description: The session identifier.
+ version_indicator:
+ $ref: '#/components/schemas/VersionIndicator'
+ description: The version indicator determining which agent version backs this session.
+ status:
+ $ref: '#/components/schemas/AgentSessionStatus'
+ description: The current status of the session.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) when the session was created.
+ readOnly: true
+ last_accessed_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) when the session was last accessed.
+ readOnly: true
+ expires_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).
+ readOnly: true
+ description: An agent session providing a long-lived compute sandbox for hosted agent invocations.
+ AgentSessionStatus:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - creating
+ - active
+ - idle
+ - updating
+ - failed
+ - deleting
+ - deleted
+ - expired
+ description: The status of an agent session.
+ AgentState:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - enabled
+ - disabled
+ description: The operational state of an agent.
+ AgentTaxonomyInput:
+ type: object
+ required:
+ - type
+ - target
+ - riskCategories
+ properties:
+ type:
+ type: string
+ enum:
+ - agent
+ description: Input type of the evaluation taxonomy.
+ target:
+ $ref: '#/components/schemas/Target'
+ description: Target configuration for the agent.
+ riskCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/RiskCategory'
+ description: List of risk categories to evaluate against.
+ allOf:
+ - $ref: '#/components/schemas/EvaluationTaxonomyInput'
+ description: Input configuration for the evaluation taxonomy when the input type is agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ AgentTaxonomyInputUpdate:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - agent
+ description: Input type of the evaluation taxonomy.
+ target:
+ $ref: '#/components/schemas/TargetUpdate'
+ description: Target configuration for the agent.
+ riskCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/RiskCategory'
+ description: List of risk categories to evaluate against.
+ allOf:
+ - $ref: '#/components/schemas/EvaluationTaxonomyInputUpdate'
+ description: Input configuration for the evaluation taxonomy when the input type is agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ AgentVersionObject:
+ type: object
+ required:
+ - metadata
+ - object
+ - id
+ - name
+ - version
+ - created_at
+ - definition
+ properties:
+ metadata:
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ type: string
+ - type: 'null'
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ object:
+ type: string
+ enum:
+ - agent.version
+ description: The object type, which is always 'agent.version'.
+ id:
+ type: string
+ description: The unique identifier of the agent version.
+ name:
+ type: string
+ maxLength: 256
+ description: The name of the agent. Name can be used to retrieve/update/delete the agent.
+ version:
+ type: string
+ description: The version identifier of the agent. Agents are immutable and every update creates a new version while keeping the name same.
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The Unix timestamp (seconds) when the agent was created.
+ definition:
+ $ref: '#/components/schemas/AgentDefinition'
+ draft:
+ type: boolean
+ description: Whether this agent version is a draft (candidate) rather than a release. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to false.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DraftAgents=V1Preview
+ default: false
+ status:
+ $ref: '#/components/schemas/AgentVersionStatus'
+ description: The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For hosted agents, reflects infrastructure readiness.
+ instance_identity:
+ $ref: '#/components/schemas/AgentIdentity'
+ description: The instance identity of the agent
+ readOnly: true
+ blueprint:
+ $ref: '#/components/schemas/AgentIdentity'
+ description: The blueprint for the agent
+ readOnly: true
+ blueprint_reference:
+ $ref: '#/components/schemas/AgentBlueprintReference'
+ description: The blueprint for the agent
+ readOnly: true
+ agent_guid:
+ type: string
+ description: The unique GUID identifier of the agent.
+ readOnly: true
+ AgentVersionStatus:
+ type: string
+ enum:
+ - creating
+ - active
+ - failed
+ - deleting
+ - deleted
+ description: The provisioning status of an agent version.
+ AgenticIdentityPreviewCredentials:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - AgenticIdentityToken_Preview
+ description: The credential type
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: Agentic identity credential definition
+ ApiErrorResponse:
+ type: object
+ required:
+ - error
+ properties:
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error response for API failures.
+ ApiKeyCredentials:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - ApiKey
+ description: The credential type
+ readOnly: true
+ key:
+ type: string
+ description: API Key
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: API Key Credential definition
+ ArtifactProfile:
+ type: object
+ required:
+ - category
+ properties:
+ category:
+ $ref: '#/components/schemas/FoundryModelArtifactProfileCategory'
+ description: The category of the artifact profile
+ signals:
+ type: array
+ items:
+ $ref: '#/components/schemas/FoundryModelArtifactProfileSignal'
+ description: Signals detected in the model artifact
+ description: Artifact profile of the model
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ AssetCredentialResponse:
+ type: object
+ required:
+ - blobReference
+ properties:
+ blobReference:
+ $ref: '#/components/schemas/BlobReference'
+ description: Credential info to access the storage account.
+ description: Represents a reference to a blob for consumption
+ AssetId:
+ type: string
+ description: Identifier of a saved asset.
+ AttackStrategy:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - easy
+ - moderate
+ - difficult
+ - ascii_art
+ - ascii_smuggler
+ - atbash
+ - base64
+ - binary
+ - caesar
+ - character_space
+ - jailbreak
+ - ansi_attack
+ - character_swap
+ - suffix_append
+ - string_join
+ - unicode_confusable
+ - unicode_substitution
+ - diacritic
+ - flip
+ - leetspeak
+ - rot13
+ - morse
+ - url
+ - baseline
+ - indirect_jailbreak
+ - tense
+ - multi_turn
+ - crescendo
+ description: Strategies for attacks.
+ x-ms-foundry-meta:
+ required_previews:
+ - RedTeams=V1Preview
+ Azure.Core.Foundations.Error:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: string
+ description: One of a server-defined set of error codes.
+ message:
+ type: string
+ description: A human-readable representation of the error.
+ target:
+ type: string
+ description: The target of the error.
+ details:
+ type: array
+ items:
+ $ref: '#/components/schemas/Azure.Core.Foundations.Error'
+ description: An array of details about specific errors that led to this reported error.
+ innererror:
+ $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
+ description: An object containing more specific information than the current object about the error.
+ description: The error object.
+ Azure.Core.Foundations.ErrorResponse:
+ type: object
+ required:
+ - error
+ properties:
+ error:
+ $ref: '#/components/schemas/Azure.Core.Foundations.Error'
+ description: The error object.
+ description: A response containing error details.
+ Azure.Core.Foundations.InnerError:
+ type: object
+ properties:
+ code:
+ type: string
+ description: One of a server-defined set of error codes.
+ innererror:
+ description: Inner error.
+ $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
+ description: An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.
+ Azure.Core.Foundations.OperationState:
+ anyOf:
+ - type: string
+ enum:
+ - NotStarted
+ - Running
+ - Succeeded
+ - Failed
+ - Canceled
+ - type: string
+ description: Enum describing allowed operation states.
+ Azure.Core.uuid:
+ type: string
+ format: uuid
+ description: Universally Unique Identifier
+ AzureAIAgentTarget:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_agent
+ description: The type of target, always `azure_ai_agent`.
+ name:
+ type: string
+ description: The unique identifier of the Azure AI agent.
+ version:
+ type: string
+ description: The version of the Azure AI agent.
+ tool_descriptions:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolDescription'
+ description: The parameters used to control the sampling behavior of the agent during text generation.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ allOf:
+ - $ref: '#/components/schemas/Target'
+ description: Represents a target specifying an Azure AI agent.
+ AzureAIAgentTargetUpdate:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_agent
+ description: The type of target, always `azure_ai_agent`.
+ name:
+ type: string
+ description: The unique identifier of the Azure AI agent.
+ version:
+ type: string
+ description: The version of the Azure AI agent.
+ tool_descriptions:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolDescription'
+ description: The parameters used to control the sampling behavior of the agent during text generation.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ allOf:
+ - $ref: '#/components/schemas/TargetUpdate'
+ description: Represents a target specifying an Azure AI agent.
+ AzureAIBenchmarkDataSourceConfig:
+ type: object
+ required:
+ - scenario
+ - benchmark_name
+ properties:
+ scenario:
+ type: string
+ enum:
+ - benchmark_preview
+ description: Data schema scenario, always `benchmark` for benchmark evaluations.
+ benchmark_name:
+ type: string
+ description: The name of the benchmark specification.
+ benchmark_version:
+ type: string
+ description: The version of the benchmark specification (e.g., '0.1'). Latest version if not specified.
+ grader_model:
+ type: string
+ description: Optional grader model for benchmarks that use model graders, Required when the benchmark's testing_criteria uses a model grader type.
+ allOf:
+ - $ref: '#/components/schemas/AzureAIDataSourceConfig'
+ description: Data source configuration for benchmark evaluations.
+ AzureAIBenchmarkPreviewEvalRunDataSource:
+ type: object
+ required:
+ - type
+ - target
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_benchmark_preview
+ description: The type of data source, always `azure_ai_benchmark_preview`.
+ input_messages:
+ $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ description: Input messages configuration.
+ target:
+ anyOf:
+ - $ref: '#/components/schemas/AzureAIModelTarget'
+ - $ref: '#/components/schemas/AzureAIAgentTarget'
+ description: |-
+ The target model or agent to evaluate against the benchmark.
+ When using `azure_ai_model` target, `sampling_params` must not be provided;
+ inference parameters are auto-filled from the benchmark specification stored in eval group properties.
+ allOf:
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Represents a data source for benchmark evaluation runs.
+ AzureAIDataSourceConfig:
+ type: object
+ required:
+ - type
+ - scenario
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_source
+ description: The object type, which is always `azure_ai_source`.
+ scenario:
+ type: string
+ enum:
+ - red_team
+ - responses
+ - traces_preview
+ - synthetic_data_gen_preview
+ - benchmark_preview
+ description: Data schema scenario.
+ discriminator:
+ propertyName: scenario
+ mapping:
+ benchmark_preview: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
+ allOf:
+ - $ref: '#/components/schemas/DataSourceConfig'
+ description: Base data source configuration for Azure AI evaluation scenarios.
+ AzureAIModelTarget:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_model
+ description: The type of target, always `azure_ai_model`.
+ model:
+ type: string
+ description: The unique identifier of the Azure AI model.
+ sampling_params:
+ $ref: '#/components/schemas/ModelSamplingParams'
+ description: The parameters used to control the sampling behavior of the model during text generation.
+ allOf:
+ - $ref: '#/components/schemas/Target'
+ description: Represents a target specifying an Azure AI model for operations requiring model selection.
+ AzureAIModelTargetUpdate:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_model
+ description: The type of target, always `azure_ai_model`.
+ model:
+ type: string
+ description: The unique identifier of the Azure AI model.
+ sampling_params:
+ $ref: '#/components/schemas/ModelSamplingParams'
+ description: The parameters used to control the sampling behavior of the model during text generation.
+ allOf:
+ - $ref: '#/components/schemas/TargetUpdate'
+ description: Represents a target specifying an Azure AI model for operations requiring model selection.
+ AzureAIResponsesEvalRunDataSource:
+ type: object
+ required:
+ - type
+ - item_generation_params
+ - max_runs_hourly
+ - event_configuration_id
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_responses
+ description: The type of data source, always `azure_ai_responses`.
+ item_generation_params:
+ $ref: '#/components/schemas/ResponseRetrievalItemGenerationParams'
+ description: The parameters for item generation.
+ max_runs_hourly:
+ type: integer
+ format: int32
+ description: Maximum number of evaluation runs allowed per hour.
+ event_configuration_id:
+ type: string
+ description: The event configuration name associated with this evaluation run.
+ allOf:
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Represents a data source for evaluation runs that are specific to Continuous Evaluation scenarios.
+ AzureAISearchIndex:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - AzureSearch
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/Index'
+ description: Azure AI Search Index Definition
+ AzureAISearchIndexUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - AzureSearch
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/IndexUpdate'
+ description: Azure AI Search Index Definition
+ AzureAISearchQueryType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - simple
+ - semantic
+ - vector
+ - vector_simple_hybrid
+ - vector_semantic_hybrid
+ description: Available query types for Azure AI Search tool.
+ AzureAISearchTool:
+ type: object
+ required:
+ - type
+ - azure_ai_search
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_search
+ description: The object type, which is always 'azure_ai_search'.
+ name:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ azure_ai_search:
+ $ref: '#/components/schemas/AzureAISearchToolResource'
+ description: The azure ai search index resource.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for an Azure AI search tool as used to configure an agent.
+ AzureAISearchToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_search_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: An Azure AI Search tool call.
+ AzureAISearchToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_search_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Azure AI Search tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of an Azure AI Search tool call.
+ AzureAISearchToolResource:
+ type: object
+ required:
+ - indexes
+ properties:
+ indexes:
+ type: array
+ items:
+ $ref: '#/components/schemas/AISearchIndexResource'
+ maxItems: 1
+ description: |-
+ The indices attached to this agent. There can be a maximum of 1 index
+ resource attached to the agent.
+ description: A set of index resources used by the `azure_ai_search` tool.
+ AzureAISearchToolboxTool:
+ type: object
+ required:
+ - type
+ - azure_ai_search
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_search
+ azure_ai_search:
+ $ref: '#/components/schemas/AzureAISearchToolResource'
+ description: The azure ai search index resource.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: An Azure AI Search tool stored in a toolbox.
+ AzureAITraceDataSourcePreviewEvalRunDataSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_trace_data_source_preview
+ description: The type of data source, always `azure_ai_trace_data_source_preview`.
+ trace_source:
+ $ref: '#/components/schemas/TraceSource'
+ description: The trace source that defines how traces are selected for evaluation.
+ allOf:
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: A wrapper data source that contains a polymorphic trace source to specify how traces are selected for evaluation.
+ AzureContentFilterBlocklistIdResult:
+ type: object
+ required:
+ - id
+ - filtered
+ properties:
+ id:
+ type: string
+ description: The ID of the custom blocklist.
+ filtered:
+ type: boolean
+ description: Whether the blocklist resulted in filtering.
+ description: A content filter blocklist ID result.
+ AzureContentFilterBlocklistResult:
+ type: object
+ required:
+ - filtered
+ properties:
+ filtered:
+ type: boolean
+ description: Whether any blocklist resulted in filtering.
+ details:
+ type: array
+ items:
+ $ref: '#/components/schemas/AzureContentFilterBlocklistIdResult'
+ description: The pairs of individual blocklist IDs and their filtering results.
+ description: A collection of filtering results for configured custom blocklists.
+ AzureContentFilterCitation:
+ type: object
+ properties:
+ license:
+ type: string
+ description: The license associated with the detection.
+ url:
+ type: string
+ format: uri
+ description: The URL associated with the license.
+ description: Citation details for protected material detection.
+ AzureContentFilterCompletionTextSpan:
+ type: object
+ required:
+ - completion_start_offset
+ - completion_end_offset
+ properties:
+ completion_start_offset:
+ type: integer
+ format: int32
+ description: Offset of the UTF32 code point which begins the span.
+ completion_end_offset:
+ type: integer
+ format: int32
+ description: Offset of the first UTF32 code point which is excluded from the span.
+ description: A representation of a span of completion text as used by Azure OpenAI content filter results.
+ AzureContentFilterCompletionTextSpanDetectionResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ - details
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether the content category was detected.
+ details:
+ type: array
+ items:
+ $ref: '#/components/schemas/AzureContentFilterCompletionTextSpan'
+ description: Detailed information about the detected completion text spans.
+ description: A content filter detection result with completion text span details.
+ AzureContentFilterDetectionResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether the content category was detected.
+ description: A content filter result indicating whether the content was detected and filtered.
+ AzureContentFilterDetectionWithCitationResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether the content category was detected.
+ citation:
+ $ref: '#/components/schemas/AzureContentFilterCitation'
+ description: Citation details describing the associated license and its location.
+ description: A content filter detection result that includes citation information for protected material.
+ AzureContentFilterDetectionWithReasonResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether the content category was detected.
+ reason:
+ type: string
+ description: A human-readable explanation of why the detection result was produced.
+ description: A content filter detection result that includes a reason description.
+ AzureContentFilterError:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: integer
+ format: int32
+ description: A machine-readable error code.
+ message:
+ type: string
+ description: A human-readable error message.
+ description: Error details from the content filtering system.
+ AzureContentFilterPersonallyIdentifiableInformationResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether PII was detected in the content.
+ sub_categories:
+ type: array
+ items:
+ $ref: '#/components/schemas/AzureContentFilterPiiSubCategoryResult'
+ description: Detailed results for individual PII subcategories.
+ description: A content filter detection result for Personally Identifiable Information.
+ AzureContentFilterPiiSubCategoryResult:
+ type: object
+ required:
+ - sub_category
+ - filtered
+ - detected
+ properties:
+ sub_category:
+ type: string
+ description: The PII subcategory that was evaluated.
+ filtered:
+ type: boolean
+ description: Whether the content was filtered for this subcategory.
+ detected:
+ type: boolean
+ description: Whether the subcategory was detected in the content.
+ description: Result details for an individual PII subcategory.
+ AzureContentFilterResultsForResponses:
+ type: object
+ properties:
+ sexual:
+ $ref: '#/components/schemas/AzureContentFilterSeverityResult'
+ description: Severity result for sexual content.
+ hate:
+ $ref: '#/components/schemas/AzureContentFilterSeverityResult'
+ description: Severity result for hate content.
+ violence:
+ $ref: '#/components/schemas/AzureContentFilterSeverityResult'
+ description: Severity result for violence content.
+ self_harm:
+ $ref: '#/components/schemas/AzureContentFilterSeverityResult'
+ description: Severity result for self-harm content.
+ profanity:
+ $ref: '#/components/schemas/AzureContentFilterDetectionResult'
+ description: Detection result for profanity.
+ custom_blocklists:
+ $ref: '#/components/schemas/AzureContentFilterBlocklistResult'
+ description: Results for configured custom blocklists.
+ jailbreak:
+ $ref: '#/components/schemas/AzureContentFilterDetectionResult'
+ description: Detection result for jailbreak attempts.
+ task_adherence:
+ $ref: '#/components/schemas/AzureContentFilterDetectionWithReasonResult'
+ description: Detection result for task adherence evaluation.
+ protected_material_text:
+ $ref: '#/components/schemas/AzureContentFilterDetectionResult'
+ description: Detection result for protected material text.
+ protected_material_code:
+ $ref: '#/components/schemas/AzureContentFilterDetectionWithCitationResult'
+ description: Detection result for protected material code with citation.
+ ungrounded_material:
+ $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult'
+ description: Detection result for ungrounded material with completion text span details.
+ personally_identifiable_information:
+ $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult'
+ description: Detection result for Personally Identifiable Information.
+ indirect_attack:
+ $ref: '#/components/schemas/AzureContentFilterDetectionResult'
+ description: Detection result for indirect attacks.
+ error:
+ $ref: '#/components/schemas/AzureContentFilterError'
+ description: Error details if content filtering evaluation failed.
+ description: Content filter results for the Responses API.
+ AzureContentFilterSeverity:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - safe
+ - low
+ - medium
+ - high
+ description: Ratings for the intensity and risk level of harmful content.
+ AzureContentFilterSeverityResult:
+ type: object
+ required:
+ - filtered
+ - severity
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ severity:
+ $ref: '#/components/schemas/AzureContentFilterSeverity'
+ description: The severity level of the content.
+ description: A content filter result indicating severity level and whether content was filtered.
+ AzureFunctionBinding:
+ type: object
+ required:
+ - type
+ - storage_queue
+ properties:
+ type:
+ type: string
+ enum:
+ - storage_queue
+ description: The type of binding, which is always 'storage_queue'.
+ storage_queue:
+ $ref: '#/components/schemas/AzureFunctionStorageQueue'
+ description: Storage queue.
+ description: The structure for keeping storage queue name and URI.
+ AzureFunctionDefinition:
+ type: object
+ required:
+ - function
+ - input_binding
+ - output_binding
+ properties:
+ function:
+ type: object
+ properties:
+ name:
+ type: string
+ description: The name of the function to be called.
+ description:
+ type: string
+ description: A description of what the function does, used by the model to choose when and how to call the function.
+ parameters:
+ type: object
+ unevaluatedProperties: {}
+ description: The parameters the functions accepts, described as a JSON Schema object.
+ required:
+ - name
+ - parameters
+ description: The definition of azure function and its parameters.
+ input_binding:
+ $ref: '#/components/schemas/AzureFunctionBinding'
+ description: Input storage queue. The queue storage trigger runs a function as messages are added to it.
+ output_binding:
+ $ref: '#/components/schemas/AzureFunctionBinding'
+ description: Output storage queue. The function writes output to this queue when the input items are processed.
+ description: The definition of Azure function.
+ AzureFunctionStorageQueue:
+ type: object
+ required:
+ - queue_service_endpoint
+ - queue_name
+ properties:
+ queue_service_endpoint:
+ type: string
+ description: URI to the Azure Storage Queue service allowing you to manipulate a queue.
+ queue_name:
+ type: string
+ description: The name of an Azure function storage queue.
+ description: The structure for keeping storage queue name and URI.
+ AzureFunctionTool:
+ type: object
+ required:
+ - type
+ - azure_function
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_function
+ description: The object type, which is always 'browser_automation'.
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ azure_function:
+ $ref: '#/components/schemas/AzureFunctionDefinition'
+ description: The Azure Function Tool definition.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for an Azure Function Tool, as used to configure an Agent.
+ AzureFunctionToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_function_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ name:
+ type: string
+ description: The name of the Azure Function being called.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: An Azure Function tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ AzureFunctionToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_function_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ name:
+ type: string
+ description: The name of the Azure Function that was called.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Azure Function tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of an Azure Function tool call.
+ AzureOpenAIModelConfiguration:
+ type: object
+ required:
+ - type
+ - modelDeploymentName
+ properties:
+ type:
+ type: string
+ enum:
+ - AzureOpenAIModel
+ modelDeploymentName:
+ type: string
+ description: 'Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`).'
+ allOf:
+ - $ref: '#/components/schemas/RedTeamTargetConfig'
+ description: Azure OpenAI model configuration. The API version would be selected by the service for querying the model.
+ x-ms-foundry-meta:
+ required_previews:
+ - RedTeams=V1Preview
+ AzureUserSecurityContext:
+ type: object
+ properties:
+ application_name:
+ type: string
+ description: The name of the application. Sensitive personal information should not be included in this field.
+ end_user_id:
+ type: string
+ description: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.
+ end_user_tenant_id:
+ type: string
+ description: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant.
+ source_ip:
+ type: string
+ description: Captures the original client's IP address.
+ description: User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.
+ BaseCredentials:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/CredentialType'
+ description: The type of credential used by the connection
+ readOnly: true
+ discriminator:
+ propertyName: type
+ mapping:
+ ApiKey: '#/components/schemas/ApiKeyCredentials'
+ AAD: '#/components/schemas/EntraIDCredentials'
+ CustomKeys: '#/components/schemas/CustomCredential'
+ SAS: '#/components/schemas/SASCredentials'
+ None: '#/components/schemas/NoAuthenticationCredentials'
+ AgenticIdentityToken_Preview: '#/components/schemas/AgenticIdentityPreviewCredentials'
+ description: A base class for connection credentials
+ BingCustomSearchConfiguration:
+ type: object
+ required:
+ - project_connection_id
+ - instance_name
+ properties:
+ project_connection_id:
+ type: string
+ description: Project connection id for grounding with bing search
+ instance_name:
+ type: string
+ description: Name of the custom configuration instance given to config.
+ market:
+ type: string
+ description: The market where the results come from.
+ set_lang:
+ type: string
+ description: The language to use for user interface strings when calling Bing API.
+ count:
+ type: integer
+ format: int64
+ description: The number of search results to return in the bing api response
+ freshness:
+ type: string
+ description: Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters).
+ description: A bing custom search configuration.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingCustomSearchPreviewTool:
+ type: object
+ required:
+ - type
+ - bing_custom_search_preview
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_custom_search_preview
+ description: The object type, which is always 'bing_custom_search_preview'.
+ bing_custom_search_preview:
+ $ref: '#/components/schemas/BingCustomSearchToolParameters'
+ description: The bing custom search tool parameters.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for a Bing custom search tool as used to configure an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingCustomSearchToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_custom_search_preview_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A Bing custom search tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingCustomSearchToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_custom_search_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Bing custom search tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a Bing custom search tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingCustomSearchToolParameters:
+ type: object
+ required:
+ - search_configurations
+ properties:
+ search_configurations:
+ type: array
+ items:
+ $ref: '#/components/schemas/BingCustomSearchConfiguration'
+ maxItems: 1
+ description: |-
+ The project connections attached to this tool. There can be a maximum of 1 connection
+ resource attached to the tool.
+ description: The bing custom search tool parameters.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingGroundingSearchConfiguration:
+ type: object
+ required:
+ - project_connection_id
+ properties:
+ project_connection_id:
+ type: string
+ description: Project connection id for grounding with bing search
+ market:
+ type: string
+ description: The market where the results come from.
+ set_lang:
+ type: string
+ description: The language to use for user interface strings when calling Bing API.
+ count:
+ type: integer
+ format: int64
+ description: The number of search results to return in the bing api response
+ freshness:
+ type: string
+ description: Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters).
+ description: Search configuration for Bing Grounding
+ BingGroundingSearchToolParameters:
+ type: object
+ required:
+ - search_configurations
+ properties:
+ search_configurations:
+ type: array
+ items:
+ $ref: '#/components/schemas/BingGroundingSearchConfiguration'
+ maxItems: 1
+ description: |-
+ The search configurations attached to this tool. There can be a maximum of 1
+ search configuration resource attached to the tool.
+ description: The bing grounding search tool parameters.
+ BingGroundingTool:
+ type: object
+ required:
+ - type
+ - bing_grounding
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_grounding
+ description: The object type, which is always 'bing_grounding'.
+ name:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ bing_grounding:
+ $ref: '#/components/schemas/BingGroundingSearchToolParameters'
+ description: The bing grounding search tool parameters.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for a bing grounding search tool as used to configure an agent.
+ BingGroundingToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_grounding_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A Bing grounding tool call.
+ BingGroundingToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_grounding_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Bing grounding tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a Bing grounding tool call.
+ BlobReference:
+ type: object
+ required:
+ - blobUri
+ - storageAccountArmId
+ - credential
+ properties:
+ blobUri:
+ type: string
+ format: uri
+ description: 'Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path`'
+ storageAccountArmId:
+ type: string
+ description: ARM ID of the storage account to use.
+ credential:
+ $ref: '#/components/schemas/SasCredential'
+ description: Credential info to access the storage account.
+ description: Blob reference details.
+ BotServiceAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - BotService
+ allOf:
+ - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ BotServiceRbacAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - BotServiceRbac
+ allOf:
+ - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ BotServiceTenantAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - BotServiceTenant
+ allOf:
+ - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ BrowserAutomationPreviewTool:
+ type: object
+ required:
+ - type
+ - browser_automation_preview
+ properties:
+ type:
+ type: string
+ enum:
+ - browser_automation_preview
+ description: The object type, which is always 'browser_automation_preview'.
+ browser_automation_preview:
+ $ref: '#/components/schemas/BrowserAutomationToolParameters'
+ description: The Browser Automation Tool parameters.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for a Browser Automation Tool, as used to configure an Agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationPreviewToolboxTool:
+ type: object
+ required:
+ - type
+ - browser_automation_preview
+ properties:
+ type:
+ type: string
+ enum:
+ - browser_automation_preview
+ browser_automation_preview:
+ $ref: '#/components/schemas/BrowserAutomationToolParameters'
+ description: The Browser Automation Tool parameters.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A browser automation tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - browser_automation_preview_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A browser automation tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - browser_automation_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the browser automation tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a browser automation tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationToolConnectionParameters:
+ type: object
+ required:
+ - project_connection_id
+ properties:
+ project_connection_id:
+ type: string
+ description: The ID of the project connection to your Azure Playwright resource.
+ description: Definition of input parameters for the connection used by the Browser Automation Tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationToolParameters:
+ type: object
+ required:
+ - connection
+ properties:
+ connection:
+ $ref: '#/components/schemas/BrowserAutomationToolConnectionParameters'
+ description: The project connection parameters associated with the Browser Automation Tool.
+ description: Definition of input parameters for the Browser Automation Tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ CaptureStructuredOutputsTool:
+ type: object
+ required:
+ - type
+ - outputs
+ properties:
+ type:
+ type: string
+ enum:
+ - capture_structured_outputs
+ description: The type of the tool. Always `capture_structured_outputs`.
+ name:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ outputs:
+ $ref: '#/components/schemas/StructuredOutputDefinition'
+ description: The structured outputs to capture from the model.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool for capturing structured outputs
+ ChartCoordinate:
+ type: object
+ required:
+ - x
+ - 'y'
+ - size
+ properties:
+ x:
+ type: integer
+ format: int32
+ description: X-axis coordinate.
+ 'y':
+ type: integer
+ format: int32
+ description: Y-axis coordinate.
+ size:
+ type: integer
+ format: int32
+ description: Size of the chart element.
+ description: Coordinates for the analysis chart.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ ChatSummaryMemoryItem:
+ type: object
+ required:
+ - kind
+ properties:
+ kind:
+ type: string
+ enum:
+ - chat_summary
+ description: The kind of the memory item.
+ allOf:
+ - $ref: '#/components/schemas/MemoryItem'
+ description: A memory item containing a summary extracted from conversations.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ ClusterInsightResult:
+ type: object
+ required:
+ - summary
+ - clusters
+ properties:
+ summary:
+ $ref: '#/components/schemas/InsightSummary'
+ description: Summary of the insights report.
+ clusters:
+ type: array
+ items:
+ $ref: '#/components/schemas/InsightCluster'
+ description: List of clusters identified in the insights.
+ coordinates:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ChartCoordinate'
+ description: |2-
+ Optional mapping of IDs to 2D coordinates used by the UX for visualization.
+
+ The map keys are string identifiers (for example, a cluster id or a sample id)
+ and the values are the coordinates and visual size for rendering on a 2D chart.
+
+ This property is omitted unless the client requests coordinates (for example,
+ by passing `includeCoordinates=true` as a query parameter).
+
+ Example:
+ ```
+ {
+ "cluster-1": { "x": 12, "y": 34, "size": 8 },
+ "sample-123": { "x": 18, "y": 22, "size": 4 }
+ }
+ ```
+
+ Coordinates are intended only for client-side visualization and do not
+ modify the canonical insights results.
+ description: Insights from the cluster analysis.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ ClusterTokenUsage:
+ type: object
+ required:
+ - inputTokenUsage
+ - outputTokenUsage
+ - totalTokenUsage
+ properties:
+ inputTokenUsage:
+ type: integer
+ format: int32
+ description: input token usage
+ outputTokenUsage:
+ type: integer
+ format: int32
+ description: output token usage
+ totalTokenUsage:
+ type: integer
+ format: int32
+ description: total token usage
+ description: Token usage for cluster analysis
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ CodeBasedEvaluatorDefinition:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - code
+ code_text:
+ type: string
+ description: Inline code text for the evaluator
+ entry_point:
+ type: string
+ description: The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ image_tag:
+ type: string
+ description: The container image tag to use for evaluator code execution
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ blob_uri:
+ type: string
+ format: uri
+ description: The blob URI for the evaluator storage
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ allOf:
+ - $ref: '#/components/schemas/EvaluatorDefinition'
+ description: Code-based evaluator definition using python code
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ CodeConfiguration:
+ type: object
+ required:
+ - runtime
+ - entry_point
+ - dependency_resolution
+ properties:
+ runtime:
+ type: string
+ description: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13').
+ entry_point:
+ type: array
+ items:
+ type: string
+ description: The entry point command and arguments for the code execution.
+ dependency_resolution:
+ $ref: '#/components/schemas/CodeDependencyResolution'
+ description: |-
+ How package dependencies are resolved at deployment time. Defaults to `bundled`,
+ where the caller bundles all dependencies into the uploaded zip and the service
+ performs no remote build. `remote_build` instructs the service to build
+ dependencies remotely from the manifest included in the uploaded zip.
+ default: bundled
+ content_hash:
+ type: string
+ description: The SHA-256 hex digest of the uploaded code zip. Set by the service from the `x-ms-code-zip-sha256` request header; read-only in responses and never accepted in request payloads.
+ readOnly: true
+ description: Code-based deployment configuration for a hosted agent.
+ CodeDependencyResolution:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - bundled
+ - remote_build
+ description: How package dependencies are resolved at deployment time for a code-based hosted agent.
+ CodeInterpreterToolboxTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - code_interpreter
+ container:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.AutoCodeInterpreterToolParam'
+ description: |-
+ The code interpreter container. Can be a container ID or an object that
+ specifies uploaded file IDs to make available to your code, along with an
+ optional `memory_limit` setting.
+ If not provided, the service assumes auto.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A code interpreter tool stored in a toolbox.
+ CompletionMessageToolCallChunk:
+ type: object
+ required:
+ - id
+ - type
+ properties:
+ id:
+ type: string
+ description: The Id for the tool call.
+ type:
+ type: string
+ enum:
+ - function
+ description: The type of tool call, which is always "function".
+ function:
+ $ref: '#/components/schemas/FunctionToolCall'
+ description: Details of the function tool call, if applicable.
+ description: Tool call details within a message.
+ Connection:
+ type: object
+ required:
+ - name
+ - id
+ - type
+ - target
+ - isDefault
+ - credentials
+ - metadata
+ properties:
+ name:
+ type: string
+ description: The friendly name of the connection, provided by the user.
+ readOnly: true
+ id:
+ type: string
+ description: A unique identifier for the connection, generated by the service
+ readOnly: true
+ type:
+ $ref: '#/components/schemas/ConnectionType'
+ description: Category of the connection
+ readOnly: true
+ target:
+ type: string
+ description: The connection URL to be used for this service
+ readOnly: true
+ isDefault:
+ type: boolean
+ description: Whether the connection is tagged as the default connection of its type
+ readOnly: true
+ credentials:
+ $ref: '#/components/schemas/BaseCredentials'
+ description: The credentials used by the connection
+ readOnly: true
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Metadata of the connection
+ readOnly: true
+ description: Response from the list and get connections operations
+ ConnectionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - AzureOpenAI
+ - AzureBlob
+ - AzureStorageAccount
+ - CognitiveSearch
+ - CosmosDB
+ - ApiKey
+ - AppConfig
+ - AppInsights
+ - CustomKeys
+ - RemoteTool_Preview
+ description: The Type (or category) of the connection
+ ContainerConfiguration:
+ type: object
+ required:
+ - image
+ properties:
+ image:
+ type: string
+ description: The container image for the hosted agent.
+ examples:
+ - my-registry.azurecr.io/my-hosted-agent:latest
+ description: Container-based deployment configuration for a hosted agent.
+ ContentFilterResult:
+ type: object
+ required:
+ - blocked
+ - source_type
+ - content_filter_results
+ properties:
+ blocked:
+ type: boolean
+ description: Whether the content was blocked by the content filter.
+ source_type:
+ type: string
+ description: The source type of the content filter evaluation (e.g., 'prompt', 'response', 'pre_tool_call', 'post_tool_call').
+ content_filter_results:
+ $ref: '#/components/schemas/AzureContentFilterResultsForResponses'
+ description: The content filter results for this evaluation.
+ tool_call_id:
+ type: string
+ description: The ID of the tool call associated with this content filter result, if applicable.
+ description: A content filter evaluation result for a specific source in the response.
+ ContinuousEvaluationRuleAction:
+ type: object
+ required:
+ - type
+ - evalId
+ properties:
+ type:
+ type: string
+ enum:
+ - continuousEvaluation
+ evalId:
+ type: string
+ description: Eval Id to add continuous evaluation runs to.
+ maxHourlyRuns:
+ type: integer
+ format: int32
+ description: Maximum number of evaluation runs allowed per hour.
+ samplingRate:
+ type: number
+ format: double
+ maximum: 100
+ description: Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the service-default is to evaluate every event, which is equivalent to setting a sampling rate of 100.
+ exclusiveMinimum: 0
+ default: 100
+ allOf:
+ - $ref: '#/components/schemas/EvaluationRuleAction'
+ description: Evaluation rule action for continuous evaluation.
+ ConversationGenPreviewItemGenerationParams:
+ type: object
+ required:
+ - type
+ - model
+ properties:
+ type:
+ type: string
+ enum:
+ - conversation_gen_preview
+ description: The type of item generation parameters, always `conversation_gen_preview`.
+ model:
+ type: string
+ description: The model deployment used for simulation, in the format '{connectionName}/modelDeploymentName'.
+ max_turns:
+ type: integer
+ format: int32
+ description: Maximum number of turns per simulated conversation. Defaults to 20.
+ default: 20
+ num_conversations:
+ type: integer
+ format: int32
+ description: Number of simulated conversations to generate per test scenario. Defaults to 5.
+ default: 5
+ data_mapping:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Mapping from source fields to response_id field, which is required for retrieving chat history.
+ sampling_params:
+ $ref: '#/components/schemas/ModelSamplingParams'
+ description: Sampling parameters for the conversation generation.
+ allOf:
+ - $ref: '#/components/schemas/ItemGenerationParams'
+ description: Represents the parameters for conversation simulation item generation.
+ ConversationIdTraceSource:
+ type: object
+ required:
+ - type
+ - conversation_ids
+ properties:
+ type:
+ type: string
+ enum:
+ - conversation_id_source
+ description: The type of trace source, always `conversation_id_source`.
+ conversation_ids:
+ type: array
+ items:
+ type: string
+ description: Collection of conversation identifiers to filter traces by.
+ allOf:
+ - $ref: '#/components/schemas/TraceSource'
+ description: A trace source that selects traces by conversation IDs.
+ CosmosDBIndex:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - CosmosDBNoSqlVectorStore
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/Index'
+ description: CosmosDB Vector Store Index Definition
+ CosmosDBIndexUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - CosmosDBNoSqlVectorStore
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/IndexUpdate'
+ description: CosmosDB Vector Store Index Definition
+ CreateAgentFromCodeContent:
+ type: object
+ properties:
+ metadata:
+ allOf:
+ - $ref: '#/components/schemas/CreateAgentVersionFromCodeMetadata'
+ description: JSON metadata including description and hosted definition.
+ code:
+ description: The code zip file (max 250 MB).
+ required:
+ - metadata
+ - code
+ CreateAgentFromManifestRequest:
+ type: object
+ required:
+ - name
+ - manifest_id
+ - parameter_values
+ properties:
+ name:
+ type: string
+ maxLength: 63
+ description: |-
+ The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ - Must start and end with alphanumeric characters,
+ - Can contain hyphens in the middle
+ - Must not exceed 63 characters.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ manifest_id:
+ type: string
+ description: The manifest ID to import the agent version from.
+ parameter_values:
+ type: object
+ unevaluatedProperties: {}
+ description: The inputs to the manifest that will result in a fully materialized Agent.
+ CreateAgentRequest:
+ type: object
+ required:
+ - name
+ - definition
+ properties:
+ name:
+ type: string
+ maxLength: 63
+ description: |-
+ The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ - Must start and end with alphanumeric characters,
+ - Can contain hyphens in the middle
+ - Must not exceed 63 characters.
+ state:
+ $ref: '#/components/schemas/AgentState'
+ description: The initial operational state of the agent. Defaults to 'enabled' if not specified.
+ default: enabled
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ definition:
+ $ref: '#/components/schemas/AgentDefinition'
+ description: The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - WorkflowAgents=V1Preview
+ - ExternalAgents=V1Preview
+ - DraftAgents=V1Preview
+ blueprint_reference:
+ $ref: '#/components/schemas/AgentBlueprintReference'
+ description: The blueprint reference for the agent.
+ draft:
+ type: boolean
+ description: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DraftAgents=V1Preview
+ default: false
+ agent_endpoint:
+ $ref: '#/components/schemas/AgentEndpointConfig'
+ description: An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent
+ agent_card:
+ $ref: '#/components/schemas/AgentCard'
+ description: Optional agent card for the agent
+ x-ms-foundry-meta:
+ conditional_previews:
+ - WorkflowAgents=V1Preview
+ - ExternalAgents=V1Preview
+ - DraftAgents=V1Preview
+ CreateAgentSessionRequest:
+ type: object
+ required:
+ - version_indicator
+ properties:
+ agent_session_id:
+ type: string
+ description: Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. Auto-generated if omitted.
+ version_indicator:
+ $ref: '#/components/schemas/VersionIndicator'
+ description: Determines which agent version backs the session.
+ description: Request to create a new agent session.
+ CreateAgentVersionFromCodeContent:
+ type: object
+ properties:
+ metadata:
+ allOf:
+ - $ref: '#/components/schemas/CreateAgentVersionFromCodeMetadata'
+ description: JSON metadata including description and hosted definition.
+ code:
+ description: The code zip file (max 250 MB).
+ required:
+ - metadata
+ - code
+ CreateAgentVersionFromCodeMetadata:
+ type: object
+ required:
+ - definition
+ properties:
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ definition:
+ $ref: '#/components/schemas/HostedAgentDefinition'
+ description: The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, and protocol_versions.
+ description: |-
+ JSON metadata for code-based agent operations (create, update, create version).
+ The agent name comes from the URL path parameter or the `x-ms-agent-name` header,
+ so it is not included in this model.
+ The content hash (SHA-256 of the zip) is carried in the `x-ms-code-zip-sha256` header.
+ CreateAgentVersionFromManifestRequest:
+ type: object
+ required:
+ - manifest_id
+ - parameter_values
+ properties:
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ manifest_id:
+ type: string
+ description: The manifest ID to import the agent version from.
+ parameter_values:
+ type: object
+ unevaluatedProperties: {}
+ description: The inputs to the manifest that will result in a fully materialized Agent.
+ CreateAgentVersionRequest:
+ type: object
+ required:
+ - definition
+ properties:
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ definition:
+ $ref: '#/components/schemas/AgentDefinition'
+ description: The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - WorkflowAgents=V1Preview
+ - ExternalAgents=V1Preview
+ - DraftAgents=V1Preview
+ blueprint_reference:
+ $ref: '#/components/schemas/AgentBlueprintReference'
+ description: The blueprint reference for the agent.
+ draft:
+ type: boolean
+ description: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DraftAgents=V1Preview
+ default: false
+ CreateEvalRequest:
+ type: object
+ required:
+ - data_source_config
+ - testing_criteria
+ properties:
+ name:
+ type: string
+ description: The name of the evaluation.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ data_source_config:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig'
+ - $ref: '#/components/schemas/AzureAIDataSourceConfig'
+ - $ref: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
+ description: The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation.
+ testing_criteria:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
+ - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
+ description: 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}}`).
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ title: CreateEvalRequest
+ CreateEvalRunRequest:
+ type: object
+ required:
+ - data_source
+ properties:
+ name:
+ type: string
+ description: The name of the run.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ data_source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource'
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Details about the run's data source.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ evaluation_level:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: The level at which evaluation is performed. Defaults to 'turn' if not specified.
+ default: turn
+ title: CreateEvalRunRequest
+ CreateSkillVersionFromFilesBody:
+ type: object
+ properties:
+ files:
+ type: array
+ items: {}
+ description: Skill files to upload. Upload a single zip file or multiple individual files with relative paths.
+ default:
+ type: boolean
+ description: Whether to set this version as the default. Defaults to false.
+ required:
+ - files
+ CredentialType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - ApiKey
+ - AAD
+ - SAS
+ - CustomKeys
+ - None
+ - AgenticIdentityToken_Preview
+ description: The credential type used by the connection
+ CronTrigger:
+ type: object
+ required:
+ - type
+ - expression
+ properties:
+ type:
+ type: string
+ enum:
+ - Cron
+ expression:
+ type: string
+ description: Cron expression that defines the schedule frequency.
+ timeZone:
+ type: string
+ description: Time zone for the cron schedule. Defaults to `UTC`.
+ default: UTC
+ startTime:
+ type: string
+ description: Start time for the cron schedule in ISO 8601 format.
+ endTime:
+ type: string
+ description: End time for the cron schedule in ISO 8601 format.
+ allOf:
+ - $ref: '#/components/schemas/Trigger'
+ description: Cron based trigger.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ CustomCredential:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - CustomKeys
+ description: The credential type
+ readOnly: true
+ unevaluatedProperties:
+ type: string
+ allOf:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: Custom credential definition
+ CustomRoutineTrigger:
+ type: object
+ required:
+ - type
+ - provider
+ - parameters
+ properties:
+ type:
+ type: string
+ enum:
+ - custom
+ description: The trigger type.
+ provider:
+ type: string
+ maxLength: 128
+ description: The external provider that emits the custom event.
+ event_name:
+ type: string
+ maxLength: 256
+ description: The provider-specific event name that fires the routine.
+ parameters:
+ type: object
+ unevaluatedProperties: {}
+ description: Provider-specific trigger parameters.
+ allOf:
+ - $ref: '#/components/schemas/RoutineTrigger'
+ description: A custom event routine trigger.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ DailyRecurrenceSchedule:
+ type: object
+ required:
+ - type
+ - hours
+ properties:
+ type:
+ type: string
+ enum:
+ - Daily
+ description: Daily recurrence type.
+ hours:
+ type: array
+ items:
+ type: integer
+ format: int32
+ description: Hours for the recurrence schedule.
+ allOf:
+ - $ref: '#/components/schemas/RecurrenceSchedule'
+ description: Daily recurrence schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ DataGenerationJob:
+ type: object
+ required:
+ - id
+ - status
+ - created_at
+ properties:
+ id:
+ type: string
+ description: Server-assigned unique identifier.
+ readOnly: true
+ inputs:
+ $ref: '#/components/schemas/DataGenerationJobInputs'
+ description: Caller-supplied inputs.
+ result:
+ $ref: '#/components/schemas/DataGenerationJobResult'
+ description: Result produced on success.
+ readOnly: true
+ status:
+ $ref: '#/components/schemas/JobStatus'
+ description: Current lifecycle status.
+ readOnly: true
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error details — populated only on failure.
+ readOnly: true
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).
+ readOnly: true
+ finished_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job was finished, represented in Unix time (seconds since January 1, 1970).
+ readOnly: true
+ description: Data Generation Job resource.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobInputs:
+ type: object
+ required:
+ - name
+ - sources
+ - options
+ - scenario
+ properties:
+ name:
+ type: string
+ description: The display name of the data generation job.
+ sources:
+ type: array
+ items:
+ $ref: '#/components/schemas/DataGenerationJobSource'
+ description: The sources used for the data generation job.
+ options:
+ $ref: '#/components/schemas/DataGenerationJobOptions'
+ description: The options for the data generation job.
+ scenario:
+ $ref: '#/components/schemas/DataGenerationJobScenario'
+ description: The scenario of the data generation job. Either for fine-tuning or evaluation.
+ output_options:
+ $ref: '#/components/schemas/DataGenerationJobOutputOptions'
+ description: Optional caller-supplied metadata for the job's output. See individual fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.
+ description: Caller-supplied inputs for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobOptions:
+ type: object
+ required:
+ - type
+ - max_samples
+ properties:
+ type:
+ $ref: '#/components/schemas/DataGenerationJobType'
+ description: The data generation job type.
+ max_samples:
+ type: integer
+ format: int32
+ description: Maximum number of samples to generate.
+ train_split:
+ type: number
+ format: float
+ minimum: 0
+ maximum: 1
+ description: The proportion of the generated data to be used for training when the data is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1.
+ model_options:
+ $ref: '#/components/schemas/DataGenerationModelOptions'
+ description: The LLM model options.
+ discriminator:
+ propertyName: type
+ mapping:
+ simple_qna: '#/components/schemas/SimpleQnADataGenerationJobOptions'
+ traces: '#/components/schemas/TracesDataGenerationJobOptions'
+ tool_use: '#/components/schemas/ToolUseFineTuningDataGenerationJobOptions'
+ description: Options for managing data generation jobs.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobOutput:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/DataGenerationJobOutputType'
+ description: The type of the output.
+ discriminator:
+ propertyName: type
+ mapping:
+ file: '#/components/schemas/FileDataGenerationJobOutput'
+ dataset: '#/components/schemas/DatasetDataGenerationJobOutput'
+ description: Output information for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobOutputOptions:
+ type: object
+ properties:
+ name:
+ type: string
+ description: Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario).
+ description:
+ type: string
+ description: Description to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs.
+ description: Output options for data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobOutputType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - file
+ - dataset
+ description: The supported output file types for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobResult:
+ type: object
+ required:
+ - generated_samples
+ properties:
+ outputs:
+ type: array
+ items:
+ $ref: '#/components/schemas/DataGenerationJobOutput'
+ description: 'The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.'
+ generated_samples:
+ type: integer
+ format: int32
+ description: The number of samples actually generated.
+ token_usage:
+ $ref: '#/components/schemas/DataGenerationTokenUsage'
+ description: The token usage information for the data generation job.
+ description: Result produced by a successful data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobScenario:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - supervised_finetuning
+ - reinforcement_finetuning
+ - evaluation
+ description: The supported scenarios for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/DataGenerationJobSourceType'
+ description: The type of source.
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ discriminator:
+ propertyName: type
+ mapping:
+ prompt: '#/components/schemas/PromptDataGenerationJobSource'
+ agent: '#/components/schemas/AgentDataGenerationJobSource'
+ traces: '#/components/schemas/TracesDataGenerationJobSource'
+ file: '#/components/schemas/FileDataGenerationJobSource'
+ description: The base source model for data generation jobs.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobSourceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - agent
+ - traces
+ - file
+ description: The supported source types for data generation jobs.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - simple_qna
+ - traces
+ - tool_use
+ description: The supported data generation job types.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationModelOptions:
+ type: object
+ required:
+ - model
+ properties:
+ model:
+ type: string
+ description: Base model name used to generate data.
+ description: LLM model options for data generation jobs.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationTokenUsage:
+ type: object
+ required:
+ - prompt_tokens
+ - completion_tokens
+ - total_tokens
+ properties:
+ prompt_tokens:
+ type: integer
+ format: int64
+ description: The number of prompt tokens used.
+ readOnly: true
+ completion_tokens:
+ type: integer
+ format: int64
+ description: The number of completion tokens generated.
+ readOnly: true
+ total_tokens:
+ type: integer
+ format: int64
+ description: Total number of tokens used.
+ readOnly: true
+ description: Token usage information for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataSourceConfig:
+ type: object
+ required:
+ - type
+ - schema
+ properties:
+ type:
+ type: string
+ description: The data source type discriminator.
+ schema:
+ type: object
+ unevaluatedProperties: {}
+ description: The overall object JSON schema for the run data source items.
+ discriminator:
+ propertyName: type
+ mapping:
+ azure_ai_source: '#/components/schemas/AzureAIDataSourceConfig'
+ description: Base class for run data sources with discriminator support.
+ DatasetDataGenerationJobOutput:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - dataset
+ description: Dataset output.
+ id:
+ type: string
+ description: The id of the output dataset created.
+ readOnly: true
+ name:
+ type: string
+ description: The name of the output dataset.
+ readOnly: true
+ version:
+ type: string
+ description: The version of the output dataset.
+ readOnly: true
+ description:
+ type: string
+ description: Description of the output dataset.
+ readOnly: true
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary of the output dataset.
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/DataGenerationJobOutput'
+ description: Dataset output for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DatasetEvaluatorGenerationJobSource:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ type:
+ type: string
+ enum:
+ - dataset
+ description: The source type for this source, which is Dataset.
+ name:
+ type: string
+ description: The name of the dataset.
+ version:
+ type: string
+ description: The version of the dataset. If not specified, the latest version is used.
+ allOf:
+ - $ref: '#/components/schemas/EvaluatorGenerationJobSource'
+ description: Dataset source for evaluator generation jobs — reference to a dataset.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ DatasetReference:
+ type: object
+ required:
+ - name
+ - version
+ properties:
+ name:
+ type: string
+ description: Dataset name.
+ version:
+ type: string
+ description: Dataset version.
+ description: Reference to a versioned Foundry Dataset.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ DatasetType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - uri_file
+ - uri_folder
+ description: Enum to determine the type of data.
+ DatasetVersion:
+ type: object
+ required:
+ - dataUri
+ - type
+ - name
+ - version
+ properties:
+ dataUri:
+ type: string
+ minLength: 1
+ pattern: '[a-zA-Z0-9_]'
+ description: URI of the data ([example](https://go.microsoft.com/fwlink/?linkid=2202330))
+ type:
+ $ref: '#/components/schemas/DatasetType'
+ description: Dataset type
+ isReference:
+ type: boolean
+ description: Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted
+ readOnly: true
+ connectionName:
+ type: string
+ description: The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset
+ id:
+ type: string
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
+ name:
+ type: string
+ description: The name of the resource
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource
+ readOnly: true
+ discriminator:
+ propertyName: type
+ mapping:
+ uri_file: '#/components/schemas/FileDatasetVersion'
+ uri_folder: '#/components/schemas/FolderDatasetVersion'
+ description: DatasetVersion Definition
+ DatasetVersionUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/DatasetType'
+ description: Dataset type
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ discriminator:
+ propertyName: type
+ mapping:
+ uri_file: '#/components/schemas/FileDatasetVersionUpdate'
+ uri_folder: '#/components/schemas/FolderDatasetVersionUpdate'
+ description: DatasetVersion Definition
+ DayOfWeek:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - Sunday
+ - Monday
+ - Tuesday
+ - Wednesday
+ - Thursday
+ - Friday
+ - Saturday
+ description: Days of the week for recurrence schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ DeleteAgentResponse:
+ type: object
+ required:
+ - object
+ - name
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - agent.deleted
+ description: The object type. Always 'agent.deleted'.
+ name:
+ type: string
+ description: The name of the agent.
+ deleted:
+ type: boolean
+ description: Whether the agent was successfully deleted.
+ description: A deleted agent Object
+ DeleteAgentVersionResponse:
+ type: object
+ required:
+ - object
+ - name
+ - version
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - agent.version.deleted
+ description: The object type. Always 'agent.version.deleted'.
+ name:
+ type: string
+ description: The name of the agent.
+ version:
+ type: string
+ description: The version identifier of the agent.
+ deleted:
+ type: boolean
+ description: Whether the agent was successfully deleted.
+ description: A deleted agent version Object
+ DeleteEvalResponse:
+ type: object
+ required:
+ - object
+ - eval_id
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - eval.deleted
+ description: The object type. Always 'eval.deleted'.
+ eval_id:
+ type: string
+ description: id of the eval.
+ deleted:
+ type: boolean
+ description: Whether the eval was successfully deleted.
+ description: A deleted evaluation Object
+ DeleteEvalRunResponse:
+ type: object
+ properties:
+ object:
+ type: string
+ enum:
+ - eval.deleted
+ description: The object type. Always 'eval.deleted'.
+ run_id:
+ type: string
+ description: id of the eval.
+ deleted:
+ type: boolean
+ description: Whether the eval was successfully deleted.
+ description: A deleted evaluation run Object.
+ DeleteMemoryResponse:
+ type: object
+ required:
+ - object
+ - memory_id
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - memory_store.item.deleted
+ description: The object type. Always 'memory_store.item.deleted'.
+ memory_id:
+ type: string
+ description: The unique ID of the deleted memory item.
+ deleted:
+ type: boolean
+ description: Whether the memory item was successfully deleted.
+ description: Response for deleting a memory item from a memory store.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ DeleteMemoryStoreResponse:
+ type: object
+ required:
+ - object
+ - name
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - memory_store.deleted
+ description: The object type. Always 'memory_store.deleted'.
+ name:
+ type: string
+ description: The name of the memory store.
+ deleted:
+ type: boolean
+ description: Whether the memory store was successfully deleted.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ DeleteResponseResult:
+ type: object
+ required:
+ - id
+ - object
+ - deleted
+ properties:
+ id:
+ type: string
+ description: The operation ID.
+ object:
+ type: string
+ enum:
+ - response
+ description: Always return 'response'.
+ deleted:
+ type: boolean
+ enum:
+ - true
+ description: Always return true
+ description: The result of a delete response operation.
+ DeleteSkillResponse:
+ type: object
+ required:
+ - id
+ - name
+ - deleted
+ properties:
+ id:
+ type: string
+ description: The unique identifier of the deleted skill.
+ name:
+ $ref: '#/components/schemas/SkillName'
+ description: The unique name of the skill.
+ deleted:
+ type: boolean
+ description: Whether the skill was successfully deleted.
+ description: A deleted skill.
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ DeleteSkillVersionResponse:
+ type: object
+ required:
+ - id
+ - name
+ - deleted
+ - version
+ properties:
+ id:
+ type: string
+ description: The unique identifier of the deleted skill version.
+ name:
+ $ref: '#/components/schemas/SkillName'
+ description: The name of the skill.
+ deleted:
+ type: boolean
+ description: Whether the skill version was successfully deleted.
+ version:
+ type: string
+ description: The version that was deleted.
+ description: A deleted skill version.
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ Deployment:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ type:
+ $ref: '#/components/schemas/DeploymentType'
+ description: The type of the deployment
+ name:
+ type: string
+ description: Name of the deployment
+ readOnly: true
+ discriminator:
+ propertyName: type
+ mapping:
+ ModelDeployment: '#/components/schemas/ModelDeployment'
+ description: Model Deployment Definition
+ DeploymentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - ModelDeployment
+ Dimension:
+ type: object
+ required:
+ - id
+ - description
+ - weight
+ properties:
+ id:
+ type: string
+ description: Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. Provided by the user when manually creating a rubric evaluator or during human-in-the-loop review of a generated set; the generation pipeline produces an initial value the user can edit. Editable when saving new versions.
+ description:
+ type: string
+ description: What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and pursues the appropriate workflow').
+ weight:
+ type: integer
+ format: int32
+ minimum: 1
+ maximum: 10
+ description: Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension weight 8-10; all others use 1-6. User edits are not constrained by this heuristic.
+ always_applicable:
+ type: boolean
+ description: When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is not specified by the caller.
+ default: false
+ description: A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ DispatchRoutineRequest:
+ type: object
+ properties:
+ payload:
+ $ref: '#/components/schemas/RoutineDispatchPayload'
+ description: A direct action-input override sent downstream when testing a routine.
+ description: Request body for the public dispatch_async route.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ DispatchRoutineResponse:
+ type: object
+ properties:
+ dispatch_id:
+ type: string
+ description: The dispatch identifier created for the routine dispatch.
+ action_correlation_id:
+ type: string
+ description: A downstream action correlation identifier, when available.
+ task_id:
+ type: string
+ description: A workspace task identifier created for the dispatch, when available.
+ description: Identifiers returned after a routine dispatch is queued.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ EndpointBasedEvaluatorDefinition:
+ type: object
+ required:
+ - type
+ - connection_name
+ properties:
+ type:
+ type: string
+ enum:
+ - endpoint
+ connection_name:
+ type: string
+ minLength: 1
+ description: "Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends `api-key` header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity)."
+ allOf:
+ - $ref: '#/components/schemas/EvaluatorDefinition'
+ description: Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row.
+ EntraAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - Entra
+ allOf:
+ - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ EntraIDCredentials:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - AAD
+ description: The credential type
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: Entra ID credential definition
+ Eval:
+ type: object
+ required:
+ - object
+ - id
+ - name
+ - data_source_config
+ - testing_criteria
+ - created_at
+ - metadata
+ properties:
+ object:
+ type: string
+ enum:
+ - eval
+ description: The object type.
+ x-stainless-const: true
+ default: eval
+ id:
+ type: string
+ description: Unique identifier for the evaluation.
+ name:
+ type: string
+ description: The name of the evaluation.
+ data_source_config:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig'
+ - $ref: '#/components/schemas/AzureAIDataSourceConfig'
+ - $ref: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
+ description: Configuration of data sources used in runs of the evaluation.
+ testing_criteria:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
+ - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
+ description: A list of testing criteria.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the eval was created.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ modified_at:
+ $ref: '#/components/schemas/integer'
+ description: Unix timestamp (in seconds) when the evaluation run was last modified.
+ created_by:
+ type: string
+ description: the name of the person who created the run.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ description: |-
+ 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
+ title: Eval
+ x-oaiMeta:
+ name: The eval object
+ group: evals
+ example: |
+ {
+ "object": "eval",
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "data_source_config": {
+ "type": "custom",
+ "item_schema": {
+ "type": "object",
+ "properties": {
+ "label": {"type": "string"},
+ },
+ "required": ["label"]
+ },
+ "include_sample_schema": true
+ },
+ "testing_criteria": [
+ {
+ "name": "My string check grader",
+ "type": "string_check",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq",
+ }
+ ],
+ "name": "External Data Eval",
+ "created_at": 1739314509,
+ "metadata": {
+ "test": "synthetics",
+ }
+ }
+ EvalCsvFileIdSource:
+ type: object
+ required:
+ - type
+ - id
+ properties:
+ type:
+ type: string
+ enum:
+ - file_id
+ description: The type of source, always `file_id`.
+ id:
+ type: string
+ description: The identifier of the uploaded CSV file.
+ description: Represents a reference to an uploaded CSV file used as a source for evaluation data.
+ EvalCsvRunDataSource:
+ type: object
+ required:
+ - type
+ - source
+ properties:
+ type:
+ type: string
+ enum:
+ - csv
+ description: The type of data source, always `csv`.
+ source:
+ $ref: '#/components/schemas/EvalCsvFileIdSource'
+ description: The source of the CSV data, either inline content or a file reference.
+ allOf:
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Represents a CSV data source for evaluation runs.
+ EvalResult:
+ type: object
+ required:
+ - name
+ - type
+ - score
+ - passed
+ properties:
+ name:
+ type: string
+ description: name of the check
+ type:
+ type: string
+ description: type of the check
+ score:
+ type: number
+ format: float
+ description: score
+ passed:
+ type: boolean
+ description: indicates if the check passed or failed
+ description: Result of the evaluation.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvalRun:
+ type: object
+ required:
+ - object
+ - id
+ - eval_id
+ - status
+ - model
+ - name
+ - created_at
+ - report_url
+ - result_counts
+ - per_model_usage
+ - per_testing_criteria_results
+ - data_source
+ - metadata
+ - error
+ properties:
+ object:
+ type: string
+ enum:
+ - eval.run
+ description: The type of the object. Always "eval.run".
+ x-stainless-const: true
+ default: eval.run
+ id:
+ type: string
+ description: Unique identifier for the evaluation run.
+ eval_id:
+ type: string
+ description: The identifier of the associated evaluation.
+ status:
+ type: string
+ description: The status of the evaluation run.
+ model:
+ type: string
+ description: The model that is evaluated, if applicable.
+ name:
+ type: string
+ description: The name of the evaluation run.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the evaluation run was created.
+ report_url:
+ type: string
+ format: uri
+ description: The URL to the rendered evaluation run report on the UI dashboard.
+ result_counts:
+ $ref: '#/components/schemas/OpenAI.EvalRunResultCounts'
+ description: Counters summarizing the outcomes of the evaluation run.
+ per_model_usage:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalRunPerModelUsage'
+ description: Usage statistics for each model during the evaluation run.
+ per_testing_criteria_results:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults'
+ description: Results per testing criteria applied during the evaluation run.
+ data_source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource'
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Information about the run's data source.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ error:
+ $ref: '#/components/schemas/OpenAI.EvalApiError'
+ modified_at:
+ $ref: '#/components/schemas/integer'
+ description: Unix timestamp (in seconds) when the evaluation run was last modified.
+ created_by:
+ type: string
+ description: the name of the person who created the run.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ evaluation_level:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: The level at which evaluation is performed. Defaults to 'turn' if not specified.
+ default: turn
+ description: A schema representing an evaluation run.
+ title: EvalRun
+ x-oaiMeta:
+ name: The eval run object
+ group: evals
+ example: |
+ {
+ "object": "eval.run",
+ "id": "evalrun_67e57965b480819094274e3a32235e4c",
+ "eval_id": "eval_67e579652b548190aaa83ada4b125f47",
+ "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c",
+ "status": "queued",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Summit Addresses Climate Change Strategies",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Major Retailer Reports Record-Breaking Holiday Sales",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "National Team Qualifies for World Championship Finals",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Manufacturer Announces Merger with Competitor",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Breakthrough in Renewable Energy Technology Unveiled",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "World Leaders Sign Historic Climate Agreement",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Professional Athlete Sets New Record in Championship Event",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Financial Institutions Adapt to New Regulatory Requirements",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Tech Conference Showcases Advances in Artificial Intelligence",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Markets Respond to Oil Price Fluctuations",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Cooperation Strengthened Through New Treaty",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Sports League Announces Revised Schedule for Upcoming Season",
+ "ground_truth": "Sports"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+ EvalRunDataSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ description: The data source type discriminator.
+ discriminator:
+ propertyName: type
+ mapping:
+ azure_ai_traces_preview: '#/components/schemas/TracesPreviewEvalRunDataSource'
+ azure_ai_synthetic_data_gen_preview: '#/components/schemas/SyntheticDataGenerationPreviewEvalRunDataSource'
+ azure_ai_responses: '#/components/schemas/AzureAIResponsesEvalRunDataSource'
+ azure_ai_target_completions: '#/components/schemas/TargetCompletionEvalRunDataSource'
+ csv: '#/components/schemas/EvalCsvRunDataSource'
+ azure_ai_red_team: '#/components/schemas/RedTeamEvalRunDataSource'
+ azure_ai_trace_data_source_preview: '#/components/schemas/AzureAITraceDataSourcePreviewEvalRunDataSource'
+ azure_ai_benchmark_preview: '#/components/schemas/AzureAIBenchmarkPreviewEvalRunDataSource'
+ description: Base class for run data sources with discriminator support.
+ EvalRunOutputItem:
+ type: object
+ required:
+ - object
+ - id
+ - run_id
+ - eval_id
+ - created_at
+ - status
+ - datasource_item_id
+ - datasource_item
+ - results
+ - sample
+ properties:
+ object:
+ type: string
+ enum:
+ - eval.run.output_item
+ description: The type of the object. Always "eval.run.output_item".
+ x-stainless-const: true
+ default: eval.run.output_item
+ id:
+ type: string
+ description: Unique identifier for the evaluation run output item.
+ run_id:
+ type: string
+ description: The identifier of the evaluation run associated with this output item.
+ eval_id:
+ type: string
+ description: The identifier of the evaluation group.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the evaluation run was created.
+ status:
+ type: string
+ description: The status of the evaluation run.
+ datasource_item_id:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The identifier for the data source item.
+ datasource_item:
+ type: object
+ unevaluatedProperties: {}
+ description: Details of the input data source item.
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunOutputItemResult'
+ description: A list of grader results for this output item.
+ sample:
+ $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSample'
+ description: A sample containing the input and output of the evaluation run.
+ description: A schema representing an evaluation run output item.
+ title: EvalRunOutputItem
+ x-oaiMeta:
+ name: The eval run output item object
+ group: evals
+ example: |
+ {
+ "object": "eval.run.output_item",
+ "id": "outputitem_67abd55eb6548190bb580745d5644a33",
+ "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "created_at": 1739314509,
+ "status": "pass",
+ "datasource_item_id": 137,
+ "datasource_item": {
+ "teacher": "To grade essays, I only check for style, content, and grammar.",
+ "student": "I am a student who is trying to write the best essay."
+ },
+ "results": [
+ {
+ "name": "String Check Grader",
+ "type": "string-check-grader",
+ "score": 1.0,
+ "passed": true,
+ }
+ ],
+ "sample": {
+ "input": [
+ {
+ "role": "system",
+ "content": "You are an evaluator bot..."
+ },
+ {
+ "role": "user",
+ "content": "You are assessing..."
+ }
+ ],
+ "output": [
+ {
+ "role": "assistant",
+ "content": "The rubric is not clear nor concise."
+ }
+ ],
+ "finish_reason": "stop",
+ "model": "gpt-4o-2024-08-06",
+ "usage": {
+ "total_tokens": 521,
+ "completion_tokens": 2,
+ "prompt_tokens": 519,
+ "cached_tokens": 0
+ },
+ "error": null,
+ "temperature": 1.0,
+ "max_completion_tokens": 2048,
+ "top_p": 1.0,
+ "seed": 42
+ }
+ }
+ EvalRunOutputItemResult:
+ type: object
+ required:
+ - name
+ - score
+ - passed
+ properties:
+ name:
+ type: string
+ description: The name of the grader.
+ type:
+ type: string
+ description: The grader type (for example, "string-check-grader").
+ score:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The numeric score produced by the grader.
+ passed:
+ type: boolean
+ description: Whether the grader considered the output a pass.
+ sample:
+ anyOf:
+ - type: object
+ unevaluatedProperties: {}
+ - type: 'null'
+ description: Optional sample or intermediate data produced by the grader.
+ status:
+ $ref: '#/components/schemas/EvalRunOutputItemResultStatus'
+ description: 'The evaluation status for this result item. Values: "completed", "errored", "skipped". Null if not provided by evaluator. When status is skipped, passed/score can be ignored.'
+ metric:
+ type: string
+ description: The name of the metric (e.g., "fluency", "f1_score").
+ label:
+ type: string
+ description: The label associated with the test criteria metric (e.g., "pass", "fail", "good", "bad").
+ threshold:
+ type: number
+ format: float
+ description: The threshold used to determine pass/fail for this test criteria, if it is numerical.
+ reason:
+ type: string
+ description: The reason for the test criteria metric.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Additional details about the test criteria metric.
+ unevaluatedProperties: {}
+ description: A single grader result for an evaluation run output item.
+ title: EvalRunOutputItemResult
+ EvalRunOutputItemResultStatus:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - completed
+ - errored
+ - skipped
+ description: The evaluation status for an evaluation run output item result.
+ EvalRunOutputItemSampleInput:
+ type: object
+ required:
+ - role
+ - content
+ - tool_calls
+ properties:
+ role:
+ type: string
+ content:
+ type: string
+ tool_calls:
+ type: array
+ items:
+ $ref: '#/components/schemas/CompletionMessageToolCallChunk'
+ description: Tool calls made within the message, if any.
+ description: A message in the evaluation run.
+ EvalRunOutputItemSampleOutput:
+ type: object
+ required:
+ - tool_calls
+ properties:
+ role:
+ type: string
+ content:
+ type: string
+ tool_calls:
+ type: array
+ items:
+ $ref: '#/components/schemas/CompletionMessageToolCallChunk'
+ description: Tool calls made within the message, if any.
+ description: A message in the evaluation run.
+ EvalRunResultCompareItem:
+ type: object
+ required:
+ - treatmentRunId
+ - treatmentRunSummary
+ - deltaEstimate
+ - pValue
+ - treatmentEffect
+ properties:
+ treatmentRunId:
+ type: string
+ description: The treatment run ID.
+ treatmentRunSummary:
+ $ref: '#/components/schemas/EvalRunResultSummary'
+ description: Summary statistics of the treatment run.
+ deltaEstimate:
+ type: number
+ format: float
+ description: Estimated difference between treatment and baseline.
+ pValue:
+ type: number
+ format: float
+ description: P-value for the treatment effect.
+ treatmentEffect:
+ $ref: '#/components/schemas/TreatmentEffectType'
+ description: Type of treatment effect.
+ description: Metric comparison for a treatment against the baseline.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvalRunResultComparison:
+ type: object
+ required:
+ - testingCriteria
+ - metric
+ - evaluator
+ - baselineRunSummary
+ - compareItems
+ properties:
+ testingCriteria:
+ type: string
+ description: Name of the testing criteria.
+ metric:
+ type: string
+ description: Metric being evaluated.
+ evaluator:
+ type: string
+ description: Name of the evaluator for this testing criteria.
+ baselineRunSummary:
+ $ref: '#/components/schemas/EvalRunResultSummary'
+ description: Summary statistics of the baseline run.
+ compareItems:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunResultCompareItem'
+ description: List of comparison results for each treatment run.
+ description: Comparison results for treatment runs against the baseline.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvalRunResultSummary:
+ type: object
+ required:
+ - runId
+ - sampleCount
+ - average
+ - standardDeviation
+ properties:
+ runId:
+ type: string
+ description: The evaluation run ID.
+ sampleCount:
+ type: integer
+ format: int32
+ description: Number of samples in the evaluation run.
+ average:
+ type: number
+ format: float
+ description: Average value of the metric in the evaluation run.
+ standardDeviation:
+ type: number
+ format: float
+ description: Standard deviation of the metric in the evaluation run.
+ description: Summary statistics of a metric in an evaluation run.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationComparisonInsightRequest:
+ type: object
+ required:
+ - type
+ - evalId
+ - baselineRunId
+ - treatmentRunIds
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationComparison
+ description: The type of request.
+ evalId:
+ type: string
+ description: Identifier for the evaluation.
+ baselineRunId:
+ type: string
+ description: The baseline run ID for comparison.
+ treatmentRunIds:
+ type: array
+ items:
+ type: string
+ description: List of treatment run IDs for comparison.
+ allOf:
+ - $ref: '#/components/schemas/InsightRequest'
+ description: Evaluation Comparison Request
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationComparisonInsightResult:
+ type: object
+ required:
+ - type
+ - comparisons
+ - method
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationComparison
+ description: The type of insights result.
+ comparisons:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunResultComparison'
+ description: Comparison results for each treatment run against the baseline.
+ method:
+ type: string
+ description: The statistical method used for comparison.
+ allOf:
+ - $ref: '#/components/schemas/InsightResult'
+ description: Insights from the evaluation comparison.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationLevel:
+ anyOf:
+ - type: string
+ enum:
+ - turn
+ - conversation
+ - type: string
+ description: The level at which evaluation is performed.
+ EvaluationResultSample:
+ type: object
+ required:
+ - type
+ - evaluationResult
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationResultSample
+ description: Evaluation Result Sample Type
+ evaluationResult:
+ $ref: '#/components/schemas/EvalResult'
+ description: Evaluation result for the analysis sample.
+ allOf:
+ - $ref: '#/components/schemas/InsightSample'
+ description: A sample from the evaluation result.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationRule:
+ type: object
+ required:
+ - id
+ - action
+ - eventType
+ - enabled
+ - systemData
+ properties:
+ id:
+ type: string
+ description: Unique identifier for the evaluation rule.
+ readOnly: true
+ displayName:
+ type: string
+ description: Display Name for the evaluation rule.
+ description:
+ type: string
+ description: Description for the evaluation rule.
+ action:
+ $ref: '#/components/schemas/EvaluationRuleAction'
+ description: Definition of the evaluation rule action.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ filter:
+ $ref: '#/components/schemas/EvaluationRuleFilter'
+ description: Filter condition of the evaluation rule.
+ eventType:
+ $ref: '#/components/schemas/EvaluationRuleEventType'
+ description: Event type that the evaluation rule applies to.
+ enabled:
+ type: boolean
+ description: Indicates whether the evaluation rule is enabled. Default is true.
+ systemData:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: System metadata for the evaluation rule.
+ readOnly: true
+ description: Evaluation rule model.
+ EvaluationRuleAction:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluationRuleActionType'
+ description: Type of the evaluation action.
+ discriminator:
+ propertyName: type
+ mapping:
+ continuousEvaluation: '#/components/schemas/ContinuousEvaluationRuleAction'
+ humanEvaluationPreview: '#/components/schemas/HumanEvaluationPreviewRuleAction'
+ description: Evaluation action model.
+ EvaluationRuleActionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - continuousEvaluation
+ - humanEvaluationPreview
+ description: Type of the evaluation action.
+ EvaluationRuleEventType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - responseCompleted
+ - manual
+ description: Type of the evaluation rule event.
+ EvaluationRuleFilter:
+ type: object
+ required:
+ - agentName
+ properties:
+ agentName:
+ type: string
+ description: Filter by agent name.
+ description: Evaluation filter model.
+ EvaluationRunClusterInsightRequest:
+ type: object
+ required:
+ - type
+ - evalId
+ - runIds
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationRunClusterInsight
+ description: The type of insights request.
+ evalId:
+ type: string
+ description: Evaluation Id for the insights.
+ runIds:
+ type: array
+ items:
+ type: string
+ description: List of evaluation run IDs for the insights.
+ modelConfiguration:
+ $ref: '#/components/schemas/InsightModelConfiguration'
+ description: Configuration of the model used in the insight generation.
+ allOf:
+ - $ref: '#/components/schemas/InsightRequest'
+ description: Insights on set of Evaluation Results
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationRunClusterInsightResult:
+ type: object
+ required:
+ - type
+ - clusterInsight
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationRunClusterInsight
+ description: The type of insights result.
+ clusterInsight:
+ $ref: '#/components/schemas/ClusterInsightResult'
+ allOf:
+ - $ref: '#/components/schemas/InsightResult'
+ description: Insights from the evaluation run cluster analysis.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationScheduleTask:
+ type: object
+ required:
+ - type
+ - evalId
+ - evalRun
+ properties:
+ type:
+ type: string
+ enum:
+ - Evaluation
+ evalId:
+ type: string
+ description: Identifier of the evaluation group.
+ evalRun:
+ type: object
+ unevaluatedProperties: {}
+ description: The evaluation run payload.
+ allOf:
+ - $ref: '#/components/schemas/ScheduleTask'
+ description: Evaluation task for the schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ EvaluationTaxonomy:
+ type: object
+ required:
+ - name
+ - version
+ - taxonomyInput
+ properties:
+ id:
+ type: string
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
+ name:
+ type: string
+ description: The name of the resource
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource
+ readOnly: true
+ taxonomyInput:
+ $ref: '#/components/schemas/EvaluationTaxonomyInput'
+ description: Input configuration for the evaluation taxonomy.
+ taxonomyCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/TaxonomyCategory'
+ description: List of taxonomy categories.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Additional properties for the evaluation taxonomy.
+ description: Evaluation Taxonomy Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyCreateOrUpdate:
+ type: object
+ required:
+ - taxonomyInput
+ properties:
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ taxonomyInput:
+ $ref: '#/components/schemas/EvaluationTaxonomyInput'
+ description: Input configuration for the evaluation taxonomy.
+ taxonomyCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/TaxonomyCategory'
+ description: List of taxonomy categories.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Additional properties for the evaluation taxonomy.
+ description: Evaluation Taxonomy Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyInput:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluationTaxonomyInputType'
+ description: Input type of the evaluation taxonomy.
+ discriminator:
+ propertyName: type
+ mapping:
+ agent: '#/components/schemas/AgentTaxonomyInput'
+ description: Input configuration for the evaluation taxonomy.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyInputType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - agent
+ - policy
+ description: Type of the evaluation taxonomy input.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyInputUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluationTaxonomyInputType'
+ description: Input type of the evaluation taxonomy.
+ discriminator:
+ propertyName: type
+ mapping:
+ agent: '#/components/schemas/AgentTaxonomyInputUpdate'
+ description: Input configuration for the evaluation taxonomy.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyUpdate:
+ type: object
+ properties:
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ taxonomyInput:
+ $ref: '#/components/schemas/EvaluationTaxonomyInputUpdate'
+ description: Input configuration for the evaluation taxonomy.
+ taxonomyCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/TaxonomyCategory'
+ description: List of taxonomy categories.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Additional properties for the evaluation taxonomy.
+ description: Evaluation Taxonomy Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorCategory:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - quality
+ - safety
+ - agents
+ description: The category of the evaluator
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorCredentialRequest:
+ type: object
+ required:
+ - blob_uri
+ properties:
+ blob_uri:
+ type: string
+ format: uri
+ description: 'The blob URI for the evaluator storage. Example: `https://account.blob.core.windows.net:443/container`'
+ description: Request body for getting evaluator credentials
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorDefinition:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluatorDefinitionType'
+ description: The type of evaluator definition
+ init_parameters:
+ type: object
+ unevaluatedProperties: {}
+ description: The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters like type, properties, required.
+ data_schema:
+ type: object
+ unevaluatedProperties: {}
+ description: The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like type, properties, required.
+ metrics:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/EvaluatorMetric'
+ description: List of output metrics produced by this evaluator
+ discriminator:
+ propertyName: type
+ mapping:
+ code: '#/components/schemas/CodeBasedEvaluatorDefinition'
+ prompt: '#/components/schemas/PromptBasedEvaluatorDefinition'
+ rubric: '#/components/schemas/RubricBasedEvaluatorDefinition'
+ endpoint: '#/components/schemas/EndpointBasedEvaluatorDefinition'
+ description: Base evaluator configuration with discriminator
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorDefinitionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - code
+ - prompt_and_code
+ - service
+ - openai_graders
+ - rubric
+ - endpoint
+ description: The type of evaluator definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationArtifacts:
+ type: object
+ required:
+ - dataset
+ - kinds
+ properties:
+ dataset:
+ $ref: '#/components/schemas/DatasetReference'
+ description: Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to `EvaluatorVersion.version`) holding all artifacts produced by the generation pipeline. Each row in the JSONL carries a `kind` field discriminating its content (e.g. `spec`, `tools`, `context`).
+ kinds:
+ type: array
+ items:
+ type: string
+ description: The kinds of rows present in `dataset`. Always contains `"spec"` (the generated evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain `"tools"` (when the generation pipeline produced or inferred OpenAI tool schemas) and/or `"context"` (when supplementary materials such as file uploads or trace samples were used during generation).
+ description: Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationInputs:
+ type: object
+ required:
+ - sources
+ - model
+ - evaluator_name
+ properties:
+ sources:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluatorGenerationJobSource'
+ description: Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry is an `EvaluatorGenerationJobSource` variant discriminated by `type`.
+ model:
+ type: string
+ description: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide their own model rather than relying on service-owned capacity.
+ evaluator_name:
+ type: string
+ minLength: 1
+ maxLength: 256
+ pattern: ^[A-Za-z0-9_.~-]+$
+ description: The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII letters, digits, underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` is reserved for system-managed evaluators and is rejected by the service. If an evaluator with this name already exists in the project (and is rubric-subtype), the service creates a new version under the same name and uses the prior version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive loop). Old versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`.
+ evaluator_display_name:
+ type: string
+ description: Optional human-friendly display name for the resulting evaluator. Surfaced as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier.
+ evaluator_description:
+ type: string
+ description: Optional human-friendly description for the resulting evaluator. Surfaced as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related models.
+ description: Caller-supplied inputs for an evaluator generation job.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationJob:
+ type: object
+ required:
+ - id
+ - status
+ - created_at
+ properties:
+ id:
+ type: string
+ description: Server-assigned unique identifier.
+ readOnly: true
+ inputs:
+ $ref: '#/components/schemas/EvaluatorGenerationInputs'
+ description: Caller-supplied inputs.
+ result:
+ $ref: '#/components/schemas/EvaluatorVersion'
+ description: Result produced on success.
+ readOnly: true
+ status:
+ $ref: '#/components/schemas/JobStatus'
+ description: Current lifecycle status.
+ readOnly: true
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error details — populated only on failure.
+ readOnly: true
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).
+ readOnly: true
+ finished_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).
+ readOnly: true
+ usage:
+ $ref: '#/components/schemas/EvaluatorGenerationTokenUsage'
+ description: Token consumption summary. Populated when the job reaches a terminal state.
+ readOnly: true
+ input_quality_warnings:
+ type: array
+ items:
+ $ref: '#/components/schemas/RubricGenerationInputQualityWarning'
+ description: Non-fatal input-quality advisories produced by the generation pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. Omitted when generation was clean. Cleared when a subsequent `PATCH` to the paired `EvaluatorVersion.definition` invalidates the advisories.
+ readOnly: true
+ description: Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationJobCreate:
+ type: object
+ properties:
+ inputs:
+ $ref: '#/components/schemas/EvaluatorGenerationInputs'
+ description: Caller-supplied inputs.
+ description: Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationJobSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluatorGenerationJobSourceType'
+ description: The type of source.
+ discriminator:
+ propertyName: type
+ mapping:
+ prompt: '#/components/schemas/PromptEvaluatorGenerationJobSource'
+ agent: '#/components/schemas/AgentEvaluatorGenerationJobSource'
+ traces: '#/components/schemas/TracesEvaluatorGenerationJobSource'
+ dataset: '#/components/schemas/DatasetEvaluatorGenerationJobSource'
+ description: The base source model for evaluator generation jobs. Polymorphic over `type`.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationJobSourceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - agent
+ - traces
+ - dataset
+ description: The supported source types for evaluator generation jobs.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationTokenUsage:
+ type: object
+ required:
+ - input_tokens
+ - output_tokens
+ - total_tokens
+ properties:
+ input_tokens:
+ type: integer
+ format: int64
+ description: Number of input (prompt) tokens consumed.
+ output_tokens:
+ type: integer
+ format: int64
+ description: Number of output (completion) tokens generated.
+ total_tokens:
+ type: integer
+ format: int64
+ description: Total tokens consumed (input + output).
+ description: Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorMetric:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluatorMetricType'
+ description: Type of the metric.
+ desirable_direction:
+ $ref: '#/components/schemas/EvaluatorMetricDirection'
+ description: It indicates whether a higher value is better or a lower value is better for this metric.
+ min_value:
+ type: number
+ format: float
+ description: Minimum value for the metric
+ max_value:
+ type: number
+ format: float
+ description: Maximum value for the metric. If not specified, it is assumed to be unbounded.
+ threshold:
+ type: number
+ format: float
+ description: Default pass/fail threshold for this metric.
+ is_primary:
+ type: boolean
+ description: Indicates if this metric is primary when there are multiple metrics.
+ description: Evaluator Metric
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorMetricDirection:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - increase
+ - decrease
+ - neutral
+ description: The direction of the metric indicating whether a higher value is better, a lower value is better, or neutral
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorMetricType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - ordinal
+ - continuous
+ - boolean
+ description: The type of the evaluator
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - builtin
+ - custom
+ description: The type of the evaluator
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorVersion:
+ type: object
+ required:
+ - evaluator_type
+ - categories
+ - definition
+ - created_by
+ - created_at
+ - modified_at
+ - name
+ - version
+ properties:
+ display_name:
+ type: string
+ description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Metadata about the evaluator
+ evaluator_type:
+ $ref: '#/components/schemas/EvaluatorType'
+ description: The type of the evaluator
+ categories:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluatorCategory'
+ description: The categories of the evaluator
+ supported_evaluation_levels:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
+ default:
+ - turn
+ definition:
+ $ref: '#/components/schemas/EvaluatorDefinition'
+ description: Definition of the evaluator
+ generation_artifacts:
+ $ref: '#/components/schemas/EvaluatorGenerationArtifacts'
+ description: Provenance artifacts from the generation pipeline. Read-only; present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry Dataset.
+ readOnly: true
+ generation_job_id:
+ type: string
+ description: Read-only provenance link back to the EvaluatorGenerationJob that produced this version. Present only on evaluator versions created via the generation pipeline; absent for manually-created versions and unaffected by subsequent `PATCH` calls.
+ readOnly: true
+ warnings:
+ type: array
+ items:
+ $ref: '#/components/schemas/GenerationWarningType'
+ description: Categories of warnings surfaced on this generated evaluator version. Present only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent (treat as no warnings) when the version is not from generation, when the paired job was clean, or when a subsequent `PATCH` to `definition` cleared the paired job's advisories. Follow `generation_job_id` to fetch the detailed warning payloads.
+ readOnly: true
+ created_by:
+ type: string
+ description: Creator of the evaluator
+ readOnly: true
+ created_at:
+ type: string
+ description: Creation date/time of the evaluator
+ readOnly: true
+ modified_at:
+ type: string
+ description: Last modified date/time of the evaluator
+ readOnly: true
+ id:
+ type: string
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
+ name:
+ type: string
+ description: The name of the resource
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource
+ readOnly: true
+ description: Evaluator Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorVersionCreate:
+ type: object
+ required:
+ - evaluator_type
+ - categories
+ - definition
+ properties:
+ display_name:
+ type: string
+ description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Metadata about the evaluator
+ evaluator_type:
+ $ref: '#/components/schemas/EvaluatorType'
+ description: The type of the evaluator
+ categories:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluatorCategory'
+ description: The categories of the evaluator
+ supported_evaluation_levels:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
+ default:
+ - turn
+ definition:
+ $ref: '#/components/schemas/EvaluatorDefinition'
+ description: Definition of the evaluator
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ description: Evaluator Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorVersionUpdate:
+ type: object
+ properties:
+ display_name:
+ type: string
+ description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Metadata about the evaluator
+ categories:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluatorCategory'
+ description: The categories of the evaluator
+ supported_evaluation_levels:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
+ default:
+ - turn
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ description: Evaluator Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ ExternalAgentDefinition:
+ type: object
+ required:
+ - kind
+ properties:
+ kind:
+ type: string
+ enum:
+ - external
+ otel_agent_id:
+ type: string
+ description: |-
+ The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry agent.
+ Spans must include the attribute `gen_ai.agent.id = ` to appear under this registration.
+ Defaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios
+ where the running external agent already emits a stable id that differs from the Foundry agent name.
+ The resolved value is always echoed on read.
+ allOf:
+ - $ref: '#/components/schemas/AgentDefinition'
+ description: |-
+ The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS).
+ Registration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations)
+ over customer-emitted OpenTelemetry data.
+ x-ms-foundry-meta:
+ required_previews:
+ - ExternalAgents=V1Preview
+ FabricDataAgentToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - fabric_dataagent_preview_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A Fabric data agent tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FabricDataAgentToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - fabric_dataagent_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Fabric data agent tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a Fabric data agent tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FabricDataAgentToolParameters:
+ type: object
+ properties:
+ project_connections:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolProjectConnection'
+ maxItems: 1
+ description: |-
+ The project connections attached to this tool. There can be a maximum of 1 connection
+ resource attached to the tool.
+ description: The fabric data agent tool parameters.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FabricIQPreviewTool:
+ type: object
+ required:
+ - type
+ - project_connection_id
+ properties:
+ type:
+ type: string
+ enum:
+ - fabric_iq_preview
+ description: The object type, which is always 'fabric_iq_preview'.
+ project_connection_id:
+ type: string
+ description: The ID of the FabricIQ project connection.
+ server_label:
+ type: string
+ description: (Optional) The label of the FabricIQ MCP server to connect to.
+ server_url:
+ type: string
+ format: uri
+ description: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used.
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ - type: 'null'
+ description: (Optional) Whether the agent requires approval before executing actions. Default is always.
+ default: always
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A FabricIQ server-side tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FabricIQPreviewToolboxTool:
+ type: object
+ required:
+ - type
+ - project_connection_id
+ properties:
+ type:
+ type: string
+ enum:
+ - fabric_iq_preview
+ project_connection_id:
+ type: string
+ description: The ID of the FabricIQ project connection.
+ server_label:
+ type: string
+ description: (Optional) The label of the FabricIQ MCP server to connect to.
+ server_url:
+ type: string
+ format: uri
+ description: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used.
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ - type: 'null'
+ description: (Optional) Whether the agent requires approval before executing actions. Default is always.
+ default: always
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A FabricIQ tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FileDataGenerationJobOutput:
+ type: object
+ required:
+ - type
+ - id
+ - filename
+ properties:
+ type:
+ type: string
+ enum:
+ - file
+ description: Azure OpenAI file output.
+ id:
+ type: string
+ description: The id of the output Azure OpenAI file.
+ readOnly: true
+ filename:
+ type: string
+ description: The filename of the output Azure OpenAI file.
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/DataGenerationJobOutput'
+ description: Azure OpenAI file output for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ FileDataGenerationJobSource:
+ type: object
+ required:
+ - type
+ - id
+ properties:
+ type:
+ type: string
+ enum:
+ - file
+ description: The source type for this job, which is File.
+ id:
+ type: string
+ description: Input Azure Open AI file id used for data generation.
+ allOf:
+ - $ref: '#/components/schemas/DataGenerationJobSource'
+ description: File source for data generation jobs — Azure OpenAI file input.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ FileDatasetVersion:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - uri_file
+ description: Dataset type
+ allOf:
+ - $ref: '#/components/schemas/DatasetVersion'
+ description: FileDatasetVersion Definition
+ FileDatasetVersionUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - uri_file
+ description: Dataset type
+ allOf:
+ - $ref: '#/components/schemas/DatasetVersionUpdate'
+ description: FileDatasetVersion Definition
+ FileSearchToolboxTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - file_search
+ max_num_results:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.RankingOptions'
+ description: Ranking options for search.
+ filters:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Filters'
+ - type: 'null'
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ description: The IDs of the vector stores to search.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A file search tool stored in a toolbox.
+ FilterStrategyType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - random_sampling
+ - smart_filtering
+ description: Specifies the type of filter strategy used to select traces for evaluation.
+ FixedRatioVersionSelectionRule:
+ type: object
+ required:
+ - type
+ - traffic_percentage
+ properties:
+ type:
+ type: string
+ enum:
+ - FixedRatio
+ traffic_percentage:
+ type: integer
+ format: int32
+ minimum: 0
+ maximum: 100
+ description: The percentage of traffic to route to the version. Must be between 0 and 100.
+ allOf:
+ - $ref: '#/components/schemas/VersionSelectionRule'
+ FolderDatasetVersion:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - uri_folder
+ description: Dataset type
+ allOf:
+ - $ref: '#/components/schemas/DatasetVersion'
+ description: FileDatasetVersion Definition
+ FolderDatasetVersionUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - uri_folder
+ description: Dataset type
+ allOf:
+ - $ref: '#/components/schemas/DatasetVersionUpdate'
+ description: FileDatasetVersion Definition
+ FoundryModelArtifactProfileCategory:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - DataOnly
+ - RuntimeDependent
+ - Unknown
+ description: The artifact profile category.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelArtifactProfileSignal:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - PickleDeserialization
+ - CustomPythonCode
+ - DynamicOps
+ - NativeBinary
+ - UnknownFormat
+ description: Signals detected in the model artifact.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelSourceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - LocalUpload
+ - TrainingJob
+ description: The source type of the model.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelWarning:
+ type: object
+ properties:
+ code:
+ $ref: '#/components/schemas/FoundryModelWarningCode'
+ description: The warning code.
+ message:
+ type: string
+ description: The warning message.
+ description: A warning associated with a model.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelWarningCode:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - RuntimeDependentArtifact
+ - UnclassifiedArtifact
+ description: Warning code for model artifacts.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelWeightType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - FullWeight
+ - LoRA
+ - DraftModel
+ description: The weight type of the model.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryTimestamp:
+ type: integer
+ format: unixtime
+ FunctionToolCall:
+ type: object
+ required:
+ - name
+ - arguments
+ properties:
+ name:
+ type: string
+ description: The name of the function to call.
+ arguments:
+ type: string
+ description: The arguments to call the function with, as generated by the model in JSON format.
+ description: Details of a function tool call.
+ GenerationWarningType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - input_quality
+ description: Category of a warning surfaced on a generated evaluator version. Extensible so new warning categories (e.g., safety, output quality) can be introduced without a breaking change.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ GitHubIssueEvent:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - opened
+ - closed
+ description: Known GitHub issue events that can fire a routine.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ GitHubIssueRoutineTrigger:
+ type: object
+ required:
+ - type
+ - connection_id
+ - owner
+ - repository
+ - issue_event
+ properties:
+ type:
+ type: string
+ enum:
+ - github_issue
+ description: The trigger type.
+ connection_id:
+ type: string
+ maxLength: 256
+ description: The workspace connection identifier that resolves the GitHub configuration for the trigger.
+ owner:
+ type: string
+ maxLength: 128
+ description: The GitHub owner or organization that scopes which issues can fire the trigger.
+ repository:
+ type: string
+ maxLength: 128
+ description: The GitHub repository filter that scopes which issues can fire the trigger.
+ issue_event:
+ $ref: '#/components/schemas/GitHubIssueEvent'
+ description: The GitHub issue event that fires the routine.
+ allOf:
+ - $ref: '#/components/schemas/RoutineTrigger'
+ description: A GitHub issue routine trigger.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ HeaderTelemetryEndpointAuth:
type: object
required:
- type
+ - header_name
+ - secret_id
+ - secret_key
properties:
type:
type: string
enum:
- - a2a_preview
- description: The type of the tool. Always `"a2a_preview`.
- base_url:
+ - header
+ description: The authentication type, always 'header' for header-based secret authentication.
+ header_name:
type: string
- format: uri
- description: Base URL of the agent.
- agent_card_path:
+ description: The name of the HTTP header to inject the secret value into.
+ examples:
+ - X-Otlp-Api-Key
+ secret_id:
type: string
- description: |-
- The path to the agent card relative to the `base_url`.
- If not provided, defaults to `/.well-known/agent-card.json`
- project_connection_id:
+ description: The identifier of the secret store or connection.
+ examples:
+ - my-secret-store
+ secret_key:
type: string
- description: |-
- The connection ID in the project for the A2A server.
- The connection stores authentication and other connection details needed to connect to the A2A server.
- send_credentials_for_agent_card:
- type: boolean
- description: |-
- When `true`, Foundry sends its credentials when fetching the remote
- agent's Agent Card. The service defaults to `false` if a value is not
- specified by the caller (anonymous fetch).
- default: false
+ description: The key within the secret to retrieve the authentication value.
+ examples:
+ - OTLP_KEY
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: An agent implementing the A2A protocol.
- A2APreviewToolboxTool:
+ - $ref: '#/components/schemas/TelemetryEndpointAuth'
+ description: Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header.
+ HostedAgentDefinition:
type: object
required:
- - type
+ - kind
+ - cpu
+ - memory
properties:
- type:
+ kind:
type: string
enum:
- - a2a_preview
- base_url:
- type: string
- format: uri
- description: Base URL of the agent.
- agent_card_path:
+ - hosted
+ cpu:
type: string
- description: |-
- The path to the agent card relative to the `base_url`.
- If not provided, defaults to `/.well-known/agent-card.json`
- project_connection_id:
+ description: The CPU configuration for the hosted agent.
+ examples:
+ - '0.25'
+ memory:
type: string
- description: |-
- The connection ID in the project for the A2A server.
- The connection stores authentication and other connection details needed to connect to the A2A server.
- send_credentials_for_agent_card:
- type: boolean
- description: |-
- When `true`, Foundry sends its credentials when fetching the remote
- agent's Agent Card. The service defaults to `false` if a value is not
- specified by the caller (anonymous fetch).
- default: false
+ description: The memory configuration for the hosted agent.
+ examples:
+ - 0.5Gi
+ environment_variables:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Environment variables to set in the hosted agent container.
+ examples:
+ - name: LOG_LEVEL
+ value: debug
+ container_configuration:
+ $ref: '#/components/schemas/ContainerConfiguration'
+ description: Container-based deployment configuration. Provide this for image-based deployments. Mutually exclusive with code_configuration — the service validates that exactly one is set.
+ protocol_versions:
+ type: array
+ items:
+ $ref: '#/components/schemas/ProtocolVersionRecord'
+ description: The protocols that the agent supports for ingress communication.
+ examples:
+ - - protocol: responses
+ version: v0.1.1
+ - protocol: a2a
+ version: v0.3.0
+ code_configuration:
+ $ref: '#/components/schemas/CodeConfiguration'
+ description: Code-based deployment configuration. Provide this for code-based deployments. Mutually exclusive with container_configuration — the service validates that exactly one is set.
+ telemetry_config:
+ $ref: '#/components/schemas/TelemetryConfig'
+ description: Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics.
allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: An A2A tool stored in a toolbox.
- A2AProtocolConfiguration:
- type: object
- description: Configuration specific to the A2A protocol.
- A2AToolCall:
+ - $ref: '#/components/schemas/AgentDefinition'
+ description: The hosted agent definition.
+ HourlyRecurrenceSchedule:
type: object
required:
- type
- - call_id
- - name
- - arguments
- - status
properties:
type:
type: string
enum:
- - a2a_preview_call
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- name:
- type: string
- description: The name of the A2A agent card being called.
- arguments:
- type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ - Hourly
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An A2A (Agent-to-Agent) tool call.
- A2AToolCallOutput:
+ - $ref: '#/components/schemas/RecurrenceSchedule'
+ description: Hourly recurrence schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ HumanEvaluationPreviewRuleAction:
type: object
required:
- type
- - call_id
- - name
- - status
+ - templateId
properties:
type:
type: string
enum:
- - a2a_preview_call_output
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- name:
- type: string
- description: The name of the A2A agent card that was called.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the A2A tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ - humanEvaluationPreview
+ templateId:
+ $ref: '#/components/schemas/AssetId'
+ description: Human evaluation template Id.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of an A2A (Agent-to-Agent) tool call.
- AISearchIndexResource:
+ - $ref: '#/components/schemas/EvaluationRuleAction'
+ description: Evaluation rule action for human evaluation.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ Index:
type: object
+ required:
+ - type
+ - name
+ - version
properties:
- project_connection_id:
- type: string
- description: An index connection ID in an IndexResource attached to this agent.
- index_name:
+ type:
+ $ref: '#/components/schemas/IndexType'
+ description: Type of index
+ id:
type: string
- description: The name of an index in an IndexResource attached to this agent.
- query_type:
- $ref: '#/components/schemas/AzureAISearchQueryType'
- description: Type of query in an AIIndexResource attached to this agent.
- top_k:
- type: integer
- format: int32
- description: Number of documents to retrieve from search and present to the model.
- filter:
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
+ name:
type: string
- description: filter string for search resource. [Learn more here](https://learn.microsoft.com/azure/search/search-filters).
- index_asset_id:
+ description: The name of the resource
+ readOnly: true
+ version:
type: string
- description: Index asset id for search resource.
- description: A AI Search Index resource.
- ActivityProtocolConfiguration:
- type: object
- properties:
- enable_m365_public_endpoint:
- type: boolean
- description: Whether to enable the M365 public endpoint for the activity protocol.
- description: Configuration specific to the activity protocol.
- AgentBlueprintReference:
+ description: The version of the resource
+ readOnly: true
+ discriminator:
+ propertyName: type
+ mapping:
+ AzureSearch: '#/components/schemas/AzureAISearchIndex'
+ ManagedAzureSearch: '#/components/schemas/ManagedAzureAISearchIndex'
+ CosmosDBNoSqlVectorStore: '#/components/schemas/CosmosDBIndex'
+ description: Index resource Definition
+ IndexType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - AzureSearch
+ - CosmosDBNoSqlVectorStore
+ - ManagedAzureSearch
+ IndexUpdate:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/AgentBlueprintReferenceType'
+ $ref: '#/components/schemas/IndexType'
+ description: Type of index
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
discriminator:
propertyName: type
mapping:
- ManagedAgentIdentityBlueprint: '#/components/schemas/ManagedAgentIdentityBlueprintReference'
- AgentBlueprintReferenceType:
- anyOf:
- - type: string
- - type: string
- enum:
- - ManagedAgentIdentityBlueprint
- AgentCard:
+ AzureSearch: '#/components/schemas/AzureAISearchIndexUpdate'
+ ManagedAzureSearch: '#/components/schemas/ManagedAzureAISearchIndexUpdate'
+ CosmosDBNoSqlVectorStore: '#/components/schemas/CosmosDBIndexUpdate'
+ description: Index resource Definition
+ Insight:
type: object
required:
- - version
- - skills
+ - id
+ - metadata
+ - state
+ - displayName
+ - request
properties:
- version:
+ id:
type: string
- minLength: 1
- maxLength: 32
- description: The version of the agent card.
- description:
+ description: The unique identifier for the insights report.
+ readOnly: true
+ metadata:
+ $ref: '#/components/schemas/InsightsMetadata'
+ description: Metadata about the insights report.
+ readOnly: true
+ state:
+ $ref: '#/components/schemas/Azure.Core.Foundations.OperationState'
+ description: The current state of the insights.
+ readOnly: true
+ displayName:
type: string
- maxLength: 2048
- description: The description of the agent card.
- skills:
- type: array
- items:
- $ref: '#/components/schemas/AgentCardSkill'
- minItems: 1
- maxItems: 16
- description: The set of skills that an agent can perform.
- AgentCardSkill:
+ description: User friendly display name for the insight.
+ request:
+ $ref: '#/components/schemas/InsightRequest'
+ description: Request for the insights analysis.
+ result:
+ $ref: '#/components/schemas/InsightResult'
+ description: The result of the insights report.
+ readOnly: true
+ description: The response body for cluster insights.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightCluster:
type: object
required:
- id
- - name
+ - label
+ - suggestion
+ - suggestionTitle
+ - description
+ - weight
properties:
id:
type: string
- minLength: 1
- maxLength: 64
- description: a unique identifier for the skill
- name:
+ description: The id of the analysis cluster.
+ label:
type: string
- minLength: 1
- maxLength: 128
- description: The name of the skill
+ description: Label for the cluster
+ suggestion:
+ type: string
+ description: Suggestion for the cluster
+ suggestionTitle:
+ type: string
+ description: The title of the suggestion for the cluster
description:
type: string
- maxLength: 2048
- description: A description of the skill
- tags:
+ description: Description of the analysis cluster.
+ weight:
+ type: integer
+ format: int32
+ description: The weight of the analysis cluster. This indicate number of samples in the cluster.
+ subClusters:
+ description: List of subclusters within this cluster. Empty if no subclusters exist.
type: array
items:
- $ref: '#/components/schemas/AgentCardSkillTag'
- maxItems: 5
- description: set of tagwords describing classes of capabilities for the skill
- examples:
+ $ref: '#/components/schemas/InsightCluster'
+ samples:
type: array
items:
- $ref: '#/components/schemas/AgentCardSkillExample'
- maxItems: 5
- description: A list of example scenarios that the skill can perform.
- AgentCardSkillExample:
- type: string
- maxLength: 1024
- description: A skill example string with a maximum length of 1024 characters.
- AgentCardSkillTag:
- type: string
- maxLength: 32
- AgentCardUpdate:
+ $ref: '#/components/schemas/InsightSample'
+ description: List of samples that belong to this cluster. Empty if samples are part of subclusters.
+ description: A cluster of analysis samples.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightModelConfiguration:
type: object
+ required:
+ - modelDeploymentName
properties:
- version:
- type: string
- minLength: 1
- maxLength: 32
- description: The version of the agent card.
- description:
+ modelDeploymentName:
type: string
- maxLength: 2048
- description: The description of the agent card.
- skills:
- type: array
- items:
- $ref: '#/components/schemas/AgentCardSkill'
- minItems: 1
- maxItems: 16
- description: The set of skills that an agent can perform.
- AgentClusterInsightRequest:
+ description: The model deployment to be evaluated. Accepts either the deployment name alone or with the connection name as '{connectionName}/'.
+ description: Configuration of the model used in the insight generation.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightRequest:
type: object
required:
- type
- - agentName
properties:
type:
- type: string
- enum:
- - AgentClusterInsight
+ $ref: '#/components/schemas/InsightType'
description: The type of request.
- agentName:
+ discriminator:
+ propertyName: type
+ mapping:
+ EvaluationRunClusterInsight: '#/components/schemas/EvaluationRunClusterInsightRequest'
+ AgentClusterInsight: '#/components/schemas/AgentClusterInsightRequest'
+ EvaluationComparison: '#/components/schemas/EvaluationComparisonInsightRequest'
+ description: The request of the insights report.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightResult:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/InsightType'
+ description: The type of insights result.
+ discriminator:
+ propertyName: type
+ mapping:
+ EvaluationComparison: '#/components/schemas/EvaluationComparisonInsightResult'
+ EvaluationRunClusterInsight: '#/components/schemas/EvaluationRunClusterInsightResult'
+ AgentClusterInsight: '#/components/schemas/AgentClusterInsightResult'
+ description: The result of the insights.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightSample:
+ type: object
+ required:
+ - id
+ - type
+ - features
+ - correlationInfo
+ properties:
+ id:
type: string
- description: Identifier for the agent.
- modelConfiguration:
- $ref: '#/components/schemas/InsightModelConfiguration'
- description: Configuration of the model used in the insight generation.
- allOf:
- - $ref: '#/components/schemas/InsightRequest'
- description: Insights on set of Agent Evaluation Results
+ description: The unique identifier for the analysis sample.
+ type:
+ $ref: '#/components/schemas/SampleType'
+ description: Sample type
+ features:
+ type: object
+ unevaluatedProperties: {}
+ description: Features to help with additional filtering of data in UX.
+ correlationInfo:
+ type: object
+ unevaluatedProperties: {}
+ description: Info about the correlation for the analysis sample.
+ discriminator:
+ propertyName: type
+ mapping:
+ EvaluationResultSample: '#/components/schemas/EvaluationResultSample'
+ description: A sample from the analysis.
x-ms-foundry-meta:
conditional_previews:
- Insights=V1Preview
- AgentClusterInsightResult:
+ InsightScheduleTask:
type: object
required:
- type
- - clusterInsight
+ - insight
properties:
type:
type: string
enum:
+ - Insight
+ insight:
+ $ref: '#/components/schemas/Insight'
+ description: The insight payload.
+ allOf:
+ - $ref: '#/components/schemas/ScheduleTask'
+ description: Insight task for the schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ InsightSummary:
+ type: object
+ required:
+ - sampleCount
+ - uniqueSubclusterCount
+ - uniqueClusterCount
+ - method
+ - usage
+ properties:
+ sampleCount:
+ type: integer
+ format: int32
+ description: Total number of samples analyzed.
+ uniqueSubclusterCount:
+ type: integer
+ format: int32
+ description: Total number of unique subcluster labels.
+ uniqueClusterCount:
+ type: integer
+ format: int32
+ description: Total number of unique clusters.
+ method:
+ type: string
+ description: Method used for clustering.
+ usage:
+ $ref: '#/components/schemas/ClusterTokenUsage'
+ description: Token usage while performing clustering analysis
+ description: Summary of the error cluster analysis.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - EvaluationRunClusterInsight
- AgentClusterInsight
- description: The type of insights result.
- clusterInsight:
- $ref: '#/components/schemas/ClusterInsightResult'
- allOf:
- - $ref: '#/components/schemas/InsightResult'
- description: Insights from the agent cluster analysis.
+ - EvaluationComparison
+ description: The request of the insights.
x-ms-foundry-meta:
conditional_previews:
- Insights=V1Preview
- AgentDataGenerationJobSource:
+ InsightsMetadata:
type: object
required:
- - type
- - agent_name
+ - createdAt
properties:
- description:
- type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
- type:
- type: string
- enum:
- - agent
- description: The source type for this source, which is Agent.
- agent_name:
+ createdAt:
type: string
- description: The agent name to fetch instructions from.
- agent_version:
+ format: date-time
+ description: The timestamp when the insights were created.
+ completedAt:
type: string
- description: The agent version. If not specified, the latest version is used.
- allOf:
- - $ref: '#/components/schemas/DataGenerationJobSource'
- description: Agent source for data generation jobs — references an agent to fetch instructions and metadata from.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- AgentDefinition:
- type: object
- required:
- - kind
- properties:
- kind:
- $ref: '#/components/schemas/AgentKind'
- rai_config:
- $ref: '#/components/schemas/RaiConfig'
- description: Configuration for Responsible AI (RAI) content filtering and safety features.
- discriminator:
- propertyName: kind
- mapping:
- hosted: '#/components/schemas/HostedAgentDefinition'
- prompt: '#/components/schemas/PromptAgentDefinition'
- workflow: '#/components/schemas/WorkflowAgentDefinition'
- external: '#/components/schemas/ExternalAgentDefinition'
+ format: date-time
+ description: The timestamp when the insights were completed.
+ description: Metadata about the insights.
x-ms-foundry-meta:
conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- AgentDefinitionOptInKeys:
- type: string
- enum:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- description: Feature opt-in keys for agent definition operations supporting hosted or workflow agents.
- AgentEndpointAuthorizationScheme:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/AgentEndpointAuthorizationSchemeType'
- discriminator:
- propertyName: type
- mapping:
- Entra: '#/components/schemas/EntraAuthorizationScheme'
- BotService: '#/components/schemas/BotServiceAuthorizationScheme'
- BotServiceRbac: '#/components/schemas/BotServiceRbacAuthorizationScheme'
- BotServiceTenant: '#/components/schemas/BotServiceTenantAuthorizationScheme'
- AgentEndpointAuthorizationSchemeType:
- anyOf:
- - type: string
- - type: string
- enum:
- - Entra
- - BotService
- - BotServiceRbac
- - BotServiceTenant
- AgentEndpointConfig:
+ - Insights=V1Preview
+ InvocationsProtocolConfiguration:
type: object
- properties:
- version_selector:
- $ref: '#/components/schemas/VersionSelector'
- description: The version selector of the agent endpoint determines how traffic is routed to different versions of the agent.
- protocol_configuration:
- $ref: '#/components/schemas/ProtocolConfiguration'
- description: Per-protocol configuration for the agent endpoint.
- authorization_schemes:
- type: array
- items:
- $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- description: The authorization schemes supported by the agent endpoint
- AgentEndpointConfigUpdate:
+ description: Configuration specific to the invocations protocol.
+ InvocationsWsProtocolConfiguration:
type: object
- properties:
- version_selector:
- $ref: '#/components/schemas/VersionSelectorUpdate'
- description: The version selector of the agent endpoint determines how traffic is routed to different versions of the agent.
- protocol_configuration:
- $ref: '#/components/schemas/ProtocolConfiguration'
- description: Per-protocol configuration for the agent endpoint.
- authorization_schemes:
- type: array
- items:
- $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- description: The authorization schemes supported by the agent endpoint
- AgentEndpointProtocol:
- anyOf:
- - type: string
- - type: string
- enum:
- - activity
- - responses
- - a2a
- - mcp
- - invocations
- - invocations_ws
- AgentEvaluatorGenerationJobSource:
+ description: Configuration specific to the WebSocket-based invocations protocol.
+ InvokeAgentInvocationsApiDispatchPayload:
type: object
required:
- type
- - agent_name
+ - input
properties:
- description:
- type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
type:
type: string
enum:
- - agent
- description: The source type for this source, which is Agent.
- agent_name:
- type: string
- description: The agent name to fetch instructions from.
- agent_version:
- type: string
- description: The agent version. If not specified, the latest version is used.
+ - invoke_agent_invocations_api
+ description: The manual dispatch payload type.
+ input:
+ description: The JSON value sent as the complete downstream invocations input. The value is passed through as-is and can be an object, string, number, boolean, array, or null.
allOf:
- - $ref: '#/components/schemas/EvaluatorGenerationJobSource'
- description: Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from.
+ - $ref: '#/components/schemas/RoutineDispatchPayload'
+ description: A manual payload used to test an invocations API routine dispatch.
x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- AgentFilterTraceSource:
+ conditional_previews:
+ - Routines=V1Preview
+ InvokeAgentInvocationsApiRoutineAction:
type: object
required:
- type
@@ -11566,311 +44098,247 @@ components:
type:
type: string
enum:
- - agent_filter
- description: The type of trace source, always `agent_filter`.
- agent_id:
- type: string
- description: The identifier of the agent to filter traces by.
+ - invoke_agent_invocations_api
+ description: The action type.
agent_name:
type: string
- description: The name of the agent to filter traces by.
- agent_version:
- type: string
- description: The version of the agent to filter traces by.
- start_time:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: Start time for the trace query window, expressed as a Unix timestamp (seconds).
- end_time:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: End time for the trace query window, expressed as a Unix timestamp (seconds).
- max_traces:
- type: integer
- format: int32
- description: Maximum number of traces to sample. Must be greater than 0.
- filter_strategy:
- $ref: '#/components/schemas/FilterStrategyType'
- description: The strategy used to filter traces.
- allOf:
- - $ref: '#/components/schemas/TraceSource'
- description: A trace source that selects traces by agent reference with time-based filtering.
- AgentIdentity:
- type: object
- required:
- - principal_id
- - client_id
- properties:
- principal_id:
+ maxLength: 256
+ description: The project-scoped agent name for routine dispatch.
+ agent_endpoint_id:
type: string
- description: The principal ID of the agent instance
- client_id:
+ maxLength: 256
+ description: Legacy endpoint-scoped agent identifier for routine dispatch.
+ input:
+ description: Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
+ session_id:
type: string
- description: The client ID of the agent instance. Also referred to as the instance ID
- AgentKind:
- anyOf:
- - type: string
- - type: string
- enum:
- - prompt
- - hosted
- - workflow
- - external
- AgentObject:
+ maxLength: 256
+ description: An optional existing hosted-agent session identifier to continue during the downstream dispatch.
+ allOf:
+ - $ref: '#/components/schemas/RoutineAction'
+ description: Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ InvokeAgentResponsesApiDispatchPayload:
type: object
required:
- - object
- - id
- - name
- - state
- - versions
+ - type
+ - input
properties:
- object:
+ type:
type: string
enum:
- - agent
- description: The object type, which is always 'agent'.
- id:
- type: string
- description: The unique identifier of the agent.
- name:
- type: string
- maxLength: 63
- description: The name of the agent.
- state:
- $ref: '#/components/schemas/AgentState'
- description: The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests.
- readOnly: true
- versions:
- type: object
- properties:
- latest:
- $ref: '#/components/schemas/AgentVersionObject'
- required:
- - latest
- description: The latest version of the agent.
- agent_endpoint:
- $ref: '#/components/schemas/AgentEndpointConfig'
- description: The endpoint configuration for the agent
- instance_identity:
- $ref: '#/components/schemas/AgentIdentity'
- description: The instance identity of the agent
- readOnly: true
- blueprint:
- $ref: '#/components/schemas/AgentIdentity'
- description: The blueprint for the agent
- readOnly: true
- blueprint_reference:
- $ref: '#/components/schemas/AgentBlueprintReference'
- description: The blueprint for the agent
- readOnly: true
- agent_card:
- $ref: '#/components/schemas/AgentCard'
- AgentReference:
+ - invoke_agent_responses_api
+ description: The manual dispatch payload type.
+ input:
+ description: The JSON value sent as the complete downstream responses input. The value is passed through as-is and can be an object, string, number, boolean, array, or null.
+ allOf:
+ - $ref: '#/components/schemas/RoutineDispatchPayload'
+ description: A manual payload used to test a responses API routine dispatch.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ InvokeAgentResponsesApiRoutineAction:
type: object
required:
- type
- - name
properties:
type:
type: string
enum:
- - agent_reference
- name:
+ - invoke_agent_responses_api
+ description: The action type.
+ agent_name:
type: string
maxLength: 256
- description: The name of the agent.
- version:
+ description: The project-scoped agent name for routine dispatch.
+ agent_endpoint_id:
type: string
- description: The version identifier of the agent.
- AgentSessionResource:
+ maxLength: 256
+ description: Legacy endpoint-scoped agent identifier for routine dispatch.
+ input:
+ description: Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
+ conversation:
+ type: string
+ maxLength: 256
+ description: An optional existing conversation identifier to continue during the downstream dispatch.
+ allOf:
+ - $ref: '#/components/schemas/RoutineAction'
+ description: Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ ItemGenerationParams:
type: object
required:
- - agent_session_id
- - version_indicator
- - status
- - created_at
- - last_accessed_at
- - expires_at
+ - type
properties:
- agent_session_id:
- type: string
- description: The session identifier.
- version_indicator:
- $ref: '#/components/schemas/VersionIndicator'
- description: The version indicator determining which agent version backs this session.
- status:
- $ref: '#/components/schemas/AgentSessionStatus'
- description: The current status of the session.
- created_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) when the session was created.
- readOnly: true
- last_accessed_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) when the session was last accessed.
- readOnly: true
- expires_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).
- readOnly: true
- description: An agent session providing a long-lived compute sandbox for hosted agent invocations.
- AgentSessionStatus:
+ type:
+ $ref: '#/components/schemas/ItemGenerationParamsType'
+ description: The type of item generation parameters to use.
+ discriminator:
+ propertyName: type
+ mapping:
+ red_team: '#/components/schemas/RedTeamItemGenerationParams'
+ red_team_seed_prompts: '#/components/schemas/RedTeamSeedPromptsItemGenerationParams'
+ red_team_taxonomy: '#/components/schemas/RedTeamTaxonomyItemGenerationParams'
+ response_retrieval: '#/components/schemas/ResponseRetrievalItemGenerationParams'
+ conversation_gen_preview: '#/components/schemas/ConversationGenPreviewItemGenerationParams'
+ synthetic_data_gen_preview: '#/components/schemas/SyntheticDataGenerationPreviewItemGenerationParams'
+ description: Represents the set of parameters used to control item generation operations.
+ ItemGenerationParamsType:
anyOf:
- type: string
- type: string
enum:
- - creating
- - active
- - idle
- - updating
- - failed
- - deleting
- - deleted
- - expired
- description: The status of an agent session.
- AgentState:
+ - red_team
+ - response_retrieval
+ - red_team_seed_prompts
+ - red_team_taxonomy
+ - synthetic_data_gen_preview
+ - conversation_gen_preview
+ description: The types of parameters for red team item generation.
+ JobStatus:
anyOf:
- type: string
- type: string
enum:
- - enabled
- - disabled
- description: The operational state of an agent.
- AgentTaxonomyInput:
+ - queued
+ - in_progress
+ - succeeded
+ - failed
+ - cancelled
+ description: Extensible status values shared by Foundry jobs.
+ LoraConfig:
type: object
- required:
- - type
- - target
- - riskCategories
properties:
- type:
- type: string
- enum:
- - agent
- description: Input type of the evaluation taxonomy.
- target:
- $ref: '#/components/schemas/Target'
- description: Target configuration for the agent.
- riskCategories:
+ rank:
+ type: integer
+ format: int32
+ description: 'LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.'
+ alpha:
+ type: integer
+ format: int32
+ description: LoRA scaling factor (α). Positive integer; typically 2× the rank.
+ targetModules:
type: array
items:
- $ref: '#/components/schemas/RiskCategory'
- description: List of risk categories to evaluate against.
- allOf:
- - $ref: '#/components/schemas/EvaluationTaxonomyInput'
- description: Input configuration for the evaluation taxonomy when the input type is agent.
+ type: string
+ description: Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from adapter_config.json if omitted.
+ dropout:
+ type: number
+ format: float
+ description: Dropout rate used during training. Informational — not used at serving time.
+ description: Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time.
x-ms-foundry-meta:
required_previews:
- - Evaluations=V1Preview
- AgentTaxonomyInputUpdate:
+ - Models=V1Preview
+ MCPToolboxTool:
type: object
+ required:
+ - type
+ - server_label
properties:
type:
type: string
enum:
- - agent
- description: Input type of the evaluation taxonomy.
- target:
- $ref: '#/components/schemas/TargetUpdate'
- description: Target configuration for the agent.
- riskCategories:
- type: array
- items:
- $ref: '#/components/schemas/RiskCategory'
- description: List of risk categories to evaluate against.
+ - mcp
+ server_label:
+ type: string
+ description: A label for this MCP server, used to identify it in tool calls.
+ server_url:
+ type: string
+ format: uri
+ description: |-
+ The URL for the MCP server. One of `server_url`, `connector_id`, or
+ `tunnel_id` must be provided.
+ connector_id:
+ type: string
+ enum:
+ - connector_dropbox
+ - connector_gmail
+ - connector_googlecalendar
+ - connector_googledrive
+ - connector_microsoftteams
+ - connector_outlookcalendar
+ - connector_outlookemail
+ - connector_sharepoint
+ description: |-
+ Identifier for service connectors, like those available in ChatGPT. One of
+ `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
+ about service connectors [here](/docs/guides/tools-remote-mcp#connectors).
+ Currently supported `connector_id` values are:
+ - Dropbox: `connector_dropbox`
+ - Gmail: `connector_gmail`
+ - Google Calendar: `connector_googlecalendar`
+ - Google Drive: `connector_googledrive`
+ - Microsoft Teams: `connector_microsoftteams`
+ - Outlook Calendar: `connector_outlookcalendar`
+ - Outlook Email: `connector_outlookemail`
+ - SharePoint: `connector_sharepoint`
+ tunnel_id:
+ type: string
+ pattern: ^tunnel_[a-z0-9]{32}$
+ description: |-
+ The Secure MCP Tunnel ID to use instead of a direct server URL. One of
+ `server_url`, `connector_id`, or `tunnel_id` must be provided.
+ authorization:
+ type: string
+ description: |-
+ An OAuth access token that can be used with a remote MCP server, either
+ with a custom MCP server URL or a service connector. Your application
+ must handle the OAuth authorization flow and provide the token here.
+ server_description:
+ type: string
+ description: Optional description of the MCP server, used to provide more context.
+ headers:
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ type: string
+ - type: 'null'
+ allowed_tools:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ - type: 'null'
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ enum:
+ - always
+ - never
+ - type: 'null'
+ default: always
+ defer_loading:
+ type: boolean
+ description: Whether this MCP tool is deferred and discovered via tool search.
+ project_connection_id:
+ type: string
+ description: The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server.
allOf:
- - $ref: '#/components/schemas/EvaluationTaxonomyInputUpdate'
- description: Input configuration for the evaluation taxonomy when the input type is agent.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- AgentVersionObject:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: An MCP tool stored in a toolbox.
+ ManagedAgentIdentityBlueprintReference:
type: object
required:
- - metadata
- - object
- - id
- - name
- - version
- - created_at
- - definition
+ - type
+ - blueprint_id
properties:
- metadata:
- anyOf:
- - type: object
- unevaluatedProperties:
- type: string
- - type: 'null'
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- object:
+ type:
type: string
enum:
- - agent.version
- description: The object type, which is always 'agent.version'.
- id:
- type: string
- description: The unique identifier of the agent version.
- name:
- type: string
- maxLength: 256
- description: The name of the agent. Name can be used to retrieve/update/delete the agent.
- version:
- type: string
- description: The version identifier of the agent. Agents are immutable and every update creates a new version while keeping the name same.
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the agent.
- created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The Unix timestamp (seconds) when the agent was created.
- definition:
- $ref: '#/components/schemas/AgentDefinition'
- draft:
- type: boolean
- description: Whether this agent version is a draft (candidate) rather than a release. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to false.
- x-ms-foundry-meta:
- conditional_previews:
- - DraftAgents=V1Preview
- default: false
- status:
- $ref: '#/components/schemas/AgentVersionStatus'
- description: The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For hosted agents, reflects infrastructure readiness.
- instance_identity:
- $ref: '#/components/schemas/AgentIdentity'
- description: The instance identity of the agent
- readOnly: true
- blueprint:
- $ref: '#/components/schemas/AgentIdentity'
- description: The blueprint for the agent
- readOnly: true
- blueprint_reference:
- $ref: '#/components/schemas/AgentBlueprintReference'
- description: The blueprint for the agent
- readOnly: true
- agent_guid:
+ - ManagedAgentIdentityBlueprint
+ blueprint_id:
type: string
- description: The unique GUID identifier of the agent.
- readOnly: true
- AgentVersionStatus:
- type: string
- enum:
- - creating
- - active
- - failed
- - deleting
- - deleted
- description: The provisioning status of an agent version.
- AgenticIdentityPreviewCredentials:
+ description: The ID of the managed blueprint
+ allOf:
+ - $ref: '#/components/schemas/AgentBlueprintReference'
+ ManagedAzureAISearchIndex:
type: object
required:
- type
@@ -11878,500 +44346,739 @@ components:
type:
type: string
enum:
- - AgenticIdentityToken_Preview
- description: The credential type
- readOnly: true
+ - ManagedAzureSearch
+ description: Type of index
allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: Agentic identity credential definition
- ApiErrorResponse:
+ - $ref: '#/components/schemas/Index'
+ description: Managed Azure AI Search Index Definition
+ ManagedAzureAISearchIndexUpdate:
type: object
required:
- - error
+ - type
properties:
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error response for API failures.
- ApiKeyCredentials:
+ type:
+ type: string
+ enum:
+ - ManagedAzureSearch
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/IndexUpdate'
+ description: Managed Azure AI Search Index Definition
+ McpProtocolConfiguration:
+ type: object
+ description: Configuration specific to the MCP protocol.
+ MemoryCommandToolCall:
type: object
required:
- type
+ - call_id
+ - arguments
+ - status
properties:
type:
type: string
enum:
- - ApiKey
- description: The credential type
- readOnly: true
- key:
+ - memory_command_preview_call
+ call_id:
type: string
- description: API Key
- readOnly: true
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool, including `action` (`remember` or `forget`) and `content`.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: API Key Credential definition
- ArtifactProfile:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A memory command tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ MemoryCommandToolCallOutput:
type: object
required:
- - category
+ - type
+ - call_id
+ - status
properties:
- category:
- $ref: '#/components/schemas/FoundryModelArtifactProfileCategory'
- description: The category of the artifact profile
- signals:
- type: array
- items:
- $ref: '#/components/schemas/FoundryModelArtifactProfileSignal'
- description: Signals detected in the model artifact
- description: Artifact profile of the model
+ type:
+ type: string
+ enum:
+ - memory_command_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a memory command tool call.
x-ms-foundry-meta:
required_previews:
- - Models=V1Preview
- AssetCredentialResponse:
+ - preview_tool
+ MemoryItem:
type: object
required:
- - blobReference
+ - memory_id
+ - updated_at
+ - scope
+ - content
+ - kind
properties:
- blobReference:
- $ref: '#/components/schemas/BlobReference'
- description: Credential info to access the storage account.
- description: Represents a reference to a blob for consumption
- AssetId:
- type: string
- description: Identifier of a saved asset.
- AttackStrategy:
+ memory_id:
+ type: string
+ description: The unique ID of the memory item.
+ updated_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The last update time of the memory item.
+ scope:
+ type: string
+ description: The namespace that logically groups and isolates memories, such as a user ID.
+ content:
+ type: string
+ description: The content of the memory.
+ kind:
+ $ref: '#/components/schemas/MemoryItemKind'
+ description: The kind of the memory item.
+ discriminator:
+ propertyName: kind
+ mapping:
+ user_profile: '#/components/schemas/UserProfileMemoryItem'
+ chat_summary: '#/components/schemas/ChatSummaryMemoryItem'
+ procedural: '#/components/schemas/ProceduralMemoryItem'
+ description: A single memory item stored in the memory store, containing content and metadata.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryItemKind:
anyOf:
- type: string
- type: string
enum:
- - easy
- - moderate
- - difficult
- - ascii_art
- - ascii_smuggler
- - atbash
- - base64
- - binary
- - caesar
- - character_space
- - jailbreak
- - ansi_attack
- - character_swap
- - suffix_append
- - string_join
- - unicode_confusable
- - unicode_substitution
- - diacritic
- - flip
- - leetspeak
- - rot13
- - morse
- - url
- - baseline
- - indirect_jailbreak
- - tense
- - multi_turn
- - crescendo
- description: Strategies for attacks.
+ - user_profile
+ - chat_summary
+ - procedural
+ description: Memory item kind.
x-ms-foundry-meta:
required_previews:
- - RedTeams=V1Preview
- Azure.Core.Foundations.Error:
+ - MemoryStores=V1Preview
+ MemoryOperation:
type: object
required:
- - code
- - message
+ - kind
+ - memory_item
properties:
- code:
- type: string
- description: One of a server-defined set of error codes.
- message:
- type: string
- description: A human-readable representation of the error.
- target:
- type: string
- description: The target of the error.
- details:
- type: array
- items:
- $ref: '#/components/schemas/Azure.Core.Foundations.Error'
- description: An array of details about specific errors that led to this reported error.
- innererror:
- $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
- description: An object containing more specific information than the current object about the error.
- description: The error object.
- Azure.Core.Foundations.ErrorResponse:
+ kind:
+ $ref: '#/components/schemas/MemoryOperationKind'
+ description: The type of memory operation being performed.
+ memory_item:
+ $ref: '#/components/schemas/MemoryItem'
+ description: The memory item to create, update, or delete.
+ description: Represents a single memory operation (create, update, or delete) performed on a memory item.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryOperationKind:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - create
+ - update
+ - delete
+ description: Memory operation kind.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemorySearchItem:
type: object
required:
- - error
+ - memory_item
properties:
- error:
- $ref: '#/components/schemas/Azure.Core.Foundations.Error'
- description: The error object.
- description: A response containing error details.
- Azure.Core.Foundations.InnerError:
+ memory_item:
+ $ref: '#/components/schemas/MemoryItem'
+ description: Retrieved memory item.
+ description: A retrieved memory item from memory search.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemorySearchOptions:
type: object
properties:
- code:
- type: string
- description: One of a server-defined set of error codes.
- innererror:
- description: Inner error.
- $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
- description: An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.
- Azure.Core.Foundations.OperationState:
- anyOf:
- - type: string
- enum:
- - NotStarted
- - Running
- - Succeeded
- - Failed
- - Canceled
- - type: string
- description: Enum describing allowed operation states.
- Azure.Core.uuid:
- type: string
- format: uuid
- description: Universally Unique Identifier
- AzureAIAgentTarget:
+ max_memories:
+ type: integer
+ format: int32
+ description: Maximum number of memory items to return.
+ description: Memory search options.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemorySearchPreviewTool:
type: object
required:
- type
- - name
+ - memory_store_name
+ - scope
properties:
type:
type: string
enum:
- - azure_ai_agent
- description: The type of target, always `azure_ai_agent`.
- name:
+ - memory_search_preview
+ description: The type of the tool. Always `memory_search_preview`.
+ memory_store_name:
type: string
- description: The unique identifier of the Azure AI agent.
- version:
+ description: The name of the memory store to use.
+ scope:
type: string
- description: The version of the Azure AI agent.
- tool_descriptions:
- type: array
- items:
- $ref: '#/components/schemas/ToolDescription'
- description: The parameters used to control the sampling behavior of the agent during text generation.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
+ description: |-
+ The namespace used to group and isolate memories, such as a user ID.
+ Limits which memories can be retrieved or updated.
+ Use special variable `{{$userId}}` to scope memories to the current signed-in user.
+ search_options:
+ $ref: '#/components/schemas/MemorySearchOptions'
+ description: Options for searching the memory store.
+ update_delay:
+ type: integer
+ format: int32
+ description: Time to wait before updating memories after inactivity (seconds). Default 300.
+ default: 300
allOf:
- - $ref: '#/components/schemas/Target'
- description: Represents a target specifying an Azure AI agent.
- AzureAIAgentTargetUpdate:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool for integrating memories into the agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ MemorySearchToolCall:
type: object
+ required:
+ - type
+ - status
properties:
type:
type: string
enum:
- - azure_ai_agent
- description: The type of target, always `azure_ai_agent`.
- name:
- type: string
- description: The unique identifier of the Azure AI agent.
- version:
- type: string
- description: The version of the Azure AI agent.
- tool_descriptions:
- type: array
- items:
- $ref: '#/components/schemas/ToolDescription'
- description: The parameters used to control the sampling behavior of the agent during text generation.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
+ - memory_search_call
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ memories:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/MemoryItem'
+ - type: 'null'
+ description: The results returned from the memory search.
allOf:
- - $ref: '#/components/schemas/TargetUpdate'
- description: Represents a target specifying an Azure AI agent.
- AzureAIBenchmarkDataSourceConfig:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A memory search tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ MemoryStoreDefaultDefinition:
type: object
required:
- - scenario
- - benchmark_name
+ - kind
+ - chat_model
+ - embedding_model
properties:
- scenario:
+ kind:
type: string
enum:
- - benchmark_preview
- description: Data schema scenario, always `benchmark` for benchmark evaluations.
- benchmark_name:
- type: string
- description: The name of the benchmark specification.
- benchmark_version:
+ - default
+ description: The kind of the memory store.
+ chat_model:
type: string
- description: The version of the benchmark specification (e.g., '0.1'). Latest version if not specified.
- grader_model:
+ description: The name or identifier of the chat completion model deployment used for memory processing.
+ embedding_model:
type: string
- description: Optional grader model for benchmarks that use model graders, Required when the benchmark's testing_criteria uses a model grader type.
+ description: The name or identifier of the embedding model deployment used for memory processing.
+ options:
+ $ref: '#/components/schemas/MemoryStoreDefaultOptions'
+ description: Default memory store options.
allOf:
- - $ref: '#/components/schemas/AzureAIDataSourceConfig'
- description: Data source configuration for benchmark evaluations.
- AzureAIBenchmarkPreviewEvalRunDataSource:
+ - $ref: '#/components/schemas/MemoryStoreDefinition'
+ description: Default memory store implementation.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreDefaultOptions:
type: object
required:
- - type
- - target
+ - user_profile_enabled
+ - chat_summary_enabled
properties:
- type:
+ user_profile_enabled:
+ type: boolean
+ description: Whether to enable user profile extraction and storage. Default is true.
+ default: true
+ user_profile_details:
type: string
- enum:
- - azure_ai_benchmark_preview
- description: The type of data source, always `azure_ai_benchmark_preview`.
- input_messages:
- $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
- description: Input messages configuration.
- target:
- anyOf:
- - $ref: '#/components/schemas/AzureAIModelTarget'
- - $ref: '#/components/schemas/AzureAIAgentTarget'
- description: |-
- The target model or agent to evaluate against the benchmark.
- When using `azure_ai_model` target, `sampling_params` must not be provided;
- inference parameters are auto-filled from the benchmark specification stored in eval group properties.
- allOf:
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Represents a data source for benchmark evaluation runs.
- AzureAIDataSourceConfig:
+ description: Specific categories or types of user profile information to extract and store.
+ chat_summary_enabled:
+ type: boolean
+ description: Whether to enable chat summary extraction and storage. Defaults to `true`.
+ default: true
+ procedural_memory_enabled:
+ type: boolean
+ description: Whether to enable procedural memory extraction and storage. The service defaults to `true` if a value is not specified by the caller.
+ default: true
+ default_ttl_seconds:
+ type: integer
+ format: int32
+ description: The default time-to-live for memories in seconds. A value of `0` indicates that memories do not expire. Defaults to `0`.
+ default: 0
+ description: Default memory store configurations.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreDefinition:
type: object
required:
- - type
- - scenario
+ - kind
properties:
- type:
- type: string
- enum:
- - azure_ai_source
- description: The object type, which is always `azure_ai_source`.
- scenario:
- type: string
- enum:
- - red_team
- - responses
- - traces_preview
- - synthetic_data_gen_preview
- - benchmark_preview
- description: Data schema scenario.
+ kind:
+ $ref: '#/components/schemas/MemoryStoreKind'
+ description: The kind of the memory store.
discriminator:
- propertyName: scenario
+ propertyName: kind
mapping:
- benchmark_preview: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
- allOf:
- - $ref: '#/components/schemas/DataSourceConfig'
- description: Base data source configuration for Azure AI evaluation scenarios.
- AzureAIModelTarget:
+ default: '#/components/schemas/MemoryStoreDefaultDefinition'
+ description: Base definition for memory store configurations.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreDeleteScopeResponse:
type: object
required:
- - type
+ - object
+ - name
+ - scope
+ - deleted
properties:
- type:
+ object:
type: string
enum:
- - azure_ai_model
- description: The type of target, always `azure_ai_model`.
- model:
+ - memory_store.scope.deleted
+ description: The object type. Always 'memory_store.scope.deleted'.
+ name:
type: string
- description: The unique identifier of the Azure AI model.
- sampling_params:
- $ref: '#/components/schemas/ModelSamplingParams'
- description: The parameters used to control the sampling behavior of the model during text generation.
- allOf:
- - $ref: '#/components/schemas/Target'
- description: Represents a target specifying an Azure AI model for operations requiring model selection.
- AzureAIModelTargetUpdate:
+ description: The name of the memory store.
+ scope:
+ type: string
+ description: The scope from which memories were deleted.
+ deleted:
+ type: boolean
+ description: Whether the deletion operation was successful.
+ description: Response for deleting memories from a scope.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreKind:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - default
+ description: The type of memory store implementation to use.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreObject:
type: object
+ required:
+ - object
+ - id
+ - created_at
+ - updated_at
+ - name
+ - definition
properties:
- type:
+ object:
type: string
enum:
- - azure_ai_model
- description: The type of target, always `azure_ai_model`.
- model:
+ - memory_store
+ description: The object type, which is always 'memory_store'.
+ id:
type: string
- description: The unique identifier of the Azure AI model.
- sampling_params:
- $ref: '#/components/schemas/ModelSamplingParams'
- description: The parameters used to control the sampling behavior of the model during text generation.
- allOf:
- - $ref: '#/components/schemas/TargetUpdate'
- description: Represents a target specifying an Azure AI model for operations requiring model selection.
- AzureAIResponsesEvalRunDataSource:
+ description: The unique identifier of the memory store.
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The Unix timestamp (seconds) when the memory store was created.
+ updated_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The Unix timestamp (seconds) when the memory store was last updated.
+ name:
+ type: string
+ maxLength: 256
+ description: The name of the memory store.
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the memory store.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Arbitrary key-value metadata to associate with the memory store.
+ definition:
+ $ref: '#/components/schemas/MemoryStoreDefinition'
+ description: The definition of the memory store.
+ description: A memory store that can store and retrieve user memories.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreOperationUsage:
type: object
required:
- - type
- - item_generation_params
- - max_runs_hourly
- - event_configuration_id
+ - embedding_tokens
+ - input_tokens
+ - input_tokens_details
+ - output_tokens
+ - output_tokens_details
+ - total_tokens
properties:
- type:
- type: string
- enum:
- - azure_ai_responses
- description: The type of data source, always `azure_ai_responses`.
- item_generation_params:
- $ref: '#/components/schemas/ResponseRetrievalItemGenerationParams'
- description: The parameters for item generation.
- max_runs_hourly:
+ embedding_tokens:
type: integer
format: int32
- description: Maximum number of evaluation runs allowed per hour.
- event_configuration_id:
+ description: The number of embedding tokens.
+ input_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of input tokens.
+ input_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails'
+ description: A detailed breakdown of the input tokens.
+ output_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of output tokens.
+ output_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails'
+ description: A detailed breakdown of the output tokens.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total number of tokens used.
+ description: Usage statistics of a memory store operation.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreSearchResponse:
+ type: object
+ required:
+ - search_id
+ - memories
+ - usage
+ properties:
+ search_id:
type: string
- description: The event configuration name associated with this evaluation run.
- allOf:
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Represents a data source for evaluation runs that are specific to Continuous Evaluation scenarios.
- AzureAISearchIndex:
+ description: The unique ID of this search request. Use this value as previous_search_id in subsequent requests to perform incremental searches.
+ memories:
+ type: array
+ items:
+ $ref: '#/components/schemas/MemorySearchItem'
+ description: Related memory items found during the search operation.
+ usage:
+ $ref: '#/components/schemas/MemoryStoreOperationUsage'
+ description: Usage statistics associated with the memory search operation.
+ description: Memory search response.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreUpdateCompletedResult:
type: object
required:
- - type
+ - memory_operations
+ - usage
properties:
- type:
+ memory_operations:
+ type: array
+ items:
+ $ref: '#/components/schemas/MemoryOperation'
+ description: A list of individual memory operations that were performed during the update.
+ usage:
+ $ref: '#/components/schemas/MemoryStoreOperationUsage'
+ description: Usage statistics associated with the memory update operation.
+ description: Memory update result.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreUpdateResponse:
+ type: object
+ required:
+ - update_id
+ - status
+ properties:
+ update_id:
+ type: string
+ description: The unique ID of this update request. Use this value as previous_update_id in subsequent requests to perform incremental updates.
+ status:
+ $ref: '#/components/schemas/MemoryStoreUpdateStatus'
+ description: The status of the memory update operation. One of "queued", "in_progress", "completed", "failed", or "superseded".
+ superseded_by:
type: string
+ description: The update_id the operation was superseded by when status is "superseded".
+ result:
+ $ref: '#/components/schemas/MemoryStoreUpdateCompletedResult'
+ description: The result of memory store update operation when status is "completed".
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error object that describes the error when status is "failed".
+ description: Provides the status of a memory store update operation.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreUpdateStatus:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - AzureSearch
- description: Type of index
- allOf:
- - $ref: '#/components/schemas/Index'
- description: Azure AI Search Index Definition
- AzureAISearchIndexUpdate:
+ - queued
+ - in_progress
+ - completed
+ - failed
+ - superseded
+ description: Status of a memory store update operation.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MicrosoftFabricPreviewTool:
type: object
required:
- type
+ - fabric_dataagent_preview
properties:
type:
type: string
enum:
- - AzureSearch
- description: Type of index
+ - fabric_dataagent_preview
+ description: The object type, which is always 'fabric_dataagent_preview'.
+ fabric_dataagent_preview:
+ $ref: '#/components/schemas/FabricDataAgentToolParameters'
+ description: The fabric data agent tool parameters.
allOf:
- - $ref: '#/components/schemas/IndexUpdate'
- description: Azure AI Search Index Definition
- AzureAISearchQueryType:
- anyOf:
- - type: string
- - type: string
- enum:
- - simple
- - semantic
- - vector
- - vector_simple_hybrid
- - vector_semantic_hybrid
- description: Available query types for Azure AI Search tool.
- AzureAISearchTool:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for a Microsoft Fabric tool as used to configure an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ ModelCredentialRequest:
+ type: object
+ required:
+ - blobUri
+ properties:
+ blobUri:
+ type: string
+ format: uri
+ description: Blob URI of the model asset to fetch credentials for.
+ description: Request to fetch credentials for a model asset.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ ModelDeployment:
type: object
required:
- type
- - azure_ai_search
+ - modelName
+ - modelVersion
+ - modelPublisher
+ - capabilities
+ - sku
properties:
type:
type: string
enum:
- - azure_ai_search
- description: The object type, which is always 'azure_ai_search'.
- name:
+ - ModelDeployment
+ description: The type of the deployment
+ modelName:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
+ description: Publisher-specific name of the deployed model
+ readOnly: true
+ modelVersion:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
+ description: Publisher-specific version of the deployed model
+ readOnly: true
+ modelPublisher:
+ type: string
+ description: Name of the deployed model's publisher
+ readOnly: true
+ capabilities:
type: object
unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- azure_ai_search:
- $ref: '#/components/schemas/AzureAISearchToolResource'
- description: The azure ai search index resource.
+ type: string
+ description: Capabilities of deployed model
+ readOnly: true
+ sku:
+ $ref: '#/components/schemas/Sku'
+ description: Sku of the model deployment
+ readOnly: true
+ connectionName:
+ type: string
+ description: Name of the connection the deployment comes from
+ readOnly: true
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for an Azure AI search tool as used to configure an agent.
- AzureAISearchToolCall:
+ - $ref: '#/components/schemas/Deployment'
+ description: Model Deployment Definition
+ ModelPendingUploadRequest:
type: object
required:
- - type
- - call_id
- - arguments
- - status
+ - pendingUploadType
properties:
- type:
+ pendingUploadId:
type: string
- enum:
- - azure_ai_search_call
- call_id:
+ description: If PendingUploadId is not provided, a random GUID will be used.
+ connectionName:
type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
+ description: Azure Storage Account connection name to use for generating temporary SAS token
+ pendingUploadType:
type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An Azure AI Search tool call.
- AzureAISearchToolCallOutput:
+ enum:
+ - TemporaryBlobReference
+ description: The type of pending upload. Only TemporaryBlobReference is supported for models.
+ description: Represents a request for a pending upload of a model version.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ ModelPendingUploadResponse:
type: object
required:
- - type
- - call_id
- - status
+ - blobReference
+ - pendingUploadId
+ - pendingUploadType
properties:
- type:
+ blobReference:
+ $ref: '#/components/schemas/BlobReference'
+ description: Container-level read, write, list SAS.
+ pendingUploadId:
+ type: string
+ description: ID for this upload request.
+ version:
+ type: string
+ description: Version of asset to be created if user did not specify version when initially creating upload
+ pendingUploadType:
type: string
enum:
- - azure_ai_search_call_output
- call_id:
+ - TemporaryBlobReference
+ description: The type of pending upload. Only TemporaryBlobReference is supported for models.
+ description: Represents the response for a model pending upload request.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ ModelSamplingParams:
+ type: object
+ properties:
+ temperature:
+ type: number
+ format: float
+ description: The temperature parameter for sampling. Defaults to 1.0.
+ default: 1
+ top_p:
+ type: number
+ format: float
+ description: The top-p parameter for nucleus sampling. Defaults to 1.0.
+ default: 1
+ seed:
+ type: integer
+ format: int32
+ description: The random seed for reproducibility. Defaults to 42.
+ default: 42
+ max_completion_tokens:
+ type: integer
+ format: int32
+ description: The maximum number of tokens allowed in the completion.
+ description: Represents a set of parameters used to control the sampling behavior of a language model during text generation.
+ ModelSourceData:
+ type: object
+ properties:
+ sourceType:
+ $ref: '#/components/schemas/FoundryModelSourceType'
+ description: The source type of the model
+ jobId:
type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Azure AI Search tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of an Azure AI Search tool call.
- AzureAISearchToolResource:
+ description: The job ID that produced this model
+ description: Source information for the model
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ ModelVersion:
type: object
required:
- - indexes
+ - blobUri
+ - name
+ - version
properties:
- indexes:
+ blobUri:
+ type: string
+ format: uri
+ description: URI of the model artifact in blob storage
+ weightType:
+ $ref: '#/components/schemas/FoundryModelWeightType'
+ description: The weight type of the model
+ baseModel:
+ type: string
+ description: Base model asset ID
+ source:
+ $ref: '#/components/schemas/ModelSourceData'
+ description: The source of the model
+ loraConfig:
+ $ref: '#/components/schemas/LoraConfig'
+ description: Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided values take precedence over auto-detected values.
+ artifactProfile:
+ $ref: '#/components/schemas/ArtifactProfile'
+ description: The artifact profile of the model
+ readOnly: true
+ warnings:
type: array
items:
- $ref: '#/components/schemas/AISearchIndexResource'
- maxItems: 1
- description: |-
- The indices attached to this agent. There can be a maximum of 1 index
- resource attached to the agent.
- description: A set of index resources used by the `azure_ai_search` tool.
- AzureAISearchToolboxTool:
+ $ref: '#/components/schemas/FoundryModelWarning'
+ description: Service-computed advisory warnings derived from the artifact profile.
+ readOnly: true
+ id:
+ type: string
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
+ name:
+ type: string
+ description: The name of the resource
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource
+ readOnly: true
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ description: Model Version Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ MonthlyRecurrenceSchedule:
type: object
required:
- type
- - azure_ai_search
+ - daysOfMonth
properties:
type:
type: string
enum:
- - azure_ai_search
- azure_ai_search:
- $ref: '#/components/schemas/AzureAISearchToolResource'
- description: The azure ai search index resource.
+ - Monthly
+ description: Monthly recurrence type.
+ daysOfMonth:
+ type: array
+ items:
+ type: integer
+ format: int32
+ description: Days of the month for the recurrence schedule.
allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: An Azure AI Search tool stored in a toolbox.
- AzureAITraceDataSourcePreviewEvalRunDataSource:
+ - $ref: '#/components/schemas/RecurrenceSchedule'
+ description: Monthly recurrence schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ NoAuthenticationCredentials:
type: object
required:
- type
@@ -12379,2392 +45086,2603 @@ components:
type:
type: string
enum:
- - azure_ai_trace_data_source_preview
- description: The type of data source, always `azure_ai_trace_data_source_preview`.
- trace_source:
- $ref: '#/components/schemas/TraceSource'
- description: The trace source that defines how traces are selected for evaluation.
+ - None
+ description: 'The credential type '
+ readOnly: true
allOf:
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: A wrapper data source that contains a polymorphic trace source to specify how traces are selected for evaluation.
- AzureContentFilterBlocklistIdResult:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: Credentials that do not require authentication
+ OAuthConsentRequestOutputItem:
type: object
required:
- id
- - filtered
+ - type
+ - consent_link
+ - server_label
properties:
id:
type: string
- description: The ID of the custom blocklist.
- filtered:
- type: boolean
- description: Whether the blocklist resulted in filtering.
- description: A content filter blocklist ID result.
- AzureContentFilterBlocklistResult:
- type: object
- required:
- - filtered
- properties:
- filtered:
- type: boolean
- description: Whether any blocklist resulted in filtering.
- details:
- type: array
- items:
- $ref: '#/components/schemas/AzureContentFilterBlocklistIdResult'
- description: The pairs of individual blocklist IDs and their filtering results.
- description: A collection of filtering results for configured custom blocklists.
- AzureContentFilterCitation:
- type: object
- properties:
- license:
+ type:
type: string
- description: The license associated with the detection.
- url:
+ enum:
+ - oauth_consent_request
+ consent_link:
type: string
- format: uri
- description: The URL associated with the license.
- description: Citation details for protected material detection.
- AzureContentFilterCompletionTextSpan:
+ description: The link the user can use to perform OAuth consent.
+ server_label:
+ type: string
+ description: The server label for the OAuth consent request.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: Request from the service for the user to perform OAuth consent.
+ OneTimeTrigger:
type: object
required:
- - completion_start_offset
- - completion_end_offset
+ - type
+ - triggerAt
properties:
- completion_start_offset:
- type: integer
- format: int32
- description: Offset of the UTF32 code point which begins the span.
- completion_end_offset:
- type: integer
- format: int32
- description: Offset of the first UTF32 code point which is excluded from the span.
- description: A representation of a span of completion text as used by Azure OpenAI content filter results.
- AzureContentFilterCompletionTextSpanDetectionResult:
+ type:
+ type: string
+ enum:
+ - OneTime
+ triggerAt:
+ type: string
+ description: Date and time for the one-time trigger in ISO 8601 format.
+ timeZone:
+ type: string
+ description: Time zone for the one-time trigger. Defaults to `UTC`.
+ default: UTC
+ allOf:
+ - $ref: '#/components/schemas/Trigger'
+ description: One-time trigger.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ OpenAI.AddUploadPartRequest:
type: object
- required:
- - filtered
- - detected
- - details
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether the content category was detected.
- details:
- type: array
- items:
- $ref: '#/components/schemas/AzureContentFilterCompletionTextSpan'
- description: Detailed information about the detected completion text spans.
- description: A content filter detection result with completion text span details.
- AzureContentFilterDetectionResult:
- type: object
+ data:
+ description: The chunk of bytes for this Part.
required:
- - filtered
- - detected
- properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether the content category was detected.
- description: A content filter result indicating whether the content was detected and filtered.
- AzureContentFilterDetectionWithCitationResult:
+ - data
+ OpenAI.Annotation:
type: object
required:
- - filtered
- - detected
+ - type
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether the content category was detected.
- citation:
- $ref: '#/components/schemas/AzureContentFilterCitation'
- description: Citation details describing the associated license and its location.
- description: A content filter detection result that includes citation information for protected material.
- AzureContentFilterDetectionWithReasonResult:
+ type:
+ $ref: '#/components/schemas/OpenAI.AnnotationType'
+ discriminator:
+ propertyName: type
+ mapping:
+ file_citation: '#/components/schemas/OpenAI.FileCitationBody'
+ url_citation: '#/components/schemas/OpenAI.UrlCitationBody'
+ container_file_citation: '#/components/schemas/OpenAI.ContainerFileCitationBody'
+ file_path: '#/components/schemas/OpenAI.FilePath'
+ description: An annotation that applies to a span of output text.
+ OpenAI.AnnotationType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - file_citation
+ - url_citation
+ - container_file_citation
+ - file_path
+ OpenAI.ApplyPatchCallOutputStatus:
+ type: string
+ enum:
+ - completed
+ - failed
+ OpenAI.ApplyPatchCallOutputStatusParam:
+ type: string
+ enum:
+ - completed
+ - failed
+ description: Outcome values reported for apply_patch tool call outputs.
+ title: Apply patch call output status
+ OpenAI.ApplyPatchCallStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ OpenAI.ApplyPatchCallStatusParam:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ description: Status values reported for apply_patch tool calls.
+ title: Apply patch call status
+ OpenAI.ApplyPatchCreateFileOperation:
type: object
required:
- - filtered
- - detected
+ - type
+ - path
+ - diff
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether the content category was detected.
- reason:
+ type:
type: string
- description: A human-readable explanation of why the detection result was produced.
- description: A content filter detection result that includes a reason description.
- AzureContentFilterError:
+ enum:
+ - create_file
+ description: Create a new file with the provided diff.
+ x-stainless-const: true
+ path:
+ type: string
+ description: Path of the file to create.
+ diff:
+ type: string
+ description: Diff to apply.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: Instruction describing how to create a file via the apply_patch tool.
+ title: Apply patch create file operation
+ OpenAI.ApplyPatchCreateFileOperationParam:
type: object
required:
- - code
- - message
+ - type
+ - path
+ - diff
properties:
- code:
- type: integer
- format: int32
- description: A machine-readable error code.
- message:
+ type:
type: string
- description: A human-readable error message.
- description: Error details from the content filtering system.
- AzureContentFilterPersonallyIdentifiableInformationResult:
+ enum:
+ - create_file
+ description: The operation type. Always `create_file`.
+ x-stainless-const: true
+ path:
+ type: string
+ minLength: 1
+ description: Path of the file to create relative to the workspace root.
+ diff:
+ type: string
+ maxLength: 10485760
+ description: Unified diff content to apply when creating the file.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: Instruction for creating a new file via the apply_patch tool.
+ title: Apply patch create file operation
+ OpenAI.ApplyPatchDeleteFileOperation:
type: object
required:
- - filtered
- - detected
+ - type
+ - path
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether PII was detected in the content.
- sub_categories:
- type: array
- items:
- $ref: '#/components/schemas/AzureContentFilterPiiSubCategoryResult'
- description: Detailed results for individual PII subcategories.
- description: A content filter detection result for Personally Identifiable Information.
- AzureContentFilterPiiSubCategoryResult:
+ type:
+ type: string
+ enum:
+ - delete_file
+ description: Delete the specified file.
+ x-stainless-const: true
+ path:
+ type: string
+ description: Path of the file to delete.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: Instruction describing how to delete a file via the apply_patch tool.
+ title: Apply patch delete file operation
+ OpenAI.ApplyPatchDeleteFileOperationParam:
type: object
required:
- - sub_category
- - filtered
- - detected
+ - type
+ - path
properties:
- sub_category:
+ type:
type: string
- description: The PII subcategory that was evaluated.
- filtered:
- type: boolean
- description: Whether the content was filtered for this subcategory.
- detected:
- type: boolean
- description: Whether the subcategory was detected in the content.
- description: Result details for an individual PII subcategory.
- AzureContentFilterResultsForResponses:
+ enum:
+ - delete_file
+ description: The operation type. Always `delete_file`.
+ x-stainless-const: true
+ path:
+ type: string
+ minLength: 1
+ description: Path of the file to delete relative to the workspace root.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: Instruction for deleting an existing file via the apply_patch tool.
+ title: Apply patch delete file operation
+ OpenAI.ApplyPatchFileOperation:
type: object
+ required:
+ - type
properties:
- sexual:
- $ref: '#/components/schemas/AzureContentFilterSeverityResult'
- description: Severity result for sexual content.
- hate:
- $ref: '#/components/schemas/AzureContentFilterSeverityResult'
- description: Severity result for hate content.
- violence:
- $ref: '#/components/schemas/AzureContentFilterSeverityResult'
- description: Severity result for violence content.
- self_harm:
- $ref: '#/components/schemas/AzureContentFilterSeverityResult'
- description: Severity result for self-harm content.
- profanity:
- $ref: '#/components/schemas/AzureContentFilterDetectionResult'
- description: Detection result for profanity.
- custom_blocklists:
- $ref: '#/components/schemas/AzureContentFilterBlocklistResult'
- description: Results for configured custom blocklists.
- jailbreak:
- $ref: '#/components/schemas/AzureContentFilterDetectionResult'
- description: Detection result for jailbreak attempts.
- task_adherence:
- $ref: '#/components/schemas/AzureContentFilterDetectionWithReasonResult'
- description: Detection result for task adherence evaluation.
- protected_material_text:
- $ref: '#/components/schemas/AzureContentFilterDetectionResult'
- description: Detection result for protected material text.
- protected_material_code:
- $ref: '#/components/schemas/AzureContentFilterDetectionWithCitationResult'
- description: Detection result for protected material code with citation.
- ungrounded_material:
- $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult'
- description: Detection result for ungrounded material with completion text span details.
- personally_identifiable_information:
- $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult'
- description: Detection result for Personally Identifiable Information.
- indirect_attack:
- $ref: '#/components/schemas/AzureContentFilterDetectionResult'
- description: Detection result for indirect attacks.
- error:
- $ref: '#/components/schemas/AzureContentFilterError'
- description: Error details if content filtering evaluation failed.
- description: Content filter results for the Responses API.
- AzureContentFilterSeverity:
+ type:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperationType'
+ discriminator:
+ propertyName: type
+ mapping:
+ create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperation'
+ delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation'
+ update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation'
+ description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
+ title: Apply patch operation
+ OpenAI.ApplyPatchFileOperationType:
anyOf:
- type: string
- type: string
enum:
- - safe
- - low
- - medium
- - high
- description: Ratings for the intensity and risk level of harmful content.
- AzureContentFilterSeverityResult:
- type: object
- required:
- - filtered
- - severity
- properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- severity:
- $ref: '#/components/schemas/AzureContentFilterSeverity'
- description: The severity level of the content.
- description: A content filter result indicating severity level and whether content was filtered.
- AzureFunctionBinding:
+ - create_file
+ - delete_file
+ - update_file
+ OpenAI.ApplyPatchOperationParam:
type: object
required:
- type
- - storage_queue
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParamType'
+ discriminator:
+ propertyName: type
+ mapping:
+ create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperationParam'
+ delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperationParam'
+ update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperationParam'
+ description: One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.
+ title: Apply patch operation
+ OpenAI.ApplyPatchOperationParamType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - storage_queue
- description: The type of binding, which is always 'storage_queue'.
- storage_queue:
- $ref: '#/components/schemas/AzureFunctionStorageQueue'
- description: Storage queue.
- description: The structure for keeping storage queue name and URI.
- AzureFunctionDefinition:
- type: object
- required:
- - function
- - input_binding
- - output_binding
- properties:
- function:
- type: object
- properties:
- name:
- type: string
- description: The name of the function to be called.
- description:
- type: string
- description: A description of what the function does, used by the model to choose when and how to call the function.
- parameters:
- type: object
- unevaluatedProperties: {}
- description: The parameters the functions accepts, described as a JSON Schema object.
- required:
- - name
- - parameters
- description: The definition of azure function and its parameters.
- input_binding:
- $ref: '#/components/schemas/AzureFunctionBinding'
- description: Input storage queue. The queue storage trigger runs a function as messages are added to it.
- output_binding:
- $ref: '#/components/schemas/AzureFunctionBinding'
- description: Output storage queue. The function writes output to this queue when the input items are processed.
- description: The definition of Azure function.
- AzureFunctionStorageQueue:
+ - create_file
+ - delete_file
+ - update_file
+ OpenAI.ApplyPatchToolParam:
type: object
required:
- - queue_service_endpoint
- - queue_name
+ - type
properties:
- queue_service_endpoint:
- type: string
- description: URI to the Azure Storage Queue service allowing you to manipulate a queue.
- queue_name:
+ type:
type: string
- description: The name of an Azure function storage queue.
- description: The structure for keeping storage queue name and URI.
- AzureFunctionTool:
+ enum:
+ - apply_patch
+ description: The type of the tool. Always `apply_patch`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: Allows the assistant to create, delete, or update files using unified diffs.
+ title: Apply patch tool
+ OpenAI.ApplyPatchUpdateFileOperation:
type: object
required:
- type
- - azure_function
+ - path
+ - diff
properties:
type:
type: string
enum:
- - azure_function
- description: The object type, which is always 'browser_automation'.
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- azure_function:
- $ref: '#/components/schemas/AzureFunctionDefinition'
- description: The Azure Function Tool definition.
+ - update_file
+ description: Update an existing file with the provided diff.
+ x-stainless-const: true
+ path:
+ type: string
+ description: Path of the file to update.
+ diff:
+ type: string
+ description: Diff to apply.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for an Azure Function Tool, as used to configure an Agent.
- AzureFunctionToolCall:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: Instruction describing how to update a file via the apply_patch tool.
+ title: Apply patch update file operation
+ OpenAI.ApplyPatchUpdateFileOperationParam:
type: object
required:
- type
- - call_id
- - name
- - arguments
- - status
+ - path
+ - diff
properties:
type:
type: string
enum:
- - azure_function_call
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- name:
+ - update_file
+ description: The operation type. Always `update_file`.
+ x-stainless-const: true
+ path:
type: string
- description: The name of the Azure Function being called.
- arguments:
+ minLength: 1
+ description: Path of the file to update relative to the workspace root.
+ diff:
type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ maxLength: 10485760
+ description: Unified diff content to apply to the existing file.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An Azure Function tool call.
- AzureFunctionToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: Instruction for updating an existing file via the apply_patch tool.
+ title: Apply patch update file operation
+ OpenAI.ApproximateLocation:
type: object
required:
- type
- - call_id
- - name
- - status
properties:
type:
type: string
enum:
- - azure_function_call_output
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- name:
- type: string
- description: The name of the Azure Function that was called.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Azure Function tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of an Azure Function tool call.
- AzureOpenAIModelConfiguration:
+ - approximate
+ description: The type of location approximation. Always `approximate`.
+ x-stainless-const: true
+ default: approximate
+ country:
+ anyOf:
+ - type: string
+ - type: 'null'
+ region:
+ anyOf:
+ - type: string
+ - type: 'null'
+ city:
+ anyOf:
+ - type: string
+ - type: 'null'
+ timezone:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.AssistantObject:
type: object
required:
- - type
- - modelDeploymentName
+ - id
+ - object
+ - created_at
+ - name
+ - description
+ - model
+ - instructions
+ - tools
+ - metadata
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - AzureOpenAIModel
- modelDeploymentName:
+ - assistant
+ description: The object type, which is always `assistant`.
+ x-stainless-const: true
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the assistant was created.
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ model:
type: string
- description: 'Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`).'
- allOf:
- - $ref: '#/components/schemas/RedTeamTargetConfig'
- description: Azure OpenAI model configuration. The API version would be selected by the service for querying the model.
- x-ms-foundry-meta:
- required_previews:
- - RedTeams=V1Preview
- BaseCredentials:
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ maxItems: 128
+ description: 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`.
+ default: []
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantObjectToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ response_format:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ - type: 'null'
+ description: Represents an `assistant` that can call the model and use tools.
+ title: Assistant
+ deprecated: true
+ x-oaiMeta:
+ name: The assistant object
+ example: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698984975,
+ "name": "Math Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ OpenAI.AssistantObjectToolResources:
+ type: object
+ properties:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.AssistantObjectToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.AssistantObjectToolResourcesFileSearch'
+ OpenAI.AssistantObjectToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 20
+ OpenAI.AssistantObjectToolResourcesFileSearch:
+ type: object
+ properties:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ OpenAI.AssistantSupportedModels:
+ type: string
+ enum:
+ - 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
+ - o3-mini
+ - o3-mini-2025-01-31
+ - o1
+ - o1-2024-12-17
+ - 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
+ OpenAI.AssistantTool:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/CredentialType'
- description: The type of credential used by the connection
- readOnly: true
+ $ref: '#/components/schemas/OpenAI.AssistantToolType'
discriminator:
propertyName: type
mapping:
- ApiKey: '#/components/schemas/ApiKeyCredentials'
- AAD: '#/components/schemas/EntraIDCredentials'
- CustomKeys: '#/components/schemas/CustomCredential'
- SAS: '#/components/schemas/SASCredentials'
- None: '#/components/schemas/NoAuthenticationCredentials'
- AgenticIdentityToken_Preview: '#/components/schemas/AgenticIdentityPreviewCredentials'
- description: A base class for connection credentials
- BingCustomSearchConfiguration:
+ code_interpreter: '#/components/schemas/OpenAI.AssistantToolsCode'
+ file_search: '#/components/schemas/OpenAI.AssistantToolsFileSearch'
+ function: '#/components/schemas/OpenAI.AssistantToolsFunction'
+ OpenAI.AssistantToolType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - code_interpreter
+ - file_search
+ - function
+ OpenAI.AssistantToolsCode:
type: object
required:
- - project_connection_id
- - instance_name
+ - type
properties:
- project_connection_id:
- type: string
- description: Project connection id for grounding with bing search
- instance_name:
- type: string
- description: Name of the custom configuration instance given to config.
- market:
- type: string
- description: The market where the results come from.
- set_lang:
- type: string
- description: The language to use for user interface strings when calling Bing API.
- count:
- type: integer
- format: int64
- description: The number of search results to return in the bing api response
- freshness:
+ type:
type: string
- description: Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters).
- description: A bing custom search configuration.
- BingCustomSearchPreviewTool:
+ enum:
+ - code_interpreter
+ description: 'The type of tool being defined: `code_interpreter`'
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantTool'
+ title: Code interpreter tool
+ OpenAI.AssistantToolsFileSearch:
type: object
required:
- type
- - bing_custom_search_preview
properties:
type:
type: string
enum:
- - bing_custom_search_preview
- description: The object type, which is always 'bing_custom_search_preview'.
- bing_custom_search_preview:
- $ref: '#/components/schemas/BingCustomSearchToolParameters'
- description: The bing custom search tool parameters.
+ - file_search
+ description: 'The type of tool being defined: `file_search`'
+ x-stainless-const: true
+ file_search:
+ $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchFileSearch'
+ description: Overrides for the file search tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for a Bing custom search tool as used to configure an agent.
- BingCustomSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.AssistantTool'
+ title: FileSearch tool
+ OpenAI.AssistantToolsFileSearchFileSearch:
+ type: object
+ properties:
+ max_num_results:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 1
+ maximum: 50
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.FileSearchRankingOptions'
+ OpenAI.AssistantToolsFileSearchTypeOnly:
type: object
required:
- type
- - call_id
- - arguments
- - status
properties:
type:
type: string
enum:
- - bing_custom_search_preview_call
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
- type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A Bing custom search tool call.
- BingCustomSearchToolCallOutput:
+ - file_search
+ description: 'The type of tool being defined: `file_search`'
+ x-stainless-const: true
+ title: FileSearch tool
+ OpenAI.AssistantToolsFunction:
type: object
required:
- type
- - call_id
- - status
+ - function
properties:
type:
type: string
enum:
- - bing_custom_search_preview_call_output
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Bing custom search tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ - function
+ description: 'The type of tool being defined: `function`'
+ x-stainless-const: true
+ function:
+ $ref: '#/components/schemas/OpenAI.FunctionObject'
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a Bing custom search tool call.
- BingCustomSearchToolParameters:
+ - $ref: '#/components/schemas/OpenAI.AssistantTool'
+ title: Function tool
+ OpenAI.AssistantsApiResponseFormatOption:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatText'
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject'
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
+ description: |-
+ Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
+ 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](/docs/guides/structured-outputs).
+ Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON.
+ *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.
+ OpenAI.AssistantsApiToolChoiceOption:
+ oneOf:
+ - type: string
+ enum:
+ - none
+ - auto
+ - required
+ - $ref: '#/components/schemas/OpenAI.AssistantsNamedToolChoice'
+ description: |-
+ Controls which (if any) tool is called by the model.
+ `none` means the model will not call any tools and instead generates a message.
+ `auto` is the default value and means the model can pick between generating a message or calling one or more tools.
+ `required` means the model must call one or more tools before responding to the user.
+ Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
+ OpenAI.AssistantsNamedToolChoice:
type: object
required:
- - search_configurations
+ - type
properties:
- search_configurations:
- type: array
- items:
- $ref: '#/components/schemas/BingCustomSearchConfiguration'
- maxItems: 1
- description: |-
- The project connections attached to this tool. There can be a maximum of 1 connection
- resource attached to the tool.
- description: The bing custom search tool parameters.
- BingGroundingSearchConfiguration:
+ type:
+ type: string
+ enum:
+ - function
+ - code_interpreter
+ - file_search
+ description: The type of the tool. If type is `function`, the function name must be set
+ function:
+ $ref: '#/components/schemas/OpenAI.AssistantsNamedToolChoiceFunction'
+ description: Specifies a tool the model should use. Use to force the model to call a specific tool.
+ OpenAI.AssistantsNamedToolChoiceFunction:
type: object
required:
- - project_connection_id
+ - name
properties:
- project_connection_id:
+ name:
type: string
- description: Project connection id for grounding with bing search
- market:
+ OpenAI.AudioResponseFormat:
+ type: string
+ enum:
+ - json
+ - text
+ - srt
+ - verbose_json
+ - vtt
+ - diarized_json
+ description: 'The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`. For `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and `diarized_json`, with `diarized_json` required to receive speaker annotations.'
+ OpenAI.AudioTranscription:
+ type: object
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - whisper-1
+ - gpt-4o-mini-transcribe
+ - gpt-4o-mini-transcribe-2025-12-15
+ - gpt-4o-transcribe
+ - gpt-4o-transcribe-diarize
+ - gpt-realtime-whisper
+ description: The model to use for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
+ language:
type: string
- description: The market where the results come from.
- set_lang:
+ description: |-
+ 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.
+ prompt:
type: string
- description: The language to use for user interface strings when calling Bing API.
- count:
- type: integer
- format: int64
- description: The number of search results to return in the bing api response
- freshness:
+ description: |-
+ 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](/docs/guides/speech-to-text#prompting).
+ For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the prompt is a free text string, for example "expect words related to technology".
+ Prompt is not supported with `gpt-realtime-whisper` in GA Realtime sessions.
+ delay:
type: string
- description: Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters).
- description: Search configuration for Bing Grounding
- BingGroundingSearchToolParameters:
+ enum:
+ - minimal
+ - low
+ - medium
+ - high
+ - xhigh
+ description: |-
+ Controls how long the model waits before emitting transcription text.
+ Higher values can improve transcription accuracy at the cost of latency.
+ Only supported with `gpt-realtime-whisper` in GA Realtime sessions.
+ OpenAI.AudioTranscriptionResponse:
type: object
- required:
- - search_configurations
properties:
- search_configurations:
- type: array
- items:
- $ref: '#/components/schemas/BingGroundingSearchConfiguration'
- maxItems: 1
- description: |-
- The search configurations attached to this tool. There can be a maximum of 1
- search configuration resource attached to the tool.
- description: The bing grounding search tool parameters.
- BingGroundingTool:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - whisper-1
+ - gpt-4o-mini-transcribe
+ - gpt-4o-mini-transcribe-2025-12-15
+ - gpt-4o-transcribe
+ - gpt-4o-transcribe-diarize
+ - gpt-realtime-whisper
+ description: The model used for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`.
+ language:
+ type: string
+ description: The language of the input audio.
+ prompt:
+ type: string
+ description: The prompt configured for input audio transcription, when present.
+ OpenAI.AutoChunkingStrategyRequestParam:
type: object
required:
- type
- - bing_grounding
properties:
type:
type: string
enum:
- - bing_grounding
- description: The object type, which is always 'bing_grounding'.
- name:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- bing_grounding:
- $ref: '#/components/schemas/BingGroundingSearchToolParameters'
- description: The bing grounding search tool parameters.
+ - auto
+ description: Always `auto`.
+ x-stainless-const: true
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for a bing grounding search tool as used to configure an agent.
- BingGroundingToolCall:
+ - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ description: The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
+ title: Auto Chunking Strategy
+ OpenAI.AutoCodeInterpreterToolParam:
type: object
required:
- type
- - call_id
- - arguments
- - status
properties:
type:
type: string
enum:
- - bing_grounding_call
- call_id:
+ - auto
+ description: Always `auto`.
+ x-stainless-const: true
+ default: auto
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 50
+ description: An optional list of uploaded files to make available to your code.
+ memory_limit:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit'
+ - type: 'null'
+ network_policy:
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
+ title: Automatic Code Interpreter Tool Parameters
+ OpenAI.Batch:
+ type: object
+ required:
+ - id
+ - object
+ - endpoint
+ - input_file_id
+ - completion_window
+ - status
+ - created_at
+ properties:
+ id:
type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
+ object:
type: string
- description: A JSON string of the arguments to pass to the tool.
+ enum:
+ - batch
+ description: The object type, which is always `batch`.
+ x-stainless-const: true
+ endpoint:
+ type: string
+ description: The OpenAI API endpoint used by the batch.
+ model:
+ type: string
+ description: |-
+ Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI
+ offers a wide range of models with different capabilities, performance
+ characteristics, and price points. Refer to the [model
+ guide](/docs/models) to browse and compare available models.
+ errors:
+ $ref: '#/components/schemas/OpenAI.BatchErrors'
+ input_file_id:
+ type: string
+ description: The ID of the input file for the batch.
+ completion_window:
+ type: string
+ description: The time frame within which the batch should be processed.
status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A Bing grounding tool call.
- BingGroundingToolCallOutput:
+ type: string
+ enum:
+ - validating
+ - failed
+ - in_progress
+ - finalizing
+ - completed
+ - expired
+ - cancelling
+ - cancelled
+ description: The current status of the batch.
+ output_file_id:
+ type: string
+ description: The ID of the file containing the outputs of successfully executed requests.
+ error_file_id:
+ type: string
+ description: The ID of the file containing the outputs of requests with errors.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch was created.
+ in_progress_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch started processing.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch will expire.
+ finalizing_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch started finalizing.
+ completed_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch was completed.
+ failed_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch failed.
+ expired_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch expired.
+ cancelling_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch started cancelling.
+ cancelled_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch was cancelled.
+ request_counts:
+ $ref: '#/components/schemas/OpenAI.BatchRequestCounts'
+ description: The request counts for different statuses within the batch.
+ usage:
+ $ref: '#/components/schemas/OpenAI.BatchUsage'
+ description: |-
+ Represents token usage details including input tokens, output tokens, a
+ breakdown of output tokens, and the total tokens used. Only populated on
+ batches created after September 7, 2025.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ x-oaiMeta:
+ name: The batch object
+ example: |
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/completions",
+ "model": "gpt-5-2025-08-07",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "completed",
+ "output_file_id": "file-cvaTdG",
+ "error_file_id": "file-HOWS94",
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": 1711493133,
+ "completed_at": 1711493163,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 95,
+ "failed": 5
+ },
+ "usage": {
+ "input_tokens": 1500,
+ "input_tokens_details": {
+ "cached_tokens": 1024
+ },
+ "output_tokens": 500,
+ "output_tokens_details": {
+ "reasoning_tokens": 300
+ },
+ "total_tokens": 2000
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+ OpenAI.BatchError:
type: object
- required:
- - type
- - call_id
- - status
properties:
- type:
+ code:
type: string
- enum:
- - bing_grounding_call_output
- call_id:
+ description: An error code identifying the error type.
+ message:
type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Bing grounding tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a Bing grounding tool call.
- BlobReference:
+ description: A human-readable message providing more details about the error.
+ param:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: The name of the parameter that caused the error, if applicable.
+ line:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The line number of the input file where the error occurred, if applicable.
+ OpenAI.BatchErrors:
type: object
- required:
- - blobUri
- - storageAccountArmId
- - credential
properties:
- blobUri:
- type: string
- format: uri
- description: 'Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path`'
- storageAccountArmId:
+ object:
type: string
- description: ARM ID of the storage account to use.
- credential:
- $ref: '#/components/schemas/SasCredential'
- description: Credential info to access the storage account.
- description: Blob reference details.
- BotServiceAuthorizationScheme:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.BatchError'
+ OpenAI.BatchFileExpirationAfter:
type: object
required:
- - type
+ - anchor
+ - seconds
properties:
- type:
+ anchor:
type: string
enum:
- - BotService
- allOf:
- - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- BotServiceRbacAuthorizationScheme:
+ - created_at
+ description: '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.'
+ x-stainless-const: true
+ seconds:
+ type: integer
+ format: int64
+ minimum: 3600
+ maximum: 2592000
+ description: The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days).
+ description: The expiration policy for the output and/or error file that are generated for a batch.
+ title: File expiration policy
+ OpenAI.BatchRequestCounts:
type: object
required:
- - type
+ - total
+ - completed
+ - failed
properties:
- type:
- type: string
- enum:
- - BotServiceRbac
- allOf:
- - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- BotServiceTenantAuthorizationScheme:
+ total:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.BatchUsage:
type: object
required:
- - type
+ - input_tokens
+ - input_tokens_details
+ - output_tokens
+ - output_tokens_details
+ - total_tokens
properties:
- type:
- type: string
- enum:
- - BotServiceTenant
- allOf:
- - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- BrowserAutomationPreviewTool:
+ input_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ input_tokens_details:
+ $ref: '#/components/schemas/OpenAI.BatchUsageInputTokensDetails'
+ output_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ output_tokens_details:
+ $ref: '#/components/schemas/OpenAI.BatchUsageOutputTokensDetails'
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.BatchUsageInputTokensDetails:
type: object
required:
- - type
- - browser_automation_preview
+ - cached_tokens
properties:
- type:
- type: string
- enum:
- - browser_automation_preview
- description: The object type, which is always 'browser_automation_preview'.
- browser_automation_preview:
- $ref: '#/components/schemas/BrowserAutomationToolParameters'
- description: The Browser Automation Tool parameters.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for a Browser Automation Tool, as used to configure an Agent.
- BrowserAutomationPreviewToolboxTool:
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.BatchUsageOutputTokensDetails:
type: object
required:
- - type
- - browser_automation_preview
+ - reasoning_tokens
properties:
- type:
- type: string
- enum:
- - browser_automation_preview
- browser_automation_preview:
- $ref: '#/components/schemas/BrowserAutomationToolParameters'
- description: The Browser Automation Tool parameters.
- allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: A browser automation tool stored in a toolbox.
- BrowserAutomationToolCall:
+ reasoning_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.ChatCompletionAllowedTools:
type: object
required:
- - type
- - call_id
- - arguments
- - status
+ - mode
+ - tools
properties:
- type:
+ mode:
type: string
enum:
- - browser_automation_preview_call
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
- type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A browser automation tool call.
- BrowserAutomationToolCallOutput:
+ - auto
+ - required
+ description: |-
+ 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.
+ tools:
+ type: array
+ items:
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ 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" } }
+ ]
+ ```
+ description: Constrains the tools available to the model to a pre-defined set.
+ title: Allowed tools
+ OpenAI.ChatCompletionAllowedToolsChoice:
type: object
required:
- type
- - call_id
- - status
+ - allowed_tools
properties:
type:
type: string
enum:
- - browser_automation_preview_call_output
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the browser automation tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a browser automation tool call.
- BrowserAutomationToolConnectionParameters:
+ - allowed_tools
+ description: Allowed tool configuration type. Always `allowed_tools`.
+ x-stainless-const: true
+ allowed_tools:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionAllowedTools'
+ description: Constrains the tools available to the model to a pre-defined set.
+ title: Allowed tools
+ OpenAI.ChatCompletionDeleted:
type: object
required:
- - project_connection_id
+ - object
+ - id
+ - deleted
properties:
- project_connection_id:
+ object:
type: string
- description: The ID of the project connection to your Azure Playwright resource.
- description: Definition of input parameters for the connection used by the Browser Automation Tool.
- BrowserAutomationToolParameters:
+ enum:
+ - chat.completion.deleted
+ description: The type of object being deleted.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The ID of the chat completion that was deleted.
+ deleted:
+ type: boolean
+ description: Whether the chat completion was deleted.
+ OpenAI.ChatCompletionFunctionCallOption:
type: object
required:
- - connection
+ - name
properties:
- connection:
- $ref: '#/components/schemas/BrowserAutomationToolConnectionParameters'
- description: The project connection parameters associated with the Browser Automation Tool.
- description: Definition of input parameters for the Browser Automation Tool.
- CaptureStructuredOutputsTool:
+ name:
+ type: string
+ description: The name of the function to call.
+ description: 'Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.'
+ OpenAI.ChatCompletionFunctions:
type: object
required:
- - type
- - outputs
+ - name
properties:
- type:
+ description:
type: string
- enum:
- - capture_structured_outputs
- description: The type of the tool. Always `capture_structured_outputs`.
+ description: A description of what the function does, used by the model to choose when and how to call the function.
name:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- outputs:
- $ref: '#/components/schemas/StructuredOutputDefinition'
- description: The structured outputs to capture from the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool for capturing structured outputs
- ChartCoordinate:
- type: object
- required:
- - x
- - 'y'
- - size
- properties:
- x:
- type: integer
- format: int32
- description: X-axis coordinate.
- 'y':
- type: integer
- format: int32
- description: Y-axis coordinate.
- size:
- type: integer
- format: int32
- description: Size of the chart element.
- description: Coordinates for the analysis chart.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- ChatSummaryMemoryItem:
+ description: 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.
+ parameters:
+ $ref: '#/components/schemas/OpenAI.FunctionParameters'
+ deprecated: true
+ OpenAI.ChatCompletionList:
type: object
required:
- - kind
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- kind:
+ object:
type: string
enum:
- - chat_summary
- description: The kind of the memory item.
- allOf:
- - $ref: '#/components/schemas/MemoryItem'
- description: A memory item containing a summary extracted from conversations.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- ClusterInsightResult:
- type: object
- required:
- - summary
- - clusters
- properties:
- summary:
- $ref: '#/components/schemas/InsightSummary'
- description: Summary of the insights report.
- clusters:
+ - list
+ description: The type of this object. It is always set to "list".
+ x-stainless-const: true
+ default: list
+ data:
type: array
items:
- $ref: '#/components/schemas/InsightCluster'
- description: List of clusters identified in the insights.
- coordinates:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ChartCoordinate'
- description: |2-
- Optional mapping of IDs to 2D coordinates used by the UX for visualization.
-
- The map keys are string identifiers (for example, a cluster id or a sample id)
- and the values are the coordinates and visual size for rendering on a 2D chart.
-
- This property is omitted unless the client requests coordinates (for example,
- by passing `includeCoordinates=true` as a query parameter).
-
- Example:
- ```
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponse'
+ description: An array of chat completion objects.
+ x-ms-list-page-items: true
+ first_id:
+ type: string
+ description: The identifier of the first chat completion in the data array.
+ last_id:
+ type: string
+ description: The identifier of the last chat completion in the data array.
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ description: Indicates whether there are more Chat Completions available.
+ description: An object representing a list of Chat Completions.
+ title: ChatCompletionList
+ x-oaiMeta:
+ name: The chat completion list object
+ group: chat
+ example: |
+ {
+ "object": "list",
+ "data": [
{
- "cluster-1": { "x": 12, "y": 34, "size": 8 },
- "sample-123": { "x": 18, "y": 22, "size": 4 }
+ "object": "chat.completion",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "model": "gpt-4o-2024-08-06",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {},
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
}
- ```
-
- Coordinates are intended only for client-side visualization and do not
- modify the canonical insights results.
- description: Insights from the cluster analysis.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- ClusterTokenUsage:
- type: object
- required:
- - inputTokenUsage
- - outputTokenUsage
- - totalTokenUsage
- properties:
- inputTokenUsage:
- type: integer
- format: int32
- description: input token usage
- outputTokenUsage:
- type: integer
- format: int32
- description: output token usage
- totalTokenUsage:
- type: integer
- format: int32
- description: total token usage
- description: Token usage for cluster analysis
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- CodeBasedEvaluatorDefinition:
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "has_more": false
+ }
+ OpenAI.ChatCompletionMessageCustomToolCall:
type: object
required:
+ - id
- type
+ - custom
properties:
+ id:
+ type: string
+ description: The ID of the tool call.
type:
type: string
enum:
- - code
- code_text:
- type: string
- description: Inline code text for the evaluator
- entry_point:
- type: string
- description: The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- image_tag:
+ - custom
+ description: The type of the tool. Always `custom`.
+ x-stainless-const: true
+ custom:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCallCustom'
+ description: The custom tool that the model called.
+ description: A call to a custom tool created by the model.
+ title: Custom tool call
+ OpenAI.ChatCompletionMessageCustomToolCallCustom:
+ type: object
+ required:
+ - name
+ - input
+ properties:
+ name:
type: string
- description: The container image tag to use for evaluator code execution
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- blob_uri:
+ input:
type: string
- format: uri
- description: The blob URI for the evaluator storage
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- allOf:
- - $ref: '#/components/schemas/EvaluatorDefinition'
- description: Code-based evaluator definition using python code
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- CodeConfiguration:
+ OpenAI.ChatCompletionMessageList:
type: object
required:
- - runtime
- - entry_point
- - dependency_resolution
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- runtime:
+ object:
type: string
- description: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13').
- entry_point:
+ enum:
+ - list
+ description: The type of this object. It is always set to "list".
+ x-stainless-const: true
+ default: list
+ data:
type: array
items:
- type: string
- description: The entry point command and arguments for the code execution.
- dependency_resolution:
- $ref: '#/components/schemas/CodeDependencyResolution'
- description: |-
- How package dependencies are resolved at deployment time. Defaults to `bundled`,
- where the caller bundles all dependencies into the uploaded zip and the service
- performs no remote build. `remote_build` instructs the service to build
- dependencies remotely from the manifest included in the uploaded zip.
- default: bundled
- content_hash:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageListData'
+ description: An array of chat completion message objects.
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The SHA-256 hex digest of the uploaded code zip. Set by the service from the `x-ms-code-zip-sha256` request header; read-only in responses and never accepted in request payloads.
- readOnly: true
- description: Code-based deployment configuration for a hosted agent.
- CodeDependencyResolution:
- anyOf:
- - type: string
- - type: string
- enum:
- - bundled
- - remote_build
- description: How package dependencies are resolved at deployment time for a code-based hosted agent.
- CodeInterpreterToolboxTool:
+ description: The identifier of the first chat message in the data array.
+ last_id:
+ type: string
+ description: The identifier of the last chat message in the data array.
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ description: Indicates whether there are more chat messages available.
+ description: An object representing a list of chat completion messages.
+ title: ChatCompletionMessageList
+ x-oaiMeta:
+ name: The chat completion message list object
+ group: chat
+ example: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "role": "user",
+ "content": "write a haiku about ai",
+ "name": null,
+ "content_parts": null
+ }
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "has_more": false
+ }
+ OpenAI.ChatCompletionMessageListData:
type: object
required:
- - type
+ - content
+ - refusal
+ - role
+ - id
properties:
- type:
- type: string
- enum:
- - code_interpreter
- container:
+ content:
anyOf:
- type: string
- - $ref: '#/components/schemas/OpenAI.AutoCodeInterpreterToolParam'
+ - type: 'null'
+ refusal:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tool_calls:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem'
+ annotations:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations'
description: |-
- The code interpreter container. Can be a container ID or an object that
- specifies uploaded file IDs to make available to your code, along with an
- optional `memory_limit` setting.
- If not provided, the service assumes auto.
- allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: A code interpreter tool stored in a toolbox.
- CompletionMessageToolCallChunk:
+ Annotations for the message, when applicable, as when using the
+ [web search tool](/docs/guides/tools-web-search?api-mode=chat).
+ role:
+ type: string
+ enum:
+ - assistant
+ description: The role of the author of this message.
+ x-stainless-const: true
+ function_call:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall'
+ description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
+ deprecated: true
+ audio:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio'
+ - type: 'null'
+ id:
+ type: string
+ content_parts:
+ anyOf:
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage'
+ - type: 'null'
+ OpenAI.ChatCompletionMessageToolCall:
type: object
required:
- id
- type
+ - function
properties:
id:
type: string
- description: The Id for the tool call.
+ description: The ID of the tool call.
type:
type: string
enum:
- function
- description: The type of tool call, which is always "function".
+ description: The type of the tool. Currently, only `function` is supported.
+ x-stainless-const: true
function:
- $ref: '#/components/schemas/FunctionToolCall'
- description: Details of the function tool call, if applicable.
- description: Tool call details within a message.
- Connection:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallFunction'
+ description: The function that the model called.
+ description: A call to a function tool created by the model.
+ title: Function tool call
+ OpenAI.ChatCompletionMessageToolCallFunction:
type: object
required:
- name
- - id
- - type
- - target
- - isDefault
- - credentials
- - metadata
+ - arguments
properties:
name:
type: string
- description: The friendly name of the connection, provided by the user.
- readOnly: true
- id:
- type: string
- description: A unique identifier for the connection, generated by the service
- readOnly: true
- type:
- $ref: '#/components/schemas/ConnectionType'
- description: Category of the connection
- readOnly: true
- target:
- type: string
- description: The connection URL to be used for this service
- readOnly: true
- isDefault:
- type: boolean
- description: Whether the connection is tagged as the default connection of its type
- readOnly: true
- credentials:
- $ref: '#/components/schemas/BaseCredentials'
- description: The credentials used by the connection
- readOnly: true
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Metadata of the connection
- readOnly: true
- description: Response from the list and get connections operations
- ConnectionType:
- anyOf:
- - type: string
- - type: string
- enum:
- - AzureOpenAI
- - AzureBlob
- - AzureStorageAccount
- - CognitiveSearch
- - CosmosDB
- - ApiKey
- - AppConfig
- - AppInsights
- - CustomKeys
- - RemoteTool_Preview
- description: The Type (or category) of the connection
- ContainerConfiguration:
- type: object
- required:
- - image
- properties:
- image:
+ arguments:
type: string
- description: The container image for the hosted agent.
- examples:
- - my-registry.azurecr.io/my-hosted-agent:latest
- description: Container-based deployment configuration for a hosted agent.
- ContentFilterResult:
+ OpenAI.ChatCompletionMessageToolCalls:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCall'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall'
+ description: The tool calls generated by the model, such as function calls.
+ OpenAI.ChatCompletionMessageToolCallsItem:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCall'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall'
+ description: The tool calls generated by the model, such as function calls.
+ OpenAI.ChatCompletionModeration:
type: object
required:
- - blocked
- - source_type
- - content_filter_results
+ - input
+ - output
properties:
- blocked:
- type: boolean
- description: Whether the content was blocked by the content filter.
- source_type:
- type: string
- description: The source type of the content filter evaluation (e.g., 'prompt', 'response', 'pre_tool_call', 'post_tool_call').
- content_filter_results:
- $ref: '#/components/schemas/AzureContentFilterResultsForResponses'
- description: The content filter results for this evaluation.
- tool_call_id:
- type: string
- description: The ID of the tool call associated with this content filter result, if applicable.
- description: A content filter evaluation result for a specific source in the response.
- ContinuousEvaluationRuleAction:
+ input:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntry'
+ description: Moderation for the request input.
+ output:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntry'
+ description: Moderation for the generated output.
+ description: Moderation results or errors for the request input and generated output.
+ OpenAI.ChatCompletionModerationEntry:
type: object
required:
- type
- - evalId
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntryType'
+ discriminator:
+ propertyName: type
+ mapping:
+ moderation_results: '#/components/schemas/OpenAI.ChatCompletionModerationResults'
+ error: '#/components/schemas/OpenAI.ChatCompletionModerationError'
+ description: Moderation results or an error for a chat completion moderation check.
+ OpenAI.ChatCompletionModerationEntryType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - continuousEvaluation
- evalId:
- type: string
- description: Eval Id to add continuous evaluation runs to.
- maxHourlyRuns:
- type: integer
- format: int32
- description: Maximum number of evaluation runs allowed per hour.
- samplingRate:
- type: number
- format: double
- maximum: 100
- description: Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the service-default is to evaluate every event, which is equivalent to setting a sampling rate of 100.
- exclusiveMinimum: 0
- default: 100
- allOf:
- - $ref: '#/components/schemas/EvaluationRuleAction'
- description: Evaluation rule action for continuous evaluation.
- ConversationGenPreviewItemGenerationParams:
+ - moderation_results
+ - error
+ OpenAI.ChatCompletionModerationError:
type: object
required:
- type
- - model
+ - code
+ - message
properties:
type:
type: string
enum:
- - conversation_gen_preview
- description: The type of item generation parameters, always `conversation_gen_preview`.
- model:
+ - error
+ description: The object type, which is always `error`.
+ x-stainless-const: true
+ code:
type: string
- description: The model deployment used for simulation, in the format '{connectionName}/modelDeploymentName'.
- max_turns:
- type: integer
- format: int32
- description: Maximum number of turns per simulated conversation. Defaults to 20.
- default: 20
- num_conversations:
- type: integer
- format: int32
- description: Number of simulated conversations to generate per test scenario. Defaults to 5.
- default: 5
- data_mapping:
- type: object
- unevaluatedProperties:
- type: string
- description: Mapping from source fields to response_id field, which is required for retrieving chat history.
- sampling_params:
- $ref: '#/components/schemas/ModelSamplingParams'
- description: Sampling parameters for the conversation generation.
+ description: The error code.
+ message:
+ type: string
+ description: The error message.
allOf:
- - $ref: '#/components/schemas/ItemGenerationParams'
- description: Represents the parameters for conversation simulation item generation.
- ConversationIdTraceSource:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntry'
+ description: An error produced while attempting moderation.
+ OpenAI.ChatCompletionModerationResults:
type: object
required:
- type
- - conversation_ids
+ - model
+ - results
properties:
type:
type: string
enum:
- - conversation_id_source
- description: The type of trace source, always `conversation_id_source`.
- conversation_ids:
+ - moderation_results
+ description: The object type, which is always `moderation_results`.
+ x-stainless-const: true
+ model:
+ type: string
+ description: The moderation model used to generate the results.
+ results:
type: array
items:
- type: string
- description: Collection of conversation identifiers to filter traces by.
+ $ref: '#/components/schemas/OpenAI.ModerationResultBody'
+ description: A list of moderation results.
allOf:
- - $ref: '#/components/schemas/TraceSource'
- description: A trace source that selects traces by conversation IDs.
- CosmosDBIndex:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntry'
+ description: Successful moderation results for the request input or generated output.
+ OpenAI.ChatCompletionNamedToolChoice:
type: object
required:
- type
+ - function
properties:
type:
type: string
enum:
- - CosmosDBNoSqlVectorStore
- description: Type of index
- allOf:
- - $ref: '#/components/schemas/Index'
- description: CosmosDB Vector Store Index Definition
- CosmosDBIndexUpdate:
+ - function
+ description: For function calling, the type is always `function`.
+ x-stainless-const: true
+ function:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceFunction'
+ description: Specifies a tool the model should use. Use to force the model to call a specific function.
+ title: Function tool choice
+ OpenAI.ChatCompletionNamedToolChoiceCustom:
type: object
required:
- type
+ - custom
properties:
type:
type: string
enum:
- - CosmosDBNoSqlVectorStore
- description: Type of index
- allOf:
- - $ref: '#/components/schemas/IndexUpdate'
- description: CosmosDB Vector Store Index Definition
- CreateAgentFromCodeContent:
- type: object
- properties:
- metadata:
- allOf:
- - $ref: '#/components/schemas/CreateAgentVersionFromCodeMetadata'
- description: JSON metadata including description and hosted definition.
- code:
- description: The code zip file (max 250 MB).
- required:
- - metadata
- - code
- CreateAgentFromManifestRequest:
+ - custom
+ description: For custom tool calling, the type is always `custom`.
+ x-stainless-const: true
+ custom:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustomCustom'
+ description: Specifies a tool the model should use. Use to force the model to call a specific custom tool.
+ title: Custom tool choice
+ OpenAI.ChatCompletionNamedToolChoiceCustomCustom:
type: object
required:
- name
- - manifest_id
- - parameter_values
properties:
name:
type: string
- maxLength: 63
- description: |-
- The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
- - Must start and end with alphanumeric characters,
- - Can contain hyphens in the middle
- - Must not exceed 63 characters.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the agent.
- manifest_id:
- type: string
- description: The manifest ID to import the agent version from.
- parameter_values:
- type: object
- unevaluatedProperties: {}
- description: The inputs to the manifest that will result in a fully materialized Agent.
- CreateAgentRequest:
+ OpenAI.ChatCompletionNamedToolChoiceFunction:
type: object
required:
- name
- - definition
properties:
name:
type: string
- maxLength: 63
- description: |-
- The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
- - Must start and end with alphanumeric characters,
- - Can contain hyphens in the middle
- - Must not exceed 63 characters.
- state:
- $ref: '#/components/schemas/AgentState'
- description: The initial operational state of the agent. Defaults to 'enabled' if not specified.
- default: enabled
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the agent.
- definition:
- $ref: '#/components/schemas/AgentDefinition'
- description: The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
- x-ms-foundry-meta:
- conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- blueprint_reference:
- $ref: '#/components/schemas/AgentBlueprintReference'
- description: The blueprint reference for the agent.
- draft:
- type: boolean
- description: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.
- x-ms-foundry-meta:
- conditional_previews:
- - DraftAgents=V1Preview
- default: false
- agent_endpoint:
- $ref: '#/components/schemas/AgentEndpointConfig'
- description: An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent
- agent_card:
- $ref: '#/components/schemas/AgentCard'
- description: Optional agent card for the agent
- x-ms-foundry-meta:
- conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- CreateAgentSessionRequest:
- type: object
- required:
- - version_indicator
- properties:
- agent_session_id:
- type: string
- description: Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. Auto-generated if omitted.
- version_indicator:
- $ref: '#/components/schemas/VersionIndicator'
- description: Determines which agent version backs the session.
- description: Request to create a new agent session.
- CreateAgentVersionFromCodeContent:
- type: object
- properties:
- metadata:
- allOf:
- - $ref: '#/components/schemas/CreateAgentVersionFromCodeMetadata'
- description: JSON metadata including description and hosted definition.
- code:
- description: The code zip file (max 250 MB).
- required:
- - metadata
- - code
- CreateAgentVersionFromCodeMetadata:
- type: object
- required:
- - definition
- properties:
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the agent.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- definition:
- $ref: '#/components/schemas/HostedAgentDefinition'
- description: The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, and protocol_versions.
- description: |-
- JSON metadata for code-based agent operations (create, update, create version).
- The agent name comes from the URL path parameter or the `x-ms-agent-name` header,
- so it is not included in this model.
- The content hash (SHA-256 of the zip) is carried in the `x-ms-code-zip-sha256` header.
- CreateAgentVersionFromManifestRequest:
- type: object
- required:
- - manifest_id
- - parameter_values
- properties:
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the agent.
- manifest_id:
- type: string
- description: The manifest ID to import the agent version from.
- parameter_values:
- type: object
- unevaluatedProperties: {}
- description: The inputs to the manifest that will result in a fully materialized Agent.
- CreateAgentVersionRequest:
+ OpenAI.ChatCompletionRequestAssistantMessage:
type: object
required:
- - definition
+ - role
properties:
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- description:
+ content:
+ anyOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart'
+ - type: 'null'
+ refusal:
+ anyOf:
+ - type: string
+ - type: 'null'
+ role:
type: string
- maxLength: 512
- description: A human-readable description of the agent.
- definition:
- $ref: '#/components/schemas/AgentDefinition'
- description: The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
- x-ms-foundry-meta:
- conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- blueprint_reference:
- $ref: '#/components/schemas/AgentBlueprintReference'
- description: The blueprint reference for the agent.
- draft:
- type: boolean
- description: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.
- x-ms-foundry-meta:
- conditional_previews:
- - DraftAgents=V1Preview
- default: false
- x-ms-foundry-meta:
- conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- CreateEvalRequest:
- type: object
- required:
- - data_source_config
- - testing_criteria
- properties:
+ enum:
+ - assistant
+ description: The role of the messages author, in this case `assistant`.
+ x-stainless-const: true
name:
type: string
- description: The name of the evaluation.
- metadata:
+ description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
+ audio:
anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageAudio'
- type: 'null'
- data_source_config:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig'
- - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig'
- - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig'
- - $ref: '#/components/schemas/AzureAIDataSourceConfig'
- - $ref: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
- description: The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation.
- testing_criteria:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
- - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
- - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
- - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
- description: 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}}`).
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- title: CreateEvalRequest
- CreateEvalRunRequest:
- type: object
- required:
- - data_source
- properties:
- name:
- type: string
- description: The name of the run.
- metadata:
+ tool_calls:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCalls'
+ function_call:
anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageFunctionCall'
- type: 'null'
- data_source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource'
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource'
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Details about the run's data source.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- evaluation_level:
- $ref: '#/components/schemas/EvaluationLevel'
- description: The level at which evaluation is performed. Defaults to 'turn' if not specified.
- default: turn
- title: CreateEvalRunRequest
- CreateSkillVersionFromFilesBody:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ description: Messages sent by the model in response to user messages.
+ title: Assistant message
+ OpenAI.ChatCompletionRequestAssistantMessageAudio:
+ type: object
+ required:
+ - id
+ properties:
+ id:
+ type: string
+ OpenAI.ChatCompletionRequestAssistantMessageContentPart:
type: object
+ required:
+ - type
properties:
- files:
- type: array
- items: {}
- description: Skill files to upload. Upload a single zip file or multiple individual files with relative paths.
- default:
- type: boolean
- description: Whether to set this version as the default. Defaults to false.
+ type:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartType'
+ discriminator:
+ propertyName: type
+ mapping:
+ refusal: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartRefusal'
+ text: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText'
+ OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText:
+ type: object
required:
- - files
- CredentialType:
+ - type
+ - text
+ properties:
+ type:
+ type: string
+ enum:
+ - text
+ description: The type of the content part.
+ x-stainless-const: true
+ text:
+ type: string
+ description: The text content.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart'
+ description: Learn about [text inputs](/docs/guides/text-generation).
+ title: Text content part
+ OpenAI.ChatCompletionRequestAssistantMessageContentPartType:
anyOf:
- type: string
- type: string
enum:
- - ApiKey
- - AAD
- - SAS
- - CustomKeys
- - None
- - AgenticIdentityToken_Preview
- description: The credential type used by the connection
- CronTrigger:
+ - text
+ - refusal
+ OpenAI.ChatCompletionRequestAssistantMessageFunctionCall:
type: object
required:
- - type
- - expression
+ - arguments
+ - name
properties:
- type:
- type: string
- enum:
- - Cron
- expression:
+ arguments:
type: string
- description: Cron expression that defines the schedule frequency.
- timeZone:
+ name:
type: string
- description: Time zone for the cron schedule. Defaults to `UTC`.
- default: UTC
- startTime:
+ OpenAI.ChatCompletionRequestDeveloperMessage:
+ type: object
+ required:
+ - content
+ - role
+ properties:
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ description: The contents of the developer message.
+ role:
type: string
- description: Start time for the cron schedule in ISO 8601 format.
- endTime:
+ enum:
+ - developer
+ description: The role of the messages author, in this case `developer`.
+ x-stainless-const: true
+ name:
type: string
- description: End time for the cron schedule in ISO 8601 format.
+ description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
allOf:
- - $ref: '#/components/schemas/Trigger'
- description: Cron based trigger.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- CustomCredential:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ description: |-
+ Developer-provided instructions that the model should follow, regardless of
+ messages sent by the user. With o1 models and newer, `developer` messages
+ replace the previous `system` messages.
+ title: Developer message
+ OpenAI.ChatCompletionRequestFunctionMessage:
type: object
required:
- - type
+ - role
+ - content
+ - name
properties:
- type:
+ role:
type: string
enum:
- - CustomKeys
- description: The credential type
- readOnly: true
- unevaluatedProperties:
- type: string
+ - function
+ description: The role of the messages author, in this case `function`.
+ x-stainless-const: true
+ content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ name:
+ type: string
+ description: The name of the function to call.
allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: Custom credential definition
- CustomRoutineTrigger:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ title: Function message
+ deprecated: true
+ OpenAI.ChatCompletionRequestMessage:
+ type: object
+ required:
+ - role
+ properties:
+ role:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageType'
+ discriminator:
+ propertyName: role
+ mapping:
+ assistant: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessage'
+ developer: '#/components/schemas/OpenAI.ChatCompletionRequestDeveloperMessage'
+ function: '#/components/schemas/OpenAI.ChatCompletionRequestFunctionMessage'
+ system: '#/components/schemas/OpenAI.ChatCompletionRequestSystemMessage'
+ user: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessage'
+ tool: '#/components/schemas/OpenAI.ChatCompletionRequestToolMessage'
+ OpenAI.ChatCompletionRequestMessageContentPartAudio:
type: object
required:
- type
- - provider
- - parameters
+ - input_audio
properties:
type:
type: string
enum:
- - custom
- description: The trigger type.
- provider:
+ - input_audio
+ description: The type of the content part. Always `input_audio`.
+ x-stainless-const: true
+ input_audio:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: Learn about [audio inputs](/docs/guides/audio).
+ title: Audio content part
+ OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio:
+ type: object
+ required:
+ - data
+ - format
+ properties:
+ data:
type: string
- maxLength: 128
- description: The external provider that emits the custom event.
- event_name:
+ format:
type: string
- maxLength: 256
- description: The provider-specific event name that fires the routine.
- parameters:
- type: object
- unevaluatedProperties: {}
- description: Provider-specific trigger parameters.
- allOf:
- - $ref: '#/components/schemas/RoutineTrigger'
- description: A custom event routine trigger.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- DailyRecurrenceSchedule:
+ enum:
+ - wav
+ - mp3
+ OpenAI.ChatCompletionRequestMessageContentPartFile:
type: object
required:
- type
- - hours
+ - file
properties:
type:
type: string
enum:
- - Daily
- description: Daily recurrence type.
- hours:
- type: array
- items:
- type: integer
- format: int32
- description: Hours for the recurrence schedule.
+ - file
+ description: The type of the content part. Always `file`.
+ x-stainless-const: true
+ file:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFileFile'
allOf:
- - $ref: '#/components/schemas/RecurrenceSchedule'
- description: Daily recurrence schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- DataGenerationJob:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: Learn about [file inputs](/docs/guides/text) for text generation.
+ title: File content part
+ OpenAI.ChatCompletionRequestMessageContentPartFileFile:
+ type: object
+ properties:
+ filename:
+ type: string
+ file_data:
+ type: string
+ file_id:
+ type: string
+ OpenAI.ChatCompletionRequestMessageContentPartImage:
type: object
required:
- - id
- - status
- - created_at
+ - type
+ - image_url
properties:
- id:
+ type:
type: string
- description: Server-assigned unique identifier.
- readOnly: true
- inputs:
- $ref: '#/components/schemas/DataGenerationJobInputs'
- description: Caller-supplied inputs.
- result:
- $ref: '#/components/schemas/DataGenerationJobResult'
- description: Result produced on success.
- readOnly: true
- status:
- $ref: '#/components/schemas/JobStatus'
- description: Current lifecycle status.
- readOnly: true
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error details — populated only on failure.
- readOnly: true
- created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).
- readOnly: true
- finished_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job was finished, represented in Unix time (seconds since January 1, 1970).
- readOnly: true
- description: Data Generation Job resource.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobInputs:
+ enum:
+ - image_url
+ description: The type of the content part.
+ x-stainless-const: true
+ image_url:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: Learn about [image inputs](/docs/guides/vision).
+ title: Image content part
+ OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl:
type: object
required:
- - name
- - sources
- - options
- - scenario
+ - url
properties:
- name:
+ url:
type: string
- description: The display name of the data generation job.
- sources:
- type: array
- items:
- $ref: '#/components/schemas/DataGenerationJobSource'
- description: The sources used for the data generation job.
- options:
- $ref: '#/components/schemas/DataGenerationJobOptions'
- description: The options for the data generation job.
- scenario:
- $ref: '#/components/schemas/DataGenerationJobScenario'
- description: The scenario of the data generation job. Either for fine-tuning or evaluation.
- output_options:
- $ref: '#/components/schemas/DataGenerationJobOutputOptions'
- description: Optional caller-supplied metadata for the job's output. See individual fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.
- description: Caller-supplied inputs for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobOptions:
+ format: uri
+ detail:
+ type: string
+ enum:
+ - auto
+ - low
+ - high
+ default: auto
+ OpenAI.ChatCompletionRequestMessageContentPartRefusal:
type: object
required:
- type
- - max_samples
+ - refusal
properties:
type:
- $ref: '#/components/schemas/DataGenerationJobType'
- description: The data generation job type.
- max_samples:
- type: integer
- format: int32
- description: Maximum number of samples to generate.
- train_split:
- type: number
- format: float
- minimum: 0
- maximum: 1
- description: The proportion of the generated data to be used for training when the data is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1.
- model_options:
- $ref: '#/components/schemas/DataGenerationModelOptions'
- description: The LLM model options.
- discriminator:
- propertyName: type
- mapping:
- simple_qna: '#/components/schemas/SimpleQnADataGenerationJobOptions'
- traces: '#/components/schemas/TracesDataGenerationJobOptions'
- tool_use: '#/components/schemas/ToolUseFineTuningDataGenerationJobOptions'
- description: Options for managing data generation jobs.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobOutput:
+ type: string
+ enum:
+ - refusal
+ description: The type of the content part.
+ x-stainless-const: true
+ refusal:
+ type: string
+ description: The refusal message generated by the model.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart'
+ title: Refusal content part
+ OpenAI.ChatCompletionRequestMessageContentPartText:
type: object
required:
- type
+ - text
properties:
type:
- $ref: '#/components/schemas/DataGenerationJobOutputType'
- description: The type of the output.
- discriminator:
- propertyName: type
- mapping:
- file: '#/components/schemas/FileDataGenerationJobOutput'
- dataset: '#/components/schemas/DatasetDataGenerationJobOutput'
- description: Output information for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobOutputOptions:
- type: object
- properties:
- name:
type: string
- description: Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario).
- description:
+ enum:
+ - text
+ description: The type of the content part.
+ x-stainless-const: true
+ text:
type: string
- description: Description to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs.
- description: Output options for data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobOutputType:
+ description: The text content.
+ description: Learn about [text inputs](/docs/guides/text-generation).
+ title: Text content part
+ OpenAI.ChatCompletionRequestMessageType:
anyOf:
- type: string
- type: string
enum:
- - file
- - dataset
- description: The supported output file types for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobResult:
+ - developer
+ - system
+ - user
+ - assistant
+ - tool
+ - function
+ OpenAI.ChatCompletionRequestSystemMessage:
type: object
required:
- - generated_samples
+ - content
+ - role
properties:
- outputs:
- type: array
- items:
- $ref: '#/components/schemas/DataGenerationJobOutput'
- description: 'The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.'
- generated_samples:
- type: integer
- format: int32
- description: The number of samples actually generated.
- token_usage:
- $ref: '#/components/schemas/DataGenerationTokenUsage'
- description: The token usage information for the data generation job.
- description: Result produced by a successful data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobScenario:
- anyOf:
- - type: string
- - type: string
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestSystemMessageContentPart'
+ description: The contents of the system message.
+ role:
+ type: string
enum:
- - supervised_finetuning
- - reinforcement_finetuning
- - evaluation
- description: The supported scenarios for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobSource:
+ - system
+ description: The role of the messages author, in this case `system`.
+ x-stainless-const: true
+ name:
+ type: string
+ description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ description: |-
+ Developer-provided instructions that the model should follow, regardless of
+ messages sent by the user. With o1 models and newer, use `developer` messages
+ for this purpose instead.
+ title: System message
+ OpenAI.ChatCompletionRequestSystemMessageContentPart:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ OpenAI.ChatCompletionRequestToolMessage:
+ type: object
+ required:
+ - role
+ - content
+ - tool_call_id
+ properties:
+ role:
+ type: string
+ enum:
+ - tool
+ description: The role of the messages author, in this case `tool`.
+ x-stainless-const: true
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestToolMessageContentPart'
+ description: The contents of the tool message.
+ tool_call_id:
+ type: string
+ description: Tool call that this message is responding to.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ title: Tool message
+ OpenAI.ChatCompletionRequestToolMessageContentPart:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ OpenAI.ChatCompletionRequestUserMessage:
+ type: object
+ required:
+ - content
+ - role
+ properties:
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: The contents of the user message.
+ role:
+ type: string
+ enum:
+ - user
+ description: The role of the messages author, in this case `user`.
+ x-stainless-const: true
+ name:
+ type: string
+ description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ description: |-
+ Messages sent by an end user, containing prompts or additional context
+ information.
+ title: User message
+ OpenAI.ChatCompletionRequestUserMessageContentPart:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/DataGenerationJobSourceType'
- description: The type of source.
- description:
- type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartType'
discriminator:
propertyName: type
mapping:
- prompt: '#/components/schemas/PromptDataGenerationJobSource'
- agent: '#/components/schemas/AgentDataGenerationJobSource'
- traces: '#/components/schemas/TracesDataGenerationJobSource'
- file: '#/components/schemas/FileDataGenerationJobSource'
- description: The base source model for data generation jobs.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobSourceType:
- anyOf:
- - type: string
- - type: string
+ image_url: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage'
+ input_audio: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudio'
+ file: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFile'
+ text: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText'
+ OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText:
+ type: object
+ required:
+ - type
+ - text
+ properties:
+ type:
+ type: string
enum:
- - prompt
- - agent
- - traces
- - file
- description: The supported source types for data generation jobs.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobType:
+ - text
+ description: The type of the content part.
+ x-stainless-const: true
+ text:
+ type: string
+ description: The text content.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: Learn about [text inputs](/docs/guides/text-generation).
+ title: Text content part
+ OpenAI.ChatCompletionRequestUserMessageContentPartType:
anyOf:
- type: string
- type: string
enum:
- - simple_qna
- - traces
- - tool_use
- description: The supported data generation job types.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationModelOptions:
+ - text
+ - image_url
+ - input_audio
+ - file
+ OpenAI.ChatCompletionResponseMessage:
type: object
required:
- - model
+ - content
+ - refusal
+ - role
properties:
- model:
+ content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ refusal:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tool_calls:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem'
+ annotations:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations'
+ description: |-
+ Annotations for the message, when applicable, as when using the
+ [web search tool](/docs/guides/tools-web-search?api-mode=chat).
+ role:
type: string
- description: Base model name used to generate data.
- description: LLM model options for data generation jobs.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationTokenUsage:
- type: object
- required:
- - prompt_tokens
- - completion_tokens
- - total_tokens
- properties:
- prompt_tokens:
- type: integer
- format: int64
- description: The number of prompt tokens used.
- readOnly: true
- completion_tokens:
- type: integer
- format: int64
- description: The number of completion tokens generated.
- readOnly: true
- total_tokens:
- type: integer
- format: int64
- description: Total number of tokens used.
- readOnly: true
- description: Token usage information for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataSourceConfig:
+ enum:
+ - assistant
+ description: The role of the author of this message.
+ x-stainless-const: true
+ function_call:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall'
+ description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
+ deprecated: true
+ audio:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio'
+ - type: 'null'
+ description: A chat completion message generated by the model.
+ OpenAI.ChatCompletionResponseMessageAnnotations:
type: object
required:
- type
- - schema
+ - url_citation
properties:
type:
type: string
- description: The data source type discriminator.
- schema:
- type: object
- unevaluatedProperties: {}
- description: The overall object JSON schema for the run data source items.
- discriminator:
- propertyName: type
- mapping:
- azure_ai_source: '#/components/schemas/AzureAIDataSourceConfig'
- description: Base class for run data sources with discriminator support.
- DatasetDataGenerationJobOutput:
+ enum:
+ - url_citation
+ x-stainless-const: true
+ url_citation:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation'
+ OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation:
type: object
required:
- - type
+ - end_index
+ - start_index
+ - url
+ - title
properties:
- type:
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ url:
type: string
- enum:
- - dataset
- description: Dataset output.
- id:
+ format: uri
+ title:
type: string
- description: The id of the output dataset created.
- readOnly: true
- name:
+ OpenAI.ChatCompletionResponseMessageAudio:
+ type: object
+ required:
+ - id
+ - expires_at
+ - data
+ - transcript
+ properties:
+ id:
type: string
- description: The name of the output dataset.
- readOnly: true
- version:
+ expires_at:
+ type: integer
+ format: unixtime
+ data:
type: string
- description: The version of the output dataset.
- readOnly: true
- description:
+ transcript:
type: string
- description: Description of the output dataset.
- readOnly: true
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary of the output dataset.
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/DataGenerationJobOutput'
- description: Dataset output for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DatasetEvaluatorGenerationJobSource:
+ OpenAI.ChatCompletionResponseMessageFunctionCall:
type: object
required:
- - type
+ - arguments
- name
properties:
- description:
- type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
- type:
+ arguments:
type: string
- enum:
- - dataset
- description: The source type for this source, which is Dataset.
name:
type: string
- description: The name of the dataset.
- version:
+ OpenAI.ChatCompletionStreamOptions:
+ type: object
+ properties:
+ include_usage:
+ type: boolean
+ description: |-
+ 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_obfuscation:
+ type: boolean
+ description: |-
+ 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.
+ description: 'Options for streaming response. Only set this when you set `stream: true`.'
+ OpenAI.ChatCompletionTokenLogprob:
+ type: object
+ required:
+ - token
+ - logprob
+ - bytes
+ - top_logprobs
+ properties:
+ token:
type: string
- description: The version of the dataset. If not specified, the latest version is used.
- allOf:
- - $ref: '#/components/schemas/EvaluatorGenerationJobSource'
- description: Dataset source for evaluator generation jobs — reference to a dataset.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- DatasetReference:
+ description: The token.
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: 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.
+ bytes:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ top_logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprobTopLogprobs'
+ description: List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`.
+ OpenAI.ChatCompletionTokenLogprobTopLogprobs:
type: object
required:
- - name
- - version
+ - token
+ - logprob
+ - bytes
properties:
- name:
+ token:
type: string
- description: Dataset name.
- version:
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ bytes:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ OpenAI.ChatCompletionTool:
+ type: object
+ required:
+ - type
+ - function
+ properties:
+ type:
type: string
- description: Dataset version.
- description: Reference to a versioned Foundry Dataset.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- DatasetType:
- anyOf:
- - type: string
+ enum:
+ - function
+ description: The type of the tool. Currently, only `function` is supported.
+ x-stainless-const: true
+ function:
+ $ref: '#/components/schemas/OpenAI.FunctionObject'
+ description: A function tool that can be used to generate a response.
+ title: Function tool
+ OpenAI.ChatCompletionToolChoiceOption:
+ oneOf:
- type: string
enum:
- - uri_file
- - uri_folder
- description: Enum to determine the type of data.
- DatasetVersion:
+ - none
+ - auto
+ - required
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionAllowedToolsChoice'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoice'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustom'
+ description: |-
+ Controls which (if any) tool is called by the model.
+ `none` means the model will not call any tool and instead generates a message.
+ `auto` means the model can pick between generating a message or calling one or more tools.
+ `required` means the model must call one or more tools.
+ Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
+ `none` is the default when no tools are present. `auto` is the default if tools are present.
+ OpenAI.ChunkingStrategyRequestParam:
type: object
required:
- - dataUri
- type
- - name
- - version
properties:
- dataUri:
- type: string
- minLength: 1
- pattern: '[a-zA-Z0-9_]'
- description: URI of the data ([example](https://go.microsoft.com/fwlink/?linkid=2202330))
type:
- $ref: '#/components/schemas/DatasetType'
- description: Dataset type
- isReference:
- type: boolean
- description: Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted
- readOnly: true
- connectionName:
- type: string
- description: The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset
- id:
- type: string
- description: Asset ID, a unique identifier for the asset
- readOnly: true
- name:
- type: string
- description: The name of the resource
- readOnly: true
- version:
- type: string
- description: The version of the resource
- readOnly: true
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParamType'
discriminator:
propertyName: type
mapping:
- uri_file: '#/components/schemas/FileDatasetVersion'
- uri_folder: '#/components/schemas/FolderDatasetVersion'
- description: DatasetVersion Definition
- DatasetVersionUpdate:
+ auto: '#/components/schemas/OpenAI.AutoChunkingStrategyRequestParam'
+ static: '#/components/schemas/OpenAI.StaticChunkingStrategyRequestParam'
+ description: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy.
+ OpenAI.ChunkingStrategyRequestParamType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - auto
+ - static
+ OpenAI.ChunkingStrategyResponse:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/DatasetType'
- description: Dataset type
- description:
- type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponseType'
discriminator:
propertyName: type
mapping:
- uri_file: '#/components/schemas/FileDatasetVersionUpdate'
- uri_folder: '#/components/schemas/FolderDatasetVersionUpdate'
- description: DatasetVersion Definition
- DayOfWeek:
+ static: '#/components/schemas/OpenAI.StaticChunkingStrategyResponseParam'
+ other: '#/components/schemas/OpenAI.OtherChunkingStrategyResponseParam'
+ description: The strategy used to chunk the file.
+ OpenAI.ChunkingStrategyResponseType:
anyOf:
- type: string
- type: string
enum:
- - Sunday
- - Monday
- - Tuesday
- - Wednesday
- - Thursday
- - Friday
- - Saturday
- description: Days of the week for recurrence schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- DeleteAgentResponse:
+ - static
+ - other
+ OpenAI.ClickButtonType:
+ type: string
+ enum:
+ - left
+ - right
+ - wheel
+ - back
+ - forward
+ OpenAI.ClickParam:
type: object
required:
- - object
- - name
- - deleted
+ - type
+ - button
+ - x
+ - 'y'
properties:
- object:
+ type:
type: string
enum:
- - agent.deleted
- description: The object type. Always 'agent.deleted'.
- name:
- type: string
- description: The name of the agent.
- deleted:
- type: boolean
- description: Whether the agent was successfully deleted.
- description: A deleted agent Object
- DeleteAgentVersionResponse:
+ - click
+ description: Specifies the event type. For a click action, this property is always `click`.
+ x-stainless-const: true
+ button:
+ $ref: '#/components/schemas/OpenAI.ClickButtonType'
+ description: Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
+ x:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The x-coordinate where the click occurred.
+ 'y':
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The y-coordinate where the click occurred.
+ keys:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A click action.
+ title: Click
+ OpenAI.CodeInterpreterOutputImage:
type: object
required:
- - object
- - name
- - version
- - deleted
+ - type
+ - url
properties:
- object:
+ type:
type: string
enum:
- - agent.version.deleted
- description: The object type. Always 'agent.version.deleted'.
- name:
- type: string
- description: The name of the agent.
- version:
+ - image
+ description: The type of the output. Always `image`.
+ x-stainless-const: true
+ default: image
+ url:
type: string
- description: The version identifier of the agent.
- deleted:
- type: boolean
- description: Whether the agent was successfully deleted.
- description: A deleted agent version Object
- DeleteEvalResponse:
+ format: uri
+ description: The URL of the image output from the code interpreter.
+ description: The image output from the code interpreter.
+ title: Code interpreter output image
+ OpenAI.CodeInterpreterOutputLogs:
type: object
required:
- - object
- - eval_id
- - deleted
+ - type
+ - logs
properties:
- object:
+ type:
type: string
enum:
- - eval.deleted
- description: The object type. Always 'eval.deleted'.
- eval_id:
+ - logs
+ description: The type of the output. Always `logs`.
+ x-stainless-const: true
+ default: logs
+ logs:
type: string
- description: id of the eval.
- deleted:
- type: boolean
- description: Whether the eval was successfully deleted.
- description: A deleted evaluation Object
- DeleteEvalRunResponse:
+ description: The logs output from the code interpreter.
+ description: The logs output from the code interpreter.
+ title: Code interpreter output logs
+ OpenAI.CodeInterpreterTool:
type: object
+ required:
+ - type
properties:
- object:
+ type:
type: string
enum:
- - eval.deleted
- description: The object type. Always 'eval.deleted'.
- run_id:
+ - code_interpreter
+ description: The type of the code interpreter tool. Always `code_interpreter`.
+ x-stainless-const: true
+ name:
type: string
- description: id of the eval.
- deleted:
- type: boolean
- description: Whether the eval was successfully deleted.
- description: A deleted evaluation run Object.
- DeleteMemoryResponse:
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ container:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.AutoCodeInterpreterToolParam'
+ description: |-
+ The code interpreter container. Can be a container ID or an object that
+ specifies uploaded file IDs to make available to your code, along with an
+ optional `memory_limit` setting.
+ If not provided, the service assumes auto.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that runs Python code to help generate a response to a prompt.
+ title: Code interpreter
+ OpenAI.CompactResource:
type: object
required:
+ - id
- object
- - memory_id
- - deleted
+ - output
+ - created_at
+ - usage
properties:
+ id:
+ type: string
+ description: The unique identifier for the compacted response.
object:
type: string
enum:
- - memory_store.item.deleted
- description: The object type. Always 'memory_store.item.deleted'.
- memory_id:
+ - response.compaction
+ description: The object type. Always `response.compaction`.
+ x-stainless-const: true
+ default: response.compaction
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The compacted list of output items.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the compacted conversation was created.
+ usage:
+ $ref: '#/components/schemas/OpenAI.ResponseUsage'
+ description: Token accounting for the compaction pass, including cached, reasoning, and total tokens.
+ title: The compacted response object
+ OpenAI.CompactResponseMethodPublicBody:
+ type: object
+ required:
+ - model
+ properties:
+ model:
type: string
- description: The unique ID of the deleted memory item.
- deleted:
- type: boolean
- description: Whether the memory item was successfully deleted.
- description: Response for deleting a memory item from a memory store.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- DeleteMemoryStoreResponse:
+ description: The model deployment to use for the compaction of this response.
+ input:
+ anyOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.InputItem'
+ - type: 'null'
+ previous_response_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ prompt_cache_key:
+ anyOf:
+ - type: string
+ - type: 'null'
+ prompt_cache_retention:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.PromptCacheRetentionEnum'
+ - type: 'null'
+ service_tier:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ServiceTierEnum'
+ - type: 'null'
+ OpenAI.ComparisonFilter:
type: object
required:
- - object
- - name
- - deleted
+ - type
+ - key
+ - value
properties:
- object:
+ type:
type: string
enum:
- - memory_store.deleted
- description: The object type. Always 'memory_store.deleted'.
- name:
+ - eq
+ - ne
+ - gt
+ - gte
+ - lt
+ - lte
+ - in
+ - nin
+ description: |-
+ Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.
+ - `eq`: equals
+ - `ne`: not equal
+ - `gt`: greater than
+ - `gte`: greater than or equal
+ - `lt`: less than
+ - `lte`: less than or equal
+ - `in`: in
+ - `nin`: not in
+ default: eq
+ key:
type: string
- description: The name of the memory store.
- deleted:
- type: boolean
- description: Whether the memory store was successfully deleted.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- DeleteResponseResult:
+ description: The key to compare against the value.
+ value:
+ oneOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: boolean
+ - type: array
+ items:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: The value to compare against the attribute key; supports string, number, or boolean types.
+ description: A filter used to compare a specified attribute key to a given value using a defined comparison operation.
+ title: Comparison Filter
+ x-oaiMeta:
+ name: ComparisonFilter
+ OpenAI.CompleteUploadRequest:
type: object
required:
- - id
- - object
- - deleted
+ - part_ids
properties:
- id:
- type: string
- description: The operation ID.
- object:
+ part_ids:
+ type: array
+ items:
+ type: string
+ description: The ordered list of Part IDs.
+ md5:
type: string
- enum:
- - response
- description: Always return 'response'.
- deleted:
- type: boolean
- enum:
- - true
- description: Always return true
- description: The result of a delete response operation.
- DeleteSkillResponse:
+ description: The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect.
+ OpenAI.CompletionUsage:
type: object
required:
- - id
- - name
- - deleted
+ - completion_tokens
+ - prompt_tokens
+ - total_tokens
properties:
- id:
- type: string
- description: The unique identifier of the deleted skill.
- name:
- $ref: '#/components/schemas/SkillName'
- description: The unique name of the skill.
- deleted:
- type: boolean
- description: Whether the skill was successfully deleted.
- description: A deleted skill.
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- DeleteSkillVersionResponse:
+ completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of tokens in the generated completion.
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of tokens in the prompt.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Total number of tokens used in the request (prompt + completion).
+ completion_tokens_details:
+ $ref: '#/components/schemas/OpenAI.CompletionUsageCompletionTokensDetails'
+ description: Breakdown of tokens used in a completion.
+ prompt_tokens_details:
+ $ref: '#/components/schemas/OpenAI.CompletionUsagePromptTokensDetails'
+ description: Breakdown of tokens used in the prompt.
+ description: Usage statistics for the completion request.
+ OpenAI.CompletionUsageCompletionTokensDetails:
+ type: object
+ properties:
+ accepted_prediction_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ audio_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ reasoning_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ rejected_prediction_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CompletionUsagePromptTokensDetails:
+ type: object
+ properties:
+ audio_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CompoundFilter:
type: object
required:
- - id
- - name
- - deleted
- - version
+ - type
+ - filters
properties:
- id:
- type: string
- description: The unique identifier of the deleted skill version.
- name:
- $ref: '#/components/schemas/SkillName'
- description: The name of the skill.
- deleted:
- type: boolean
- description: Whether the skill version was successfully deleted.
- version:
+ type:
type: string
- description: The version that was deleted.
- description: A deleted skill version.
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- Deployment:
+ enum:
+ - and
+ - or
+ description: 'Type of operation: `and` or `or`.'
+ filters:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
+ - {}
+ description: Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
+ description: Combine multiple filters using `and` or `or`.
+ title: Compound Filter
+ x-oaiMeta:
+ name: CompoundFilter
+ OpenAI.ComputerAction:
type: object
required:
- type
- - name
properties:
type:
- $ref: '#/components/schemas/DeploymentType'
- description: The type of the deployment
- name:
- type: string
- description: Name of the deployment
- readOnly: true
+ $ref: '#/components/schemas/OpenAI.ComputerActionType'
discriminator:
propertyName: type
mapping:
- ModelDeployment: '#/components/schemas/ModelDeployment'
- description: Model Deployment Definition
- DeploymentType:
+ click: '#/components/schemas/OpenAI.ClickParam'
+ double_click: '#/components/schemas/OpenAI.DoubleClickAction'
+ drag: '#/components/schemas/OpenAI.DragParam'
+ keypress: '#/components/schemas/OpenAI.KeyPressAction'
+ move: '#/components/schemas/OpenAI.MoveParam'
+ screenshot: '#/components/schemas/OpenAI.ScreenshotParam'
+ scroll: '#/components/schemas/OpenAI.ScrollParam'
+ type: '#/components/schemas/OpenAI.TypeParam'
+ wait: '#/components/schemas/OpenAI.WaitParam'
+ OpenAI.ComputerActionList:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: |-
+ Flattened batched actions for `computer_use`. Each action includes an
+ `type` discriminator and action-specific fields.
+ title: Computer Action List
+ OpenAI.ComputerActionType:
anyOf:
- type: string
- type: string
enum:
- - ModelDeployment
- Dimension:
+ - click
+ - double_click
+ - drag
+ - keypress
+ - move
+ - screenshot
+ - scroll
+ - type
+ - wait
+ OpenAI.ComputerCallSafetyCheckParam:
type: object
required:
- id
- - description
- - weight
properties:
id:
type: string
- description: Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. Provided by the user when manually creating a rubric evaluator or during human-in-the-loop review of a generated set; the generation pipeline produces an initial value the user can edit. Editable when saving new versions.
- description:
- type: string
- description: What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and pursues the appropriate workflow').
- weight:
- type: integer
- format: int32
- minimum: 1
- maximum: 10
- description: Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension weight 8-10; all others use 1-6. User edits are not constrained by this heuristic.
- always_applicable:
- type: boolean
- description: When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is not specified by the caller.
- default: false
- description: A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- DispatchRoutineRequest:
+ description: The ID of the pending safety check.
+ code:
+ anyOf:
+ - type: string
+ - type: 'null'
+ message:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: A pending safety check for the computer call.
+ OpenAI.ComputerEnvironment:
+ type: string
+ enum:
+ - windows
+ - mac
+ - linux
+ - ubuntu
+ - browser
+ OpenAI.ComputerScreenshotContent:
type: object
+ required:
+ - type
+ - image_url
+ - file_id
+ - detail
properties:
- payload:
- $ref: '#/components/schemas/RoutineDispatchPayload'
- description: A direct action-input override sent downstream when testing a routine.
- description: Request body for the public dispatch_async route.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- DispatchRoutineResponse:
+ type:
+ type: string
+ enum:
+ - computer_screenshot
+ description: Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.
+ x-stainless-const: true
+ image_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A screenshot of a computer.
+ title: Computer screenshot
+ OpenAI.ComputerScreenshotImage:
type: object
+ required:
+ - type
properties:
- dispatch_id:
+ type:
type: string
- description: The dispatch identifier created for the routine dispatch.
- action_correlation_id:
+ enum:
+ - computer_screenshot
+ description: |-
+ Specifies the event type. For a computer screenshot, this property is
+ always set to `computer_screenshot`.
+ x-stainless-const: true
+ default: computer_screenshot
+ image_url:
type: string
- description: A downstream action correlation identifier, when available.
- task_id:
+ format: uri
+ description: The URL of the screenshot image.
+ file_id:
type: string
- description: A workspace task identifier created for the dispatch, when available.
- description: Identifiers returned after a routine dispatch is queued.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- EndpointBasedEvaluatorDefinition:
+ description: The identifier of an uploaded file that contains the screenshot.
+ description: A computer screenshot image used with the computer use tool.
+ OpenAI.ComputerTool:
type: object
required:
- type
- - connection_name
properties:
type:
type: string
enum:
- - endpoint
- connection_name:
+ - computer
+ description: The type of the computer tool. Always `computer`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
+ title: Computer
+ OpenAI.ComputerUsePreviewTool:
+ type: object
+ required:
+ - type
+ - environment
+ - display_width
+ - display_height
+ properties:
+ type:
type: string
- minLength: 1
- description: "Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends `api-key` header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity)."
+ enum:
+ - computer_use_preview
+ description: The type of the computer use tool. Always `computer_use_preview`.
+ x-stainless-const: true
+ environment:
+ $ref: '#/components/schemas/OpenAI.ComputerEnvironment'
+ description: The type of computer environment to control.
+ display_width:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The width of the computer display.
+ display_height:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The height of the computer display.
allOf:
- - $ref: '#/components/schemas/EvaluatorDefinition'
- description: Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row.
- EntraAuthorizationScheme:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
+ title: Computer use preview
+ OpenAI.ContainerAutoParam:
type: object
required:
- type
@@ -14772,3908 +47690,5120 @@ components:
type:
type: string
enum:
- - Entra
+ - container_auto
+ description: Automatically creates a container for this request
+ x-stainless-const: true
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 50
+ description: An optional list of uploaded files to make available to your code.
+ memory_limit:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit'
+ - type: 'null'
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ContainerSkill'
+ maxItems: 200
+ description: An optional list of skills referenced by id or inline data.
+ network_policy:
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
allOf:
- - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- EntraIDCredentials:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
+ OpenAI.ContainerFileCitationBody:
type: object
required:
- type
+ - container_id
+ - file_id
+ - start_index
+ - end_index
+ - filename
properties:
type:
type: string
enum:
- - AAD
- description: The credential type
- readOnly: true
+ - container_file_citation
+ description: The type of the container file citation. Always `container_file_citation`.
+ x-stainless-const: true
+ container_id:
+ type: string
+ description: The ID of the container file.
+ file_id:
+ type: string
+ description: The ID of the file.
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the first character of the container file citation in the message.
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the last character of the container file citation in the message.
+ filename:
+ type: string
+ description: The filename of the container file cited.
allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: Entra ID credential definition
- Eval:
+ - $ref: '#/components/schemas/OpenAI.Annotation'
+ description: A citation for a container file used to generate a model response.
+ title: Container file citation
+ OpenAI.ContainerFileListResource:
type: object
required:
- object
- - id
- - name
- - data_source_config
- - testing_criteria
- - created_at
- - metadata
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
object:
type: string
enum:
- - eval
- description: The object type.
- x-stainless-const: true
- default: eval
+ - list
+ description: The type of object returned, must be 'list'.
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ContainerFileResource'
+ description: A list of container files.
+ x-ms-list-page-items: true
+ first_id:
+ type: string
+ description: The ID of the first file in the list.
+ last_id:
+ type: string
+ description: The ID of the last file in the list.
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ description: Whether there are more files available.
+ OpenAI.ContainerFileResource:
+ type: object
+ required:
+ - id
+ - object
+ - container_id
+ - created_at
+ - bytes
+ - path
+ - source
+ properties:
id:
type: string
- description: Unique identifier for the evaluation.
- name:
+ description: Unique identifier for the file.
+ object:
type: string
- description: The name of the evaluation.
- data_source_config:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig'
- - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig'
- - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig'
- - $ref: '#/components/schemas/AzureAIDataSourceConfig'
- - $ref: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
- description: Configuration of data sources used in runs of the evaluation.
- testing_criteria:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
- - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
- - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
- - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
- description: A list of testing criteria.
+ enum:
+ - container.file
+ description: The type of this object (`container.file`).
+ container_id:
+ type: string
+ description: The container this file belongs to.
created_at:
type: integer
format: unixtime
- description: The Unix timestamp (in seconds) for when the eval was created.
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- modified_at:
- $ref: '#/components/schemas/integer'
- description: Unix timestamp (in seconds) when the evaluation run was last modified.
- created_by:
+ description: Unix timestamp (in seconds) when the file was created.
+ bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Size of the file in bytes.
+ path:
type: string
- description: the name of the person who created the run.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- description: |-
- 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
- title: Eval
+ description: Path of the file in the container.
+ source:
+ type: string
+ description: Source of the file (e.g., `user`, `assistant`).
+ title: The container file object
x-oaiMeta:
- name: The eval object
- group: evals
+ name: The container file object
example: |
{
- "object": "eval",
- "id": "eval_67abd54d9b0081909a86353f6fb9317a",
- "data_source_config": {
- "type": "custom",
- "item_schema": {
- "type": "object",
- "properties": {
- "label": {"type": "string"},
- },
- "required": ["label"]
- },
- "include_sample_schema": true
- },
- "testing_criteria": [
- {
- "name": "My string check grader",
- "type": "string_check",
- "input": "{{sample.output_text}}",
- "reference": "{{item.label}}",
- "operation": "eq",
- }
- ],
- "name": "External Data Eval",
- "created_at": 1739314509,
- "metadata": {
- "test": "synthetics",
- }
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
}
- EvalCsvFileIdSource:
+ OpenAI.ContainerListResource:
+ type: object
+ required:
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
+ properties:
+ object:
+ type: string
+ enum:
+ - list
+ description: The type of object returned, must be 'list'.
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ContainerResource'
+ description: A list of containers.
+ x-ms-list-page-items: true
+ first_id:
+ type: string
+ description: The ID of the first container in the list.
+ last_id:
+ type: string
+ description: The ID of the last container in the list.
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ description: Whether there are more containers available.
+ OpenAI.ContainerMemoryLimit:
+ type: string
+ enum:
+ - 1g
+ - 4g
+ - 16g
+ - 64g
+ OpenAI.ContainerNetworkPolicyAllowlistParam:
+ type: object
+ required:
+ - type
+ - allowed_domains
+ properties:
+ type:
+ type: string
+ enum:
+ - allowlist
+ description: Allow outbound network access only to specified domains. Always `allowlist`.
+ x-stainless-const: true
+ allowed_domains:
+ type: array
+ items:
+ type: string
+ minItems: 1
+ description: A list of allowed domains when type is `allowlist`.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ OpenAI.ContainerNetworkPolicyDisabledParam:
type: object
required:
- type
- - id
properties:
type:
type: string
enum:
- - file_id
- description: The type of source, always `file_id`.
- id:
- type: string
- description: The identifier of the uploaded CSV file.
- description: Represents a reference to an uploaded CSV file used as a source for evaluation data.
- EvalCsvRunDataSource:
+ - disabled
+ description: Disable outbound network access. Always `disabled`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ OpenAI.ContainerNetworkPolicyParam:
type: object
required:
- type
- - source
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParamType'
+ discriminator:
+ propertyName: type
+ mapping:
+ disabled: '#/components/schemas/OpenAI.ContainerNetworkPolicyDisabledParam'
+ allowlist: '#/components/schemas/OpenAI.ContainerNetworkPolicyAllowlistParam'
+ description: Network access policy for the container.
+ OpenAI.ContainerNetworkPolicyParamType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - csv
- description: The type of data source, always `csv`.
- source:
- $ref: '#/components/schemas/EvalCsvFileIdSource'
- description: The source of the CSV data, either inline content or a file reference.
- allOf:
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Represents a CSV data source for evaluation runs.
- EvalResult:
+ - disabled
+ - allowlist
+ OpenAI.ContainerReferenceResource:
type: object
required:
- - name
- type
- - score
- - passed
+ - container_id
properties:
- name:
- type: string
- description: name of the check
type:
type: string
- description: type of the check
- score:
- type: number
- format: float
- description: score
- passed:
- type: boolean
- description: indicates if the check passed or failed
- description: Result of the evaluation.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvalRun:
+ enum:
+ - container_reference
+ description: The environment type. Always `container_reference`.
+ x-stainless-const: true
+ container_id:
+ type: string
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ description: Represents a container created with /v1/containers.
+ title: Container Reference
+ OpenAI.ContainerResource:
type: object
required:
- - object
- id
- - eval_id
- - status
- - model
+ - object
- name
- created_at
- - report_url
- - result_counts
- - per_model_usage
- - per_testing_criteria_results
- - data_source
- - metadata
- - error
+ - status
properties:
- object:
- type: string
- enum:
- - eval.run
- description: The type of the object. Always "eval.run".
- x-stainless-const: true
- default: eval.run
id:
type: string
- description: Unique identifier for the evaluation run.
- eval_id:
- type: string
- description: The identifier of the associated evaluation.
- status:
- type: string
- description: The status of the evaluation run.
- model:
+ description: Unique identifier for the container.
+ object:
type: string
- description: The model that is evaluated, if applicable.
+ description: The type of this object.
name:
type: string
- description: The name of the evaluation run.
+ description: Name of the container.
created_at:
type: integer
format: unixtime
- description: Unix timestamp (in seconds) when the evaluation run was created.
- report_url:
- type: string
- format: uri
- description: The URL to the rendered evaluation run report on the UI dashboard.
- result_counts:
- $ref: '#/components/schemas/OpenAI.EvalRunResultCounts'
- description: Counters summarizing the outcomes of the evaluation run.
- per_model_usage:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalRunPerModelUsage'
- description: Usage statistics for each model during the evaluation run.
- per_testing_criteria_results:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults'
- description: Results per testing criteria applied during the evaluation run.
- data_source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource'
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource'
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Information about the run's data source.
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- error:
- $ref: '#/components/schemas/OpenAI.EvalApiError'
- modified_at:
- $ref: '#/components/schemas/integer'
- description: Unix timestamp (in seconds) when the evaluation run was last modified.
- created_by:
+ description: Unix timestamp (in seconds) when the container was created.
+ status:
type: string
- description: the name of the person who created the run.
- properties:
- type: object
- unevaluatedProperties:
- type: string
+ description: Status of the container (e.g., active, deleted).
+ last_active_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the container was last active.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.ContainerResourceExpiresAfter'
description: |-
- Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- evaluation_level:
- $ref: '#/components/schemas/EvaluationLevel'
- description: The level at which evaluation is performed. Defaults to 'turn' if not specified.
- default: turn
- description: A schema representing an evaluation run.
- title: EvalRun
+ 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.
+ memory_limit:
+ type: string
+ enum:
+ - 1g
+ - 4g
+ - 16g
+ - 64g
+ description: The memory limit configured for the container.
+ network_policy:
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ title: The container object
x-oaiMeta:
- name: The eval run object
- group: evals
+ name: The container object
example: |
{
- "object": "eval.run",
- "id": "evalrun_67e57965b480819094274e3a32235e4c",
- "eval_id": "eval_67e579652b548190aaa83ada4b125f47",
- "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c",
- "status": "queued",
- "model": "gpt-4o-mini",
- "name": "gpt-4o-mini",
- "created_at": 1743092069,
- "result_counts": {
- "total": 0,
- "errored": 0,
- "failed": 0,
- "passed": 0
- },
- "per_model_usage": null,
- "per_testing_criteria_results": null,
- "data_source": {
- "type": "completions",
- "source": {
- "type": "file_content",
- "content": [
- {
- "item": {
- "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
- "ground_truth": "Technology"
- }
- },
- {
- "item": {
- "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
- "ground_truth": "Markets"
- }
- },
- {
- "item": {
- "input": "International Summit Addresses Climate Change Strategies",
- "ground_truth": "World"
- }
- },
- {
- "item": {
- "input": "Major Retailer Reports Record-Breaking Holiday Sales",
- "ground_truth": "Business"
- }
- },
- {
- "item": {
- "input": "National Team Qualifies for World Championship Finals",
- "ground_truth": "Sports"
- }
- },
- {
- "item": {
- "input": "Stock Markets Rally After Positive Economic Data Released",
- "ground_truth": "Markets"
- }
- },
- {
- "item": {
- "input": "Global Manufacturer Announces Merger with Competitor",
- "ground_truth": "Business"
- }
- },
- {
- "item": {
- "input": "Breakthrough in Renewable Energy Technology Unveiled",
- "ground_truth": "Technology"
- }
- },
- {
- "item": {
- "input": "World Leaders Sign Historic Climate Agreement",
- "ground_truth": "World"
- }
- },
- {
- "item": {
- "input": "Professional Athlete Sets New Record in Championship Event",
- "ground_truth": "Sports"
- }
- },
- {
- "item": {
- "input": "Financial Institutions Adapt to New Regulatory Requirements",
- "ground_truth": "Business"
- }
- },
- {
- "item": {
- "input": "Tech Conference Showcases Advances in Artificial Intelligence",
- "ground_truth": "Technology"
- }
- },
- {
- "item": {
- "input": "Global Markets Respond to Oil Price Fluctuations",
- "ground_truth": "Markets"
- }
- },
- {
- "item": {
- "input": "International Cooperation Strengthened Through New Treaty",
- "ground_truth": "World"
- }
- },
- {
- "item": {
- "input": "Sports League Announces Revised Schedule for Upcoming Season",
- "ground_truth": "Sports"
- }
- }
- ]
- },
- "input_messages": {
- "type": "template",
- "template": [
- {
- "type": "message",
- "role": "developer",
- "content": {
- "type": "input_text",
- "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
-
- # Steps
-
- 1. Analyze the content of the news headline to understand its primary focus.
- 2. Extract the subject matter, identifying any key indicators or keywords.
- 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
- 4. Ensure only one category is selected per headline.
-
- # Output Format
-
- Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
-
- # Examples
-
- **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
- **Output**: "Technology"
-
- **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
- **Output**: "Markets"
-
- **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
- **Output**: "World"
-
- **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
- **Output**: "Business"
-
- **Input**: "Manchester United Secures Win in Premier League Football Match"
- **Output**: "Sports"
-
- # Notes
-
- - If the headline appears to fit into more than one category, choose the most dominant theme.
- - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
- "
- }
- },
- {
- "type": "message",
- "role": "user",
- "content": {
- "type": "input_text",
- "text": "{{item.input}}"
- }
- }
- ]
- },
- "model": "gpt-4o-mini",
- "sampling_params": {
- "seed": 42,
- "temperature": 1.0,
- "top_p": 1.0,
- "max_completions_tokens": 2048
- }
- },
- "error": null,
- "metadata": {}
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container",
+ "created_at": 1747844794,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747844794,
+ "memory_limit": "1g",
+ "name": "My Container"
}
- EvalRunDataSource:
- type: object
- required:
- - type
- properties:
- type:
- type: string
- description: The data source type discriminator.
- discriminator:
- propertyName: type
- mapping:
- azure_ai_traces_preview: '#/components/schemas/TracesPreviewEvalRunDataSource'
- azure_ai_synthetic_data_gen_preview: '#/components/schemas/SyntheticDataGenerationPreviewEvalRunDataSource'
- azure_ai_responses: '#/components/schemas/AzureAIResponsesEvalRunDataSource'
- azure_ai_target_completions: '#/components/schemas/TargetCompletionEvalRunDataSource'
- csv: '#/components/schemas/EvalCsvRunDataSource'
- azure_ai_red_team: '#/components/schemas/RedTeamEvalRunDataSource'
- azure_ai_trace_data_source_preview: '#/components/schemas/AzureAITraceDataSourcePreviewEvalRunDataSource'
- azure_ai_benchmark_preview: '#/components/schemas/AzureAIBenchmarkPreviewEvalRunDataSource'
- description: Base class for run data sources with discriminator support.
- EvalRunOutputItem:
+ OpenAI.ContainerResourceExpiresAfter:
type: object
- required:
- - object
- - id
- - run_id
- - eval_id
- - created_at
- - status
- - datasource_item_id
- - datasource_item
- - results
- - sample
properties:
- object:
+ anchor:
type: string
enum:
- - eval.run.output_item
- description: The type of the object. Always "eval.run.output_item".
- x-stainless-const: true
- default: eval.run.output_item
- id:
- type: string
- description: Unique identifier for the evaluation run output item.
- run_id:
- type: string
- description: The identifier of the evaluation run associated with this output item.
- eval_id:
- type: string
- description: The identifier of the evaluation group.
- created_at:
- type: integer
- format: unixtime
- description: Unix timestamp (in seconds) when the evaluation run was created.
- status:
- type: string
- description: The status of the evaluation run.
- datasource_item_id:
+ - last_active_at
+ minutes:
$ref: '#/components/schemas/OpenAI.integer'
- description: The identifier for the data source item.
- datasource_item:
- type: object
- unevaluatedProperties: {}
- description: Details of the input data source item.
- results:
- type: array
- items:
- $ref: '#/components/schemas/EvalRunOutputItemResult'
- description: A list of grader results for this output item.
- sample:
- $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSample'
- description: A sample containing the input and output of the evaluation run.
- description: A schema representing an evaluation run output item.
- title: EvalRunOutputItem
- x-oaiMeta:
- name: The eval run output item object
- group: evals
- example: |
- {
- "object": "eval.run.output_item",
- "id": "outputitem_67abd55eb6548190bb580745d5644a33",
- "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
- "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
- "created_at": 1739314509,
- "status": "pass",
- "datasource_item_id": 137,
- "datasource_item": {
- "teacher": "To grade essays, I only check for style, content, and grammar.",
- "student": "I am a student who is trying to write the best essay."
- },
- "results": [
- {
- "name": "String Check Grader",
- "type": "string-check-grader",
- "score": 1.0,
- "passed": true,
- }
- ],
- "sample": {
- "input": [
- {
- "role": "system",
- "content": "You are an evaluator bot..."
- },
- {
- "role": "user",
- "content": "You are assessing..."
- }
- ],
- "output": [
- {
- "role": "assistant",
- "content": "The rubric is not clear nor concise."
- }
- ],
- "finish_reason": "stop",
- "model": "gpt-4o-2024-08-06",
- "usage": {
- "total_tokens": 521,
- "completion_tokens": 2,
- "prompt_tokens": 519,
- "cached_tokens": 0
- },
- "error": null,
- "temperature": 1.0,
- "max_completion_tokens": 2048,
- "top_p": 1.0,
- "seed": 42
- }
- }
- EvalRunOutputItemResult:
+ OpenAI.ContainerSkill:
type: object
required:
- - name
- - score
- - passed
+ - type
properties:
- name:
- type: string
- description: The name of the grader.
- type:
- type: string
- description: The grader type (for example, "string-check-grader").
- score:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The numeric score produced by the grader.
- passed:
- type: boolean
- description: Whether the grader considered the output a pass.
- sample:
- anyOf:
- - type: object
- unevaluatedProperties: {}
- - type: 'null'
- description: Optional sample or intermediate data produced by the grader.
- status:
- $ref: '#/components/schemas/EvalRunOutputItemResultStatus'
- description: 'The evaluation status for this result item. Values: "completed", "errored", "skipped". Null if not provided by evaluator. When status is skipped, passed/score can be ignored.'
- metric:
- type: string
- description: The name of the metric (e.g., "fluency", "f1_score").
- label:
- type: string
- description: The label associated with the test criteria metric (e.g., "pass", "fail", "good", "bad").
- threshold:
- type: number
- format: float
- description: The threshold used to determine pass/fail for this test criteria, if it is numerical.
- reason:
- type: string
- description: The reason for the test criteria metric.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: Additional details about the test criteria metric.
- unevaluatedProperties: {}
- description: A single grader result for an evaluation run output item.
- title: EvalRunOutputItemResult
- EvalRunOutputItemResultStatus:
+ type:
+ $ref: '#/components/schemas/OpenAI.ContainerSkillType'
+ discriminator:
+ propertyName: type
+ mapping:
+ skill_reference: '#/components/schemas/OpenAI.SkillReferenceParam'
+ inline: '#/components/schemas/OpenAI.InlineSkillParam'
+ OpenAI.ContainerSkillType:
anyOf:
- type: string
- type: string
enum:
- - completed
- - errored
- - skipped
- description: The evaluation status for an evaluation run output item result.
- EvalRunOutputItemSampleInput:
+ - skill_reference
+ - inline
+ OpenAI.ContextManagementParam:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ description: The context management entry type. Currently only 'compaction' is supported.
+ compact_threshold:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ OpenAI.ConversationItem:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.ConversationItemType'
+ discriminator:
+ propertyName: type
+ mapping:
+ message: '#/components/schemas/OpenAI.ConversationItemMessage'
+ function_call: '#/components/schemas/OpenAI.ConversationItemFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutput'
+ file_search_call: '#/components/schemas/OpenAI.ConversationItemFileSearchToolCall'
+ web_search_call: '#/components/schemas/OpenAI.ConversationItemWebSearchToolCall'
+ image_generation_call: '#/components/schemas/OpenAI.ConversationItemImageGenToolCall'
+ computer_call: '#/components/schemas/OpenAI.ConversationItemComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.ConversationItemComputerToolCallOutput'
+ tool_search_call: '#/components/schemas/OpenAI.ConversationItemToolSearchCall'
+ tool_search_output: '#/components/schemas/OpenAI.ConversationItemToolSearchOutput'
+ additional_tools: '#/components/schemas/OpenAI.ConversationItemAdditionalTools'
+ reasoning: '#/components/schemas/OpenAI.ConversationItemReasoningItem'
+ compaction: '#/components/schemas/OpenAI.ConversationItemCompactionBody'
+ code_interpreter_call: '#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.ConversationItemFunctionShellCall'
+ shell_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput'
+ apply_patch_call: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall'
+ apply_patch_call_output: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput'
+ mcp_list_tools: '#/components/schemas/OpenAI.ConversationItemMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource'
+ mcp_call: '#/components/schemas/OpenAI.ConversationItemMcpToolCall'
+ custom_tool_call: '#/components/schemas/OpenAI.ConversationItemCustomToolCallResource'
+ custom_tool_call_output: '#/components/schemas/OpenAI.ConversationItemCustomToolCallOutputResource'
+ description: A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](/docs/api-reference/responses/object#responses/object-output).
+ title: Conversation item
+ OpenAI.ConversationItemAdditionalTools:
type: object
required:
+ - type
+ - id
- role
- - content
- - tool_calls
+ - tools
properties:
- role:
+ type:
type: string
- content:
+ enum:
+ - additional_tools
+ description: The type of the item. Always `additional_tools`.
+ x-stainless-const: true
+ default: additional_tools
+ id:
type: string
- tool_calls:
+ description: The unique ID of the additional tools item.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role that provided the additional tools.
+ tools:
type: array
items:
- $ref: '#/components/schemas/CompletionMessageToolCallChunk'
- description: Tool calls made within the message, if any.
- description: A message in the evaluation run.
- EvalRunOutputItemSampleOutput:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The additional tool definitions made available at this item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ OpenAI.ConversationItemApplyPatchToolCall:
type: object
required:
- - tool_calls
+ - type
+ - id
+ - call_id
+ - status
+ - operation
properties:
- role:
+ type:
type: string
- content:
+ enum:
+ - apply_patch_call
+ description: The type of the item. Always `apply_patch_call`.
+ x-stainless-const: true
+ default: apply_patch_call
+ id:
type: string
- tool_calls:
- type: array
- items:
- $ref: '#/components/schemas/CompletionMessageToolCallChunk'
- description: Tool calls made within the message, if any.
- description: A message in the evaluation run.
- EvalRunResultCompareItem:
+ description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
+ description: The status of the apply patch tool call. One of `in_progress` or `completed`.
+ operation:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
+ title: Apply patch operation
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A tool call that applies file diffs by creating, deleting, or updating files.
+ title: Apply patch tool call
+ OpenAI.ConversationItemApplyPatchToolCallOutput:
type: object
required:
- - treatmentRunId
- - treatmentRunSummary
- - deltaEstimate
- - pValue
- - treatmentEffect
+ - type
+ - id
+ - call_id
+ - status
properties:
- treatmentRunId:
+ type:
type: string
- description: The treatment run ID.
- treatmentRunSummary:
- $ref: '#/components/schemas/EvalRunResultSummary'
- description: Summary statistics of the treatment run.
- deltaEstimate:
- type: number
- format: float
- description: Estimated difference between treatment and baseline.
- pValue:
- type: number
- format: float
- description: P-value for the treatment effect.
- treatmentEffect:
- $ref: '#/components/schemas/TreatmentEffectType'
- description: Type of treatment effect.
- description: Metric comparison for a treatment against the baseline.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvalRunResultComparison:
+ enum:
+ - apply_patch_call_output
+ description: The type of the item. Always `apply_patch_call_output`.
+ x-stainless-const: true
+ default: apply_patch_call_output
+ id:
+ type: string
+ description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
+ description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call output.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output emitted by an apply patch tool call.
+ title: Apply patch tool call output
+ OpenAI.ConversationItemCodeInterpreterToolCall:
type: object
required:
- - testingCriteria
- - metric
- - evaluator
- - baselineRunSummary
- - compareItems
+ - type
+ - id
+ - status
+ - container_id
+ - code
+ - outputs
properties:
- testingCriteria:
+ type:
type: string
- description: Name of the testing criteria.
- metric:
+ enum:
+ - code_interpreter_call
+ description: The type of the code interpreter tool call. Always `code_interpreter_call`.
+ x-stainless-const: true
+ default: code_interpreter_call
+ id:
type: string
- description: Metric being evaluated.
- evaluator:
+ description: The unique ID of the code interpreter tool call.
+ status:
type: string
- description: Name of the evaluator for this testing criteria.
- baselineRunSummary:
- $ref: '#/components/schemas/EvalRunResultSummary'
- description: Summary statistics of the baseline run.
- compareItems:
- type: array
- items:
- $ref: '#/components/schemas/EvalRunResultCompareItem'
- description: List of comparison results for each treatment run.
- description: Comparison results for treatment runs against the baseline.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvalRunResultSummary:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - interpreting
+ - failed
+ description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
+ container_id:
+ type: string
+ description: The ID of the container used to run the code.
+ code:
+ anyOf:
+ - type: string
+ - type: 'null'
+ outputs:
+ anyOf:
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A tool call to run code.
+ title: Code interpreter tool call
+ OpenAI.ConversationItemCompactionBody:
type: object
required:
- - runId
- - sampleCount
- - average
- - standardDeviation
+ - type
+ - id
+ - encrypted_content
properties:
- runId:
+ type:
type: string
- description: The evaluation run ID.
- sampleCount:
- type: integer
- format: int32
- description: Number of samples in the evaluation run.
- average:
- type: number
- format: float
- description: Average value of the metric in the evaluation run.
- standardDeviation:
- type: number
- format: float
- description: Standard deviation of the metric in the evaluation run.
- description: Summary statistics of a metric in an evaluation run.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationComparisonInsightRequest:
+ enum:
+ - compaction
+ description: The type of the item. Always `compaction`.
+ x-stainless-const: true
+ default: compaction
+ id:
+ type: string
+ description: The unique ID of the compaction item.
+ encrypted_content:
+ type: string
+ description: The encrypted content that was produced by compaction.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
+ title: Compaction item
+ OpenAI.ConversationItemComputerToolCall:
type: object
required:
- type
- - evalId
- - baselineRunId
- - treatmentRunIds
+ - id
+ - call_id
+ - pending_safety_checks
+ - status
properties:
type:
type: string
enum:
- - EvaluationComparison
- description: The type of request.
- evalId:
+ - computer_call
+ description: The type of the computer call. Always `computer_call`.
+ default: computer_call
+ id:
type: string
- description: Identifier for the evaluation.
- baselineRunId:
+ description: The unique ID of the computer call.
+ call_id:
type: string
- description: The baseline run ID for comparison.
- treatmentRunIds:
+ description: An identifier used when responding to the tool call with output.
+ action:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ actions:
+ $ref: '#/components/schemas/OpenAI.ComputerActionList'
+ pending_safety_checks:
type: array
items:
- type: string
- description: List of treatment run IDs for comparison.
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: The pending safety checks for the computer call.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/InsightRequest'
- description: Evaluation Comparison Request
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationComparisonInsightResult:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ A tool call to a computer use tool. See the
+ [computer use guide](/docs/guides/tools-computer-use) for more information.
+ title: Computer tool call
+ OpenAI.ConversationItemComputerToolCallOutput:
type: object
required:
- type
- - comparisons
- - method
+ - id
+ - call_id
+ - output
properties:
type:
type: string
enum:
- - EvaluationComparison
- description: The type of insights result.
- comparisons:
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
+ x-stainless-const: true
+ default: computer_call_output
+ id:
+ type: string
+ description: The ID of the computer tool call output.
+ readOnly: true
+ call_id:
+ type: string
+ description: The ID of the computer tool call that produced the output.
+ acknowledged_safety_checks:
type: array
items:
- $ref: '#/components/schemas/EvalRunResultComparison'
- description: Comparison results for each treatment run against the baseline.
- method:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: |-
+ The safety checks reported by the API that have been acknowledged by the
+ developer.
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ status:
type: string
- description: The statistical method used for comparison.
- allOf:
- - $ref: '#/components/schemas/InsightResult'
- description: Insights from the evaluation comparison.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationLevel:
- anyOf:
- - type: string
enum:
- - turn
- - conversation
- - type: string
- description: The level at which evaluation is performed.
- EvaluationResultSample:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.ConversationItemCustomToolCallOutputResource:
type: object
required:
- type
- - evaluationResult
+ - call_id
+ - output
+ - status
properties:
type:
type: string
enum:
- - EvaluationResultSample
- description: Evaluation Result Sample Type
- evaluationResult:
- $ref: '#/components/schemas/EvalResult'
- description: Evaluation result for the analysis sample.
+ - custom_tool_call_output
+ description: The type of the custom tool call output. Always `custom_tool_call_output`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the custom tool call output in the OpenAI platform.
+ call_id:
+ type: string
+ description: The call ID, used to map this custom tool call output to a custom tool call.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the custom tool call generated by your code.
+ Can be a string or an list of output content.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/InsightSample'
- description: A sample from the evaluation result.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationRule:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ title: ResponseCustomToolCallOutputItem
+ OpenAI.ConversationItemCustomToolCallResource:
type: object
required:
- - id
- - action
- - eventType
- - enabled
- - systemData
+ - type
+ - call_id
+ - name
+ - input
+ - status
properties:
+ type:
+ type: string
+ enum:
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
+ x-stainless-const: true
id:
type: string
- description: Unique identifier for the evaluation rule.
- readOnly: true
- displayName:
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
type: string
- description: Display Name for the evaluation rule.
- description:
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
type: string
- description: Description for the evaluation rule.
- action:
- $ref: '#/components/schemas/EvaluationRuleAction'
- description: Definition of the evaluation rule action.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- filter:
- $ref: '#/components/schemas/EvaluationRuleFilter'
- description: Filter condition of the evaluation rule.
- eventType:
- $ref: '#/components/schemas/EvaluationRuleEventType'
- description: Event type that the evaluation rule applies to.
- enabled:
- type: boolean
- description: Indicates whether the evaluation rule is enabled. Default is true.
- systemData:
- type: object
- unevaluatedProperties:
- type: string
- description: System metadata for the evaluation rule.
- readOnly: true
- description: Evaluation rule model.
- EvaluationRuleAction:
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ title: ResponseCustomToolCallItem
+ OpenAI.ConversationItemFileSearchToolCall:
type: object
required:
+ - id
- type
+ - status
+ - queries
properties:
+ id:
+ type: string
+ description: The unique ID of the file search tool call.
type:
- $ref: '#/components/schemas/EvaluationRuleActionType'
- description: Type of the evaluation action.
- discriminator:
- propertyName: type
- mapping:
- continuousEvaluation: '#/components/schemas/ContinuousEvaluationRuleAction'
- humanEvaluationPreview: '#/components/schemas/HumanEvaluationPreviewRuleAction'
- description: Evaluation action model.
- EvaluationRuleActionType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - continuousEvaluation
- - humanEvaluationPreview
- description: Type of the evaluation action.
- EvaluationRuleEventType:
- anyOf:
- - type: string
- - type: string
+ - file_search_call
+ description: The type of the file search tool call. Always `file_search_call`.
+ x-stainless-const: true
+ status:
+ type: string
enum:
- - responseCompleted
- - manual
- description: Type of the evaluation rule event.
- EvaluationRuleFilter:
+ - in_progress
+ - searching
+ - completed
+ - incomplete
+ - failed
+ description: |-
+ The status of the file search tool call. One of `in_progress`,
+ `searching`, `incomplete` or `failed`,
+ queries:
+ type: array
+ items:
+ type: string
+ description: The queries used to search for files.
+ results:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ The results of a file search tool call. See the
+ [file search guide](/docs/guides/tools-file-search) for more information.
+ title: File search tool call
+ OpenAI.ConversationItemFunctionShellCall:
type: object
required:
- - agentName
+ - type
+ - id
+ - call_id
+ - action
+ - status
+ - environment
properties:
- agentName:
+ type:
type: string
- description: Filter by agent name.
- description: Evaluation filter model.
- EvaluationRunClusterInsightRequest:
+ enum:
+ - shell_call
+ description: The type of the item. Always `shell_call`.
+ x-stainless-const: true
+ default: shell_call
+ id:
+ type: string
+ description: The unique ID of the shell tool call. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.FunctionShellAction'
+ description: The shell commands and limits that describe how to run the tool call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
+ description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
+ environment:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ - type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A tool call that executes one or more shell commands in a managed environment.
+ title: Shell tool call
+ OpenAI.ConversationItemFunctionShellCallOutput:
type: object
required:
- type
- - evalId
- - runIds
+ - id
+ - call_id
+ - status
+ - output
+ - max_output_length
properties:
type:
type: string
enum:
- - EvaluationRunClusterInsight
- description: The type of insights request.
- evalId:
+ - shell_call_output
+ description: The type of the shell call output. Always `shell_call_output`.
+ x-stainless-const: true
+ default: shell_call_output
+ id:
type: string
- description: Evaluation Id for the insights.
- runIds:
+ description: The unique ID of the shell call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the shell tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
+ description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
+ output:
type: array
items:
- type: string
- description: List of evaluation run IDs for the insights.
- modelConfiguration:
- $ref: '#/components/schemas/InsightModelConfiguration'
- description: Configuration of the model used in the insight generation.
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
+ description: An array of shell call output contents
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/InsightRequest'
- description: Insights on set of Evaluation Results
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationRunClusterInsightResult:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output of a shell tool call that was emitted.
+ title: Shell call output
+ OpenAI.ConversationItemFunctionToolCall:
type: object
required:
+ - id
- type
- - clusterInsight
+ - call_id
+ - name
+ - arguments
properties:
+ id:
+ type: string
+ description: The unique ID of the function tool call.
+ readOnly: true
type:
type: string
enum:
- - EvaluationRunClusterInsight
- description: The type of insights result.
- clusterInsight:
- $ref: '#/components/schemas/ClusterInsightResult'
+ - function_call
+ description: The type of the function tool call. Always `function_call`.
+ x-stainless-const: true
+ call_id:
+ type: string
+ description: The unique ID of the function tool call generated by the model.
+ namespace:
+ type: string
+ description: The namespace of the function to run.
+ name:
+ type: string
+ description: The name of the function to run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the function.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/InsightResult'
- description: Insights from the evaluation run cluster analysis.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationScheduleTask:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ A tool call to run a function. See the
+ [function calling guide](/docs/guides/function-calling) for more information.
+ title: Function tool call
+ OpenAI.ConversationItemFunctionToolCallOutput:
type: object
required:
+ - id
- type
- - evalId
- - evalRun
+ - call_id
+ - output
properties:
+ id:
+ type: string
+ description: |-
+ The unique ID of the function tool call output. Populated when this item
+ is returned via API.
+ readOnly: true
type:
type: string
enum:
- - Evaluation
- evalId:
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
+ x-stainless-const: true
+ call_id:
type: string
- description: Identifier of the evaluation group.
- evalRun:
- type: object
- unevaluatedProperties: {}
- description: The evaluation run payload.
+ description: The unique ID of the function tool call generated by the model.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the function call generated by your code.
+ Can be a string or an list of output content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/ScheduleTask'
- description: Evaluation task for the schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- EvaluationTaxonomy:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.ConversationItemImageGenToolCall:
type: object
required:
- - name
- - version
- - taxonomyInput
+ - type
+ - id
+ - status
+ - result
properties:
- id:
+ type:
type: string
- description: Asset ID, a unique identifier for the asset
- readOnly: true
- name:
+ enum:
+ - image_generation_call
+ description: The type of the image generation call. Always `image_generation_call`.
+ x-stainless-const: true
+ id:
type: string
- description: The name of the resource
- readOnly: true
- version:
+ description: The unique ID of the image generation call.
+ status:
type: string
- description: The version of the resource
- readOnly: true
- taxonomyInput:
- $ref: '#/components/schemas/EvaluationTaxonomyInput'
- description: Input configuration for the evaluation taxonomy.
- taxonomyCategories:
- type: array
- items:
- $ref: '#/components/schemas/TaxonomyCategory'
- description: List of taxonomy categories.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: Additional properties for the evaluation taxonomy.
- description: Evaluation Taxonomy Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyCreateOrUpdate:
+ enum:
+ - in_progress
+ - completed
+ - generating
+ - failed
+ description: The status of the image generation call.
+ result:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: An image generation request made by the model.
+ title: Image generation call
+ OpenAI.ConversationItemList:
type: object
required:
- - taxonomyInput
+ - object
+ - data
+ - has_more
+ - first_id
+ - last_id
properties:
- description:
+ object:
type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- taxonomyInput:
- $ref: '#/components/schemas/EvaluationTaxonomyInput'
- description: Input configuration for the evaluation taxonomy.
- taxonomyCategories:
+ enum:
+ - list
+ description: The type of object returned, must be `list`.
+ x-stainless-const: true
+ data:
type: array
items:
- $ref: '#/components/schemas/TaxonomyCategory'
- description: List of taxonomy categories.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: Additional properties for the evaluation taxonomy.
- description: Evaluation Taxonomy Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyInput:
+ $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A list of conversation items.
+ x-ms-list-page-items: true
+ has_more:
+ type: boolean
+ description: Whether there are more items available.
+ first_id:
+ type: string
+ description: The ID of the first item in the list.
+ last_id:
+ type: string
+ description: The ID of the last item in the list.
+ x-ms-list-continuation-token: true
+ description: A list of Conversation items.
+ title: The conversation item list
+ x-oaiMeta:
+ name: The item list
+ group: conversations
+ OpenAI.ConversationItemLocalShellToolCall:
type: object
required:
- type
+ - id
+ - call_id
+ - action
+ - status
properties:
type:
- $ref: '#/components/schemas/EvaluationTaxonomyInputType'
- description: Input type of the evaluation taxonomy.
- discriminator:
- propertyName: type
- mapping:
- agent: '#/components/schemas/AgentTaxonomyInput'
- description: Input configuration for the evaluation taxonomy.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyInputType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - agent
- - policy
- description: Type of the evaluation taxonomy input.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyInputUpdate:
+ - local_shell_call
+ description: The type of the local shell call. Always `local_shell_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the local shell call.
+ call_id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: The status of the local shell call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A tool call to run a command on the local shell.
+ title: Local shell call
+ OpenAI.ConversationItemLocalShellToolCallOutput:
type: object
required:
- type
+ - id
+ - output
properties:
type:
- $ref: '#/components/schemas/EvaluationTaxonomyInputType'
- description: Input type of the evaluation taxonomy.
- discriminator:
- propertyName: type
- mapping:
- agent: '#/components/schemas/AgentTaxonomyInputUpdate'
- description: Input configuration for the evaluation taxonomy.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyUpdate:
- type: object
- properties:
- description:
type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- taxonomyInput:
- $ref: '#/components/schemas/EvaluationTaxonomyInputUpdate'
- description: Input configuration for the evaluation taxonomy.
- taxonomyCategories:
- type: array
- items:
- $ref: '#/components/schemas/TaxonomyCategory'
- description: List of taxonomy categories.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: Additional properties for the evaluation taxonomy.
- description: Evaluation Taxonomy Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorCategory:
- anyOf:
- - type: string
- - type: string
enum:
- - quality
- - safety
- - agents
- description: The category of the evaluator
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorCredentialRequest:
+ - local_shell_call_output
+ description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ output:
+ type: string
+ description: A JSON string of the output of the local shell tool call.
+ status:
+ anyOf:
+ - type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output of a local shell tool call.
+ title: Local shell call output
+ OpenAI.ConversationItemMcpApprovalRequest:
type: object
required:
- - blob_uri
+ - type
+ - id
+ - server_label
+ - name
+ - arguments
properties:
- blob_uri:
+ type:
+ type: string
+ enum:
+ - mcp_approval_request
+ description: The type of the item. Always `mcp_approval_request`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the approval request.
+ server_label:
type: string
- format: uri
- description: 'The blob URI for the evaluator storage. Example: `https://account.blob.core.windows.net:443/container`'
- description: Request body for getting evaluator credentials
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorDefinition:
+ description: The label of the MCP server making the request.
+ name:
+ type: string
+ description: The name of the tool to run.
+ arguments:
+ type: string
+ description: A JSON string of arguments for the tool.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A request for human approval of a tool invocation.
+ title: MCP approval request
+ OpenAI.ConversationItemMcpApprovalResponseResource:
type: object
required:
- type
+ - id
+ - approval_request_id
+ - approve
properties:
type:
- $ref: '#/components/schemas/EvaluatorDefinitionType'
- description: The type of evaluator definition
- init_parameters:
- type: object
- unevaluatedProperties: {}
- description: The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters like type, properties, required.
- data_schema:
- type: object
- unevaluatedProperties: {}
- description: The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like type, properties, required.
- metrics:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/EvaluatorMetric'
- description: List of output metrics produced by this evaluator
- discriminator:
- propertyName: type
- mapping:
- code: '#/components/schemas/CodeBasedEvaluatorDefinition'
- prompt: '#/components/schemas/PromptBasedEvaluatorDefinition'
- rubric: '#/components/schemas/RubricBasedEvaluatorDefinition'
- endpoint: '#/components/schemas/EndpointBasedEvaluatorDefinition'
- description: Base evaluator configuration with discriminator
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorDefinitionType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - prompt
- - code
- - prompt_and_code
- - service
- - openai_graders
- - rubric
- - endpoint
- description: The type of evaluator definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationArtifacts:
+ - mcp_approval_response
+ description: The type of the item. Always `mcp_approval_response`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the approval response
+ approval_request_id:
+ type: string
+ description: The ID of the approval request being answered.
+ approve:
+ type: boolean
+ description: Whether the request was approved.
+ reason:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A response to an MCP approval request.
+ title: MCP approval response
+ OpenAI.ConversationItemMcpListTools:
type: object
required:
- - dataset
- - kinds
+ - type
+ - id
+ - server_label
+ - tools
properties:
- dataset:
- $ref: '#/components/schemas/DatasetReference'
- description: Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to `EvaluatorVersion.version`) holding all artifacts produced by the generation pipeline. Each row in the JSONL carries a `kind` field discriminating its content (e.g. `spec`, `tools`, `context`).
- kinds:
+ type:
+ type: string
+ enum:
+ - mcp_list_tools
+ description: The type of the item. Always `mcp_list_tools`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the list.
+ server_label:
+ type: string
+ description: The label of the MCP server.
+ tools:
type: array
items:
- type: string
- description: The kinds of rows present in `dataset`. Always contains `"spec"` (the generated evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain `"tools"` (when the generation pipeline produced or inferred OpenAI tool schemas) and/or `"context"` (when supplementary materials such as file uploads or trace samples were used during generation).
- description: Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationInputs:
+ $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
+ description: The tools available on the server.
+ error:
+ $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A list of tools available on an MCP server.
+ title: MCP list tools
+ OpenAI.ConversationItemMcpToolCall:
type: object
required:
- - sources
- - model
- - evaluator_name
+ - type
+ - id
+ - server_label
+ - name
+ - arguments
properties:
- sources:
- type: array
- items:
- $ref: '#/components/schemas/EvaluatorGenerationJobSource'
- description: Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry is an `EvaluatorGenerationJobSource` variant discriminated by `type`.
- model:
+ type:
type: string
- description: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide their own model rather than relying on service-owned capacity.
- evaluator_name:
+ enum:
+ - mcp_call
+ description: The type of the item. Always `mcp_call`.
+ x-stainless-const: true
+ id:
type: string
- minLength: 1
- maxLength: 256
- pattern: ^[A-Za-z0-9_.~-]+$
- description: The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII letters, digits, underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` is reserved for system-managed evaluators and is rejected by the service. If an evaluator with this name already exists in the project (and is rubric-subtype), the service creates a new version under the same name and uses the prior version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive loop). Old versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`.
- evaluator_display_name:
+ description: The unique ID of the tool call.
+ server_label:
type: string
- description: Optional human-friendly display name for the resulting evaluator. Surfaced as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier.
- evaluator_description:
+ description: The label of the MCP server running the tool.
+ name:
type: string
- description: Optional human-friendly description for the resulting evaluator. Surfaced as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related models.
- description: Caller-supplied inputs for an evaluator generation job.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationJob:
+ description: The name of the tool that was run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments passed to the tool.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ error:
+ type: object
+ unevaluatedProperties: {}
+ status:
+ $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
+ description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
+ approval_request_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: An invocation of a tool on an MCP server.
+ title: MCP tool call
+ OpenAI.ConversationItemMessage:
type: object
required:
+ - type
- id
- status
- - created_at
+ - role
+ - content
properties:
+ type:
+ type: string
+ enum:
+ - message
+ description: The type of the message. Always set to `message`.
+ x-stainless-const: true
+ default: message
id:
type: string
- description: Server-assigned unique identifier.
- readOnly: true
- inputs:
- $ref: '#/components/schemas/EvaluatorGenerationInputs'
- description: Caller-supplied inputs.
- result:
- $ref: '#/components/schemas/EvaluatorVersion'
- description: Result produced on success.
- readOnly: true
+ description: The unique ID of the message.
status:
- $ref: '#/components/schemas/JobStatus'
- description: Current lifecycle status.
- readOnly: true
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error details — populated only on failure.
- readOnly: true
- created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).
- readOnly: true
- finished_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).
- readOnly: true
- usage:
- $ref: '#/components/schemas/EvaluatorGenerationTokenUsage'
- description: Token consumption summary. Populated when the job reaches a terminal state.
- readOnly: true
- description: Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationJobCreate:
- type: object
- properties:
- inputs:
- $ref: '#/components/schemas/EvaluatorGenerationInputs'
- description: Caller-supplied inputs.
- description: Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationJobSource:
+ $ref: '#/components/schemas/OpenAI.MessageStatus'
+ description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: The content of the message
+ phase:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A message to or from the model.
+ title: Message
+ OpenAI.ConversationItemReasoningItem:
type: object
required:
- type
+ - id
+ - summary
properties:
type:
- $ref: '#/components/schemas/EvaluatorGenerationJobSourceType'
- description: The type of source.
- discriminator:
- propertyName: type
- mapping:
- prompt: '#/components/schemas/PromptEvaluatorGenerationJobSource'
- agent: '#/components/schemas/AgentEvaluatorGenerationJobSource'
- traces: '#/components/schemas/TracesEvaluatorGenerationJobSource'
- dataset: '#/components/schemas/DatasetEvaluatorGenerationJobSource'
- description: The base source model for evaluator generation jobs. Polymorphic over `type`.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationJobSourceType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - prompt
- - agent
- - traces
- - dataset
- description: The supported source types for evaluator generation jobs.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationTokenUsage:
+ - reasoning
+ description: The type of the object. Always `reasoning`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique identifier of the reasoning content.
+ encrypted_content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ summary:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: Reasoning summary content.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
+ description: Reasoning text content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ A description of the chain of thought used by a reasoning model while generating
+ a response. Be sure to include these items in your `input` to the Responses API
+ for subsequent turns of a conversation if you are manually
+ [managing context](/docs/guides/conversation-state).
+ title: Reasoning
+ OpenAI.ConversationItemToolSearchCall:
type: object
required:
- - input_tokens
- - output_tokens
- - total_tokens
+ - type
+ - id
+ - call_id
+ - execution
+ - arguments
+ - status
properties:
- input_tokens:
- type: integer
- format: int64
- description: Number of input (prompt) tokens consumed.
- output_tokens:
- type: integer
- format: int64
- description: Number of output (completion) tokens generated.
- total_tokens:
- type: integer
- format: int64
- description: Total tokens consumed (input + output).
- description: Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorMetric:
+ type:
+ type: string
+ enum:
+ - tool_search_call
+ description: The type of the item. Always `tool_search_call`.
+ x-stainless-const: true
+ default: tool_search_call
+ id:
+ type: string
+ description: The unique ID of the tool search call item.
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ arguments:
+ description: Arguments used for the tool search call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: The status of the tool search call item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ OpenAI.ConversationItemToolSearchOutput:
type: object
+ required:
+ - type
+ - id
+ - call_id
+ - execution
+ - tools
+ - status
properties:
type:
- $ref: '#/components/schemas/EvaluatorMetricType'
- description: Type of the metric.
- desirable_direction:
- $ref: '#/components/schemas/EvaluatorMetricDirection'
- description: It indicates whether a higher value is better or a lower value is better for this metric.
- min_value:
- type: number
- format: float
- description: Minimum value for the metric
- max_value:
- type: number
- format: float
- description: Maximum value for the metric. If not specified, it is assumed to be unbounded.
- threshold:
- type: number
- format: float
- description: Default pass/fail threshold for this metric.
- is_primary:
- type: boolean
- description: Indicates if this metric is primary when there are multiple metrics.
- description: Evaluator Metric
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorMetricDirection:
- anyOf:
- - type: string
- - type: string
- enum:
- - increase
- - decrease
- - neutral
- description: The direction of the metric indicating whether a higher value is better, a lower value is better, or neutral
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorMetricType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - ordinal
- - continuous
- - boolean
- description: The type of the evaluator
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorType:
+ - tool_search_output
+ description: The type of the item. Always `tool_search_output`.
+ x-stainless-const: true
+ default: tool_search_output
+ id:
+ type: string
+ description: The unique ID of the tool search output item.
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The loaded tool definitions returned by tool search.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: The status of the tool search output item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ OpenAI.ConversationItemType:
anyOf:
- type: string
- type: string
enum:
- - builtin
- - custom
- description: The type of the evaluator
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorVersion:
+ - message
+ - function_call
+ - function_call_output
+ - file_search_call
+ - web_search_call
+ - image_generation_call
+ - computer_call
+ - computer_call_output
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - reasoning
+ - compaction
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - mcp_call
+ - custom_tool_call
+ - custom_tool_call_output
+ OpenAI.ConversationItemWebSearchToolCall:
type: object
required:
- - evaluator_type
- - categories
- - definition
- - created_by
- - created_at
- - modified_at
- - name
- - version
+ - id
+ - type
+ - status
+ - action
properties:
- display_name:
- type: string
- description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Metadata about the evaluator
- evaluator_type:
- $ref: '#/components/schemas/EvaluatorType'
- description: The type of the evaluator
- categories:
- type: array
- items:
- $ref: '#/components/schemas/EvaluatorCategory'
- description: The categories of the evaluator
- supported_evaluation_levels:
- type: array
- items:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
- default:
- - turn
- definition:
- $ref: '#/components/schemas/EvaluatorDefinition'
- description: Definition of the evaluator
- generation_artifacts:
- $ref: '#/components/schemas/EvaluatorGenerationArtifacts'
- description: Provenance artifacts from the generation pipeline. Read-only; present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry Dataset.
- readOnly: true
- created_by:
+ id:
type: string
- description: Creator of the evaluator
- readOnly: true
- created_at:
+ description: The unique ID of the web search tool call.
+ type:
type: string
- description: Creation date/time of the evaluator
- readOnly: true
- modified_at:
+ enum:
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
+ x-stainless-const: true
+ status:
type: string
- description: Last modified date/time of the evaluator
- readOnly: true
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - failed
+ - incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ description: |-
+ 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_in_page).
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.ConversationParam:
+ oneOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.ConversationParam-2'
+ description: |-
+ The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.
+ Input items and output items from this response are automatically added to this conversation after this response completes.
+ OpenAI.ConversationParam-2:
+ type: object
+ required:
+ - id
+ properties:
id:
type: string
- description: Asset ID, a unique identifier for the asset
- readOnly: true
- name:
- type: string
- description: The name of the resource
- readOnly: true
- version:
+ description: The unique ID of the conversation.
+ description: The conversation that this response belongs to.
+ title: Conversation object
+ OpenAI.ConversationReference:
+ type: object
+ required:
+ - id
+ properties:
+ id:
type: string
- description: The version of the resource
- readOnly: true
- description: Evaluator Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorVersionCreate:
+ description: The unique ID of the conversation that this response was associated with.
+ description: The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
+ title: Conversation
+ OpenAI.ConversationResource:
type: object
required:
- - evaluator_type
- - categories
- - definition
+ - id
+ - object
+ - metadata
+ - created_at
properties:
- display_name:
+ id:
type: string
- description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
+ description: The unique ID of the conversation.
+ object:
+ type: string
+ enum:
+ - conversation
+ description: The object type, which is always `conversation`.
+ x-stainless-const: true
+ default: conversation
metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Metadata about the evaluator
- evaluator_type:
- $ref: '#/components/schemas/EvaluatorType'
- description: The type of the evaluator
- categories:
+ $ref: '#/components/schemas/OpenAI.Metadata'
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The time at which the conversation was created, measured in seconds since the Unix epoch.
+ OpenAI.CoordParam:
+ type: object
+ required:
+ - x
+ - 'y'
+ properties:
+ x:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The x-coordinate.
+ 'y':
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The y-coordinate.
+ description: 'An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.'
+ title: Coordinate
+ OpenAI.CreateAssistantRequest:
+ type: object
+ required:
+ - model
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.AssistantSupportedModels'
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ x-oaiTypeLabel: string
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ tools:
type: array
items:
- $ref: '#/components/schemas/EvaluatorCategory'
- description: The categories of the evaluator
- supported_evaluation_levels:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ maxItems: 128
+ description: 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`.
+ default: []
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ response_format:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ - type: 'null'
+ OpenAI.CreateAssistantRequestToolResources:
+ type: object
+ properties:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearch'
+ OpenAI.CreateAssistantRequestToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
type: array
items:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
- default:
- - turn
- definition:
- $ref: '#/components/schemas/EvaluatorDefinition'
- description: Definition of the evaluator
- description:
- type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- description: Evaluator Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorVersionUpdate:
+ maxItems: 20
+ OpenAI.CreateAssistantRequestToolResourcesFileSearch:
type: object
properties:
- display_name:
- type: string
- description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
- metadata:
- type: object
- unevaluatedProperties:
+ vector_store_ids:
+ type: array
+ items:
type: string
- description: Metadata about the evaluator
- categories:
+ maxItems: 1
+ vector_stores:
type: array
items:
- $ref: '#/components/schemas/EvaluatorCategory'
- description: The categories of the evaluator
- supported_evaluation_levels:
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStores'
+ maxItems: 1
+ OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStores:
+ type: object
+ properties:
+ file_ids:
type: array
items:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
- default:
- - turn
- description:
- type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- description: Evaluator Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- ExternalAgentDefinition:
+ maxItems: 100000000
+ chunking_strategy:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto'
+ - $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto:
type: object
required:
- - kind
+ - type
properties:
- kind:
+ type:
type: string
enum:
- - external
- otel_agent_id:
- type: string
- description: |-
- The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry agent.
- Spans must include the attribute `gen_ai.agent.id = ` to appear under this registration.
- Defaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios
- where the running external agent already emits a stable id that differs from the Foundry agent name.
- The resolved value is always echoed on read.
- allOf:
- - $ref: '#/components/schemas/AgentDefinition'
- description: |-
- The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS).
- Registration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations)
- over customer-emitted OpenTelemetry data.
- x-ms-foundry-meta:
- required_previews:
- - ExternalAgents=V1Preview
- FabricDataAgentToolCall:
+ - auto
+ x-stainless-const: true
+ OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic:
type: object
required:
- type
- - call_id
- - arguments
- - status
+ - static
properties:
type:
type: string
enum:
- - fabric_dataagent_preview_call
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
- type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A Fabric data agent tool call.
- FabricDataAgentToolCallOutput:
+ - static
+ x-stainless-const: true
+ static:
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic'
+ OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic:
type: object
required:
- - type
- - call_id
- - status
+ - max_chunk_size_tokens
+ - chunk_overlap_tokens
properties:
- type:
+ max_chunk_size_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 100
+ maximum: 4096
+ chunk_overlap_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CreateBatchParametersBody:
+ type: object
+ required:
+ - input_file_id
+ - endpoint
+ - completion_window
+ properties:
+ input_file_id:
+ type: string
+ endpoint:
type: string
enum:
- - fabric_dataagent_preview_call_output
- call_id:
+ - /v1/responses
+ - /v1/chat/completions
+ - /v1/embeddings
+ - /v1/completions
+ - /v1/moderations
+ - /v1/images/generations
+ - /v1/images/edits
+ - /v1/videos
+ completion_window:
type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Fabric data agent tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a Fabric data agent tool call.
- FabricDataAgentToolParameters:
+ enum:
+ - 24h
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ output_expires_after:
+ $ref: '#/components/schemas/OpenAI.BatchFileExpirationAfter'
+ OpenAI.CreateChatCompletionRequest:
type: object
+ required:
+ - messages
+ - model
properties:
- project_connections:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ top_logprobs:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ user:
+ type: string
+ description: |-
+ 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](/docs/guides/safety-best-practices#safety-identifiers).
+ deprecated: true
+ safety_identifier:
+ type: string
+ maxLength: 64
+ description: |-
+ 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
+ prompt_cache_key:
+ type: string
+ description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
+ service_tier:
+ $ref: '#/components/schemas/OpenAI.ServiceTier'
+ prompt_cache_retention:
+ anyOf:
+ - type: string
+ enum:
+ - in_memory
+ - 24h
+ - type: 'null'
+ messages:
type: array
items:
- $ref: '#/components/schemas/ToolProjectConnection'
- maxItems: 1
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ minItems: 1
description: |-
- The project connections attached to this tool. There can be a maximum of 1 connection
- resource attached to the tool.
- description: The fabric data agent tool parameters.
- FabricIQPreviewTool:
+ A list of messages comprising the conversation so far. Depending on the
+ [model](/docs/models) you use, different message types (modalities) are
+ supported, like [text](/docs/guides/text-generation),
+ [images](/docs/guides/vision), and [audio](/docs/guides/audio).
+ model:
+ type: string
+ description: The model deployment to use for this chat completion.
+ modalities:
+ $ref: '#/components/schemas/OpenAI.ResponseModalities'
+ verbosity:
+ $ref: '#/components/schemas/OpenAI.Verbosity'
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ max_completion_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).
+ frequency_penalty:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: -2
+ maximum: 2
+ description: |-
+ 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.
+ presence_penalty:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: -2
+ maximum: 2
+ description: |-
+ 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.
+ web_search_options:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestWebSearchOptions'
+ description: |-
+ This tool searches the web for relevant results to use in a response.
+ Learn more about the [web search tool](/docs/guides/tools-web-search?api-mode=chat).
+ title: Web search
+ response_format:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
+ description: |-
+ 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](/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.
+ audio:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestAudio'
+ - type: 'null'
+ description: |-
+ Parameters for audio output. Required when audio output is requested with
+ `modalities: ["audio"]`. [Learn more](/docs/guides/audio).
+ store:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: |-
+ Whether or not to store the output of this chat completion request for
+ use in our [model distillation](/docs/guides/distillation) or
+ [evals](/docs/guides/evals) products.
+ Supports text and image inputs. Note: image inputs over 8MB will be dropped.
+ moderation:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ModerationParam'
+ - type: 'null'
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: |-
+ 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](/docs/api-reference/chat/streaming)
+ for more information, along with the [streaming responses](/docs/guides/streaming-responses)
+ guide for more information on how to handle the streaming events.
+ stop:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.StopConfiguration'
+ - type: 'null'
+ logit_bias:
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: |-
+ 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.
+ x-oaiTypeLabel: map
+ logprobs:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: |-
+ 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`.
+ max_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: |-
+ 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](/docs/guides/reasoning).
+ deprecated: true
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 1
+ maximum: 128
+ description: 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.
+ default: 1
+ prediction:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.PredictionContent'
+ - type: 'null'
+ description: |-
+ Configuration for a [Predicted Output](/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.
+ seed:
+ anyOf:
+ - type: integer
+ format: int64
+ - type: 'null'
+ description: |-
+ 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: true
+ x-oaiMeta:
+ beta: true
+ stream_options:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamOptions'
+ - type: 'null'
+ tools:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionTool'
+ - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletions'
+ description: |-
+ A list of tools the model may call. You can provide either
+ [custom tools](/docs/guides/function-calling#custom-tools) or
+ [function tools](/docs/guides/function-calling).
+ tool_choice:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionToolChoiceOption'
+ parallel_tool_calls:
+ type: boolean
+ description: Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
+ default: true
+ function_call:
+ oneOf:
+ - type: string
+ enum:
+ - none
+ - auto
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionFunctionCallOption'
+ description: |-
+ 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: true
+ functions:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionFunctions'
+ minItems: 1
+ maxItems: 128
+ description: |-
+ Deprecated in favor of `tools`.
+ A list of functions the model may generate JSON inputs for.
+ deprecated: true
+ user_security_context:
+ $ref: '#/components/schemas/AzureUserSecurityContext'
+ description: User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.
+ OpenAI.CreateChatCompletionRequestAudio:
+ type: object
+ required:
+ - voice
+ - format
+ properties:
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsOrCustomVoice'
+ format:
+ type: string
+ enum:
+ - wav
+ - aac
+ - mp3
+ - flac
+ - opus
+ - pcm16
+ OpenAI.CreateChatCompletionRequestResponseFormat:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType'
+ discriminator:
+ propertyName: type
+ mapping:
+ text: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText'
+ json_object: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject'
+ json_schema: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
+ description: |-
+ 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](/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.
+ OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject:
type: object
required:
- type
- - project_connection_id
properties:
type:
type: string
enum:
- - fabric_iq_preview
- description: The object type, which is always 'fabric_iq_preview'.
- project_connection_id:
- type: string
- description: The ID of the FabricIQ project connection.
- server_label:
- type: string
- description: (Optional) The label of the FabricIQ MCP server to connect to.
- server_url:
- type: string
- format: uri
- description: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used.
- require_approval:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
- - type: string
- - type: 'null'
- description: (Optional) Whether the agent requires approval before executing actions. Default is always.
- default: always
+ - json_object
+ description: The type of response format being defined. Always `json_object`.
+ x-stainless-const: true
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A FabricIQ server-side tool.
- FabricIQPreviewToolboxTool:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
+ description: |-
+ JSON object response format. An older method of generating JSON responses.
+ Using `json_schema` is recommended for models that support it. Note that the
+ model will not generate JSON without a system or user message instructing it
+ to do so.
+ title: JSON object
+ OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText:
type: object
required:
- type
- - project_connection_id
properties:
type:
type: string
enum:
- - fabric_iq_preview
- project_connection_id:
- type: string
- description: The ID of the FabricIQ project connection.
- server_label:
- type: string
- description: (Optional) The label of the FabricIQ MCP server to connect to.
- server_url:
- type: string
- format: uri
- description: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used.
- require_approval:
+ - text
+ description: The type of response format being defined. Always `text`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
+ description: Default response format. Used to generate text responses.
+ title: Text
+ OpenAI.CreateChatCompletionRequestResponseFormatType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - text
+ - json_schema
+ - json_object
+ OpenAI.CreateChatCompletionRequestWebSearchOptions:
+ type: object
+ properties:
+ user_location:
anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
- - type: string
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestWebSearchOptionsUserLocation'
- type: 'null'
- description: (Optional) Whether the agent requires approval before executing actions. Default is always.
- default: always
- allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: A FabricIQ tool stored in a toolbox.
- FileDataGenerationJobOutput:
+ search_context_size:
+ $ref: '#/components/schemas/OpenAI.WebSearchContextSize'
+ OpenAI.CreateChatCompletionRequestWebSearchOptionsUserLocation:
type: object
required:
- type
- - id
- - filename
+ - approximate
properties:
type:
type: string
enum:
- - file
- description: Azure OpenAI file output.
+ - approximate
+ x-stainless-const: true
+ approximate:
+ $ref: '#/components/schemas/OpenAI.WebSearchLocation'
+ OpenAI.CreateChatCompletionResponse:
+ type: object
+ required:
+ - id
+ - choices
+ - created
+ - model
+ - object
+ properties:
id:
type: string
- description: The id of the output Azure OpenAI file.
- readOnly: true
- filename:
+ description: A unique identifier for the chat completion.
+ choices:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponseChoices'
+ description: A list of chat completion choices. Can be more than one if `n` is greater than 1.
+ created:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) of when the chat completion was created.
+ model:
type: string
- description: The filename of the output Azure OpenAI file.
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/DataGenerationJobOutput'
- description: Azure OpenAI file output for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- FileDataGenerationJobSource:
+ description: The model deployment used for the creation of this chat completion.
+ service_tier:
+ $ref: '#/components/schemas/OpenAI.ServiceTier'
+ system_fingerprint:
+ type: string
+ description: |-
+ 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: true
+ object:
+ type: string
+ enum:
+ - chat.completion
+ description: The object type, which is always `chat.completion`.
+ x-stainless-const: true
+ usage:
+ $ref: '#/components/schemas/OpenAI.CompletionUsage'
+ moderation:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionModeration'
+ - type: 'null'
+ description: Represents a chat completion response returned by model, based on the provided input.
+ x-oaiMeta:
+ name: The chat completion object
+ group: chat
+ example: |
+ {
+ "id": "chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG",
+ "object": "chat.completion",
+ "created": 1741570283,
+ "model": "gpt-4o-2024-08-06",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.",
+ "refusal": null,
+ "annotations": []
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 1117,
+ "completion_tokens": 46,
+ "total_tokens": 1163,
+ "prompt_tokens_details": {
+ "cached_tokens": 0,
+ "audio_tokens": 0
+ },
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "audio_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "service_tier": "default",
+ "system_fingerprint": "fp_fc9f1d7035"
+ }
+ OpenAI.CreateChatCompletionResponseChoices:
type: object
required:
- - type
- - id
+ - finish_reason
+ - index
+ - message
+ - logprobs
properties:
- type:
+ finish_reason:
type: string
enum:
- - file
- description: The source type for this job, which is File.
- id:
- type: string
- description: Input Azure Open AI file id used for data generation.
- allOf:
- - $ref: '#/components/schemas/DataGenerationJobSource'
- description: File source for data generation jobs — Azure OpenAI file input.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- FileDatasetVersion:
+ - stop
+ - length
+ - tool_calls
+ - content_filter
+ - function_call
+ index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ message:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessage'
+ logprobs:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponseChoicesLogprobs'
+ - type: 'null'
+ OpenAI.CreateChatCompletionResponseChoicesLogprobs:
type: object
required:
- - type
+ - content
+ - refusal
properties:
- type:
+ content:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob'
+ - type: 'null'
+ refusal:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob'
+ - type: 'null'
+ OpenAI.CreateCompletionRequest:
+ type: object
+ required:
+ - model
+ - prompt
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - gpt-3.5-turbo-instruct
+ - davinci-002
+ - babbage-002
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ x-oaiTypeLabel: string
+ prompt:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: array
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: |-
+ 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.
+ default: <|endoftext|>
+ best_of:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ maximum: 20
+ description: |-
+ 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`.
+ default: 1
+ echo:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: Echo back the prompt in addition to the completion
+ frequency_penalty:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: -2
+ maximum: 2
+ description: |-
+ 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.](/docs/guides/text-generation)
+ logit_bias:
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: |-
+ 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.
+ x-oaiTypeLabel: map
+ logprobs:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ maximum: 5
+ description: |-
+ 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.
+ max_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ description: |-
+ 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.
+ default: 16
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 1
+ maximum: 128
+ description: |-
+ 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`.
+ default: 1
+ presence_penalty:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: -2
+ maximum: 2
+ description: |-
+ 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.](/docs/guides/text-generation)
+ seed:
+ anyOf:
+ - type: integer
+ format: int64
+ - type: 'null'
+ description: |-
+ 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.
+ stop:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.StopConfiguration'
+ - type: 'null'
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: '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_options:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamOptions'
+ - type: 'null'
+ suffix:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: |-
+ The suffix that comes after a completion of inserted text.
+ This parameter is only supported for `gpt-3.5-turbo-instruct`.
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 2
+ description: |-
+ 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.
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 1
+ description: |-
+ 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.
+ default: 1
+ user:
type: string
- enum:
- - uri_file
- description: Dataset type
- allOf:
- - $ref: '#/components/schemas/DatasetVersion'
- description: FileDatasetVersion Definition
- FileDatasetVersionUpdate:
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ OpenAI.CreateCompletionResponse:
type: object
required:
- - type
+ - id
+ - choices
+ - created
+ - model
+ - object
properties:
- type:
+ id:
+ type: string
+ description: A unique identifier for the completion.
+ choices:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateCompletionResponseChoices'
+ description: The list of completion choices the model generated for the input prompt.
+ created:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) of when the completion was created.
+ model:
+ type: string
+ description: The model used for completion.
+ system_fingerprint:
+ type: string
+ description: |-
+ 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.
+ object:
type: string
enum:
- - uri_file
- description: Dataset type
- allOf:
- - $ref: '#/components/schemas/DatasetVersionUpdate'
- description: FileDatasetVersion Definition
- FileSearchToolboxTool:
+ - text_completion
+ description: The object type, which is always "text_completion"
+ x-stainless-const: true
+ usage:
+ $ref: '#/components/schemas/OpenAI.CompletionUsage'
+ description: 'Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).'
+ x-oaiMeta:
+ name: The completion object
+ legacy: true
+ example: |
+ {
+ "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
+ "object": "text_completion",
+ "created": 1589478378,
+ "model": "gpt-4-turbo",
+ "choices": [
+ {
+ "text": "
+
+ This is indeed a test",
+ "index": 0,
+ "logprobs": null,
+ "finish_reason": "length"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 5,
+ "completion_tokens": 7,
+ "total_tokens": 12
+ }
+ }
+ OpenAI.CreateCompletionResponseChoices:
type: object
required:
- - type
+ - finish_reason
+ - index
+ - logprobs
+ - text
properties:
- type:
+ finish_reason:
type: string
enum:
- - file_search
- max_num_results:
+ - stop
+ - length
+ - content_filter
+ index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
- ranking_options:
- $ref: '#/components/schemas/OpenAI.RankingOptions'
- description: Ranking options for search.
- filters:
+ logprobs:
anyOf:
- - $ref: '#/components/schemas/OpenAI.Filters'
+ - $ref: '#/components/schemas/OpenAI.CreateCompletionResponseChoicesLogprobs'
- type: 'null'
- vector_store_ids:
+ text:
+ type: string
+ OpenAI.CreateCompletionResponseChoicesLogprobs:
+ type: object
+ properties:
+ text_offset:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ token_logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ tokens:
type: array
items:
type: string
- description: The IDs of the vector stores to search.
- allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: A file search tool stored in a toolbox.
- FilterStrategyType:
- anyOf:
- - type: string
- - type: string
- enum:
- - random_sampling
- - smart_filtering
- description: Specifies the type of filter strategy used to select traces for evaluation.
- FixedRatioVersionSelectionRule:
+ top_logprobs:
+ type: array
+ items:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.CreateContainerBody:
type: object
required:
- - type
- - traffic_percentage
+ - name
properties:
- type:
+ name:
+ type: string
+ description: Name of the container to create.
+ file_ids:
+ type: array
+ items:
+ type: string
+ description: IDs of files to copy to the container.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.CreateContainerBodyExpiresAfter'
+ description: Container expiration time in seconds relative to the 'anchor' time.
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ContainerSkill'
+ description: An optional list of skills referenced by id or inline data.
+ memory_limit:
type: string
enum:
- - FixedRatio
- traffic_percentage:
- type: integer
- format: int32
- minimum: 0
- maximum: 100
- description: The percentage of traffic to route to the version. Must be between 0 and 100.
- allOf:
- - $ref: '#/components/schemas/VersionSelectionRule'
- FolderDatasetVersion:
+ - 1g
+ - 4g
+ - 16g
+ - 64g
+ description: Optional memory limit for the container. Defaults to "1g".
+ network_policy:
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ OpenAI.CreateContainerBodyExpiresAfter:
type: object
required:
- - type
+ - anchor
+ - minutes
properties:
- type:
+ anchor:
type: string
enum:
- - uri_folder
- description: Dataset type
- allOf:
- - $ref: '#/components/schemas/DatasetVersion'
- description: FileDatasetVersion Definition
- FolderDatasetVersionUpdate:
+ - last_active_at
+ minutes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CreateContainerFileBody:
type: object
- required:
- - type
properties:
- type:
- type: string
- enum:
- - uri_folder
- description: Dataset type
- allOf:
- - $ref: '#/components/schemas/DatasetVersionUpdate'
- description: FileDatasetVersion Definition
- FoundryModelArtifactProfileCategory:
- anyOf:
- - type: string
- - type: string
- enum:
- - DataOnly
- - RuntimeDependent
- - Unknown
- description: The artifact profile category.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelArtifactProfileSignal:
- anyOf:
- - type: string
- - type: string
- enum:
- - PickleDeserialization
- - CustomPythonCode
- - DynamicOps
- - NativeBinary
- - UnknownFormat
- description: Signals detected in the model artifact.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelSourceType:
- anyOf:
- - type: string
- - type: string
- enum:
- - LocalUpload
- - TrainingJob
- description: The source type of the model.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelWarning:
+ file_id:
+ type: object
+ description: Name of the file to create.
+ file:
+ type: object
+ description: The File object (not file name) to be uploaded.
+ OpenAI.CreateConversationBody:
type: object
properties:
- code:
- $ref: '#/components/schemas/FoundryModelWarningCode'
- description: The warning code.
- message:
- type: string
- description: The warning message.
- description: A warning associated with a model.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelWarningCode:
- anyOf:
- - type: string
- - type: string
- enum:
- - RuntimeDependentArtifact
- - UnclassifiedArtifact
- description: Warning code for model artifacts.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelWeightType:
- anyOf:
- - type: string
- - type: string
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ items:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.InputItem'
+ - type: 'null'
+ OpenAI.CreateEmbeddingRequest:
+ type: object
+ required:
+ - input
+ - model
+ properties:
+ input:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: array
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: 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.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - text-embedding-ada-002
+ - text-embedding-3-small
+ - text-embedding-3-large
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ x-oaiTypeLabel: string
+ encoding_format:
+ type: string
enum:
- - FullWeight
- - LoRA
- - DraftModel
- description: The weight type of the model.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryTimestamp:
- type: integer
- format: unixtime
- FunctionToolCall:
+ - float
+ - base64
+ description: The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).
+ default: float
+ dimensions:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 1
+ description: The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.
+ user:
+ type: string
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ OpenAI.CreateEmbeddingResponse:
type: object
required:
- - name
- - arguments
+ - data
+ - model
+ - object
+ - usage
properties:
- name:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Embedding'
+ description: The list of embeddings generated by the model.
+ model:
type: string
- description: The name of the function to call.
- arguments:
+ description: The name of the model used to generate the embedding.
+ object:
type: string
- description: The arguments to call the function with, as generated by the model in JSON format.
- description: Details of a function tool call.
- GitHubIssueEvent:
- anyOf:
- - type: string
- - type: string
enum:
- - opened
- - closed
- description: Known GitHub issue events that can fire a routine.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- GitHubIssueRoutineTrigger:
+ - list
+ description: The object type, which is always "list".
+ x-stainless-const: true
+ usage:
+ $ref: '#/components/schemas/OpenAI.CreateEmbeddingResponseUsage'
+ description: The usage information for the request.
+ OpenAI.CreateEmbeddingResponseUsage:
+ type: object
+ required:
+ - prompt_tokens
+ - total_tokens
+ properties:
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CreateEvalCompletionsRunDataSource:
type: object
required:
- type
- - connection_id
- - owner
- - repository
- - issue_event
+ - source
properties:
type:
type: string
enum:
- - github_issue
- description: The trigger type.
- connection_id:
- type: string
- maxLength: 256
- description: The workspace connection identifier that resolves the GitHub configuration for the trigger.
- owner:
- type: string
- maxLength: 128
- description: The GitHub owner or organization that scopes which issues can fire the trigger.
- repository:
+ - completions
+ description: The type of run data source. Always `completions`.
+ default: completions
+ input_messages:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ description: 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.
+ sampling_params:
+ $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams'
+ model:
type: string
- maxLength: 128
- description: The GitHub repository filter that scopes which issues can fire the trigger.
- issue_event:
- $ref: '#/components/schemas/GitHubIssueEvent'
- description: The GitHub issue event that fires the routine.
- allOf:
- - $ref: '#/components/schemas/RoutineTrigger'
- description: A GitHub issue routine trigger.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- HeaderTelemetryEndpointAuth:
+ description: The name of the model to use for generating completions (e.g. "o3-mini").
+ source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
+ - $ref: '#/components/schemas/OpenAI.EvalStoredCompletionsSource'
+ description: Determines what populates the `item` namespace in this run's data source.
+ description: A CompletionsRunDataSource object describing a model sampling configuration.
+ title: CompletionsRunDataSource
+ x-oaiMeta:
+ name: The completions data source object used to configure an individual run
+ group: eval runs
+ example: |
+ {
+ "name": "gpt-4o-mini-2024-07-18",
+ "data_source": {
+ "type": "completions",
+ "input_messages": {
+ "type": "item_reference",
+ "item_reference": "item.input"
+ },
+ "model": "gpt-4o-mini-2024-07-18",
+ "source": {
+ "type": "stored_completions",
+ "model": "gpt-4o-mini-2024-07-18"
+ }
+ }
+ }
+ OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference:
type: object
required:
- type
- - header_name
- - secret_id
- - secret_key
+ - item_reference
properties:
type:
type: string
enum:
- - header
- description: The authentication type, always 'header' for header-based secret authentication.
- header_name:
- type: string
- description: The name of the HTTP header to inject the secret value into.
- examples:
- - X-Otlp-Api-Key
- secret_id:
- type: string
- description: The identifier of the secret store or connection.
- examples:
- - my-secret-store
- secret_key:
+ - item_reference
+ item_reference:
type: string
- description: The key within the secret to retrieve the authentication value.
- examples:
- - OTLP_KEY
- allOf:
- - $ref: '#/components/schemas/TelemetryEndpointAuth'
- description: Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header.
- HostedAgentDefinition:
+ OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate:
type: object
required:
- - kind
- - cpu
- - memory
+ - type
+ - template
properties:
- kind:
+ type:
type: string
enum:
- - hosted
- cpu:
- type: string
- description: The CPU configuration for the hosted agent.
- examples:
- - '0.25'
- memory:
- type: string
- description: The memory configuration for the hosted agent.
- examples:
- - 0.5Gi
- environment_variables:
- type: object
- unevaluatedProperties:
- type: string
- description: Environment variables to set in the hosted agent container.
- examples:
- - name: LOG_LEVEL
- value: debug
- container_configuration:
- $ref: '#/components/schemas/ContainerConfiguration'
- description: Container-based deployment configuration. Provide this for image-based deployments. Mutually exclusive with code_configuration — the service validates that exactly one is set.
- protocol_versions:
+ - template
+ template:
type: array
items:
- $ref: '#/components/schemas/ProtocolVersionRecord'
- description: The protocols that the agent supports for ingress communication.
- examples:
- - - protocol: responses
- version: v0.1.1
- - protocol: a2a
- version: v0.3.0
- code_configuration:
- $ref: '#/components/schemas/CodeConfiguration'
- description: Code-based deployment configuration. Provide this for code-based deployments. Mutually exclusive with container_configuration — the service validates that exactly one is set.
- telemetry_config:
- $ref: '#/components/schemas/TelemetryConfig'
- description: Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics.
- allOf:
- - $ref: '#/components/schemas/AgentDefinition'
- description: The hosted agent definition.
- HourlyRecurrenceSchedule:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EasyInputMessage'
+ - $ref: '#/components/schemas/OpenAI.EvalItem'
+ OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams:
type: object
- required:
- - type
properties:
- type:
- type: string
- enum:
- - Hourly
- allOf:
- - $ref: '#/components/schemas/RecurrenceSchedule'
- description: Hourly recurrence schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- HumanEvaluationPreviewRuleAction:
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ temperature:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ default: 1
+ max_completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ top_p:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ default: 1
+ seed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ default: 42
+ response_format:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatText'
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject'
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionTool'
+ OpenAI.CreateEvalCustomDataSourceConfig:
type: object
required:
- type
- - templateId
+ - item_schema
properties:
type:
type: string
enum:
- - humanEvaluationPreview
- templateId:
- $ref: '#/components/schemas/AssetId'
- description: Human evaluation template Id.
- allOf:
- - $ref: '#/components/schemas/EvaluationRuleAction'
- description: Evaluation rule action for human evaluation.
- Index:
+ - custom
+ description: The type of data source. Always `custom`.
+ x-stainless-const: true
+ default: custom
+ item_schema:
+ type: object
+ unevaluatedProperties: {}
+ description: The json schema for each row in the data source.
+ include_sample_schema:
+ type: boolean
+ description: Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)
+ description: |-
+ 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
+ title: CustomDataSourceConfig
+ x-oaiMeta:
+ name: The eval file data source config object
+ group: evals
+ example: |
+ {
+ "type": "custom",
+ "item_schema": {
+ "type": "object",
+ "properties": {
+ "name": {"type": "string"},
+ "age": {"type": "integer"}
+ },
+ "required": ["name", "age"]
+ },
+ "include_sample_schema": true
+ }
+ OpenAI.CreateEvalJsonlRunDataSource:
type: object
required:
- type
- - name
- - version
+ - source
properties:
type:
- $ref: '#/components/schemas/IndexType'
- description: Type of index
- id:
- type: string
- description: Asset ID, a unique identifier for the asset
- readOnly: true
- name:
- type: string
- description: The name of the resource
- readOnly: true
- version:
type: string
- description: The version of the resource
- readOnly: true
- discriminator:
- propertyName: type
- mapping:
- AzureSearch: '#/components/schemas/AzureAISearchIndex'
- ManagedAzureSearch: '#/components/schemas/ManagedAzureAISearchIndex'
- CosmosDBNoSqlVectorStore: '#/components/schemas/CosmosDBIndex'
- description: Index resource Definition
- IndexType:
- anyOf:
- - type: string
- - type: string
enum:
- - AzureSearch
- - CosmosDBNoSqlVectorStore
- - ManagedAzureSearch
- IndexUpdate:
+ - jsonl
+ description: The type of data source. Always `jsonl`.
+ x-stainless-const: true
+ default: jsonl
+ source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
+ description: Determines what populates the `item` namespace in the data source.
+ description: A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
+ title: JsonlRunDataSource
+ x-oaiMeta:
+ name: The file data source object for the eval run configuration
+ group: evals
+ example: |
+ {
+ "type": "jsonl",
+ "source": {
+ "type": "file_id",
+ "id": "file-9GYS6xbkWgWhmE7VoLUWFg"
+ }
+ }
+ OpenAI.CreateEvalLogsDataSourceConfig:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/IndexType'
- description: Type of index
- description:
- type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- discriminator:
- propertyName: type
- mapping:
- AzureSearch: '#/components/schemas/AzureAISearchIndexUpdate'
- ManagedAzureSearch: '#/components/schemas/ManagedAzureAISearchIndexUpdate'
- CosmosDBNoSqlVectorStore: '#/components/schemas/CosmosDBIndexUpdate'
- description: Index resource Definition
- Insight:
- type: object
- required:
- - id
- - metadata
- - state
- - displayName
- - request
- properties:
- id:
type: string
- description: The unique identifier for the insights report.
- readOnly: true
+ enum:
+ - logs
+ description: The type of data source. Always `logs`.
+ x-stainless-const: true
+ default: logs
metadata:
- $ref: '#/components/schemas/InsightsMetadata'
- description: Metadata about the insights report.
- readOnly: true
- state:
- $ref: '#/components/schemas/Azure.Core.Foundations.OperationState'
- description: The current state of the insights.
- readOnly: true
- displayName:
- type: string
- description: User friendly display name for the insight.
- request:
- $ref: '#/components/schemas/InsightRequest'
- description: Request for the insights analysis.
- result:
- $ref: '#/components/schemas/InsightResult'
- description: The result of the insights report.
- readOnly: true
- description: The response body for cluster insights.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightCluster:
+ type: object
+ unevaluatedProperties: {}
+ description: Metadata filters for the logs data source.
+ description: |-
+ 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.
+ title: LogsDataSourceConfig
+ x-oaiMeta:
+ name: The logs data source object for evals
+ group: evals
+ example: |
+ {
+ "type": "logs",
+ "metadata": {
+ "use_case": "customer_support_agent"
+ }
+ }
+ OpenAI.CreateEvalResponsesRunDataSource:
type: object
required:
- - id
- - label
- - suggestion
- - suggestionTitle
- - description
- - weight
+ - type
+ - source
properties:
- id:
- type: string
- description: The id of the analysis cluster.
- label:
- type: string
- description: Label for the cluster
- suggestion:
- type: string
- description: Suggestion for the cluster
- suggestionTitle:
- type: string
- description: The title of the suggestion for the cluster
- description:
+ type:
type: string
- description: Description of the analysis cluster.
- weight:
- type: integer
- format: int32
- description: The weight of the analysis cluster. This indicate number of samples in the cluster.
- subClusters:
- description: List of subclusters within this cluster. Empty if no subclusters exist.
- type: array
- items:
- $ref: '#/components/schemas/InsightCluster'
- samples:
- type: array
- items:
- $ref: '#/components/schemas/InsightSample'
- description: List of samples that belong to this cluster. Empty if samples are part of subclusters.
- description: A cluster of analysis samples.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightModelConfiguration:
- type: object
- required:
- - modelDeploymentName
- properties:
- modelDeploymentName:
+ enum:
+ - responses
+ description: The type of run data source. Always `responses`.
+ default: responses
+ input_messages:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference'
+ description: 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.
+ sampling_params:
+ $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams'
+ model:
type: string
- description: The model deployment to be evaluated. Accepts either the deployment name alone or with the connection name as '{connectionName}/'.
- description: Configuration of the model used in the insight generation.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightRequest:
+ description: The name of the model to use for generating completions (e.g. "o3-mini").
+ source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
+ - $ref: '#/components/schemas/OpenAI.EvalResponsesSource'
+ description: Determines what populates the `item` namespace in this run's data source.
+ description: A ResponsesRunDataSource object describing a model sampling configuration.
+ title: ResponsesRunDataSource
+ x-oaiMeta:
+ name: The completions data source object used to configure an individual run
+ group: eval runs
+ example: |
+ {
+ "name": "gpt-4o-mini-2024-07-18",
+ "data_source": {
+ "type": "responses",
+ "input_messages": {
+ "type": "item_reference",
+ "item_reference": "item.input"
+ },
+ "model": "gpt-4o-mini-2024-07-18",
+ "source": {
+ "type": "responses",
+ "model": "gpt-4o-mini-2024-07-18"
+ }
+ }
+ }
+ OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference:
type: object
required:
- type
+ - item_reference
properties:
type:
- $ref: '#/components/schemas/InsightType'
- description: The type of request.
- discriminator:
- propertyName: type
- mapping:
- EvaluationRunClusterInsight: '#/components/schemas/EvaluationRunClusterInsightRequest'
- AgentClusterInsight: '#/components/schemas/AgentClusterInsightRequest'
- EvaluationComparison: '#/components/schemas/EvaluationComparisonInsightRequest'
- description: The request of the insights report.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightResult:
+ type: string
+ enum:
+ - item_reference
+ item_reference:
+ type: string
+ OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate:
type: object
required:
- type
+ - template
properties:
type:
- $ref: '#/components/schemas/InsightType'
- description: The type of insights result.
- discriminator:
- propertyName: type
- mapping:
- EvaluationComparison: '#/components/schemas/EvaluationComparisonInsightResult'
- EvaluationRunClusterInsight: '#/components/schemas/EvaluationRunClusterInsightResult'
- AgentClusterInsight: '#/components/schemas/AgentClusterInsightResult'
- description: The result of the insights.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightSample:
+ type: string
+ enum:
+ - template
+ template:
+ type: array
+ items:
+ anyOf:
+ - type: object
+ properties:
+ role:
+ type: string
+ content:
+ type: string
+ required:
+ - role
+ - content
+ - $ref: '#/components/schemas/OpenAI.EvalItem'
+ OpenAI.CreateEvalResponsesRunDataSourceSamplingParams:
+ type: object
+ properties:
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ temperature:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ default: 1
+ max_completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ top_p:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ default: 1
+ seed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ default: 42
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ text:
+ $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText'
+ OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
+ OpenAI.CreateEvalStoredCompletionsDataSourceConfig:
type: object
required:
- - id
- type
- - features
- - correlationInfo
properties:
- id:
- type: string
- description: The unique identifier for the analysis sample.
type:
- $ref: '#/components/schemas/SampleType'
- description: Sample type
- features:
- type: object
- unevaluatedProperties: {}
- description: Features to help with additional filtering of data in UX.
- correlationInfo:
+ type: string
+ enum:
+ - stored_completions
+ description: The type of data source. Always `stored_completions`.
+ x-stainless-const: true
+ default: stored_completions
+ metadata:
type: object
unevaluatedProperties: {}
- description: Info about the correlation for the analysis sample.
- discriminator:
- propertyName: type
- mapping:
- EvaluationResultSample: '#/components/schemas/EvaluationResultSample'
- description: A sample from the analysis.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightScheduleTask:
+ description: Metadata filters for the stored completions data source.
+ description: Deprecated in favor of LogsDataSourceConfig.
+ title: StoredCompletionsDataSourceConfig
+ deprecated: true
+ x-oaiMeta:
+ name: The stored completions data source object for evals
+ group: evals
+ example: |
+ {
+ "type": "stored_completions",
+ "metadata": {
+ "use_case": "customer_support_agent"
+ }
+ }
+ OpenAI.CreateFileRequest:
+ type: object
+ properties:
+ file:
+ description: The File object (not file name) to be uploaded.
+ purpose:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FilePurpose'
+ description: |-
+ 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
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.FileExpirationAfter'
+ required:
+ - file
+ - purpose
+ OpenAI.CreateFineTuningCheckpointPermissionRequest:
+ type: object
+ required:
+ - project_ids
+ properties:
+ project_ids:
+ type: array
+ items:
+ type: string
+ description: The project identifiers to grant access to.
+ OpenAI.CreateFineTuningJobRequest:
+ type: object
+ required:
+ - model
+ - training_file
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - babbage-002
+ - davinci-002
+ - gpt-3.5-turbo
+ - gpt-4o-mini
+ description: |-
+ The name of the model to fine-tune. You can select one of the
+ [supported models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned).
+ x-oaiTypeLabel: string
+ training_file:
+ type: string
+ description: |-
+ The ID of an uploaded file that contains training data.
+ See [upload file](/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](/docs/api-reference/fine-tuning/chat-input), [completions](/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](/docs/api-reference/fine-tuning/preference-input) format.
+ See the [fine-tuning guide](/docs/guides/model-optimization) for more details.
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters'
+ description: |-
+ 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: true
+ suffix:
+ anyOf:
+ - type: string
+ - type: 'null'
+ minLength: 1
+ maxLength: 64
+ description: |-
+ 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`.
+ validation_file:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: |-
+ 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](/docs/guides/model-optimization) for more details.
+ integrations:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations'
+ - type: 'null'
+ description: A list of integrations to enable for your fine-tuning job.
+ seed:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ maximum: 2147483647
+ description: |-
+ 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.
+ method:
+ $ref: '#/components/schemas/OpenAI.FineTuneMethod'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateFineTuningJobRequestHyperparameters:
+ type: object
+ properties:
+ batch_size:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ default: auto
+ OpenAI.CreateFineTuningJobRequestIntegrations:
type: object
required:
- type
- - insight
+ - wandb
properties:
type:
type: string
enum:
- - Insight
- insight:
- $ref: '#/components/schemas/Insight'
- description: The insight payload.
- allOf:
- - $ref: '#/components/schemas/ScheduleTask'
- description: Insight task for the schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- InsightSummary:
+ - wandb
+ x-stainless-const: true
+ wandb:
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb'
+ OpenAI.CreateFineTuningJobRequestIntegrationsWandb:
type: object
required:
- - sampleCount
- - uniqueSubclusterCount
- - uniqueClusterCount
- - method
- - usage
+ - project
properties:
- sampleCount:
- type: integer
- format: int32
- description: Total number of samples analyzed.
- uniqueSubclusterCount:
- type: integer
- format: int32
- description: Total number of unique subcluster labels.
- uniqueClusterCount:
- type: integer
- format: int32
- description: Total number of unique clusters.
- method:
+ project:
type: string
- description: Method used for clustering.
- usage:
- $ref: '#/components/schemas/ClusterTokenUsage'
- description: Token usage while performing clustering analysis
- description: Summary of the error cluster analysis.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightType:
- anyOf:
- - type: string
- - type: string
- enum:
- - EvaluationRunClusterInsight
- - AgentClusterInsight
- - EvaluationComparison
- description: The request of the insights.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightsMetadata:
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ entity:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tags:
+ type: array
+ items:
+ type: string
+ OpenAI.CreateImageEditRequest:
type: object
- required:
- - createdAt
properties:
- createdAt:
+ image:
+ anyOf:
+ - {}
+ - type: array
+ items:
+ type: string
+ contentEncoding: base64
+ description: |-
+ The image(s) to edit. Must be a supported image file or an array of images.
+ For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`
+ file less than 50MB. You can provide up to 16 images.
+ `chatgpt-image-latest` follows the same input constraints as GPT image models.
+ For `dall-e-2`, you can only provide one image, and it should be a square
+ `png` file less than 4MB.
+ prompt:
type: string
- format: date-time
- description: The timestamp when the insights were created.
- completedAt:
+ description: A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
+ mask:
+ description: 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`.
+ background:
+ anyOf:
+ - type: string
+ enum:
+ - transparent
+ - opaque
+ - auto
+ - type: 'null'
+ description: |-
+ Allows to set transparency for the background of the generated image(s).
+ This parameter is only supported for the GPT image models. 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`.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - gpt-image-1.5
+ - dall-e-2
+ - gpt-image-1
+ - gpt-image-1-mini
+ - chatgpt-image-latest
+ - type: 'null'
+ description: The model to use for image generation. Defaults to `gpt-image-1.5`.
+ x-oaiTypeLabel: string
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The number of images to generate. Must be between 1 and 10.
+ size:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - 256x256
+ - 512x512
+ - 1024x1024
+ - 1536x1024
+ - 1024x1536
+ - auto
+ - type: 'null'
+ description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ response_format:
+ anyOf:
+ - type: string
+ enum:
+ - url
+ - b64_json
+ - type: 'null'
+ description: 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` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
+ output_format:
+ anyOf:
+ - type: string
+ enum:
+ - png
+ - jpeg
+ - webp
+ - type: 'null'
+ description: |-
+ The format in which the generated images are returned. This parameter is
+ only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
+ The default value is `png`.
+ output_compression:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: |-
+ The compression level (0-100%) for the generated images. This parameter
+ is only supported for the GPT image models with the `webp` or `jpeg` output
+ formats, and defaults to 100.
+ user:
type: string
- format: date-time
- description: The timestamp when the insights were completed.
- description: Metadata about the insights.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InvocationsProtocolConfiguration:
- type: object
- description: Configuration specific to the invocations protocol.
- InvocationsWsProtocolConfiguration:
- type: object
- description: Configuration specific to the WebSocket-based invocations protocol.
- InvokeAgentInvocationsApiDispatchPayload:
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ input_fidelity:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.InputFidelity'
+ - type: 'null'
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: |-
+ Edit the image in streaming mode. Defaults to `false`. See the
+ [Image generation guide](/docs/guides/image-generation) for more information.
+ partial_images:
+ $ref: '#/components/schemas/OpenAI.PartialImages'
+ quality:
+ anyOf:
+ - type: string
+ enum:
+ - standard
+ - low
+ - medium
+ - high
+ - auto
+ - type: 'null'
+ description: The quality of the image that will be generated for GPT image models. Defaults to `auto`.
+ required:
+ - image
+ - prompt
+ OpenAI.CreateImageRequest:
type: object
required:
- - type
- - input
+ - prompt
properties:
- type:
+ prompt:
type: string
- enum:
- - invoke_agent_invocations_api
- description: The manual dispatch payload type.
- input:
- description: The JSON value sent as the complete downstream invocations input. The value is passed through as-is and can be an object, string, number, boolean, array, or null.
- allOf:
- - $ref: '#/components/schemas/RoutineDispatchPayload'
- description: A manual payload used to test an invocations API routine dispatch.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- InvokeAgentInvocationsApiRoutineAction:
+ description: A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - gpt-image-1.5
+ - dall-e-2
+ - dall-e-3
+ - gpt-image-1
+ - gpt-image-1-mini
+ - type: 'null'
+ description: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
+ x-oaiTypeLabel: string
+ default: dall-e-2
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 1
+ maximum: 10
+ description: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
+ default: 1
+ quality:
+ anyOf:
+ - type: string
+ enum:
+ - standard
+ - hd
+ - low
+ - medium
+ - high
+ - auto
+ - type: 'null'
+ description: |-
+ 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 the GPT image models.
+ - `hd` and `standard` are supported for `dall-e-3`.
+ - `standard` is the only option for `dall-e-2`.
+ default: auto
+ response_format:
+ anyOf:
+ - type: string
+ enum:
+ - url
+ - b64_json
+ - type: 'null'
+ description: 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 the GPT image models, which always return base64-encoded images.
+ default: url
+ output_format:
+ anyOf:
+ - type: string
+ enum:
+ - png
+ - jpeg
+ - webp
+ - type: 'null'
+ description: The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
+ default: png
+ output_compression:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100.
+ default: 100
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: |-
+ Generate the image in streaming mode. Defaults to `false`. See the
+ [Image generation guide](/docs/guides/image-generation) for more information.
+ This parameter is only supported for the GPT image models.
+ partial_images:
+ $ref: '#/components/schemas/OpenAI.PartialImages'
+ size:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - auto
+ - 1024x1024
+ - 1536x1024
+ - 1024x1536
+ - 256x256
+ - 512x512
+ - 1792x1024
+ - 1024x1792
+ - type: 'null'
+ description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ default: auto
+ moderation:
+ anyOf:
+ - type: string
+ enum:
+ - low
+ - auto
+ - type: 'null'
+ description: Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value).
+ default: auto
+ background:
+ anyOf:
+ - type: string
+ enum:
+ - transparent
+ - opaque
+ - auto
+ - type: 'null'
+ description: |-
+ Allows to set transparency for the background of the generated image(s).
+ This parameter is only supported for the GPT image models. 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`.
+ default: auto
+ style:
+ anyOf:
+ - type: string
+ enum:
+ - vivid
+ - natural
+ - type: 'null'
+ description: 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.
+ default: vivid
+ user:
+ type: string
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ OpenAI.CreateImageVariationRequest:
+ type: object
+ properties:
+ image:
+ description: The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - dall-e-2
+ - type: 'null'
+ description: The model to use for image generation. Only `dall-e-2` is supported at this time.
+ x-oaiTypeLabel: string
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The number of images to generate. Must be between 1 and 10.
+ response_format:
+ anyOf:
+ - type: string
+ enum:
+ - url
+ - b64_json
+ - type: 'null'
+ description: 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.
+ size:
+ anyOf:
+ - type: string
+ enum:
+ - 256x256
+ - 512x512
+ - 1024x1024
+ - type: 'null'
+ description: The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
+ user:
+ type: string
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ required:
+ - image
+ OpenAI.CreateMessageRequest:
type: object
required:
- - type
+ - role
+ - content
properties:
- type:
+ role:
type: string
enum:
- - invoke_agent_invocations_api
- description: The action type.
- agent_name:
- type: string
- maxLength: 256
- description: The project-scoped agent name for routine dispatch.
- agent_endpoint_id:
- type: string
- maxLength: 256
- description: Legacy endpoint-scoped agent identifier for routine dispatch.
- input:
- description: Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
- session_id:
- type: string
- maxLength: 256
- description: An optional existing hosted-agent session identifier to continue during the downstream dispatch.
- allOf:
- - $ref: '#/components/schemas/RoutineAction'
- description: Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- InvokeAgentResponsesApiDispatchPayload:
+ - user
+ - assistant
+ description: |-
+ 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.
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessageContentImageFileObject'
+ - $ref: '#/components/schemas/OpenAI.MessageContentImageUrlObject'
+ - $ref: '#/components/schemas/OpenAI.MessageRequestContentTextObject'
+ attachments:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateMessageRequestAttachments'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateMessageRequestAttachments:
type: object
- required:
- - type
- - input
properties:
- type:
+ file_id:
type: string
- enum:
- - invoke_agent_responses_api
- description: The manual dispatch payload type.
- input:
- description: The JSON value sent as the complete downstream responses input. The value is passed through as-is and can be an object, string, number, boolean, array, or null.
- allOf:
- - $ref: '#/components/schemas/RoutineDispatchPayload'
- description: A manual payload used to test a responses API routine dispatch.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- InvokeAgentResponsesApiRoutineAction:
+ tools:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantToolsCode'
+ - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly'
+ OpenAI.CreateModerationRequest:
type: object
required:
- - type
+ - input
properties:
- type:
- type: string
- enum:
- - invoke_agent_responses_api
- description: The action type.
- agent_name:
- type: string
- maxLength: 256
- description: The project-scoped agent name for routine dispatch.
- agent_endpoint_id:
- type: string
- maxLength: 256
- description: Legacy endpoint-scoped agent identifier for routine dispatch.
input:
- description: Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
- conversation:
- type: string
- maxLength: 256
- description: An optional existing conversation identifier to continue during the downstream dispatch.
- allOf:
- - $ref: '#/components/schemas/RoutineAction'
- description: Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- ItemGenerationParams:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateModerationRequestInput'
+ description: |-
+ 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.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - omni-moderation-latest
+ - omni-moderation-2024-09-26
+ - text-moderation-latest
+ - text-moderation-stable
+ description: |-
+ The content moderation model you would like to use. Learn more in
+ [the moderation guide](/docs/guides/moderation), and learn about
+ available models [here](/docs/models#moderation).
+ x-oaiTypeLabel: string
+ default: omni-moderation-latest
+ OpenAI.CreateModerationRequestInput:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/ItemGenerationParamsType'
- description: The type of item generation parameters to use.
+ $ref: '#/components/schemas/OpenAI.CreateModerationRequestInputType'
discriminator:
propertyName: type
mapping:
- red_team: '#/components/schemas/RedTeamItemGenerationParams'
- red_team_seed_prompts: '#/components/schemas/RedTeamSeedPromptsItemGenerationParams'
- red_team_taxonomy: '#/components/schemas/RedTeamTaxonomyItemGenerationParams'
- response_retrieval: '#/components/schemas/ResponseRetrievalItemGenerationParams'
- conversation_gen_preview: '#/components/schemas/ConversationGenPreviewItemGenerationParams'
- synthetic_data_gen_preview: '#/components/schemas/SyntheticDataGenerationPreviewItemGenerationParams'
- description: Represents the set of parameters used to control item generation operations.
- ItemGenerationParamsType:
- anyOf:
- - type: string
- - type: string
- enum:
- - red_team
- - response_retrieval
- - red_team_seed_prompts
- - red_team_taxonomy
- - synthetic_data_gen_preview
- - conversation_gen_preview
- description: The types of parameters for red team item generation.
- JobStatus:
+ image_url: '#/components/schemas/OpenAI.ModerationImageURLInput'
+ text: '#/components/schemas/OpenAI.ModerationTextInput'
+ OpenAI.CreateModerationRequestInputType:
anyOf:
- type: string
- type: string
enum:
- - queued
- - in_progress
- - succeeded
- - failed
- - cancelled
- description: Extensible status values shared by Foundry jobs.
- LoraConfig:
+ - image_url
+ - text
+ OpenAI.CreateModerationResponse:
type: object
+ required:
+ - id
+ - model
+ - results
properties:
- rank:
- type: integer
- format: int32
- description: 'LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.'
- alpha:
- type: integer
- format: int32
- description: LoRA scaling factor (α). Positive integer; typically 2× the rank.
- targetModules:
+ id:
+ type: string
+ description: The unique identifier for the moderation request.
+ model:
+ type: string
+ description: The model used to generate the moderation results.
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponseResults'
+ description: A list of moderation objects.
+ description: Represents if a given text input is potentially harmful.
+ x-oaiMeta:
+ name: The moderation object
+ example: |
+ {
+ "id": "modr-0d9740456c391e43c445bf0f010940c7",
+ "model": "omni-moderation-latest",
+ "results": [
+ {
+ "flagged": true,
+ "categories": {
+ "harassment": true,
+ "harassment/threatening": true,
+ "sexual": false,
+ "hate": false,
+ "hate/threatening": false,
+ "illicit": false,
+ "illicit/violent": false,
+ "self-harm/intent": false,
+ "self-harm/instructions": false,
+ "self-harm": false,
+ "sexual/minors": false,
+ "violence": true,
+ "violence/graphic": true
+ },
+ "category_scores": {
+ "harassment": 0.8189693396524255,
+ "harassment/threatening": 0.804985420696006,
+ "sexual": 1.573112165348997e-6,
+ "hate": 0.007562942636942845,
+ "hate/threatening": 0.004208854591835476,
+ "illicit": 0.030535955153511665,
+ "illicit/violent": 0.008925306722380033,
+ "self-harm/intent": 0.00023023930975076432,
+ "self-harm/instructions": 0.0002293869201073356,
+ "self-harm": 0.012598046106750154,
+ "sexual/minors": 2.212566909570261e-8,
+ "violence": 0.9999992735124786,
+ "violence/graphic": 0.843064871157054
+ },
+ "category_applied_input_types": {
+ "harassment": [
+ "text"
+ ],
+ "harassment/threatening": [
+ "text"
+ ],
+ "sexual": [
+ "text",
+ "image"
+ ],
+ "hate": [
+ "text"
+ ],
+ "hate/threatening": [
+ "text"
+ ],
+ "illicit": [
+ "text"
+ ],
+ "illicit/violent": [
+ "text"
+ ],
+ "self-harm/intent": [
+ "text",
+ "image"
+ ],
+ "self-harm/instructions": [
+ "text",
+ "image"
+ ],
+ "self-harm": [
+ "text",
+ "image"
+ ],
+ "sexual/minors": [
+ "text"
+ ],
+ "violence": [
+ "text",
+ "image"
+ ],
+ "violence/graphic": [
+ "text",
+ "image"
+ ]
+ }
+ }
+ ]
+ }
+ OpenAI.CreateModerationResponseResults:
+ type: object
+ required:
+ - flagged
+ - categories
+ - category_scores
+ - category_applied_input_types
+ properties:
+ flagged:
+ type: boolean
+ categories:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponseResultsCategories'
+ category_scores:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponseResultsCategoryScores'
+ category_applied_input_types:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponseResultsCategoryAppliedInputTypes'
+ OpenAI.CreateModerationResponseResultsCategories:
+ type: object
+ required:
+ - hate
+ - hate/threatening
+ - harassment
+ - harassment/threatening
+ - illicit
+ - illicit/violent
+ - self-harm
+ - self-harm/intent
+ - self-harm/instructions
+ - sexual
+ - sexual/minors
+ - violence
+ - violence/graphic
+ properties:
+ hate:
+ type: boolean
+ hate/threatening:
+ type: boolean
+ harassment:
+ type: boolean
+ harassment/threatening:
+ type: boolean
+ illicit:
+ type: boolean
+ illicit/violent:
+ type: boolean
+ self-harm:
+ type: boolean
+ self-harm/intent:
+ type: boolean
+ self-harm/instructions:
+ type: boolean
+ sexual:
+ type: boolean
+ sexual/minors:
+ type: boolean
+ violence:
+ type: boolean
+ violence/graphic:
+ type: boolean
+ OpenAI.CreateModerationResponseResultsCategoryAppliedInputTypes:
+ type: object
+ required:
+ - hate
+ - hate/threatening
+ - harassment
+ - harassment/threatening
+ - illicit
+ - illicit/violent
+ - self-harm
+ - self-harm/intent
+ - self-harm/instructions
+ - sexual
+ - sexual/minors
+ - violence
+ - violence/graphic
+ properties:
+ hate:
type: array
items:
type: string
- description: Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from adapter_config.json if omitted.
- dropout:
- type: number
- format: float
- description: Dropout rate used during training. Informational — not used at serving time.
- description: Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- MCPToolboxTool:
+ enum:
+ - text
+ hate/threatening:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ harassment:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ harassment/threatening:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ illicit:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ illicit/violent:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ self-harm:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ self-harm/intent:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ self-harm/instructions:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ sexual:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ sexual/minors:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ violence:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ violence/graphic:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ OpenAI.CreateModerationResponseResultsCategoryScores:
+ type: object
+ required:
+ - hate
+ - hate/threatening
+ - harassment
+ - harassment/threatening
+ - illicit
+ - illicit/violent
+ - self-harm
+ - self-harm/intent
+ - self-harm/instructions
+ - sexual
+ - sexual/minors
+ - violence
+ - violence/graphic
+ properties:
+ hate:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ hate/threatening:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ harassment:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ harassment/threatening:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ illicit:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ illicit/violent:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ self-harm:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ self-harm/intent:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ self-harm/instructions:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ sexual:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ sexual/minors:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ violence:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ violence/graphic:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.CreateResponseStreamingResponse:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCreatedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseErrorEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFailedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseIncompleteEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseTextDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseQueuedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseAudioDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseContentPartDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseOutputItemDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseRefusalDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseTextDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent'
+ OpenAI.CreateRunRequest:
type: object
required:
- - type
- - server_label
+ - assistant_id
properties:
- type:
+ assistant_id:
type: string
- enum:
- - mcp
- server_label:
+ description: The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run.
+ model:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.AssistantSupportedModels'
+ - type: 'null'
+ description: The ID of the [Model](/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.
+ x-oaiTypeLabel: string
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis.
+ additional_instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: 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_messages:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateMessageRequest'
+ - type: 'null'
+ description: Adds additional messages to the thread before creating the run.
+ tools:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ - type: 'null'
+ maxItems: 20
+ description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 2
+ description: 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.
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 1
+ description: |-
+ 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.
+ default: 1
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: '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.'
+ max_prompt_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: 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_completion_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: 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.
+ truncation_strategy:
+ $ref: '#/components/schemas/OpenAI.TruncationObject'
+ tool_choice:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption'
+ parallel_tool_calls:
+ type: boolean
+ description: Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
+ default: true
+ response_format:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ OpenAI.CreateSpeechRequest:
+ type: object
+ required:
+ - model
+ - input
+ - voice
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - tts-1
+ - tts-1-hd
+ - gpt-4o-mini-tts
+ - gpt-4o-mini-tts-2025-12-15
+ description: 'One of the available [TTS models](/docs/models#tts): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.'
+ x-oaiTypeLabel: string
+ input:
type: string
- description: A label for this MCP server, used to identify it in tool calls.
- server_url:
+ maxLength: 4096
+ description: The text to generate audio for. The maximum length is 4096 characters.
+ instructions:
type: string
- format: uri
- description: |-
- The URL for the MCP server. One of `server_url`, `connector_id`, or
- `tunnel_id` must be provided.
- connector_id:
+ maxLength: 4096
+ description: Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`.
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsOrCustomVoice'
+ description: 'The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech#voice-options).'
+ response_format:
type: string
enum:
- - connector_dropbox
- - connector_gmail
- - connector_googlecalendar
- - connector_googledrive
- - connector_microsoftteams
- - connector_outlookcalendar
- - connector_outlookemail
- - connector_sharepoint
- description: |-
- Identifier for service connectors, like those available in ChatGPT. One of
- `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
- about service connectors [here](/docs/guides/tools-remote-mcp#connectors).
- Currently supported `connector_id` values are:
- - Dropbox: `connector_dropbox`
- - Gmail: `connector_gmail`
- - Google Calendar: `connector_googlecalendar`
- - Google Drive: `connector_googledrive`
- - Microsoft Teams: `connector_microsoftteams`
- - Outlook Calendar: `connector_outlookcalendar`
- - Outlook Email: `connector_outlookemail`
- - SharePoint: `connector_sharepoint`
- tunnel_id:
- type: string
- pattern: ^tunnel_[a-z0-9]{32}$
- description: |-
- The Secure MCP Tunnel ID to use instead of a direct server URL. One of
- `server_url`, `connector_id`, or `tunnel_id` must be provided.
- authorization:
+ - mp3
+ - opus
+ - aac
+ - flac
+ - wav
+ - pcm
+ description: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.
+ default: mp3
+ speed:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0.25
+ maximum: 4
+ description: The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.
+ default: 1
+ stream_format:
type: string
- description: |-
- An OAuth access token that can be used with a remote MCP server, either
- with a custom MCP server URL or a service connector. Your application
- must handle the OAuth authorization flow and provide the token here.
- server_description:
+ enum:
+ - sse
+ - audio
+ description: The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.
+ default: audio
+ OpenAI.CreateThreadAndRunRequest:
+ type: object
+ required:
+ - assistant_id
+ properties:
+ assistant_id:
type: string
- description: Optional description of the MCP server, used to provide more context.
- headers:
+ description: The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run.
+ thread:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequest'
+ model:
anyOf:
- - type: object
- unevaluatedProperties:
- type: string
+ - type: string
+ - type: string
+ enum:
+ - 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
- type: 'null'
- allowed_tools:
+ description: The ID of the [Model](/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.
+ x-oaiTypeLabel: string
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.
+ tools:
anyOf:
- type: array
items:
- type: string
- - $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
- type: 'null'
- require_approval:
+ maxItems: 20
+ description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
+ tool_resources:
anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
- - type: string
- enum:
- - always
- - never
+ - $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResources'
+ - type: 'null'
+ description: 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.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 2
+ description: 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.
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 1
+ description: |-
+ 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.
+ default: 1
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: '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.'
+ max_prompt_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: 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_completion_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- default: always
- defer_loading:
+ minimum: 256
+ description: 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.
+ truncation_strategy:
+ $ref: '#/components/schemas/OpenAI.TruncationObject'
+ tool_choice:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption'
+ parallel_tool_calls:
type: boolean
- description: Whether this MCP tool is deferred and discovered via tool search.
- project_connection_id:
- type: string
- description: The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server.
- allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: An MCP tool stored in a toolbox.
- ManagedAgentIdentityBlueprintReference:
- type: object
- required:
- - type
- - blueprint_id
- properties:
- type:
- type: string
- enum:
- - ManagedAgentIdentityBlueprint
- blueprint_id:
- type: string
- description: The ID of the managed blueprint
- allOf:
- - $ref: '#/components/schemas/AgentBlueprintReference'
- ManagedAzureAISearchIndex:
+ description: Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
+ default: true
+ response_format:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ OpenAI.CreateThreadAndRunRequestToolResources:
type: object
- required:
- - type
properties:
- type:
- type: string
- enum:
- - ManagedAzureSearch
- description: Type of index
- allOf:
- - $ref: '#/components/schemas/Index'
- description: Managed Azure AI Search Index Definition
- ManagedAzureAISearchIndexUpdate:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch'
+ OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter:
type: object
- required:
- - type
properties:
- type:
- type: string
- enum:
- - ManagedAzureSearch
- description: Type of index
- allOf:
- - $ref: '#/components/schemas/IndexUpdate'
- description: Managed Azure AI Search Index Definition
- McpProtocolConfiguration:
- type: object
- description: Configuration specific to the MCP protocol.
- MemoryCommandToolCall:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 20
+ default: []
+ OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch:
type: object
- required:
- - type
- - call_id
- - arguments
- - status
properties:
- type:
- type: string
- enum:
- - memory_command_preview_call
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
- type: string
- description: A JSON string of the arguments to pass to the tool, including `action` (`remember` or `forget`) and `content`.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A memory command tool call.
- MemoryCommandToolCallOutput:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ OpenAI.CreateThreadRequest:
type: object
- required:
- - type
- - call_id
- - status
properties:
- type:
- type: string
- enum:
- - memory_command_preview_call_output
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a memory command tool call.
- MemoryItem:
+ messages:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateMessageRequest'
+ description: A list of [messages](/docs/api-reference/messages) to start the thread with.
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: |-
+ Options to create a new thread. If no thread is provided when running a
+ request, an empty thread will be created.
+ OpenAI.CreateThreadRequestToolResources:
type: object
- required:
- - memory_id
- - updated_at
- - scope
- - content
- - kind
properties:
- memory_id:
- type: string
- description: The unique ID of the memory item.
- updated_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The last update time of the memory item.
- scope:
- type: string
- description: The namespace that logically groups and isolates memories, such as a user ID.
- content:
- type: string
- description: The content of the memory.
- kind:
- $ref: '#/components/schemas/MemoryItemKind'
- description: The kind of the memory item.
- discriminator:
- propertyName: kind
- mapping:
- user_profile: '#/components/schemas/UserProfileMemoryItem'
- chat_summary: '#/components/schemas/ChatSummaryMemoryItem'
- procedural: '#/components/schemas/ProceduralMemoryItem'
- description: A single memory item stored in the memory store, containing content and metadata.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryItemKind:
- anyOf:
- - type: string
- - type: string
- enum:
- - user_profile
- - chat_summary
- - procedural
- description: Memory item kind.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryOperation:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearch'
+ OpenAI.CreateThreadRequestToolResourcesCodeInterpreter:
type: object
- required:
- - kind
- - memory_item
properties:
- kind:
- $ref: '#/components/schemas/MemoryOperationKind'
- description: The type of memory operation being performed.
- memory_item:
- $ref: '#/components/schemas/MemoryItem'
- description: The memory item to create, update, or delete.
- description: Represents a single memory operation (create, update, or delete) performed on a memory item.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryOperationKind:
- anyOf:
- - type: string
- - type: string
- enum:
- - create
- - update
- - delete
- description: Memory operation kind.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemorySearchItem:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 20
+ OpenAI.CreateThreadRequestToolResourcesFileSearch:
type: object
- required:
- - memory_item
properties:
- memory_item:
- $ref: '#/components/schemas/MemoryItem'
- description: Retrieved memory item.
- description: A retrieved memory item from memory search.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemorySearchOptions:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ vector_stores:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores'
+ maxItems: 1
+ OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores:
type: object
properties:
- max_memories:
- type: integer
- format: int32
- description: Maximum number of memory items to return.
- description: Memory search options.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemorySearchPreviewTool:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 100000000
+ chunking_strategy:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto'
+ - $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto:
type: object
required:
- type
- - memory_store_name
- - scope
properties:
type:
type: string
enum:
- - memory_search_preview
- description: The type of the tool. Always `memory_search_preview`.
- memory_store_name:
- type: string
- description: The name of the memory store to use.
- scope:
- type: string
- description: |-
- The namespace used to group and isolate memories, such as a user ID.
- Limits which memories can be retrieved or updated.
- Use special variable `{{$userId}}` to scope memories to the current signed-in user.
- search_options:
- $ref: '#/components/schemas/MemorySearchOptions'
- description: Options for searching the memory store.
- update_delay:
- type: integer
- format: int32
- description: Time to wait before updating memories after inactivity (seconds). Default 300.
- default: 300
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool for integrating memories into the agent.
- MemorySearchToolCall:
+ - auto
+ x-stainless-const: true
+ OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic:
type: object
required:
- type
- - status
+ - static
properties:
type:
type: string
enum:
- - memory_search_call
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- memories:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/MemoryItem'
- - type: 'null'
- description: The results returned from the memory search.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A memory search tool call.
- MemoryStoreDefaultDefinition:
- type: object
- required:
- - kind
- - chat_model
- - embedding_model
- properties:
- kind:
- type: string
- enum:
- - default
- description: The kind of the memory store.
- chat_model:
- type: string
- description: The name or identifier of the chat completion model deployment used for memory processing.
- embedding_model:
- type: string
- description: The name or identifier of the embedding model deployment used for memory processing.
- options:
- $ref: '#/components/schemas/MemoryStoreDefaultOptions'
- description: Default memory store options.
- allOf:
- - $ref: '#/components/schemas/MemoryStoreDefinition'
- description: Default memory store implementation.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreDefaultOptions:
- type: object
- required:
- - user_profile_enabled
- - chat_summary_enabled
- properties:
- user_profile_enabled:
- type: boolean
- description: Whether to enable user profile extraction and storage. Default is true.
- default: true
- user_profile_details:
- type: string
- description: Specific categories or types of user profile information to extract and store.
- chat_summary_enabled:
- type: boolean
- description: Whether to enable chat summary extraction and storage. Defaults to `true`.
- default: true
- procedural_memory_enabled:
- type: boolean
- description: Whether to enable procedural memory extraction and storage. The service defaults to `true` if a value is not specified by the caller.
- default: true
- default_ttl_seconds:
- type: integer
- format: int32
- description: The default time-to-live for memories in seconds. A value of `0` indicates that memories do not expire. Defaults to `0`.
- default: 0
- description: Default memory store configurations.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreDefinition:
+ - static
+ x-stainless-const: true
+ static:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic'
+ OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic:
type: object
required:
- - kind
+ - max_chunk_size_tokens
+ - chunk_overlap_tokens
properties:
- kind:
- $ref: '#/components/schemas/MemoryStoreKind'
- description: The kind of the memory store.
- discriminator:
- propertyName: kind
- mapping:
- default: '#/components/schemas/MemoryStoreDefaultDefinition'
- description: Base definition for memory store configurations.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreDeleteScopeResponse:
+ max_chunk_size_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 100
+ maximum: 4096
+ chunk_overlap_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CreateTranscriptionRequest:
type: object
- required:
- - object
- - name
- - scope
- - deleted
properties:
- object:
- type: string
- enum:
- - memory_store.scope.deleted
- description: The object type. Always 'memory_store.scope.deleted'.
- name:
+ file:
+ description: 'The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.'
+ x-oaiTypeLabel: file
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - whisper-1
+ - gpt-4o-transcribe
+ - gpt-4o-mini-transcribe
+ - gpt-4o-mini-transcribe-2025-12-15
+ - gpt-4o-transcribe-diarize
+ description: ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`.
+ x-oaiTypeLabel: string
+ language:
type: string
- description: The name of the memory store.
- scope:
+ description: 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.
+ prompt:
type: string
- description: The scope from which memories were deleted.
- deleted:
- type: boolean
- description: Whether the deletion operation was successful.
- description: Response for deleting memories from a scope.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreKind:
- anyOf:
- - type: string
- - type: string
- enum:
- - default
- description: The type of memory store implementation to use.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreObject:
+ description: An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`.
+ response_format:
+ $ref: '#/components/schemas/OpenAI.AudioResponseFormat'
+ temperature:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: 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.
+ include:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionInclude'
+ description: |-
+ 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`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`.
+ timestamp_granularities:
+ type: array
+ items:
+ type: string
+ enum:
+ - word
+ - segment
+ description: |-
+ 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.
+ This option is not available for `gpt-4o-transcribe-diarize`.
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ chunking_strategy:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.VadConfig'
+ - type: 'null'
+ known_speaker_names:
+ $ref: '#/components/schemas/OpenAI.KnownSpeakerNames'
+ known_speaker_references:
+ $ref: '#/components/schemas/OpenAI.KnownSpeakerReferences'
+ required:
+ - file
+ - model
+ OpenAI.CreateTranscriptionResponseDiarizedJson:
type: object
required:
- - object
- - id
- - created_at
- - updated_at
- - name
- - definition
+ - task
+ - duration
+ - text
+ - segments
properties:
- object:
+ task:
type: string
enum:
- - memory_store
- description: The object type, which is always 'memory_store'.
- id:
- type: string
- description: The unique identifier of the memory store.
- created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The Unix timestamp (seconds) when the memory store was created.
- updated_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The Unix timestamp (seconds) when the memory store was last updated.
- name:
- type: string
- maxLength: 256
- description: The name of the memory store.
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the memory store.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Arbitrary key-value metadata to associate with the memory store.
- definition:
- $ref: '#/components/schemas/MemoryStoreDefinition'
- description: The definition of the memory store.
- description: A memory store that can store and retrieve user memories.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreOperationUsage:
- type: object
- required:
- - embedding_tokens
- - input_tokens
- - input_tokens_details
- - output_tokens
- - output_tokens_details
- - total_tokens
- properties:
- embedding_tokens:
+ - transcribe
+ description: The type of task that was run. Always `transcribe`.
+ x-stainless-const: true
+ duration:
type: integer
- format: int32
- description: The number of embedding tokens.
- input_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The number of input tokens.
- input_tokens_details:
- $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails'
- description: A detailed breakdown of the input tokens.
- output_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The number of output tokens.
- output_tokens_details:
- $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails'
- description: A detailed breakdown of the output tokens.
- total_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The total number of tokens used.
- description: Usage statistics of a memory store operation.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreSearchResponse:
+ format: int64
+ description: Duration of the input audio in seconds.
+ x-ms-duration: seconds
+ text:
+ type: string
+ description: The concatenated transcript text for the entire audio input.
+ segments:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionDiarizedSegment'
+ description: Segments of the transcript annotated with timestamps and speaker labels.
+ usage:
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage'
+ description: Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.
+ x-oaiMeta:
+ name: The transcription object (Diarized JSON)
+ group: audio
+ example: |
+ {
+ "task": "transcribe",
+ "duration": 42.7,
+ "text": "Agent: Thanks for calling OpenAI support.
+ Customer: Hi, I need help with diarization.",
+ "segments": [
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_001",
+ "start": 0.0,
+ "end": 5.2,
+ "text": "Thanks for calling OpenAI support.",
+ "speaker": "agent"
+ },
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_002",
+ "start": 5.2,
+ "end": 12.8,
+ "text": "Hi, I need help with diarization.",
+ "speaker": "A"
+ }
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 43
+ }
+ }
+ OpenAI.CreateTranscriptionResponseJson:
type: object
required:
- - search_id
- - memories
- - usage
+ - text
properties:
- search_id:
+ text:
type: string
- description: The unique ID of this search request. Use this value as previous_search_id in subsequent requests to perform incremental searches.
- memories:
+ description: The transcribed text.
+ logprobs:
type: array
items:
- $ref: '#/components/schemas/MemorySearchItem'
- description: Related memory items found during the search operation.
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonLogprobs'
+ description: 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.
usage:
- $ref: '#/components/schemas/MemoryStoreOperationUsage'
- description: Usage statistics associated with the memory search operation.
- description: Memory search response.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreUpdateCompletedResult:
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage'
+ description: Represents a transcription response returned by model, based on the provided input.
+ x-oaiMeta:
+ name: The transcription object (JSON)
+ group: audio
+ example: |
+ {
+ "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.",
+ "usage": {
+ "type": "tokens",
+ "input_tokens": 14,
+ "input_token_details": {
+ "text_tokens": 10,
+ "audio_tokens": 4
+ },
+ "output_tokens": 101,
+ "total_tokens": 115
+ }
+ }
+ OpenAI.CreateTranscriptionResponseJsonLogprobs:
type: object
- required:
- - memory_operations
- - usage
properties:
- memory_operations:
+ token:
+ type: string
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ bytes:
type: array
items:
- $ref: '#/components/schemas/MemoryOperation'
- description: A list of individual memory operations that were performed during the update.
- usage:
- $ref: '#/components/schemas/MemoryStoreOperationUsage'
- description: Usage statistics associated with the memory update operation.
- description: Memory update result.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreUpdateResponse:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.CreateTranscriptionResponseJsonUsage:
type: object
required:
- - update_id
- - status
+ - type
properties:
- update_id:
- type: string
- description: The unique ID of this update request. Use this value as previous_update_id in subsequent requests to perform incremental updates.
- status:
- $ref: '#/components/schemas/MemoryStoreUpdateStatus'
- description: The status of the memory update operation. One of "queued", "in_progress", "completed", "failed", or "superseded".
- superseded_by:
- type: string
- description: The update_id the operation was superseded by when status is "superseded".
- result:
- $ref: '#/components/schemas/MemoryStoreUpdateCompletedResult'
- description: The result of memory store update operation when status is "completed".
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error object that describes the error when status is "failed".
- description: Provides the status of a memory store update operation.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreUpdateStatus:
+ type:
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsageType'
+ discriminator:
+ propertyName: type
+ mapping:
+ duration: '#/components/schemas/OpenAI.TranscriptTextUsageDuration'
+ tokens: '#/components/schemas/OpenAI.TranscriptTextUsageTokens'
+ description: Token usage statistics for the request.
+ OpenAI.CreateTranscriptionResponseJsonUsageType:
anyOf:
- type: string
- type: string
enum:
- - queued
- - in_progress
- - completed
- - failed
- - superseded
- description: Status of a memory store update operation.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MicrosoftFabricPreviewTool:
+ - tokens
+ - duration
+ OpenAI.CreateTranscriptionResponseVerboseJson:
type: object
required:
- - type
- - fabric_dataagent_preview
+ - language
+ - duration
+ - text
properties:
- type:
+ language:
type: string
- enum:
- - fabric_dataagent_preview
- description: The object type, which is always 'fabric_dataagent_preview'.
- fabric_dataagent_preview:
- $ref: '#/components/schemas/FabricDataAgentToolParameters'
- description: The fabric data agent tool parameters.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for a Microsoft Fabric tool as used to configure an agent.
- ModelCredentialRequest:
+ description: The language of the input audio.
+ duration:
+ type: integer
+ format: int64
+ description: The duration of the input audio.
+ x-ms-duration: seconds
+ text:
+ type: string
+ description: The transcribed text.
+ words:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionWord'
+ description: Extracted words and their corresponding timestamps.
+ segments:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionSegment'
+ description: Segments of the transcribed text and their corresponding details.
+ usage:
+ $ref: '#/components/schemas/OpenAI.TranscriptTextUsageDuration'
+ description: Represents a verbose json transcription response returned by model, based on the provided input.
+ x-oaiMeta:
+ name: The transcription object (Verbose JSON)
+ group: audio
+ example: |
+ {
+ "task": "transcribe",
+ "language": "english",
+ "duration": 8.470000267028809,
+ "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
+ "segments": [
+ {
+ "id": 0,
+ "seek": 0,
+ "start": 0.0,
+ "end": 3.319999933242798,
+ "text": " The beach was a popular spot on a hot summer day.",
+ "tokens": [
+ 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530
+ ],
+ "temperature": 0.0,
+ "avg_logprob": -0.2860786020755768,
+ "compression_ratio": 1.2363636493682861,
+ "no_speech_prob": 0.00985979475080967
+ },
+ ...
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 9
+ }
+ }
+ OpenAI.CreateTranslationRequest:
type: object
- required:
- - blobUri
properties:
- blobUri:
+ file:
+ description: 'The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.'
+ x-oaiTypeLabel: file
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - whisper-1
+ description: ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available.
+ x-oaiTypeLabel: string
+ prompt:
type: string
- format: uri
- description: Blob URI of the model asset to fetch credentials for.
- description: Request to fetch credentials for a model asset.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- ModelDeployment:
+ description: An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should be in English.
+ response_format:
+ type: string
+ enum:
+ - json
+ - text
+ - srt
+ - verbose_json
+ - vtt
+ description: 'The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.'
+ temperature:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: 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.
+ required:
+ - file
+ - model
+ OpenAI.CreateTranslationResponseJson:
type: object
required:
- - type
- - modelName
- - modelVersion
- - modelPublisher
- - capabilities
- - sku
+ - text
properties:
- type:
- type: string
- enum:
- - ModelDeployment
- description: The type of the deployment
- modelName:
- type: string
- description: Publisher-specific name of the deployed model
- readOnly: true
- modelVersion:
- type: string
- description: Publisher-specific version of the deployed model
- readOnly: true
- modelPublisher:
- type: string
- description: Name of the deployed model's publisher
- readOnly: true
- capabilities:
- type: object
- unevaluatedProperties:
- type: string
- description: Capabilities of deployed model
- readOnly: true
- sku:
- $ref: '#/components/schemas/Sku'
- description: Sku of the model deployment
- readOnly: true
- connectionName:
+ text:
type: string
- description: Name of the connection the deployment comes from
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/Deployment'
- description: Model Deployment Definition
- ModelPendingUploadRequest:
+ OpenAI.CreateTranslationResponseVerboseJson:
type: object
required:
- - pendingUploadType
+ - language
+ - duration
+ - text
properties:
- pendingUploadId:
+ language:
type: string
- description: If PendingUploadId is not provided, a random GUID will be used.
- connectionName:
- type: string
- description: Azure Storage Account connection name to use for generating temporary SAS token
- pendingUploadType:
+ description: The language of the output translation (always `english`).
+ duration:
+ type: integer
+ format: int64
+ description: The duration of the input audio.
+ x-ms-duration: seconds
+ text:
type: string
- enum:
- - TemporaryBlobReference
- description: The type of pending upload. Only TemporaryBlobReference is supported for models.
- description: Represents a request for a pending upload of a model version.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- ModelPendingUploadResponse:
+ description: The translated text.
+ segments:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionSegment'
+ description: Segments of the translated text and their corresponding details.
+ OpenAI.CreateUploadRequest:
type: object
required:
- - blobReference
- - pendingUploadId
- - pendingUploadType
+ - filename
+ - purpose
+ - bytes
+ - mime_type
properties:
- blobReference:
- $ref: '#/components/schemas/BlobReference'
- description: Container-level read, write, list SAS.
- pendingUploadId:
- type: string
- description: ID for this upload request.
- version:
+ filename:
type: string
- description: Version of asset to be created if user did not specify version when initially creating upload
- pendingUploadType:
+ description: The name of the file to upload.
+ purpose:
type: string
enum:
- - TemporaryBlobReference
- description: The type of pending upload. Only TemporaryBlobReference is supported for models.
- description: Represents the response for a model pending upload request.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- ModelSamplingParams:
+ - assistants
+ - batch
+ - fine-tune
+ - vision
+ description: |-
+ The intended purpose of the uploaded file.
+ See the [documentation on File
+ purposes](/docs/api-reference/files/create#files-create-purpose).
+ bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of bytes in the file you are uploading.
+ mime_type:
+ type: string
+ description: |-
+ 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.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.FileExpirationAfter'
+ OpenAI.CreateVectorStoreFileBatchRequest:
type: object
properties:
- temperature:
- type: number
- format: float
- description: The temperature parameter for sampling. Defaults to 1.0.
- default: 1
- top_p:
- type: number
- format: float
- description: The top-p parameter for nucleus sampling. Defaults to 1.0.
- default: 1
- seed:
- type: integer
- format: int32
- description: The random seed for reproducibility. Defaults to 42.
- default: 42
- max_completion_tokens:
- type: integer
- format: int32
- description: The maximum number of tokens allowed in the completion.
- description: Represents a set of parameters used to control the sampling behavior of a language model during text generation.
- ModelSourceData:
+ file_ids:
+ type: array
+ items:
+ type: string
+ minItems: 1
+ maxItems: 2000
+ description: A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied to all files in the batch. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `files`.
+ files:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileRequest'
+ minItems: 1
+ maxItems: 2000
+ description: A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must be specified for each file. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `file_ids`.
+ chunking_strategy:
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ OpenAI.CreateVectorStoreFileRequest:
type: object
+ required:
+ - file_id
properties:
- sourceType:
- $ref: '#/components/schemas/FoundryModelSourceType'
- description: The source type of the model
- jobId:
+ file_id:
type: string
- description: The job ID that produced this model
- description: Source information for the model
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- ModelVersion:
+ description: A [File](/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. For multi-file ingestion, we recommend [`file_batches`](/docs/api-reference/vector-stores-file-batches/createBatch) to minimize per-vector-store write requests.
+ chunking_strategy:
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ OpenAI.CreateVectorStoreRequest:
type: object
- required:
- - blobUri
- - name
- - version
properties:
- blobUri:
- type: string
- format: uri
- description: URI of the model artifact in blob storage
- weightType:
- $ref: '#/components/schemas/FoundryModelWeightType'
- description: The weight type of the model
- baseModel:
- type: string
- description: Base model asset ID
- source:
- $ref: '#/components/schemas/ModelSourceData'
- description: The source of the model
- loraConfig:
- $ref: '#/components/schemas/LoraConfig'
- description: Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided values take precedence over auto-detected values.
- artifactProfile:
- $ref: '#/components/schemas/ArtifactProfile'
- description: The artifact profile of the model
- readOnly: true
- warnings:
+ file_ids:
type: array
items:
- $ref: '#/components/schemas/FoundryModelWarning'
- description: Service-computed advisory warnings derived from the artifact profile.
- readOnly: true
- id:
- type: string
- description: Asset ID, a unique identifier for the asset
- readOnly: true
+ type: string
+ maxItems: 500
+ description: A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files.
name:
type: string
- description: The name of the resource
- readOnly: true
- version:
- type: string
- description: The version of the resource
- readOnly: true
+ description: The name of the vector store.
description:
type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- description: Model Version Definition
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- MonthlyRecurrenceSchedule:
+ description: A description for the vector store. Can be used to describe the vector store's purpose.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter'
+ chunking_strategy:
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ description: 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.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateVideoCharacterBody:
type: object
- required:
- - type
- - daysOfMonth
properties:
- type:
+ video:
+ description: Video file used to create a character.
+ name:
type: string
- enum:
- - Monthly
- description: Monthly recurrence type.
- daysOfMonth:
- type: array
- items:
- type: integer
- format: int32
- description: Days of the month for the recurrence schedule.
- allOf:
- - $ref: '#/components/schemas/RecurrenceSchedule'
- description: Monthly recurrence schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- NoAuthenticationCredentials:
+ description: Display name for this API character.
+ required:
+ - video
+ - name
+ OpenAI.CreateVideoEditJsonBody:
type: object
required:
- - type
+ - video
+ - prompt
properties:
- type:
+ video:
+ $ref: '#/components/schemas/OpenAI.VideoReferenceInputParam'
+ description: Reference to the completed video to edit.
+ prompt:
type: string
- enum:
- - None
- description: 'The credential type '
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: Credentials that do not require authentication
- OAuthConsentRequestOutputItem:
+ minLength: 1
+ maxLength: 32000
+ description: Text prompt that describes how to edit the source video.
+ description: JSON parameters for editing an existing generated video.
+ title: Create video edit JSON request
+ OpenAI.CreateVideoEditMultipartBody:
type: object
- required:
- - id
- - type
- - consent_link
- - server_label
properties:
- id:
+ video:
+ $ref: '#/components/schemas/OpenAI.CreateVideoEditMultipartBodyVideo'
+ prompt:
type: string
- type:
+ description: Text prompt that describes how to edit the source video.
+ required:
+ - video
+ - prompt
+ OpenAI.CreateVideoEditMultipartBodyVideo:
+ oneOf:
+ - {}
+ - $ref: '#/components/schemas/OpenAI.VideoReferenceInputParam'
+ OpenAI.CreateVideoExtendJsonBody:
+ type: object
+ required:
+ - video
+ - prompt
+ - seconds
+ properties:
+ video:
+ $ref: '#/components/schemas/OpenAI.VideoReferenceInputParam'
+ description: Reference to the completed video to extend.
+ prompt:
type: string
- enum:
- - oauth_consent_request
- consent_link:
+ minLength: 1
+ maxLength: 32000
+ description: Updated text prompt that directs the extension generation.
+ seconds:
+ $ref: '#/components/schemas/OpenAI.VideoSeconds'
+ description: 'Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).'
+ description: JSON parameters for extending an existing generated video.
+ title: Create video extension JSON request
+ OpenAI.CreateVideoExtendMultipartBody:
+ type: object
+ properties:
+ video:
+ $ref: '#/components/schemas/OpenAI.CreateVideoExtendMultipartBodyVideo'
+ prompt:
type: string
- description: The link the user can use to perform OAuth consent.
- server_label:
+ description: Updated text prompt that directs the extension generation.
+ seconds:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoSeconds'
+ description: 'Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).'
+ required:
+ - video
+ - prompt
+ - seconds
+ OpenAI.CreateVideoExtendMultipartBodyVideo:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.VideoReferenceInputParam'
+ - {}
+ OpenAI.CreateVideoMultipartBody:
+ type: object
+ properties:
+ model:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoModel'
+ description: 'The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to `sora-2`.'
+ prompt:
type: string
- description: The server label for the OAuth consent request.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: Request from the service for the user to perform OAuth consent.
- OneTimeTrigger:
+ description: Text prompt that describes the video to generate.
+ input_reference:
+ $ref: '#/components/schemas/OpenAI.CreateVideoMultipartBodyInputReference'
+ seconds:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoSeconds'
+ description: 'Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.'
+ size:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoSize'
+ description: 'Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.'
+ required:
+ - prompt
+ OpenAI.CreateVideoMultipartBodyInputReference:
+ oneOf:
+ - {}
+ - $ref: '#/components/schemas/OpenAI.ImageRefParam'
+ OpenAI.CreateVideoRemixBody:
+ type: object
+ properties:
+ prompt:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoPrompt'
+ description: Updated text prompt that directs the remix generation.
+ required:
+ - prompt
+ OpenAI.CustomGrammarFormatParam:
type: object
required:
- type
- - triggerAt
+ - syntax
+ - definition
properties:
type:
type: string
enum:
- - OneTime
- triggerAt:
- type: string
- description: Date and time for the one-time trigger in ISO 8601 format.
- timeZone:
+ - grammar
+ description: Grammar format. Always `grammar`.
+ x-stainless-const: true
+ syntax:
+ $ref: '#/components/schemas/OpenAI.GrammarSyntax1'
+ description: The syntax of the grammar definition. One of `lark` or `regex`.
+ definition:
type: string
- description: Time zone for the one-time trigger. Defaults to `UTC`.
- default: UTC
+ description: The grammar definition.
allOf:
- - $ref: '#/components/schemas/Trigger'
- description: One-time trigger.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- OpenAI.Annotation:
+ - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
+ description: A grammar defined by the user.
+ title: Grammar format
+ OpenAI.CustomTextFormatParam:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.AnnotationType'
- discriminator:
- propertyName: type
- mapping:
- file_citation: '#/components/schemas/OpenAI.FileCitationBody'
- url_citation: '#/components/schemas/OpenAI.UrlCitationBody'
- container_file_citation: '#/components/schemas/OpenAI.ContainerFileCitationBody'
- file_path: '#/components/schemas/OpenAI.FilePath'
- description: An annotation that applies to a span of output text.
- OpenAI.AnnotationType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - file_citation
- - url_citation
- - container_file_citation
- - file_path
- OpenAI.ApplyPatchCallOutputStatus:
- type: string
- enum:
- - completed
- - failed
- OpenAI.ApplyPatchCallOutputStatusParam:
- type: string
- enum:
- - completed
- - failed
- description: Outcome values reported for apply_patch tool call outputs.
- title: Apply patch call output status
- OpenAI.ApplyPatchCallStatus:
- type: string
- enum:
- - in_progress
- - completed
- OpenAI.ApplyPatchCallStatusParam:
- type: string
- enum:
- - in_progress
- - completed
- description: Status values reported for apply_patch tool calls.
- title: Apply patch call status
- OpenAI.ApplyPatchCreateFileOperation:
+ - text
+ description: Unconstrained text format. Always `text`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
+ description: Unconstrained free-form text.
+ title: Text format
+ OpenAI.CustomToolChatCompletions:
type: object
required:
- type
- - path
- - diff
+ - custom
properties:
type:
type: string
enum:
- - create_file
- description: Create a new file with the provided diff.
+ - custom
+ description: The type of the custom tool. Always `custom`.
x-stainless-const: true
- path:
+ custom:
+ $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustom'
+ description: Properties of the custom tool.
+ title: Custom tool properties
+ description: A custom tool that processes input using a specified format.
+ title: Custom tool
+ OpenAI.CustomToolChatCompletionsCustom:
+ type: object
+ required:
+ - name
+ properties:
+ name:
type: string
- description: Path of the file to create.
- diff:
+ description:
type: string
- description: Diff to apply.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: Instruction describing how to create a file via the apply_patch tool.
- title: Apply patch create file operation
- OpenAI.ApplyPatchCreateFileOperationParam:
+ format:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatText'
+ - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammar'
+ OpenAI.CustomToolChatCompletionsCustomFormatGrammar:
type: object
required:
- type
- - path
- - diff
+ - grammar
properties:
type:
type: string
enum:
- - create_file
- description: The operation type. Always `create_file`.
+ - grammar
x-stainless-const: true
- path:
+ grammar:
+ $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar'
+ title: Grammar format
+ OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar:
+ type: object
+ required:
+ - definition
+ - syntax
+ properties:
+ definition:
type: string
- minLength: 1
- description: Path of the file to create relative to the workspace root.
- diff:
+ syntax:
type: string
- maxLength: 10485760
- description: Unified diff content to apply when creating the file.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: Instruction for creating a new file via the apply_patch tool.
- title: Apply patch create file operation
- OpenAI.ApplyPatchDeleteFileOperation:
+ enum:
+ - lark
+ - regex
+ OpenAI.CustomToolChatCompletionsCustomFormatText:
type: object
required:
- type
- - path
properties:
type:
type: string
enum:
- - delete_file
- description: Delete the specified file.
+ - text
x-stainless-const: true
- path:
- type: string
- description: Path of the file to delete.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: Instruction describing how to delete a file via the apply_patch tool.
- title: Apply patch delete file operation
- OpenAI.ApplyPatchDeleteFileOperationParam:
+ OpenAI.CustomToolParam:
type: object
required:
- type
- - path
+ - name
properties:
type:
type: string
enum:
- - delete_file
- description: The operation type. Always `delete_file`.
+ - custom
+ description: The type of the custom tool. Always `custom`.
x-stainless-const: true
- path:
+ name:
type: string
- minLength: 1
- description: Path of the file to delete relative to the workspace root.
+ description: The name of the custom tool, used to identify it in tool calls.
+ description:
+ type: string
+ description: Optional description of the custom tool, used to provide more context.
+ format:
+ $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
+ description: The input format for the custom tool. Default is unconstrained text.
+ defer_loading:
+ type: boolean
+ description: Whether this tool should be deferred and discovered via tool search.
allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: Instruction for deleting an existing file via the apply_patch tool.
- title: Apply patch delete file operation
- OpenAI.ApplyPatchFileOperation:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)
+ title: Custom tool
+ OpenAI.CustomToolParamFormat:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperationType'
+ $ref: '#/components/schemas/OpenAI.CustomToolParamFormatType'
discriminator:
propertyName: type
mapping:
- create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperation'
- delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation'
- update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation'
- description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
- title: Apply patch operation
- OpenAI.ApplyPatchFileOperationType:
+ text: '#/components/schemas/OpenAI.CustomTextFormatParam'
+ grammar: '#/components/schemas/OpenAI.CustomGrammarFormatParam'
+ description: The input format for the custom tool. Default is unconstrained text.
+ OpenAI.CustomToolParamFormatType:
anyOf:
- type: string
- type: string
enum:
- - create_file
- - delete_file
- - update_file
- OpenAI.ApplyPatchOperationParam:
+ - text
+ - grammar
+ OpenAI.DeleteAssistantResponse:
type: object
required:
- - type
+ - id
+ - deleted
+ - object
properties:
- type:
- $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParamType'
- discriminator:
- propertyName: type
- mapping:
- create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperationParam'
- delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperationParam'
- update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperationParam'
- description: One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.
- title: Apply patch operation
- OpenAI.ApplyPatchOperationParamType:
- anyOf:
- - type: string
- - type: string
+ id:
+ type: string
+ deleted:
+ type: boolean
+ object:
+ type: string
enum:
- - create_file
- - delete_file
- - update_file
- OpenAI.ApplyPatchToolParam:
+ - assistant.deleted
+ x-stainless-const: true
+ OpenAI.DeleteFileResponse:
type: object
required:
- - type
+ - id
+ - object
+ - deleted
properties:
- type:
+ id:
+ type: string
+ object:
type: string
enum:
- - apply_patch
- description: The type of the tool. Always `apply_patch`.
+ - file
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: Allows the assistant to create, delete, or update files using unified diffs.
- title: Apply patch tool
- OpenAI.ApplyPatchUpdateFileOperation:
+ deleted:
+ type: boolean
+ OpenAI.DeleteFineTuningCheckpointPermissionResponse:
type: object
required:
- - type
- - path
- - diff
+ - id
+ - object
+ - deleted
properties:
- type:
+ id:
+ type: string
+ description: The ID of the fine-tuned model checkpoint permission that was deleted.
+ object:
type: string
enum:
- - update_file
- description: Update an existing file with the provided diff.
+ - checkpoint.permission
+ description: The object type, which is always "checkpoint.permission".
x-stainless-const: true
- path:
+ deleted:
+ type: boolean
+ description: Whether the fine-tuned model checkpoint permission was successfully deleted.
+ OpenAI.DeleteMessageResponse:
+ type: object
+ required:
+ - id
+ - deleted
+ - object
+ properties:
+ id:
type: string
- description: Path of the file to update.
- diff:
+ deleted:
+ type: boolean
+ object:
type: string
- description: Diff to apply.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: Instruction describing how to update a file via the apply_patch tool.
- title: Apply patch update file operation
- OpenAI.ApplyPatchUpdateFileOperationParam:
+ enum:
+ - thread.message.deleted
+ x-stainless-const: true
+ OpenAI.DeleteModelResponse:
type: object
required:
- - type
- - path
- - diff
+ - id
+ - deleted
+ - object
properties:
- type:
+ id:
+ type: string
+ deleted:
+ type: boolean
+ object:
+ type: string
+ OpenAI.DeleteThreadResponse:
+ type: object
+ required:
+ - id
+ - deleted
+ - object
+ properties:
+ id:
+ type: string
+ deleted:
+ type: boolean
+ object:
type: string
enum:
- - update_file
- description: The operation type. Always `update_file`.
+ - thread.deleted
x-stainless-const: true
- path:
+ OpenAI.DeleteVectorStoreFileResponse:
+ type: object
+ required:
+ - id
+ - deleted
+ - object
+ properties:
+ id:
type: string
- minLength: 1
- description: Path of the file to update relative to the workspace root.
- diff:
+ deleted:
+ type: boolean
+ object:
type: string
- maxLength: 10485760
- description: Unified diff content to apply to the existing file.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: Instruction for updating an existing file via the apply_patch tool.
- title: Apply patch update file operation
- OpenAI.ApproximateLocation:
+ enum:
+ - vector_store.file.deleted
+ x-stainless-const: true
+ OpenAI.DeleteVectorStoreResponse:
type: object
required:
- - type
+ - id
+ - deleted
+ - object
properties:
- type:
+ id:
+ type: string
+ deleted:
+ type: boolean
+ object:
type: string
enum:
- - approximate
- description: The type of location approximation. Always `approximate`.
+ - vector_store.deleted
x-stainless-const: true
- default: approximate
- country:
- anyOf:
- - type: string
- - type: 'null'
- region:
- anyOf:
- - type: string
- - type: 'null'
- city:
- anyOf:
- - type: string
- - type: 'null'
- timezone:
- anyOf:
- - type: string
- - type: 'null'
- OpenAI.AutoCodeInterpreterToolParam:
+ OpenAI.DeletedConversationResource:
type: object
required:
- - type
+ - object
+ - deleted
+ - id
properties:
- type:
+ object:
type: string
enum:
- - auto
- description: Always `auto`.
+ - conversation.deleted
x-stainless-const: true
- default: auto
- file_ids:
- type: array
- items:
- type: string
- maxItems: 50
- description: An optional list of uploaded files to make available to your code.
- memory_limit:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit'
- - type: 'null'
- network_policy:
- $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
- description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
- title: Automatic Code Interpreter Tool Parameters
- OpenAI.ChatCompletionTool:
+ default: conversation.deleted
+ deleted:
+ type: boolean
+ id:
+ type: string
+ OpenAI.DeletedVideoResource:
type: object
required:
- - type
- - function
+ - object
+ - deleted
+ - id
properties:
- type:
+ object:
type: string
enum:
- - function
- description: The type of the tool. Currently, only `function` is supported.
+ - video.deleted
+ description: The object type that signals the deletion response.
x-stainless-const: true
- function:
- $ref: '#/components/schemas/OpenAI.FunctionObject'
- description: A function tool that can be used to generate a response.
- title: Function tool
- OpenAI.ChatModel:
- type: string
- enum:
- - gpt-5.4
- - gpt-5.4-mini
- - gpt-5.4-nano
- - gpt-5.4-mini-2026-03-17
- - gpt-5.4-nano-2026-03-17
- - gpt-5.3-chat-latest
- - gpt-5.2
- - gpt-5.2-2025-12-11
- - gpt-5.2-chat-latest
- - gpt-5.2-pro
- - gpt-5.2-pro-2025-12-11
- - gpt-5.1
- - gpt-5.1-2025-11-13
- - gpt-5.1-codex
- - gpt-5.1-mini
- - gpt-5.1-chat-latest
- - 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-5-chat-latest
- - 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
- - o4-mini
- - o4-mini-2025-04-16
- - o3
- - o3-2025-04-16
- - o3-mini
- - o3-mini-2025-01-31
- - o1
- - o1-2024-12-17
- - o1-preview
- - o1-preview-2024-09-12
- - o1-mini
- - o1-mini-2024-09-12
- - gpt-4o
- - gpt-4o-2024-11-20
- - gpt-4o-2024-08-06
- - gpt-4o-2024-05-13
- - gpt-4o-audio-preview
- - gpt-4o-audio-preview-2024-10-01
- - gpt-4o-audio-preview-2024-12-17
- - gpt-4o-audio-preview-2025-06-03
- - gpt-4o-mini-audio-preview
- - gpt-4o-mini-audio-preview-2024-12-17
- - gpt-4o-search-preview
- - gpt-4o-mini-search-preview
- - gpt-4o-search-preview-2025-03-11
- - gpt-4o-mini-search-preview-2025-03-11
- - chatgpt-4o-latest
- - codex-mini-latest
- - gpt-4o-mini
- - gpt-4o-mini-2024-07-18
- - 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-0301
- - gpt-3.5-turbo-0613
- - gpt-3.5-turbo-1106
- - gpt-3.5-turbo-0125
- - gpt-3.5-turbo-16k-0613
- OpenAI.ClickButtonType:
+ default: video.deleted
+ deleted:
+ type: boolean
+ description: Indicates that the video resource was deleted.
+ id:
+ type: string
+ description: Identifier of the deleted video.
+ description: Confirmation payload returned after deleting a video.
+ title: Deleted video response
+ OpenAI.DetailEnum:
type: string
enum:
- - left
- - right
- - wheel
- - back
- - forward
- OpenAI.ClickParam:
+ - low
+ - high
+ - auto
+ - original
+ OpenAI.DoubleClickAction:
type: object
required:
- type
- - button
- x
- 'y'
+ - keys
properties:
type:
type: string
enum:
- - click
- description: Specifies the event type. For a click action, this property is always `click`.
+ - double_click
+ description: Specifies the event type. For a double click action, this property is always set to `double_click`.
x-stainless-const: true
- button:
- $ref: '#/components/schemas/OpenAI.ClickButtonType'
- description: Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
x:
$ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate where the click occurred.
+ description: The x-coordinate where the double click occurred.
'y':
$ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate where the click occurred.
+ description: The y-coordinate where the double click occurred.
keys:
anyOf:
- type: array
@@ -18682,1769 +52812,2183 @@ components:
- type: 'null'
allOf:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A click action.
- title: Click
- OpenAI.CodeInterpreterOutputImage:
+ description: A double click action.
+ title: DoubleClick
+ OpenAI.DragParam:
type: object
required:
- type
- - url
+ - path
properties:
type:
type: string
enum:
- - image
- description: The type of the output. Always `image`.
+ - drag
+ description: Specifies the event type. For a drag action, this property is always set to `drag`.
x-stainless-const: true
- default: image
- url:
- type: string
- format: uri
- description: The URL of the image output from the code interpreter.
- description: The image output from the code interpreter.
- title: Code interpreter output image
- OpenAI.CodeInterpreterOutputLogs:
+ path:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CoordParam'
+ description: |-
+ 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 }
+ ]
+ ```
+ keys:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A drag action.
+ title: Drag
+ OpenAI.EasyInputMessage:
type: object
required:
+ - role
+ - content
- type
- - logs
properties:
- type:
+ role:
type: string
enum:
- - logs
- description: The type of the output. Always `logs`.
- x-stainless-const: true
- default: logs
- logs:
- type: string
- description: The logs output from the code interpreter.
- description: The logs output from the code interpreter.
- title: Code interpreter output logs
- OpenAI.CodeInterpreterTool:
- type: object
- required:
- - type
- properties:
+ - user
+ - assistant
+ - system
+ - developer
+ description: |-
+ The role of the message input. One of `user`, `assistant`, `system`, or
+ `developer`.
+ content:
+ oneOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.InputMessageContentList'
+ description: |-
+ Text, image, or audio input to the model, used to generate a response.
+ Can also contain previous assistant responses.
+ phase:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
+ - type: 'null'
type:
type: string
enum:
- - code_interpreter
- description: The type of the code interpreter tool. Always `code_interpreter`.
+ - message
+ description: The type of the message input. Always `message`.
x-stainless-const: true
- name:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
+ status:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- container:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.AutoCodeInterpreterToolParam'
+ enum:
+ - in_progress
+ - completed
+ - incomplete
description: |-
- The code interpreter container. Can be a container ID or an object that
- specifies uploaded file IDs to make available to your code, along with an
- optional `memory_limit` setting.
- If not provided, the service assumes auto.
+ The status of item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that runs Python code to help generate a response to a prompt.
- title: Code interpreter
- OpenAI.CompactResource:
- type: object
- required:
- - id
- - object
- - output
- - created_at
- - usage
- properties:
- id:
- type: string
- description: The unique identifier for the compacted response.
- object:
- type: string
- enum:
- - response.compaction
- description: The object type. Always `response.compaction`.
- x-stainless-const: true
- default: response.compaction
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ItemField'
- description: The compacted list of output items.
- created_at:
- type: integer
- format: unixtime
- description: Unix timestamp (in seconds) when the compacted conversation was created.
- usage:
- $ref: '#/components/schemas/OpenAI.ResponseUsage'
- description: Token accounting for the compaction pass, including cached, reasoning, and total tokens.
- title: The compacted response object
- OpenAI.CompactResponseMethodPublicBody:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ 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.
+ title: Input message
+ OpenAI.EditImageBodyJsonParam:
type: object
required:
- - model
+ - images
+ - prompt
properties:
model:
- $ref: '#/components/schemas/OpenAI.ModelIdsCompaction'
- input:
anyOf:
- type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputItem'
+ - type: string
+ enum:
+ - gpt-image-1.5
+ - gpt-image-1
+ - gpt-image-1-mini
+ - chatgpt-image-latest
+ - type: 'null'
+ description: The model to use for image editing.
+ x-oaiTypeLabel: string
+ default: gpt-image-1.5
+ images:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ImageRefParam'
+ minItems: 1
+ maxItems: 16
+ description: |-
+ Input image references to edit.
+ For GPT image models, you can provide up to 16 images.
+ mask:
+ $ref: '#/components/schemas/OpenAI.ImageRefParam'
+ prompt:
+ type: string
+ minLength: 1
+ maxLength: 32000
+ description: A text description of the desired image edit.
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The number of edited images to generate.
+ default: 1
+ quality:
+ anyOf:
+ - type: string
+ enum:
+ - low
+ - medium
+ - high
+ - auto
- type: 'null'
- previous_response_id:
+ description: Output quality for GPT image models.
+ default: auto
+ input_fidelity:
anyOf:
- type: string
+ enum:
+ - high
+ - low
- type: 'null'
- instructions:
+ description: Controls fidelity to the original input image(s).
+ size:
anyOf:
- type: string
+ enum:
+ - auto
+ - 1024x1024
+ - 1536x1024
+ - 1024x1536
- type: 'null'
- prompt_cache_key:
+ description: Requested output image size.
+ default: auto
+ user:
+ type: string
+ description: |-
+ A unique identifier representing your end-user, which can help OpenAI
+ monitor and detect abuse.
+ output_format:
anyOf:
- type: string
+ enum:
+ - png
+ - jpeg
+ - webp
- type: 'null'
- prompt_cache_retention:
+ description: Output image format. Supported for GPT image models.
+ default: png
+ output_compression:
anyOf:
- - $ref: '#/components/schemas/OpenAI.PromptCacheRetentionEnum'
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- service_tier:
+ description: Compression level for `jpeg` or `webp` output.
+ moderation:
anyOf:
- - $ref: '#/components/schemas/OpenAI.ServiceTierEnum'
+ - type: string
+ enum:
+ - low
+ - auto
- type: 'null'
- OpenAI.ComparisonFilter:
- type: object
- required:
- - type
- - key
- - value
- properties:
- type:
- type: string
- enum:
- - eq
- - ne
- - gt
- - gte
- - lt
- - lte
- - in
- - nin
- description: |-
- Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.
- - `eq`: equals
- - `ne`: not equal
- - `gt`: greater than
- - `gte`: greater than or equal
- - `lt`: less than
- - `lte`: less than or equal
- - `in`: in
- - `nin`: not in
- default: eq
- key:
- type: string
- description: The key to compare against the value.
- value:
- oneOf:
+ description: Moderation level for GPT image models.
+ default: auto
+ background:
+ anyOf:
- type: string
- - $ref: '#/components/schemas/OpenAI.numeric'
+ enum:
+ - transparent
+ - opaque
+ - auto
+ - type: 'null'
+ description: Background behavior for generated image output.
+ default: auto
+ stream:
+ anyOf:
- type: boolean
- - type: array
- items:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: The value to compare against the attribute key; supports string, number, or boolean types.
- description: A filter used to compare a specified attribute key to a given value using a defined comparison operation.
- title: Comparison Filter
- x-oaiMeta:
- name: ComparisonFilter
- OpenAI.CompoundFilter:
+ - type: 'null'
+ description: Stream partial image results as events.
+ partial_images:
+ $ref: '#/components/schemas/OpenAI.PartialImages'
+ description: |-
+ JSON request body for image edits.
+ Use `images` (array of `ImageRefParam`) instead of multipart `image` uploads.
+ You can reference images via external URLs, data URLs, or uploaded file IDs.
+ JSON edits support GPT image models only; DALL-E edits require multipart (`dall-e-2` only).
+ OpenAI.Embedding:
type: object
required:
- - type
- - filters
+ - index
+ - embedding
+ - object
properties:
- type:
- type: string
- enum:
- - and
- - or
- description: 'Type of operation: `and` or `or`.'
- filters:
+ index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the embedding in the list of embeddings.
+ embedding:
type: array
items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
- - {}
- description: Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
- description: Combine multiple filters using `and` or `or`.
- title: Compound Filter
+ type: number
+ format: float
+ description: The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings).
+ object:
+ type: string
+ enum:
+ - embedding
+ description: The object type, which is always "embedding".
+ x-stainless-const: true
+ description: Represents an embedding vector returned by embedding endpoint.
x-oaiMeta:
- name: CompoundFilter
- OpenAI.ComputerAction:
+ name: The embedding object
+ example: |
+ {
+ "object": "embedding",
+ "embedding": [
+ 0.0023064255,
+ -0.009327292,
+ .... (1536 floats total for ada-002)
+ -0.0028842222,
+ ],
+ "index": 0
+ }
+ OpenAI.EmptyModelParam:
type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.ComputerActionType'
- discriminator:
- propertyName: type
- mapping:
- click: '#/components/schemas/OpenAI.ClickParam'
- double_click: '#/components/schemas/OpenAI.DoubleClickAction'
- drag: '#/components/schemas/OpenAI.DragParam'
- keypress: '#/components/schemas/OpenAI.KeyPressAction'
- move: '#/components/schemas/OpenAI.MoveParam'
- screenshot: '#/components/schemas/OpenAI.ScreenshotParam'
- scroll: '#/components/schemas/OpenAI.ScrollParam'
- type: '#/components/schemas/OpenAI.TypeParam'
- wait: '#/components/schemas/OpenAI.WaitParam'
- OpenAI.ComputerActionList:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: |-
- Flattened batched actions for `computer_use`. Each action includes an
- `type` discriminator and action-specific fields.
- title: Computer Action List
- OpenAI.ComputerActionType:
- anyOf:
- - type: string
- - type: string
- enum:
- - click
- - double_click
- - drag
- - keypress
- - move
- - screenshot
- - scroll
- - type
- - wait
- OpenAI.ComputerCallSafetyCheckParam:
+ OpenAI.Error:
type: object
required:
- - id
+ - code
+ - message
properties:
- id:
- type: string
- description: The ID of the pending safety check.
code:
anyOf:
- type: string
- type: 'null'
message:
+ type: string
+ param:
anyOf:
- type: string
- type: 'null'
- description: A pending safety check for the computer call.
- OpenAI.ComputerEnvironment:
- type: string
- enum:
- - windows
- - mac
- - linux
- - ubuntu
- - browser
- OpenAI.ComputerScreenshotContent:
+ type:
+ type: string
+ details:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Error'
+ additionalInfo:
+ type: object
+ unevaluatedProperties: {}
+ debugInfo:
+ type: object
+ unevaluatedProperties: {}
+ OpenAI.Error-2:
type: object
required:
- - type
- - image_url
- - file_id
- - detail
+ - code
+ - message
properties:
- type:
+ code:
type: string
- enum:
- - computer_screenshot
- description: Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.
- x-stainless-const: true
- image_url:
- anyOf:
- - type: string
- format: uri
- - type: 'null'
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
- allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A screenshot of a computer.
- title: Computer screenshot
- OpenAI.ComputerScreenshotImage:
+ description: A machine-readable error code that was returned.
+ message:
+ type: string
+ description: A human-readable description of the error that was returned.
+ description: An error that occurred while generating the response.
+ title: Error
+ OpenAI.EvalApiError:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: string
+ description: The error code.
+ message:
+ type: string
+ description: The error message.
+ description: An object representing an error response from the Eval API.
+ title: EvalApiError
+ x-oaiMeta:
+ name: The API error object
+ group: evals
+ example: |
+ {
+ "code": "internal_error",
+ "message": "The eval run failed due to an internal error."
+ }
+ OpenAI.EvalGraderLabelModel:
type: object
required:
- type
+ - name
+ - model
+ - input
+ - labels
+ - passing_labels
properties:
type:
type: string
enum:
- - computer_screenshot
- description: |-
- Specifies the event type. For a computer screenshot, this property is
- always set to `computer_screenshot`.
+ - label_model
+ description: The object type, which is always `label_model`.
x-stainless-const: true
- default: computer_screenshot
- image_url:
+ name:
type: string
- format: uri
- description: The URL of the screenshot image.
- file_id:
+ description: The name of the grader.
+ model:
type: string
- description: The identifier of an uploaded file that contains the screenshot.
- description: A computer screenshot image used with the computer use tool.
- OpenAI.ComputerTool:
+ description: The model to use for the evaluation. Must support structured outputs.
+ input:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalItem'
+ labels:
+ type: array
+ items:
+ type: string
+ description: The labels to assign to each item in the evaluation.
+ passing_labels:
+ type: array
+ items:
+ type: string
+ description: The labels that indicate a passing result. Must be a subset of labels.
+ title: LabelModelGrader
+ OpenAI.EvalGraderPython:
type: object
required:
- type
+ - name
+ - source
properties:
type:
type: string
enum:
- - computer
- description: The type of the computer tool. Always `computer`.
+ - python
+ description: The object type, which is always `python`.
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
- title: Computer
- OpenAI.ComputerUsePreviewTool:
+ name:
+ type: string
+ description: The name of the grader.
+ source:
+ type: string
+ description: The source code of the python script.
+ image_tag:
+ type: string
+ description: The image tag to use for the python script.
+ pass_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The threshold for the score.
+ title: PythonGrader
+ OpenAI.EvalGraderScoreModel:
type: object
required:
- type
- - environment
- - display_width
- - display_height
+ - name
+ - model
+ - input
properties:
type:
type: string
enum:
- - computer_use_preview
- description: The type of the computer use tool. Always `computer_use_preview`.
+ - score_model
+ description: The object type, which is always `score_model`.
x-stainless-const: true
- environment:
- $ref: '#/components/schemas/OpenAI.ComputerEnvironment'
- description: The type of computer environment to control.
- display_width:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The width of the computer display.
- display_height:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The height of the computer display.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
- title: Computer use preview
- OpenAI.ContainerAutoParam:
+ name:
+ type: string
+ description: The name of the grader.
+ model:
+ type: string
+ description: The model to use for the evaluation.
+ sampling_params:
+ $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams'
+ description: The sampling parameters for the model.
+ input:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalItem'
+ description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
+ range:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The range of the score. Defaults to `[0, 1]`.
+ pass_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The threshold for the score.
+ title: ScoreModelGrader
+ OpenAI.EvalGraderScoreModelSamplingParams:
+ type: object
+ properties:
+ seed:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ max_completions_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ OpenAI.EvalGraderStringCheck:
type: object
required:
- type
+ - name
+ - input
+ - reference
+ - operation
properties:
type:
type: string
enum:
- - container_auto
- description: Automatically creates a container for this request
+ - string_check
+ description: The object type, which is always `string_check`.
x-stainless-const: true
- file_ids:
- type: array
- items:
- type: string
- maxItems: 50
- description: An optional list of uploaded files to make available to your code.
- memory_limit:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit'
- - type: 'null'
- skills:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ContainerSkill'
- maxItems: 200
- description: An optional list of skills referenced by id or inline data.
- network_policy:
- $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
- allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
- OpenAI.ContainerFileCitationBody:
+ name:
+ type: string
+ description: The name of the grader.
+ input:
+ type: string
+ description: The input text. This may include template strings.
+ reference:
+ type: string
+ description: The reference text. This may include template strings.
+ operation:
+ type: string
+ enum:
+ - eq
+ - ne
+ - like
+ - ilike
+ description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
+ title: StringCheckGrader
+ OpenAI.EvalGraderTextSimilarity:
type: object
required:
- type
- - container_id
- - file_id
- - start_index
- - end_index
- - filename
+ - name
+ - input
+ - reference
+ - evaluation_metric
+ - pass_threshold
properties:
type:
type: string
enum:
- - container_file_citation
- description: The type of the container file citation. Always `container_file_citation`.
+ - text_similarity
+ description: The type of grader.
x-stainless-const: true
- container_id:
+ default: text_similarity
+ name:
type: string
- description: The ID of the container file.
- file_id:
+ description: The name of the grader.
+ input:
type: string
- description: The ID of the file.
- start_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the first character of the container file citation in the message.
- end_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the last character of the container file citation in the message.
- filename:
+ description: The text being graded.
+ reference:
type: string
- description: The filename of the container file cited.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Annotation'
- description: A citation for a container file used to generate a model response.
- title: Container file citation
- OpenAI.ContainerMemoryLimit:
- type: string
- enum:
- - 1g
- - 4g
- - 16g
- - 64g
- OpenAI.ContainerNetworkPolicyAllowlistParam:
+ description: The text being graded against.
+ evaluation_metric:
+ type: string
+ enum:
+ - cosine
+ - fuzzy_match
+ - bleu
+ - gleu
+ - meteor
+ - rouge_1
+ - rouge_2
+ - rouge_3
+ - rouge_4
+ - rouge_5
+ - rouge_l
+ description: |-
+ 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`.
+ pass_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The threshold for the score.
+ title: TextSimilarityGrader
+ OpenAI.EvalItem:
type: object
required:
- - type
- - allowed_domains
+ - role
+ - content
properties:
- type:
+ role:
type: string
enum:
- - allowlist
- description: Allow outbound network access only to specified domains. Always `allowlist`.
- x-stainless-const: true
- allowed_domains:
- type: array
- items:
- type: string
- minItems: 1
- description: A list of allowed domains when type is `allowlist`.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
- OpenAI.ContainerNetworkPolicyDisabledParam:
- type: object
- required:
- - type
- properties:
+ - user
+ - assistant
+ - system
+ - developer
+ description: |-
+ The role of the message input. One of `user`, `assistant`, `system`, or
+ `developer`.
+ content:
+ $ref: '#/components/schemas/OpenAI.EvalItemContent'
type:
type: string
enum:
- - disabled
- description: Disable outbound network access. Always `disabled`.
+ - message
+ description: The type of the message input. Always `message`.
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
- OpenAI.ContainerNetworkPolicyParam:
+ description: |-
+ 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.
+ title: Eval message object
+ OpenAI.EvalItemContent:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItem'
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentArray'
+ description: Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
+ title: Eval content
+ OpenAI.EvalItemContentArray:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalItemContentItem'
+ description: |-
+ A list of inputs, each of which may be either an input text, output text, input
+ image, or input audio object.
+ title: An array of Input text, Output text, Input image, and Input audio
+ OpenAI.EvalItemContentItem:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentText'
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: 'A single content item: input text, output text, input image, or input audio.'
+ title: Eval content item
+ OpenAI.EvalItemContentItemObject:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParamType'
+ $ref: '#/components/schemas/OpenAI.EvalItemContentItemObjectType'
discriminator:
propertyName: type
mapping:
- disabled: '#/components/schemas/OpenAI.ContainerNetworkPolicyDisabledParam'
- allowlist: '#/components/schemas/OpenAI.ContainerNetworkPolicyAllowlistParam'
- description: Network access policy for the container.
- OpenAI.ContainerNetworkPolicyParamType:
- anyOf:
- - type: string
- - type: string
- enum:
- - disabled
- - allowlist
- OpenAI.ContainerReferenceResource:
+ output_text: '#/components/schemas/OpenAI.EvalItemContentOutputText'
+ input_image: '#/components/schemas/OpenAI.EvalItemInputImage'
+ input_audio: '#/components/schemas/OpenAI.InputAudio'
+ input_text: '#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent'
+ description: 'A single content item: input text, output text, input image, or input audio.'
+ title: Eval content item
+ OpenAI.EvalItemContentItemObjectInputTextContent:
type: object
required:
- type
- - container_id
+ - text
properties:
type:
type: string
enum:
- - container_reference
- description: The environment type. Always `container_reference`.
+ - input_text
+ description: The type of the input item. Always `input_text`.
x-stainless-const: true
- container_id:
+ default: input_text
+ text:
type: string
+ description: The text input to the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
- description: Represents a container created with /v1/containers.
- title: Container Reference
- OpenAI.ContainerSkill:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.ContainerSkillType'
- discriminator:
- propertyName: type
- mapping:
- skill_reference: '#/components/schemas/OpenAI.SkillReferenceParam'
- inline: '#/components/schemas/OpenAI.InlineSkillParam'
- OpenAI.ContainerSkillType:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: A text input to the model.
+ title: Input text
+ OpenAI.EvalItemContentItemObjectType:
anyOf:
- type: string
- type: string
enum:
- - skill_reference
- - inline
- OpenAI.ContextManagementParam:
- type: object
- required:
- - type
- properties:
- type:
- type: string
- description: The context management entry type. Currently only 'compaction' is supported.
- compact_threshold:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- OpenAI.ConversationItem:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.ConversationItemType'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OpenAI.ConversationItemMessage'
- function_call: '#/components/schemas/OpenAI.ConversationItemFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutput'
- file_search_call: '#/components/schemas/OpenAI.ConversationItemFileSearchToolCall'
- web_search_call: '#/components/schemas/OpenAI.ConversationItemWebSearchToolCall'
- image_generation_call: '#/components/schemas/OpenAI.ConversationItemImageGenToolCall'
- computer_call: '#/components/schemas/OpenAI.ConversationItemComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.ConversationItemComputerToolCallOutput'
- tool_search_call: '#/components/schemas/OpenAI.ConversationItemToolSearchCall'
- tool_search_output: '#/components/schemas/OpenAI.ConversationItemToolSearchOutput'
- additional_tools: '#/components/schemas/OpenAI.ConversationItemAdditionalTools'
- reasoning: '#/components/schemas/OpenAI.ConversationItemReasoningItem'
- compaction: '#/components/schemas/OpenAI.ConversationItemCompactionBody'
- code_interpreter_call: '#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.ConversationItemFunctionShellCall'
- shell_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput'
- apply_patch_call: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall'
- apply_patch_call_output: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput'
- mcp_list_tools: '#/components/schemas/OpenAI.ConversationItemMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource'
- mcp_call: '#/components/schemas/OpenAI.ConversationItemMcpToolCall'
- custom_tool_call: '#/components/schemas/OpenAI.ConversationItemCustomToolCallResource'
- custom_tool_call_output: '#/components/schemas/OpenAI.ConversationItemCustomToolCallOutputResource'
- description: A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](/docs/api-reference/responses/object#responses/object-output).
- title: Conversation item
- OpenAI.ConversationItemAdditionalTools:
+ - input_text
+ - output_text
+ - input_image
+ - input_audio
+ OpenAI.EvalItemContentOutputText:
type: object
required:
- type
- - id
- - role
- - tools
+ - text
properties:
type:
type: string
enum:
- - additional_tools
- description: The type of the item. Always `additional_tools`.
+ - output_text
+ description: The type of the output text. Always `output_text`.
x-stainless-const: true
- default: additional_tools
- id:
+ text:
type: string
- description: The unique ID of the additional tools item.
- role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role that provided the additional tools.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The additional tool definitions made available at this item.
+ description: The text output from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- OpenAI.ConversationItemApplyPatchToolCall:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: A text output from the model.
+ title: Output text
+ OpenAI.EvalItemContentText:
+ type: string
+ description: A text input to the model.
+ title: Text input
+ OpenAI.EvalItemInputImage:
type: object
required:
- type
- - id
- - call_id
- - status
- - operation
+ - image_url
properties:
type:
type: string
enum:
- - apply_patch_call
- description: The type of the item. Always `apply_patch_call`.
+ - input_image
+ description: The type of the image input. Always `input_image`.
x-stainless-const: true
- default: apply_patch_call
- id:
- type: string
- description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
- call_id:
+ image_url:
type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
- description: The status of the apply patch tool call. One of `in_progress` or `completed`.
- operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
- title: Apply patch operation
- created_by:
+ format: uri
+ description: The URL of the image input.
+ detail:
type: string
- description: The ID of the entity that created this tool call.
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A tool call that applies file diffs by creating, deleting, or updating files.
- title: Apply patch tool call
- OpenAI.ConversationItemApplyPatchToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: An image input block used within EvalItem content arrays.
+ title: Input image
+ OpenAI.EvalJsonlFileContentSource:
type: object
required:
- type
- - id
- - call_id
- - status
+ - content
properties:
type:
type: string
enum:
- - apply_patch_call_output
- description: The type of the item. Always `apply_patch_call_output`.
+ - file_content
+ description: The type of jsonl source. Always `file_content`.
x-stainless-const: true
- default: apply_patch_call_output
- id:
- type: string
- description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
- description: The status of the apply patch tool call output. One of `completed` or `failed`.
- output:
- anyOf:
- - type: string
- - type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call output.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: The output emitted by an apply patch tool call.
- title: Apply patch tool call output
- OpenAI.ConversationItemCodeInterpreterToolCall:
+ default: file_content
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent'
+ description: The content of the jsonl file.
+ title: EvalJsonlFileContentSource
+ OpenAI.EvalJsonlFileContentSourceContent:
+ type: object
+ required:
+ - item
+ properties:
+ item:
+ type: object
+ unevaluatedProperties: {}
+ sample:
+ type: object
+ unevaluatedProperties: {}
+ OpenAI.EvalJsonlFileIdSource:
type: object
required:
- type
- id
- - status
- - container_id
- - code
- - outputs
properties:
type:
type: string
enum:
- - code_interpreter_call
- description: The type of the code interpreter tool call. Always `code_interpreter_call`.
+ - file_id
+ description: The type of jsonl source. Always `file_id`.
x-stainless-const: true
- default: code_interpreter_call
+ default: file_id
id:
type: string
- description: The unique ID of the code interpreter tool call.
- status:
+ description: The identifier of the file.
+ title: EvalJsonlFileIdSource
+ OpenAI.EvalResponsesSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
type: string
enum:
- - in_progress
- - completed
- - incomplete
- - interpreting
- - failed
- description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
- container_id:
- type: string
- description: The ID of the container used to run the code.
- code:
+ - responses
+ description: The type of run data source. Always `responses`.
+ metadata:
+ anyOf:
+ - type: object
+ unevaluatedProperties: {}
+ - type: 'null'
+ model:
anyOf:
- type: string
- type: 'null'
- outputs:
+ instructions_search:
+ anyOf:
+ - type: string
+ - type: 'null'
+ created_after:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ created_before:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ description: Optional reasoning effort parameter. This is a query parameter used to select responses.
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ users:
anyOf:
- type: array
items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
+ type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A tool call to run code.
- title: Code interpreter tool call
- OpenAI.ConversationItemCompactionBody:
+ tools:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: 'null'
+ description: A EvalResponsesSource object describing a run data source configuration.
+ title: EvalResponsesSource
+ x-oaiMeta:
+ name: The run data source object used to configure an individual run
+ group: eval runs
+ example: |
+ {
+ "type": "responses",
+ "model": "gpt-4o-mini-2024-07-18",
+ "temperature": 0.7,
+ "top_p": 1.0,
+ "users": ["user1", "user2"],
+ "tools": ["tool1", "tool2"],
+ "instructions_search": "You are a coding assistant"
+ }
+ OpenAI.EvalRunOutputItemSample:
type: object
required:
- - type
- - id
- - encrypted_content
+ - input
+ - output
+ - finish_reason
+ - model
+ - usage
+ - error
+ - temperature
+ - max_completion_tokens
+ - top_p
+ - seed
properties:
- type:
+ input:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunOutputItemSampleInput'
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunOutputItemSampleOutput'
+ finish_reason:
type: string
- enum:
- - compaction
- description: The type of the item. Always `compaction`.
- x-stainless-const: true
- default: compaction
- id:
+ model:
type: string
- description: The unique ID of the compaction item.
- encrypted_content:
+ usage:
+ $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage'
+ error:
+ $ref: '#/components/schemas/OpenAI.EvalApiError'
+ temperature:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ max_completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ top_p:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ seed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.EvalRunOutputItemSampleUsage:
+ type: object
+ required:
+ - total_tokens
+ - completion_tokens
+ - prompt_tokens
+ - cached_tokens
+ properties:
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.EvalRunPerModelUsage:
+ type: object
+ required:
+ - model_name
+ - invocation_count
+ - prompt_tokens
+ - completion_tokens
+ - total_tokens
+ - cached_tokens
+ properties:
+ model_name:
type: string
- description: The encrypted content that was produced by compaction.
- created_by:
+ invocation_count:
+ $ref: '#/components/schemas/OpenAI.integer'
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.EvalRunPerTestingCriteriaResults:
+ type: object
+ required:
+ - testing_criteria
+ - passed
+ - failed
+ properties:
+ testing_criteria:
type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
- title: Compaction item
- OpenAI.ConversationItemComputerToolCall:
+ passed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ errored:
+ $ref: '#/components/schemas/integer'
+ description: Number of tests that errored for this criteria.
+ skipped:
+ $ref: '#/components/schemas/integer'
+ description: Number of tests that were skipped for this criteria.
+ OpenAI.EvalRunResultCounts:
+ type: object
+ required:
+ - total
+ - errored
+ - failed
+ - passed
+ properties:
+ total:
+ $ref: '#/components/schemas/OpenAI.integer'
+ errored:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ passed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ skipped:
+ $ref: '#/components/schemas/integer'
+ description: Number of output items that were skipped during the evaluation.
+ OpenAI.EvalStoredCompletionsSource:
type: object
required:
- type
- - id
- - call_id
- - pending_safety_checks
- - status
properties:
type:
type: string
enum:
- - computer_call
- description: The type of the computer call. Always `computer_call`.
- default: computer_call
- id:
- type: string
- description: The unique ID of the computer call.
- call_id:
- type: string
- description: An identifier used when responding to the tool call with output.
- action:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- actions:
- $ref: '#/components/schemas/OpenAI.ComputerActionList'
- pending_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: The pending safety checks for the computer call.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: |-
- A tool call to a computer use tool. See the
- [computer use guide](/docs/guides/tools-computer-use) for more information.
- title: Computer tool call
- OpenAI.ConversationItemComputerToolCallOutput:
+ - stored_completions
+ description: The type of source. Always `stored_completions`.
+ x-stainless-const: true
+ default: stored_completions
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ model:
+ anyOf:
+ - type: string
+ - type: 'null'
+ created_after:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ created_before:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ limit:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: A StoredCompletionsRunDataSource configuration describing a set of filters
+ title: StoredCompletionsRunDataSource
+ x-oaiMeta:
+ name: The stored completions data source object used to configure an individual run
+ group: eval runs
+ example: |
+ {
+ "type": "stored_completions",
+ "model": "gpt-4o",
+ "created_after": 1668124800,
+ "created_before": 1668124900,
+ "limit": 100,
+ "metadata": {}
+ }
+ OpenAI.FileCitationBody:
type: object
required:
- type
- - id
- - call_id
- - output
+ - file_id
+ - index
+ - filename
properties:
type:
type: string
enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
+ - file_citation
+ description: The type of the file citation. Always `file_citation`.
x-stainless-const: true
- default: computer_call_output
- id:
- type: string
- description: The ID of the computer tool call output.
- readOnly: true
- call_id:
+ file_id:
type: string
- description: The ID of the computer tool call that produced the output.
- acknowledged_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: |-
- The safety checks reported by the API that have been acknowledged by the
- developer.
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- status:
+ description: The ID of the file.
+ index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the file in the list of files.
+ filename:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
+ description: The filename of the file cited.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.ConversationItemCustomToolCallOutputResource:
+ - $ref: '#/components/schemas/OpenAI.Annotation'
+ description: A citation to a file.
+ title: File citation
+ OpenAI.FileExpirationAfter:
type: object
required:
- - type
- - call_id
- - output
- - status
+ - anchor
+ - seconds
properties:
- type:
+ anchor:
type: string
enum:
- - custom_tool_call_output
- description: The type of the custom tool call output. Always `custom_tool_call_output`.
+ - created_at
+ description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`.'
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call output in the OpenAI platform.
- call_id:
- type: string
- description: The call ID, used to map this custom tool call output to a custom tool call.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the custom tool call generated by your code.
- Can be a string or an list of output content.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- title: ResponseCustomToolCallOutputItem
- OpenAI.ConversationItemCustomToolCallResource:
+ seconds:
+ type: integer
+ format: int64
+ minimum: 3600
+ maximum: 2592000
+ description: The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days).
+ description: 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.
+ title: File expiration policy
+ OpenAI.FileInputDetail:
+ type: string
+ enum:
+ - low
+ - high
+ OpenAI.FilePath:
type: object
required:
- type
- - call_id
- - name
- - input
- - status
+ - file_id
+ - index
properties:
type:
type: string
enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
+ - file_path
+ description: The type of the file path. Always `file_path`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
- type: string
- description: The name of the custom tool being called.
- input:
- type: string
- description: The input for the custom tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
+ file_id:
type: string
- description: The identifier of the actor that created the item.
+ description: The ID of the file.
+ index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the file in the list of files.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- title: ResponseCustomToolCallItem
- OpenAI.ConversationItemFileSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.Annotation'
+ description: A path to a file.
+ title: File path
+ OpenAI.FilePurpose:
+ type: string
+ enum:
+ - assistants
+ - batch
+ - fine-tune
+ - vision
+ - user_data
+ - evals
+ description: |-
+ 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
+ OpenAI.FileSearchRanker:
+ type: string
+ enum:
+ - auto
+ - default_2024_08_21
+ description: The ranker to use for the file search. If not specified will use the `auto` ranker.
+ OpenAI.FileSearchRankingOptions:
+ type: object
+ required:
+ - score_threshold
+ properties:
+ ranker:
+ $ref: '#/components/schemas/OpenAI.FileSearchRanker'
+ score_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ description: The score threshold for the file search. All values must be a floating point number between 0 and 1.
+ description: |-
+ 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
+ title: File search tool call ranking options
+ OpenAI.FileSearchTool:
type: object
required:
- - id
- type
- - status
- - queries
+ - vector_store_ids
properties:
- id:
- type: string
- description: The unique ID of the file search tool call.
type:
type: string
enum:
- - file_search_call
- description: The type of the file search tool call. Always `file_search_call`.
+ - file_search
+ description: The type of the file search tool. Always `file_search`.
x-stainless-const: true
- status:
- type: string
- enum:
- - in_progress
- - searching
- - completed
- - incomplete
- - failed
- description: |-
- The status of the file search tool call. One of `in_progress`,
- `searching`, `incomplete` or `failed`,
- queries:
+ vector_store_ids:
type: array
items:
type: string
- description: The queries used to search for files.
- results:
+ description: The IDs of the vector stores to search.
+ max_num_results:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.RankingOptions'
+ description: Ranking options for search.
+ filters:
anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - $ref: '#/components/schemas/OpenAI.Filters'
- type: 'null'
+ name:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: |-
- The results of a file search tool call. See the
- [file search guide](/docs/guides/tools-file-search) for more information.
- title: File search tool call
- OpenAI.ConversationItemFunctionShellCall:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: 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).
+ title: File search
+ OpenAI.FileSearchToolCallResults:
type: object
- required:
- - type
- - id
- - call_id
- - action
- - status
- - environment
properties:
- type:
+ file_id:
type: string
- enum:
- - shell_call
- description: The type of the item. Always `shell_call`.
- x-stainless-const: true
- default: shell_call
- id:
+ text:
type: string
- description: The unique ID of the shell tool call. Populated when this item is returned via API.
- call_id:
+ filename:
type: string
- description: The unique ID of the shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.FunctionShellAction'
- description: The shell commands and limits that describe how to run the tool call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
- description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
- environment:
+ attributes:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
- type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A tool call that executes one or more shell commands in a managed environment.
- title: Shell tool call
- OpenAI.ConversationItemFunctionShellCallOutput:
+ score:
+ type: number
+ format: float
+ OpenAI.Filters:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
+ - $ref: '#/components/schemas/OpenAI.CompoundFilter'
+ OpenAI.FineTuneDPOHyperparameters:
+ type: object
+ properties:
+ beta:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
+ default: auto
+ batch_size:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
+ default: auto
+ description: The hyperparameters used for the DPO fine-tuning job.
+ OpenAI.FineTuneDPOMethod:
+ type: object
+ properties:
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.FineTuneDPOHyperparameters'
+ description: Configuration for the DPO fine-tuning method.
+ OpenAI.FineTuneMethod:
type: object
required:
- type
- - id
- - call_id
- - status
- - output
- - max_output_length
properties:
type:
type: string
enum:
- - shell_call_output
- description: The type of the shell call output. Always `shell_call_output`.
- x-stainless-const: true
- default: shell_call_output
- id:
- type: string
- description: The unique ID of the shell call output. Populated when this item is returned via API.
- call_id:
+ - supervised
+ - dpo
+ - reinforcement
+ description: The type of method. Is either `supervised`, `dpo`, or `reinforcement`.
+ supervised:
+ $ref: '#/components/schemas/OpenAI.FineTuneSupervisedMethod'
+ dpo:
+ $ref: '#/components/schemas/OpenAI.FineTuneDPOMethod'
+ reinforcement:
+ $ref: '#/components/schemas/OpenAI.FineTuneReinforcementMethod'
+ description: The method used for fine-tuning.
+ OpenAI.FineTuneReinforcementHyperparameters:
+ type: object
+ properties:
+ batch_size:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
+ default: auto
+ reasoning_effort:
type: string
- description: The unique ID of the shell tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
- description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
- description: An array of shell call output contents
- max_output_length:
- anyOf:
+ enum:
+ - default
+ - low
+ - medium
+ - high
+ description: Level of reasoning effort.
+ default: default
+ compute_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: Multiplier on amount of compute used for exploring search space during training.
+ default: auto
+ eval_interval:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of training steps between evaluation runs.
+ default: auto
+ eval_samples:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of evaluation samples to generate per training step.
+ default: auto
+ description: The hyperparameters used for the reinforcement fine-tuning job.
+ OpenAI.FineTuneReinforcementMethod:
+ type: object
+ required:
+ - grader
+ properties:
+ grader:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderMulti'
+ description: The grader used for the fine-tuning job.
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters'
+ description: Configuration for the reinforcement fine-tuning method.
+ OpenAI.FineTuneSupervisedHyperparameters:
+ type: object
+ properties:
+ batch_size:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
- $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: The output of a shell tool call that was emitted.
- title: Shell call output
- OpenAI.ConversationItemFunctionToolCall:
+ description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
+ default: auto
+ description: The hyperparameters used for the fine-tuning job.
+ OpenAI.FineTuneSupervisedMethod:
+ type: object
+ properties:
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters'
+ description: Configuration for the supervised fine-tuning method.
+ OpenAI.FineTuningCheckpointPermission:
type: object
required:
- id
- - type
- - call_id
- - name
- - arguments
+ - created_at
+ - project_id
+ - object
properties:
id:
type: string
- description: The unique ID of the function tool call.
- readOnly: true
- type:
- type: string
- enum:
- - function_call
- description: The type of the function tool call. Always `function_call`.
- x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- namespace:
- type: string
- description: The namespace of the function to run.
- name:
- type: string
- description: The name of the function to run.
- arguments:
+ description: The permission identifier, which can be referenced in the API endpoints.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the permission was created.
+ project_id:
type: string
- description: A JSON string of the arguments to pass to the function.
- status:
+ description: The project identifier that the permission is for.
+ object:
type: string
enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: |-
- A tool call to run a function. See the
- [function calling guide](/docs/guides/function-calling) for more information.
- title: Function tool call
- OpenAI.ConversationItemFunctionToolCallOutput:
+ - checkpoint.permission
+ description: The object type, which is always "checkpoint.permission".
+ x-stainless-const: true
+ description: The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.
+ title: FineTuningCheckpointPermission
+ x-oaiMeta:
+ name: The fine-tuned model checkpoint permission object
+ example: |
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1712211699,
+ "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"
+ }
+ OpenAI.FineTuningIntegration:
type: object
required:
- - id
- type
- - call_id
- - output
+ - wandb
properties:
- id:
- type: string
- description: |-
- The unique ID of the function tool call output. Populated when this item
- is returned via API.
- readOnly: true
type:
type: string
enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
+ - wandb
+ description: The type of the integration being enabled for the fine-tuning job
x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ wandb:
+ $ref: '#/components/schemas/OpenAI.FineTuningIntegrationWandb'
description: |-
- The output from the function call generated by your code.
- Can be a string or an list of output content.
- status:
+ 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.
+ title: Fine-Tuning Job Integration
+ OpenAI.FineTuningIntegrationWandb:
+ type: object
+ required:
+ - project
+ properties:
+ project:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.ConversationItemImageGenToolCall:
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ entity:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tags:
+ type: array
+ items:
+ type: string
+ OpenAI.FineTuningJob:
type: object
required:
- - type
- id
+ - created_at
+ - error
+ - fine_tuned_model
+ - finished_at
+ - hyperparameters
+ - model
+ - object
+ - organization_id
+ - result_files
- status
- - result
+ - trained_tokens
+ - training_file
+ - validation_file
+ - seed
properties:
- type:
+ id:
+ type: string
+ description: The object identifier, which can be referenced in the API endpoints.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the fine-tuning job was created.
+ error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FineTuningJobError'
+ - type: 'null'
+ fine_tuned_model:
+ anyOf:
+ - type: string
+ - type: 'null'
+ finished_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobHyperparameters'
+ description: The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.
+ model:
+ type: string
+ description: The base model that is being fine-tuned.
+ object:
type: string
enum:
- - image_generation_call
- description: The type of the image generation call. Always `image_generation_call`.
+ - fine_tuning.job
+ description: The object type, which is always "fine_tuning.job".
x-stainless-const: true
- id:
+ organization_id:
type: string
- description: The unique ID of the image generation call.
+ description: The organization that owns the fine-tuning job.
+ result_files:
+ type: array
+ items:
+ type: string
+ description: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents).
status:
type: string
enum:
- - in_progress
- - completed
- - generating
+ - validating_files
+ - queued
+ - running
+ - succeeded
- failed
- description: The status of the image generation call.
- result:
+ - cancelled
+ description: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.
+ trained_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ training_file:
+ type: string
+ description: The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents).
+ validation_file:
anyOf:
- type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: An image generation request made by the model.
- title: Image generation call
- OpenAI.ConversationItemList:
+ integrations:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FineTuningIntegration'
+ - type: 'null'
+ seed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The seed used for the fine-tuning job.
+ estimated_finish:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ method:
+ $ref: '#/components/schemas/OpenAI.FineTuneMethod'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.
+ title: FineTuningJob
+ x-oaiMeta:
+ name: The fine-tuning job object
+ example: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "davinci-002",
+ "created_at": 1692661014,
+ "finished_at": 1692661190,
+ "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
+ "organization_id": "org-123",
+ "result_files": [
+ "file-abc123"
+ ],
+ "status": "succeeded",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ },
+ "trained_tokens": 5768,
+ "integrations": [],
+ "seed": 0,
+ "estimated_finish": 0,
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ }
+ }
+ },
+ "metadata": {
+ "key": "value"
+ }
+ }
+ OpenAI.FineTuningJobCheckpoint:
type: object
required:
+ - id
+ - created_at
+ - fine_tuned_model_checkpoint
+ - step_number
+ - metrics
+ - fine_tuning_job_id
- object
- - data
- - has_more
- - first_id
- - last_id
properties:
+ id:
+ type: string
+ description: The checkpoint identifier, which can be referenced in the API endpoints.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the checkpoint was created.
+ fine_tuned_model_checkpoint:
+ type: string
+ description: The name of the fine-tuned checkpoint model that is created.
+ step_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The step number that the checkpoint was created at.
+ metrics:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics'
+ description: Metrics at the step number during the fine-tuning job.
+ fine_tuning_job_id:
+ type: string
+ description: The name of the fine-tuning job that this checkpoint was created from.
object:
type: string
enum:
- - list
- description: The type of object returned, must be `list`.
+ - fine_tuning.job.checkpoint
+ description: The object type, which is always "fine_tuning.job.checkpoint".
x-stainless-const: true
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A list of conversation items.
- x-ms-list-page-items: true
- has_more:
- type: boolean
- description: Whether there are more items available.
- first_id:
- type: string
- description: The ID of the first item in the list.
- last_id:
- type: string
- description: The ID of the last item in the list.
- x-ms-list-continuation-token: true
- description: A list of Conversation items.
- title: The conversation item list
+ description: The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.
+ title: FineTuningJobCheckpoint
x-oaiMeta:
- name: The item list
- group: conversations
- OpenAI.ConversationItemLocalShellToolCall:
+ name: The fine-tuning job checkpoint object
+ example: |
+ {
+ "object": "fine_tuning.job.checkpoint",
+ "id": "ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P",
+ "created_at": 1712211699,
+ "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88",
+ "fine_tuning_job_id": "ftjob-fpbNQ3H1GrMehXRf8cO97xTN",
+ "metrics": {
+ "step": 88,
+ "train_loss": 0.478,
+ "train_mean_token_accuracy": 0.924,
+ "valid_loss": 10.112,
+ "valid_mean_token_accuracy": 0.145,
+ "full_valid_loss": 0.567,
+ "full_valid_mean_token_accuracy": 0.944
+ },
+ "step_number": 88
+ }
+ OpenAI.FineTuningJobCheckpointMetrics:
+ type: object
+ properties:
+ step:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ train_loss:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ train_mean_token_accuracy:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ valid_loss:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ valid_mean_token_accuracy:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ full_valid_loss:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ full_valid_mean_token_accuracy:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.FineTuningJobError:
type: object
required:
- - type
- - id
- - call_id
- - action
- - status
+ - code
+ - message
+ - param
properties:
- type:
- type: string
- enum:
- - local_shell_call
- description: The type of the local shell call. Always `local_shell_call`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell call.
- call_id:
+ code:
type: string
- description: The unique ID of the local shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
- status:
+ message:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: The status of the local shell call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A tool call to run a command on the local shell.
- title: Local shell call
- OpenAI.ConversationItemLocalShellToolCallOutput:
+ param:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.FineTuningJobEvent:
type: object
required:
- - type
+ - object
- id
- - output
+ - created_at
+ - level
+ - message
properties:
- type:
+ object:
type: string
enum:
- - local_shell_call_output
- description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ - fine_tuning.job.event
+ description: The object type, which is always "fine_tuning.job.event".
x-stainless-const: true
id:
type: string
- description: The unique ID of the local shell tool call generated by the model.
- output:
+ description: The object identifier.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the fine-tuning job was created.
+ level:
type: string
- description: A JSON string of the output of the local shell tool call.
- status:
+ enum:
+ - info
+ - warn
+ - error
+ description: The log level of the event.
+ message:
+ type: string
+ description: The message of the event.
+ type:
+ type: string
+ enum:
+ - message
+ - metrics
+ description: The type of event.
+ data:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobEventData'
+ description: The data associated with the event.
+ description: Fine-tuning job event object
+ x-oaiMeta:
+ name: The fine-tuning job event object
+ example: |
+ {
+ "object": "fine_tuning.job.event",
+ "id": "ftevent-abc123"
+ "created_at": 1677610602,
+ "level": "info",
+ "message": "Created fine-tuning job",
+ "data": {},
+ "type": "message"
+ }
+ OpenAI.FineTuningJobEventData:
+ type: object
+ OpenAI.FineTuningJobHyperparameters:
+ type: object
+ properties:
+ batch_size:
anyOf:
- type: string
enum:
- - in_progress
- - completed
- - incomplete
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: The output of a local shell tool call.
- title: Local shell call output
- OpenAI.ConversationItemMcpApprovalRequest:
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ default: auto
+ OpenAI.FunctionAndCustomToolCallOutput:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType'
+ discriminator:
+ propertyName: type
+ mapping:
+ input_text: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent'
+ input_image: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent'
+ input_file: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent'
+ OpenAI.FunctionAndCustomToolCallOutputInputFileContent:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
properties:
type:
type: string
enum:
- - mcp_approval_request
- description: The type of the item. Always `mcp_approval_request`.
+ - input_file
+ description: The type of the input item. Always `input_file`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval request.
- server_label:
+ default: input_file
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ filename:
type: string
- description: The label of the MCP server making the request.
- name:
+ description: The name of the file to be sent to the model.
+ file_data:
type: string
- description: The name of the tool to run.
- arguments:
+ description: The content of the file to be sent to the model.
+ file_url:
type: string
- description: A JSON string of arguments for the tool.
+ format: uri
+ description: The URL of the file to be sent to the model.
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A request for human approval of a tool invocation.
- title: MCP approval request
- OpenAI.ConversationItemMcpApprovalResponseResource:
+ - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: A file input to the model.
+ title: Input file
+ OpenAI.FunctionAndCustomToolCallOutputInputImageContent:
type: object
required:
- type
- - id
- - approval_request_id
- - approve
+ - detail
properties:
type:
type: string
enum:
- - mcp_approval_response
- description: The type of the item. Always `mcp_approval_response`.
+ - input_image
+ description: The type of the input item. Always `input_image`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval response
- approval_request_id:
- type: string
- description: The ID of the approval request being answered.
- approve:
- type: boolean
- description: Whether the request was approved.
- reason:
+ default: input_image
+ image_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ file_id:
anyOf:
- type: string
- type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A response to an MCP approval request.
- title: MCP approval response
- OpenAI.ConversationItemMcpListTools:
+ - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
+ title: Input image
+ OpenAI.FunctionAndCustomToolCallOutputInputTextContent:
type: object
required:
- type
- - id
- - server_label
- - tools
+ - text
properties:
type:
type: string
enum:
- - mcp_list_tools
- description: The type of the item. Always `mcp_list_tools`.
+ - input_text
+ description: The type of the input item. Always `input_text`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the list.
- server_label:
+ default: input_text
+ text:
type: string
- description: The label of the MCP server.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
- description: The tools available on the server.
- error:
- $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ description: The text input to the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A list of tools available on an MCP server.
- title: MCP list tools
- OpenAI.ConversationItemMcpToolCall:
+ - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: A text input to the model.
+ title: Input text
+ OpenAI.FunctionAndCustomToolCallOutputType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - input_text
+ - input_image
+ - input_file
+ OpenAI.FunctionCallItemStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.FunctionCallOutputStatusEnum:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.FunctionCallStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.FunctionObject:
type: object
required:
- - type
- - id
- - server_label
- name
- - arguments
properties:
- type:
- type: string
- enum:
- - mcp_call
- description: The type of the item. Always `mcp_call`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the tool call.
- server_label:
+ description:
type: string
- description: The label of the MCP server running the tool.
+ description: A description of what the function does, used by the model to choose when and how to call the function.
name:
type: string
- description: The name of the tool that was run.
- arguments:
- type: string
- description: A JSON string of the arguments passed to the tool.
- output:
+ description: 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.
+ parameters:
+ $ref: '#/components/schemas/OpenAI.FunctionParameters'
+ strict:
anyOf:
- - type: string
+ - type: boolean
- type: 'null'
- error:
- type: object
- unevaluatedProperties: {}
- status:
- $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
- description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
- approval_request_id:
+ OpenAI.FunctionParameters:
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
+ Omitting `parameters` defines a function with an empty parameter list.
+ OpenAI.FunctionShellAction:
+ type: object
+ required:
+ - commands
+ - timeout_ms
+ - max_output_length
+ properties:
+ commands:
+ type: array
+ items:
+ type: string
+ timeout_ms:
anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: An invocation of a tool on an MCP server.
- title: MCP tool call
- OpenAI.ConversationItemMessage:
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: Execute a shell command.
+ title: Shell exec action
+ OpenAI.FunctionShellActionParam:
type: object
required:
- - type
- - id
- - status
- - role
- - content
+ - commands
properties:
- type:
- type: string
- enum:
- - message
- description: The type of the message. Always set to `message`.
- x-stainless-const: true
- default: message
- id:
- type: string
- description: The unique ID of the message.
- status:
- $ref: '#/components/schemas/OpenAI.MessageStatus'
- description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
- role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`.
- content:
+ commands:
type: array
items:
- $ref: '#/components/schemas/OpenAI.MessageContent'
- description: The content of the message
- phase:
+ type: string
+ description: Ordered shell commands for the execution environment to run.
+ timeout_ms:
anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A message to or from the model.
- title: Message
- OpenAI.ConversationItemReasoningItem:
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: Commands and limits describing how to run the shell tool call.
+ title: Shell action
+ OpenAI.FunctionShellCallEnvironment:
type: object
required:
- type
- - id
- - summary
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironmentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ local: '#/components/schemas/OpenAI.LocalEnvironmentResource'
+ container_reference: '#/components/schemas/OpenAI.ContainerReferenceResource'
+ OpenAI.FunctionShellCallEnvironmentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - local
+ - container_reference
+ OpenAI.FunctionShellCallItemParamEnvironment:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ local: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam'
+ container_reference: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam'
+ description: The environment to execute the shell commands in.
+ OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam:
+ type: object
+ required:
+ - type
+ - container_id
properties:
type:
type: string
enum:
- - reasoning
- description: The type of the object. Always `reasoning`.
+ - container_reference
+ description: References a container created with the /v1/containers endpoint
x-stainless-const: true
- id:
- type: string
- description: The unique identifier of the reasoning content.
- encrypted_content:
- anyOf:
- - type: string
- - type: 'null'
- summary:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.SummaryTextContent'
- description: Reasoning summary content.
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
- description: Reasoning text content.
- status:
+ default: container_reference
+ container_id:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ description: The ID of the referenced container.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: |-
- A description of the chain of thought used by a reasoning model while generating
- a response. Be sure to include these items in your `input` to the Responses API
- for subsequent turns of a conversation if you are manually
- [managing context](/docs/guides/conversation-state).
- title: Reasoning
- OpenAI.ConversationItemToolSearchCall:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
+ OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam:
type: object
required:
- type
- - id
- - call_id
- - execution
- - arguments
- - status
properties:
type:
type: string
enum:
- - tool_search_call
- description: The type of the item. Always `tool_search_call`.
+ - local
+ description: Use a local computer environment.
x-stainless-const: true
- default: tool_search_call
- id:
+ default: local
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.LocalSkillParam'
+ maxItems: 200
+ description: An optional list of skills.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
+ OpenAI.FunctionShellCallItemParamEnvironmentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - local
+ - container_reference
+ OpenAI.FunctionShellCallItemStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: Status values reported for shell tool calls.
+ title: Shell call status
+ OpenAI.FunctionShellCallOutputContent:
+ type: object
+ required:
+ - stdout
+ - stderr
+ - outcome
+ properties:
+ stdout:
type: string
- description: The unique ID of the tool search call item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- arguments:
- description: Arguments used for the tool search call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: The status of the tool search call item that was recorded.
+ description: The standard output that was captured.
+ stderr:
+ type: string
+ description: The standard error output that was captured.
+ outcome:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
+ description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
+ title: Shell call outcome
created_by:
type: string
description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- OpenAI.ConversationItemToolSearchOutput:
+ description: The content of a shell tool call output that was emitted.
+ title: Shell call output content
+ OpenAI.FunctionShellCallOutputContentParam:
+ type: object
+ required:
+ - stdout
+ - stderr
+ - outcome
+ properties:
+ stdout:
+ type: string
+ maxLength: 10485760
+ description: Captured stdout output for the shell call.
+ stderr:
+ type: string
+ maxLength: 10485760
+ description: Captured stderr output for the shell call.
+ outcome:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
+ description: The exit or timeout outcome associated with this shell call.
+ description: Captured stdout and stderr for a portion of a shell tool call output.
+ title: Shell output content
+ OpenAI.FunctionShellCallOutputExitOutcome:
type: object
required:
- type
- - id
- - call_id
- - execution
- - tools
- - status
+ - exit_code
properties:
type:
type: string
enum:
- - tool_search_output
- description: The type of the item. Always `tool_search_output`.
+ - exit
+ description: The outcome type. Always `exit`.
x-stainless-const: true
- default: tool_search_output
- id:
- type: string
- description: The unique ID of the tool search output item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by tool search.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: The status of the tool search output item that was recorded.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
+ exit_code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Exit code from the shell process.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- OpenAI.ConversationItemType:
- anyOf:
- - type: string
- - type: string
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
+ description: Indicates that the shell commands finished and returned an exit code.
+ title: Shell call exit outcome
+ OpenAI.FunctionShellCallOutputExitOutcomeParam:
+ type: object
+ required:
+ - type
+ - exit_code
+ properties:
+ type:
+ type: string
enum:
- - message
- - function_call
- - function_call_output
- - file_search_call
- - web_search_call
- - image_generation_call
- - computer_call
- - computer_call_output
- - tool_search_call
- - tool_search_output
- - additional_tools
- - reasoning
- - compaction
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - mcp_call
- - custom_tool_call
- - custom_tool_call_output
- OpenAI.ConversationItemWebSearchToolCall:
+ - exit
+ description: The outcome type. Always `exit`.
+ x-stainless-const: true
+ exit_code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The exit code returned by the shell process.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
+ description: Indicates that the shell commands finished and returned an exit code.
+ title: Shell call exit outcome
+ OpenAI.FunctionShellCallOutputOutcome:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType'
+ discriminator:
+ propertyName: type
+ mapping:
+ timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome'
+ exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome'
+ description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
+ title: Shell call outcome
+ OpenAI.FunctionShellCallOutputOutcomeParam:
type: object
required:
- - id
- type
- - status
- - action
properties:
- id:
- type: string
- description: The unique ID of the web search tool call.
type:
- type: string
- enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
- x-stainless-const: true
- status:
- type: string
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParamType'
+ discriminator:
+ propertyName: type
+ mapping:
+ timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcomeParam'
+ exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcomeParam'
+ description: The exit or timeout outcome associated with this shell call.
+ title: Shell call outcome
+ OpenAI.FunctionShellCallOutputOutcomeParamType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
- description: |-
- 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_in_page).
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.ConversationParam:
- oneOf:
+ - timeout
+ - exit
+ OpenAI.FunctionShellCallOutputOutcomeType:
+ anyOf:
- type: string
- - $ref: '#/components/schemas/OpenAI.ConversationParam-2'
- description: |-
- The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.
- Input items and output items from this response are automatically added to this conversation after this response completes.
- OpenAI.ConversationParam-2:
+ - type: string
+ enum:
+ - timeout
+ - exit
+ OpenAI.FunctionShellCallOutputStatusEnum:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.FunctionShellCallOutputTimeoutOutcome:
type: object
required:
- - id
+ - type
properties:
- id:
+ type:
type: string
- description: The unique ID of the conversation.
- description: The conversation that this response belongs to.
- title: Conversation object
- OpenAI.ConversationReference:
+ enum:
+ - timeout
+ description: The outcome type. Always `timeout`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
+ description: Indicates that the shell call exceeded its configured time limit.
+ title: Shell call timeout outcome
+ OpenAI.FunctionShellCallOutputTimeoutOutcomeParam:
type: object
required:
- - id
+ - type
properties:
- id:
+ type:
type: string
- description: The unique ID of the conversation that this response was associated with.
- description: The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
- title: Conversation
- OpenAI.ConversationResource:
+ enum:
+ - timeout
+ description: The outcome type. Always `timeout`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
+ description: Indicates that the shell call exceeded its configured time limit.
+ title: Shell call timeout outcome
+ OpenAI.FunctionShellCallStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.FunctionShellToolParam:
type: object
required:
- - id
- - object
- - metadata
- - created_at
+ - type
properties:
- id:
- type: string
- description: The unique ID of the conversation.
- object:
+ type:
type: string
enum:
- - conversation
- description: The object type, which is always `conversation`.
+ - shell
+ description: The type of the shell tool. Always `shell`.
x-stainless-const: true
- default: conversation
- metadata:
- $ref: '#/components/schemas/OpenAI.Metadata'
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- created_at:
- type: integer
- format: unixtime
- description: The time at which the conversation was created, measured in seconds since the Unix epoch.
- OpenAI.CoordParam:
- type: object
- required:
- - x
- - 'y'
- properties:
- x:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate.
- 'y':
- $ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate.
- description: 'An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.'
- title: Coordinate
- OpenAI.CreateChatCompletionRequestResponseFormat:
+ environment:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
+ - type: 'null'
+ name:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that allows the model to execute shell commands.
+ title: Shell tool
+ OpenAI.FunctionShellToolParamEnvironment:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType'
+ $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentType'
discriminator:
propertyName: type
mapping:
- text: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText'
- json_object: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject'
- json_schema: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
- description: |-
- 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](/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.
- OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject:
+ local: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam'
+ container_reference: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam'
+ container_auto: '#/components/schemas/OpenAI.ContainerAutoParam'
+ OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam:
type: object
required:
- type
+ - container_id
properties:
type:
type: string
enum:
- - json_object
- description: The type of response format being defined. Always `json_object`.
+ - container_reference
+ description: References a container created with the /v1/containers endpoint
x-stainless-const: true
+ default: container_reference
+ container_id:
+ type: string
+ description: The ID of the referenced container.
allOf:
- - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
- description: |-
- JSON object response format. An older method of generating JSON responses.
- Using `json_schema` is recommended for models that support it. Note that the
- model will not generate JSON without a system or user message instructing it
- to do so.
- title: JSON object
- OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
+ OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam:
type: object
required:
- type
@@ -20452,3627 +54996,4271 @@ components:
type:
type: string
enum:
- - text
- description: The type of response format being defined. Always `text`.
+ - local
+ description: Use a local computer environment.
x-stainless-const: true
+ default: local
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.LocalSkillParam'
+ maxItems: 200
+ description: An optional list of skills.
allOf:
- - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
- description: Default response format. Used to generate text responses.
- title: Text
- OpenAI.CreateChatCompletionRequestResponseFormatType:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
+ OpenAI.FunctionShellToolParamEnvironmentType:
anyOf:
- type: string
- type: string
enum:
- - text
- - json_schema
- - json_object
- OpenAI.CreateConversationBody:
- type: object
- properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- items:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputItem'
- - type: 'null'
- OpenAI.CreateEvalCompletionsRunDataSource:
+ - container_auto
+ - local
+ - container_reference
+ OpenAI.FunctionTool:
type: object
required:
- type
- - source
+ - name
+ - parameters
+ - strict
properties:
type:
type: string
enum:
- - completions
- description: The type of run data source. Always `completions`.
- default: completions
- input_messages:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
- description: 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.
- sampling_params:
- $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams'
- model:
+ - function
+ description: The type of the function tool. Always `function`.
+ x-stainless-const: true
+ name:
type: string
- description: The name of the model to use for generating completions (e.g. "o3-mini").
- source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
- - $ref: '#/components/schemas/OpenAI.EvalStoredCompletionsSource'
- description: Determines what populates the `item` namespace in this run's data source.
- description: A CompletionsRunDataSource object describing a model sampling configuration.
- title: CompletionsRunDataSource
- x-oaiMeta:
- name: The completions data source object used to configure an individual run
- group: eval runs
- example: |
- {
- "name": "gpt-4o-mini-2024-07-18",
- "data_source": {
- "type": "completions",
- "input_messages": {
- "type": "item_reference",
- "item_reference": "item.input"
- },
- "model": "gpt-4o-mini-2024-07-18",
- "source": {
- "type": "stored_completions",
- "model": "gpt-4o-mini-2024-07-18"
- }
- }
- }
- OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference:
+ description: The name of the function to call.
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ parameters:
+ anyOf:
+ - type: object
+ unevaluatedProperties: {}
+ - type: 'null'
+ strict:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ defer_loading:
+ type: boolean
+ description: Whether this function is deferred and loaded via tool search.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: 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).
+ title: Function
+ OpenAI.FunctionToolParam:
type: object
required:
+ - name
- type
- - item_reference
properties:
+ name:
+ type: string
+ minLength: 1
+ maxLength: 128
+ pattern: ^[a-zA-Z0-9_-]+$
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ parameters:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EmptyModelParam'
+ - type: 'null'
+ strict:
+ anyOf:
+ - type: boolean
+ - type: 'null'
type:
type: string
enum:
- - item_reference
- item_reference:
- type: string
- OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate:
+ - function
+ x-stainless-const: true
+ default: function
+ defer_loading:
+ type: boolean
+ description: Whether this function should be deferred and discovered via tool search.
+ OpenAI.GraderLabelModel:
type: object
required:
- type
- - template
+ - name
+ - model
+ - input
+ - labels
+ - passing_labels
properties:
type:
type: string
enum:
- - template
- template:
+ - label_model
+ description: The object type, which is always `label_model`.
+ x-stainless-const: true
+ name:
+ type: string
+ description: The name of the grader.
+ model:
+ type: string
+ description: The model to use for the evaluation. Must support structured outputs.
+ input:
type: array
items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EasyInputMessage'
- - $ref: '#/components/schemas/OpenAI.EvalItem'
- OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams:
- type: object
- properties:
- reasoning_effort:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
- - type: 'null'
- temperature:
- $ref: '#/components/schemas/OpenAI.numeric'
- default: 1
- max_completion_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- top_p:
- $ref: '#/components/schemas/OpenAI.numeric'
- default: 1
- seed:
- $ref: '#/components/schemas/OpenAI.integer'
- default: 42
- response_format:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.ResponseFormatText'
- - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
- - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject'
- tools:
+ $ref: '#/components/schemas/OpenAI.EvalItem'
+ labels:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ChatCompletionTool'
- OpenAI.CreateEvalCustomDataSourceConfig:
+ type: string
+ description: The labels to assign to each item in the evaluation.
+ passing_labels:
+ type: array
+ items:
+ type: string
+ description: The labels that indicate a passing result. Must be a subset of labels.
+ description: |-
+ A LabelModelGrader object which uses a model to assign labels to each item
+ in the evaluation.
+ title: LabelModelGrader
+ x-oaiMeta:
+ name: Label Model Grader
+ group: graders
+ example: |
+ {
+ "name": "First label grader",
+ "type": "label_model",
+ "model": "gpt-4o-2024-08-06",
+ "input": [
+ {
+ "type": "message",
+ "role": "system",
+ "content": {
+ "type": "input_text",
+ "text": "Classify the sentiment of the following statement as one of positive, neutral, or negative"
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "Statement: {{item.response}}"
+ }
+ }
+ ],
+ "passing_labels": [
+ "positive"
+ ],
+ "labels": [
+ "positive",
+ "neutral",
+ "negative"
+ ]
+ }
+ OpenAI.GraderMulti:
type: object
required:
- type
- - item_schema
+ - name
+ - graders
+ - calculate_output
properties:
type:
type: string
enum:
- - custom
- description: The type of data source. Always `custom`.
+ - multi
+ description: The object type, which is always `multi`.
x-stainless-const: true
- default: custom
- item_schema:
- type: object
- unevaluatedProperties: {}
- description: The json schema for each row in the data source.
- include_sample_schema:
- type: boolean
- description: Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)
- description: |-
- 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
- title: CustomDataSourceConfig
+ default: multi
+ name:
+ type: string
+ description: The name of the grader.
+ graders:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderLabelModel'
+ calculate_output:
+ type: string
+ description: A formula to calculate the output based on grader results.
+ description: A MultiGrader object combines the output of multiple graders to produce a single score.
+ title: MultiGrader
x-oaiMeta:
- name: The eval file data source config object
- group: evals
+ name: Multi Grader
+ group: graders
example: |
{
- "type": "custom",
- "item_schema": {
- "type": "object",
- "properties": {
- "name": {"type": "string"},
- "age": {"type": "integer"}
+ "type": "multi",
+ "name": "example multi grader",
+ "graders": [
+ {
+ "type": "text_similarity",
+ "name": "example text similarity grader",
+ "input": "The graded text",
+ "reference": "The reference text",
+ "evaluation_metric": "fuzzy_match"
},
- "required": ["name", "age"]
- },
- "include_sample_schema": true
+ {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ }
+ ],
+ "calculate_output": "0.5 * text_similarity_score + 0.5 * string_check_score)"
}
- OpenAI.CreateEvalJsonlRunDataSource:
+ OpenAI.GraderPython:
type: object
required:
- type
+ - name
- source
properties:
type:
type: string
enum:
- - jsonl
- description: The type of data source. Always `jsonl`.
+ - python
+ description: The object type, which is always `python`.
x-stainless-const: true
- default: jsonl
+ name:
+ type: string
+ description: The name of the grader.
source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
- description: Determines what populates the `item` namespace in the data source.
- description: A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
- title: JsonlRunDataSource
+ type: string
+ description: The source code of the python script.
+ image_tag:
+ type: string
+ description: The image tag to use for the python script.
+ description: A PythonGrader object that runs a python script on the input.
+ title: PythonGrader
x-oaiMeta:
- name: The file data source object for the eval run configuration
- group: evals
+ name: Python Grader
+ group: graders
example: |
{
- "type": "jsonl",
- "source": {
- "type": "file_id",
- "id": "file-9GYS6xbkWgWhmE7VoLUWFg"
- }
+ "type": "python",
+ "name": "Example python grader",
+ "image_tag": "2025-05-08",
+ "source": """
+ def grade(sample: dict, item: dict) -> float:
+ """
+ Returns 1.0 if `output_text` equals `label`, otherwise 0.0.
+ """
+ output = sample.get("output_text")
+ label = item.get("label")
+ return 1.0 if output == label else 0.0
+ """,
}
- OpenAI.CreateEvalLogsDataSourceConfig:
+ OpenAI.GraderScoreModel:
type: object
required:
- type
+ - name
+ - model
+ - input
properties:
type:
type: string
enum:
- - logs
- description: The type of data source. Always `logs`.
+ - score_model
+ description: The object type, which is always `score_model`.
x-stainless-const: true
- default: logs
- metadata:
- type: object
- unevaluatedProperties: {}
- description: Metadata filters for the logs data source.
- description: |-
- 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.
- title: LogsDataSourceConfig
+ name:
+ type: string
+ description: The name of the grader.
+ model:
+ type: string
+ description: The model to use for the evaluation.
+ sampling_params:
+ $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams'
+ description: The sampling parameters for the model.
+ input:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalItem'
+ description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
+ range:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The range of the score. Defaults to `[0, 1]`.
+ description: A ScoreModelGrader object that uses a model to assign a score to the input.
+ title: ScoreModelGrader
x-oaiMeta:
- name: The logs data source object for evals
- group: evals
+ name: Score Model Grader
+ group: graders
example: |
{
- "type": "logs",
- "metadata": {
- "use_case": "customer_support_agent"
- }
+ "type": "score_model",
+ "name": "Example score model grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": (
+ "Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different."
+ " Return just a floating point score
+
+ "
+ " Reference answer: {{item.label}}
+
+ "
+ " Model answer: {{sample.output_text}}"
+ )
+ },
+ {
+ "type": "input_image",
+ "image_url": "https://example.com/reference.png",
+ "file_id": null,
+ "detail": "auto"
+ }
+ ],
+ }
+ ],
+ "model": "gpt-5-mini",
+ "sampling_params": {
+ "temperature": 1,
+ "top_p": 1,
+ "seed": 42,
+ "max_completions_tokens": 32768,
+ "reasoning_effort": "medium"
+ },
}
- OpenAI.CreateEvalResponsesRunDataSource:
+ OpenAI.GraderStringCheck:
type: object
required:
- type
- - source
+ - name
+ - input
+ - reference
+ - operation
properties:
type:
type: string
enum:
- - responses
- description: The type of run data source. Always `responses`.
- default: responses
- input_messages:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference'
- description: 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.
- sampling_params:
- $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams'
- model:
+ - string_check
+ description: The object type, which is always `string_check`.
+ x-stainless-const: true
+ name:
type: string
- description: The name of the model to use for generating completions (e.g. "o3-mini").
- source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
- - $ref: '#/components/schemas/OpenAI.EvalResponsesSource'
- description: Determines what populates the `item` namespace in this run's data source.
- description: A ResponsesRunDataSource object describing a model sampling configuration.
- title: ResponsesRunDataSource
+ description: The name of the grader.
+ input:
+ type: string
+ description: The input text. This may include template strings.
+ reference:
+ type: string
+ description: The reference text. This may include template strings.
+ operation:
+ type: string
+ enum:
+ - eq
+ - ne
+ - like
+ - ilike
+ description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
+ description: A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
+ title: StringCheckGrader
x-oaiMeta:
- name: The completions data source object used to configure an individual run
- group: eval runs
+ name: String Check Grader
+ group: graders
example: |
{
- "name": "gpt-4o-mini-2024-07-18",
- "data_source": {
- "type": "responses",
- "input_messages": {
- "type": "item_reference",
- "item_reference": "item.input"
- },
- "model": "gpt-4o-mini-2024-07-18",
- "source": {
- "type": "responses",
- "model": "gpt-4o-mini-2024-07-18"
- }
- }
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
}
- OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference:
+ OpenAI.GraderTextSimilarity:
type: object
required:
- type
- - item_reference
+ - name
+ - input
+ - reference
+ - evaluation_metric
properties:
type:
type: string
enum:
- - item_reference
- item_reference:
+ - text_similarity
+ description: The type of grader.
+ x-stainless-const: true
+ default: text_similarity
+ name:
type: string
- OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate:
+ description: The name of the grader.
+ input:
+ type: string
+ description: The text being graded.
+ reference:
+ type: string
+ description: The text being graded against.
+ evaluation_metric:
+ type: string
+ enum:
+ - cosine
+ - fuzzy_match
+ - bleu
+ - gleu
+ - meteor
+ - rouge_1
+ - rouge_2
+ - rouge_3
+ - rouge_4
+ - rouge_5
+ - rouge_l
+ description: |-
+ 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`.
+ description: A TextSimilarityGrader object which grades text based on similarity metrics.
+ title: TextSimilarityGrader
+ x-oaiMeta:
+ name: Text Similarity Grader
+ group: graders
+ example: |
+ {
+ "type": "text_similarity",
+ "name": "Example text similarity grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "evaluation_metric": "fuzzy_match"
+ }
+ OpenAI.GrammarSyntax1:
+ type: string
+ enum:
+ - lark
+ - regex
+ OpenAI.HybridSearchOptions:
+ type: object
+ required:
+ - embedding_weight
+ - text_weight
+ properties:
+ embedding_weight:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The weight of the embedding in the reciprocal ranking fusion.
+ text_weight:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The weight of the text in the reciprocal ranking fusion.
+ OpenAI.Image:
+ type: object
+ properties:
+ b64_json:
+ type: string
+ contentEncoding: base64
+ description: The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`.
+ url:
+ type: string
+ format: uri
+ description: 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 the GPT image models.
+ revised_prompt:
+ type: string
+ description: For `dall-e-3` only, the revised prompt that was used to generate the image.
+ description: Represents the content or the URL of an image generated by the OpenAI API.
+ OpenAI.ImageDetail:
+ type: string
+ enum:
+ - low
+ - high
+ - auto
+ - original
+ OpenAI.ImageGenActionEnum:
+ type: string
+ enum:
+ - generate
+ - edit
+ - auto
+ OpenAI.ImageGenInputUsageDetails:
+ type: object
+ required:
+ - text_tokens
+ - image_tokens
+ properties:
+ text_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of text tokens in the input prompt.
+ image_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of image tokens in the input prompt.
+ description: The input tokens detailed information for the image generation.
+ title: Input usage details
+ OpenAI.ImageGenOutputTokensDetails:
+ type: object
+ required:
+ - image_tokens
+ - text_tokens
+ properties:
+ image_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of image output tokens generated by the model.
+ text_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of text output tokens generated by the model.
+ description: The output token details for the image generation.
+ title: Image generation output token details
+ OpenAI.ImageGenTool:
type: object
required:
- type
- - template
properties:
type:
type: string
enum:
- - template
- template:
- type: array
- items:
- anyOf:
- - type: object
- properties:
- role:
- type: string
- content:
- type: string
- required:
- - role
- - content
- - $ref: '#/components/schemas/OpenAI.EvalItem'
- OpenAI.CreateEvalResponsesRunDataSourceSamplingParams:
- type: object
- properties:
- reasoning_effort:
+ - image_generation
+ description: The type of the image generation tool. Always `image_generation`.
+ x-stainless-const: true
+ model:
anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: string
+ - type: string
+ enum:
+ - gpt-image-1
+ - gpt-image-1-mini
+ - gpt-image-1.5
+ default: gpt-image-1
+ quality:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ - auto
+ description: |-
+ The quality of the generated image. One of `low`, `medium`, `high`,
+ or `auto`. Default: `auto`.
+ default: auto
+ size:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - 1024x1024
+ - 1024x1536
+ - 1536x1024
+ - auto
+ description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ default: auto
+ output_format:
+ type: string
+ enum:
+ - png
+ - webp
+ - jpeg
+ description: |-
+ The output format of the generated image. One of `png`, `webp`, or
+ `jpeg`. Default: `png`.
+ default: png
+ output_compression:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
+ maximum: 100
+ description: 'Compression level for the output image. Default: 100.'
+ default: 100
+ moderation:
+ type: string
+ enum:
+ - auto
+ - low
+ description: 'Moderation level for the generated image. Default: `auto`.'
+ default: auto
+ background:
+ type: string
+ enum:
+ - transparent
+ - opaque
+ - auto
+ description: |-
+ Background type for the generated image. One of `transparent`,
+ `opaque`, or `auto`. Default: `auto`.
+ default: auto
+ input_fidelity:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.InputFidelity'
- type: 'null'
- temperature:
- $ref: '#/components/schemas/OpenAI.numeric'
- default: 1
- max_completion_tokens:
+ input_image_mask:
+ $ref: '#/components/schemas/OpenAI.ImageGenToolInputImageMask'
+ description: |-
+ Optional mask for inpainting. Contains `image_url`
+ (string, optional) and `file_id` (string, optional).
+ partial_images:
$ref: '#/components/schemas/OpenAI.integer'
- top_p:
- $ref: '#/components/schemas/OpenAI.numeric'
- default: 1
- seed:
+ minimum: 0
+ maximum: 3
+ description: Number of partial images to generate in streaming mode, from 0 (default value) to 3.
+ action:
+ $ref: '#/components/schemas/OpenAI.ImageGenActionEnum'
+ description: 'Whether to generate a new image or edit an existing image. Default: `auto`.'
+ name:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that generates images using the GPT image models.
+ title: Image generation tool
+ OpenAI.ImageGenToolInputImageMask:
+ type: object
+ properties:
+ image_url:
+ type: string
+ format: uri
+ file_id:
+ type: string
+ OpenAI.ImageGenUsage:
+ type: object
+ required:
+ - input_tokens
+ - total_tokens
+ - output_tokens
+ - input_tokens_details
+ properties:
+ input_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- default: 42
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- text:
- $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText'
- OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText:
+ description: The number of tokens (images and text) in the input prompt.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total number of tokens (images and text) used for the image generation.
+ output_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of output tokens generated by the model.
+ output_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ImageGenOutputTokensDetails'
+ input_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ImageGenInputUsageDetails'
+ description: For `gpt-image-1` only, the token usage information for the image generation.
+ title: Image generation usage
+ OpenAI.ImageRefParam:
+ anyOf:
+ - type: object
+ properties:
+ image_url:
+ type: string
+ format: uri
+ maxLength: 20971520
+ required:
+ - image_url
+ - type: object
+ properties:
+ file_id:
+ type: string
+ required:
+ - file_id
+ description: |-
+ Reference an input image by either URL or uploaded file ID.
+ Provide exactly one of `image_url` or `file_id`.
+ OpenAI.ImagesResponse:
type: object
+ required:
+ - created
properties:
- format:
- $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- OpenAI.CreateEvalStoredCompletionsDataSourceConfig:
+ created:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) of when the image was created.
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Image'
+ description: The list of generated images.
+ background:
+ type: string
+ enum:
+ - transparent
+ - opaque
+ description: The background parameter used for the image generation. Either `transparent` or `opaque`.
+ output_format:
+ type: string
+ enum:
+ - png
+ - webp
+ - jpeg
+ description: The output format of the image generation. Either `png`, `webp`, or `jpeg`.
+ size:
+ type: string
+ enum:
+ - 1024x1024
+ - 1024x1536
+ - 1536x1024
+ description: The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`.
+ quality:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ description: The quality of the image generated. Either `low`, `medium`, or `high`.
+ usage:
+ $ref: '#/components/schemas/OpenAI.ImageGenUsage'
+ description: The response from the image generation endpoint.
+ title: Image generation response
+ x-oaiMeta:
+ name: The image generation response
+ group: images
+ example: |
+ {
+ "created": 1713833628,
+ "data": [
+ {
+ "b64_json": "..."
+ }
+ ],
+ "background": "transparent",
+ "output_format": "png",
+ "size": "1024x1024",
+ "quality": "high",
+ "usage": {
+ "total_tokens": 100,
+ "input_tokens": 50,
+ "output_tokens": 50,
+ "input_tokens_details": {
+ "text_tokens": 10,
+ "image_tokens": 40
+ }
+ }
+ }
+ OpenAI.IncludeEnum:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - file_search_call.results
+ - web_search_call.results
+ - web_search_call.action.sources
+ - message.input_image.image_url
+ - computer_call_output.output.image_url
+ - code_interpreter_call.outputs
+ - reasoning.encrypted_content
+ - message.output_text.logprobs
+ - memory_search_call.results
+ description: |-
+ Specify additional output data to include in the model response. Currently supported values are:
+ - `web_search_call.results`: Include the search results of the web search tool call.
+ - `web_search_call.action.sources`: Include the sources of the web search tool call.
+ - `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).
+ OpenAI.InlineSkillParam:
type: object
required:
- type
+ - name
+ - description
+ - source
properties:
type:
type: string
enum:
- - stored_completions
- description: The type of data source. Always `stored_completions`.
+ - inline
+ description: Defines an inline skill for this request.
x-stainless-const: true
- default: stored_completions
- metadata:
- type: object
- unevaluatedProperties: {}
- description: Metadata filters for the stored completions data source.
- description: Deprecated in favor of LogsDataSourceConfig.
- title: StoredCompletionsDataSourceConfig
- deprecated: true
- x-oaiMeta:
- name: The stored completions data source object for evals
- group: evals
- example: |
- {
- "type": "stored_completions",
- "metadata": {
- "use_case": "customer_support_agent"
- }
- }
- OpenAI.CreateFineTuningJobRequest:
+ name:
+ type: string
+ description: The name of the skill.
+ description:
+ type: string
+ description: The description of the skill.
+ source:
+ $ref: '#/components/schemas/OpenAI.InlineSkillSourceParam'
+ description: Inline skill payload
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerSkill'
+ OpenAI.InlineSkillSourceParam:
type: object
required:
- - model
- - training_file
+ - type
+ - media_type
+ - data
properties:
- model:
- anyOf:
- - type: string
- - type: string
- enum:
- - babbage-002
- - davinci-002
- - gpt-3.5-turbo
- - gpt-4o-mini
- description: |-
- The name of the model to fine-tune. You can select one of the
- [supported models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned).
- x-oaiTypeLabel: string
- training_file:
+ type:
+ type: string
+ enum:
+ - base64
+ description: The type of the inline skill source. Must be `base64`.
+ x-stainless-const: true
+ default: base64
+ media_type:
+ type: string
+ enum:
+ - application/zip
+ description: The media type of the inline skill payload. Must be `application/zip`.
+ x-stainless-const: true
+ default: application/zip
+ data:
type: string
- description: |-
- The ID of an uploaded file that contains training data.
- See [upload file](/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](/docs/api-reference/fine-tuning/chat-input), [completions](/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](/docs/api-reference/fine-tuning/preference-input) format.
- See the [fine-tuning guide](/docs/guides/model-optimization) for more details.
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters'
- description: |-
- 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: true
- suffix:
- anyOf:
- - type: string
- - type: 'null'
minLength: 1
- maxLength: 64
- description: |-
- 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`.
- validation_file:
- anyOf:
- - type: string
- - type: 'null'
- description: |-
- 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](/docs/guides/model-optimization) for more details.
- integrations:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations'
- - type: 'null'
- description: A list of integrations to enable for your fine-tuning job.
- seed:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- minimum: 0
- maximum: 2147483647
- description: |-
- 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.
- method:
- $ref: '#/components/schemas/OpenAI.FineTuneMethod'
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- OpenAI.CreateFineTuningJobRequestHyperparameters:
- type: object
- properties:
- batch_size:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- default: auto
- learning_rate_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- default: auto
- n_epochs:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- default: auto
- OpenAI.CreateFineTuningJobRequestIntegrations:
+ maxLength: 70254592
+ description: Base64-encoded skill zip bundle.
+ description: Inline skill payload
+ OpenAI.InputAudio:
type: object
required:
- type
- - wandb
+ - input_audio
properties:
type:
type: string
enum:
- - wandb
+ - input_audio
+ description: The type of the input item. Always `input_audio`.
x-stainless-const: true
- wandb:
- $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb'
- OpenAI.CreateFineTuningJobRequestIntegrationsWandb:
+ input_audio:
+ $ref: '#/components/schemas/OpenAI.InputAudioInputAudio'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: An audio input to the model.
+ title: Input audio
+ OpenAI.InputAudioInputAudio:
type: object
required:
- - project
+ - data
+ - format
properties:
- project:
+ data:
type: string
- name:
- anyOf:
- - type: string
- - type: 'null'
- entity:
- anyOf:
- - type: string
- - type: 'null'
- tags:
- type: array
- items:
- type: string
- OpenAI.CreateResponseStreamingResponse:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCreatedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseErrorEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFailedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseIncompleteEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseTextDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseQueuedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseAudioDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseContentPartDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseOutputItemDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseRefusalDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseTextDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent'
- OpenAI.CustomGrammarFormatParam:
+ format:
+ type: string
+ enum:
+ - mp3
+ - wav
+ OpenAI.InputContent:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.InputContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ input_text: '#/components/schemas/OpenAI.InputContentInputTextContent'
+ input_image: '#/components/schemas/OpenAI.InputContentInputImageContent'
+ input_file: '#/components/schemas/OpenAI.InputContentInputFileContent'
+ OpenAI.InputContentInputFileContent:
type: object
required:
- type
- - syntax
- - definition
properties:
type:
type: string
enum:
- - grammar
- description: Grammar format. Always `grammar`.
+ - input_file
+ description: The type of the input item. Always `input_file`.
x-stainless-const: true
- syntax:
- $ref: '#/components/schemas/OpenAI.GrammarSyntax1'
- description: The syntax of the grammar definition. One of `lark` or `regex`.
- definition:
+ default: input_file
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ filename:
type: string
- description: The grammar definition.
+ description: The name of the file to be sent to the model.
+ file_data:
+ type: string
+ description: The content of the file to be sent to the model.
+ file_url:
+ type: string
+ format: uri
+ description: The URL of the file to be sent to the model.
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
allOf:
- - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
- description: A grammar defined by the user.
- title: Grammar format
- OpenAI.CustomTextFormatParam:
+ - $ref: '#/components/schemas/OpenAI.InputContent'
+ description: A file input to the model.
+ title: Input file
+ OpenAI.InputContentInputImageContent:
type: object
required:
- type
+ - detail
properties:
type:
type: string
enum:
- - text
- description: Unconstrained text format. Always `text`.
+ - input_image
+ description: The type of the input item. Always `input_image`.
x-stainless-const: true
+ default: input_image
+ image_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
- description: Unconstrained free-form text.
- title: Text format
- OpenAI.CustomToolParam:
+ - $ref: '#/components/schemas/OpenAI.InputContent'
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
+ title: Input image
+ OpenAI.InputContentInputTextContent:
type: object
required:
- type
- - name
+ - text
properties:
type:
type: string
enum:
- - custom
- description: The type of the custom tool. Always `custom`.
+ - input_text
+ description: The type of the input item. Always `input_text`.
x-stainless-const: true
- name:
- type: string
- description: The name of the custom tool, used to identify it in tool calls.
- description:
+ default: input_text
+ text:
type: string
- description: Optional description of the custom tool, used to provide more context.
- format:
- $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
- description: The input format for the custom tool. Default is unconstrained text.
- defer_loading:
- type: boolean
- description: Whether this tool should be deferred and discovered via tool search.
+ description: The text input to the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)
- title: Custom tool
- OpenAI.CustomToolParamFormat:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.CustomToolParamFormatType'
- discriminator:
- propertyName: type
- mapping:
- text: '#/components/schemas/OpenAI.CustomTextFormatParam'
- grammar: '#/components/schemas/OpenAI.CustomGrammarFormatParam'
- description: The input format for the custom tool. Default is unconstrained text.
- OpenAI.CustomToolParamFormatType:
+ - $ref: '#/components/schemas/OpenAI.InputContent'
+ description: A text input to the model.
+ title: Input text
+ OpenAI.InputContentType:
anyOf:
- type: string
- type: string
enum:
- - text
- - grammar
- OpenAI.DeletedConversationResource:
- type: object
- required:
- - object
- - deleted
- - id
- properties:
- object:
- type: string
- enum:
- - conversation.deleted
- x-stainless-const: true
- default: conversation.deleted
- deleted:
- type: boolean
- id:
- type: string
- OpenAI.DetailEnum:
+ - input_text
+ - input_image
+ - input_file
+ OpenAI.InputFidelity:
type: string
enum:
- - low
- high
- - auto
- - original
- OpenAI.DoubleClickAction:
+ - low
+ description: Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.
+ OpenAI.InputFileContent:
type: object
required:
- type
- - x
- - 'y'
- - keys
properties:
type:
type: string
enum:
- - double_click
- description: Specifies the event type. For a double click action, this property is always set to `double_click`.
+ - input_file
+ description: The type of the input item. Always `input_file`.
x-stainless-const: true
- x:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate where the double click occurred.
- 'y':
- $ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate where the double click occurred.
- keys:
+ default: input_file
+ file_id:
anyOf:
- - type: array
- items:
- type: string
+ - type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A double click action.
- title: DoubleClick
- OpenAI.DragParam:
+ filename:
+ type: string
+ description: The name of the file to be sent to the model.
+ file_data:
+ type: string
+ description: The content of the file to be sent to the model.
+ file_url:
+ type: string
+ format: uri
+ description: The URL of the file to be sent to the model.
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
+ description: A file input to the model.
+ title: Input file
+ OpenAI.InputFileContentParam:
type: object
required:
- type
- - path
properties:
type:
type: string
enum:
- - drag
- description: Specifies the event type. For a drag action, this property is always set to `drag`.
+ - input_file
+ description: The type of the input item. Always `input_file`.
x-stainless-const: true
- path:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.CoordParam'
- description: |-
- 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 }
- ]
- ```
- keys:
+ default: input_file
+ file_id:
anyOf:
- - type: array
- items:
- type: string
+ - type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A drag action.
- title: Drag
- OpenAI.EasyInputMessage:
+ filename:
+ anyOf:
+ - type: string
+ - type: 'null'
+ file_data:
+ anyOf:
+ - type: string
+ - type: 'null'
+ file_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
+ description: A file input to the model.
+ title: Input file
+ OpenAI.InputImageContent:
type: object
required:
- - role
- - content
- type
+ - detail
properties:
- role:
+ type:
type: string
enum:
- - user
- - assistant
- - system
- - developer
- description: |-
- The role of the message input. One of `user`, `assistant`, `system`, or
- `developer`.
- content:
- oneOf:
+ - input_image
+ description: The type of the input item. Always `input_image`.
+ x-stainless-const: true
+ default: input_image
+ image_url:
+ anyOf:
- type: string
- - $ref: '#/components/schemas/OpenAI.InputMessageContentList'
- description: |-
- Text, image, or audio input to the model, used to generate a response.
- Can also contain previous assistant responses.
- phase:
+ format: uri
+ - type: 'null'
+ file_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
+ - type: string
- type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
+ title: Input image
+ OpenAI.InputImageContentParamAutoParam:
+ type: object
+ required:
+ - type
+ properties:
type:
type: string
enum:
- - message
- description: The type of the message input. Always `message`.
+ - input_image
+ description: The type of the input item. Always `input_image`.
x-stainless-const: true
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: |-
- 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.
- title: Input message
- OpenAI.EmptyModelParam:
- type: object
- OpenAI.Error:
- type: object
- required:
- - code
- - message
- properties:
- code:
+ default: input_image
+ image_url:
anyOf:
- type: string
+ format: uri
- type: 'null'
- message:
- type: string
- param:
+ file_id:
anyOf:
- type: string
- type: 'null'
- type:
- type: string
- details:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Error'
- additionalInfo:
- type: object
- unevaluatedProperties: {}
- debugInfo:
- type: object
- unevaluatedProperties: {}
- OpenAI.EvalApiError:
+ detail:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.DetailEnum'
+ - type: 'null'
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision)
+ title: Input image
+ OpenAI.InputItem:
type: object
required:
- - code
- - message
+ - type
properties:
- code:
- type: string
- description: The error code.
- message:
- type: string
- description: The error message.
- description: An object representing an error response from the Eval API.
- title: EvalApiError
- x-oaiMeta:
- name: The API error object
- group: evals
- example: |
- {
- "code": "internal_error",
- "message": "The eval run failed due to an internal error."
- }
- OpenAI.EvalGraderLabelModel:
+ type:
+ $ref: '#/components/schemas/OpenAI.InputItemType'
+ discriminator:
+ propertyName: type
+ mapping:
+ message: '#/components/schemas/OpenAI.EasyInputMessage'
+ item_reference: '#/components/schemas/OpenAI.ItemReferenceParam'
+ output_message: '#/components/schemas/OpenAI.InputItemOutputMessage'
+ file_search_call: '#/components/schemas/OpenAI.InputItemFileSearchToolCall'
+ computer_call: '#/components/schemas/OpenAI.InputItemComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.InputItemComputerCallOutputItemParam'
+ web_search_call: '#/components/schemas/OpenAI.InputItemWebSearchToolCall'
+ function_call: '#/components/schemas/OpenAI.InputItemFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.InputItemFunctionCallOutputItemParam'
+ tool_search_call: '#/components/schemas/OpenAI.InputItemToolSearchCallItemParam'
+ tool_search_output: '#/components/schemas/OpenAI.InputItemToolSearchOutputItemParam'
+ additional_tools: '#/components/schemas/OpenAI.InputItemAdditionalToolsItemParam'
+ reasoning: '#/components/schemas/OpenAI.InputItemReasoningItem'
+ compaction: '#/components/schemas/OpenAI.InputItemCompactionSummaryItemParam'
+ image_generation_call: '#/components/schemas/OpenAI.InputItemImageGenToolCall'
+ code_interpreter_call: '#/components/schemas/OpenAI.InputItemCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.InputItemLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.InputItemLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.InputItemFunctionShellCallItemParam'
+ shell_call_output: '#/components/schemas/OpenAI.InputItemFunctionShellCallOutputItemParam'
+ apply_patch_call: '#/components/schemas/OpenAI.InputItemApplyPatchToolCallItemParam'
+ apply_patch_call_output: '#/components/schemas/OpenAI.InputItemApplyPatchToolCallOutputItemParam'
+ mcp_list_tools: '#/components/schemas/OpenAI.InputItemMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.InputItemMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.InputItemMcpApprovalResponse'
+ mcp_call: '#/components/schemas/OpenAI.InputItemMcpToolCall'
+ custom_tool_call_output: '#/components/schemas/OpenAI.InputItemCustomToolCallOutput'
+ custom_tool_call: '#/components/schemas/OpenAI.InputItemCustomToolCall'
+ description: |-
+ An item representing part of the context for the response to be
+ generated by the model. Can contain text, images, and audio inputs,
+ as well as previous assistant responses and tool call outputs.
+ OpenAI.InputItemAdditionalToolsItemParam:
type: object
required:
- type
- - name
- - model
- - input
- - labels
- - passing_labels
+ - role
+ - tools
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- - label_model
- description: The object type, which is always `label_model`.
+ - additional_tools
+ description: The item type. Always `additional_tools`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- model:
+ default: additional_tools
+ role:
type: string
- description: The model to use for the evaluation. Must support structured outputs.
- input:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalItem'
- labels:
- type: array
- items:
- type: string
- description: The labels to assign to each item in the evaluation.
- passing_labels:
+ enum:
+ - developer
+ description: The role that provided the additional tools. Only `developer` is supported.
+ x-stainless-const: true
+ default: developer
+ tools:
type: array
items:
- type: string
- description: The labels that indicate a passing result. Must be a subset of labels.
- title: LabelModelGrader
- OpenAI.EvalGraderPython:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: A list of additional tools made available at this item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ OpenAI.InputItemApplyPatchToolCallItemParam:
type: object
required:
- type
- - name
- - source
+ - call_id
+ - status
+ - operation
properties:
type:
type: string
enum:
- - python
- description: The object type, which is always `python`.
+ - apply_patch_call
+ description: The type of the item. Always `apply_patch_call`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- source:
- type: string
- description: The source code of the python script.
- image_tag:
+ default: apply_patch_call
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
type: string
- description: The image tag to use for the python script.
- pass_threshold:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The threshold for the score.
- title: PythonGrader
- OpenAI.EvalGraderScoreModel:
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatusParam'
+ description: The status of the apply patch tool call. One of `in_progress` or `completed`.
+ operation:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: The specific create, delete, or update instruction for the apply_patch tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A tool call representing a request to create, delete, or update files using diff patches.
+ title: Apply patch tool call
+ OpenAI.InputItemApplyPatchToolCallOutputItemParam:
type: object
required:
- type
- - name
- - model
- - input
+ - call_id
+ - status
properties:
type:
type: string
enum:
- - score_model
- description: The object type, which is always `score_model`.
+ - apply_patch_call_output
+ description: The type of the item. Always `apply_patch_call_output`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- model:
- type: string
- description: The model to use for the evaluation.
- sampling_params:
- $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams'
- description: The sampling parameters for the model.
- input:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalItem'
- description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
- range:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The range of the score. Defaults to `[0, 1]`.
- pass_threshold:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The threshold for the score.
- title: ScoreModelGrader
- OpenAI.EvalGraderScoreModelSamplingParams:
- type: object
- properties:
- seed:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- max_completions_tokens:
+ default: apply_patch_call_output
+ id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
- type: 'null'
- reasoning_effort:
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam'
+ description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ output:
anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: string
- type: 'null'
- OpenAI.EvalGraderStringCheck:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The streamed output emitted by an apply patch tool call.
+ title: Apply patch tool call output
+ OpenAI.InputItemCodeInterpreterToolCall:
type: object
required:
- type
- - name
- - input
- - reference
- - operation
+ - id
+ - status
+ - container_id
+ - code
+ - outputs
properties:
type:
type: string
enum:
- - string_check
- description: The object type, which is always `string_check`.
+ - code_interpreter_call
+ description: The type of the code interpreter tool call. Always `code_interpreter_call`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- input:
- type: string
- description: The input text. This may include template strings.
- reference:
+ default: code_interpreter_call
+ id:
type: string
- description: The reference text. This may include template strings.
- operation:
+ description: The unique ID of the code interpreter tool call.
+ status:
type: string
enum:
- - eq
- - ne
- - like
- - ilike
- description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
- title: StringCheckGrader
- OpenAI.EvalGraderTextSimilarity:
+ - in_progress
+ - completed
+ - incomplete
+ - interpreting
+ - failed
+ description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
+ container_id:
+ type: string
+ description: The ID of the container used to run the code.
+ code:
+ anyOf:
+ - type: string
+ - type: 'null'
+ outputs:
+ anyOf:
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A tool call to run code.
+ title: Code interpreter tool call
+ OpenAI.InputItemCompactionSummaryItemParam:
type: object
required:
- type
- - name
- - input
- - reference
- - evaluation_metric
- - pass_threshold
+ - encrypted_content
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- - text_similarity
- description: The type of grader.
+ - compaction
+ description: The type of the item. Always `compaction`.
x-stainless-const: true
- default: text_similarity
- name:
- type: string
- description: The name of the grader.
- input:
- type: string
- description: The text being graded.
- reference:
- type: string
- description: The text being graded against.
- evaluation_metric:
+ default: compaction
+ encrypted_content:
type: string
- enum:
- - cosine
- - fuzzy_match
- - bleu
- - gleu
- - meteor
- - rouge_1
- - rouge_2
- - rouge_3
- - rouge_4
- - rouge_5
- - rouge_l
- description: |-
- 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`.
- pass_threshold:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The threshold for the score.
- title: TextSimilarityGrader
- OpenAI.EvalItem:
+ maxLength: 10485760
+ description: The encrypted content of the compaction summary.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
+ title: Compaction item
+ OpenAI.InputItemComputerCallOutputItemParam:
type: object
required:
- - role
- - content
+ - call_id
+ - type
+ - output
properties:
- role:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
type: string
- enum:
- - user
- - assistant
- - system
- - developer
- description: |-
- The role of the message input. One of `user`, `assistant`, `system`, or
- `developer`.
- content:
- $ref: '#/components/schemas/OpenAI.EvalItemContent'
+ minLength: 1
+ maxLength: 64
+ description: The ID of the computer tool call that produced the output.
type:
type: string
enum:
- - message
- description: The type of the message input. Always `message`.
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
x-stainless-const: true
- description: |-
- 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.
- title: Eval message object
- OpenAI.EvalItemContent:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItem'
- - $ref: '#/components/schemas/OpenAI.EvalItemContentArray'
- description: Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
- title: Eval content
- OpenAI.EvalItemContentArray:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalItemContentItem'
- description: |-
- A list of inputs, each of which may be either an input text, output text, input
- image, or input audio object.
- title: An array of Input text, Output text, Input image, and Input audio
- OpenAI.EvalItemContentItem:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentText'
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: 'A single content item: input text, output text, input image, or input audio.'
- title: Eval content item
- OpenAI.EvalItemContentItemObject:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.EvalItemContentItemObjectType'
- discriminator:
- propertyName: type
- mapping:
- output_text: '#/components/schemas/OpenAI.EvalItemContentOutputText'
- input_image: '#/components/schemas/OpenAI.EvalItemInputImage'
- input_audio: '#/components/schemas/OpenAI.InputAudio'
- input_text: '#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent'
- description: 'A single content item: input text, output text, input image, or input audio.'
- title: Eval content item
- OpenAI.EvalItemContentItemObjectInputTextContent:
+ default: computer_call_output
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ acknowledged_safety_checks:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ - type: 'null'
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.InputItemComputerToolCall:
type: object
required:
- type
- - text
+ - id
+ - call_id
+ - pending_safety_checks
+ - status
properties:
type:
type: string
enum:
- - input_text
- description: The type of the input item. Always `input_text`.
- x-stainless-const: true
- default: input_text
- text:
+ - computer_call
+ description: The type of the computer call. Always `computer_call`.
+ default: computer_call
+ id:
+ type: string
+ description: The unique ID of the computer call.
+ call_id:
+ type: string
+ description: An identifier used when responding to the tool call with output.
+ action:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ actions:
+ $ref: '#/components/schemas/OpenAI.ComputerActionList'
+ pending_safety_checks:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: The pending safety checks for the computer call.
+ status:
type: string
- description: The text input to the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: A text input to the model.
- title: Input text
- OpenAI.EvalItemContentItemObjectType:
- anyOf:
- - type: string
- - type: string
enum:
- - input_text
- - output_text
- - input_image
- - input_audio
- OpenAI.EvalItemContentOutputText:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ A tool call to a computer use tool. See the
+ [computer use guide](/docs/guides/tools-computer-use) for more information.
+ title: Computer tool call
+ OpenAI.InputItemCustomToolCall:
type: object
required:
- type
- - text
+ - call_id
+ - name
+ - input
properties:
type:
type: string
enum:
- - output_text
- description: The type of the output text. Always `output_text`.
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
x-stainless-const: true
- text:
+ id:
type: string
- description: The text output from the model.
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
+ type: string
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
+ type: string
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: A text output from the model.
- title: Output text
- OpenAI.EvalItemContentText:
- type: string
- description: A text input to the model.
- title: Text input
- OpenAI.EvalItemInputImage:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A call to a custom tool created by the model.
+ title: Custom tool call
+ OpenAI.InputItemCustomToolCallOutput:
type: object
required:
- type
- - image_url
+ - call_id
+ - output
properties:
type:
type: string
enum:
- - input_image
- description: The type of the image input. Always `input_image`.
+ - custom_tool_call_output
+ description: The type of the custom tool call output. Always `custom_tool_call_output`.
x-stainless-const: true
- image_url:
+ id:
type: string
- format: uri
- description: The URL of the image input.
- detail:
+ description: The unique ID of the custom tool call output in the OpenAI platform.
+ call_id:
type: string
- description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
+ description: The call ID, used to map this custom tool call output to a custom tool call.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the custom tool call generated by your code.
+ Can be a string or an list of output content.
allOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: An image input block used within EvalItem content arrays.
- title: Input image
- OpenAI.EvalJsonlFileContentSource:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The output of a custom tool call from your code, being sent back to the model.
+ title: Custom tool call output
+ OpenAI.InputItemFileSearchToolCall:
type: object
required:
+ - id
- type
- - content
+ - status
+ - queries
properties:
+ id:
+ type: string
+ description: The unique ID of the file search tool call.
type:
type: string
enum:
- - file_content
- description: The type of jsonl source. Always `file_content`.
+ - file_search_call
+ description: The type of the file search tool call. Always `file_search_call`.
x-stainless-const: true
- default: file_content
- content:
+ status:
+ type: string
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - incomplete
+ - failed
+ description: |-
+ The status of the file search tool call. One of `in_progress`,
+ `searching`, `incomplete` or `failed`,
+ queries:
type: array
items:
- $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent'
- description: The content of the jsonl file.
- title: EvalJsonlFileContentSource
- OpenAI.EvalJsonlFileContentSourceContent:
- type: object
- required:
- - item
- properties:
- item:
- type: object
- unevaluatedProperties: {}
- sample:
- type: object
- unevaluatedProperties: {}
- OpenAI.EvalJsonlFileIdSource:
+ type: string
+ description: The queries used to search for files.
+ results:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ The results of a file search tool call. See the
+ [file search guide](/docs/guides/tools-file-search) for more information.
+ title: File search tool call
+ OpenAI.InputItemFunctionCallOutputItemParam:
type: object
required:
+ - call_id
- type
- - id
+ - output
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the function tool call generated by the model.
type:
type: string
enum:
- - file_id
- description: The type of jsonl source. Always `file_id`.
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
x-stainless-const: true
- default: file_id
- id:
- type: string
- description: The identifier of the file.
- title: EvalJsonlFileIdSource
- OpenAI.EvalResponsesSource:
+ default: function_call_output
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.InputTextContentParam'
+ - $ref: '#/components/schemas/OpenAI.InputImageContentParamAutoParam'
+ - $ref: '#/components/schemas/OpenAI.InputFileContentParam'
+ description: Text, image, or file output of the function tool call.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.InputItemFunctionShellCallItemParam:
type: object
required:
+ - call_id
- type
+ - action
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the shell tool call generated by the model.
type:
type: string
enum:
- - responses
- description: The type of run data source. Always `responses`.
- metadata:
+ - shell_call
+ description: The type of the item. Always `shell_call`.
+ x-stainless-const: true
+ default: shell_call
+ action:
+ $ref: '#/components/schemas/OpenAI.FunctionShellActionParam'
+ description: The shell commands and limits that describe how to run the tool call.
+ status:
anyOf:
- - type: object
- unevaluatedProperties: {}
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- type: 'null'
- model:
+ environment:
anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
- type: 'null'
- instructions_search:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A tool representing a request to execute one or more shell commands.
+ title: Shell tool call
+ OpenAI.InputItemFunctionShellCallOutputItemParam:
+ type: object
+ required:
+ - call_id
+ - type
+ - output
+ properties:
+ id:
anyOf:
- type: string
- type: 'null'
- created_after:
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the shell tool call generated by the model.
+ type:
+ type: string
+ enum:
+ - shell_call_output
+ description: The type of the item. Always `shell_call_output`.
+ x-stainless-const: true
+ default: shell_call_output
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContentParam'
+ description: Captured chunks of stdout and stderr output, along with their associated outcomes.
+ status:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- type: 'null'
- created_before:
+ max_output_length:
anyOf:
- $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- reasoning_effort:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
- - type: 'null'
- description: Optional reasoning effort parameter. This is a query parameter used to select responses.
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- users:
- anyOf:
- - type: array
- items:
- type: string
- - type: 'null'
- tools:
- anyOf:
- - type: array
- items:
- type: string
- - type: 'null'
- description: A EvalResponsesSource object describing a run data source configuration.
- title: EvalResponsesSource
- x-oaiMeta:
- name: The run data source object used to configure an individual run
- group: eval runs
- example: |
- {
- "type": "responses",
- "model": "gpt-4o-mini-2024-07-18",
- "temperature": 0.7,
- "top_p": 1.0,
- "users": ["user1", "user2"],
- "tools": ["tool1", "tool2"],
- "instructions_search": "You are a coding assistant"
- }
- OpenAI.EvalRunOutputItemSample:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The streamed output items emitted by a shell tool call.
+ title: Shell tool call output
+ OpenAI.InputItemFunctionToolCall:
type: object
required:
- - input
- - output
- - finish_reason
- - model
- - usage
- - error
- - temperature
- - max_completion_tokens
- - top_p
- - seed
+ - id
+ - type
+ - call_id
+ - name
+ - arguments
properties:
- input:
- type: array
- items:
- $ref: '#/components/schemas/EvalRunOutputItemSampleInput'
- output:
- type: array
- items:
- $ref: '#/components/schemas/EvalRunOutputItemSampleOutput'
- finish_reason:
+ id:
type: string
- model:
+ description: The unique ID of the function tool call.
+ readOnly: true
+ type:
type: string
- usage:
- $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage'
- error:
- $ref: '#/components/schemas/OpenAI.EvalApiError'
- temperature:
- $ref: '#/components/schemas/OpenAI.numeric'
- max_completion_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- top_p:
- $ref: '#/components/schemas/OpenAI.numeric'
- seed:
- $ref: '#/components/schemas/OpenAI.integer'
- OpenAI.EvalRunOutputItemSampleUsage:
+ enum:
+ - function_call
+ description: The type of the function tool call. Always `function_call`.
+ x-stainless-const: true
+ call_id:
+ type: string
+ description: The unique ID of the function tool call generated by the model.
+ namespace:
+ type: string
+ description: The namespace of the function to run.
+ name:
+ type: string
+ description: The name of the function to run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the function.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ A tool call to run a function. See the
+ [function calling guide](/docs/guides/function-calling) for more information.
+ title: Function tool call
+ OpenAI.InputItemImageGenToolCall:
type: object
required:
- - total_tokens
- - completion_tokens
- - prompt_tokens
- - cached_tokens
+ - type
+ - id
+ - status
+ - result
properties:
- total_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- completion_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- prompt_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- cached_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- OpenAI.EvalRunPerModelUsage:
+ type:
+ type: string
+ enum:
+ - image_generation_call
+ description: The type of the image generation call. Always `image_generation_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the image generation call.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - generating
+ - failed
+ description: The status of the image generation call.
+ result:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: An image generation request made by the model.
+ title: Image generation call
+ OpenAI.InputItemLocalShellToolCall:
type: object
required:
- - model_name
- - invocation_count
- - prompt_tokens
- - completion_tokens
- - total_tokens
- - cached_tokens
+ - type
+ - id
+ - call_id
+ - action
+ - status
properties:
- model_name:
+ type:
type: string
- invocation_count:
- $ref: '#/components/schemas/OpenAI.integer'
- prompt_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- completion_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- total_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- cached_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- OpenAI.EvalRunPerTestingCriteriaResults:
+ enum:
+ - local_shell_call
+ description: The type of the local shell call. Always `local_shell_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the local shell call.
+ call_id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: The status of the local shell call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A tool call to run a command on the local shell.
+ title: Local shell call
+ OpenAI.InputItemLocalShellToolCallOutput:
type: object
required:
- - testing_criteria
- - passed
- - failed
+ - type
+ - id
+ - output
properties:
- testing_criteria:
+ type:
+ type: string
+ enum:
+ - local_shell_call_output
+ description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ x-stainless-const: true
+ id:
type: string
- passed:
- $ref: '#/components/schemas/OpenAI.integer'
- failed:
- $ref: '#/components/schemas/OpenAI.integer'
- errored:
- $ref: '#/components/schemas/integer'
- description: Number of tests that errored for this criteria.
- skipped:
- $ref: '#/components/schemas/integer'
- description: Number of tests that were skipped for this criteria.
- OpenAI.EvalRunResultCounts:
+ description: The unique ID of the local shell tool call generated by the model.
+ output:
+ type: string
+ description: A JSON string of the output of the local shell tool call.
+ status:
+ anyOf:
+ - type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The output of a local shell tool call.
+ title: Local shell call output
+ OpenAI.InputItemMcpApprovalRequest:
type: object
required:
- - total
- - errored
- - failed
- - passed
+ - type
+ - id
+ - server_label
+ - name
+ - arguments
properties:
- total:
- $ref: '#/components/schemas/OpenAI.integer'
- errored:
- $ref: '#/components/schemas/OpenAI.integer'
- failed:
- $ref: '#/components/schemas/OpenAI.integer'
- passed:
- $ref: '#/components/schemas/OpenAI.integer'
- skipped:
- $ref: '#/components/schemas/integer'
- description: Number of output items that were skipped during the evaluation.
- OpenAI.EvalStoredCompletionsSource:
+ type:
+ type: string
+ enum:
+ - mcp_approval_request
+ description: The type of the item. Always `mcp_approval_request`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the approval request.
+ server_label:
+ type: string
+ description: The label of the MCP server making the request.
+ name:
+ type: string
+ description: The name of the tool to run.
+ arguments:
+ type: string
+ description: A JSON string of arguments for the tool.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A request for human approval of a tool invocation.
+ title: MCP approval request
+ OpenAI.InputItemMcpApprovalResponse:
type: object
required:
- type
+ - approval_request_id
+ - approve
properties:
type:
type: string
enum:
- - stored_completions
- description: The type of source. Always `stored_completions`.
+ - mcp_approval_response
+ description: The type of the item. Always `mcp_approval_response`.
x-stainless-const: true
- default: stored_completions
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- model:
+ id:
anyOf:
- type: string
- type: 'null'
- created_after:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- created_before:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- limit:
+ approval_request_id:
+ type: string
+ description: The ID of the approval request being answered.
+ approve:
+ type: boolean
+ description: Whether the request was approved.
+ reason:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
- type: 'null'
- description: A StoredCompletionsRunDataSource configuration describing a set of filters
- title: StoredCompletionsRunDataSource
- x-oaiMeta:
- name: The stored completions data source object used to configure an individual run
- group: eval runs
- example: |
- {
- "type": "stored_completions",
- "model": "gpt-4o",
- "created_after": 1668124800,
- "created_before": 1668124900,
- "limit": 100,
- "metadata": {}
- }
- OpenAI.FileCitationBody:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A response to an MCP approval request.
+ title: MCP approval response
+ OpenAI.InputItemMcpListTools:
type: object
required:
- type
- - file_id
- - index
- - filename
+ - id
+ - server_label
+ - tools
properties:
type:
type: string
enum:
- - file_citation
- description: The type of the file citation. Always `file_citation`.
+ - mcp_list_tools
+ description: The type of the item. Always `mcp_list_tools`.
x-stainless-const: true
- file_id:
+ id:
type: string
- description: The ID of the file.
- index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the file in the list of files.
- filename:
+ description: The unique ID of the list.
+ server_label:
type: string
- description: The filename of the file cited.
+ description: The label of the MCP server.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
+ description: The tools available on the server.
+ error:
+ $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.Annotation'
- description: A citation to a file.
- title: File citation
- OpenAI.FileInputDetail:
- type: string
- enum:
- - low
- - high
- OpenAI.FilePath:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A list of tools available on an MCP server.
+ title: MCP list tools
+ OpenAI.InputItemMcpToolCall:
type: object
required:
- type
- - file_id
- - index
+ - id
+ - server_label
+ - name
+ - arguments
properties:
type:
type: string
enum:
- - file_path
- description: The type of the file path. Always `file_path`.
+ - mcp_call
+ description: The type of the item. Always `mcp_call`.
x-stainless-const: true
- file_id:
+ id:
type: string
- description: The ID of the file.
- index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the file in the list of files.
+ description: The unique ID of the tool call.
+ server_label:
+ type: string
+ description: The label of the MCP server running the tool.
+ name:
+ type: string
+ description: The name of the tool that was run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments passed to the tool.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ error:
+ type: object
+ unevaluatedProperties: {}
+ status:
+ $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
+ description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
+ approval_request_id:
+ anyOf:
+ - type: string
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Annotation'
- description: A path to a file.
- title: File path
- OpenAI.FileSearchTool:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: An invocation of a tool on an MCP server.
+ title: MCP tool call
+ OpenAI.InputItemOutputMessage:
type: object
required:
+ - id
- type
- - vector_store_ids
+ - role
+ - content
+ - status
properties:
+ id:
+ type: string
+ description: The unique ID of the output message.
type:
type: string
enum:
- - file_search
- description: The type of the file search tool. Always `file_search`.
+ - output_message
+ description: The type of the output message. Always `message`.
x-stainless-const: true
- vector_store_ids:
+ role:
+ type: string
+ enum:
+ - assistant
+ description: The role of the output message. Always `assistant`.
+ x-stainless-const: true
+ content:
type: array
items:
- type: string
- description: The IDs of the vector stores to search.
- max_num_results:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
- ranking_options:
- $ref: '#/components/schemas/OpenAI.RankingOptions'
- description: Ranking options for search.
- filters:
+ $ref: '#/components/schemas/OpenAI.OutputMessageContent'
+ description: The content of the output message.
+ phase:
anyOf:
- - $ref: '#/components/schemas/OpenAI.Filters'
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
- type: 'null'
- name:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
+ status:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: 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).
- title: File search
- OpenAI.FileSearchToolCallResults:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: An output message from the model.
+ title: Output message
+ OpenAI.InputItemReasoningItem:
type: object
+ required:
+ - type
+ - id
+ - summary
properties:
- file_id:
- type: string
- text:
+ type:
type: string
- filename:
+ enum:
+ - reasoning
+ description: The type of the object. Always `reasoning`.
+ x-stainless-const: true
+ id:
type: string
- attributes:
+ description: The unique identifier of the reasoning content.
+ encrypted_content:
anyOf:
- - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: string
- type: 'null'
- score:
- type: number
- format: float
- OpenAI.Filters:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
- - $ref: '#/components/schemas/OpenAI.CompoundFilter'
- OpenAI.FineTuneDPOHyperparameters:
+ summary:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: Reasoning summary content.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
+ description: Reasoning text content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ A description of the chain of thought used by a reasoning model while generating
+ a response. Be sure to include these items in your `input` to the Responses API
+ for subsequent turns of a conversation if you are manually
+ [managing context](/docs/guides/conversation-state).
+ title: Reasoning
+ OpenAI.InputItemToolSearchCallItemParam:
type: object
+ required:
+ - type
+ - arguments
properties:
- beta:
- oneOf:
+ id:
+ anyOf:
- type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
- default: auto
- batch_size:
- oneOf:
+ - type: 'null'
+ call_id:
+ anyOf:
- type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
- default: auto
- learning_rate_multiplier:
- oneOf:
+ - type: 'null'
+ type:
+ type: string
+ enum:
+ - tool_search_call
+ description: The item type. Always `tool_search_call`.
+ x-stainless-const: true
+ default: tool_search_call
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ arguments:
+ $ref: '#/components/schemas/OpenAI.EmptyModelParam'
+ description: The arguments supplied to the tool search call.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ OpenAI.InputItemToolSearchOutputItemParam:
+ type: object
+ required:
+ - type
+ - tools
+ properties:
+ id:
+ anyOf:
- type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
- default: auto
- n_epochs:
- oneOf:
+ - type: 'null'
+ call_id:
+ anyOf:
- type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
- default: auto
- description: The hyperparameters used for the DPO fine-tuning job.
- OpenAI.FineTuneDPOMethod:
+ - type: 'null'
+ type:
+ type: string
+ enum:
+ - tool_search_output
+ description: The item type. Always `tool_search_output`.
+ x-stainless-const: true
+ default: tool_search_output
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The loaded tool definitions returned by the tool search output.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ OpenAI.InputItemType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - message
+ - output_message
+ - file_search_call
+ - computer_call
+ - computer_call_output
+ - web_search_call
+ - function_call
+ - function_call_output
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - reasoning
+ - compaction
+ - image_generation_call
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - mcp_call
+ - custom_tool_call_output
+ - custom_tool_call
+ - item_reference
+ OpenAI.InputItemWebSearchToolCall:
type: object
+ required:
+ - id
+ - type
+ - status
+ - action
properties:
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.FineTuneDPOHyperparameters'
- description: Configuration for the DPO fine-tuning method.
- OpenAI.FineTuneMethod:
+ id:
+ type: string
+ description: The unique ID of the web search tool call.
+ type:
+ type: string
+ enum:
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
+ x-stainless-const: true
+ status:
+ type: string
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - failed
+ - incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ description: |-
+ 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_in_page).
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.InputMessageContentList:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.InputContent'
+ description: |-
+ A list of one or many input items to the model, containing different content
+ types.
+ title: Input item content list
+ OpenAI.InputParam:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ Text, image, or file inputs to the model, used to generate a response.
+ Learn more:
+ - [Text inputs and outputs](/docs/guides/text)
+ - [Image inputs](/docs/guides/images)
+ - [File inputs](/docs/guides/pdf-files)
+ - [Conversation state](/docs/guides/conversation-state)
+ - [Function calling](/docs/guides/function-calling)
+ OpenAI.InputTextContent:
type: object
required:
- type
+ - text
properties:
type:
type: string
enum:
- - supervised
- - dpo
- - reinforcement
- description: The type of method. Is either `supervised`, `dpo`, or `reinforcement`.
- supervised:
- $ref: '#/components/schemas/OpenAI.FineTuneSupervisedMethod'
- dpo:
- $ref: '#/components/schemas/OpenAI.FineTuneDPOMethod'
- reinforcement:
- $ref: '#/components/schemas/OpenAI.FineTuneReinforcementMethod'
- description: The method used for fine-tuning.
- OpenAI.FineTuneReinforcementHyperparameters:
+ - input_text
+ description: The type of the input item. Always `input_text`.
+ x-stainless-const: true
+ default: input_text
+ text:
+ type: string
+ description: The text input to the model.
+ description: A text input to the model.
+ title: Input text
+ OpenAI.InputTextContentParam:
type: object
+ required:
+ - type
+ - text
properties:
- batch_size:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
- default: auto
- learning_rate_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
- default: auto
- n_epochs:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
- default: auto
- reasoning_effort:
+ type:
type: string
enum:
- - default
- - low
- - medium
- - high
- description: Level of reasoning effort.
- default: default
- compute_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: Multiplier on amount of compute used for exploring search space during training.
- default: auto
- eval_interval:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: The number of training steps between evaluation runs.
- default: auto
- eval_samples:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: Number of evaluation samples to generate per training step.
- default: auto
- description: The hyperparameters used for the reinforcement fine-tuning job.
- OpenAI.FineTuneReinforcementMethod:
+ - input_text
+ description: The type of the input item. Always `input_text`.
+ x-stainless-const: true
+ default: input_text
+ text:
+ type: string
+ maxLength: 10485760
+ description: The text input to the model.
+ description: A text input to the model.
+ title: Input text
+ OpenAI.Item:
type: object
required:
- - grader
- properties:
- grader:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.GraderPython'
- - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
- - $ref: '#/components/schemas/OpenAI.GraderMulti'
- description: The grader used for the fine-tuning job.
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters'
- description: Configuration for the reinforcement fine-tuning method.
- OpenAI.FineTuneSupervisedHyperparameters:
- type: object
- properties:
- batch_size:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
- default: auto
- learning_rate_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
- default: auto
- n_epochs:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
- default: auto
- description: The hyperparameters used for the fine-tuning job.
- OpenAI.FineTuneSupervisedMethod:
- type: object
+ - type
properties:
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters'
- description: Configuration for the supervised fine-tuning method.
- OpenAI.FineTuningIntegration:
+ type:
+ $ref: '#/components/schemas/OpenAI.ItemType'
+ discriminator:
+ propertyName: type
+ mapping:
+ message: '#/components/schemas/OpenAI.ItemInputMessage'
+ output_message: '#/components/schemas/OpenAI.ItemOutputMessage'
+ file_search_call: '#/components/schemas/OpenAI.ItemFileSearchToolCall'
+ computer_call: '#/components/schemas/OpenAI.ItemComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.ItemComputerCallOutputItemParam'
+ web_search_call: '#/components/schemas/OpenAI.ItemWebSearchToolCall'
+ function_call: '#/components/schemas/OpenAI.ItemFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.ItemFunctionCallOutputItemParam'
+ tool_search_call: '#/components/schemas/OpenAI.ItemToolSearchCallItemParam'
+ tool_search_output: '#/components/schemas/OpenAI.ItemToolSearchOutputItemParam'
+ additional_tools: '#/components/schemas/OpenAI.ItemAdditionalToolsItemParam'
+ reasoning: '#/components/schemas/OpenAI.ItemReasoningItem'
+ compaction: '#/components/schemas/OpenAI.ItemCompactionSummaryItemParam'
+ image_generation_call: '#/components/schemas/OpenAI.ItemImageGenToolCall'
+ code_interpreter_call: '#/components/schemas/OpenAI.ItemCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.ItemLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.ItemLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.ItemFunctionShellCallItemParam'
+ shell_call_output: '#/components/schemas/OpenAI.ItemFunctionShellCallOutputItemParam'
+ apply_patch_call: '#/components/schemas/OpenAI.ItemApplyPatchToolCallItemParam'
+ apply_patch_call_output: '#/components/schemas/OpenAI.ItemApplyPatchToolCallOutputItemParam'
+ mcp_list_tools: '#/components/schemas/OpenAI.ItemMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.ItemMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.ItemMcpApprovalResponse'
+ mcp_call: '#/components/schemas/OpenAI.ItemMcpToolCall'
+ custom_tool_call_output: '#/components/schemas/OpenAI.ItemCustomToolCallOutput'
+ custom_tool_call: '#/components/schemas/OpenAI.ItemCustomToolCall'
+ description: Content item used to generate a response.
+ OpenAI.ItemAdditionalToolsItemParam:
type: object
required:
- type
- - wandb
+ - role
+ - tools
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- - wandb
- description: The type of the integration being enabled for the fine-tuning job
+ - additional_tools
+ description: The item type. Always `additional_tools`.
x-stainless-const: true
- wandb:
- $ref: '#/components/schemas/OpenAI.FineTuningIntegrationWandb'
- description: |-
- 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.
- title: Fine-Tuning Job Integration
- OpenAI.FineTuningIntegrationWandb:
+ default: additional_tools
+ role:
+ type: string
+ enum:
+ - developer
+ description: The role that provided the additional tools. Only `developer` is supported.
+ x-stainless-const: true
+ default: developer
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: A list of additional tools made available at this item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ OpenAI.ItemApplyPatchToolCallItemParam:
type: object
required:
- - project
+ - type
+ - call_id
+ - status
+ - operation
properties:
- project:
+ type:
type: string
- name:
- anyOf:
- - type: string
- - type: 'null'
- entity:
+ enum:
+ - apply_patch_call
+ description: The type of the item. Always `apply_patch_call`.
+ x-stainless-const: true
+ default: apply_patch_call
+ id:
anyOf:
- type: string
- type: 'null'
- tags:
- type: array
- items:
- type: string
- OpenAI.FineTuningJob:
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatusParam'
+ description: The status of the apply patch tool call. One of `in_progress` or `completed`.
+ operation:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: The specific create, delete, or update instruction for the apply_patch tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A tool call representing a request to create, delete, or update files using diff patches.
+ title: Apply patch tool call
+ OpenAI.ItemApplyPatchToolCallOutputItemParam:
type: object
required:
- - id
- - created_at
- - error
- - fine_tuned_model
- - finished_at
- - hyperparameters
- - model
- - object
- - organization_id
- - result_files
+ - type
+ - call_id
- status
- - trained_tokens
- - training_file
- - validation_file
- - seed
properties:
- id:
+ type:
type: string
- description: The object identifier, which can be referenced in the API endpoints.
- created_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) for when the fine-tuning job was created.
- error:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FineTuningJobError'
- - type: 'null'
- fine_tuned_model:
+ enum:
+ - apply_patch_call_output
+ description: The type of the item. Always `apply_patch_call_output`.
+ x-stainless-const: true
+ default: apply_patch_call_output
+ id:
anyOf:
- type: string
- type: 'null'
- finished_at:
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam'
+ description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ output:
anyOf:
- type: string
- format: date-time
- type: 'null'
- type: integer
- format: unixTimestamp
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.FineTuningJobHyperparameters'
- description: The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.
- model:
- type: string
- description: The base model that is being fine-tuned.
- object:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The streamed output emitted by an apply patch tool call.
+ title: Apply patch tool call output
+ OpenAI.ItemCodeInterpreterToolCall:
+ type: object
+ required:
+ - type
+ - id
+ - status
+ - container_id
+ - code
+ - outputs
+ properties:
+ type:
type: string
enum:
- - fine_tuning.job
- description: The object type, which is always "fine_tuning.job".
+ - code_interpreter_call
+ description: The type of the code interpreter tool call. Always `code_interpreter_call`.
x-stainless-const: true
- organization_id:
+ default: code_interpreter_call
+ id:
type: string
- description: The organization that owns the fine-tuning job.
- result_files:
- type: array
- items:
- type: string
- description: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents).
+ description: The unique ID of the code interpreter tool call.
status:
type: string
enum:
- - validating_files
- - queued
- - running
- - succeeded
+ - in_progress
+ - completed
+ - incomplete
+ - interpreting
- failed
- - cancelled
- description: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.
- trained_tokens:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- training_file:
+ description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
+ container_id:
type: string
- description: The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents).
- validation_file:
+ description: The ID of the container used to run the code.
+ code:
anyOf:
- type: string
- type: 'null'
- integrations:
+ outputs:
anyOf:
- type: array
items:
- $ref: '#/components/schemas/OpenAI.FineTuningIntegration'
- - type: 'null'
- seed:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The seed used for the fine-tuning job.
- estimated_finish:
- anyOf:
- - type: string
- format: date-time
- - type: 'null'
- type: integer
- format: unixTimestamp
- method:
- $ref: '#/components/schemas/OpenAI.FineTuneMethod'
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- type: 'null'
- description: The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.
- title: FineTuningJob
- x-oaiMeta:
- name: The fine-tuning job object
- example: |
- {
- "object": "fine_tuning.job",
- "id": "ftjob-abc123",
- "model": "davinci-002",
- "created_at": 1692661014,
- "finished_at": 1692661190,
- "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
- "organization_id": "org-123",
- "result_files": [
- "file-abc123"
- ],
- "status": "succeeded",
- "validation_file": null,
- "training_file": "file-abc123",
- "hyperparameters": {
- "n_epochs": 4,
- "batch_size": 1,
- "learning_rate_multiplier": 1.0
- },
- "trained_tokens": 5768,
- "integrations": [],
- "seed": 0,
- "estimated_finish": 0,
- "method": {
- "type": "supervised",
- "supervised": {
- "hyperparameters": {
- "n_epochs": 4,
- "batch_size": 1,
- "learning_rate_multiplier": 1.0
- }
- }
- },
- "metadata": {
- "key": "value"
- }
- }
- OpenAI.FineTuningJobCheckpoint:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A tool call to run code.
+ title: Code interpreter tool call
+ OpenAI.ItemCompactionSummaryItemParam:
type: object
required:
- - id
- - created_at
- - fine_tuned_model_checkpoint
- - step_number
- - metrics
- - fine_tuning_job_id
- - object
+ - type
+ - encrypted_content
properties:
id:
- type: string
- description: The checkpoint identifier, which can be referenced in the API endpoints.
- created_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) for when the checkpoint was created.
- fine_tuned_model_checkpoint:
- type: string
- description: The name of the fine-tuned checkpoint model that is created.
- step_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The step number that the checkpoint was created at.
- metrics:
- $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics'
- description: Metrics at the step number during the fine-tuning job.
- fine_tuning_job_id:
- type: string
- description: The name of the fine-tuning job that this checkpoint was created from.
- object:
+ anyOf:
+ - type: string
+ - type: 'null'
+ type:
type: string
enum:
- - fine_tuning.job.checkpoint
- description: The object type, which is always "fine_tuning.job.checkpoint".
- x-stainless-const: true
- description: The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.
- title: FineTuningJobCheckpoint
- x-oaiMeta:
- name: The fine-tuning job checkpoint object
- example: |
- {
- "object": "fine_tuning.job.checkpoint",
- "id": "ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P",
- "created_at": 1712211699,
- "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88",
- "fine_tuning_job_id": "ftjob-fpbNQ3H1GrMehXRf8cO97xTN",
- "metrics": {
- "step": 88,
- "train_loss": 0.478,
- "train_mean_token_accuracy": 0.924,
- "valid_loss": 10.112,
- "valid_mean_token_accuracy": 0.145,
- "full_valid_loss": 0.567,
- "full_valid_mean_token_accuracy": 0.944
- },
- "step_number": 88
- }
- OpenAI.FineTuningJobCheckpointMetrics:
- type: object
- properties:
- step:
- $ref: '#/components/schemas/OpenAI.numeric'
- train_loss:
- $ref: '#/components/schemas/OpenAI.numeric'
- train_mean_token_accuracy:
- $ref: '#/components/schemas/OpenAI.numeric'
- valid_loss:
- $ref: '#/components/schemas/OpenAI.numeric'
- valid_mean_token_accuracy:
- $ref: '#/components/schemas/OpenAI.numeric'
- full_valid_loss:
- $ref: '#/components/schemas/OpenAI.numeric'
- full_valid_mean_token_accuracy:
- $ref: '#/components/schemas/OpenAI.numeric'
- OpenAI.FineTuningJobError:
+ - compaction
+ description: The type of the item. Always `compaction`.
+ x-stainless-const: true
+ default: compaction
+ encrypted_content:
+ type: string
+ maxLength: 10485760
+ description: The encrypted content of the compaction summary.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
+ title: Compaction item
+ OpenAI.ItemComputerCallOutputItemParam:
type: object
required:
- - code
- - message
- - param
+ - call_id
+ - type
+ - output
properties:
- code:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
type: string
- message:
+ minLength: 1
+ maxLength: 64
+ description: The ID of the computer tool call that produced the output.
+ type:
type: string
- param:
+ enum:
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
+ x-stainless-const: true
+ default: computer_call_output
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ acknowledged_safety_checks:
anyOf:
- - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- type: 'null'
- OpenAI.FineTuningJobEvent:
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.ItemComputerToolCall:
type: object
required:
- - object
+ - type
- id
- - created_at
- - level
- - message
+ - call_id
+ - pending_safety_checks
+ - status
properties:
- object:
+ type:
type: string
enum:
- - fine_tuning.job.event
- description: The object type, which is always "fine_tuning.job.event".
- x-stainless-const: true
+ - computer_call
+ description: The type of the computer call. Always `computer_call`.
+ default: computer_call
id:
type: string
- description: The object identifier.
- created_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) for when the fine-tuning job was created.
- level:
+ description: The unique ID of the computer call.
+ call_id:
type: string
- enum:
- - info
- - warn
- - error
- description: The log level of the event.
- message:
+ description: An identifier used when responding to the tool call with output.
+ action:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ actions:
+ $ref: '#/components/schemas/OpenAI.ComputerActionList'
+ pending_safety_checks:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: The pending safety checks for the computer call.
+ status:
type: string
- description: The message of the event.
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: |-
+ A tool call to a computer use tool. See the
+ [computer use guide](/docs/guides/tools-computer-use) for more information.
+ title: Computer tool call
+ OpenAI.ItemCustomToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - input
+ properties:
type:
type: string
enum:
- - message
- - metrics
- description: The type of event.
- data:
- $ref: '#/components/schemas/OpenAI.FineTuningJobEventData'
- description: The data associated with the event.
- description: Fine-tuning job event object
- x-oaiMeta:
- name: The fine-tuning job event object
- example: |
- {
- "object": "fine_tuning.job.event",
- "id": "ftevent-abc123"
- "created_at": 1677610602,
- "level": "info",
- "message": "Created fine-tuning job",
- "data": {},
- "type": "message"
- }
- OpenAI.FineTuningJobEventData:
- type: object
- OpenAI.FineTuningJobHyperparameters:
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
+ type: string
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
+ type: string
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A call to a custom tool created by the model.
+ title: Custom tool call
+ OpenAI.ItemCustomToolCallOutput:
type: object
+ required:
+ - type
+ - call_id
+ - output
properties:
- batch_size:
- anyOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- default: auto
- learning_rate_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- default: auto
- n_epochs:
+ type:
+ type: string
+ enum:
+ - custom_tool_call_output
+ description: The type of the custom tool call output. Always `custom_tool_call_output`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the custom tool call output in the OpenAI platform.
+ call_id:
+ type: string
+ description: The call ID, used to map this custom tool call output to a custom tool call.
+ output:
oneOf:
- type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- default: auto
- OpenAI.FunctionAndCustomToolCallOutput:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the custom tool call generated by your code.
+ Can be a string or an list of output content.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The output of a custom tool call from your code, being sent back to the model.
+ title: Custom tool call output
+ OpenAI.ItemField:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType'
+ $ref: '#/components/schemas/OpenAI.ItemFieldType'
discriminator:
propertyName: type
mapping:
- input_text: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent'
- input_image: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent'
- input_file: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent'
- OpenAI.FunctionAndCustomToolCallOutputInputFileContent:
+ message: '#/components/schemas/OpenAI.ItemFieldMessage'
+ function_call: '#/components/schemas/OpenAI.ItemFieldFunctionToolCall'
+ tool_search_call: '#/components/schemas/OpenAI.ItemFieldToolSearchCall'
+ tool_search_output: '#/components/schemas/OpenAI.ItemFieldToolSearchOutput'
+ additional_tools: '#/components/schemas/OpenAI.ItemFieldAdditionalTools'
+ function_call_output: '#/components/schemas/OpenAI.ItemFieldFunctionToolCallOutput'
+ file_search_call: '#/components/schemas/OpenAI.ItemFieldFileSearchToolCall'
+ web_search_call: '#/components/schemas/OpenAI.ItemFieldWebSearchToolCall'
+ image_generation_call: '#/components/schemas/OpenAI.ItemFieldImageGenToolCall'
+ computer_call: '#/components/schemas/OpenAI.ItemFieldComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.ItemFieldComputerToolCallOutput'
+ reasoning: '#/components/schemas/OpenAI.ItemFieldReasoningItem'
+ compaction: '#/components/schemas/OpenAI.ItemFieldCompactionBody'
+ code_interpreter_call: '#/components/schemas/OpenAI.ItemFieldCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.ItemFieldLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.ItemFieldLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.ItemFieldFunctionShellCall'
+ shell_call_output: '#/components/schemas/OpenAI.ItemFieldFunctionShellCallOutput'
+ apply_patch_call: '#/components/schemas/OpenAI.ItemFieldApplyPatchToolCall'
+ apply_patch_call_output: '#/components/schemas/OpenAI.ItemFieldApplyPatchToolCallOutput'
+ mcp_list_tools: '#/components/schemas/OpenAI.ItemFieldMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.ItemFieldMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.ItemFieldMcpApprovalResponseResource'
+ mcp_call: '#/components/schemas/OpenAI.ItemFieldMcpToolCall'
+ custom_tool_call: '#/components/schemas/OpenAI.ItemFieldCustomToolCall'
+ custom_tool_call_output: '#/components/schemas/OpenAI.ItemFieldCustomToolCallOutput'
+ description: An item representing a message, tool call, tool output, reasoning, or other response element.
+ OpenAI.ItemFieldAdditionalTools:
type: object
required:
- type
+ - id
+ - role
+ - tools
properties:
type:
type: string
enum:
- - input_file
- description: The type of the input item. Always `input_file`.
+ - additional_tools
+ description: The type of the item. Always `additional_tools`.
x-stainless-const: true
- default: input_file
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- filename:
+ default: additional_tools
+ id:
type: string
- description: The name of the file to be sent to the model.
- file_data:
+ description: The unique ID of the additional tools item.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role that provided the additional tools.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The additional tool definitions made available at this item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ OpenAI.ItemFieldApplyPatchToolCall:
+ type: object
+ required:
+ - type
+ - id
+ - call_id
+ - status
+ - operation
+ properties:
+ type:
type: string
- description: The content of the file to be sent to the model.
- file_url:
+ enum:
+ - apply_patch_call
+ description: The type of the item. Always `apply_patch_call`.
+ x-stainless-const: true
+ default: apply_patch_call
+ id:
type: string
- format: uri
- description: The URL of the file to be sent to the model.
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
+ description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
+ description: The status of the apply patch tool call. One of `in_progress` or `completed`.
+ operation:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
+ title: Apply patch operation
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: A file input to the model.
- title: Input file
- OpenAI.FunctionAndCustomToolCallOutputInputImageContent:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A tool call that applies file diffs by creating, deleting, or updating files.
+ title: Apply patch tool call
+ OpenAI.ItemFieldApplyPatchToolCallOutput:
type: object
required:
- type
- - detail
+ - id
+ - call_id
+ - status
properties:
type:
type: string
enum:
- - input_image
- description: The type of the input item. Always `input_image`.
+ - apply_patch_call_output
+ description: The type of the item. Always `apply_patch_call_output`.
x-stainless-const: true
- default: input_image
- image_url:
- anyOf:
- - type: string
- format: uri
- - type: 'null'
- file_id:
+ default: apply_patch_call_output
+ id:
+ type: string
+ description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
+ description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ output:
anyOf:
- type: string
- type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call output.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
- title: Input image
- OpenAI.FunctionAndCustomToolCallOutputInputTextContent:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output emitted by an apply patch tool call.
+ title: Apply patch tool call output
+ OpenAI.ItemFieldCodeInterpreterToolCall:
type: object
required:
- type
- - text
+ - id
+ - status
+ - container_id
+ - code
+ - outputs
properties:
type:
type: string
enum:
- - input_text
- description: The type of the input item. Always `input_text`.
+ - code_interpreter_call
+ description: The type of the code interpreter tool call. Always `code_interpreter_call`.
x-stainless-const: true
- default: input_text
- text:
+ default: code_interpreter_call
+ id:
type: string
- description: The text input to the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: A text input to the model.
- title: Input text
- OpenAI.FunctionAndCustomToolCallOutputType:
- anyOf:
- - type: string
- - type: string
- enum:
- - input_text
- - input_image
- - input_file
- OpenAI.FunctionCallItemStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionCallOutputStatusEnum:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionCallStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionObject:
- type: object
- required:
- - name
- properties:
- description:
+ description: The unique ID of the code interpreter tool call.
+ status:
type: string
- description: A description of what the function does, used by the model to choose when and how to call the function.
- name:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - interpreting
+ - failed
+ description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
+ container_id:
type: string
- description: 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.
- parameters:
- $ref: '#/components/schemas/OpenAI.FunctionParameters'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
- OpenAI.FunctionParameters:
- type: object
- unevaluatedProperties: {}
- description: |-
- The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
- Omitting `parameters` defines a function with an empty parameter list.
- OpenAI.FunctionShellAction:
- type: object
- required:
- - commands
- - timeout_ms
- - max_output_length
- properties:
- commands:
- type: array
- items:
- type: string
- timeout_ms:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- max_output_length:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- description: Execute a shell command.
- title: Shell exec action
- OpenAI.FunctionShellActionParam:
- type: object
- required:
- - commands
- properties:
- commands:
- type: array
- items:
- type: string
- description: Ordered shell commands for the execution environment to run.
- timeout_ms:
+ description: The ID of the container used to run the code.
+ code:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
- type: 'null'
- max_output_length:
+ outputs:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- description: Commands and limits describing how to run the shell tool call.
- title: Shell action
- OpenAI.FunctionShellCallEnvironment:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironmentType'
- discriminator:
- propertyName: type
- mapping:
- local: '#/components/schemas/OpenAI.LocalEnvironmentResource'
- container_reference: '#/components/schemas/OpenAI.ContainerReferenceResource'
- OpenAI.FunctionShellCallEnvironmentType:
- anyOf:
- - type: string
- - type: string
- enum:
- - local
- - container_reference
- OpenAI.FunctionShellCallItemParamEnvironment:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentType'
- discriminator:
- propertyName: type
- mapping:
- local: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam'
- container_reference: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam'
- description: The environment to execute the shell commands in.
- OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam:
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A tool call to run code.
+ title: Code interpreter tool call
+ OpenAI.ItemFieldCompactionBody:
type: object
required:
- type
- - container_id
+ - id
+ - encrypted_content
properties:
type:
type: string
enum:
- - container_reference
- description: References a container created with the /v1/containers endpoint
+ - compaction
+ description: The type of the item. Always `compaction`.
x-stainless-const: true
- default: container_reference
- container_id:
+ default: compaction
+ id:
type: string
- description: The ID of the referenced container.
+ description: The unique ID of the compaction item.
+ encrypted_content:
+ type: string
+ description: The encrypted content that was produced by compaction.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
- OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
+ title: Compaction item
+ OpenAI.ItemFieldComputerToolCall:
type: object
required:
- type
+ - id
+ - call_id
+ - pending_safety_checks
+ - status
properties:
type:
type: string
enum:
- - local
- description: Use a local computer environment.
- x-stainless-const: true
- default: local
- skills:
+ - computer_call
+ description: The type of the computer call. Always `computer_call`.
+ default: computer_call
+ id:
+ type: string
+ description: The unique ID of the computer call.
+ call_id:
+ type: string
+ description: An identifier used when responding to the tool call with output.
+ action:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ actions:
+ $ref: '#/components/schemas/OpenAI.ComputerActionList'
+ pending_safety_checks:
type: array
items:
- $ref: '#/components/schemas/OpenAI.LocalSkillParam'
- maxItems: 200
- description: An optional list of skills.
- allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
- OpenAI.FunctionShellCallItemParamEnvironmentType:
- anyOf:
- - type: string
- - type: string
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: The pending safety checks for the computer call.
+ status:
+ type: string
enum:
- - local
- - container_reference
- OpenAI.FunctionShellCallItemStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: Status values reported for shell tool calls.
- title: Shell call status
- OpenAI.FunctionShellCallOutputContent:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: |-
+ A tool call to a computer use tool. See the
+ [computer use guide](/docs/guides/tools-computer-use) for more information.
+ title: Computer tool call
+ OpenAI.ItemFieldComputerToolCallOutput:
type: object
required:
- - stdout
- - stderr
- - outcome
+ - type
+ - id
+ - call_id
+ - output
properties:
- stdout:
- type: string
- description: The standard output that was captured.
- stderr:
+ type:
type: string
- description: The standard error output that was captured.
- outcome:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
- description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
- title: Shell call outcome
- created_by:
+ enum:
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
+ x-stainless-const: true
+ default: computer_call_output
+ id:
type: string
- description: The identifier of the actor that created the item.
- description: The content of a shell tool call output that was emitted.
- title: Shell call output content
- OpenAI.FunctionShellCallOutputContentParam:
- type: object
- required:
- - stdout
- - stderr
- - outcome
- properties:
- stdout:
+ description: The ID of the computer tool call output.
+ readOnly: true
+ call_id:
type: string
- maxLength: 10485760
- description: Captured stdout output for the shell call.
- stderr:
+ description: The ID of the computer tool call that produced the output.
+ acknowledged_safety_checks:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: |-
+ The safety checks reported by the API that have been acknowledged by the
+ developer.
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ status:
type: string
- maxLength: 10485760
- description: Captured stderr output for the shell call.
- outcome:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
- description: The exit or timeout outcome associated with this shell call.
- description: Captured stdout and stderr for a portion of a shell tool call output.
- title: Shell output content
- OpenAI.FunctionShellCallOutputExitOutcome:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.ItemFieldCustomToolCall:
type: object
required:
- type
- - exit_code
+ - call_id
+ - name
+ - input
properties:
type:
type: string
enum:
- - exit
- description: The outcome type. Always `exit`.
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
x-stainless-const: true
- exit_code:
- $ref: '#/components/schemas/OpenAI.integer'
- description: Exit code from the shell process.
+ id:
+ type: string
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
+ type: string
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
+ type: string
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
- description: Indicates that the shell commands finished and returned an exit code.
- title: Shell call exit outcome
- OpenAI.FunctionShellCallOutputExitOutcomeParam:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A call to a custom tool created by the model.
+ title: Custom tool call
+ OpenAI.ItemFieldCustomToolCallOutput:
type: object
required:
- type
- - exit_code
+ - call_id
+ - output
properties:
type:
type: string
enum:
- - exit
- description: The outcome type. Always `exit`.
+ - custom_tool_call_output
+ description: The type of the custom tool call output. Always `custom_tool_call_output`.
x-stainless-const: true
- exit_code:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The exit code returned by the shell process.
+ id:
+ type: string
+ description: The unique ID of the custom tool call output in the OpenAI platform.
+ call_id:
+ type: string
+ description: The call ID, used to map this custom tool call output to a custom tool call.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the custom tool call generated by your code.
+ Can be a string or an list of output content.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
- description: Indicates that the shell commands finished and returned an exit code.
- title: Shell call exit outcome
- OpenAI.FunctionShellCallOutputOutcome:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a custom tool call from your code, being sent back to the model.
+ title: Custom tool call output
+ OpenAI.ItemFieldFileSearchToolCall:
type: object
required:
+ - id
- type
+ - status
+ - queries
properties:
+ id:
+ type: string
+ description: The unique ID of the file search tool call.
type:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType'
- discriminator:
- propertyName: type
- mapping:
- timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome'
- exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome'
- description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
- title: Shell call outcome
- OpenAI.FunctionShellCallOutputOutcomeParam:
+ type: string
+ enum:
+ - file_search_call
+ description: The type of the file search tool call. Always `file_search_call`.
+ x-stainless-const: true
+ status:
+ type: string
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - incomplete
+ - failed
+ description: |-
+ The status of the file search tool call. One of `in_progress`,
+ `searching`, `incomplete` or `failed`,
+ queries:
+ type: array
+ items:
+ type: string
+ description: The queries used to search for files.
+ results:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: |-
+ The results of a file search tool call. See the
+ [file search guide](/docs/guides/tools-file-search) for more information.
+ title: File search tool call
+ OpenAI.ItemFieldFunctionShellCall:
type: object
required:
- type
+ - id
+ - call_id
+ - action
+ - status
+ - environment
properties:
type:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParamType'
- discriminator:
- propertyName: type
- mapping:
- timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcomeParam'
- exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcomeParam'
- description: The exit or timeout outcome associated with this shell call.
- title: Shell call outcome
- OpenAI.FunctionShellCallOutputOutcomeParamType:
- anyOf:
- - type: string
- - type: string
- enum:
- - timeout
- - exit
- OpenAI.FunctionShellCallOutputOutcomeType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - timeout
- - exit
- OpenAI.FunctionShellCallOutputStatusEnum:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionShellCallOutputTimeoutOutcome:
+ - shell_call
+ description: The type of the item. Always `shell_call`.
+ x-stainless-const: true
+ default: shell_call
+ id:
+ type: string
+ description: The unique ID of the shell tool call. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.FunctionShellAction'
+ description: The shell commands and limits that describe how to run the tool call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
+ description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
+ environment:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ - type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A tool call that executes one or more shell commands in a managed environment.
+ title: Shell tool call
+ OpenAI.ItemFieldFunctionShellCallOutput:
type: object
required:
- type
+ - id
+ - call_id
+ - status
+ - output
+ - max_output_length
properties:
type:
type: string
enum:
- - timeout
- description: The outcome type. Always `timeout`.
+ - shell_call_output
+ description: The type of the shell call output. Always `shell_call_output`.
x-stainless-const: true
+ default: shell_call_output
+ id:
+ type: string
+ description: The unique ID of the shell call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the shell tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
+ description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
+ description: An array of shell call output contents
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
- description: Indicates that the shell call exceeded its configured time limit.
- title: Shell call timeout outcome
- OpenAI.FunctionShellCallOutputTimeoutOutcomeParam:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a shell tool call that was emitted.
+ title: Shell call output
+ OpenAI.ItemFieldFunctionToolCall:
type: object
required:
+ - id
- type
+ - call_id
+ - name
+ - arguments
properties:
+ id:
+ type: string
+ description: The unique ID of the function tool call.
+ readOnly: true
type:
type: string
enum:
- - timeout
- description: The outcome type. Always `timeout`.
+ - function_call
+ description: The type of the function tool call. Always `function_call`.
x-stainless-const: true
+ call_id:
+ type: string
+ description: The unique ID of the function tool call generated by the model.
+ namespace:
+ type: string
+ description: The namespace of the function to run.
+ name:
+ type: string
+ description: The name of the function to run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the function.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
- description: Indicates that the shell call exceeded its configured time limit.
- title: Shell call timeout outcome
- OpenAI.FunctionShellCallStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionShellToolParam:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: |-
+ A tool call to run a function. See the
+ [function calling guide](/docs/guides/function-calling) for more information.
+ title: Function tool call
+ OpenAI.ItemFieldFunctionToolCallOutput:
type: object
required:
+ - id
- type
+ - call_id
+ - output
properties:
+ id:
+ type: string
+ description: |-
+ The unique ID of the function tool call output. Populated when this item
+ is returned via API.
+ readOnly: true
type:
type: string
enum:
- - shell
- description: The type of the shell tool. Always `shell`.
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
x-stainless-const: true
- environment:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
- - type: 'null'
- name:
+ call_id:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
+ description: The unique ID of the function tool call generated by the model.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the function call generated by your code.
+ Can be a string or an list of output content.
+ status:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that allows the model to execute shell commands.
- title: Shell tool
- OpenAI.FunctionShellToolParamEnvironment:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.ItemFieldImageGenToolCall:
type: object
required:
- type
+ - id
+ - status
+ - result
properties:
type:
- $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentType'
- discriminator:
- propertyName: type
- mapping:
- local: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam'
- container_reference: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam'
- container_auto: '#/components/schemas/OpenAI.ContainerAutoParam'
- OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam:
+ type: string
+ enum:
+ - image_generation_call
+ description: The type of the image generation call. Always `image_generation_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the image generation call.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - generating
+ - failed
+ description: The status of the image generation call.
+ result:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: An image generation request made by the model.
+ title: Image generation call
+ OpenAI.ItemFieldLocalShellToolCall:
type: object
required:
- type
- - container_id
+ - id
+ - call_id
+ - action
+ - status
properties:
type:
type: string
enum:
- - container_reference
- description: References a container created with the /v1/containers endpoint
+ - local_shell_call
+ description: The type of the local shell call. Always `local_shell_call`.
x-stainless-const: true
- default: container_reference
- container_id:
+ id:
type: string
- description: The ID of the referenced container.
+ description: The unique ID of the local shell call.
+ call_id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: The status of the local shell call.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
- OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A tool call to run a command on the local shell.
+ title: Local shell call
+ OpenAI.ItemFieldLocalShellToolCallOutput:
type: object
required:
- type
+ - id
+ - output
properties:
type:
type: string
enum:
- - local
- description: Use a local computer environment.
+ - local_shell_call_output
+ description: The type of the local shell tool call output. Always `local_shell_call_output`.
x-stainless-const: true
- default: local
- skills:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.LocalSkillParam'
- maxItems: 200
- description: An optional list of skills.
+ id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ output:
+ type: string
+ description: A JSON string of the output of the local shell tool call.
+ status:
+ anyOf:
+ - type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
- OpenAI.FunctionShellToolParamEnvironmentType:
- anyOf:
- - type: string
- - type: string
- enum:
- - container_auto
- - local
- - container_reference
- OpenAI.FunctionTool:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a local shell tool call.
+ title: Local shell call output
+ OpenAI.ItemFieldMcpApprovalRequest:
type: object
required:
- type
+ - id
+ - server_label
- name
- - parameters
- - strict
+ - arguments
properties:
type:
type: string
enum:
- - function
- description: The type of the function tool. Always `function`.
+ - mcp_approval_request
+ description: The type of the item. Always `mcp_approval_request`.
x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the approval request.
+ server_label:
+ type: string
+ description: The label of the MCP server making the request.
name:
type: string
- description: The name of the function to call.
- description:
- anyOf:
- - type: string
- - type: 'null'
- parameters:
- anyOf:
- - type: object
- unevaluatedProperties: {}
- - type: 'null'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
- defer_loading:
- type: boolean
- description: Whether this function is deferred and loaded via tool search.
+ description: The name of the tool to run.
+ arguments:
+ type: string
+ description: A JSON string of arguments for the tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: 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).
- title: Function
- OpenAI.FunctionToolParam:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A request for human approval of a tool invocation.
+ title: MCP approval request
+ OpenAI.ItemFieldMcpApprovalResponseResource:
type: object
required:
- - name
- type
+ - id
+ - approval_request_id
+ - approve
properties:
- name:
- type: string
- minLength: 1
- maxLength: 128
- pattern: ^[a-zA-Z0-9_-]+$
- description:
- anyOf:
- - type: string
- - type: 'null'
- parameters:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EmptyModelParam'
- - type: 'null'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
type:
type: string
enum:
- - function
+ - mcp_approval_response
+ description: The type of the item. Always `mcp_approval_response`.
x-stainless-const: true
- default: function
- defer_loading:
+ id:
+ type: string
+ description: The unique ID of the approval response
+ approval_request_id:
+ type: string
+ description: The ID of the approval request being answered.
+ approve:
type: boolean
- description: Whether this function should be deferred and discovered via tool search.
- OpenAI.GraderLabelModel:
+ description: Whether the request was approved.
+ reason:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A response to an MCP approval request.
+ title: MCP approval response
+ OpenAI.ItemFieldMcpListTools:
type: object
required:
- type
- - name
- - model
- - input
- - labels
- - passing_labels
+ - id
+ - server_label
+ - tools
properties:
type:
type: string
enum:
- - label_model
- description: The object type, which is always `label_model`.
+ - mcp_list_tools
+ description: The type of the item. Always `mcp_list_tools`.
x-stainless-const: true
- name:
+ id:
type: string
- description: The name of the grader.
- model:
+ description: The unique ID of the list.
+ server_label:
type: string
- description: The model to use for the evaluation. Must support structured outputs.
- input:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalItem'
- labels:
- type: array
- items:
- type: string
- description: The labels to assign to each item in the evaluation.
- passing_labels:
+ description: The label of the MCP server.
+ tools:
type: array
items:
- type: string
- description: The labels that indicate a passing result. Must be a subset of labels.
- description: |-
- A LabelModelGrader object which uses a model to assign labels to each item
- in the evaluation.
- title: LabelModelGrader
- x-oaiMeta:
- name: Label Model Grader
- group: graders
- example: |
- {
- "name": "First label grader",
- "type": "label_model",
- "model": "gpt-4o-2024-08-06",
- "input": [
- {
- "type": "message",
- "role": "system",
- "content": {
- "type": "input_text",
- "text": "Classify the sentiment of the following statement as one of positive, neutral, or negative"
- }
- },
- {
- "type": "message",
- "role": "user",
- "content": {
- "type": "input_text",
- "text": "Statement: {{item.response}}"
- }
- }
- ],
- "passing_labels": [
- "positive"
- ],
- "labels": [
- "positive",
- "neutral",
- "negative"
- ]
- }
- OpenAI.GraderMulti:
+ $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
+ description: The tools available on the server.
+ error:
+ $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A list of tools available on an MCP server.
+ title: MCP list tools
+ OpenAI.ItemFieldMcpToolCall:
type: object
required:
- type
+ - id
+ - server_label
- name
- - graders
- - calculate_output
+ - arguments
properties:
type:
type: string
enum:
- - multi
- description: The object type, which is always `multi`.
+ - mcp_call
+ description: The type of the item. Always `mcp_call`.
x-stainless-const: true
- default: multi
+ id:
+ type: string
+ description: The unique ID of the tool call.
+ server_label:
+ type: string
+ description: The label of the MCP server running the tool.
name:
type: string
- description: The name of the grader.
- graders:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.GraderPython'
- - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
- - $ref: '#/components/schemas/OpenAI.GraderLabelModel'
- calculate_output:
+ description: The name of the tool that was run.
+ arguments:
type: string
- description: A formula to calculate the output based on grader results.
- description: A MultiGrader object combines the output of multiple graders to produce a single score.
- title: MultiGrader
- x-oaiMeta:
- name: Multi Grader
- group: graders
- example: |
- {
- "type": "multi",
- "name": "example multi grader",
- "graders": [
- {
- "type": "text_similarity",
- "name": "example text similarity grader",
- "input": "The graded text",
- "reference": "The reference text",
- "evaluation_metric": "fuzzy_match"
- },
- {
- "type": "string_check",
- "name": "Example string check grader",
- "input": "{{sample.output_text}}",
- "reference": "{{item.label}}",
- "operation": "eq"
- }
- ],
- "calculate_output": "0.5 * text_similarity_score + 0.5 * string_check_score)"
- }
- OpenAI.GraderPython:
+ description: A JSON string of the arguments passed to the tool.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ error:
+ type: object
+ unevaluatedProperties: {}
+ status:
+ $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
+ description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
+ approval_request_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: An invocation of a tool on an MCP server.
+ title: MCP tool call
+ OpenAI.ItemFieldMessage:
type: object
required:
- type
- - name
- - source
+ - id
+ - status
+ - role
+ - content
properties:
type:
type: string
enum:
- - python
- description: The object type, which is always `python`.
+ - message
+ description: The type of the message. Always set to `message`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- source:
- type: string
- description: The source code of the python script.
- image_tag:
+ default: message
+ id:
type: string
- description: The image tag to use for the python script.
- description: A PythonGrader object that runs a python script on the input.
- title: PythonGrader
- x-oaiMeta:
- name: Python Grader
- group: graders
- example: |
- {
- "type": "python",
- "name": "Example python grader",
- "image_tag": "2025-05-08",
- "source": """
- def grade(sample: dict, item: dict) -> float:
- """
- Returns 1.0 if `output_text` equals `label`, otherwise 0.0.
- """
- output = sample.get("output_text")
- label = item.get("label")
- return 1.0 if output == label else 0.0
- """,
- }
- OpenAI.GraderScoreModel:
+ description: The unique ID of the message.
+ status:
+ $ref: '#/components/schemas/OpenAI.MessageStatus'
+ description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: The content of the message
+ phase:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A message to or from the model.
+ title: Message
+ OpenAI.ItemFieldReasoningItem:
type: object
required:
- type
- - name
- - model
- - input
+ - id
+ - summary
properties:
type:
type: string
enum:
- - score_model
- description: The object type, which is always `score_model`.
+ - reasoning
+ description: The type of the object. Always `reasoning`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- model:
+ id:
type: string
- description: The model to use for the evaluation.
- sampling_params:
- $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams'
- description: The sampling parameters for the model.
- input:
+ description: The unique identifier of the reasoning content.
+ encrypted_content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ summary:
type: array
items:
- $ref: '#/components/schemas/OpenAI.EvalItem'
- description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
- range:
+ $ref: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: Reasoning summary content.
+ content:
type: array
items:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The range of the score. Defaults to `[0, 1]`.
- description: A ScoreModelGrader object that uses a model to assign a score to the input.
- title: ScoreModelGrader
- x-oaiMeta:
- name: Score Model Grader
- group: graders
- example: |
- {
- "type": "score_model",
- "name": "Example score model grader",
- "input": [
- {
- "role": "user",
- "content": [
- {
- "type": "input_text",
- "text": (
- "Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different."
- " Return just a floating point score
-
- "
- " Reference answer: {{item.label}}
-
- "
- " Model answer: {{sample.output_text}}"
- )
- },
- {
- "type": "input_image",
- "image_url": "https://example.com/reference.png",
- "file_id": null,
- "detail": "auto"
- }
- ],
- }
- ],
- "model": "gpt-5-mini",
- "sampling_params": {
- "temperature": 1,
- "top_p": 1,
- "seed": 42,
- "max_completions_tokens": 32768,
- "reasoning_effort": "medium"
- },
- }
- OpenAI.GraderStringCheck:
+ $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
+ description: Reasoning text content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: |-
+ A description of the chain of thought used by a reasoning model while generating
+ a response. Be sure to include these items in your `input` to the Responses API
+ for subsequent turns of a conversation if you are manually
+ [managing context](/docs/guides/conversation-state).
+ title: Reasoning
+ OpenAI.ItemFieldToolSearchCall:
+ type: object
+ required:
+ - type
+ - id
+ - call_id
+ - execution
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - tool_search_call
+ description: The type of the item. Always `tool_search_call`.
+ x-stainless-const: true
+ default: tool_search_call
+ id:
+ type: string
+ description: The unique ID of the tool search call item.
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ arguments:
+ description: Arguments used for the tool search call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: The status of the tool search call item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ OpenAI.ItemFieldToolSearchOutput:
type: object
required:
- type
- - name
- - input
- - reference
- - operation
+ - id
+ - call_id
+ - execution
+ - tools
+ - status
properties:
type:
type: string
enum:
- - string_check
- description: The object type, which is always `string_check`.
+ - tool_search_output
+ description: The type of the item. Always `tool_search_output`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- input:
- type: string
- description: The input text. This may include template strings.
- reference:
+ default: tool_search_output
+ id:
type: string
- description: The reference text. This may include template strings.
- operation:
+ description: The unique ID of the tool search output item.
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The loaded tool definitions returned by tool search.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: The status of the tool search output item that was recorded.
+ created_by:
type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ OpenAI.ItemFieldType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - eq
- - ne
- - like
- - ilike
- description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
- description: A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
- title: StringCheckGrader
- x-oaiMeta:
- name: String Check Grader
- group: graders
- example: |
- {
- "type": "string_check",
- "name": "Example string check grader",
- "input": "{{sample.output_text}}",
- "reference": "{{item.label}}",
- "operation": "eq"
- }
- OpenAI.GraderTextSimilarity:
+ - message
+ - function_call
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - function_call_output
+ - file_search_call
+ - web_search_call
+ - image_generation_call
+ - computer_call
+ - computer_call_output
+ - reasoning
+ - compaction
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - mcp_call
+ - custom_tool_call
+ - custom_tool_call_output
+ OpenAI.ItemFieldWebSearchToolCall:
type: object
required:
+ - id
- type
- - name
- - input
- - reference
- - evaluation_metric
+ - status
+ - action
properties:
+ id:
+ type: string
+ description: The unique ID of the web search tool call.
type:
type: string
enum:
- - text_similarity
- description: The type of grader.
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
x-stainless-const: true
- default: text_similarity
- name:
- type: string
- description: The name of the grader.
- input:
- type: string
- description: The text being graded.
- reference:
- type: string
- description: The text being graded against.
- evaluation_metric:
+ status:
type: string
enum:
- - cosine
- - fuzzy_match
- - bleu
- - gleu
- - meteor
- - rouge_1
- - rouge_2
- - rouge_3
- - rouge_4
- - rouge_5
- - rouge_l
+ - in_progress
+ - searching
+ - completed
+ - failed
+ - incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
description: |-
- 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`.
- description: A TextSimilarityGrader object which grades text based on similarity metrics.
- title: TextSimilarityGrader
- x-oaiMeta:
- name: Text Similarity Grader
- group: graders
- example: |
- {
- "type": "text_similarity",
- "name": "Example text similarity grader",
- "input": "{{sample.output_text}}",
- "reference": "{{item.label}}",
- "evaluation_metric": "fuzzy_match"
- }
- OpenAI.GrammarSyntax1:
- type: string
- enum:
- - lark
- - regex
- OpenAI.HybridSearchOptions:
- type: object
- required:
- - embedding_weight
- - text_weight
- properties:
- embedding_weight:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The weight of the embedding in the reciprocal ranking fusion.
- text_weight:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The weight of the text in the reciprocal ranking fusion.
- OpenAI.ImageDetail:
- type: string
- enum:
- - low
- - high
- - auto
- - original
- OpenAI.ImageGenActionEnum:
- type: string
- enum:
- - generate
- - edit
- - auto
- OpenAI.ImageGenTool:
+ 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_in_page).
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: |-
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.ItemFileSearchToolCall:
type: object
required:
+ - id
- type
+ - status
+ - queries
properties:
+ id:
+ type: string
+ description: The unique ID of the file search tool call.
type:
type: string
enum:
- - image_generation
- description: The type of the image generation tool. Always `image_generation`.
+ - file_search_call
+ description: The type of the file search tool call. Always `file_search_call`.
x-stainless-const: true
- model:
- anyOf:
- - type: string
- - type: string
- enum:
- - gpt-image-1
- - gpt-image-1-mini
- - gpt-image-1.5
- default: gpt-image-1
- quality:
+ status:
type: string
enum:
- - low
- - medium
- - high
- - auto
+ - in_progress
+ - searching
+ - completed
+ - incomplete
+ - failed
description: |-
- The quality of the generated image. One of `low`, `medium`, `high`,
- or `auto`. Default: `auto`.
- default: auto
- size:
+ The status of the file search tool call. One of `in_progress`,
+ `searching`, `incomplete` or `failed`,
+ queries:
+ type: array
+ items:
+ type: string
+ description: The queries used to search for files.
+ results:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: |-
+ The results of a file search tool call. See the
+ [file search guide](/docs/guides/tools-file-search) for more information.
+ title: File search tool call
+ OpenAI.ItemFunctionCallOutputItemParam:
+ type: object
+ required:
+ - call_id
+ - type
+ - output
+ properties:
+ id:
anyOf:
- type: string
- - type: string
- enum:
- - 1024x1024
- - 1024x1536
- - 1536x1024
- - auto
- description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- default: auto
- output_format:
+ - type: 'null'
+ call_id:
type: string
- enum:
- - png
- - webp
- - jpeg
- description: |-
- The output format of the generated image. One of `png`, `webp`, or
- `jpeg`. Default: `png`.
- default: png
- output_compression:
- $ref: '#/components/schemas/OpenAI.integer'
- minimum: 0
- maximum: 100
- description: 'Compression level for the output image. Default: 100.'
- default: 100
- moderation:
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the function tool call generated by the model.
+ type:
type: string
enum:
- - auto
- - low
- description: 'Moderation level for the generated image. Default: `auto`.'
- default: auto
- background:
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
+ x-stainless-const: true
+ default: function_call_output
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.InputTextContentParam'
+ - $ref: '#/components/schemas/OpenAI.InputImageContentParamAutoParam'
+ - $ref: '#/components/schemas/OpenAI.InputFileContentParam'
+ description: Text, image, or file output of the function tool call.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.ItemFunctionShellCallItemParam:
+ type: object
+ required:
+ - call_id
+ - type
+ - action
+ properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the shell tool call generated by the model.
+ type:
type: string
enum:
- - transparent
- - opaque
- - auto
- description: |-
- Background type for the generated image. One of `transparent`,
- `opaque`, or `auto`. Default: `auto`.
- default: auto
- input_fidelity:
+ - shell_call
+ description: The type of the item. Always `shell_call`.
+ x-stainless-const: true
+ default: shell_call
+ action:
+ $ref: '#/components/schemas/OpenAI.FunctionShellActionParam'
+ description: The shell commands and limits that describe how to run the tool call.
+ status:
anyOf:
- - $ref: '#/components/schemas/OpenAI.InputFidelity'
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- type: 'null'
- input_image_mask:
- $ref: '#/components/schemas/OpenAI.ImageGenToolInputImageMask'
- description: |-
- Optional mask for inpainting. Contains `image_url`
- (string, optional) and `file_id` (string, optional).
- partial_images:
- $ref: '#/components/schemas/OpenAI.integer'
- minimum: 0
- maximum: 3
- description: Number of partial images to generate in streaming mode, from 0 (default value) to 3.
- action:
- $ref: '#/components/schemas/OpenAI.ImageGenActionEnum'
- description: 'Whether to generate a new image or edit an existing image. Default: `auto`.'
- name:
+ environment:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A tool representing a request to execute one or more shell commands.
+ title: Shell tool call
+ OpenAI.ItemFunctionShellCallOutputItemParam:
+ type: object
+ required:
+ - call_id
+ - type
+ - output
+ properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the shell tool call generated by the model.
+ type:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
+ enum:
+ - shell_call_output
+ description: The type of the item. Always `shell_call_output`.
+ x-stainless-const: true
+ default: shell_call_output
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContentParam'
+ description: Captured chunks of stdout and stderr output, along with their associated outcomes.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
+ - type: 'null'
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that generates images using the GPT image models.
- title: Image generation tool
- OpenAI.ImageGenToolInputImageMask:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The streamed output items emitted by a shell tool call.
+ title: Shell tool call output
+ OpenAI.ItemFunctionToolCall:
type: object
+ required:
+ - id
+ - type
+ - call_id
+ - name
+ - arguments
properties:
- image_url:
+ id:
type: string
- format: uri
- file_id:
+ description: The unique ID of the function tool call.
+ readOnly: true
+ type:
type: string
- OpenAI.IncludeEnum:
- anyOf:
- - type: string
- - type: string
enum:
- - file_search_call.results
- - web_search_call.results
- - web_search_call.action.sources
- - message.input_image.image_url
- - computer_call_output.output.image_url
- - code_interpreter_call.outputs
- - reasoning.encrypted_content
- - message.output_text.logprobs
- - memory_search_call.results
+ - function_call
+ description: The type of the function tool call. Always `function_call`.
+ x-stainless-const: true
+ call_id:
+ type: string
+ description: The unique ID of the function tool call generated by the model.
+ namespace:
+ type: string
+ description: The namespace of the function to run.
+ name:
+ type: string
+ description: The name of the function to run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the function.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
description: |-
- Specify additional output data to include in the model response. Currently supported values are:
- - `web_search_call.results`: Include the search results of the web search tool call.
- - `web_search_call.action.sources`: Include the sources of the web search tool call.
- - `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).
- OpenAI.InlineSkillParam:
+ A tool call to run a function. See the
+ [function calling guide](/docs/guides/function-calling) for more information.
+ title: Function tool call
+ OpenAI.ItemImageGenToolCall:
type: object
required:
- type
- - name
- - description
- - source
+ - id
+ - status
+ - result
properties:
type:
type: string
enum:
- - inline
- description: Defines an inline skill for this request.
+ - image_generation_call
+ description: The type of the image generation call. Always `image_generation_call`.
x-stainless-const: true
- name:
+ id:
type: string
- description: The name of the skill.
- description:
+ description: The unique ID of the image generation call.
+ status:
type: string
- description: The description of the skill.
- source:
- $ref: '#/components/schemas/OpenAI.InlineSkillSourceParam'
- description: Inline skill payload
+ enum:
+ - in_progress
+ - completed
+ - generating
+ - failed
+ description: The status of the image generation call.
+ result:
+ anyOf:
+ - type: string
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ContainerSkill'
- OpenAI.InlineSkillSourceParam:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: An image generation request made by the model.
+ title: Image generation call
+ OpenAI.ItemInputMessage:
type: object
required:
- type
- - media_type
- - data
+ - role
+ - content
+ - id
properties:
type:
type: string
enum:
- - base64
- description: The type of the inline skill source. Must be `base64`.
+ - message
+ description: The type of the message input. Always set to `message`.
x-stainless-const: true
- default: base64
- media_type:
+ default: message
+ role:
type: string
enum:
- - application/zip
- description: The media type of the inline skill payload. Must be `application/zip`.
- x-stainless-const: true
- default: application/zip
- data:
+ - user
+ - system
+ - developer
+ description: The role of the message input. One of `user`, `system`, or `developer`.
+ status:
type: string
- minLength: 1
- maxLength: 70254592
- description: Base64-encoded skill zip bundle.
- description: Inline skill payload
- OpenAI.InputAudio:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ content:
+ $ref: '#/components/schemas/OpenAI.InputMessageContentList'
+ id:
+ type: string
+ description: The unique ID of the message input.
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: |-
+ 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.
+ title: Input message
+ OpenAI.ItemLocalShellToolCall:
type: object
required:
- type
- - input_audio
+ - id
+ - call_id
+ - action
+ - status
properties:
type:
type: string
enum:
- - input_audio
- description: The type of the input item. Always `input_audio`.
+ - local_shell_call
+ description: The type of the local shell call. Always `local_shell_call`.
x-stainless-const: true
- input_audio:
- $ref: '#/components/schemas/OpenAI.InputAudioInputAudio'
- allOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: An audio input to the model.
- title: Input audio
- OpenAI.InputAudioInputAudio:
- type: object
- required:
- - data
- - format
- properties:
- data:
+ id:
type: string
- format:
+ description: The unique ID of the local shell call.
+ call_id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
+ status:
type: string
enum:
- - mp3
- - wav
- OpenAI.InputContent:
+ - in_progress
+ - completed
+ - incomplete
+ description: The status of the local shell call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A tool call to run a command on the local shell.
+ title: Local shell call
+ OpenAI.ItemLocalShellToolCallOutput:
type: object
required:
- type
+ - id
+ - output
properties:
type:
- $ref: '#/components/schemas/OpenAI.InputContentType'
- discriminator:
- propertyName: type
- mapping:
- input_text: '#/components/schemas/OpenAI.InputContentInputTextContent'
- input_image: '#/components/schemas/OpenAI.InputContentInputImageContent'
- input_file: '#/components/schemas/OpenAI.InputContentInputFileContent'
- OpenAI.InputContentInputFileContent:
+ type: string
+ enum:
+ - local_shell_call_output
+ description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ output:
+ type: string
+ description: A JSON string of the output of the local shell tool call.
+ status:
+ anyOf:
+ - type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The output of a local shell tool call.
+ title: Local shell call output
+ OpenAI.ItemMcpApprovalRequest:
type: object
required:
- type
+ - id
+ - server_label
+ - name
+ - arguments
properties:
type:
type: string
enum:
- - input_file
- description: The type of the input item. Always `input_file`.
+ - mcp_approval_request
+ description: The type of the item. Always `mcp_approval_request`.
x-stainless-const: true
- default: input_file
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- filename:
+ id:
type: string
- description: The name of the file to be sent to the model.
- file_data:
+ description: The unique ID of the approval request.
+ server_label:
type: string
- description: The content of the file to be sent to the model.
- file_url:
+ description: The label of the MCP server making the request.
+ name:
type: string
- format: uri
- description: The URL of the file to be sent to the model.
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
+ description: The name of the tool to run.
+ arguments:
+ type: string
+ description: A JSON string of arguments for the tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputContent'
- description: A file input to the model.
- title: Input file
- OpenAI.InputContentInputImageContent:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A request for human approval of a tool invocation.
+ title: MCP approval request
+ OpenAI.ItemMcpApprovalResponse:
type: object
required:
- type
- - detail
+ - approval_request_id
+ - approve
properties:
type:
type: string
enum:
- - input_image
- description: The type of the input item. Always `input_image`.
+ - mcp_approval_response
+ description: The type of the item. Always `mcp_approval_response`.
x-stainless-const: true
- default: input_image
- image_url:
+ id:
anyOf:
- type: string
- format: uri
- type: 'null'
- file_id:
+ approval_request_id:
+ type: string
+ description: The ID of the approval request being answered.
+ approve:
+ type: boolean
+ description: Whether the request was approved.
+ reason:
anyOf:
- type: string
- type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputContent'
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
- title: Input image
- OpenAI.InputContentInputTextContent:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A response to an MCP approval request.
+ title: MCP approval response
+ OpenAI.ItemMcpListTools:
type: object
required:
- type
- - text
+ - id
+ - server_label
+ - tools
properties:
type:
type: string
enum:
- - input_text
- description: The type of the input item. Always `input_text`.
+ - mcp_list_tools
+ description: The type of the item. Always `mcp_list_tools`.
x-stainless-const: true
- default: input_text
- text:
+ id:
type: string
- description: The text input to the model.
+ description: The unique ID of the list.
+ server_label:
+ type: string
+ description: The label of the MCP server.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
+ description: The tools available on the server.
+ error:
+ $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputContent'
- description: A text input to the model.
- title: Input text
- OpenAI.InputContentType:
- anyOf:
- - type: string
- - type: string
- enum:
- - input_text
- - input_image
- - input_file
- OpenAI.InputFidelity:
- type: string
- enum:
- - high
- - low
- description: Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.
- OpenAI.InputFileContent:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A list of tools available on an MCP server.
+ title: MCP list tools
+ OpenAI.ItemMcpToolCall:
type: object
required:
- type
+ - id
+ - server_label
+ - name
+ - arguments
properties:
type:
type: string
enum:
- - input_file
- description: The type of the input item. Always `input_file`.
+ - mcp_call
+ description: The type of the item. Always `mcp_call`.
x-stainless-const: true
- default: input_file
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- filename:
+ id:
type: string
- description: The name of the file to be sent to the model.
- file_data:
+ description: The unique ID of the tool call.
+ server_label:
type: string
- description: The content of the file to be sent to the model.
- file_url:
+ description: The label of the MCP server running the tool.
+ name:
type: string
- format: uri
- description: The URL of the file to be sent to the model.
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
- description: A file input to the model.
- title: Input file
- OpenAI.InputFileContentParam:
+ description: The name of the tool that was run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments passed to the tool.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ error:
+ type: object
+ unevaluatedProperties: {}
+ status:
+ $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
+ description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
+ approval_request_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: An invocation of a tool on an MCP server.
+ title: MCP tool call
+ OpenAI.ItemOutputMessage:
type: object
required:
+ - id
- type
+ - role
+ - content
+ - status
properties:
+ id:
+ type: string
+ description: The unique ID of the output message.
type:
type: string
enum:
- - input_file
- description: The type of the input item. Always `input_file`.
+ - output_message
+ description: The type of the output message. Always `message`.
x-stainless-const: true
- default: input_file
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- filename:
- anyOf:
- - type: string
- - type: 'null'
- file_data:
- anyOf:
- - type: string
- - type: 'null'
- file_url:
+ role:
+ type: string
+ enum:
+ - assistant
+ description: The role of the output message. Always `assistant`.
+ x-stainless-const: true
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.OutputMessageContent'
+ description: The content of the output message.
+ phase:
anyOf:
- - type: string
- format: uri
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
- type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
- description: A file input to the model.
- title: Input file
- OpenAI.InputImageContent:
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: An output message from the model.
+ title: Output message
+ OpenAI.ItemReasoningItem:
type: object
required:
- type
- - detail
+ - id
+ - summary
properties:
type:
type: string
enum:
- - input_image
- description: The type of the input item. Always `input_image`.
+ - reasoning
+ description: The type of the object. Always `reasoning`.
x-stainless-const: true
- default: input_image
- image_url:
- anyOf:
- - type: string
- format: uri
- - type: 'null'
- file_id:
+ id:
+ type: string
+ description: The unique identifier of the reasoning content.
+ encrypted_content:
anyOf:
- type: string
- type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
- title: Input image
- OpenAI.InputImageContentParamAutoParam:
+ summary:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: Reasoning summary content.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
+ description: Reasoning text content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: |-
+ A description of the chain of thought used by a reasoning model while generating
+ a response. Be sure to include these items in your `input` to the Responses API
+ for subsequent turns of a conversation if you are manually
+ [managing context](/docs/guides/conversation-state).
+ title: Reasoning
+ OpenAI.ItemReferenceParam:
type: object
required:
- type
+ - id
properties:
type:
type: string
enum:
- - input_image
- description: The type of the input item. Always `input_image`.
+ - item_reference
+ description: The type of item to reference. Always `item_reference`.
x-stainless-const: true
- default: input_image
- image_url:
- anyOf:
- - type: string
- format: uri
- - type: 'null'
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- detail:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.DetailEnum'
- - type: 'null'
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision)
- title: Input image
- OpenAI.InputItem:
+ id:
+ type: string
+ description: The ID of the item to reference.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: An internal identifier for an item to reference.
+ title: Item reference
+ OpenAI.ItemResource:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.InputItemType'
+ $ref: '#/components/schemas/OpenAI.ItemResourceType'
discriminator:
propertyName: type
mapping:
- message: '#/components/schemas/OpenAI.EasyInputMessage'
- item_reference: '#/components/schemas/OpenAI.ItemReferenceParam'
- output_message: '#/components/schemas/OpenAI.InputItemOutputMessage'
- file_search_call: '#/components/schemas/OpenAI.InputItemFileSearchToolCall'
- computer_call: '#/components/schemas/OpenAI.InputItemComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.InputItemComputerCallOutputItemParam'
- web_search_call: '#/components/schemas/OpenAI.InputItemWebSearchToolCall'
- function_call: '#/components/schemas/OpenAI.InputItemFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.InputItemFunctionCallOutputItemParam'
- tool_search_call: '#/components/schemas/OpenAI.InputItemToolSearchCallItemParam'
- tool_search_output: '#/components/schemas/OpenAI.InputItemToolSearchOutputItemParam'
- additional_tools: '#/components/schemas/OpenAI.InputItemAdditionalToolsItemParam'
- reasoning: '#/components/schemas/OpenAI.InputItemReasoningItem'
- compaction: '#/components/schemas/OpenAI.InputItemCompactionSummaryItemParam'
- image_generation_call: '#/components/schemas/OpenAI.InputItemImageGenToolCall'
- code_interpreter_call: '#/components/schemas/OpenAI.InputItemCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.InputItemLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.InputItemLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.InputItemFunctionShellCallItemParam'
- shell_call_output: '#/components/schemas/OpenAI.InputItemFunctionShellCallOutputItemParam'
- apply_patch_call: '#/components/schemas/OpenAI.InputItemApplyPatchToolCallItemParam'
- apply_patch_call_output: '#/components/schemas/OpenAI.InputItemApplyPatchToolCallOutputItemParam'
- mcp_list_tools: '#/components/schemas/OpenAI.InputItemMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.InputItemMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.InputItemMcpApprovalResponse'
- mcp_call: '#/components/schemas/OpenAI.InputItemMcpToolCall'
- custom_tool_call_output: '#/components/schemas/OpenAI.InputItemCustomToolCallOutput'
- custom_tool_call: '#/components/schemas/OpenAI.InputItemCustomToolCall'
- description: |-
- An item representing part of the context for the response to be
- generated by the model. Can contain text, images, and audio inputs,
- as well as previous assistant responses and tool call outputs.
- OpenAI.InputItemAdditionalToolsItemParam:
+ message: '#/components/schemas/OpenAI.ItemResourceInputMessage'
+ output_message: '#/components/schemas/OpenAI.ItemResourceOutputMessage'
+ file_search_call: '#/components/schemas/OpenAI.ItemResourceFileSearchToolCall'
+ computer_call: '#/components/schemas/OpenAI.ItemResourceComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.ItemResourceComputerToolCallOutput'
+ web_search_call: '#/components/schemas/OpenAI.ItemResourceWebSearchToolCall'
+ function_call: '#/components/schemas/OpenAI.ItemResourceFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutput'
+ tool_search_call: '#/components/schemas/OpenAI.ItemResourceToolSearchCall'
+ tool_search_output: '#/components/schemas/OpenAI.ItemResourceToolSearchOutput'
+ additional_tools: '#/components/schemas/OpenAI.ItemResourceAdditionalTools'
+ reasoning: '#/components/schemas/OpenAI.ItemResourceReasoningItem'
+ compaction: '#/components/schemas/OpenAI.ItemResourceCompactionBody'
+ image_generation_call: '#/components/schemas/OpenAI.ItemResourceImageGenToolCall'
+ code_interpreter_call: '#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.ItemResourceFunctionShellCall'
+ shell_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput'
+ apply_patch_call: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall'
+ apply_patch_call_output: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput'
+ mcp_list_tools: '#/components/schemas/OpenAI.ItemResourceMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource'
+ mcp_call: '#/components/schemas/OpenAI.ItemResourceMcpToolCall'
+ custom_tool_call: '#/components/schemas/OpenAI.ItemResourceCustomToolCallResource'
+ custom_tool_call_output: '#/components/schemas/OpenAI.ItemResourceCustomToolCallOutputResource'
+ description: Content item used to generate a response.
+ OpenAI.ItemResourceAdditionalTools:
type: object
required:
- type
+ - id
- role
- tools
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
enum:
- additional_tools
- description: The item type. Always `additional_tools`.
+ description: The type of the item. Always `additional_tools`.
x-stainless-const: true
default: additional_tools
- role:
+ id:
type: string
- enum:
- - developer
- description: The role that provided the additional tools. Only `developer` is supported.
- x-stainless-const: true
- default: developer
+ description: The unique ID of the additional tools item.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role that provided the additional tools.
tools:
type: array
items:
$ref: '#/components/schemas/OpenAI.Tool'
- description: A list of additional tools made available at this item.
+ description: The additional tool definitions made available at this item.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- OpenAI.InputItemApplyPatchToolCallItemParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ OpenAI.ItemResourceApplyPatchToolCall:
type: object
required:
- type
+ - id
- call_id
- status
- operation
@@ -24085,28 +59273,30 @@ components:
x-stainless-const: true
default: apply_patch_call
id:
- anyOf:
- - type: string
- - type: 'null'
+ type: string
+ description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
call_id:
type: string
- minLength: 1
- maxLength: 64
description: The unique ID of the apply patch tool call generated by the model.
status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatusParam'
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
description: The status of the apply patch tool call. One of `in_progress` or `completed`.
operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: The specific create, delete, or update instruction for the apply_patch tool call.
+ $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
+ title: Apply patch operation
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A tool call representing a request to create, delete, or update files using diff patches.
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A tool call that applies file diffs by creating, deleting, or updating files.
title: Apply patch tool call
- OpenAI.InputItemApplyPatchToolCallOutputItemParam:
+ OpenAI.ItemResourceApplyPatchToolCallOutput:
type: object
required:
- type
+ - id
- call_id
- status
properties:
@@ -24118,26 +59308,26 @@ components:
x-stainless-const: true
default: apply_patch_call_output
id:
- anyOf:
- - type: string
- - type: 'null'
+ type: string
+ description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
call_id:
type: string
- minLength: 1
- maxLength: 64
description: The unique ID of the apply patch tool call generated by the model.
status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam'
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
description: The status of the apply patch tool call output. One of `completed` or `failed`.
output:
anyOf:
- type: string
- type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call output.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The streamed output emitted by an apply patch tool call.
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The output emitted by an apply patch tool call.
title: Apply patch tool call output
- OpenAI.InputItemCodeInterpreterToolCall:
+ OpenAI.ItemResourceCodeInterpreterToolCall:
type: object
required:
- type
@@ -24182,19 +59372,16 @@ components:
- $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: A tool call to run code.
title: Code interpreter tool call
- OpenAI.InputItemCompactionSummaryItemParam:
+ OpenAI.ItemResourceCompactionBody:
type: object
required:
- type
+ - id
- encrypted_content
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
enum:
@@ -24202,54 +59389,20 @@ components:
description: The type of the item. Always `compaction`.
x-stainless-const: true
default: compaction
+ id:
+ type: string
+ description: The unique ID of the compaction item.
encrypted_content:
type: string
- maxLength: 10485760
- description: The encrypted content of the compaction summary.
+ description: The encrypted content that was produced by compaction.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
title: Compaction item
- OpenAI.InputItemComputerCallOutputItemParam:
- type: object
- required:
- - call_id
- - type
- - output
- properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The ID of the computer tool call that produced the output.
- type:
- type: string
- enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
- x-stainless-const: true
- default: computer_call_output
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- acknowledged_safety_checks:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- - type: 'null'
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.InputItemComputerToolCall:
+ OpenAI.ItemResourceComputerToolCall:
type: object
required:
- type
@@ -24289,50 +59442,62 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: |-
A tool call to a computer use tool. See the
[computer use guide](/docs/guides/tools-computer-use) for more information.
title: Computer tool call
- OpenAI.InputItemCustomToolCall:
+ OpenAI.ItemResourceComputerToolCallOutput:
type: object
required:
- type
+ - id
- call_id
- - name
- - input
+ - output
properties:
type:
type: string
enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
x-stainless-const: true
+ default: computer_call_output
id:
type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
+ description: The ID of the computer tool call output.
+ readOnly: true
call_id:
type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
- type: string
- description: The name of the custom tool being called.
- input:
+ description: The ID of the computer tool call that produced the output.
+ acknowledged_safety_checks:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: |-
+ The safety checks reported by the API that have been acknowledged by the
+ developer.
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ status:
type: string
- description: The input for the custom tool call generated by the model.
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A call to a custom tool created by the model.
- title: Custom tool call
- OpenAI.InputItemCustomToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.ItemResourceCustomToolCallOutputResource:
type: object
required:
- type
- call_id
- output
+ - status
properties:
type:
type: string
@@ -24355,11 +59520,59 @@ components:
description: |-
The output from the custom tool call generated by your code.
Can be a string or an list of output content.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The output of a custom tool call from your code, being sent back to the model.
- title: Custom tool call output
- OpenAI.InputItemFileSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ title: ResponseCustomToolCallOutputItem
+ OpenAI.ItemResourceCustomToolCallResource:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - input
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
+ type: string
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
+ type: string
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ title: ResponseCustomToolCallItem
+ OpenAI.ItemResourceFileSearchToolCall:
type: object
required:
- id
@@ -24399,68 +59612,21 @@ components:
$ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: |-
The results of a file search tool call. See the
[file search guide](/docs/guides/tools-file-search) for more information.
title: File search tool call
- OpenAI.InputItemFunctionCallOutputItemParam:
+ OpenAI.ItemResourceFunctionShellCall:
type: object
required:
- - call_id
- type
- - output
- properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the function tool call generated by the model.
- type:
- type: string
- enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
- x-stainless-const: true
- default: function_call_output
- output:
- oneOf:
- - type: string
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.InputTextContentParam'
- - $ref: '#/components/schemas/OpenAI.InputImageContentParamAutoParam'
- - $ref: '#/components/schemas/OpenAI.InputFileContentParam'
- description: Text, image, or file output of the function tool call.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.InputItemFunctionShellCallItemParam:
- type: object
- required:
+ - id
- call_id
- - type
- action
+ - status
+ - environment
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the shell tool call generated by the model.
type:
type: string
enum:
@@ -24468,62 +59634,72 @@ components:
description: The type of the item. Always `shell_call`.
x-stainless-const: true
default: shell_call
+ id:
+ type: string
+ description: The unique ID of the shell tool call. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the shell tool call generated by the model.
action:
- $ref: '#/components/schemas/OpenAI.FunctionShellActionParam'
+ $ref: '#/components/schemas/OpenAI.FunctionShellAction'
description: The shell commands and limits that describe how to run the tool call.
status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- - type: 'null'
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
+ description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
environment:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
- type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A tool representing a request to execute one or more shell commands.
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A tool call that executes one or more shell commands in a managed environment.
title: Shell tool call
- OpenAI.InputItemFunctionShellCallOutputItemParam:
+ OpenAI.ItemResourceFunctionShellCallOutput:
type: object
required:
- - call_id
- type
+ - id
+ - call_id
+ - status
- output
+ - max_output_length
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the shell tool call generated by the model.
type:
type: string
enum:
- shell_call_output
- description: The type of the item. Always `shell_call_output`.
+ description: The type of the shell call output. Always `shell_call_output`.
x-stainless-const: true
default: shell_call_output
+ id:
+ type: string
+ description: The unique ID of the shell call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the shell tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
+ description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
output:
type: array
items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContentParam'
- description: Captured chunks of stdout and stderr output, along with their associated outcomes.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- - type: 'null'
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
+ description: An array of shell call output contents
max_output_length:
anyOf:
- $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The streamed output items emitted by a shell tool call.
- title: Shell tool call output
- OpenAI.InputItemFunctionToolCall:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The output of a shell tool call that was emitted.
+ title: Shell call output
+ OpenAI.ItemResourceFunctionToolCall:
type: object
required:
- id
@@ -24564,12 +59740,57 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: |-
A tool call to run a function. See the
[function calling guide](/docs/guides/function-calling) for more information.
title: Function tool call
- OpenAI.InputItemImageGenToolCall:
+ OpenAI.ItemResourceFunctionToolCallOutput:
+ type: object
+ required:
+ - id
+ - type
+ - call_id
+ - output
+ properties:
+ id:
+ type: string
+ description: |-
+ The unique ID of the function tool call output. Populated when this item
+ is returned via API.
+ readOnly: true
+ type:
+ type: string
+ enum:
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
+ x-stainless-const: true
+ call_id:
+ type: string
+ description: The unique ID of the function tool call generated by the model.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the function call generated by your code.
+ Can be a string or an list of output content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.ItemResourceImageGenToolCall:
type: object
required:
- type
@@ -24599,10 +59820,54 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: An image generation request made by the model.
title: Image generation call
- OpenAI.InputItemLocalShellToolCall:
+ OpenAI.ItemResourceInputMessage:
+ type: object
+ required:
+ - type
+ - role
+ - content
+ - id
+ properties:
+ type:
+ type: string
+ enum:
+ - message
+ description: The type of the message input. Always set to `message`.
+ x-stainless-const: true
+ default: message
+ role:
+ type: string
+ enum:
+ - user
+ - system
+ - developer
+ description: The role of the message input. One of `user`, `system`, or `developer`.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ content:
+ $ref: '#/components/schemas/OpenAI.InputMessageContentList'
+ id:
+ type: string
+ description: The unique ID of the message input.
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: |-
+ 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.
+ title: Input message
+ OpenAI.ItemResourceLocalShellToolCall:
type: object
required:
- type
@@ -24633,10 +59898,10 @@ components:
- incomplete
description: The status of the local shell call.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: A tool call to run a command on the local shell.
title: Local shell call
- OpenAI.InputItemLocalShellToolCallOutput:
+ OpenAI.ItemResourceLocalShellToolCallOutput:
type: object
required:
- type
@@ -24664,10 +59929,10 @@ components:
- incomplete
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: The output of a local shell tool call.
title: Local shell call output
- OpenAI.InputItemMcpApprovalRequest:
+ OpenAI.ItemResourceMcpApprovalRequest:
type: object
required:
- type
@@ -24695,13 +59960,14 @@ components:
type: string
description: A JSON string of arguments for the tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: A request for human approval of a tool invocation.
title: MCP approval request
- OpenAI.InputItemMcpApprovalResponse:
+ OpenAI.ItemResourceMcpApprovalResponseResource:
type: object
required:
- type
+ - id
- approval_request_id
- approve
properties:
@@ -24712,9 +59978,8 @@ components:
description: The type of the item. Always `mcp_approval_response`.
x-stainless-const: true
id:
- anyOf:
- - type: string
- - type: 'null'
+ type: string
+ description: The unique ID of the approval response
approval_request_id:
type: string
description: The ID of the approval request being answered.
@@ -24726,10 +59991,10 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: A response to an MCP approval request.
title: MCP approval response
- OpenAI.InputItemMcpListTools:
+ OpenAI.ItemResourceMcpListTools:
type: object
required:
- type
@@ -24757,10 +60022,10 @@ components:
error:
$ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: A list of tools available on an MCP server.
title: MCP list tools
- OpenAI.InputItemMcpToolCall:
+ OpenAI.ItemResourceMcpToolCall:
type: object
required:
- type
@@ -24802,10 +60067,10 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: An invocation of a tool on an MCP server.
title: MCP tool call
- OpenAI.InputItemOutputMessage:
+ OpenAI.ItemResourceOutputMessage:
type: object
required:
- id
@@ -24848,10 +60113,10 @@ components:
The status of the message input. One of `in_progress`, `completed`, or
`incomplete`. Populated when input items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: An output message from the model.
title: Output message
- OpenAI.InputItemReasoningItem:
+ OpenAI.ItemResourceReasoningItem:
type: object
required:
- type
@@ -24891,67 +60156,74 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: |-
A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your `input` to the Responses API
for subsequent turns of a conversation if you are manually
[managing context](/docs/guides/conversation-state).
title: Reasoning
- OpenAI.InputItemToolSearchCallItemParam:
+ OpenAI.ItemResourceToolSearchCall:
type: object
required:
- type
+ - id
+ - call_id
+ - execution
- arguments
+ - status
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
enum:
- tool_search_call
- description: The item type. Always `tool_search_call`.
+ description: The type of the item. Always `tool_search_call`.
x-stainless-const: true
default: tool_search_call
+ id:
+ type: string
+ description: The unique ID of the tool search call item.
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
execution:
$ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
description: Whether tool search was executed by the server or by the client.
arguments:
- $ref: '#/components/schemas/OpenAI.EmptyModelParam'
- description: The arguments supplied to the tool search call.
+ description: Arguments used for the tool search call.
status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: The status of the tool search call item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- OpenAI.InputItemToolSearchOutputItemParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ OpenAI.ItemResourceToolSearchOutput:
type: object
required:
- type
+ - id
+ - call_id
+ - execution
- tools
+ - status
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
enum:
- tool_search_output
- description: The item type. Always `tool_search_output`.
+ description: The type of the item. Always `tool_search_output`.
x-stainless-const: true
default: tool_search_output
+ id:
+ type: string
+ description: The unique ID of the tool search output item.
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
execution:
$ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
description: Whether tool search was executed by the server or by the client.
@@ -24959,14 +60231,16 @@ components:
type: array
items:
$ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by the tool search output.
+ description: The loaded tool definitions returned by tool search.
status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: The status of the tool search output item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- OpenAI.InputItemType:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ OpenAI.ItemResourceType:
anyOf:
- type: string
- type: string
@@ -24996,10 +60270,33 @@ components:
- mcp_approval_request
- mcp_approval_response
- mcp_call
- - custom_tool_call_output
- custom_tool_call
- - item_reference
- OpenAI.InputItemWebSearchToolCall:
+ - custom_tool_call_output
+ - structured_outputs
+ - oauth_consent_request
+ - memory_search_call
+ - memory_command_preview_call
+ - memory_command_preview_call_output
+ - workflow_action
+ - a2a_preview_call
+ - a2a_preview_call_output
+ - bing_grounding_call
+ - bing_grounding_call_output
+ - sharepoint_grounding_preview_call
+ - sharepoint_grounding_preview_call_output
+ - azure_ai_search_call
+ - azure_ai_search_call_output
+ - bing_custom_search_preview_call
+ - bing_custom_search_preview_call_output
+ - openapi_call
+ - openapi_call_output
+ - browser_automation_preview_call
+ - browser_automation_preview_call_output
+ - fabric_dataagent_preview_call
+ - fabric_dataagent_preview_call_output
+ - azure_function_call
+ - azure_function_call_output
+ OpenAI.ItemResourceWebSearchToolCall:
type: object
required:
- id
@@ -25034,2123 +60331,2081 @@ components:
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_in_page).
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
description: |-
The results of a web search tool call. See the
[web search guide](/docs/guides/tools-web-search) for more information.
title: Web search tool call
- OpenAI.InputMessageContentList:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputContent'
- description: |-
- A list of one or many input items to the model, containing different content
- types.
- title: Input item content list
- OpenAI.InputParam:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputItem'
- description: |-
- Text, image, or file inputs to the model, used to generate a response.
- Learn more:
- - [Text inputs and outputs](/docs/guides/text)
- - [Image inputs](/docs/guides/images)
- - [File inputs](/docs/guides/pdf-files)
- - [Conversation state](/docs/guides/conversation-state)
- - [Function calling](/docs/guides/function-calling)
- OpenAI.InputTextContent:
- type: object
- required:
- - type
- - text
- properties:
- type:
- type: string
- enum:
- - input_text
- description: The type of the input item. Always `input_text`.
- x-stainless-const: true
- default: input_text
- text:
- type: string
- description: The text input to the model.
- description: A text input to the model.
- title: Input text
- OpenAI.InputTextContentParam:
+ OpenAI.ItemToolSearchCallItemParam:
type: object
required:
- type
- - text
+ - arguments
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- - input_text
- description: The type of the input item. Always `input_text`.
+ - tool_search_call
+ description: The item type. Always `tool_search_call`.
x-stainless-const: true
- default: input_text
- text:
- type: string
- maxLength: 10485760
- description: The text input to the model.
- description: A text input to the model.
- title: Input text
- OpenAI.Item:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.ItemType'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OpenAI.ItemInputMessage'
- output_message: '#/components/schemas/OpenAI.ItemOutputMessage'
- file_search_call: '#/components/schemas/OpenAI.ItemFileSearchToolCall'
- computer_call: '#/components/schemas/OpenAI.ItemComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.ItemComputerCallOutputItemParam'
- web_search_call: '#/components/schemas/OpenAI.ItemWebSearchToolCall'
- function_call: '#/components/schemas/OpenAI.ItemFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.ItemFunctionCallOutputItemParam'
- tool_search_call: '#/components/schemas/OpenAI.ItemToolSearchCallItemParam'
- tool_search_output: '#/components/schemas/OpenAI.ItemToolSearchOutputItemParam'
- additional_tools: '#/components/schemas/OpenAI.ItemAdditionalToolsItemParam'
- reasoning: '#/components/schemas/OpenAI.ItemReasoningItem'
- compaction: '#/components/schemas/OpenAI.ItemCompactionSummaryItemParam'
- image_generation_call: '#/components/schemas/OpenAI.ItemImageGenToolCall'
- code_interpreter_call: '#/components/schemas/OpenAI.ItemCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.ItemLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.ItemLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.ItemFunctionShellCallItemParam'
- shell_call_output: '#/components/schemas/OpenAI.ItemFunctionShellCallOutputItemParam'
- apply_patch_call: '#/components/schemas/OpenAI.ItemApplyPatchToolCallItemParam'
- apply_patch_call_output: '#/components/schemas/OpenAI.ItemApplyPatchToolCallOutputItemParam'
- mcp_list_tools: '#/components/schemas/OpenAI.ItemMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.ItemMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.ItemMcpApprovalResponse'
- mcp_call: '#/components/schemas/OpenAI.ItemMcpToolCall'
- custom_tool_call_output: '#/components/schemas/OpenAI.ItemCustomToolCallOutput'
- custom_tool_call: '#/components/schemas/OpenAI.ItemCustomToolCall'
- description: Content item used to generate a response.
- OpenAI.ItemAdditionalToolsItemParam:
+ default: tool_search_call
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ arguments:
+ $ref: '#/components/schemas/OpenAI.EmptyModelParam'
+ description: The arguments supplied to the tool search call.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ OpenAI.ItemToolSearchOutputItemParam:
type: object
required:
- type
- - role
- tools
properties:
id:
anyOf:
- type: string
- type: 'null'
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- - additional_tools
- description: The item type. Always `additional_tools`.
- x-stainless-const: true
- default: additional_tools
- role:
- type: string
- enum:
- - developer
- description: The role that provided the additional tools. Only `developer` is supported.
+ - tool_search_output
+ description: The item type. Always `tool_search_output`.
x-stainless-const: true
- default: developer
+ default: tool_search_output
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
tools:
type: array
items:
$ref: '#/components/schemas/OpenAI.Tool'
- description: A list of additional tools made available at this item.
+ description: The loaded tool definitions returned by the tool search output.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
allOf:
- $ref: '#/components/schemas/OpenAI.Item'
- OpenAI.ItemApplyPatchToolCallItemParam:
+ OpenAI.ItemType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - message
+ - output_message
+ - file_search_call
+ - computer_call
+ - computer_call_output
+ - web_search_call
+ - function_call
+ - function_call_output
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - reasoning
+ - compaction
+ - image_generation_call
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - mcp_call
+ - custom_tool_call_output
+ - custom_tool_call
+ - structured_outputs
+ - oauth_consent_request
+ - memory_search_call
+ - memory_command_preview_call
+ - memory_command_preview_call_output
+ - workflow_action
+ - a2a_preview_call
+ - a2a_preview_call_output
+ - bing_grounding_call
+ - bing_grounding_call_output
+ - sharepoint_grounding_preview_call
+ - sharepoint_grounding_preview_call_output
+ - azure_ai_search_call
+ - azure_ai_search_call_output
+ - bing_custom_search_preview_call
+ - bing_custom_search_preview_call_output
+ - openapi_call
+ - openapi_call_output
+ - browser_automation_preview_call
+ - browser_automation_preview_call_output
+ - fabric_dataagent_preview_call
+ - fabric_dataagent_preview_call_output
+ - azure_function_call
+ - azure_function_call_output
+ OpenAI.ItemWebSearchToolCall:
type: object
required:
+ - id
- type
- - call_id
- status
- - operation
+ - action
properties:
+ id:
+ type: string
+ description: The unique ID of the web search tool call.
type:
type: string
enum:
- - apply_patch_call
- description: The type of the item. Always `apply_patch_call`.
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
x-stainless-const: true
- default: apply_patch_call
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the apply patch tool call generated by the model.
status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatusParam'
- description: The status of the apply patch tool call. One of `in_progress` or `completed`.
- operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: The specific create, delete, or update instruction for the apply_patch tool call.
+ type: string
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - failed
+ - incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ description: |-
+ 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_in_page).
allOf:
- $ref: '#/components/schemas/OpenAI.Item'
- description: A tool call representing a request to create, delete, or update files using diff patches.
- title: Apply patch tool call
- OpenAI.ItemApplyPatchToolCallOutputItemParam:
+ description: |-
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.KeyPressAction:
type: object
required:
- type
- - call_id
- - status
+ - keys
properties:
type:
type: string
enum:
- - apply_patch_call_output
- description: The type of the item. Always `apply_patch_call_output`.
+ - keypress
+ description: Specifies the event type. For a keypress action, this property is always set to `keypress`.
x-stainless-const: true
- default: apply_patch_call_output
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam'
- description: The status of the apply patch tool call output. One of `completed` or `failed`.
- output:
- anyOf:
- - type: string
- - type: 'null'
+ keys:
+ type: array
+ items:
+ type: string
+ description: The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The streamed output emitted by an apply patch tool call.
- title: Apply patch tool call output
- OpenAI.ItemCodeInterpreterToolCall:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A collection of keypresses the model would like to perform.
+ title: KeyPress
+ OpenAI.KnownSpeakerNames:
+ type: array
+ items:
+ type: string
+ maxItems: 4
+ description: Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported.
+ OpenAI.KnownSpeakerReferences:
+ type: array
+ items:
+ type: string
+ maxItems: 4
+ description: Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)) that contain known speaker references matching `known_speaker_names[]`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by `file`.
+ OpenAI.ListAssistantsResponse:
type: object
required:
- - type
- - id
- - status
- - container_id
- - code
- - outputs
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
- type: string
- enum:
- - code_interpreter_call
- description: The type of the code interpreter tool call. Always `code_interpreter_call`.
- x-stainless-const: true
- default: code_interpreter_call
- id:
+ object:
type: string
- description: The unique ID of the code interpreter tool call.
- status:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - interpreting
- - failed
- description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
- container_id:
+ last_id:
type: string
- description: The ID of the container used to run the code.
- code:
- anyOf:
- - type: string
- - type: 'null'
- outputs:
- anyOf:
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A tool call to run code.
- title: Code interpreter tool call
- OpenAI.ItemCompactionSummaryItemParam:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ x-oaiMeta:
+ name: List assistants response object
+ group: chat
+ example: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698982736,
+ "name": "Coding Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc456",
+ "object": "assistant",
+ "created_at": 1698982718,
+ "name": "My Assistant",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc789",
+ "object": "assistant",
+ "created_at": 1698982643,
+ "name": null,
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ ],
+ "first_id": "asst_abc123",
+ "last_id": "asst_abc789",
+ "has_more": false
+ }
+ OpenAI.ListBatchesResponse:
type: object
required:
- - type
- - encrypted_content
+ - data
+ - has_more
+ - object
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- type:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Batch'
+ x-ms-list-page-items: true
+ first_id:
+ type: string
+ last_id:
+ type: string
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ object:
type: string
enum:
- - compaction
- description: The type of the item. Always `compaction`.
+ - list
x-stainless-const: true
- default: compaction
- encrypted_content:
+ OpenAI.ListFilesResponse:
+ type: object
+ required:
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
+ properties:
+ object:
+ type: string
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.OpenAIFile'
+ x-ms-list-page-items: true
+ first_id:
type: string
- maxLength: 10485760
- description: The encrypted content of the compaction summary.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
- title: Compaction item
- OpenAI.ItemComputerCallOutputItemParam:
+ last_id:
+ type: string
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListFineTuningCheckpointPermissionResponse:
type: object
required:
- - call_id
- - type
- - output
+ - data
+ - object
+ - has_more
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The ID of the computer tool call that produced the output.
- type:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FineTuningCheckpointPermission'
+ x-ms-list-page-items: true
+ object:
type: string
enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
+ - list
x-stainless-const: true
- default: computer_call_output
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- acknowledged_safety_checks:
+ first_id:
anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ - type: string
- type: 'null'
- status:
+ last_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.ItemComputerToolCall:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListFineTuningJobCheckpointsResponse:
type: object
required:
- - type
- - id
- - call_id
- - pending_safety_checks
- - status
+ - data
+ - object
+ - has_more
properties:
- type:
- type: string
- enum:
- - computer_call
- description: The type of the computer call. Always `computer_call`.
- default: computer_call
- id:
- type: string
- description: The unique ID of the computer call.
- call_id:
- type: string
- description: An identifier used when responding to the tool call with output.
- action:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- actions:
- $ref: '#/components/schemas/OpenAI.ComputerActionList'
- pending_safety_checks:
+ data:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: The pending safety checks for the computer call.
- status:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpoint'
+ x-ms-list-page-items: true
+ object:
type: string
enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: |-
- A tool call to a computer use tool. See the
- [computer use guide](/docs/guides/tools-computer-use) for more information.
- title: Computer tool call
- OpenAI.ItemCustomToolCall:
+ - list
+ x-stainless-const: true
+ first_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ last_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListFineTuningJobEventsResponse:
type: object
required:
- - type
- - call_id
- - name
- - input
+ - data
+ - object
+ - has_more
properties:
- type:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobEvent'
+ x-ms-list-page-items: true
+ object:
type: string
enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
+ - list
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
- type: string
- description: The name of the custom tool being called.
- input:
- type: string
- description: The input for the custom tool call generated by the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A call to a custom tool created by the model.
- title: Custom tool call
- OpenAI.ItemCustomToolCallOutput:
+ has_more:
+ type: boolean
+ OpenAI.ListMessagesResponse:
type: object
required:
- - type
- - call_id
- - output
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
+ object:
type: string
- enum:
- - custom_tool_call_output
- description: The type of the custom tool call output. Always `custom_tool_call_output`.
- x-stainless-const: true
- id:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MessageObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The unique ID of the custom tool call output in the OpenAI platform.
- call_id:
+ last_id:
type: string
- description: The call ID, used to map this custom tool call output to a custom tool call.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the custom tool call generated by your code.
- Can be a string or an list of output content.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The output of a custom tool call from your code, being sent back to the model.
- title: Custom tool call output
- OpenAI.ItemField:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.ItemFieldType'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OpenAI.ItemFieldMessage'
- function_call: '#/components/schemas/OpenAI.ItemFieldFunctionToolCall'
- tool_search_call: '#/components/schemas/OpenAI.ItemFieldToolSearchCall'
- tool_search_output: '#/components/schemas/OpenAI.ItemFieldToolSearchOutput'
- additional_tools: '#/components/schemas/OpenAI.ItemFieldAdditionalTools'
- function_call_output: '#/components/schemas/OpenAI.ItemFieldFunctionToolCallOutput'
- file_search_call: '#/components/schemas/OpenAI.ItemFieldFileSearchToolCall'
- web_search_call: '#/components/schemas/OpenAI.ItemFieldWebSearchToolCall'
- image_generation_call: '#/components/schemas/OpenAI.ItemFieldImageGenToolCall'
- computer_call: '#/components/schemas/OpenAI.ItemFieldComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.ItemFieldComputerToolCallOutput'
- reasoning: '#/components/schemas/OpenAI.ItemFieldReasoningItem'
- compaction: '#/components/schemas/OpenAI.ItemFieldCompactionBody'
- code_interpreter_call: '#/components/schemas/OpenAI.ItemFieldCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.ItemFieldLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.ItemFieldLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.ItemFieldFunctionShellCall'
- shell_call_output: '#/components/schemas/OpenAI.ItemFieldFunctionShellCallOutput'
- apply_patch_call: '#/components/schemas/OpenAI.ItemFieldApplyPatchToolCall'
- apply_patch_call_output: '#/components/schemas/OpenAI.ItemFieldApplyPatchToolCallOutput'
- mcp_list_tools: '#/components/schemas/OpenAI.ItemFieldMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.ItemFieldMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.ItemFieldMcpApprovalResponseResource'
- mcp_call: '#/components/schemas/OpenAI.ItemFieldMcpToolCall'
- custom_tool_call: '#/components/schemas/OpenAI.ItemFieldCustomToolCall'
- custom_tool_call_output: '#/components/schemas/OpenAI.ItemFieldCustomToolCallOutput'
- description: An item representing a message, tool call, tool output, reasoning, or other response element.
- OpenAI.ItemFieldAdditionalTools:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListModelsResponse:
type: object
required:
- - type
- - id
- - role
- - tools
+ - object
+ - data
properties:
- type:
+ object:
type: string
enum:
- - additional_tools
- description: The type of the item. Always `additional_tools`.
+ - list
x-stainless-const: true
- default: additional_tools
- id:
- type: string
- description: The unique ID of the additional tools item.
- role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role that provided the additional tools.
- tools:
+ data:
type: array
items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The additional tool definitions made available at this item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- OpenAI.ItemFieldApplyPatchToolCall:
+ $ref: '#/components/schemas/OpenAI.Model'
+ x-ms-list-page-items: true
+ OpenAI.ListPaginatedFineTuningJobsResponse:
type: object
required:
- - type
- - id
- - call_id
- - status
- - operation
+ - data
+ - has_more
+ - object
properties:
- type:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ x-ms-list-page-items: true
+ has_more:
+ type: boolean
+ object:
type: string
enum:
- - apply_patch_call
- description: The type of the item. Always `apply_patch_call`.
+ - list
x-stainless-const: true
- default: apply_patch_call
- id:
+ OpenAI.ListRunStepsResponse:
+ type: object
+ required:
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
+ properties:
+ object:
type: string
- description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
- call_id:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunStepObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
- description: The status of the apply patch tool call. One of `in_progress` or `completed`.
- operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
- title: Apply patch operation
- created_by:
+ last_id:
type: string
- description: The ID of the entity that created this tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A tool call that applies file diffs by creating, deleting, or updating files.
- title: Apply patch tool call
- OpenAI.ItemFieldApplyPatchToolCallOutput:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListRunsResponse:
type: object
required:
- - type
- - id
- - call_id
- - status
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
- type: string
- enum:
- - apply_patch_call_output
- description: The type of the item. Always `apply_patch_call_output`.
- x-stainless-const: true
- default: apply_patch_call_output
- id:
+ object:
type: string
- description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
- call_id:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
- description: The status of the apply patch tool call output. One of `completed` or `failed`.
- output:
- anyOf:
- - type: string
- - type: 'null'
- created_by:
+ last_id:
type: string
- description: The ID of the entity that created this tool call output.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output emitted by an apply patch tool call.
- title: Apply patch tool call output
- OpenAI.ItemFieldCodeInterpreterToolCall:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListVectorStoreFilesFilter:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - failed
+ - cancelled
+ OpenAI.ListVectorStoreFilesResponse:
type: object
required:
- - type
- - id
- - status
- - container_id
- - code
- - outputs
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
- type: string
- enum:
- - code_interpreter_call
- description: The type of the code interpreter tool call. Always `code_interpreter_call`.
- x-stainless-const: true
- default: code_interpreter_call
- id:
+ object:
type: string
- description: The unique ID of the code interpreter tool call.
- status:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - interpreting
- - failed
- description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
- container_id:
+ last_id:
type: string
- description: The ID of the container used to run the code.
- code:
- anyOf:
- - type: string
- - type: 'null'
- outputs:
- anyOf:
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A tool call to run code.
- title: Code interpreter tool call
- OpenAI.ItemFieldCompactionBody:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListVectorStoresResponse:
type: object
required:
- - type
- - id
- - encrypted_content
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
- type: string
- enum:
- - compaction
- description: The type of the item. Always `compaction`.
- x-stainless-const: true
- default: compaction
- id:
+ object:
type: string
- description: The unique ID of the compaction item.
- encrypted_content:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The encrypted content that was produced by compaction.
- created_by:
+ last_id:
type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
- title: Compaction item
- OpenAI.ItemFieldComputerToolCall:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.LocalEnvironmentResource:
type: object
required:
- type
- - id
- - call_id
- - pending_safety_checks
- - status
properties:
type:
type: string
enum:
- - computer_call
- description: The type of the computer call. Always `computer_call`.
- default: computer_call
- id:
- type: string
- description: The unique ID of the computer call.
- call_id:
- type: string
- description: An identifier used when responding to the tool call with output.
- action:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- actions:
- $ref: '#/components/schemas/OpenAI.ComputerActionList'
- pending_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: The pending safety checks for the computer call.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ - local
+ description: The environment type. Always `local`.
+ x-stainless-const: true
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: |-
- A tool call to a computer use tool. See the
- [computer use guide](/docs/guides/tools-computer-use) for more information.
- title: Computer tool call
- OpenAI.ItemFieldComputerToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ description: Represents the use of a local environment to perform shell actions.
+ title: Local Environment
+ OpenAI.LocalShellExecAction:
type: object
required:
- type
- - id
- - call_id
- - output
+ - command
+ - env
properties:
type:
type: string
enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
+ - exec
+ description: The type of the local shell action. Always `exec`.
x-stainless-const: true
- default: computer_call_output
- id:
- type: string
- description: The ID of the computer tool call output.
- readOnly: true
- call_id:
- type: string
- description: The ID of the computer tool call that produced the output.
- acknowledged_safety_checks:
+ default: exec
+ command:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: |-
- The safety checks reported by the API that have been acknowledged by the
- developer.
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.ItemFieldCustomToolCall:
+ type: string
+ description: The command to run.
+ timeout_ms:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ working_directory:
+ anyOf:
+ - type: string
+ - type: 'null'
+ env:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Environment variables to set for the command.
+ x-oaiTypeLabel: map
+ user:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: Execute a shell command on the server.
+ title: Local shell exec action
+ OpenAI.LocalShellToolParam:
type: object
required:
- type
- - call_id
- - name
- - input
properties:
type:
type: string
enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
+ - local_shell
+ description: The type of the local shell tool. Always `local_shell`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
name:
type: string
- description: The name of the custom tool being called.
- input:
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
type: string
- description: The input for the custom tool call generated by the model.
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A call to a custom tool created by the model.
- title: Custom tool call
- OpenAI.ItemFieldCustomToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that allows the model to execute shell commands in a local environment.
+ title: Local shell tool
+ OpenAI.LocalSkillParam:
type: object
required:
- - type
- - call_id
- - output
+ - name
+ - description
+ - path
properties:
- type:
+ name:
type: string
- enum:
- - custom_tool_call_output
- description: The type of the custom tool call output. Always `custom_tool_call_output`.
- x-stainless-const: true
- id:
+ description: The name of the skill.
+ description:
type: string
- description: The unique ID of the custom tool call output in the OpenAI platform.
- call_id:
+ description: The description of the skill.
+ path:
type: string
- description: The call ID, used to map this custom tool call output to a custom tool call.
- output:
- oneOf:
+ description: The path to the directory containing the skill.
+ OpenAI.LogProb:
+ type: object
+ required:
+ - token
+ - logprob
+ - bytes
+ - top_logprobs
+ properties:
+ token:
+ type: string
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ bytes:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ top_logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TopLogProb'
+ description: The log probability of a token.
+ title: Log probability
+ OpenAI.MCPListToolsTool:
+ type: object
+ required:
+ - name
+ - input_schema
+ properties:
+ name:
+ type: string
+ description: The name of the tool.
+ description:
+ anyOf:
- type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the custom tool call generated by your code.
- Can be a string or an list of output content.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a custom tool call from your code, being sent back to the model.
- title: Custom tool call output
- OpenAI.ItemFieldFileSearchToolCall:
+ - type: 'null'
+ input_schema:
+ $ref: '#/components/schemas/OpenAI.MCPListToolsToolInputSchema'
+ description: The JSON schema describing the tool's input.
+ annotations:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPListToolsToolAnnotations'
+ - type: 'null'
+ description: A tool available on an MCP server.
+ title: MCP list tools tool
+ OpenAI.MCPListToolsToolAnnotations:
+ type: object
+ OpenAI.MCPListToolsToolInputSchema:
+ type: object
+ OpenAI.MCPTool:
type: object
required:
- - id
- type
- - status
- - queries
+ - server_label
properties:
- id:
- type: string
- description: The unique ID of the file search tool call.
type:
type: string
enum:
- - file_search_call
- description: The type of the file search tool call. Always `file_search_call`.
+ - mcp
+ description: The type of the MCP tool. Always `mcp`.
x-stainless-const: true
- status:
+ server_label:
+ type: string
+ description: A label for this MCP server, used to identify it in tool calls.
+ server_url:
+ type: string
+ format: uri
+ description: |-
+ The URL for the MCP server. One of `server_url`, `connector_id`, or
+ `tunnel_id` must be provided.
+ connector_id:
type: string
enum:
- - in_progress
- - searching
- - completed
- - incomplete
- - failed
+ - connector_dropbox
+ - connector_gmail
+ - connector_googlecalendar
+ - connector_googledrive
+ - connector_microsoftteams
+ - connector_outlookcalendar
+ - connector_outlookemail
+ - connector_sharepoint
description: |-
- The status of the file search tool call. One of `in_progress`,
- `searching`, `incomplete` or `failed`,
- queries:
- type: array
- items:
- type: string
- description: The queries used to search for files.
- results:
+ Identifier for service connectors, like those available in ChatGPT. One of
+ `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
+ about service connectors [here](/docs/guides/tools-remote-mcp#connectors).
+ Currently supported `connector_id` values are:
+ - Dropbox: `connector_dropbox`
+ - Gmail: `connector_gmail`
+ - Google Calendar: `connector_googlecalendar`
+ - Google Drive: `connector_googledrive`
+ - Microsoft Teams: `connector_microsoftteams`
+ - Outlook Calendar: `connector_outlookcalendar`
+ - Outlook Email: `connector_outlookemail`
+ - SharePoint: `connector_sharepoint`
+ tunnel_id:
+ type: string
+ pattern: ^tunnel_[a-z0-9]{32}$
+ description: |-
+ The Secure MCP Tunnel ID to use instead of a direct server URL. One of
+ `server_url`, `connector_id`, or `tunnel_id` must be provided.
+ authorization:
+ type: string
+ description: |-
+ An OAuth access token that can be used with a remote MCP server, either
+ with a custom MCP server URL or a service connector. Your application
+ must handle the OAuth authorization flow and provide the token here.
+ server_description:
+ type: string
+ description: Optional description of the MCP server, used to provide more context.
+ headers:
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ type: string
+ - type: 'null'
+ allowed_tools:
anyOf:
- type: array
items:
- $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ type: string
+ - $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ - type: 'null'
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ enum:
+ - always
+ - never
- type: 'null'
+ default: always
+ defer_loading:
+ type: boolean
+ description: Whether this MCP tool is deferred and discovered via tool search.
+ project_connection_id:
+ type: string
+ description: The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server.
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
+ - $ref: '#/components/schemas/OpenAI.Tool'
description: |-
- The results of a file search tool call. See the
- [file search guide](/docs/guides/tools-file-search) for more information.
- title: File search tool call
- OpenAI.ItemFieldFunctionShellCall:
+ Give the model access to additional tools via remote Model Context Protocol
+ (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).
+ title: MCP tool
+ OpenAI.MCPToolCallStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - calling
+ - failed
+ OpenAI.MCPToolFilter:
+ type: object
+ properties:
+ tool_names:
+ type: array
+ items:
+ type: string
+ description: List of allowed tool names.
+ title: MCP allowed tools
+ read_only:
+ type: boolean
+ description: |-
+ Indicates whether or not a tool modifies data or is read-only. If an
+ MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
+ it will match this filter.
+ description: A filter object to specify which tools are allowed.
+ title: MCP tool filter
+ OpenAI.MCPToolRequireApproval:
+ type: object
+ properties:
+ always:
+ $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ never:
+ $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ OpenAI.MessageContent:
type: object
required:
- type
- - id
- - call_id
- - action
- - status
- - environment
properties:
type:
- type: string
- enum:
- - shell_call
- description: The type of the item. Always `shell_call`.
- x-stainless-const: true
- default: shell_call
- id:
- type: string
- description: The unique ID of the shell tool call. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.FunctionShellAction'
- description: The shell commands and limits that describe how to run the tool call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
- description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
- environment:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
- - type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A tool call that executes one or more shell commands in a managed environment.
- title: Shell tool call
- OpenAI.ItemFieldFunctionShellCallOutput:
+ $ref: '#/components/schemas/OpenAI.MessageContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ text: '#/components/schemas/OpenAI.TextContent'
+ computer_screenshot: '#/components/schemas/OpenAI.ComputerScreenshotContent'
+ input_text: '#/components/schemas/OpenAI.MessageContentInputTextContent'
+ output_text: '#/components/schemas/OpenAI.MessageContentOutputTextContent'
+ reasoning_text: '#/components/schemas/OpenAI.MessageContentReasoningTextContent'
+ refusal: '#/components/schemas/OpenAI.MessageContentRefusalContent'
+ input_image: '#/components/schemas/OpenAI.MessageContentInputImageContent'
+ input_file: '#/components/schemas/OpenAI.MessageContentInputFileContent'
+ summary_text: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: A content part that makes up an input or output item.
+ OpenAI.MessageContentImageFileObject:
type: object
required:
- type
- - id
- - call_id
- - status
- - output
- - max_output_length
+ - image_file
properties:
type:
type: string
enum:
- - shell_call_output
- description: The type of the shell call output. Always `shell_call_output`.
+ - image_file
+ description: Always `image_file`.
x-stainless-const: true
- default: shell_call_output
- id:
- type: string
- description: The unique ID of the shell call output. Populated when this item is returned via API.
- call_id:
+ image_file:
+ $ref: '#/components/schemas/OpenAI.MessageContentImageFileObjectImageFile'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: References an image [File](/docs/api-reference/files) in the content of a message.
+ title: Image file
+ OpenAI.MessageContentImageFileObjectImageFile:
+ type: object
+ required:
+ - file_id
+ properties:
+ file_id:
type: string
- description: The unique ID of the shell tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
- description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
- description: An array of shell call output contents
- max_output_length:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- created_by:
+ detail:
type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a shell tool call that was emitted.
- title: Shell call output
- OpenAI.ItemFieldFunctionToolCall:
+ enum:
+ - auto
+ - low
+ - high
+ default: auto
+ OpenAI.MessageContentImageUrlObject:
type: object
required:
- - id
- type
- - call_id
- - name
- - arguments
+ - image_url
properties:
- id:
- type: string
- description: The unique ID of the function tool call.
- readOnly: true
type:
type: string
enum:
- - function_call
- description: The type of the function tool call. Always `function_call`.
+ - image_url
+ description: The type of the content part.
x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- namespace:
- type: string
- description: The namespace of the function to run.
- name:
- type: string
- description: The name of the function to run.
- arguments:
+ image_url:
+ $ref: '#/components/schemas/OpenAI.MessageContentImageUrlObjectImageUrl'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: References an image URL in the content of a message.
+ title: Image URL
+ OpenAI.MessageContentImageUrlObjectImageUrl:
+ type: object
+ required:
+ - url
+ properties:
+ url:
type: string
- description: A JSON string of the arguments to pass to the function.
- status:
+ format: uri
+ detail:
type: string
enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: |-
- A tool call to run a function. See the
- [function calling guide](/docs/guides/function-calling) for more information.
- title: Function tool call
- OpenAI.ItemFieldFunctionToolCallOutput:
+ - auto
+ - low
+ - high
+ default: auto
+ OpenAI.MessageContentInputFileContent:
type: object
required:
- - id
- type
- - call_id
- - output
properties:
- id:
- type: string
- description: |-
- The unique ID of the function tool call output. Populated when this item
- is returned via API.
- readOnly: true
type:
type: string
enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
+ - input_file
+ description: The type of the input item. Always `input_file`.
x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- output:
- oneOf:
+ default: input_file
+ file_id:
+ anyOf:
- type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the function call generated by your code.
- Can be a string or an list of output content.
- status:
+ - type: 'null'
+ filename:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ description: The name of the file to be sent to the model.
+ file_data:
+ type: string
+ description: The content of the file to be sent to the model.
+ file_url:
+ type: string
+ format: uri
+ description: The URL of the file to be sent to the model.
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.ItemFieldImageGenToolCall:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A file input to the model.
+ title: Input file
+ OpenAI.MessageContentInputImageContent:
type: object
required:
- type
- - id
- - status
- - result
+ - detail
properties:
type:
type: string
enum:
- - image_generation_call
- description: The type of the image generation call. Always `image_generation_call`.
+ - input_image
+ description: The type of the input item. Always `input_image`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the image generation call.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - generating
- - failed
- description: The status of the image generation call.
- result:
+ default: input_image
+ image_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ file_id:
anyOf:
- type: string
- type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: An image generation request made by the model.
- title: Image generation call
- OpenAI.ItemFieldLocalShellToolCall:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
+ title: Input image
+ OpenAI.MessageContentInputTextContent:
type: object
required:
- type
- - id
- - call_id
- - action
- - status
+ - text
properties:
type:
type: string
enum:
- - local_shell_call
- description: The type of the local shell call. Always `local_shell_call`.
+ - input_text
+ description: The type of the input item. Always `input_text`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell call.
- call_id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
- status:
+ default: input_text
+ text:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: The status of the local shell call.
+ description: The text input to the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A tool call to run a command on the local shell.
- title: Local shell call
- OpenAI.ItemFieldLocalShellToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A text input to the model.
+ title: Input text
+ OpenAI.MessageContentOutputTextContent:
type: object
required:
- type
- - id
- - output
+ - text
+ - annotations
+ - logprobs
properties:
type:
type: string
enum:
- - local_shell_call_output
- description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ - output_text
+ description: The type of the output text. Always `output_text`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- output:
+ default: output_text
+ text:
type: string
- description: A JSON string of the output of the local shell tool call.
- status:
- anyOf:
- - type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - type: 'null'
+ description: The text output from the model.
+ annotations:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Annotation'
+ description: The annotations of the text output.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.LogProb'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a local shell tool call.
- title: Local shell call output
- OpenAI.ItemFieldMcpApprovalRequest:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A text output from the model.
+ title: Output text
+ OpenAI.MessageContentReasoningTextContent:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
+ - text
properties:
type:
type: string
enum:
- - mcp_approval_request
- description: The type of the item. Always `mcp_approval_request`.
+ - reasoning_text
+ description: The type of the reasoning text. Always `reasoning_text`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval request.
- server_label:
- type: string
- description: The label of the MCP server making the request.
- name:
- type: string
- description: The name of the tool to run.
- arguments:
+ default: reasoning_text
+ text:
type: string
- description: A JSON string of arguments for the tool.
+ description: The reasoning text from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A request for human approval of a tool invocation.
- title: MCP approval request
- OpenAI.ItemFieldMcpApprovalResponseResource:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: Reasoning text from the model.
+ title: Reasoning text
+ OpenAI.MessageContentRefusalContent:
type: object
required:
- type
- - id
- - approval_request_id
- - approve
+ - refusal
properties:
type:
type: string
enum:
- - mcp_approval_response
- description: The type of the item. Always `mcp_approval_response`.
+ - refusal
+ description: The type of the refusal. Always `refusal`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval response
- approval_request_id:
+ default: refusal
+ refusal:
type: string
- description: The ID of the approval request being answered.
- approve:
- type: boolean
- description: Whether the request was approved.
- reason:
- anyOf:
- - type: string
- - type: 'null'
+ description: The refusal explanation from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A response to an MCP approval request.
- title: MCP approval response
- OpenAI.ItemFieldMcpListTools:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A refusal from the model.
+ title: Refusal
+ OpenAI.MessageContentRefusalObject:
type: object
required:
- type
- - id
- - server_label
- - tools
+ - refusal
properties:
type:
type: string
enum:
- - mcp_list_tools
- description: The type of the item. Always `mcp_list_tools`.
+ - refusal
+ description: Always `refusal`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the list.
- server_label:
+ refusal:
type: string
- description: The label of the MCP server.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
- description: The tools available on the server.
- error:
- $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A list of tools available on an MCP server.
- title: MCP list tools
- OpenAI.ItemFieldMcpToolCall:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: The refusal content generated by the assistant.
+ title: Refusal
+ OpenAI.MessageContentTextAnnotationsFileCitationObject:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
+ - text
+ - file_citation
+ - start_index
+ - end_index
properties:
type:
type: string
enum:
- - mcp_call
- description: The type of the item. Always `mcp_call`.
+ - file_citation
+ description: Always `file_citation`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the tool call.
- server_label:
- type: string
- description: The label of the MCP server running the tool.
- name:
- type: string
- description: The name of the tool that was run.
- arguments:
+ text:
type: string
- description: A JSON string of the arguments passed to the tool.
- output:
- anyOf:
- - type: string
- - type: 'null'
- error:
- type: object
- unevaluatedProperties: {}
- status:
- $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
- description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
- approval_request_id:
- anyOf:
- - type: string
- - type: 'null'
+ description: The text in the message content that needs to be replaced.
+ file_citation:
+ $ref: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation'
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: An invocation of a tool on an MCP server.
- title: MCP tool call
- OpenAI.ItemFieldMessage:
+ - $ref: '#/components/schemas/OpenAI.TextAnnotation'
+ description: 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.
+ title: File citation
+ OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation:
+ type: object
+ required:
+ - file_id
+ properties:
+ file_id:
+ type: string
+ OpenAI.MessageContentTextAnnotationsFilePathObject:
type: object
required:
- type
- - id
- - status
- - role
- - content
+ - text
+ - file_path
+ - start_index
+ - end_index
properties:
type:
type: string
enum:
- - message
- description: The type of the message. Always set to `message`.
+ - file_path
+ description: Always `file_path`.
x-stainless-const: true
- default: message
- id:
+ text:
type: string
- description: The unique ID of the message.
- status:
- $ref: '#/components/schemas/OpenAI.MessageStatus'
- description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
- role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`.
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.MessageContent'
- description: The content of the message
- phase:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
- - type: 'null'
+ description: The text in the message content that needs to be replaced.
+ file_path:
+ $ref: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath'
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A message to or from the model.
- title: Message
- OpenAI.ItemFieldReasoningItem:
+ - $ref: '#/components/schemas/OpenAI.TextAnnotation'
+ description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.
+ title: File path
+ OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath:
+ type: object
+ required:
+ - file_id
+ properties:
+ file_id:
+ type: string
+ OpenAI.MessageContentTextObject:
type: object
required:
- type
- - id
- - summary
+ - text
properties:
type:
type: string
enum:
- - reasoning
- description: The type of the object. Always `reasoning`.
+ - text
+ description: Always `text`.
x-stainless-const: true
- id:
+ text:
+ $ref: '#/components/schemas/OpenAI.MessageContentTextObjectText'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: The text content that is part of a message.
+ title: Text
+ OpenAI.MessageContentTextObjectText:
+ type: object
+ required:
+ - value
+ - annotations
+ properties:
+ value:
type: string
- description: The unique identifier of the reasoning content.
- encrypted_content:
- anyOf:
- - type: string
- - type: 'null'
- summary:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.SummaryTextContent'
- description: Reasoning summary content.
- content:
+ annotations:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
- description: Reasoning text content.
- status:
- type: string
+ $ref: '#/components/schemas/OpenAI.TextAnnotation'
+ OpenAI.MessageContentType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: |-
- A description of the chain of thought used by a reasoning model while generating
- a response. Be sure to include these items in your `input` to the Responses API
- for subsequent turns of a conversation if you are manually
- [managing context](/docs/guides/conversation-state).
- title: Reasoning
- OpenAI.ItemFieldToolSearchCall:
+ - input_text
+ - output_text
+ - text
+ - summary_text
+ - reasoning_text
+ - refusal
+ - input_image
+ - computer_screenshot
+ - input_file
+ OpenAI.MessageObject:
type: object
required:
- - type
- id
- - call_id
- - execution
- - arguments
+ - object
+ - created_at
+ - thread_id
- status
+ - incomplete_details
+ - completed_at
+ - incomplete_at
+ - role
+ - content
+ - assistant_id
+ - run_id
+ - attachments
+ - metadata
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - tool_search_call
- description: The type of the item. Always `tool_search_call`.
+ - thread.message
+ description: The object type, which is always `thread.message`.
x-stainless-const: true
- default: tool_search_call
- id:
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the message was created.
+ thread_id:
type: string
- description: The unique ID of the tool search call item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- arguments:
- description: Arguments used for the tool search call.
+ description: The [thread](/docs/api-reference/threads) ID that this message belongs to.
status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: The status of the tool search call item that was recorded.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- OpenAI.ItemFieldToolSearchOutput:
- type: object
- required:
- - type
- - id
- - call_id
- - execution
- - tools
- - status
- properties:
- type:
type: string
enum:
- - tool_search_output
- description: The type of the item. Always `tool_search_output`.
- x-stainless-const: true
- default: tool_search_output
- id:
- type: string
- description: The unique ID of the tool search output item.
- call_id:
+ - in_progress
+ - incomplete
+ - completed
+ description: The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.
+ incomplete_details:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectIncompleteDetails'
+ - type: 'null'
+ completed_at:
anyOf:
- type: string
+ format: date-time
- type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by tool search.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: The status of the tool search output item that was recorded.
- created_by:
+ type: integer
+ format: unixTimestamp
+ incomplete_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ role:
type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- OpenAI.ItemFieldType:
- anyOf:
- - type: string
- - type: string
enum:
- - message
- - function_call
- - tool_search_call
- - tool_search_output
- - additional_tools
- - function_call_output
- - file_search_call
- - web_search_call
- - image_generation_call
- - computer_call
- - computer_call_output
- - reasoning
- - compaction
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - mcp_call
- - custom_tool_call
- - custom_tool_call_output
- OpenAI.ItemFieldWebSearchToolCall:
+ - user
+ - assistant
+ description: The entity that produced the message. One of `user` or `assistant`.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: The content of the message in array of text and/or images.
+ assistant_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ run_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ attachments:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MessageObjectAttachments'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: Represents a message within a [thread](/docs/api-reference/threads).
+ title: The message object
+ x-oaiMeta:
+ name: The message object
+ beta: true
+ example: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1698983503,
+ "thread_id": "thread_abc123",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "Hi! How can I help you today?",
+ "annotations": []
+ }
+ }
+ ],
+ "assistant_id": "asst_abc123",
+ "run_id": "run_abc123",
+ "attachments": [],
+ "metadata": {}
+ }
+ OpenAI.MessageObjectAttachments:
+ type: object
+ properties:
+ file_id:
+ type: string
+ tools:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantToolsCode'
+ - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly'
+ OpenAI.MessageObjectContent:
type: object
required:
- - id
- type
- - status
- - action
properties:
- id:
- type: string
- description: The unique ID of the web search tool call.
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.MessageObjectContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ image_url: '#/components/schemas/OpenAI.MessageContentImageUrlObject'
+ text: '#/components/schemas/OpenAI.MessageContentTextObject'
+ refusal: '#/components/schemas/OpenAI.MessageContentRefusalObject'
+ image_file: '#/components/schemas/OpenAI.MessageContentImageFileObject'
+ OpenAI.MessageObjectContentType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
- x-stainless-const: true
- status:
+ - image_file
+ - image_url
+ - text
+ - refusal
+ OpenAI.MessageObjectIncompleteDetails:
+ type: object
+ required:
+ - reason
+ properties:
+ reason:
type: string
enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
- description: |-
- 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_in_page).
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
+ - content_filter
+ - max_tokens
+ - run_cancelled
+ - run_expired
+ - run_failed
+ OpenAI.MessagePhase:
+ type: string
+ enum:
+ - commentary
+ - final_answer
description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.ItemFileSearchToolCall:
+ Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
+ For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
+ phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
+ OpenAI.MessageRequestContentTextObject:
type: object
required:
- - id
- type
- - status
- - queries
+ - text
properties:
- id:
- type: string
- description: The unique ID of the file search tool call.
type:
type: string
enum:
- - file_search_call
- description: The type of the file search tool call. Always `file_search_call`.
+ - text
+ description: Always `text`.
x-stainless-const: true
- status:
+ text:
type: string
- enum:
- - in_progress
- - searching
- - completed
- - incomplete
- - failed
- description: |-
- The status of the file search tool call. One of `in_progress`,
- `searching`, `incomplete` or `failed`,
- queries:
- type: array
- items:
- type: string
- description: The queries used to search for files.
- results:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ description: Text content to be sent to the model
+ description: The text content that is part of a message.
+ title: Text
+ OpenAI.MessageRole:
+ type: string
+ enum:
+ - unknown
+ - user
+ - assistant
+ - system
+ - critic
+ - discriminator
+ - developer
+ - tool
+ OpenAI.MessageStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.Metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
description: |-
- The results of a file search tool call. See the
- [file search guide](/docs/guides/tools-file-search) for more information.
- title: File search tool call
- OpenAI.ItemFunctionCallOutputItemParam:
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ OpenAI.Model:
type: object
required:
- - call_id
- - type
- - output
+ - id
+ - created
+ - object
+ - owned_by
properties:
id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the function tool call generated by the model.
- type:
+ description: The model identifier, which can be referenced in the API endpoints.
+ created:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) when the model was created.
+ object:
type: string
enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
+ - model
+ description: The object type, which is always "model".
x-stainless-const: true
- default: function_call_output
+ owned_by:
+ type: string
+ description: The organization that owns the model.
+ description: Describes an OpenAI model offering that can be used with the API.
+ title: Model
+ x-oaiMeta:
+ name: The model object
+ example: |
+ {
+ "id": "VAR_chat_model_id",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "openai"
+ }
+ OpenAI.Moderation:
+ type: object
+ required:
+ - input
+ - output
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.ModerationEntry'
+ description: Moderation for the response input.
output:
- oneOf:
- - type: string
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.InputTextContentParam'
- - $ref: '#/components/schemas/OpenAI.InputImageContentParamAutoParam'
- - $ref: '#/components/schemas/OpenAI.InputFileContentParam'
- description: Text, image, or file output of the function tool call.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.ItemFunctionShellCallItemParam:
+ $ref: '#/components/schemas/OpenAI.ModerationEntry'
+ description: Moderation for the response output.
+ description: Moderation results or errors for the response input and output.
+ title: Moderation
+ OpenAI.ModerationCategoryInputType:
+ type: string
+ enum:
+ - text
+ - image
+ description: The applied input type(s) for the category.
+ OpenAI.ModerationEntry:
type: object
required:
- - call_id
- type
- - action
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the shell tool call generated by the model.
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.ModerationEntryType'
+ discriminator:
+ propertyName: type
+ mapping:
+ error: '#/components/schemas/OpenAI.ModerationErrorBody'
+ moderation_result: '#/components/schemas/OpenAI.ModerationResultBody'
+ description: Moderation results or an error for a response moderation check.
+ OpenAI.ModerationEntryType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - shell_call
- description: The type of the item. Always `shell_call`.
- x-stainless-const: true
- default: shell_call
- action:
- $ref: '#/components/schemas/OpenAI.FunctionShellActionParam'
- description: The shell commands and limits that describe how to run the tool call.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- - type: 'null'
- environment:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A tool representing a request to execute one or more shell commands.
- title: Shell tool call
- OpenAI.ItemFunctionShellCallOutputItemParam:
+ - moderation_result
+ - error
+ OpenAI.ModerationErrorBody:
type: object
required:
- - call_id
- type
- - output
+ - code
+ - message
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the shell tool call generated by the model.
type:
type: string
enum:
- - shell_call_output
- description: The type of the item. Always `shell_call_output`.
+ - error
+ description: The object type, which was always `error` for moderation failures.
x-stainless-const: true
- default: shell_call_output
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContentParam'
- description: Captured chunks of stdout and stderr output, along with their associated outcomes.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- - type: 'null'
- max_output_length:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
+ code:
+ type: string
+ description: The error code.
+ message:
+ type: string
+ description: The error message.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The streamed output items emitted by a shell tool call.
- title: Shell tool call output
- OpenAI.ItemFunctionToolCall:
+ - $ref: '#/components/schemas/OpenAI.ModerationEntry'
+ description: An error produced while attempting moderation for the response input or output.
+ title: Moderation error
+ OpenAI.ModerationImageURLInput:
type: object
required:
- - id
- type
- - call_id
- - name
- - arguments
+ - image_url
properties:
- id:
- type: string
- description: The unique ID of the function tool call.
- readOnly: true
type:
type: string
enum:
- - function_call
- description: The type of the function tool call. Always `function_call`.
+ - image_url
+ description: Always `image_url`.
x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- namespace:
- type: string
- description: The namespace of the function to run.
- name:
- type: string
- description: The name of the function to run.
- arguments:
+ image_url:
+ $ref: '#/components/schemas/OpenAI.ModerationImageURLInputImageUrl'
+ description: Contains either an image URL or a data URL for a base64 encoded image.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CreateModerationRequestInput'
+ description: An object describing an image to classify.
+ OpenAI.ModerationImageURLInputImageUrl:
+ type: object
+ required:
+ - url
+ properties:
+ url:
type: string
- description: A JSON string of the arguments to pass to the function.
- status:
+ format: uri
+ OpenAI.ModerationInputType:
+ type: string
+ enum:
+ - text
+ - image
+ OpenAI.ModerationParam:
+ type: object
+ required:
+ - model
+ properties:
+ model:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: |-
- A tool call to run a function. See the
- [function calling guide](/docs/guides/function-calling) for more information.
- title: Function tool call
- OpenAI.ItemImageGenToolCall:
+ description: The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.
+ description: Configuration for running moderation on the input and output of this response.
+ OpenAI.ModerationResultBody:
type: object
required:
- type
- - id
- - status
- - result
+ - model
+ - flagged
+ - categories
+ - category_scores
+ - category_applied_input_types
properties:
type:
type: string
enum:
- - image_generation_call
- description: The type of the image generation call. Always `image_generation_call`.
+ - moderation_result
+ description: The object type, which was always `moderation_result` for successful moderation results.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the image generation call.
- status:
+ model:
type: string
- enum:
- - in_progress
- - completed
- - generating
- - failed
- description: The status of the image generation call.
- result:
- anyOf:
- - type: string
- - type: 'null'
+ description: The moderation model that produced this result.
+ flagged:
+ type: boolean
+ description: A boolean indicating whether the content was flagged by any category.
+ categories:
+ type: object
+ unevaluatedProperties:
+ type: boolean
+ description: A dictionary of moderation categories to booleans, True if the input is flagged under this category.
+ x-oaiTypeLabel: map
+ category_scores:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: A dictionary of moderation categories to scores.
+ x-oaiTypeLabel: map
+ category_applied_input_types:
+ type: object
+ unevaluatedProperties:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationInputType'
+ description: Which modalities of input are reflected by the score for each category.
+ x-oaiTypeLabel: map
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: An image generation request made by the model.
- title: Image generation call
- OpenAI.ItemInputMessage:
+ - $ref: '#/components/schemas/OpenAI.ModerationEntry'
+ description: A moderation result produced for the response input or output.
+ title: Moderation result
+ OpenAI.ModerationTextInput:
type: object
required:
- type
- - role
- - content
- - id
+ - text
properties:
type:
type: string
enum:
- - message
- description: The type of the message input. Always set to `message`.
+ - text
+ description: Always `text`.
x-stainless-const: true
- default: message
- role:
- type: string
- enum:
- - user
- - system
- - developer
- description: The role of the message input. One of `user`, `system`, or `developer`.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- content:
- $ref: '#/components/schemas/OpenAI.InputMessageContentList'
- id:
+ text:
type: string
- description: The unique ID of the message input.
- readOnly: true
+ description: A string of text to classify.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: |-
- 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.
- title: Input message
- OpenAI.ItemLocalShellToolCall:
+ - $ref: '#/components/schemas/OpenAI.CreateModerationRequestInput'
+ description: An object describing text to classify.
+ OpenAI.ModifyAssistantRequest:
+ type: object
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.AssistantSupportedModels'
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ maxItems: 128
+ description: 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`.
+ default: []
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ModifyAssistantRequestToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ response_format:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ - type: 'null'
+ OpenAI.ModifyAssistantRequestToolResources:
+ type: object
+ properties:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.ModifyAssistantRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.ModifyAssistantRequestToolResourcesFileSearch'
+ OpenAI.ModifyAssistantRequestToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 20
+ OpenAI.ModifyAssistantRequestToolResourcesFileSearch:
+ type: object
+ properties:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ OpenAI.ModifyMessageRequest:
+ type: object
+ properties:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.ModifyRunRequest:
+ type: object
+ properties:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.ModifyThreadRequest:
+ type: object
+ properties:
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.ModifyThreadRequestToolResources:
type: object
- required:
- - type
- - id
- - call_id
- - action
- - status
properties:
- type:
- type: string
- enum:
- - local_shell_call
- description: The type of the local shell call. Always `local_shell_call`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell call.
- call_id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: The status of the local shell call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A tool call to run a command on the local shell.
- title: Local shell call
- OpenAI.ItemLocalShellToolCallOutput:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesFileSearch'
+ OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 20
+ OpenAI.ModifyThreadRequestToolResourcesFileSearch:
+ type: object
+ properties:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ OpenAI.MoveParam:
type: object
required:
- type
- - id
- - output
+ - x
+ - 'y'
properties:
type:
type: string
enum:
- - local_shell_call_output
- description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ - move
+ description: Specifies the event type. For a move action, this property is always set to `move`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- output:
- type: string
- description: A JSON string of the output of the local shell tool call.
- status:
+ x:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The x-coordinate to move to.
+ 'y':
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The y-coordinate to move to.
+ keys:
anyOf:
- - type: string
- enum:
- - in_progress
- - completed
- - incomplete
+ - type: array
+ items:
+ type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The output of a local shell tool call.
- title: Local shell call output
- OpenAI.ItemMcpApprovalRequest:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A mouse move action.
+ title: Move
+ OpenAI.NamespaceToolParam:
type: object
required:
- type
- - id
- - server_label
- name
- - arguments
+ - description
+ - tools
properties:
type:
type: string
enum:
- - mcp_approval_request
- description: The type of the item. Always `mcp_approval_request`.
+ - namespace
+ description: The type of the tool. Always `namespace`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval request.
- server_label:
- type: string
- description: The label of the MCP server making the request.
name:
type: string
- description: The name of the tool to run.
- arguments:
+ minLength: 1
+ description: The namespace name used in tool calls (for example, `crm`).
+ description:
type: string
- description: A JSON string of arguments for the tool.
+ minLength: 1
+ description: A description of the namespace shown to the model.
+ tools:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionToolParam'
+ - $ref: '#/components/schemas/OpenAI.CustomToolParam'
+ minItems: 1
+ description: The function/custom tools available inside this namespace.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A request for human approval of a tool invocation.
- title: MCP approval request
- OpenAI.ItemMcpApprovalResponse:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: Groups function/custom tools under a shared namespace.
+ title: Namespace
+ OpenAI.NoiseReductionType:
+ type: string
+ enum:
+ - near_field
+ - far_field
+ description: 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.
+ OpenAI.OpenAIFile:
type: object
required:
- - type
- - approval_request_id
- - approve
+ - id
+ - bytes
+ - created_at
+ - filename
+ - object
+ - purpose
+ - status
properties:
- type:
+ id:
+ type: string
+ description: The file identifier, which can be referenced in the API endpoints.
+ bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The size of the file, in bytes.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the file was created.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the file will expire.
+ filename:
+ type: string
+ description: The name of the file.
+ object:
type: string
enum:
- - mcp_approval_response
- description: The type of the item. Always `mcp_approval_response`.
+ - file
+ description: The object type, which is always `file`.
x-stainless-const: true
- id:
- anyOf:
- - type: string
- - type: 'null'
- approval_request_id:
+ purpose:
+ type: string
+ enum:
+ - assistants
+ - assistants_output
+ - batch
+ - batch_output
+ - fine-tune
+ - fine-tune-results
+ - vision
+ - user_data
+ description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
+ status:
type: string
- description: The ID of the approval request being answered.
- approve:
- type: boolean
- description: Whether the request was approved.
- reason:
- anyOf:
- - type: string
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A response to an MCP approval request.
- title: MCP approval response
- OpenAI.ItemMcpListTools:
+ enum:
+ - uploaded
+ - processed
+ - error
+ description: Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
+ deprecated: true
+ status_details:
+ type: string
+ description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.
+ deprecated: true
+ description: The `File` object represents a document that has been uploaded to OpenAI.
+ title: OpenAIFile
+ x-oaiMeta:
+ name: The file object
+ example: |
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 120000,
+ "created_at": 1677610602,
+ "expires_at": 1680202602,
+ "filename": "salesOverview.pdf",
+ "purpose": "assistants",
+ }
+ OpenAI.OrderEnum:
+ type: string
+ enum:
+ - asc
+ - desc
+ OpenAI.OtherChunkingStrategyResponseParam:
type: object
required:
- type
- - id
- - server_label
- - tools
properties:
type:
type: string
enum:
- - mcp_list_tools
- description: The type of the item. Always `mcp_list_tools`.
+ - other
+ description: Always `other`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the list.
- server_label:
- type: string
- description: The label of the MCP server.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
- description: The tools available on the server.
- error:
- $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A list of tools available on an MCP server.
- title: MCP list tools
- OpenAI.ItemMcpToolCall:
+ - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse'
+ description: 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.
+ title: Other Chunking Strategy
+ OpenAI.OutputContent:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
properties:
type:
- type: string
- enum:
- - mcp_call
- description: The type of the item. Always `mcp_call`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the tool call.
- server_label:
- type: string
- description: The label of the MCP server running the tool.
- name:
- type: string
- description: The name of the tool that was run.
- arguments:
- type: string
- description: A JSON string of the arguments passed to the tool.
- output:
- anyOf:
- - type: string
- - type: 'null'
- error:
- type: object
- unevaluatedProperties: {}
- status:
- $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
- description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
- approval_request_id:
- anyOf:
- - type: string
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: An invocation of a tool on an MCP server.
- title: MCP tool call
- OpenAI.ItemOutputMessage:
+ $ref: '#/components/schemas/OpenAI.OutputContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ output_text: '#/components/schemas/OpenAI.OutputContentOutputTextContent'
+ refusal: '#/components/schemas/OpenAI.OutputContentRefusalContent'
+ reasoning_text: '#/components/schemas/OpenAI.OutputContentReasoningTextContent'
+ OpenAI.OutputContentOutputTextContent:
type: object
required:
- - id
- type
- - role
- - content
- - status
+ - text
+ - annotations
+ - logprobs
properties:
- id:
- type: string
- description: The unique ID of the output message.
type:
type: string
enum:
- - output_message
- description: The type of the output message. Always `message`.
+ - output_text
+ description: The type of the output text. Always `output_text`.
x-stainless-const: true
- role:
+ default: output_text
+ text:
type: string
- enum:
- - assistant
- description: The role of the output message. Always `assistant`.
- x-stainless-const: true
- content:
+ description: The text output from the model.
+ annotations:
type: array
items:
- $ref: '#/components/schemas/OpenAI.OutputMessageContent'
- description: The content of the output message.
- phase:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
- - type: 'null'
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
+ $ref: '#/components/schemas/OpenAI.Annotation'
+ description: The annotations of the text output.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.LogProb'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: An output message from the model.
- title: Output message
- OpenAI.ItemReasoningItem:
+ - $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: A text output from the model.
+ title: Output text
+ OpenAI.OutputContentReasoningTextContent:
type: object
required:
- type
- - id
- - summary
+ - text
properties:
type:
type: string
enum:
- - reasoning
- description: The type of the object. Always `reasoning`.
+ - reasoning_text
+ description: The type of the reasoning text. Always `reasoning_text`.
x-stainless-const: true
- id:
- type: string
- description: The unique identifier of the reasoning content.
- encrypted_content:
- anyOf:
- - type: string
- - type: 'null'
- summary:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.SummaryTextContent'
- description: Reasoning summary content.
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
- description: Reasoning text content.
- status:
+ default: reasoning_text
+ text:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ description: The reasoning text from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: |-
- A description of the chain of thought used by a reasoning model while generating
- a response. Be sure to include these items in your `input` to the Responses API
- for subsequent turns of a conversation if you are manually
- [managing context](/docs/guides/conversation-state).
- title: Reasoning
- OpenAI.ItemReferenceParam:
+ - $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: Reasoning text from the model.
+ title: Reasoning text
+ OpenAI.OutputContentRefusalContent:
type: object
required:
- type
- - id
+ - refusal
properties:
type:
type: string
enum:
- - item_reference
- description: The type of item to reference. Always `item_reference`.
+ - refusal
+ description: The type of the refusal. Always `refusal`.
x-stainless-const: true
- id:
+ default: refusal
+ refusal:
type: string
- description: The ID of the item to reference.
+ description: The refusal explanation from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: An internal identifier for an item to reference.
- title: Item reference
- OpenAI.ItemResource:
+ - $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: A refusal from the model.
+ title: Refusal
+ OpenAI.OutputContentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - output_text
+ - refusal
+ - reasoning_text
+ OpenAI.OutputItem:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.ItemResourceType'
+ $ref: '#/components/schemas/OpenAI.OutputItemType'
+ agent_reference:
+ $ref: '#/components/schemas/AgentReference'
+ description: The agent that created the item.
+ response_id:
+ type: string
+ description: The response on which the item is created.
discriminator:
propertyName: type
mapping:
- message: '#/components/schemas/OpenAI.ItemResourceInputMessage'
- output_message: '#/components/schemas/OpenAI.ItemResourceOutputMessage'
- file_search_call: '#/components/schemas/OpenAI.ItemResourceFileSearchToolCall'
- computer_call: '#/components/schemas/OpenAI.ItemResourceComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.ItemResourceComputerToolCallOutput'
- web_search_call: '#/components/schemas/OpenAI.ItemResourceWebSearchToolCall'
- function_call: '#/components/schemas/OpenAI.ItemResourceFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutput'
- tool_search_call: '#/components/schemas/OpenAI.ItemResourceToolSearchCall'
- tool_search_output: '#/components/schemas/OpenAI.ItemResourceToolSearchOutput'
- additional_tools: '#/components/schemas/OpenAI.ItemResourceAdditionalTools'
- reasoning: '#/components/schemas/OpenAI.ItemResourceReasoningItem'
- compaction: '#/components/schemas/OpenAI.ItemResourceCompactionBody'
- image_generation_call: '#/components/schemas/OpenAI.ItemResourceImageGenToolCall'
- code_interpreter_call: '#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.ItemResourceFunctionShellCall'
- shell_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput'
- apply_patch_call: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall'
- apply_patch_call_output: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput'
- mcp_list_tools: '#/components/schemas/OpenAI.ItemResourceMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource'
- mcp_call: '#/components/schemas/OpenAI.ItemResourceMcpToolCall'
- custom_tool_call: '#/components/schemas/OpenAI.ItemResourceCustomToolCallResource'
- custom_tool_call_output: '#/components/schemas/OpenAI.ItemResourceCustomToolCallOutputResource'
- description: Content item used to generate a response.
- OpenAI.ItemResourceAdditionalTools:
+ structured_outputs: '#/components/schemas/StructuredOutputsOutputItem'
+ workflow_action: '#/components/schemas/WorkflowActionOutputItem'
+ oauth_consent_request: '#/components/schemas/OAuthConsentRequestOutputItem'
+ bing_grounding_call: '#/components/schemas/BingGroundingToolCall'
+ bing_grounding_call_output: '#/components/schemas/BingGroundingToolCallOutput'
+ sharepoint_grounding_preview_call: '#/components/schemas/SharepointGroundingToolCall'
+ sharepoint_grounding_preview_call_output: '#/components/schemas/SharepointGroundingToolCallOutput'
+ azure_ai_search_call: '#/components/schemas/AzureAISearchToolCall'
+ azure_ai_search_call_output: '#/components/schemas/AzureAISearchToolCallOutput'
+ bing_custom_search_preview_call: '#/components/schemas/BingCustomSearchToolCall'
+ bing_custom_search_preview_call_output: '#/components/schemas/BingCustomSearchToolCallOutput'
+ openapi_call: '#/components/schemas/OpenApiToolCall'
+ openapi_call_output: '#/components/schemas/OpenApiToolCallOutput'
+ browser_automation_preview_call: '#/components/schemas/BrowserAutomationToolCall'
+ browser_automation_preview_call_output: '#/components/schemas/BrowserAutomationToolCallOutput'
+ fabric_dataagent_preview_call: '#/components/schemas/FabricDataAgentToolCall'
+ fabric_dataagent_preview_call_output: '#/components/schemas/FabricDataAgentToolCallOutput'
+ azure_function_call: '#/components/schemas/AzureFunctionToolCall'
+ azure_function_call_output: '#/components/schemas/AzureFunctionToolCallOutput'
+ a2a_preview_call: '#/components/schemas/A2AToolCall'
+ a2a_preview_call_output: '#/components/schemas/A2AToolCallOutput'
+ memory_search_call: '#/components/schemas/MemorySearchToolCall'
+ memory_command_preview_call: '#/components/schemas/MemoryCommandToolCall'
+ memory_command_preview_call_output: '#/components/schemas/MemoryCommandToolCallOutput'
+ output_message: '#/components/schemas/OpenAI.OutputItemOutputMessage'
+ file_search_call: '#/components/schemas/OpenAI.OutputItemFileSearchToolCall'
+ function_call: '#/components/schemas/OpenAI.OutputItemFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.OutputItemFunctionToolCallOutput'
+ web_search_call: '#/components/schemas/OpenAI.OutputItemWebSearchToolCall'
+ computer_call: '#/components/schemas/OpenAI.OutputItemComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.OutputItemComputerToolCallOutput'
+ reasoning: '#/components/schemas/OpenAI.OutputItemReasoningItem'
+ tool_search_call: '#/components/schemas/OpenAI.OutputItemToolSearchCall'
+ tool_search_output: '#/components/schemas/OpenAI.OutputItemToolSearchOutput'
+ additional_tools: '#/components/schemas/OpenAI.OutputItemAdditionalTools'
+ compaction: '#/components/schemas/OpenAI.OutputItemCompactionBody'
+ image_generation_call: '#/components/schemas/OpenAI.OutputItemImageGenToolCall'
+ code_interpreter_call: '#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.OutputItemLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.OutputItemLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.OutputItemFunctionShellCall'
+ shell_call_output: '#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput'
+ apply_patch_call: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCall'
+ apply_patch_call_output: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput'
+ mcp_call: '#/components/schemas/OpenAI.OutputItemMcpToolCall'
+ mcp_list_tools: '#/components/schemas/OpenAI.OutputItemMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.OutputItemMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.OutputItemMcpApprovalResponseResource'
+ custom_tool_call: '#/components/schemas/OpenAI.OutputItemCustomToolCallResource'
+ custom_tool_call_output: '#/components/schemas/OpenAI.OutputItemCustomToolCallOutputResource'
+ OpenAI.OutputItemAdditionalTools:
type: object
required:
- type
@@ -27177,8 +62432,8 @@ components:
$ref: '#/components/schemas/OpenAI.Tool'
description: The additional tool definitions made available at this item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- OpenAI.ItemResourceApplyPatchToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ OpenAI.OutputItemApplyPatchToolCall:
type: object
required:
- type
@@ -27211,10 +62466,10 @@ components:
type: string
description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A tool call that applies file diffs by creating, deleting, or updating files.
title: Apply patch tool call
- OpenAI.ItemResourceApplyPatchToolCallOutput:
+ OpenAI.OutputItemApplyPatchToolCallOutput:
type: object
required:
- type
@@ -27246,10 +62501,10 @@ components:
type: string
description: The ID of the entity that created this tool call output.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: The output emitted by an apply patch tool call.
title: Apply patch tool call output
- OpenAI.ItemResourceCodeInterpreterToolCall:
+ OpenAI.OutputItemCodeInterpreterToolCall:
type: object
required:
- type
@@ -27294,10 +62549,10 @@ components:
- $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A tool call to run code.
title: Code interpreter tool call
- OpenAI.ItemResourceCompactionBody:
+ OpenAI.OutputItemCompactionBody:
type: object
required:
- type
@@ -27321,10 +62576,10 @@ components:
type: string
description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
title: Compaction item
- OpenAI.ItemResourceComputerToolCall:
+ OpenAI.OutputItemComputerToolCall:
type: object
required:
- type
@@ -27364,12 +62619,12 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: |-
A tool call to a computer use tool. See the
[computer use guide](/docs/guides/tools-computer-use) for more information.
title: Computer tool call
- OpenAI.ItemResourceComputerToolCallOutput:
+ OpenAI.OutputItemComputerToolCallOutput:
type: object
required:
- type
@@ -27410,10 +62665,10 @@ components:
The status of the message input. One of `in_progress`, `completed`, or
`incomplete`. Populated when input items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: The output of a computer tool call.
title: Computer tool call output
- OpenAI.ItemResourceCustomToolCallOutputResource:
+ OpenAI.OutputItemCustomToolCallOutputResource:
type: object
required:
- type
@@ -27451,9 +62706,9 @@ components:
type: string
description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
title: ResponseCustomToolCallOutputItem
- OpenAI.ItemResourceCustomToolCallResource:
+ OpenAI.OutputItemCustomToolCallResource:
type: object
required:
- type
@@ -27492,9 +62747,9 @@ components:
type: string
description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
title: ResponseCustomToolCallItem
- OpenAI.ItemResourceFileSearchToolCall:
+ OpenAI.OutputItemFileSearchToolCall:
type: object
required:
- id
@@ -27534,12 +62789,12 @@ components:
$ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: |-
The results of a file search tool call. See the
[file search guide](/docs/guides/tools-file-search) for more information.
title: File search tool call
- OpenAI.ItemResourceFunctionShellCall:
+ OpenAI.OutputItemFunctionShellCall:
type: object
required:
- type
@@ -27576,10 +62831,10 @@ components:
type: string
description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A tool call that executes one or more shell commands in a managed environment.
title: Shell tool call
- OpenAI.ItemResourceFunctionShellCallOutput:
+ OpenAI.OutputItemFunctionShellCallOutput:
type: object
required:
- type
@@ -27618,10 +62873,10 @@ components:
type: string
description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: The output of a shell tool call that was emitted.
title: Shell call output
- OpenAI.ItemResourceFunctionToolCall:
+ OpenAI.OutputItemFunctionToolCall:
type: object
required:
- id
@@ -27662,12 +62917,12 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: |-
A tool call to run a function. See the
[function calling guide](/docs/guides/function-calling) for more information.
title: Function tool call
- OpenAI.ItemResourceFunctionToolCallOutput:
+ OpenAI.OutputItemFunctionToolCallOutput:
type: object
required:
- id
@@ -27709,10 +62964,10 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: The output of a function tool call.
title: Function tool call output
- OpenAI.ItemResourceImageGenToolCall:
+ OpenAI.OutputItemImageGenToolCall:
type: object
required:
- type
@@ -27742,54 +62997,10 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: An image generation request made by the model.
title: Image generation call
- OpenAI.ItemResourceInputMessage:
- type: object
- required:
- - type
- - role
- - content
- - id
- properties:
- type:
- type: string
- enum:
- - message
- description: The type of the message input. Always set to `message`.
- x-stainless-const: true
- default: message
- role:
- type: string
- enum:
- - user
- - system
- - developer
- description: The role of the message input. One of `user`, `system`, or `developer`.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- content:
- $ref: '#/components/schemas/OpenAI.InputMessageContentList'
- id:
- type: string
- description: The unique ID of the message input.
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: |-
- 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.
- title: Input message
- OpenAI.ItemResourceLocalShellToolCall:
+ OpenAI.OutputItemLocalShellToolCall:
type: object
required:
- type
@@ -27820,10 +63031,10 @@ components:
- incomplete
description: The status of the local shell call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A tool call to run a command on the local shell.
title: Local shell call
- OpenAI.ItemResourceLocalShellToolCallOutput:
+ OpenAI.OutputItemLocalShellToolCallOutput:
type: object
required:
- type
@@ -27851,10 +63062,10 @@ components:
- incomplete
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: The output of a local shell tool call.
title: Local shell call output
- OpenAI.ItemResourceMcpApprovalRequest:
+ OpenAI.OutputItemMcpApprovalRequest:
type: object
required:
- type
@@ -27882,10 +63093,10 @@ components:
type: string
description: A JSON string of arguments for the tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A request for human approval of a tool invocation.
title: MCP approval request
- OpenAI.ItemResourceMcpApprovalResponseResource:
+ OpenAI.OutputItemMcpApprovalResponseResource:
type: object
required:
- type
@@ -27913,10 +63124,10 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A response to an MCP approval request.
title: MCP approval response
- OpenAI.ItemResourceMcpListTools:
+ OpenAI.OutputItemMcpListTools:
type: object
required:
- type
@@ -27944,10 +63155,10 @@ components:
error:
$ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A list of tools available on an MCP server.
title: MCP list tools
- OpenAI.ItemResourceMcpToolCall:
+ OpenAI.OutputItemMcpToolCall:
type: object
required:
- type
@@ -27989,10 +63200,10 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: An invocation of a tool on an MCP server.
title: MCP tool call
- OpenAI.ItemResourceOutputMessage:
+ OpenAI.OutputItemOutputMessage:
type: object
required:
- id
@@ -28035,10 +63246,10 @@ components:
The status of the message input. One of `in_progress`, `completed`, or
`incomplete`. Populated when input items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: An output message from the model.
title: Output message
- OpenAI.ItemResourceReasoningItem:
+ OpenAI.OutputItemReasoningItem:
type: object
required:
- type
@@ -28078,14 +63289,14 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: |-
A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your `input` to the Responses API
for subsequent turns of a conversation if you are manually
[managing context](/docs/guides/conversation-state).
title: Reasoning
- OpenAI.ItemResourceToolSearchCall:
+ OpenAI.OutputItemToolSearchCall:
type: object
required:
- type
@@ -28121,197 +63332,31 @@ components:
type: string
description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- OpenAI.ItemResourceToolSearchOutput:
- type: object
- required:
- - type
- - id
- - call_id
- - execution
- - tools
- - status
- properties:
- type:
- type: string
- enum:
- - tool_search_output
- description: The type of the item. Always `tool_search_output`.
- x-stainless-const: true
- default: tool_search_output
- id:
- type: string
- description: The unique ID of the tool search output item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by tool search.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: The status of the tool search output item that was recorded.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- OpenAI.ItemResourceType:
- anyOf:
- - type: string
- - type: string
- enum:
- - message
- - output_message
- - file_search_call
- - computer_call
- - computer_call_output
- - web_search_call
- - function_call
- - function_call_output
- - tool_search_call
- - tool_search_output
- - additional_tools
- - reasoning
- - compaction
- - image_generation_call
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - mcp_call
- - custom_tool_call
- - custom_tool_call_output
- - structured_outputs
- - oauth_consent_request
- - memory_search_call
- - memory_command_preview_call
- - memory_command_preview_call_output
- - workflow_action
- - a2a_preview_call
- - a2a_preview_call_output
- - bing_grounding_call
- - bing_grounding_call_output
- - sharepoint_grounding_preview_call
- - sharepoint_grounding_preview_call_output
- - azure_ai_search_call
- - azure_ai_search_call_output
- - bing_custom_search_preview_call
- - bing_custom_search_preview_call_output
- - openapi_call
- - openapi_call_output
- - browser_automation_preview_call
- - browser_automation_preview_call_output
- - fabric_dataagent_preview_call
- - fabric_dataagent_preview_call_output
- - azure_function_call
- - azure_function_call_output
- OpenAI.ItemResourceWebSearchToolCall:
- type: object
- required:
- - id
- - type
- - status
- - action
- properties:
- id:
- type: string
- description: The unique ID of the web search tool call.
- type:
- type: string
- enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
- x-stainless-const: true
- status:
- type: string
- enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
- description: |-
- 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_in_page).
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.ItemToolSearchCallItemParam:
- type: object
- required:
- - type
- - arguments
- properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- type:
- type: string
- enum:
- - tool_search_call
- description: The item type. Always `tool_search_call`.
- x-stainless-const: true
- default: tool_search_call
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- arguments:
- $ref: '#/components/schemas/OpenAI.EmptyModelParam'
- description: The arguments supplied to the tool search call.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- OpenAI.ItemToolSearchOutputItemParam:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ OpenAI.OutputItemToolSearchOutput:
type: object
required:
- type
+ - id
+ - call_id
+ - execution
- tools
+ - status
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
enum:
- tool_search_output
- description: The item type. Always `tool_search_output`.
+ description: The type of the item. Always `tool_search_output`.
x-stainless-const: true
default: tool_search_output
+ id:
+ type: string
+ description: The unique ID of the tool search output item.
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
execution:
$ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
description: Whether tool search was executed by the server or by the client.
@@ -28319,30 +63364,31 @@ components:
type: array
items:
$ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by the tool search output.
+ description: The loaded tool definitions returned by tool search.
status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: The status of the tool search output item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- OpenAI.ItemType:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ OpenAI.OutputItemType:
anyOf:
- type: string
- type: string
enum:
- - message
- output_message
- file_search_call
- - computer_call
- - computer_call_output
- - web_search_call
- function_call
- function_call_output
+ - web_search_call
+ - computer_call
+ - computer_call_output
+ - reasoning
- tool_search_call
- tool_search_output
- additional_tools
- - reasoning
- compaction
- image_generation_call
- code_interpreter_call
@@ -28352,12 +63398,12 @@ components:
- shell_call_output
- apply_patch_call
- apply_patch_call_output
+ - mcp_call
- mcp_list_tools
- mcp_approval_request
- mcp_approval_response
- - mcp_call
- - custom_tool_call_output
- custom_tool_call
+ - custom_tool_call_output
- structured_outputs
- oauth_consent_request
- memory_search_call
@@ -28382,7 +63428,7 @@ components:
- fabric_dataagent_preview_call_output
- azure_function_call
- azure_function_call_output
- OpenAI.ItemWebSearchToolCall:
+ OpenAI.OutputItemWebSearchToolCall:
type: object
required:
- id
@@ -28404,493 +63450,37 @@ components:
enum:
- in_progress
- searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
- description: |-
- 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_in_page).
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.KeyPressAction:
- type: object
- required:
- - type
- - keys
- properties:
- type:
- type: string
- enum:
- - keypress
- description: Specifies the event type. For a keypress action, this property is always set to `keypress`.
- x-stainless-const: true
- keys:
- type: array
- items:
- type: string
- description: The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A collection of keypresses the model would like to perform.
- title: KeyPress
- OpenAI.ListFineTuningJobCheckpointsResponse:
- type: object
- required:
- - data
- - object
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpoint'
- x-ms-list-page-items: true
- object:
- type: string
- enum:
- - list
- x-stainless-const: true
- first_id:
- anyOf:
- - type: string
- - type: 'null'
- last_id:
- anyOf:
- - type: string
- - type: 'null'
- x-ms-list-continuation-token: true
- has_more:
- type: boolean
- OpenAI.ListFineTuningJobEventsResponse:
- type: object
- required:
- - data
- - object
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FineTuningJobEvent'
- x-ms-list-page-items: true
- object:
- type: string
- enum:
- - list
- x-stainless-const: true
- has_more:
- type: boolean
- OpenAI.ListPaginatedFineTuningJobsResponse:
- type: object
- required:
- - data
- - has_more
- - object
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
- x-ms-list-page-items: true
- has_more:
- type: boolean
- object:
- type: string
- enum:
- - list
- x-stainless-const: true
- OpenAI.LocalEnvironmentResource:
- type: object
- required:
- - type
- properties:
- type:
- type: string
- enum:
- - local
- description: The environment type. Always `local`.
- x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
- description: Represents the use of a local environment to perform shell actions.
- title: Local Environment
- OpenAI.LocalShellExecAction:
- type: object
- required:
- - type
- - command
- - env
- properties:
- type:
- type: string
- enum:
- - exec
- description: The type of the local shell action. Always `exec`.
- x-stainless-const: true
- default: exec
- command:
- type: array
- items:
- type: string
- description: The command to run.
- timeout_ms:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- working_directory:
- anyOf:
- - type: string
- - type: 'null'
- env:
- type: object
- unevaluatedProperties:
- type: string
- description: Environment variables to set for the command.
- x-oaiTypeLabel: map
- user:
- anyOf:
- - type: string
- - type: 'null'
- description: Execute a shell command on the server.
- title: Local shell exec action
- OpenAI.LocalShellToolParam:
- type: object
- required:
- - type
- properties:
- type:
- type: string
- enum:
- - local_shell
- description: The type of the local shell tool. Always `local_shell`.
- x-stainless-const: true
- name:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that allows the model to execute shell commands in a local environment.
- title: Local shell tool
- OpenAI.LocalSkillParam:
- type: object
- required:
- - name
- - description
- - path
- properties:
- name:
- type: string
- description: The name of the skill.
- description:
- type: string
- description: The description of the skill.
- path:
- type: string
- description: The path to the directory containing the skill.
- OpenAI.LogProb:
- type: object
- required:
- - token
- - logprob
- - bytes
- - top_logprobs
- properties:
- token:
- type: string
- logprob:
- $ref: '#/components/schemas/OpenAI.numeric'
- bytes:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.integer'
- top_logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.TopLogProb'
- description: The log probability of a token.
- title: Log probability
- OpenAI.MCPListToolsTool:
- type: object
- required:
- - name
- - input_schema
- properties:
- name:
- type: string
- description: The name of the tool.
- description:
- anyOf:
- - type: string
- - type: 'null'
- input_schema:
- $ref: '#/components/schemas/OpenAI.MCPListToolsToolInputSchema'
- description: The JSON schema describing the tool's input.
- annotations:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPListToolsToolAnnotations'
- - type: 'null'
- description: A tool available on an MCP server.
- title: MCP list tools tool
- OpenAI.MCPListToolsToolAnnotations:
- type: object
- OpenAI.MCPListToolsToolInputSchema:
- type: object
- OpenAI.MCPTool:
- type: object
- required:
- - type
- - server_label
- properties:
- type:
- type: string
- enum:
- - mcp
- description: The type of the MCP tool. Always `mcp`.
- x-stainless-const: true
- server_label:
- type: string
- description: A label for this MCP server, used to identify it in tool calls.
- server_url:
- type: string
- format: uri
- description: |-
- The URL for the MCP server. One of `server_url`, `connector_id`, or
- `tunnel_id` must be provided.
- connector_id:
- type: string
- enum:
- - connector_dropbox
- - connector_gmail
- - connector_googlecalendar
- - connector_googledrive
- - connector_microsoftteams
- - connector_outlookcalendar
- - connector_outlookemail
- - connector_sharepoint
- description: |-
- Identifier for service connectors, like those available in ChatGPT. One of
- `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
- about service connectors [here](/docs/guides/tools-remote-mcp#connectors).
- Currently supported `connector_id` values are:
- - Dropbox: `connector_dropbox`
- - Gmail: `connector_gmail`
- - Google Calendar: `connector_googlecalendar`
- - Google Drive: `connector_googledrive`
- - Microsoft Teams: `connector_microsoftteams`
- - Outlook Calendar: `connector_outlookcalendar`
- - Outlook Email: `connector_outlookemail`
- - SharePoint: `connector_sharepoint`
- tunnel_id:
- type: string
- pattern: ^tunnel_[a-z0-9]{32}$
- description: |-
- The Secure MCP Tunnel ID to use instead of a direct server URL. One of
- `server_url`, `connector_id`, or `tunnel_id` must be provided.
- authorization:
- type: string
- description: |-
- An OAuth access token that can be used with a remote MCP server, either
- with a custom MCP server URL or a service connector. Your application
- must handle the OAuth authorization flow and provide the token here.
- server_description:
- type: string
- description: Optional description of the MCP server, used to provide more context.
- headers:
- anyOf:
- - type: object
- unevaluatedProperties:
- type: string
- - type: 'null'
- allowed_tools:
- anyOf:
- - type: array
- items:
- type: string
- - $ref: '#/components/schemas/OpenAI.MCPToolFilter'
- - type: 'null'
- require_approval:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
- - type: string
- enum:
- - always
- - never
- - type: 'null'
- default: always
- defer_loading:
- type: boolean
- description: Whether this MCP tool is deferred and discovered via tool search.
- project_connection_id:
- type: string
- description: The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server.
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: |-
- Give the model access to additional tools via remote Model Context Protocol
- (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).
- title: MCP tool
- OpenAI.MCPToolCallStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - calling
- - failed
- OpenAI.MCPToolFilter:
- type: object
- properties:
- tool_names:
- type: array
- items:
- type: string
- description: List of allowed tool names.
- title: MCP allowed tools
- read_only:
- type: boolean
- description: |-
- Indicates whether or not a tool modifies data or is read-only. If an
- MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
- it will match this filter.
- description: A filter object to specify which tools are allowed.
- title: MCP tool filter
- OpenAI.MCPToolRequireApproval:
- type: object
- properties:
- always:
- $ref: '#/components/schemas/OpenAI.MCPToolFilter'
- never:
- $ref: '#/components/schemas/OpenAI.MCPToolFilter'
- OpenAI.MessageContent:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.MessageContentType'
- discriminator:
- propertyName: type
- mapping:
- text: '#/components/schemas/OpenAI.TextContent'
- computer_screenshot: '#/components/schemas/OpenAI.ComputerScreenshotContent'
- input_text: '#/components/schemas/OpenAI.MessageContentInputTextContent'
- output_text: '#/components/schemas/OpenAI.MessageContentOutputTextContent'
- reasoning_text: '#/components/schemas/OpenAI.MessageContentReasoningTextContent'
- refusal: '#/components/schemas/OpenAI.MessageContentRefusalContent'
- input_image: '#/components/schemas/OpenAI.MessageContentInputImageContent'
- input_file: '#/components/schemas/OpenAI.MessageContentInputFileContent'
- summary_text: '#/components/schemas/OpenAI.SummaryTextContent'
- description: A content part that makes up an input or output item.
- OpenAI.MessageContentInputFileContent:
- type: object
- required:
- - type
- properties:
- type:
- type: string
- enum:
- - input_file
- description: The type of the input item. Always `input_file`.
- x-stainless-const: true
- default: input_file
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- filename:
- type: string
- description: The name of the file to be sent to the model.
- file_data:
- type: string
- description: The content of the file to be sent to the model.
- file_url:
- type: string
- format: uri
- description: The URL of the file to be sent to the model.
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
- allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A file input to the model.
- title: Input file
- OpenAI.MessageContentInputImageContent:
- type: object
- required:
- - type
- - detail
- properties:
- type:
- type: string
- enum:
- - input_image
- description: The type of the input item. Always `input_image`.
- x-stainless-const: true
- default: input_image
- image_url:
- anyOf:
- - type: string
- format: uri
- - type: 'null'
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
+ - completed
+ - failed
+ - incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ description: |-
+ 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_in_page).
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
- title: Input image
- OpenAI.MessageContentInputTextContent:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: |-
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.OutputMessageContent:
type: object
required:
- type
- - text
properties:
type:
- type: string
- enum:
- - input_text
- description: The type of the input item. Always `input_text`.
- x-stainless-const: true
- default: input_text
- text:
- type: string
- description: The text input to the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A text input to the model.
- title: Input text
- OpenAI.MessageContentOutputTextContent:
+ $ref: '#/components/schemas/OpenAI.OutputMessageContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ output_text: '#/components/schemas/OpenAI.OutputMessageContentOutputTextContent'
+ refusal: '#/components/schemas/OpenAI.OutputMessageContentRefusalContent'
+ OpenAI.OutputMessageContentOutputTextContent:
type: object
required:
- type
@@ -28918,30 +63508,10 @@ components:
items:
$ref: '#/components/schemas/OpenAI.LogProb'
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
+ - $ref: '#/components/schemas/OpenAI.OutputMessageContent'
description: A text output from the model.
title: Output text
- OpenAI.MessageContentReasoningTextContent:
- type: object
- required:
- - type
- - text
- properties:
- type:
- type: string
- enum:
- - reasoning_text
- description: The type of the reasoning text. Always `reasoning_text`.
- x-stainless-const: true
- default: reasoning_text
- text:
- type: string
- description: The reasoning text from the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: Reasoning text from the model.
- title: Reasoning text
- OpenAI.MessageContentRefusalContent:
+ OpenAI.OutputMessageContentRefusalContent:
type: object
required:
- type
@@ -28958,124 +63528,361 @@ components:
type: string
description: The refusal explanation from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
+ - $ref: '#/components/schemas/OpenAI.OutputMessageContent'
description: A refusal from the model.
title: Refusal
- OpenAI.MessageContentType:
+ OpenAI.OutputMessageContentType:
anyOf:
- type: string
- type: string
enum:
- - input_text
- output_text
- - text
- - summary_text
- - reasoning_text
- refusal
- - input_image
- - computer_screenshot
- - input_file
- OpenAI.MessagePhase:
- type: string
- enum:
- - commentary
- - final_answer
+ OpenAI.PartialImages:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ maximum: 3
description: |-
- Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
- For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
- phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
- OpenAI.MessageRole:
+ The number of partial images to generate. This parameter is used for
+ streaming responses that return partial images. Value must be between 0 and 3.
+ When set to 0, the response will be a single image sent in one streaming event.
+ Note that the final image may be sent before the full number of partial images
+ are generated if the full image is generated more quickly.
+ OpenAI.PredictionContent:
+ type: object
+ required:
+ - type
+ - content
+ properties:
+ type:
+ type: string
+ enum:
+ - content
+ description: |-
+ The type of the predicted content you want to provide. This type is
+ currently always `content`.
+ x-stainless-const: true
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ description: |-
+ 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.
+ description: |-
+ Static predicted output content, such as the content of a text file that is
+ being regenerated.
+ title: Static Content
+ OpenAI.Prompt:
+ type: object
+ required:
+ - id
+ properties:
+ id:
+ type: string
+ description: The unique identifier of the prompt template to use.
+ version:
+ anyOf:
+ - type: string
+ - type: 'null'
+ variables:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ResponsePromptVariables'
+ - type: 'null'
+ description: |-
+ Reference to a prompt template and its variables.
+ [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts).
+ OpenAI.PromptCacheRetentionEnum:
type: string
enum:
- - unknown
- - user
- - assistant
- - system
- - critic
- - discriminator
- - developer
- - tool
- OpenAI.MessageStatus:
+ - in_memory
+ - 24h
+ OpenAI.RankerVersionType:
type: string
enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.Metadata:
+ - auto
+ - default-2024-11-15
+ OpenAI.RankingOptions:
type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- OpenAI.ModelIdsCompaction:
+ properties:
+ ranker:
+ $ref: '#/components/schemas/OpenAI.RankerVersionType'
+ description: The ranker to use for the file search.
+ score_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: 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.
+ hybrid_search:
+ $ref: '#/components/schemas/OpenAI.HybridSearchOptions'
+ description: Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
+ OpenAI.RealtimeAudioFormats:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormatsType'
+ discriminator:
+ propertyName: type
+ mapping:
+ audio/pcm: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcm'
+ audio/pcmu: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcmu'
+ audio/pcma: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcma'
+ OpenAI.RealtimeAudioFormatsAudioPcm:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - audio/pcm
+ rate:
+ type: number
+ enum:
+ - 24000
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ OpenAI.RealtimeAudioFormatsAudioPcma:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - audio/pcma
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ OpenAI.RealtimeAudioFormatsAudioPcmu:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - audio/pcmu
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ OpenAI.RealtimeAudioFormatsType:
anyOf:
- - $ref: '#/components/schemas/OpenAI.ModelIdsResponses'
- type: string
- - type: 'null'
- description: Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/docs/models) to browse and compare available models.
- OpenAI.ModelIdsResponses:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ModelIdsShared'
- - type: string
- enum:
- - 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
- - gpt-5-codex
- - gpt-5-pro
- - gpt-5-pro-2025-10-06
- - gpt-5.1-codex-max
- OpenAI.ModelIdsShared:
- anyOf:
- type: string
- - $ref: '#/components/schemas/OpenAI.ChatModel'
- OpenAI.Moderation:
+ enum:
+ - audio/pcm
+ - audio/pcmu
+ - audio/pcma
+ OpenAI.RealtimeCallCreateRequest:
+ type: object
+ properties:
+ sdp:
+ type: string
+ description: WebRTC Session Description Protocol (SDP) offer generated by the caller.
+ session:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA'
+ description: |-
+ Optional session configuration to apply before the realtime session is
+ created. Use the same parameters you would send in a [`create client secret`](/docs/api-reference/realtime-sessions/create-realtime-client-secret)
+ request.
+ required:
+ - sdp
+ OpenAI.RealtimeCallReferRequest:
type: object
required:
- - input
- - output
+ - target_uri
properties:
- input:
- $ref: '#/components/schemas/OpenAI.ModerationEntry'
- description: Moderation for the response input.
- output:
- $ref: '#/components/schemas/OpenAI.ModerationEntry'
- description: Moderation for the response output.
- description: Moderation results or errors for the response input and output.
- title: Moderation
- OpenAI.ModerationEntry:
+ target_uri:
+ type: string
+ description: |-
+ URI that should appear in the SIP Refer-To header. Supports values like
+ `tel:+14155550123` or `sip:agent\@example.com`.
+ description: |-
+ Parameters required to transfer a SIP call to a new destination using the
+ Realtime API.
+ title: Realtime call refer request
+ OpenAI.RealtimeCallRejectRequest:
+ type: object
+ properties:
+ status_code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: |-
+ SIP response code to send back to the caller. Defaults to `603` (Decline)
+ when omitted.
+ description: Parameters used to decline an incoming SIP call handled by the Realtime API.
+ title: Realtime call reject request
+ OpenAI.RealtimeCreateClientSecretRequest:
+ type: object
+ properties:
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.RealtimeCreateClientSecretRequestExpiresAfter'
+ description: |-
+ Configuration for the client secret expiration. Expiration refers to the time after which
+ a client secret will no longer be valid for creating sessions. The session itself may
+ continue after that time once started. A secret can be used to create multiple sessions
+ until it expires.
+ title: Client secret expiration
+ session:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion'
+ description: |-
+ Session configuration to use for the client secret. Choose either a realtime
+ session or a transcription session.
+ title: Session configuration
+ description: |-
+ Create a session and client secret for the Realtime API. The request can specify
+ either a realtime or a transcription session configuration.
+ [Learn more about the Realtime API](/docs/guides/realtime).
+ title: Realtime client secret creation request
+ OpenAI.RealtimeCreateClientSecretRequestExpiresAfter:
+ type: object
+ properties:
+ anchor:
+ type: string
+ enum:
+ - created_at
+ x-stainless-const: true
+ default: created_at
+ seconds:
+ type: integer
+ format: int64
+ minimum: 10
+ maximum: 7200
+ default: 600
+ OpenAI.RealtimeCreateClientSecretResponse:
+ type: object
+ required:
+ - value
+ - expires_at
+ - session
+ properties:
+ value:
+ type: string
+ description: The generated client secret value.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: Expiration timestamp for the client secret, in seconds since epoch.
+ session:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion'
+ description: The session configuration for either a realtime or transcription session.
+ title: Session configuration
+ description: Response from creating a session and client secret for the Realtime API.
+ title: Realtime session and client secret
+ x-oaiMeta:
+ name: Session response object
+ group: realtime
+ example: |
+ {
+ "value": "ek_68af296e8e408191a1120ab6383263c2",
+ "expires_at": 1756310470,
+ "session": {
+ "type": "realtime",
+ "object": "realtime.session",
+ "id": "sess_C9CiUVUzUzYIssh3ELY1d",
+ "model": "gpt-realtime-2025-08-25",
+ "output_modalities": [
+ "audio"
+ ],
+ "instructions": "You are a friendly assistant.",
+ "tools": [],
+ "tool_choice": "auto",
+ "max_output_tokens": "inf",
+ "tracing": null,
+ "truncation": "auto",
+ "prompt": null,
+ "expires_at": 0,
+ "audio": {
+ "input": {
+ "format": {
+ "type": "audio/pcm",
+ "rate": 24000
+ },
+ "transcription": null,
+ "noise_reduction": null,
+ "turn_detection": {
+ "type": "server_vad",
+ "threshold": 0.5,
+ "prefix_padding_ms": 300,
+ "silence_duration_ms": 200,
+ "idle_timeout_ms": null,
+ "create_response": true,
+ "interrupt_response": true
+ }
+ },
+ "output": {
+ "format": {
+ "type": "audio/pcm",
+ "rate": 24000
+ },
+ "voice": "alloy",
+ "speed": 1.0
+ }
+ },
+ "include": null
+ }
+ }
+ OpenAI.RealtimeFunctionTool:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - function
+ description: The type of the tool, i.e. `function`.
+ x-stainless-const: true
+ name:
+ type: string
+ description: The name of the function.
+ description:
+ type: string
+ description: |-
+ 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).
+ parameters:
+ $ref: '#/components/schemas/OpenAI.RealtimeFunctionToolParameters'
+ description: Parameters of the function in JSON Schema.
+ title: Function tool
+ OpenAI.RealtimeFunctionToolParameters:
+ type: object
+ OpenAI.RealtimeMCPError:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.ModerationEntryType'
+ $ref: '#/components/schemas/OpenAI.RealtimeMcpErrorType'
discriminator:
propertyName: type
mapping:
- moderation_result: '#/components/schemas/OpenAI.ModerationResultBody'
- error: '#/components/schemas/OpenAI.ModerationErrorBody'
- description: Moderation results or an error for a response moderation check.
- OpenAI.ModerationEntryType:
- anyOf:
- - type: string
- - type: string
+ protocol_error: '#/components/schemas/OpenAI.RealtimeMCPProtocolError'
+ tool_execution_error: '#/components/schemas/OpenAI.RealtimeMCPToolExecutionError'
+ http_error: '#/components/schemas/OpenAI.RealtimeMCPHTTPError'
+ OpenAI.RealtimeMCPHTTPError:
+ type: object
+ required:
+ - type
+ - code
+ - message
+ properties:
+ type:
+ type: string
enum:
- - moderation_result
- - error
- OpenAI.ModerationErrorBody:
+ - http_error
+ x-stainless-const: true
+ code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ message:
+ type: string
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ title: Realtime MCP HTTP error
+ OpenAI.RealtimeMCPProtocolError:
type: object
required:
- type
@@ -29085,2299 +63892,3270 @@ components:
type:
type: string
enum:
- - error
- description: The object type, which was always `error` for moderation failures.
+ - protocol_error
x-stainless-const: true
code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ message:
type: string
- description: The error code.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ title: Realtime MCP protocol error
+ OpenAI.RealtimeMCPToolExecutionError:
+ type: object
+ required:
+ - type
+ - message
+ properties:
+ type:
+ type: string
+ enum:
+ - tool_execution_error
+ x-stainless-const: true
message:
type: string
- description: The error message.
allOf:
- - $ref: '#/components/schemas/OpenAI.ModerationEntry'
- description: An error produced while attempting moderation for the response input or output.
- title: Moderation error
- OpenAI.ModerationInputType:
+ - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ title: Realtime MCP tool execution error
+ OpenAI.RealtimeMcpErrorType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - protocol_error
+ - tool_execution_error
+ - http_error
+ OpenAI.RealtimeReasoning:
+ type: object
+ properties:
+ effort:
+ $ref: '#/components/schemas/OpenAI.RealtimeReasoningEffort'
+ description: Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
+ title: Realtime reasoning configuration
+ OpenAI.RealtimeReasoningEffort:
type: string
enum:
- - text
- - image
- OpenAI.ModerationParam:
+ - minimal
+ - low
+ - medium
+ - high
+ - xhigh
+ description: |-
+ Constrains effort on reasoning for reasoning-capable Realtime models such as
+ `gpt-realtime-2`.
+ OpenAI.RealtimeSessionCreateRequest:
type: object
required:
- - model
+ - client_secret
properties:
- model:
+ client_secret:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestClientSecret'
+ description: Ephemeral key returned by the API.
+ modalities:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ - audio
+ description: |-
+ The set of modalities the model can respond with. To disable audio,
+ set this to ["text"].
+ default:
+ - text
+ - audio
+ instructions:
type: string
- description: The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.
- description: Configuration for running moderation on the input and output of this response.
- OpenAI.ModerationResultBody:
+ description: |-
+ 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.
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsOrCustomVoice'
+ description: |-
+ The voice the model uses to respond. Supported built-in voices are
+ `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`,
+ `marin`, and `cedar`. You may also provide a custom voice object with an
+ `id`, for example `{ "id": "voice_1234" }`. Voice cannot be changed during
+ the session once the model has responded with audio at least once.
+ input_audio_format:
+ type: string
+ description: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
+ output_audio_format:
+ type: string
+ description: The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
+ input_audio_transcription:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestInputAudioTranscription'
+ description: |-
+ 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.
+ speed:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0.25
+ maximum: 1.5
+ description: |-
+ 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.
+ default: 1
+ tracing:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - type: object
+ properties:
+ workflow_name:
+ type: string
+ group_id:
+ type: string
+ metadata:
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ 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.
+ title: Tracing Configuration
+ default: auto
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestTurnDetection'
+ description: |-
+ 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.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestTools'
+ description: Tools (functions) available to the model.
+ tool_choice:
+ type: string
+ description: |-
+ How the model chooses tools. Options are `auto`, `none`, `required`, or
+ specify a function.
+ temperature:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
+ max_response_output_tokens:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
+ enum:
+ - inf
+ description: |-
+ 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`.
+ truncation:
+ $ref: '#/components/schemas/OpenAI.RealtimeTruncation'
+ prompt:
+ $ref: '#/components/schemas/OpenAI.Prompt'
+ description: |-
+ A new Realtime session configuration, with an ephemeral key. Default TTL
+ for keys is one minute.
+ x-oaiMeta:
+ name: The session object
+ group: realtime
+ example: |
+ {
+ "id": "sess_001",
+ "object": "realtime.session",
+ "model": "gpt-realtime-2025-08-25",
+ "modalities": ["audio", "text"],
+ "instructions": "You are a friendly assistant.",
+ "voice": "alloy",
+ "input_audio_format": "pcm16",
+ "output_audio_format": "pcm16",
+ "input_audio_transcription": {
+ "model": "whisper-1"
+ },
+ "turn_detection": null,
+ "tools": [],
+ "tool_choice": "none",
+ "temperature": 0.7,
+ "speed": 1.1,
+ "tracing": "auto",
+ "max_response_output_tokens": 200,
+ "truncation": "auto",
+ "prompt": null,
+ "client_secret": {
+ "value": "ek_abc123",
+ "expires_at": 1234567890
+ }
+ }
+ OpenAI.RealtimeSessionCreateRequestClientSecret:
+ type: object
+ required:
+ - value
+ - expires_at
+ properties:
+ value:
+ type: string
+ expires_at:
+ type: integer
+ format: unixtime
+ OpenAI.RealtimeSessionCreateRequestGA:
type: object
required:
- type
- - model
- - flagged
- - categories
- - category_scores
- - category_applied_input_types
properties:
type:
type: string
enum:
- - moderation_result
- description: The object type, which was always `moderation_result` for successful moderation results.
+ - realtime
+ description: The type of session to create. Always `realtime` for the Realtime API.
x-stainless-const: true
+ output_modalities:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ - audio
+ description: |-
+ The set of modalities the model can respond with. It defaults to `["audio"]`, indicating
+ that the model will respond with audio plus a transcript. `["text"]` can be used to make
+ the model respond with text only. It is not possible to request both `text` and `audio` at the same time.
+ default:
+ - audio
model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - gpt-realtime
+ - gpt-realtime-1.5
+ - gpt-realtime-2
+ - gpt-realtime-2025-08-28
+ - 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
+ - gpt-realtime-mini
+ - gpt-realtime-mini-2025-10-06
+ - gpt-realtime-mini-2025-12-15
+ - gpt-audio-1.5
+ - gpt-audio-mini
+ - gpt-audio-mini-2025-10-06
+ - gpt-audio-mini-2025-12-15
+ description: The Realtime model used for this session.
+ instructions:
type: string
- description: The moderation model that produced this result.
- flagged:
+ description: |-
+ 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.
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudio'
+ description: Configuration for input and output audio.
+ include:
+ type: array
+ items:
+ type: string
+ enum:
+ - item.input_audio_transcription.logprobs
+ description: |-
+ Additional fields to include in server outputs.
+ `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.
+ tracing:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGATracing'
+ - type: 'null'
+ description: |-
+ Realtime API can write session traces to the [Traces Dashboard](https://platform.openai.com/logs?api=traces). 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.
+ title: Tracing Configuration
+ default: auto
+ tools:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeFunctionTool'
+ - $ref: '#/components/schemas/OpenAI.MCPTool'
+ description: Tools available to the model.
+ tool_choice:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceFunction'
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceMCP'
+ description: |-
+ How the model chooses tools. Provide one of the string modes or force a specific
+ function/MCP tool.
+ default: auto
+ parallel_tool_calls:
type: boolean
- description: A boolean indicating whether the content was flagged by any category.
- categories:
- type: object
- unevaluatedProperties:
- type: boolean
- description: A dictionary of moderation categories to booleans, True if the input is flagged under this category.
- x-oaiTypeLabel: map
- category_scores:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: A dictionary of moderation categories to scores.
- x-oaiTypeLabel: map
- category_applied_input_types:
- type: object
- unevaluatedProperties:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ModerationInputType'
- description: Which modalities of input are reflected by the score for each category.
- x-oaiTypeLabel: map
+ description: |-
+ Whether the model may call multiple tools in parallel. Only supported by
+ reasoning Realtime models such as `gpt-realtime-2`.
+ reasoning:
+ $ref: '#/components/schemas/OpenAI.RealtimeReasoning'
+ max_output_tokens:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
+ enum:
+ - inf
+ description: |-
+ 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`.
+ truncation:
+ $ref: '#/components/schemas/OpenAI.RealtimeTruncation'
+ prompt:
+ $ref: '#/components/schemas/OpenAI.Prompt'
allOf:
- - $ref: '#/components/schemas/OpenAI.ModerationEntry'
- description: A moderation result produced for the response input or output.
- title: Moderation result
- OpenAI.MoveParam:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion'
+ description: Realtime session object configuration.
+ title: Realtime session configuration
+ OpenAI.RealtimeSessionCreateRequestGAAudio:
+ type: object
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInput'
+ output:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioOutput'
+ OpenAI.RealtimeSessionCreateRequestGAAudioInput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscription'
+ noise_reduction:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction'
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection'
+ OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction:
type: object
- required:
- - type
- - x
- - 'y'
properties:
type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeSessionCreateRequestGAAudioOutput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsOrCustomVoice'
+ default: alloy
+ speed:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0.25
+ maximum: 1.5
+ default: 1
+ OpenAI.RealtimeSessionCreateRequestGATracing:
+ type: object
+ properties:
+ workflow_name:
type: string
- enum:
- - move
- description: Specifies the event type. For a move action, this property is always set to `move`.
- x-stainless-const: true
- x:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate to move to.
- 'y':
- $ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate to move to.
- keys:
- anyOf:
- - type: array
- items:
- type: string
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A mouse move action.
- title: Move
- OpenAI.NamespaceToolParam:
+ group_id:
+ type: string
+ metadata:
+ type: object
+ unevaluatedProperties: {}
+ OpenAI.RealtimeSessionCreateRequestInputAudioTranscription:
+ type: object
+ properties:
+ model:
+ type: string
+ OpenAI.RealtimeSessionCreateRequestTools:
type: object
- required:
- - type
- - name
- - description
- - tools
properties:
type:
type: string
enum:
- - namespace
- description: The type of the tool. Always `namespace`.
+ - function
x-stainless-const: true
name:
type: string
- minLength: 1
- description: The namespace name used in tool calls (for example, `crm`).
description:
type: string
- minLength: 1
- description: A description of the namespace shown to the model.
- tools:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionToolParam'
- - $ref: '#/components/schemas/OpenAI.CustomToolParam'
- minItems: 1
- description: The function/custom tools available inside this namespace.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: Groups function/custom tools under a shared namespace.
- title: Namespace
- OpenAI.OutputContent:
+ parameters:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestToolsParameters'
+ OpenAI.RealtimeSessionCreateRequestToolsParameters:
+ type: object
+ OpenAI.RealtimeSessionCreateRequestTurnDetection:
+ type: object
+ properties:
+ type:
+ type: string
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeSessionCreateRequestUnion:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.OutputContentType'
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnionType'
discriminator:
propertyName: type
mapping:
- output_text: '#/components/schemas/OpenAI.OutputContentOutputTextContent'
- refusal: '#/components/schemas/OpenAI.OutputContentRefusalContent'
- reasoning_text: '#/components/schemas/OpenAI.OutputContentReasoningTextContent'
- OpenAI.OutputContentOutputTextContent:
+ transcription: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGA'
+ realtime: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA'
+ OpenAI.RealtimeSessionCreateRequestUnionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - realtime
+ - transcription
+ OpenAI.RealtimeSessionCreateResponse:
type: object
required:
- type
- - text
- - annotations
- - logprobs
properties:
- type:
+ id:
type: string
- enum:
- - output_text
- description: The type of the output text. Always `output_text`.
- x-stainless-const: true
- default: output_text
- text:
+ description: Unique identifier for the session that looks like `sess_1234567890abcdef`.
+ object:
type: string
- description: The text output from the model.
- annotations:
+ description: The object type. Always `realtime.session`.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: Expiration timestamp for the session, in seconds since epoch.
+ include:
type: array
items:
- $ref: '#/components/schemas/OpenAI.Annotation'
- description: The annotations of the text output.
- logprobs:
+ type: string
+ enum:
+ - item.input_audio_transcription.logprobs
+ description: |-
+ Additional fields to include in server outputs.
+ - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.
+ model:
+ type: string
+ description: The Realtime model used for this session.
+ output_modalities:
type: array
items:
- $ref: '#/components/schemas/OpenAI.LogProb'
+ type: string
+ enum:
+ - text
+ - audio
+ description: |-
+ The set of modalities the model can respond with. To disable audio,
+ set this to ["text"].
+ instructions:
+ type: string
+ description: |-
+ 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.
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudio'
+ description: Configuration for input and output audio for the session.
+ tracing:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - type: object
+ properties:
+ workflow_name:
+ type: string
+ group_id:
+ type: string
+ metadata:
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ 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.
+ title: Tracing Configuration
+ default: auto
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseTurnDetection'
+ description: |-
+ 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.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RealtimeFunctionTool'
+ description: Tools (functions) available to the model.
+ tool_choice:
+ type: string
+ description: |-
+ How the model chooses tools. Options are `auto`, `none`, `required`, or
+ specify a function.
+ max_output_tokens:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
+ enum:
+ - inf
+ description: |-
+ 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:
+ type: string
+ enum:
+ - realtime
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputContent'
- description: A text output from the model.
- title: Output text
- OpenAI.OutputContentReasoningTextContent:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion'
+ description: A Realtime session configuration object.
+ title: Realtime session configuration object
+ x-oaiMeta:
+ name: The session object
+ group: realtime
+ example: |
+ {
+ "id": "sess_001",
+ "object": "realtime.session",
+ "expires_at": 1742188264,
+ "model": "gpt-realtime",
+ "output_modalities": ["audio"],
+ "instructions": "You are a friendly assistant.",
+ "tools": [],
+ "tool_choice": "none",
+ "max_output_tokens": "inf",
+ "tracing": "auto",
+ "truncation": "auto",
+ "prompt": null,
+ "audio": {
+ "input": {
+ "format": {
+ "type": "audio/pcm",
+ "rate": 24000
+ },
+ "transcription": { "model": "whisper-1" },
+ "noise_reduction": null,
+ "turn_detection": null
+ },
+ "output": {
+ "format": {
+ "type": "audio/pcm",
+ "rate": 24000
+ },
+ "voice": "alloy",
+ "speed": 1.0
+ }
+ }
+ }
+ OpenAI.RealtimeSessionCreateResponseAudio:
+ type: object
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInput'
+ output:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioOutput'
+ OpenAI.RealtimeSessionCreateResponseAudioInput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscriptionResponse'
+ noise_reduction:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction'
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection'
+ OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection:
type: object
- required:
- - type
- - text
properties:
type:
type: string
- enum:
- - reasoning_text
- description: The type of the reasoning text. Always `reasoning_text`.
- x-stainless-const: true
- default: reasoning_text
- text:
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeSessionCreateResponseAudioOutput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsShared'
+ speed:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.RealtimeSessionCreateResponseTurnDetection:
+ type: object
+ properties:
+ type:
type: string
- description: The reasoning text from the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputContent'
- description: Reasoning text from the model.
- title: Reasoning text
- OpenAI.OutputContentRefusalContent:
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeSessionCreateResponseUnion:
type: object
required:
- type
- - refusal
properties:
type:
- type: string
- enum:
- - refusal
- description: The type of the refusal. Always `refusal`.
- x-stainless-const: true
- default: refusal
- refusal:
- type: string
- description: The refusal explanation from the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputContent'
- description: A refusal from the model.
- title: Refusal
- OpenAI.OutputContentType:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnionType'
+ discriminator:
+ propertyName: type
+ mapping:
+ transcription: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse'
+ realtime: '#/components/schemas/OpenAI.RealtimeSessionCreateResponse'
+ OpenAI.RealtimeSessionCreateResponseUnionType:
anyOf:
- type: string
- type: string
enum:
- - output_text
- - refusal
- - reasoning_text
- OpenAI.OutputItem:
+ - realtime
+ - transcription
+ OpenAI.RealtimeTranscriptionSessionCreateRequest:
type: object
- required:
- - type
properties:
- type:
- $ref: '#/components/schemas/OpenAI.OutputItemType'
- agent_reference:
- $ref: '#/components/schemas/AgentReference'
- description: The agent that created the item.
- response_id:
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection'
+ description: 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.
+ input_audio_noise_reduction:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction'
+ description: |-
+ 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_format:
type: string
- description: The response on which the item is created.
- discriminator:
- propertyName: type
- mapping:
- structured_outputs: '#/components/schemas/StructuredOutputsOutputItem'
- workflow_action: '#/components/schemas/WorkflowActionOutputItem'
- oauth_consent_request: '#/components/schemas/OAuthConsentRequestOutputItem'
- bing_grounding_call: '#/components/schemas/BingGroundingToolCall'
- bing_grounding_call_output: '#/components/schemas/BingGroundingToolCallOutput'
- sharepoint_grounding_preview_call: '#/components/schemas/SharepointGroundingToolCall'
- sharepoint_grounding_preview_call_output: '#/components/schemas/SharepointGroundingToolCallOutput'
- azure_ai_search_call: '#/components/schemas/AzureAISearchToolCall'
- azure_ai_search_call_output: '#/components/schemas/AzureAISearchToolCallOutput'
- bing_custom_search_preview_call: '#/components/schemas/BingCustomSearchToolCall'
- bing_custom_search_preview_call_output: '#/components/schemas/BingCustomSearchToolCallOutput'
- openapi_call: '#/components/schemas/OpenApiToolCall'
- openapi_call_output: '#/components/schemas/OpenApiToolCallOutput'
- browser_automation_preview_call: '#/components/schemas/BrowserAutomationToolCall'
- browser_automation_preview_call_output: '#/components/schemas/BrowserAutomationToolCallOutput'
- fabric_dataagent_preview_call: '#/components/schemas/FabricDataAgentToolCall'
- fabric_dataagent_preview_call_output: '#/components/schemas/FabricDataAgentToolCallOutput'
- azure_function_call: '#/components/schemas/AzureFunctionToolCall'
- azure_function_call_output: '#/components/schemas/AzureFunctionToolCallOutput'
- a2a_preview_call: '#/components/schemas/A2AToolCall'
- a2a_preview_call_output: '#/components/schemas/A2AToolCallOutput'
- memory_search_call: '#/components/schemas/MemorySearchToolCall'
- memory_command_preview_call: '#/components/schemas/MemoryCommandToolCall'
- memory_command_preview_call_output: '#/components/schemas/MemoryCommandToolCallOutput'
- output_message: '#/components/schemas/OpenAI.OutputItemOutputMessage'
- file_search_call: '#/components/schemas/OpenAI.OutputItemFileSearchToolCall'
- function_call: '#/components/schemas/OpenAI.OutputItemFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.OutputItemFunctionToolCallOutput'
- web_search_call: '#/components/schemas/OpenAI.OutputItemWebSearchToolCall'
- computer_call: '#/components/schemas/OpenAI.OutputItemComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.OutputItemComputerToolCallOutput'
- reasoning: '#/components/schemas/OpenAI.OutputItemReasoningItem'
- tool_search_call: '#/components/schemas/OpenAI.OutputItemToolSearchCall'
- tool_search_output: '#/components/schemas/OpenAI.OutputItemToolSearchOutput'
- additional_tools: '#/components/schemas/OpenAI.OutputItemAdditionalTools'
- compaction: '#/components/schemas/OpenAI.OutputItemCompactionBody'
- image_generation_call: '#/components/schemas/OpenAI.OutputItemImageGenToolCall'
- code_interpreter_call: '#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.OutputItemLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.OutputItemLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.OutputItemFunctionShellCall'
- shell_call_output: '#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput'
- apply_patch_call: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCall'
- apply_patch_call_output: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput'
- mcp_call: '#/components/schemas/OpenAI.OutputItemMcpToolCall'
- mcp_list_tools: '#/components/schemas/OpenAI.OutputItemMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.OutputItemMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.OutputItemMcpApprovalResponseResource'
- custom_tool_call: '#/components/schemas/OpenAI.OutputItemCustomToolCallResource'
- custom_tool_call_output: '#/components/schemas/OpenAI.OutputItemCustomToolCallOutputResource'
- OpenAI.OutputItemAdditionalTools:
+ enum:
+ - pcm16
+ - g711_ulaw
+ - g711_alaw
+ description: |-
+ 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.
+ default: pcm16
+ input_audio_transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscription'
+ description: Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.
+ include:
+ type: array
+ items:
+ type: string
+ enum:
+ - item.input_audio_transcription.logprobs
+ description: |-
+ The set of items to include in the transcription. Current available items are:
+ `item.input_audio_transcription.logprobs`
+ description: Realtime transcription session object configuration.
+ title: Realtime transcription session configuration
+ OpenAI.RealtimeTranscriptionSessionCreateRequestGA:
type: object
required:
- type
- - id
- - role
- - tools
properties:
type:
type: string
enum:
- - additional_tools
- description: The type of the item. Always `additional_tools`.
+ - transcription
+ description: The type of session to create. Always `transcription` for transcription sessions.
x-stainless-const: true
- default: additional_tools
- id:
- type: string
- description: The unique ID of the additional tools item.
- role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role that provided the additional tools.
- tools:
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudio'
+ description: Configuration for input and output audio.
+ include:
type: array
items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The additional tool definitions made available at this item.
+ type: string
+ enum:
+ - item.input_audio_transcription.logprobs
+ description: |-
+ Additional fields to include in server outputs.
+ `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- OpenAI.OutputItemApplyPatchToolCall:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion'
+ description: Realtime transcription session object configuration.
+ title: Realtime transcription session configuration
+ OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudio:
+ type: object
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInput'
+ OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscription'
+ noise_reduction:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInputNoiseReduction'
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection'
+ OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInputNoiseReduction:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - server_vad
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeTranscriptionSessionCreateResponse:
type: object
required:
+ - client_secret
- type
- - id
- - call_id
- - status
- - operation
properties:
+ client_secret:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret'
+ description: |-
+ Ephemeral key returned by the API. Only present when the session is
+ created on the server via REST API.
+ modalities:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ - audio
+ description: |-
+ The set of modalities the model can respond with. To disable audio,
+ set this to ["text"].
+ input_audio_format:
+ type: string
+ description: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
+ input_audio_transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscriptionResponse'
+ description: Configuration of the transcription model.
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection'
+ description: |-
+ Configuration for turn detection. Can be set to `null` to turn off. Server
+ VAD means that the model will detect the start and end of speech based on
+ audio volume and respond at the end of user speech.
type:
type: string
enum:
- - apply_patch_call
- description: The type of the item. Always `apply_patch_call`.
+ - transcription
x-stainless-const: true
- default: apply_patch_call
- id:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion'
+ description: |-
+ A new Realtime transcription session configuration.
+ When a session is created on the server via REST API, the session object
+ also contains an ephemeral key. Default TTL for keys is 10 minutes. This
+ property is not present when a session is updated via the WebSocket API.
+ x-oaiMeta:
+ name: The transcription session object
+ group: realtime
+ example: |
+ {
+ "id": "sess_BBwZc7cFV3XizEyKGDCGL",
+ "object": "realtime.transcription_session",
+ "expires_at": 1742188264,
+ "modalities": ["audio", "text"],
+ "turn_detection": {
+ "type": "server_vad",
+ "threshold": 0.5,
+ "prefix_padding_ms": 300,
+ "silence_duration_ms": 200
+ },
+ "input_audio_format": "pcm16",
+ "input_audio_transcription": {
+ "model": "gpt-4o-transcribe",
+ "language": null,
+ "prompt": ""
+ },
+ "client_secret": null
+ }
+ OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret:
+ type: object
+ required:
+ - value
+ - expires_at
+ properties:
+ value:
type: string
- description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
- call_id:
+ expires_at:
+ type: integer
+ format: unixtime
+ OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection:
+ type: object
+ properties:
+ type:
type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
- description: The status of the apply patch tool call. One of `in_progress` or `completed`.
- operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
- title: Apply patch operation
- created_by:
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeTranslationClientSecretCreateRequest:
+ type: object
+ required:
+ - session
+ properties:
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationClientSecretCreateRequestExpiresAfter'
+ description: |-
+ Configuration for the client secret expiration. Expiration refers to the time after which
+ a client secret will no longer be valid for creating sessions. The session itself may
+ continue after that time once started. A secret can be used to create multiple sessions
+ until it expires.
+ title: Client secret expiration
+ session:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequest'
+ description: Create a translation session and client secret for the Realtime API.
+ title: Realtime translation client secret creation request
+ OpenAI.RealtimeTranslationClientSecretCreateRequestExpiresAfter:
+ type: object
+ properties:
+ anchor:
type: string
- description: The ID of the entity that created this tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A tool call that applies file diffs by creating, deleting, or updating files.
- title: Apply patch tool call
- OpenAI.OutputItemApplyPatchToolCallOutput:
+ enum:
+ - created_at
+ x-stainless-const: true
+ default: created_at
+ seconds:
+ type: integer
+ format: int64
+ minimum: 10
+ maximum: 7200
+ default: 600
+ OpenAI.RealtimeTranslationClientSecretCreateResponse:
+ type: object
+ required:
+ - value
+ - expires_at
+ - session
+ properties:
+ value:
+ type: string
+ description: The generated client secret value.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: Expiration timestamp for the client secret, in seconds since epoch.
+ session:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSession'
+ description: Response from creating a translation session and client secret for the Realtime API.
+ title: Realtime translation session and client secret
+ x-oaiMeta:
+ name: Translation session response object
+ group: realtime
+ example: |
+ {
+ "value": "ek_68af296e8e408191a1120ab6383263c2",
+ "expires_at": 1756310470,
+ "session": {
+ "id": "sess_C9CiUVUzUzYIssh3ELY1d",
+ "type": "translation",
+ "expires_at": 1756310470,
+ "model": "gpt-realtime-translate",
+ "audio": {
+ "input": {
+ "transcription": null,
+ "noise_reduction": null
+ },
+ "output": {
+ "language": "es"
+ }
+ }
+ }
+ }
+ OpenAI.RealtimeTranslationSession:
type: object
required:
- - type
- id
- - call_id
- - status
+ - type
+ - expires_at
+ - model
+ - audio
properties:
+ id:
+ type: string
+ description: Unique identifier for the session that looks like `sess_1234567890abcdef`.
type:
type: string
enum:
- - apply_patch_call_output
- description: The type of the item. Always `apply_patch_call_output`.
+ - translation
+ description: The session type. Always `translation` for Realtime translation sessions.
x-stainless-const: true
- default: apply_patch_call_output
- id:
- type: string
- description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
- call_id:
+ expires_at:
+ type: integer
+ format: unixtime
+ description: Expiration timestamp for the session, in seconds since epoch.
+ model:
type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
- description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ description: |-
+ The Realtime translation model used for this session. This field is set at
+ session creation and cannot be changed with `session.update`.
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudio'
+ description: Configuration for translation input and output audio.
+ description: |-
+ A Realtime translation session. Translation sessions continuously translate input
+ audio into the configured output language.
+ title: Realtime translation session
+ x-oaiMeta:
+ name: The translation session object
+ group: realtime
+ example: |
+ {
+ "id": "sess_C9G5QPteg4UIbotdKLoYQ",
+ "type": "translation",
+ "expires_at": 1756324625,
+ "model": "gpt-realtime-translate",
+ "audio": {
+ "input": {
+ "transcription": {
+ "model": "gpt-realtime-whisper"
+ },
+ "noise_reduction": null
+ },
+ "output": {
+ "language": "es"
+ }
+ }
+ }
+ OpenAI.RealtimeTranslationSessionAudio:
+ type: object
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInput'
output:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudioOutput'
+ OpenAI.RealtimeTranslationSessionAudioInput:
+ type: object
+ properties:
+ transcription:
anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInputTranscription'
- type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call output.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output emitted by an apply patch tool call.
- title: Apply patch tool call output
- OpenAI.OutputItemCodeInterpreterToolCall:
+ noise_reduction:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInputNoiseReduction'
+ - type: 'null'
+ OpenAI.RealtimeTranslationSessionAudioInputNoiseReduction:
type: object
required:
- type
- - id
- - status
- - container_id
- - code
- - outputs
properties:
type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeTranslationSessionAudioInputTranscription:
+ type: object
+ required:
+ - model
+ properties:
+ model:
type: string
- enum:
- - code_interpreter_call
- description: The type of the code interpreter tool call. Always `code_interpreter_call`.
- x-stainless-const: true
- default: code_interpreter_call
- id:
- type: string
- description: The unique ID of the code interpreter tool call.
- status:
+ OpenAI.RealtimeTranslationSessionAudioOutput:
+ type: object
+ properties:
+ language:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - interpreting
- - failed
- description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
- container_id:
+ OpenAI.RealtimeTranslationSessionCreateRequest:
+ type: object
+ required:
+ - model
+ properties:
+ model:
type: string
- description: The ID of the container used to run the code.
- code:
+ description: The Realtime translation model used for this session.
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudio'
+ description: Configuration for translation input and output audio.
+ description: |-
+ Realtime translation session configuration. Translation sessions stream source
+ audio in and translated audio plus transcript deltas out continuously.
+ title: Realtime translation session configuration
+ OpenAI.RealtimeTranslationSessionCreateRequestAudio:
+ type: object
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInput'
+ output:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioOutput'
+ OpenAI.RealtimeTranslationSessionCreateRequestAudioInput:
+ type: object
+ properties:
+ transcription:
anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInputTranscription'
- type: 'null'
- outputs:
+ noise_reduction:
anyOf:
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
+ - $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInputNoiseReduction'
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A tool call to run code.
- title: Code interpreter tool call
- OpenAI.OutputItemCompactionBody:
+ OpenAI.RealtimeTranslationSessionCreateRequestAudioInputNoiseReduction:
type: object
required:
- type
- - id
- - encrypted_content
properties:
type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeTranslationSessionCreateRequestAudioInputTranscription:
+ type: object
+ required:
+ - model
+ properties:
+ model:
type: string
- enum:
- - compaction
- description: The type of the item. Always `compaction`.
- x-stainless-const: true
- default: compaction
- id:
- type: string
- description: The unique ID of the compaction item.
- encrypted_content:
- type: string
- description: The encrypted content that was produced by compaction.
- created_by:
+ OpenAI.RealtimeTranslationSessionCreateRequestAudioOutput:
+ type: object
+ properties:
+ language:
type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
- title: Compaction item
- OpenAI.OutputItemComputerToolCall:
+ OpenAI.RealtimeTruncation:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - disabled
+ - type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - retention_ratio
+ x-stainless-const: true
+ retention_ratio:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ token_limits:
+ $ref: '#/components/schemas/OpenAI.TokenLimits'
+ required:
+ - type
+ - retention_ratio
+ description: |-
+ When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs.
+ Clients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost.
+ Truncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate.
+ Truncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit.
+ title: Realtime Truncation Controls
+ OpenAI.RealtimeTurnDetection:
type: object
required:
- type
- - id
- - call_id
- - pending_safety_checks
- - status
properties:
type:
- type: string
- enum:
- - computer_call
- description: The type of the computer call. Always `computer_call`.
- default: computer_call
- id:
- type: string
- description: The unique ID of the computer call.
- call_id:
- type: string
- description: An identifier used when responding to the tool call with output.
- action:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- actions:
- $ref: '#/components/schemas/OpenAI.ComputerActionList'
- pending_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: The pending safety checks for the computer call.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
+ $ref: '#/components/schemas/OpenAI.RealtimeTurnDetectionType'
+ discriminator:
+ propertyName: type
+ mapping:
+ server_vad: '#/components/schemas/OpenAI.RealtimeTurnDetectionServerVad'
+ semantic_vad: '#/components/schemas/OpenAI.RealtimeTurnDetectionSemanticVad'
description: |-
- A tool call to a computer use tool. See the
- [computer use guide](/docs/guides/tools-computer-use) for more information.
- title: Computer tool call
- OpenAI.OutputItemComputerToolCallOutput:
+ 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.
+ For `gpt-realtime-whisper` transcription sessions, turn detection must be
+ set to `null`; VAD is not supported.
+ title: Realtime Turn Detection
+ OpenAI.RealtimeTurnDetectionSemanticVad:
type: object
required:
- type
- - id
- - call_id
- - output
properties:
type:
type: string
enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
- x-stainless-const: true
- default: computer_call_output
- id:
- type: string
- description: The ID of the computer tool call output.
- readOnly: true
- call_id:
- type: string
- description: The ID of the computer tool call that produced the output.
- acknowledged_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: |-
- The safety checks reported by the API that have been acknowledged by the
- developer.
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- status:
+ - semantic_vad
+ eagerness:
type: string
enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
+ - low
+ - medium
+ - high
+ - auto
+ default: auto
+ create_response:
+ type: boolean
+ default: true
+ interrupt_response:
+ type: boolean
+ default: true
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.OutputItemCustomToolCallOutputResource:
+ - $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection'
+ OpenAI.RealtimeTurnDetectionServerVad:
type: object
required:
- type
- - call_id
- - output
- - status
properties:
type:
type: string
enum:
- - custom_tool_call_output
- description: The type of the custom tool call output. Always `custom_tool_call_output`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call output in the OpenAI platform.
- call_id:
- type: string
- description: The call ID, used to map this custom tool call output to a custom tool call.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the custom tool call generated by your code.
- Can be a string or an list of output content.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
+ - server_vad
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ create_response:
+ type: boolean
+ default: true
+ interrupt_response:
+ type: boolean
+ default: true
+ idle_timeout_ms:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- title: ResponseCustomToolCallOutputItem
- OpenAI.OutputItemCustomToolCallResource:
+ - $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection'
+ OpenAI.RealtimeTurnDetectionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - server_vad
+ - semantic_vad
+ OpenAI.Reasoning:
+ type: object
+ properties:
+ effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ summary:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - concise
+ - detailed
+ - type: 'null'
+ context:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - current_turn
+ - all_turns
+ - type: 'null'
+ generate_summary:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - concise
+ - detailed
+ - type: 'null'
+ description: |-
+ **gpt-5 and o-series models only**
+ Configuration options for
+ [reasoning models](https://platform.openai.com/docs/guides/reasoning).
+ title: Reasoning
+ OpenAI.ReasoningEffort:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - none
+ - minimal
+ - low
+ - medium
+ - high
+ - xhigh
+ description: |-
+ Constrains effort on reasoning for
+ [reasoning models](https://platform.openai.com/docs/guides/reasoning).
+ Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used
+ on reasoning in a response.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
+ - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
+ OpenAI.ReasoningTextContent:
type: object
required:
- type
- - call_id
- - name
- - input
- - status
+ - text
properties:
type:
type: string
enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
+ - reasoning_text
+ description: The type of the reasoning text. Always `reasoning_text`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
- type: string
- description: The name of the custom tool being called.
- input:
- type: string
- description: The input for the custom tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
+ default: reasoning_text
+ text:
type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- title: ResponseCustomToolCallItem
- OpenAI.OutputItemFileSearchToolCall:
+ description: The reasoning text from the model.
+ description: Reasoning text from the model.
+ title: Reasoning text
+ OpenAI.Response:
type: object
required:
- id
- - type
- - status
- - queries
+ - object
+ - created_at
+ - error
+ - incomplete_details
+ - output
+ - instructions
+ - parallel_tool_calls
+ - agent_reference
properties:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ top_logprobs:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ user:
+ type: string
+ description: |-
+ 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](/docs/guides/safety-best-practices#safety-identifiers).
+ deprecated: true
+ safety_identifier:
+ type: string
+ maxLength: 64
+ description: |-
+ 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
+ prompt_cache_key:
+ type: string
+ description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
+ service_tier:
+ $ref: '#/components/schemas/OpenAI.ServiceTier'
+ prompt_cache_retention:
+ anyOf:
+ - type: string
+ enum:
+ - in_memory
+ - 24h
+ - type: 'null'
+ previous_response_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ model:
+ type: string
+ description: The model deployment to use for the creation of this response.
+ background:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ max_tool_calls:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ text:
+ $ref: '#/components/schemas/OpenAI.ResponseTextParam'
+ tools:
+ $ref: '#/components/schemas/OpenAI.ToolsArray'
+ tool_choice:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ prompt:
+ $ref: '#/components/schemas/OpenAI.Prompt'
+ truncation:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - disabled
+ - type: 'null'
+ default: disabled
id:
type: string
- description: The unique ID of the file search tool call.
- type:
+ description: Unique identifier for this Response.
+ object:
type: string
enum:
- - file_search_call
- description: The type of the file search tool call. Always `file_search_call`.
+ - response
+ description: The object type of this resource - always set to `response`.
x-stainless-const: true
status:
type: string
enum:
- - in_progress
- - searching
- completed
- - incomplete
- failed
+ - in_progress
+ - cancelled
+ - queued
+ - incomplete
description: |-
- The status of the file search tool call. One of `in_progress`,
- `searching`, `incomplete` or `failed`,
- queries:
+ The status of the response generation. One of `completed`, `failed`,
+ `in_progress`, `cancelled`, `queued`, or `incomplete`.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) of when this Response was created.
+ completed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseError'
+ - type: 'null'
+ incomplete_details:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails'
+ - type: 'null'
+ output:
type: array
items:
- type: string
- description: The queries used to search for files.
- results:
+ $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: |-
+ An array of content items generated by the model.
+ - The length and order of items in the `output` array is dependent
+ on the model's response.
+ - Rather than accessing the first item in the `output` array and
+ assuming it's an `assistant` message with the content generated by
+ the model, you might consider using the `output_text` property where
+ supported in SDKs.
+ reasoning:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Reasoning'
+ - type: 'null'
+ instructions:
anyOf:
+ - type: string
- type: array
items:
- $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ $ref: '#/components/schemas/OpenAI.InputItem'
+ - type: 'null'
+ output_text:
+ anyOf:
+ - type: string
+ - type: 'null'
+ usage:
+ $ref: '#/components/schemas/OpenAI.ResponseUsage'
+ moderation:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Moderation'
+ - type: 'null'
+ parallel_tool_calls:
+ type: boolean
+ description: Whether to allow the model to run tool calls in parallel.
+ default: true
+ conversation:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationReference'
+ - type: 'null'
+ max_output_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ agent_reference:
+ anyOf:
+ - $ref: '#/components/schemas/AgentReference'
- type: 'null'
+ description: The agent used for this response
+ content_filters:
+ type: array
+ items:
+ $ref: '#/components/schemas/ContentFilterResult'
+ description: The content filter evaluation results.
+ title: The response object
+ OpenAI.ResponseAudioDeltaEvent:
+ type: object
+ required:
+ - type
+ - sequence_number
+ - delta
+ properties:
+ type:
+ type: string
+ enum:
+ - response.audio.delta
+ description: The type of the event. Always `response.audio.delta`.
+ x-stainless-const: true
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: A sequence number for this chunk of the stream response.
+ delta:
+ type: string
+ contentEncoding: base64
+ description: A chunk of Base64 encoded response audio bytes.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- The results of a file search tool call. See the
- [file search guide](/docs/guides/tools-file-search) for more information.
- title: File search tool call
- OpenAI.OutputItemFunctionShellCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when there is a partial audio response.
+ x-oaiMeta:
+ name: response.audio.delta
+ group: responses
+ example: |
+ {
+ "type": "response.audio.delta",
+ "response_id": "resp_123",
+ "delta": "base64encoded...",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseAudioDoneEvent:
+ type: object
+ required:
+ - type
+ - sequence_number
+ properties:
+ type:
+ type: string
+ enum:
+ - response.audio.done
+ description: The type of the event. Always `response.audio.done`.
+ x-stainless-const: true
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the delta.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the audio response is complete.
+ x-oaiMeta:
+ name: response.audio.done
+ group: responses
+ example: |
+ {
+ "type": "response.audio.done",
+ "response_id": "resp-123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseAudioTranscriptDeltaEvent:
type: object
required:
- type
- - id
- - call_id
- - action
- - status
- - environment
+ - delta
+ - sequence_number
properties:
type:
type: string
enum:
- - shell_call
- description: The type of the item. Always `shell_call`.
+ - response.audio.transcript.delta
+ description: The type of the event. Always `response.audio.transcript.delta`.
x-stainless-const: true
- default: shell_call
- id:
- type: string
- description: The unique ID of the shell tool call. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.FunctionShellAction'
- description: The shell commands and limits that describe how to run the tool call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
- description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
- environment:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
- - type: 'null'
- created_by:
+ delta:
type: string
- description: The ID of the entity that created this tool call.
+ description: The partial transcript of the audio response.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A tool call that executes one or more shell commands in a managed environment.
- title: Shell tool call
- OpenAI.OutputItemFunctionShellCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when there is a partial transcript of audio.
+ x-oaiMeta:
+ name: response.audio.transcript.delta
+ group: responses
+ example: |
+ {
+ "type": "response.audio.transcript.delta",
+ "response_id": "resp_123",
+ "delta": " ... partial transcript ... ",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseAudioTranscriptDoneEvent:
type: object
required:
- type
- - id
- - call_id
- - status
- - output
- - max_output_length
+ - sequence_number
properties:
type:
type: string
enum:
- - shell_call_output
- description: The type of the shell call output. Always `shell_call_output`.
+ - response.audio.transcript.done
+ description: The type of the event. Always `response.audio.transcript.done`.
x-stainless-const: true
- default: shell_call_output
- id:
- type: string
- description: The unique ID of the shell call output. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
- description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
- description: An array of shell call output contents
- max_output_length:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- created_by:
- type: string
- description: The identifier of the actor that created the item.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a shell tool call that was emitted.
- title: Shell call output
- OpenAI.OutputItemFunctionToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the full audio transcript is completed.
+ x-oaiMeta:
+ name: response.audio.transcript.done
+ group: responses
+ example: |
+ {
+ "type": "response.audio.transcript.done",
+ "response_id": "resp_123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent:
type: object
required:
- - id
- type
- - call_id
- - name
- - arguments
+ - output_index
+ - item_id
+ - delta
+ - sequence_number
properties:
- id:
- type: string
- description: The unique ID of the function tool call.
- readOnly: true
type:
type: string
enum:
- - function_call
- description: The type of the function tool call. Always `function_call`.
+ - response.code_interpreter_call_code.delta
+ description: The type of the event. Always `response.code_interpreter_call_code.delta`.
x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- namespace:
- type: string
- description: The namespace of the function to run.
- name:
- type: string
- description: The name of the function to run.
- arguments:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response for which the code is being streamed.
+ item_id:
type: string
- description: A JSON string of the arguments to pass to the function.
- status:
+ description: The unique identifier of the code interpreter tool call item.
+ delta:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ description: The partial code snippet being streamed by the code interpreter.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- A tool call to run a function. See the
- [function calling guide](/docs/guides/function-calling) for more information.
- title: Function tool call
- OpenAI.OutputItemFunctionToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a partial code snippet is streamed by the code interpreter.
+ x-oaiMeta:
+ name: response.code_interpreter_call_code.delta
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call_code.delta",
+ "output_index": 0,
+ "item_id": "ci_12345",
+ "delta": "print('Hello, world')",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallCodeDoneEvent:
type: object
required:
- - id
- type
- - call_id
- - output
+ - output_index
+ - item_id
+ - code
+ - sequence_number
properties:
- id:
- type: string
- description: |-
- The unique ID of the function tool call output. Populated when this item
- is returned via API.
- readOnly: true
type:
type: string
enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
+ - response.code_interpreter_call_code.done
+ description: The type of the event. Always `response.code_interpreter_call_code.done`.
x-stainless-const: true
- call_id:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response for which the code is finalized.
+ item_id:
type: string
- description: The unique ID of the function tool call generated by the model.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the function call generated by your code.
- Can be a string or an list of output content.
- status:
+ description: The unique identifier of the code interpreter tool call item.
+ code:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ description: The final code snippet output by the code interpreter.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.OutputItemImageGenToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the code snippet is finalized by the code interpreter.
+ x-oaiMeta:
+ name: response.code_interpreter_call_code.done
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call_code.done",
+ "output_index": 3,
+ "item_id": "ci_12345",
+ "code": "print('done')",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallCompletedEvent:
type: object
required:
- type
- - id
- - status
- - result
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - image_generation_call
- description: The type of the image generation call. Always `image_generation_call`.
+ - response.code_interpreter_call.completed
+ description: The type of the event. Always `response.code_interpreter_call.completed`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the image generation call.
- status:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response for which the code interpreter call is completed.
+ item_id:
type: string
- enum:
- - in_progress
- - completed
- - generating
- - failed
- description: The status of the image generation call.
- result:
- anyOf:
- - type: string
- - type: 'null'
+ description: The unique identifier of the code interpreter tool call item.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An image generation request made by the model.
- title: Image generation call
- OpenAI.OutputItemLocalShellToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the code interpreter call is completed.
+ x-oaiMeta:
+ name: response.code_interpreter_call.completed
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call.completed",
+ "output_index": 5,
+ "item_id": "ci_12345",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallInProgressEvent:
type: object
required:
- type
- - id
- - call_id
- - action
- - status
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - local_shell_call
- description: The type of the local shell call. Always `local_shell_call`.
+ - response.code_interpreter_call.in_progress
+ description: The type of the event. Always `response.code_interpreter_call.in_progress`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell call.
- call_id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
- status:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response for which the code interpreter call is in progress.
+ item_id:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: The status of the local shell call.
+ description: The unique identifier of the code interpreter tool call item.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A tool call to run a command on the local shell.
- title: Local shell call
- OpenAI.OutputItemLocalShellToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a code interpreter call is in progress.
+ x-oaiMeta:
+ name: response.code_interpreter_call.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call.in_progress",
+ "output_index": 0,
+ "item_id": "ci_12345",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallInterpretingEvent:
type: object
required:
- type
- - id
- - output
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - local_shell_call_output
- description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ - response.code_interpreter_call.interpreting
+ description: The type of the event. Always `response.code_interpreter_call.interpreting`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- output:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response for which the code interpreter is interpreting code.
+ item_id:
type: string
- description: A JSON string of the output of the local shell tool call.
- status:
- anyOf:
- - type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - type: 'null'
+ description: The unique identifier of the code interpreter tool call item.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a local shell tool call.
- title: Local shell call output
- OpenAI.OutputItemMcpApprovalRequest:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the code interpreter is actively interpreting the code snippet.
+ x-oaiMeta:
+ name: response.code_interpreter_call.interpreting
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call.interpreting",
+ "output_index": 4,
+ "item_id": "ci_12345",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCompletedEvent:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
+ - response
+ - sequence_number
properties:
type:
type: string
enum:
- - mcp_approval_request
- description: The type of the item. Always `mcp_approval_request`.
+ - response.completed
+ description: The type of the event. Always `response.completed`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval request.
- server_label:
- type: string
- description: The label of the MCP server making the request.
- name:
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: Properties of the completed response.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number for this event.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the model response is complete.
+ x-oaiMeta:
+ name: response.completed
+ group: responses
+ example: |
+ {
+ "type": "response.completed",
+ "response": {
+ "id": "resp_123",
+ "object": "response",
+ "created_at": 1740855869,
+ "status": "completed",
+ "completed_at": 1740855870,
+ "error": null,
+ "incomplete_details": null,
+ "input": [],
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-mini-2024-07-18",
+ "output": [
+ {
+ "id": "msg_123",
+ "type": "message",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "previous_response_id": null,
+ "reasoning_effort": null,
+ "store": false,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 0,
+ "output_tokens": 0,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 0
+ },
+ "user": null,
+ "metadata": {}
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseContentPartAddedEvent:
+ type: object
+ required:
+ - type
+ - item_id
+ - output_index
+ - content_index
+ - part
+ - sequence_number
+ properties:
+ type:
type: string
- description: The name of the tool to run.
- arguments:
+ enum:
+ - response.content_part.added
+ description: The type of the event. Always `response.content_part.added`.
+ x-stainless-const: true
+ item_id:
type: string
- description: A JSON string of arguments for the tool.
+ description: The ID of the output item that the content part was added to.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the content part was added to.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the content part that was added.
+ part:
+ $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: The content part that was added.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A request for human approval of a tool invocation.
- title: MCP approval request
- OpenAI.OutputItemMcpApprovalResponseResource:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a new content part is added.
+ x-oaiMeta:
+ name: response.content_part.added
+ group: responses
+ example: |
+ {
+ "type": "response.content_part.added",
+ "item_id": "msg_123",
+ "output_index": 0,
+ "content_index": 0,
+ "part": {
+ "type": "output_text",
+ "text": "",
+ "annotations": []
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseContentPartDoneEvent:
type: object
required:
- type
- - id
- - approval_request_id
- - approve
+ - item_id
+ - output_index
+ - content_index
+ - sequence_number
+ - part
properties:
type:
type: string
enum:
- - mcp_approval_response
- description: The type of the item. Always `mcp_approval_response`.
+ - response.content_part.done
+ description: The type of the event. Always `response.content_part.done`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval response
- approval_request_id:
+ item_id:
type: string
- description: The ID of the approval request being answered.
- approve:
- type: boolean
- description: Whether the request was approved.
- reason:
- anyOf:
- - type: string
- - type: 'null'
+ description: The ID of the output item that the content part was added to.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the content part was added to.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the content part that is done.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ part:
+ $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: The content part that is done.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A response to an MCP approval request.
- title: MCP approval response
- OpenAI.OutputItemMcpListTools:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a content part is done.
+ x-oaiMeta:
+ name: response.content_part.done
+ group: responses
+ example: |
+ {
+ "type": "response.content_part.done",
+ "item_id": "msg_123",
+ "output_index": 0,
+ "content_index": 0,
+ "sequence_number": 1,
+ "part": {
+ "type": "output_text",
+ "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
+ "annotations": []
+ }
+ }
+ OpenAI.ResponseCreatedEvent:
type: object
required:
- type
- - id
- - server_label
- - tools
+ - response
+ - sequence_number
properties:
type:
type: string
enum:
- - mcp_list_tools
- description: The type of the item. Always `mcp_list_tools`.
+ - response.created
+ description: The type of the event. Always `response.created`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the list.
- server_label:
- type: string
- description: The label of the MCP server.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
- description: The tools available on the server.
- error:
- $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The response that was created.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number for this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A list of tools available on an MCP server.
- title: MCP list tools
- OpenAI.OutputItemMcpToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: An event that is emitted when a response is created.
+ x-oaiMeta:
+ name: response.created
+ group: responses
+ example: |
+ {
+ "type": "response.created",
+ "response": {
+ "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
+ "object": "response",
+ "created_at": 1741487325,
+ "status": "in_progress",
+ "completed_at": null,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCustomToolCallInputDeltaEvent:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
+ - sequence_number
+ - output_index
+ - item_id
+ - delta
properties:
type:
type: string
enum:
- - mcp_call
- description: The type of the item. Always `mcp_call`.
+ - response.custom_tool_call_input.delta
+ description: The event type identifier.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the tool call.
- server_label:
- type: string
- description: The label of the MCP server running the tool.
- name:
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output this delta applies to.
+ item_id:
type: string
- description: The name of the tool that was run.
- arguments:
+ description: Unique identifier for the API item associated with this event.
+ delta:
type: string
- description: A JSON string of the arguments passed to the tool.
- output:
- anyOf:
- - type: string
- - type: 'null'
- error:
- type: object
- unevaluatedProperties: {}
- status:
- $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
- description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
- approval_request_id:
- anyOf:
- - type: string
- - type: 'null'
+ description: The incremental input data (delta) for the custom tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An invocation of a tool on an MCP server.
- title: MCP tool call
- OpenAI.OutputItemOutputMessage:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Event representing a delta (partial update) to the input of a custom tool call.
+ title: ResponseCustomToolCallInputDelta
+ x-oaiMeta:
+ name: response.custom_tool_call_input.delta
+ group: responses
+ example: |
+ {
+ "type": "response.custom_tool_call_input.delta",
+ "output_index": 0,
+ "item_id": "ctc_1234567890abcdef",
+ "delta": "partial input text"
+ }
+ OpenAI.ResponseCustomToolCallInputDoneEvent:
type: object
required:
- - id
- type
- - role
- - content
- - status
+ - sequence_number
+ - output_index
+ - item_id
+ - input
properties:
- id:
- type: string
- description: The unique ID of the output message.
type:
type: string
enum:
- - output_message
- description: The type of the output message. Always `message`.
+ - response.custom_tool_call_input.done
+ description: The event type identifier.
x-stainless-const: true
- role:
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output this event applies to.
+ item_id:
type: string
- enum:
- - assistant
- description: The role of the output message. Always `assistant`.
- x-stainless-const: true
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.OutputMessageContent'
- description: The content of the output message.
- phase:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
- - type: 'null'
- status:
+ description: Unique identifier for the API item associated with this event.
+ input:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
+ description: The complete input data for the custom tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An output message from the model.
- title: Output message
- OpenAI.OutputItemReasoningItem:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Event indicating that input for a custom tool call is complete.
+ title: ResponseCustomToolCallInputDone
+ x-oaiMeta:
+ name: response.custom_tool_call_input.done
+ group: responses
+ example: |
+ {
+ "type": "response.custom_tool_call_input.done",
+ "output_index": 0,
+ "item_id": "ctc_1234567890abcdef",
+ "input": "final complete input text"
+ }
+ OpenAI.ResponseError:
type: object
required:
- - type
- - id
- - summary
+ - code
+ - message
properties:
- type:
- type: string
- enum:
- - reasoning
- description: The type of the object. Always `reasoning`.
- x-stainless-const: true
- id:
- type: string
- description: The unique identifier of the reasoning content.
- encrypted_content:
- anyOf:
- - type: string
- - type: 'null'
- summary:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.SummaryTextContent'
- description: Reasoning summary content.
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
- description: Reasoning text content.
- status:
+ code:
+ $ref: '#/components/schemas/OpenAI.ResponseErrorCode'
+ message:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- A description of the chain of thought used by a reasoning model while generating
- a response. Be sure to include these items in your `input` to the Responses API
- for subsequent turns of a conversation if you are manually
- [managing context](/docs/guides/conversation-state).
- title: Reasoning
- OpenAI.OutputItemToolSearchCall:
+ description: A human-readable description of the error.
+ description: An error object returned when the model fails to generate a Response.
+ OpenAI.ResponseErrorCode:
+ type: string
+ enum:
+ - server_error
+ - rate_limit_exceeded
+ - invalid_prompt
+ - vector_store_timeout
+ - invalid_image
+ - invalid_image_format
+ - invalid_base64_image
+ - invalid_image_url
+ - image_too_large
+ - image_too_small
+ - image_parse_error
+ - image_content_policy_violation
+ - invalid_image_mode
+ - image_file_too_large
+ - unsupported_image_media_type
+ - empty_image_file
+ - failed_to_download_image
+ - image_file_not_found
+ description: The error code for the response.
+ OpenAI.ResponseErrorEvent:
type: object
required:
- type
- - id
- - call_id
- - execution
- - arguments
- - status
+ - code
+ - message
+ - param
+ - sequence_number
properties:
type:
type: string
enum:
- - tool_search_call
- description: The type of the item. Always `tool_search_call`.
+ - error
+ description: The type of the event. Always `error`.
x-stainless-const: true
- default: tool_search_call
- id:
- type: string
- description: The unique ID of the tool search call item.
- call_id:
+ code:
anyOf:
- type: string
- type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- arguments:
- description: Arguments used for the tool search call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: The status of the tool search call item that was recorded.
- created_by:
+ message:
type: string
- description: The identifier of the actor that created the item.
+ description: The error message.
+ param:
+ anyOf:
+ - type: string
+ - type: 'null'
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- OpenAI.OutputItemToolSearchOutput:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an error occurs.
+ x-oaiMeta:
+ name: error
+ group: responses
+ example: |
+ {
+ "type": "error",
+ "code": "ERR_SOMETHING",
+ "message": "Something went wrong",
+ "param": null,
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFailedEvent:
type: object
required:
- type
- - id
- - call_id
- - execution
- - tools
- - status
+ - sequence_number
+ - response
properties:
type:
type: string
enum:
- - tool_search_output
- description: The type of the item. Always `tool_search_output`.
+ - response.failed
+ description: The type of the event. Always `response.failed`.
x-stainless-const: true
- default: tool_search_output
- id:
- type: string
- description: The unique ID of the tool search output item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by tool search.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: The status of the tool search output item that was recorded.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The response that failed.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- OpenAI.OutputItemType:
- anyOf:
- - type: string
- - type: string
- enum:
- - output_message
- - file_search_call
- - function_call
- - function_call_output
- - web_search_call
- - computer_call
- - computer_call_output
- - reasoning
- - tool_search_call
- - tool_search_output
- - additional_tools
- - compaction
- - image_generation_call
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_call
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - custom_tool_call
- - custom_tool_call_output
- - structured_outputs
- - oauth_consent_request
- - memory_search_call
- - memory_command_preview_call
- - memory_command_preview_call_output
- - workflow_action
- - a2a_preview_call
- - a2a_preview_call_output
- - bing_grounding_call
- - bing_grounding_call_output
- - sharepoint_grounding_preview_call
- - sharepoint_grounding_preview_call_output
- - azure_ai_search_call
- - azure_ai_search_call_output
- - bing_custom_search_preview_call
- - bing_custom_search_preview_call_output
- - openapi_call
- - openapi_call_output
- - browser_automation_preview_call
- - browser_automation_preview_call_output
- - fabric_dataagent_preview_call
- - fabric_dataagent_preview_call_output
- - azure_function_call
- - azure_function_call_output
- OpenAI.OutputItemWebSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: An event that is emitted when a response fails.
+ x-oaiMeta:
+ name: response.failed
+ group: responses
+ example: |
+ {
+ "type": "response.failed",
+ "response": {
+ "id": "resp_123",
+ "object": "response",
+ "created_at": 1740855869,
+ "status": "failed",
+ "completed_at": null,
+ "error": {
+ "code": "server_error",
+ "message": "The model failed to generate a response."
+ },
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-mini-2024-07-18",
+ "output": [],
+ "previous_response_id": null,
+ "reasoning_effort": null,
+ "store": false,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ }
+ }
+ OpenAI.ResponseFileSearchCallCompletedEvent:
type: object
required:
- - id
- type
- - status
- - action
+ - output_index
+ - item_id
+ - sequence_number
properties:
- id:
- type: string
- description: The unique ID of the web search tool call.
type:
type: string
enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
+ - response.file_search_call.completed
+ description: The type of the event. Always `response.file_search_call.completed`.
x-stainless-const: true
- status:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the file search call is initiated.
+ item_id:
type: string
- enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
- description: |-
- 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_in_page).
+ description: The ID of the output item that the file search call is initiated.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.OutputMessageContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a file search call is completed (results found).
+ x-oaiMeta:
+ name: response.file_search_call.completed
+ group: responses
+ example: |
+ {
+ "type": "response.file_search_call.completed",
+ "output_index": 0,
+ "item_id": "fs_123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFileSearchCallInProgressEvent:
type: object
required:
- type
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
- $ref: '#/components/schemas/OpenAI.OutputMessageContentType'
- discriminator:
- propertyName: type
- mapping:
- output_text: '#/components/schemas/OpenAI.OutputMessageContentOutputTextContent'
- refusal: '#/components/schemas/OpenAI.OutputMessageContentRefusalContent'
- OpenAI.OutputMessageContentOutputTextContent:
+ type: string
+ enum:
+ - response.file_search_call.in_progress
+ description: The type of the event. Always `response.file_search_call.in_progress`.
+ x-stainless-const: true
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the file search call is initiated.
+ item_id:
+ type: string
+ description: The ID of the output item that the file search call is initiated.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a file search call is initiated.
+ x-oaiMeta:
+ name: response.file_search_call.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.file_search_call.in_progress",
+ "output_index": 0,
+ "item_id": "fs_123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFileSearchCallSearchingEvent:
type: object
required:
- type
- - text
- - annotations
- - logprobs
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - output_text
- description: The type of the output text. Always `output_text`.
+ - response.file_search_call.searching
+ description: The type of the event. Always `response.file_search_call.searching`.
x-stainless-const: true
- default: output_text
- text:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the file search call is searching.
+ item_id:
type: string
- description: The text output from the model.
- annotations:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Annotation'
- description: The annotations of the text output.
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.LogProb'
+ description: The ID of the output item that the file search call is initiated.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputMessageContent'
- description: A text output from the model.
- title: Output text
- OpenAI.OutputMessageContentRefusalContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a file search is currently searching.
+ x-oaiMeta:
+ name: response.file_search_call.searching
+ group: responses
+ example: |
+ {
+ "type": "response.file_search_call.searching",
+ "output_index": 0,
+ "item_id": "fs_123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFormatJsonObject:
type: object
required:
- type
- - refusal
properties:
type:
type: string
enum:
- - refusal
- description: The type of the refusal. Always `refusal`.
+ - json_object
+ description: The type of response format being defined. Always `json_object`.
x-stainless-const: true
- default: refusal
- refusal:
+ description: |-
+ JSON object response format. An older method of generating JSON responses.
+ Using `json_schema` is recommended for models that support it. Note that the
+ model will not generate JSON without a system or user message instructing it
+ to do so.
+ title: JSON object
+ OpenAI.ResponseFormatJsonSchema:
+ type: object
+ required:
+ - type
+ - json_schema
+ properties:
+ type:
type: string
- description: The refusal explanation from the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputMessageContent'
- description: A refusal from the model.
- title: Refusal
- OpenAI.OutputMessageContentType:
- anyOf:
- - type: string
- - type: string
enum:
- - output_text
- - refusal
- OpenAI.Prompt:
+ - json_schema
+ description: The type of response format being defined. Always `json_schema`.
+ x-stainless-const: true
+ json_schema:
+ $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema'
+ description: Structured Outputs configuration options, including a JSON Schema.
+ title: JSON schema
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
+ description: |-
+ JSON Schema response format. Used to generate structured JSON responses.
+ Learn more about [Structured Outputs](/docs/guides/structured-outputs).
+ title: JSON schema
+ OpenAI.ResponseFormatJsonSchemaJsonSchema:
type: object
required:
- - id
+ - name
properties:
- id:
+ description:
type: string
- description: The unique identifier of the prompt template to use.
- version:
- anyOf:
- - type: string
- - type: 'null'
- variables:
+ name:
+ type: string
+ schema:
+ $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema'
+ strict:
anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponsePromptVariables'
+ - type: boolean
- type: 'null'
+ OpenAI.ResponseFormatJsonSchemaSchema:
+ type: object
+ unevaluatedProperties: {}
description: |-
- Reference to a prompt template and its variables.
- [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts).
- OpenAI.PromptCacheRetentionEnum:
- type: string
- enum:
- - in_memory
- - 24h
- OpenAI.RankerVersionType:
- type: string
- enum:
- - auto
- - default-2024-11-15
- OpenAI.RankingOptions:
+ The schema for the response format, described as a JSON Schema object.
+ Learn how to build JSON schemas [here](https://json-schema.org/).
+ title: JSON schema
+ OpenAI.ResponseFormatText:
type: object
+ required:
+ - type
properties:
- ranker:
- $ref: '#/components/schemas/OpenAI.RankerVersionType'
- description: The ranker to use for the file search.
- score_threshold:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: 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.
- hybrid_search:
- $ref: '#/components/schemas/OpenAI.HybridSearchOptions'
- description: Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
- OpenAI.RealtimeMCPError:
+ type:
+ type: string
+ enum:
+ - text
+ description: The type of response format being defined. Always `text`.
+ x-stainless-const: true
+ description: Default response format. Used to generate text responses.
+ title: Text
+ OpenAI.ResponseFunctionCallArgumentsDeltaEvent:
type: object
required:
- type
+ - item_id
+ - output_index
+ - sequence_number
+ - delta
properties:
type:
- $ref: '#/components/schemas/OpenAI.RealtimeMcpErrorType'
- discriminator:
- propertyName: type
- mapping:
- protocol_error: '#/components/schemas/OpenAI.RealtimeMCPProtocolError'
- tool_execution_error: '#/components/schemas/OpenAI.RealtimeMCPToolExecutionError'
- http_error: '#/components/schemas/OpenAI.RealtimeMCPHTTPError'
- OpenAI.RealtimeMCPHTTPError:
+ type: string
+ enum:
+ - response.function_call_arguments.delta
+ description: The type of the event. Always `response.function_call_arguments.delta`.
+ x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the output item that the function-call arguments delta is added to.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the function-call arguments delta is added to.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ delta:
+ type: string
+ description: The function-call arguments delta that is added.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when there is a partial function-call arguments delta.
+ x-oaiMeta:
+ name: response.function_call_arguments.delta
+ group: responses
+ example: |
+ {
+ "type": "response.function_call_arguments.delta",
+ "item_id": "item-abc",
+ "output_index": 0,
+ "delta": "{ "arg":"
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFunctionCallArgumentsDoneEvent:
type: object
required:
- type
- - code
- - message
+ - item_id
+ - name
+ - output_index
+ - sequence_number
+ - arguments
properties:
type:
type: string
enum:
- - http_error
+ - response.function_call_arguments.done
x-stainless-const: true
- code:
+ item_id:
+ type: string
+ description: The ID of the item.
+ name:
+ type: string
+ description: The name of the function that was called.
+ output_index:
$ref: '#/components/schemas/OpenAI.integer'
- message:
+ description: The index of the output item.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ arguments:
type: string
+ description: The function-call arguments.
allOf:
- - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
- title: Realtime MCP HTTP error
- OpenAI.RealtimeMCPProtocolError:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when function-call arguments are finalized.
+ x-oaiMeta:
+ name: response.function_call_arguments.done
+ group: responses
+ example: |
+ {
+ "type": "response.function_call_arguments.done",
+ "item_id": "item-abc",
+ "name": "get_weather",
+ "output_index": 1,
+ "arguments": "{ "arg": 123 }",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseImageGenCallCompletedEvent:
type: object
required:
- type
- - code
- - message
+ - output_index
+ - sequence_number
+ - item_id
properties:
type:
type: string
enum:
- - protocol_error
+ - response.image_generation_call.completed
+ description: The type of the event. Always 'response.image_generation_call.completed'.
x-stainless-const: true
- code:
+ output_index:
$ref: '#/components/schemas/OpenAI.integer'
- message:
+ description: The index of the output item in the response's output array.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ item_id:
type: string
+ description: The unique identifier of the image generation item being processed.
allOf:
- - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
- title: Realtime MCP protocol error
- OpenAI.RealtimeMCPToolExecutionError:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an image generation tool call has completed and the final image is available.
+ title: ResponseImageGenCallCompletedEvent
+ x-oaiMeta:
+ name: response.image_generation_call.completed
+ group: responses
+ example: |
+ {
+ "type": "response.image_generation_call.completed",
+ "output_index": 0,
+ "item_id": "item-123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseImageGenCallGeneratingEvent:
type: object
required:
- type
- - message
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - tool_execution_error
+ - response.image_generation_call.generating
+ description: The type of the event. Always 'response.image_generation_call.generating'.
x-stainless-const: true
- message:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
type: string
+ description: The unique identifier of the image generation item being processed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the image generation item being processed.
allOf:
- - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
- title: Realtime MCP tool execution error
- OpenAI.RealtimeMcpErrorType:
- anyOf:
- - type: string
- - type: string
- enum:
- - protocol_error
- - tool_execution_error
- - http_error
- OpenAI.Reasoning:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an image generation tool call is actively generating an image (intermediate state).
+ title: ResponseImageGenCallGeneratingEvent
+ x-oaiMeta:
+ name: response.image_generation_call.generating
+ group: responses
+ example: |
+ {
+ "type": "response.image_generation_call.generating",
+ "output_index": 0,
+ "item_id": "item-123",
+ "sequence_number": 0
+ }
+ OpenAI.ResponseImageGenCallInProgressEvent:
type: object
+ required:
+ - type
+ - output_index
+ - item_id
+ - sequence_number
properties:
- effort:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
- - type: 'null'
- summary:
- anyOf:
- - type: string
- enum:
- - auto
- - concise
- - detailed
- - type: 'null'
- context:
- anyOf:
- - type: string
- enum:
- - auto
- - current_turn
- - all_turns
- - type: 'null'
- generate_summary:
- anyOf:
- - type: string
- enum:
- - auto
- - concise
- - detailed
- - type: 'null'
- description: |-
- **gpt-5 and o-series models only**
- Configuration options for
- [reasoning models](https://platform.openai.com/docs/guides/reasoning).
- title: Reasoning
- OpenAI.ReasoningEffort:
- anyOf:
- - type: string
- - type: string
+ type:
+ type: string
enum:
- - none
- - minimal
- - low
- - medium
- - high
- - xhigh
- description: |-
- Constrains effort on reasoning for
- [reasoning models](https://platform.openai.com/docs/guides/reasoning).
- Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing
- reasoning effort can result in faster responses and fewer tokens used
- on reasoning in a response.
- - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
- - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
- - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
- - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
- OpenAI.ReasoningTextContent:
+ - response.image_generation_call.in_progress
+ description: The type of the event. Always 'response.image_generation_call.in_progress'.
+ x-stainless-const: true
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
+ type: string
+ description: The unique identifier of the image generation item being processed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the image generation item being processed.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an image generation tool call is in progress.
+ title: ResponseImageGenCallInProgressEvent
+ x-oaiMeta:
+ name: response.image_generation_call.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.image_generation_call.in_progress",
+ "output_index": 0,
+ "item_id": "item-123",
+ "sequence_number": 0
+ }
+ OpenAI.ResponseImageGenCallPartialImageEvent:
type: object
required:
- type
- - text
+ - output_index
+ - item_id
+ - sequence_number
+ - partial_image_index
+ - partial_image_b64
properties:
type:
type: string
enum:
- - reasoning_text
- description: The type of the reasoning text. Always `reasoning_text`.
+ - response.image_generation_call.partial_image
+ description: The type of the event. Always 'response.image_generation_call.partial_image'.
x-stainless-const: true
- default: reasoning_text
- text:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
type: string
- description: The reasoning text from the model.
- description: Reasoning text from the model.
- title: Reasoning text
- OpenAI.Response:
+ description: The unique identifier of the image generation item being processed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the image generation item being processed.
+ partial_image_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: 0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
+ partial_image_b64:
+ type: string
+ description: Base64-encoded partial image data, suitable for rendering as an image.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a partial image is available during image generation streaming.
+ title: ResponseImageGenCallPartialImageEvent
+ x-oaiMeta:
+ name: response.image_generation_call.partial_image
+ group: responses
+ example: |
+ {
+ "type": "response.image_generation_call.partial_image",
+ "output_index": 0,
+ "item_id": "item-123",
+ "sequence_number": 0,
+ "partial_image_index": 0,
+ "partial_image_b64": "..."
+ }
+ OpenAI.ResponseInProgressEvent:
type: object
required:
- - id
- - object
- - created_at
- - error
- - incomplete_details
- - output
- - instructions
- - parallel_tool_calls
- - agent_reference
+ - type
+ - response
+ - sequence_number
properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- top_logprobs:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- user:
- type: string
- description: |-
- 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](/docs/guides/safety-best-practices#safety-identifiers).
- deprecated: true
- safety_identifier:
- type: string
- maxLength: 64
- description: |-
- 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
- prompt_cache_key:
- type: string
- description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
- service_tier:
- $ref: '#/components/schemas/OpenAI.ServiceTier'
- prompt_cache_retention:
- anyOf:
- - type: string
- enum:
- - in_memory
- - 24h
- - type: 'null'
- previous_response_id:
- anyOf:
- - type: string
- - type: 'null'
- model:
- type: string
- description: The model deployment to use for the creation of this response.
- background:
- anyOf:
- - type: boolean
- - type: 'null'
- max_tool_calls:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- text:
- $ref: '#/components/schemas/OpenAI.ResponseTextParam'
- tools:
- $ref: '#/components/schemas/OpenAI.ToolsArray'
- tool_choice:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- prompt:
- $ref: '#/components/schemas/OpenAI.Prompt'
- truncation:
- anyOf:
- - type: string
- enum:
- - auto
- - disabled
- - type: 'null'
- default: disabled
- id:
- type: string
- description: Unique identifier for this Response.
- object:
+ type:
type: string
enum:
- - response
- description: The object type of this resource - always set to `response`.
+ - response.in_progress
+ description: The type of the event. Always `response.in_progress`.
x-stainless-const: true
- status:
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The response that is in progress.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the response is in progress.
+ x-oaiMeta:
+ name: response.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.in_progress",
+ "response": {
+ "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
+ "object": "response",
+ "created_at": 1741487325,
+ "status": "in_progress",
+ "completed_at": null,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseIncompleteDetails:
+ type: object
+ properties:
+ reason:
type: string
enum:
- - completed
- - failed
- - in_progress
- - cancelled
- - queued
- - incomplete
- description: |-
- The status of the response generation. One of `completed`, `failed`,
- `in_progress`, `cancelled`, `queued`, or `incomplete`.
- created_at:
- type: integer
- format: unixtime
- description: Unix timestamp (in seconds) of when this Response was created.
- completed_at:
- anyOf:
- - type: string
- format: date-time
- - type: 'null'
- type: integer
- format: unixTimestamp
- error:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseError'
- - type: 'null'
- incomplete_details:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails'
- - type: 'null'
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- An array of content items generated by the model.
- - The length and order of items in the `output` array is dependent
- on the model's response.
- - Rather than accessing the first item in the `output` array and
- assuming it's an `assistant` message with the content generated by
- the model, you might consider using the `output_text` property where
- supported in SDKs.
- reasoning:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Reasoning'
- - type: 'null'
- instructions:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputItem'
- - type: 'null'
- output_text:
- anyOf:
- - type: string
- - type: 'null'
- usage:
- $ref: '#/components/schemas/OpenAI.ResponseUsage'
- moderation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Moderation'
- - type: 'null'
- parallel_tool_calls:
- type: boolean
- description: Whether to allow the model to run tool calls in parallel.
- default: true
- conversation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ConversationReference'
- - type: 'null'
- max_output_tokens:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- agent_reference:
- anyOf:
- - $ref: '#/components/schemas/AgentReference'
- - type: 'null'
- description: The agent used for this response
- content_filters:
- type: array
- items:
- $ref: '#/components/schemas/ContentFilterResult'
- description: The content filter evaluation results.
- title: The response object
- OpenAI.ResponseAudioDeltaEvent:
+ - max_output_tokens
+ - content_filter
+ OpenAI.ResponseIncompleteEvent:
type: object
required:
- type
+ - response
- sequence_number
- - delta
properties:
type:
type: string
enum:
- - response.audio.delta
- description: The type of the event. Always `response.audio.delta`.
+ - response.incomplete
+ description: The type of the event. Always `response.incomplete`.
x-stainless-const: true
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The response that was incomplete.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: A sequence number for this chunk of the stream response.
- delta:
- type: string
- contentEncoding: base64
- description: A chunk of Base64 encoded response audio bytes.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a partial audio response.
+ description: An event that is emitted when a response finishes as incomplete.
x-oaiMeta:
- name: response.audio.delta
+ name: response.incomplete
group: responses
example: |
{
- "type": "response.audio.delta",
- "response_id": "resp_123",
- "delta": "base64encoded...",
+ "type": "response.incomplete",
+ "response": {
+ "id": "resp_123",
+ "object": "response",
+ "created_at": 1740855869,
+ "status": "incomplete",
+ "completed_at": null,
+ "error": null,
+ "incomplete_details": {
+ "reason": "max_tokens"
+ },
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-mini-2024-07-18",
+ "output": [],
+ "previous_response_id": null,
+ "reasoning_effort": null,
+ "store": false,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ },
"sequence_number": 1
}
- OpenAI.ResponseAudioDoneEvent:
+ OpenAI.ResponseLogProb:
+ type: object
+ required:
+ - token
+ - logprob
+ properties:
+ token:
+ type: string
+ description: A possible text token.
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The log probability of this token.
+ top_logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ResponseLogProbTopLogprobs'
+ description: The log probabilities of up to 20 of the most likely tokens.
+ description: |-
+ A logprob is the logarithmic probability that the model assigns to producing
+ a particular token at a given position in the sequence. Less-negative (higher)
+ logprob values indicate greater model confidence in that token choice.
+ OpenAI.ResponseLogProbTopLogprobs:
+ type: object
+ properties:
+ token:
+ type: string
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.ResponseMCPCallArgumentsDeltaEvent:
type: object
required:
- type
+ - output_index
+ - item_id
+ - delta
- sequence_number
properties:
type:
type: string
enum:
- - response.audio.done
- description: The type of the event. Always `response.audio.done`.
+ - response.mcp_call_arguments.delta
+ description: The type of the event. Always 'response.mcp_call_arguments.delta'.
x-stainless-const: true
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
+ type: string
+ description: The unique identifier of the MCP tool call item being processed.
+ delta:
+ type: string
+ description: A JSON string containing the partial update to the arguments for the MCP tool call.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the delta.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the audio response is complete.
+ description: Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
+ title: ResponseMCPCallArgumentsDeltaEvent
x-oaiMeta:
- name: response.audio.done
+ name: response.mcp_call_arguments.delta
group: responses
example: |
{
- "type": "response.audio.done",
- "response_id": "resp-123",
+ "type": "response.mcp_call_arguments.delta",
+ "output_index": 0,
+ "item_id": "item-abc",
+ "delta": "{",
"sequence_number": 1
}
- OpenAI.ResponseAudioTranscriptDeltaEvent:
+ OpenAI.ResponseMCPCallArgumentsDoneEvent:
type: object
required:
- type
- - delta
+ - output_index
+ - item_id
+ - arguments
- sequence_number
properties:
type:
type: string
enum:
- - response.audio.transcript.delta
- description: The type of the event. Always `response.audio.transcript.delta`.
+ - response.mcp_call_arguments.done
+ description: The type of the event. Always 'response.mcp_call_arguments.done'.
x-stainless-const: true
- delta:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
type: string
- description: The partial transcript of the audio response.
+ description: The unique identifier of the MCP tool call item being processed.
+ arguments:
+ type: string
+ description: A JSON string containing the finalized arguments for the MCP tool call.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a partial transcript of audio.
+ description: Emitted when the arguments for an MCP tool call are finalized.
+ title: ResponseMCPCallArgumentsDoneEvent
x-oaiMeta:
- name: response.audio.transcript.delta
+ name: response.mcp_call_arguments.done
group: responses
example: |
{
- "type": "response.audio.transcript.delta",
- "response_id": "resp_123",
- "delta": " ... partial transcript ... ",
+ "type": "response.mcp_call_arguments.done",
+ "output_index": 0,
+ "item_id": "item-abc",
+ "arguments": "{"arg1": "value1", "arg2": "value2"}",
"sequence_number": 1
}
- OpenAI.ResponseAudioTranscriptDoneEvent:
+ OpenAI.ResponseMCPCallCompletedEvent:
type: object
required:
- type
+ - item_id
+ - output_index
- sequence_number
properties:
type:
type: string
enum:
- - response.audio.transcript.done
- description: The type of the event. Always `response.audio.transcript.done`.
+ - response.mcp_call.completed
+ description: The type of the event. Always 'response.mcp_call.completed'.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the MCP tool call item that completed.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that completed.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the full audio transcript is completed.
+ description: Emitted when an MCP tool call has completed successfully.
+ title: ResponseMCPCallCompletedEvent
x-oaiMeta:
- name: response.audio.transcript.done
+ name: response.mcp_call.completed
group: responses
example: |
{
- "type": "response.audio.transcript.done",
- "response_id": "resp_123",
- "sequence_number": 1
+ "type": "response.mcp_call.completed",
+ "sequence_number": 1,
+ "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90",
+ "output_index": 0
}
- OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent:
+ OpenAI.ResponseMCPCallFailedEvent:
type: object
required:
- type
- - output_index
- item_id
- - delta
+ - output_index
- sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call_code.delta
- description: The type of the event. Always `response.code_interpreter_call_code.delta`.
+ - response.mcp_call.failed
+ description: The type of the event. Always 'response.mcp_call.failed'.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code is being streamed.
item_id:
type: string
- description: The unique identifier of the code interpreter tool call item.
- delta:
- type: string
- description: The partial code snippet being streamed by the code interpreter.
+ description: The ID of the MCP tool call item that failed.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that failed.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a partial code snippet is streamed by the code interpreter.
+ description: Emitted when an MCP tool call has failed.
+ title: ResponseMCPCallFailedEvent
x-oaiMeta:
- name: response.code_interpreter_call_code.delta
- group: responses
- example: |
- {
- "type": "response.code_interpreter_call_code.delta",
- "output_index": 0,
- "item_id": "ci_12345",
- "delta": "print('Hello, world')",
- "sequence_number": 1
+ name: response.mcp_call.failed
+ group: responses
+ example: |
+ {
+ "type": "response.mcp_call.failed",
+ "sequence_number": 1,
+ "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90",
+ "output_index": 0
}
- OpenAI.ResponseCodeInterpreterCallCodeDoneEvent:
+ OpenAI.ResponseMCPCallInProgressEvent:
type: object
required:
- type
+ - sequence_number
- output_index
- item_id
- - code
- - sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call_code.done
- description: The type of the event. Always `response.code_interpreter_call_code.done`.
+ - response.mcp_call.in_progress
+ description: The type of the event. Always 'response.mcp_call.in_progress'.
x-stainless-const: true
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code is finalized.
+ description: The index of the output item in the response's output array.
item_id:
type: string
- description: The unique identifier of the code interpreter tool call item.
- code:
- type: string
- description: The final code snippet output by the code interpreter.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The unique identifier of the MCP tool call item being processed.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the code snippet is finalized by the code interpreter.
+ description: Emitted when an MCP tool call is in progress.
+ title: ResponseMCPCallInProgressEvent
x-oaiMeta:
- name: response.code_interpreter_call_code.done
+ name: response.mcp_call.in_progress
group: responses
example: |
{
- "type": "response.code_interpreter_call_code.done",
- "output_index": 3,
- "item_id": "ci_12345",
- "code": "print('done')",
- "sequence_number": 1
+ "type": "response.mcp_call.in_progress",
+ "sequence_number": 1,
+ "output_index": 0,
+ "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90"
}
- OpenAI.ResponseCodeInterpreterCallCompletedEvent:
+ OpenAI.ResponseMCPListToolsCompletedEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
- sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call.completed
- description: The type of the event. Always `response.code_interpreter_call.completed`.
+ - response.mcp_list_tools.completed
+ description: The type of the event. Always 'response.mcp_list_tools.completed'.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code interpreter call is completed.
item_id:
type: string
- description: The unique identifier of the code interpreter tool call item.
+ description: The ID of the MCP tool call item that produced this output.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that was processed.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the code interpreter call is completed.
+ description: Emitted when the list of available MCP tools has been successfully retrieved.
+ title: ResponseMCPListToolsCompletedEvent
x-oaiMeta:
- name: response.code_interpreter_call.completed
+ name: response.mcp_list_tools.completed
group: responses
example: |
{
- "type": "response.code_interpreter_call.completed",
- "output_index": 5,
- "item_id": "ci_12345",
- "sequence_number": 1
+ "type": "response.mcp_list_tools.completed",
+ "sequence_number": 1,
+ "output_index": 0,
+ "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
}
- OpenAI.ResponseCodeInterpreterCallInProgressEvent:
+ OpenAI.ResponseMCPListToolsFailedEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
- sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call.in_progress
- description: The type of the event. Always `response.code_interpreter_call.in_progress`.
+ - response.mcp_list_tools.failed
+ description: The type of the event. Always 'response.mcp_list_tools.failed'.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code interpreter call is in progress.
item_id:
type: string
- description: The unique identifier of the code interpreter tool call item.
+ description: The ID of the MCP tool call item that failed.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that failed.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a code interpreter call is in progress.
+ description: Emitted when the attempt to list available MCP tools has failed.
+ title: ResponseMCPListToolsFailedEvent
x-oaiMeta:
- name: response.code_interpreter_call.in_progress
+ name: response.mcp_list_tools.failed
group: responses
example: |
{
- "type": "response.code_interpreter_call.in_progress",
+ "type": "response.mcp_list_tools.failed",
+ "sequence_number": 1,
"output_index": 0,
- "item_id": "ci_12345",
- "sequence_number": 1
+ "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
}
- OpenAI.ResponseCodeInterpreterCallInterpretingEvent:
+ OpenAI.ResponseMCPListToolsInProgressEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
- sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call.interpreting
- description: The type of the event. Always `response.code_interpreter_call.interpreting`.
+ - response.mcp_list_tools.in_progress
+ description: The type of the event. Always 'response.mcp_list_tools.in_progress'.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code interpreter is interpreting code.
item_id:
type: string
- description: The unique identifier of the code interpreter tool call item.
+ description: The ID of the MCP tool call item that is being processed.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that is being processed.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the code interpreter is actively interpreting the code snippet.
+ description: Emitted when the system is in the process of retrieving the list of available MCP tools.
+ title: ResponseMCPListToolsInProgressEvent
x-oaiMeta:
- name: response.code_interpreter_call.interpreting
+ name: response.mcp_list_tools.in_progress
group: responses
example: |
{
- "type": "response.code_interpreter_call.interpreting",
- "output_index": 4,
- "item_id": "ci_12345",
- "sequence_number": 1
+ "type": "response.mcp_list_tools.in_progress",
+ "sequence_number": 1,
+ "output_index": 0,
+ "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
}
- OpenAI.ResponseCompletedEvent:
+ OpenAI.ResponseModalities:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ enum:
+ - text
+ - audio
+ - type: 'null'
+ description: |-
+ Output types that you would like the model to generate.
+ Most models are capable of generating text, which is the default:
+ `["text"]`
+ The `gpt-4o-audio-preview` model can also be used to
+ [generate audio](/docs/guides/audio). To request that this model generate
+ both text and audio responses, you can use:
+ `["text", "audio"]`
+ OpenAI.ResponseOutputItemAddedEvent:
type: object
required:
- type
- - response
+ - output_index
- sequence_number
+ - item
properties:
type:
type: string
enum:
- - response.completed
- description: The type of the event. Always `response.completed`.
+ - response.output_item.added
+ description: The type of the event. Always `response.output_item.added`.
x-stainless-const: true
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: Properties of the completed response.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that was added.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number for this event.
+ description: The sequence number of this event.
+ item:
+ $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output item that was added.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the model response is complete.
+ description: Emitted when a new output item is added.
x-oaiMeta:
- name: response.completed
+ name: response.output_item.added
group: responses
example: |
{
- "type": "response.completed",
- "response": {
- "id": "resp_123",
- "object": "response",
- "created_at": 1740855869,
- "status": "completed",
- "completed_at": 1740855870,
- "error": null,
- "incomplete_details": null,
- "input": [],
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-mini-2024-07-18",
- "output": [
- {
- "id": "msg_123",
- "type": "message",
- "role": "assistant",
- "content": [
- {
- "type": "output_text",
- "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
- "annotations": []
- }
- ]
- }
- ],
- "previous_response_id": null,
- "reasoning_effort": null,
- "store": false,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "output_tokens_details": {
- "reasoning_tokens": 0
- },
- "total_tokens": 0
- },
- "user": null,
- "metadata": {}
+ "type": "response.output_item.added",
+ "output_index": 0,
+ "item": {
+ "id": "msg_123",
+ "status": "in_progress",
+ "type": "message",
+ "role": "assistant",
+ "content": []
},
"sequence_number": 1
}
- OpenAI.ResponseContentPartAddedEvent:
+ OpenAI.ResponseOutputItemDoneEvent:
type: object
required:
- type
- - item_id
- output_index
- - content_index
- - part
- sequence_number
+ - item
properties:
type:
type: string
enum:
- - response.content_part.added
- description: The type of the event. Always `response.content_part.added`.
+ - response.output_item.done
+ description: The type of the event. Always `response.output_item.done`.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the output item that the content part was added to.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the content part was added to.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that was added.
- part:
- $ref: '#/components/schemas/OpenAI.OutputContent'
- description: The content part that was added.
+ description: The index of the output item that was marked done.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
+ item:
+ $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output item that was marked done.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a new content part is added.
+ description: Emitted when an output item is marked done.
x-oaiMeta:
- name: response.content_part.added
+ name: response.output_item.done
group: responses
example: |
{
- "type": "response.content_part.added",
- "item_id": "msg_123",
+ "type": "response.output_item.done",
"output_index": 0,
- "content_index": 0,
- "part": {
- "type": "output_text",
- "text": "",
- "annotations": []
+ "item": {
+ "id": "msg_123",
+ "status": "completed",
+ "type": "message",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
+ "annotations": []
+ }
+ ]
},
"sequence_number": 1
}
- OpenAI.ResponseContentPartDoneEvent:
+ OpenAI.ResponseOutputTextAnnotationAddedEvent:
type: object
required:
- type
- item_id
- output_index
- content_index
+ - annotation_index
- sequence_number
- - part
+ - annotation
properties:
type:
type: string
enum:
- - response.content_part.done
- description: The type of the event. Always `response.content_part.done`.
+ - response.output_text.annotation.added
+ description: The type of the event. Always 'response.output_text.annotation.added'.
x-stainless-const: true
item_id:
type: string
- description: The ID of the output item that the content part was added to.
+ description: The unique identifier of the item to which the annotation is being added.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the content part was added to.
+ description: The index of the output item in the response's output array.
content_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that is done.
+ description: The index of the content part within the output item.
+ annotation_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the annotation within the content part.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
- part:
- $ref: '#/components/schemas/OpenAI.OutputContent'
- description: The content part that is done.
+ annotation:
+ $ref: '#/components/schemas/OpenAI.Annotation'
+ description: The annotation object being added. (See annotation schema for details.)
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a content part is done.
+ description: Emitted when an annotation is added to output text content.
+ title: ResponseOutputTextAnnotationAddedEvent
x-oaiMeta:
- name: response.content_part.done
+ name: response.output_text.annotation.added
group: responses
example: |
{
- "type": "response.content_part.done",
- "item_id": "msg_123",
+ "type": "response.output_text.annotation.added",
+ "item_id": "item-abc",
"output_index": 0,
"content_index": 0,
- "sequence_number": 1,
- "part": {
- "type": "output_text",
- "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
- "annotations": []
- }
+ "annotation_index": 0,
+ "annotation": {
+ "type": "text_annotation",
+ "text": "This is a test annotation",
+ "start": 0,
+ "end": 10
+ },
+ "sequence_number": 1
}
- OpenAI.ResponseCreatedEvent:
+ OpenAI.ResponsePromptVariables:
+ type: object
+ unevaluatedProperties:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.InputTextContent'
+ - $ref: '#/components/schemas/OpenAI.InputImageContent'
+ - $ref: '#/components/schemas/OpenAI.InputFileContent'
+ description: |-
+ Optional map of values to substitute in for variables in your
+ prompt. The substitution values can either be strings, or other
+ Response input types like images or files.
+ title: Prompt Variables
+ x-oaiExpandable: true
+ x-oaiTypeLabel: map
+ OpenAI.ResponseQueuedEvent:
type: object
required:
- type
@@ -31387,622 +67165,732 @@ components:
type:
type: string
enum:
- - response.created
- description: The type of the event. Always `response.created`.
+ - response.queued
+ description: The type of the event. Always 'response.queued'.
x-stainless-const: true
response:
$ref: '#/components/schemas/OpenAI.Response'
- description: The response that was created.
+ description: The full response object that is queued.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number for this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: An event that is emitted when a response is created.
+ description: Emitted when a response is queued and waiting to be processed.
+ title: ResponseQueuedEvent
x-oaiMeta:
- name: response.created
+ name: response.queued
group: responses
example: |
{
- "type": "response.created",
+ "type": "response.queued",
"response": {
- "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
- "object": "response",
- "created_at": 1741487325,
- "status": "in_progress",
- "completed_at": null,
- "error": null,
- "incomplete_details": null,
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-2024-08-06",
- "output": [],
- "parallel_tool_calls": true,
- "previous_response_id": null,
- "reasoning": {
- "effort": null,
- "summary": null
- },
- "store": true,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": null,
- "user": null,
- "metadata": {}
+ "id": "res_123",
+ "status": "queued",
+ "created_at": "2021-01-01T00:00:00Z",
+ "updated_at": "2021-01-01T00:00:00Z"
},
"sequence_number": 1
}
- OpenAI.ResponseCustomToolCallInputDeltaEvent:
+ OpenAI.ResponseReasoningSummaryPartAddedEvent:
type: object
required:
- type
- - sequence_number
- - output_index
- item_id
- - delta
+ - output_index
+ - summary_index
+ - sequence_number
+ - part
properties:
type:
type: string
enum:
- - response.custom_tool_call_input.delta
- description: The event type identifier.
+ - response.reasoning_summary_part.added
+ description: The type of the event. Always `response.reasoning_summary_part.added`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the item this summary part is associated with.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item this summary part is associated with.
+ summary_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the summary part within the reasoning summary.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output this delta applies to.
- item_id:
- type: string
- description: Unique identifier for the API item associated with this event.
- delta:
- type: string
- description: The incremental input data (delta) for the custom tool call.
+ part:
+ $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart'
+ description: The summary part that was added.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Event representing a delta (partial update) to the input of a custom tool call.
- title: ResponseCustomToolCallInputDelta
+ description: Emitted when a new reasoning summary part is added.
x-oaiMeta:
- name: response.custom_tool_call_input.delta
+ name: response.reasoning_summary_part.added
group: responses
example: |
{
- "type": "response.custom_tool_call_input.delta",
+ "type": "response.reasoning_summary_part.added",
+ "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
"output_index": 0,
- "item_id": "ctc_1234567890abcdef",
- "delta": "partial input text"
+ "summary_index": 0,
+ "part": {
+ "type": "summary_text",
+ "text": ""
+ },
+ "sequence_number": 1
}
- OpenAI.ResponseCustomToolCallInputDoneEvent:
+ OpenAI.ResponseReasoningSummaryPartAddedEventPart:
type: object
required:
- type
- - sequence_number
- - output_index
- - item_id
- - input
+ - text
properties:
type:
type: string
enum:
- - response.custom_tool_call_input.done
- description: The event type identifier.
+ - summary_text
x-stainless-const: true
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output this event applies to.
- item_id:
- type: string
- description: Unique identifier for the API item associated with this event.
- input:
- type: string
- description: The complete input data for the custom tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Event indicating that input for a custom tool call is complete.
- title: ResponseCustomToolCallInputDone
- x-oaiMeta:
- name: response.custom_tool_call_input.done
- group: responses
- example: |
- {
- "type": "response.custom_tool_call_input.done",
- "output_index": 0,
- "item_id": "ctc_1234567890abcdef",
- "input": "final complete input text"
- }
- OpenAI.ResponseError:
- type: object
- required:
- - code
- - message
- properties:
- code:
- $ref: '#/components/schemas/OpenAI.ResponseErrorCode'
- message:
+ text:
type: string
- description: A human-readable description of the error.
- description: An error object returned when the model fails to generate a Response.
- OpenAI.ResponseErrorCode:
- type: string
- enum:
- - server_error
- - rate_limit_exceeded
- - invalid_prompt
- - vector_store_timeout
- - invalid_image
- - invalid_image_format
- - invalid_base64_image
- - invalid_image_url
- - image_too_large
- - image_too_small
- - image_parse_error
- - image_content_policy_violation
- - invalid_image_mode
- - image_file_too_large
- - unsupported_image_media_type
- - empty_image_file
- - failed_to_download_image
- - image_file_not_found
- description: The error code for the response.
- OpenAI.ResponseErrorEvent:
+ OpenAI.ResponseReasoningSummaryPartDoneEvent:
type: object
required:
- type
- - code
- - message
- - param
+ - item_id
+ - output_index
+ - summary_index
- sequence_number
+ - part
properties:
type:
type: string
enum:
- - error
- description: The type of the event. Always `error`.
+ - response.reasoning_summary_part.done
+ description: The type of the event. Always `response.reasoning_summary_part.done`.
x-stainless-const: true
- code:
- anyOf:
- - type: string
- - type: 'null'
- message:
+ item_id:
type: string
- description: The error message.
- param:
- anyOf:
- - type: string
- - type: 'null'
+ description: The ID of the item this summary part is associated with.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item this summary part is associated with.
+ summary_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the summary part within the reasoning summary.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
+ part:
+ $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEventPart'
+ description: The completed summary part.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an error occurs.
+ description: Emitted when a reasoning summary part is completed.
x-oaiMeta:
- name: error
+ name: response.reasoning_summary_part.done
group: responses
example: |
{
- "type": "error",
- "code": "ERR_SOMETHING",
- "message": "Something went wrong",
- "param": null,
+ "type": "response.reasoning_summary_part.done",
+ "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
+ "output_index": 0,
+ "summary_index": 0,
+ "part": {
+ "type": "summary_text",
+ "text": "**Responding to a greeting**
+
+ The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!"
+ },
"sequence_number": 1
}
- OpenAI.ResponseFailedEvent:
+ OpenAI.ResponseReasoningSummaryPartDoneEventPart:
type: object
required:
- type
- - sequence_number
- - response
+ - text
properties:
type:
type: string
enum:
- - response.failed
- description: The type of the event. Always `response.failed`.
+ - summary_text
x-stainless-const: true
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The response that failed.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: An event that is emitted when a response fails.
- x-oaiMeta:
- name: response.failed
- group: responses
- example: |
- {
- "type": "response.failed",
- "response": {
- "id": "resp_123",
- "object": "response",
- "created_at": 1740855869,
- "status": "failed",
- "completed_at": null,
- "error": {
- "code": "server_error",
- "message": "The model failed to generate a response."
- },
- "incomplete_details": null,
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-mini-2024-07-18",
- "output": [],
- "previous_response_id": null,
- "reasoning_effort": null,
- "store": false,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": null,
- "user": null,
- "metadata": {}
- }
- }
- OpenAI.ResponseFileSearchCallCompletedEvent:
+ text:
+ type: string
+ OpenAI.ResponseReasoningSummaryTextDeltaEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
+ - summary_index
+ - delta
- sequence_number
properties:
type:
type: string
enum:
- - response.file_search_call.completed
- description: The type of the event. Always `response.file_search_call.completed`.
+ - response.reasoning_summary_text.delta
+ description: The type of the event. Always `response.reasoning_summary_text.delta`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the item this summary text delta is associated with.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the file search call is initiated.
- item_id:
+ description: The index of the output item this summary text delta is associated with.
+ summary_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the summary part within the reasoning summary.
+ delta:
type: string
- description: The ID of the output item that the file search call is initiated.
+ description: The text delta that was added to the summary.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a file search call is completed (results found).
+ description: Emitted when a delta is added to a reasoning summary text.
x-oaiMeta:
- name: response.file_search_call.completed
+ name: response.reasoning_summary_text.delta
group: responses
example: |
{
- "type": "response.file_search_call.completed",
+ "type": "response.reasoning_summary_text.delta",
+ "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
"output_index": 0,
- "item_id": "fs_123",
+ "summary_index": 0,
+ "delta": "**Responding to a greeting**
+
+ The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
"sequence_number": 1
}
- OpenAI.ResponseFileSearchCallInProgressEvent:
+ OpenAI.ResponseReasoningSummaryTextDoneEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
+ - summary_index
+ - text
- sequence_number
properties:
type:
type: string
enum:
- - response.file_search_call.in_progress
- description: The type of the event. Always `response.file_search_call.in_progress`.
+ - response.reasoning_summary_text.done
+ description: The type of the event. Always `response.reasoning_summary_text.done`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the item this summary text is associated with.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the file search call is initiated.
- item_id:
+ description: The index of the output item this summary text is associated with.
+ summary_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the summary part within the reasoning summary.
+ text:
type: string
- description: The ID of the output item that the file search call is initiated.
+ description: The full text of the completed reasoning summary.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a file search call is initiated.
+ description: Emitted when a reasoning summary text is completed.
x-oaiMeta:
- name: response.file_search_call.in_progress
+ name: response.reasoning_summary_text.done
group: responses
example: |
{
- "type": "response.file_search_call.in_progress",
+ "type": "response.reasoning_summary_text.done",
+ "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
"output_index": 0,
- "item_id": "fs_123",
+ "summary_index": 0,
+ "text": "**Responding to a greeting**
+
+ The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
"sequence_number": 1
}
- OpenAI.ResponseFileSearchCallSearchingEvent:
+ OpenAI.ResponseReasoningTextDeltaEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
+ - content_index
+ - delta
- sequence_number
properties:
type:
type: string
enum:
- - response.file_search_call.searching
- description: The type of the event. Always `response.file_search_call.searching`.
+ - response.reasoning_text.delta
+ description: The type of the event. Always `response.reasoning_text.delta`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the item this reasoning text delta is associated with.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the file search call is searching.
- item_id:
+ description: The index of the output item this reasoning text delta is associated with.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the reasoning content part this delta is associated with.
+ delta:
type: string
- description: The ID of the output item that the file search call is initiated.
+ description: The text delta that was added to the reasoning content.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a file search is currently searching.
+ description: Emitted when a delta is added to a reasoning text.
x-oaiMeta:
- name: response.file_search_call.searching
+ name: response.reasoning_text.delta
group: responses
example: |
{
- "type": "response.file_search_call.searching",
+ "type": "response.reasoning_text.delta",
+ "item_id": "rs_123",
"output_index": 0,
- "item_id": "fs_123",
+ "content_index": 0,
+ "delta": "The",
"sequence_number": 1
}
- OpenAI.ResponseFormatJsonObject:
- type: object
- required:
- - type
- properties:
- type:
- type: string
- enum:
- - json_object
- description: The type of response format being defined. Always `json_object`.
- x-stainless-const: true
- description: |-
- JSON object response format. An older method of generating JSON responses.
- Using `json_schema` is recommended for models that support it. Note that the
- model will not generate JSON without a system or user message instructing it
- to do so.
- title: JSON object
- OpenAI.ResponseFormatJsonSchema:
+ OpenAI.ResponseReasoningTextDoneEvent:
type: object
required:
- type
- - json_schema
+ - item_id
+ - output_index
+ - content_index
+ - text
+ - sequence_number
properties:
type:
type: string
enum:
- - json_schema
- description: The type of response format being defined. Always `json_schema`.
+ - response.reasoning_text.done
+ description: The type of the event. Always `response.reasoning_text.done`.
x-stainless-const: true
- json_schema:
- $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema'
- description: Structured Outputs configuration options, including a JSON Schema.
- title: JSON schema
- allOf:
- - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
- description: |-
- JSON Schema response format. Used to generate structured JSON responses.
- Learn more about [Structured Outputs](/docs/guides/structured-outputs).
- title: JSON schema
- OpenAI.ResponseFormatJsonSchemaJsonSchema:
- type: object
- required:
- - name
- properties:
- description:
- type: string
- name:
+ item_id:
type: string
- schema:
- $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
- OpenAI.ResponseFormatJsonSchemaSchema:
- type: object
- unevaluatedProperties: {}
- description: |-
- The schema for the response format, described as a JSON Schema object.
- Learn how to build JSON schemas [here](https://json-schema.org/).
- title: JSON schema
- OpenAI.ResponseFormatText:
- type: object
- required:
- - type
- properties:
- type:
+ description: The ID of the item this reasoning text is associated with.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item this reasoning text is associated with.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the reasoning content part.
+ text:
type: string
- enum:
- - text
- description: The type of response format being defined. Always `text`.
- x-stainless-const: true
- description: Default response format. Used to generate text responses.
- title: Text
- OpenAI.ResponseFunctionCallArgumentsDeltaEvent:
+ description: The full text of the completed reasoning content.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a reasoning text is completed.
+ x-oaiMeta:
+ name: response.reasoning_text.done
+ group: responses
+ example: |
+ {
+ "type": "response.reasoning_text.done",
+ "item_id": "rs_123",
+ "output_index": 0,
+ "content_index": 0,
+ "text": "The user is asking...",
+ "sequence_number": 4
+ }
+ OpenAI.ResponseRefusalDeltaEvent:
type: object
required:
- type
- item_id
- output_index
- - sequence_number
+ - content_index
- delta
+ - sequence_number
properties:
type:
type: string
enum:
- - response.function_call_arguments.delta
- description: The type of the event. Always `response.function_call_arguments.delta`.
+ - response.refusal.delta
+ description: The type of the event. Always `response.refusal.delta`.
x-stainless-const: true
item_id:
type: string
- description: The ID of the output item that the function-call arguments delta is added to.
+ description: The ID of the output item that the refusal text is added to.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the function-call arguments delta is added to.
- sequence_number:
+ description: The index of the output item that the refusal text is added to.
+ content_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: The index of the content part that the refusal text is added to.
delta:
type: string
- description: The function-call arguments delta that is added.
+ description: The refusal text that is added.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a partial function-call arguments delta.
+ description: Emitted when there is a partial refusal text.
x-oaiMeta:
- name: response.function_call_arguments.delta
+ name: response.refusal.delta
group: responses
example: |
{
- "type": "response.function_call_arguments.delta",
- "item_id": "item-abc",
+ "type": "response.refusal.delta",
+ "item_id": "msg_123",
"output_index": 0,
- "delta": "{ "arg":"
+ "content_index": 0,
+ "delta": "refusal text so far",
"sequence_number": 1
}
- OpenAI.ResponseFunctionCallArgumentsDoneEvent:
+ OpenAI.ResponseRefusalDoneEvent:
type: object
required:
- type
- item_id
- - name
- output_index
+ - content_index
+ - refusal
- sequence_number
- - arguments
properties:
type:
type: string
enum:
- - response.function_call_arguments.done
+ - response.refusal.done
+ description: The type of the event. Always `response.refusal.done`.
x-stainless-const: true
item_id:
type: string
- description: The ID of the item.
- name:
- type: string
- description: The name of the function that was called.
+ description: The ID of the output item that the refusal text is finalized.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item.
+ description: The index of the output item that the refusal text is finalized.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the content part that the refusal text is finalized.
+ refusal:
+ type: string
+ description: The refusal text that is finalized.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
- arguments:
- type: string
- description: The function-call arguments.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when function-call arguments are finalized.
+ description: Emitted when refusal text is finalized.
x-oaiMeta:
- name: response.function_call_arguments.done
+ name: response.refusal.done
group: responses
example: |
{
- "type": "response.function_call_arguments.done",
+ "type": "response.refusal.done",
"item_id": "item-abc",
- "name": "get_weather",
"output_index": 1,
- "arguments": "{ "arg": 123 }",
+ "content_index": 2,
+ "refusal": "final refusal text",
"sequence_number": 1
}
- OpenAI.ResponseImageGenCallCompletedEvent:
+ OpenAI.ResponseStreamEvent:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.ResponseStreamEventType'
+ discriminator:
+ propertyName: type
+ mapping:
+ response.audio.done: '#/components/schemas/OpenAI.ResponseAudioDoneEvent'
+ response.audio.transcript.delta: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent'
+ response.audio.transcript.done: '#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent'
+ response.code_interpreter_call_code.delta: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent'
+ response.code_interpreter_call_code.done: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent'
+ response.code_interpreter_call.completed: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent'
+ response.code_interpreter_call.in_progress: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent'
+ response.code_interpreter_call.interpreting: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent'
+ response.completed: '#/components/schemas/OpenAI.ResponseCompletedEvent'
+ response.content_part.added: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent'
+ response.content_part.done: '#/components/schemas/OpenAI.ResponseContentPartDoneEvent'
+ response.created: '#/components/schemas/OpenAI.ResponseCreatedEvent'
+ response.custom_tool_call_input.delta: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent'
+ response.custom_tool_call_input.done: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent'
+ error: '#/components/schemas/OpenAI.ResponseErrorEvent'
+ response.failed: '#/components/schemas/OpenAI.ResponseFailedEvent'
+ response.file_search_call.completed: '#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent'
+ response.file_search_call.in_progress: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent'
+ response.file_search_call.searching: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent'
+ response.function_call_arguments.delta: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent'
+ response.function_call_arguments.done: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent'
+ response.image_generation_call.completed: '#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent'
+ response.image_generation_call.generating: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent'
+ response.image_generation_call.in_progress: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent'
+ response.image_generation_call.partial_image: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent'
+ response.in_progress: '#/components/schemas/OpenAI.ResponseInProgressEvent'
+ response.incomplete: '#/components/schemas/OpenAI.ResponseIncompleteEvent'
+ response.mcp_call_arguments.delta: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent'
+ response.mcp_call_arguments.done: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent'
+ response.mcp_call.completed: '#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent'
+ response.mcp_call.failed: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent'
+ response.mcp_call.in_progress: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent'
+ response.mcp_list_tools.completed: '#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent'
+ response.mcp_list_tools.failed: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent'
+ response.mcp_list_tools.in_progress: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent'
+ response.output_item.added: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent'
+ response.output_item.done: '#/components/schemas/OpenAI.ResponseOutputItemDoneEvent'
+ response.output_text.annotation.added: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent'
+ response.queued: '#/components/schemas/OpenAI.ResponseQueuedEvent'
+ response.reasoning_summary_part.added: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent'
+ response.reasoning_summary_part.done: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent'
+ response.reasoning_summary_text.delta: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent'
+ response.reasoning_summary_text.done: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent'
+ response.reasoning_text.delta: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent'
+ response.reasoning_text.done: '#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent'
+ response.refusal.delta: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent'
+ response.refusal.done: '#/components/schemas/OpenAI.ResponseRefusalDoneEvent'
+ response.output_text.delta: '#/components/schemas/OpenAI.ResponseTextDeltaEvent'
+ response.output_text.done: '#/components/schemas/OpenAI.ResponseTextDoneEvent'
+ response.web_search_call.completed: '#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent'
+ response.web_search_call.in_progress: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent'
+ response.web_search_call.searching: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent'
+ response.audio.delta: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent'
+ OpenAI.ResponseStreamEventType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - response.audio.delta
+ - response.audio.done
+ - response.audio.transcript.delta
+ - response.audio.transcript.done
+ - response.code_interpreter_call_code.delta
+ - response.code_interpreter_call_code.done
+ - response.code_interpreter_call.completed
+ - response.code_interpreter_call.in_progress
+ - response.code_interpreter_call.interpreting
+ - response.completed
+ - response.content_part.added
+ - response.content_part.done
+ - response.created
+ - error
+ - response.file_search_call.completed
+ - response.file_search_call.in_progress
+ - response.file_search_call.searching
+ - response.function_call_arguments.delta
+ - response.function_call_arguments.done
+ - response.in_progress
+ - response.failed
+ - response.incomplete
+ - response.output_item.added
+ - response.output_item.done
+ - response.reasoning_summary_part.added
+ - response.reasoning_summary_part.done
+ - response.reasoning_summary_text.delta
+ - response.reasoning_summary_text.done
+ - response.reasoning_text.delta
+ - response.reasoning_text.done
+ - response.refusal.delta
+ - response.refusal.done
+ - response.output_text.delta
+ - response.output_text.done
+ - response.web_search_call.completed
+ - response.web_search_call.in_progress
+ - response.web_search_call.searching
+ - response.image_generation_call.completed
+ - response.image_generation_call.generating
+ - response.image_generation_call.in_progress
+ - response.image_generation_call.partial_image
+ - response.mcp_call_arguments.delta
+ - response.mcp_call_arguments.done
+ - response.mcp_call.completed
+ - response.mcp_call.failed
+ - response.mcp_call.in_progress
+ - response.mcp_list_tools.completed
+ - response.mcp_list_tools.failed
+ - response.mcp_list_tools.in_progress
+ - response.output_text.annotation.added
+ - response.queued
+ - response.custom_tool_call_input.delta
+ - response.custom_tool_call_input.done
+ OpenAI.ResponseStreamOptions:
+ type: object
+ properties:
+ include_obfuscation:
+ type: boolean
+ description: |-
+ 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.
+ description: 'Options for streaming responses. Only set this when you set `stream: true`.'
+ OpenAI.ResponseTextDeltaEvent:
type: object
required:
- type
+ - item_id
- output_index
+ - content_index
+ - delta
- sequence_number
- - item_id
+ - logprobs
properties:
type:
type: string
enum:
- - response.image_generation_call.completed
- description: The type of the event. Always 'response.image_generation_call.completed'.
+ - response.output_text.delta
+ description: The type of the event. Always `response.output_text.delta`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the output item that the text delta was added to.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- sequence_number:
+ description: The index of the output item that the text delta was added to.
+ content_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- item_id:
+ description: The index of the content part that the text delta was added to.
+ delta:
type: string
- description: The unique identifier of the image generation item being processed.
+ description: The text delta that was added.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number for this event.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ResponseLogProb'
+ description: The log probabilities of the tokens in the delta.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an image generation tool call has completed and the final image is available.
- title: ResponseImageGenCallCompletedEvent
+ description: Emitted when there is an additional text delta.
x-oaiMeta:
- name: response.image_generation_call.completed
+ name: response.output_text.delta
group: responses
example: |
{
- "type": "response.image_generation_call.completed",
+ "type": "response.output_text.delta",
+ "item_id": "msg_123",
"output_index": 0,
- "item_id": "item-123",
+ "content_index": 0,
+ "delta": "In",
"sequence_number": 1
}
- OpenAI.ResponseImageGenCallGeneratingEvent:
+ OpenAI.ResponseTextDoneEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
+ - content_index
+ - text
- sequence_number
+ - logprobs
properties:
type:
type: string
enum:
- - response.image_generation_call.generating
- description: The type of the event. Always 'response.image_generation_call.generating'.
+ - response.output_text.done
+ description: The type of the event. Always `response.output_text.done`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the output item that the text content is finalized.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
+ description: The index of the output item that the text content is finalized.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the content part that the text content is finalized.
+ text:
type: string
- description: The unique identifier of the image generation item being processed.
+ description: The text content that is finalized.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the image generation item being processed.
+ description: The sequence number for this event.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ResponseLogProb'
+ description: The log probabilities of the tokens in the delta.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an image generation tool call is actively generating an image (intermediate state).
- title: ResponseImageGenCallGeneratingEvent
+ description: Emitted when text content is finalized.
x-oaiMeta:
- name: response.image_generation_call.generating
+ name: response.output_text.done
group: responses
example: |
{
- "type": "response.image_generation_call.generating",
+ "type": "response.output_text.done",
+ "item_id": "msg_123",
"output_index": 0,
- "item_id": "item-123",
- "sequence_number": 0
+ "content_index": 0,
+ "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
+ "sequence_number": 1
}
- OpenAI.ResponseImageGenCallInProgressEvent:
+ OpenAI.ResponseTextParam:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
+ verbosity:
+ $ref: '#/components/schemas/OpenAI.Verbosity'
+ description: |-
+ Configuration options for a text response from the model. Can be plain
+ text or structured JSON data. Learn more:
+ - [Text inputs and outputs](/docs/guides/text)
+ - [Structured Outputs](/docs/guides/structured-outputs)
+ OpenAI.ResponseUsage:
+ type: object
+ required:
+ - input_tokens
+ - input_tokens_details
+ - output_tokens
+ - output_tokens_details
+ - total_tokens
+ properties:
+ input_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of input tokens.
+ input_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails'
+ description: A detailed breakdown of the input tokens.
+ output_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of output tokens.
+ output_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails'
+ description: A detailed breakdown of the output tokens.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total number of tokens used.
+ description: |-
+ Represents token usage details including input tokens, output tokens,
+ a breakdown of output tokens, and the total tokens used.
+ OpenAI.ResponseUsageInputTokensDetails:
+ type: object
+ required:
+ - cached_tokens
+ properties:
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.ResponseUsageOutputTokensDetails:
+ type: object
+ required:
+ - reasoning_tokens
+ properties:
+ reasoning_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.ResponseWebSearchCallCompletedEvent:
type: object
required:
- type
@@ -32013,1551 +67901,1595 @@ components:
type:
type: string
enum:
- - response.image_generation_call.in_progress
- description: The type of the event. Always 'response.image_generation_call.in_progress'.
+ - response.web_search_call.completed
+ description: The type of the event. Always `response.web_search_call.completed`.
x-stainless-const: true
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
+ description: The index of the output item that the web search call is associated with.
item_id:
type: string
- description: The unique identifier of the image generation item being processed.
+ description: Unique ID for the output item associated with the web search call.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the image generation item being processed.
+ description: The sequence number of the web search call being processed.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an image generation tool call is in progress.
- title: ResponseImageGenCallInProgressEvent
+ description: Emitted when a web search call is completed.
x-oaiMeta:
- name: response.image_generation_call.in_progress
+ name: response.web_search_call.completed
group: responses
example: |
{
- "type": "response.image_generation_call.in_progress",
+ "type": "response.web_search_call.completed",
"output_index": 0,
- "item_id": "item-123",
+ "item_id": "ws_123",
"sequence_number": 0
}
- OpenAI.ResponseImageGenCallPartialImageEvent:
+ OpenAI.ResponseWebSearchCallInProgressEvent:
type: object
required:
- type
- output_index
- item_id
- sequence_number
- - partial_image_index
- - partial_image_b64
properties:
type:
type: string
enum:
- - response.image_generation_call.partial_image
- description: The type of the event. Always 'response.image_generation_call.partial_image'.
+ - response.web_search_call.in_progress
+ description: The type of the event. Always `response.web_search_call.in_progress`.
x-stainless-const: true
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
+ description: The index of the output item that the web search call is associated with.
item_id:
type: string
- description: The unique identifier of the image generation item being processed.
+ description: Unique ID for the output item associated with the web search call.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the image generation item being processed.
- partial_image_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: 0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
- partial_image_b64:
- type: string
- description: Base64-encoded partial image data, suitable for rendering as an image.
+ description: The sequence number of the web search call being processed.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a partial image is available during image generation streaming.
- title: ResponseImageGenCallPartialImageEvent
+ description: Emitted when a web search call is initiated.
x-oaiMeta:
- name: response.image_generation_call.partial_image
+ name: response.web_search_call.in_progress
group: responses
example: |
{
- "type": "response.image_generation_call.partial_image",
+ "type": "response.web_search_call.in_progress",
"output_index": 0,
- "item_id": "item-123",
- "sequence_number": 0,
- "partial_image_index": 0,
- "partial_image_b64": "..."
+ "item_id": "ws_123",
+ "sequence_number": 0
}
- OpenAI.ResponseInProgressEvent:
+ OpenAI.ResponseWebSearchCallSearchingEvent:
type: object
required:
- type
- - response
+ - output_index
+ - item_id
- sequence_number
properties:
type:
type: string
enum:
- - response.in_progress
- description: The type of the event. Always `response.in_progress`.
+ - response.web_search_call.searching
+ description: The type of the event. Always `response.web_search_call.searching`.
x-stainless-const: true
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The response that is in progress.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the web search call is associated with.
+ item_id:
+ type: string
+ description: Unique ID for the output item associated with the web search call.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: The sequence number of the web search call being processed.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the response is in progress.
+ description: Emitted when a web search call is executing.
x-oaiMeta:
- name: response.in_progress
+ name: response.web_search_call.searching
group: responses
example: |
{
- "type": "response.in_progress",
- "response": {
- "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
- "object": "response",
- "created_at": 1741487325,
- "status": "in_progress",
- "completed_at": null,
- "error": null,
- "incomplete_details": null,
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-2024-08-06",
- "output": [],
- "parallel_tool_calls": true,
- "previous_response_id": null,
- "reasoning": {
- "effort": null,
- "summary": null
- },
- "store": true,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": null,
- "user": null,
- "metadata": {}
- },
- "sequence_number": 1
+ "type": "response.web_search_call.searching",
+ "output_index": 0,
+ "item_id": "ws_123",
+ "sequence_number": 0
}
- OpenAI.ResponseIncompleteDetails:
+ OpenAI.RunCompletionUsage:
type: object
+ required:
+ - completion_tokens
+ - prompt_tokens
+ - total_tokens
properties:
- reason:
- type: string
- enum:
- - max_output_tokens
- - content_filter
- OpenAI.ResponseIncompleteEvent:
+ completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of completion tokens used over the course of the run.
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of prompt tokens used over the course of the run.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Total number of tokens used (prompt + completion).
+ description: 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.).
+ OpenAI.RunGraderRequest:
type: object
required:
- - type
- - response
- - sequence_number
+ - grader
+ - model_sample
properties:
- type:
+ grader:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderMulti'
+ description: The grader used for the fine-tuning job.
+ item:
+ $ref: '#/components/schemas/OpenAI.RunGraderRequestItem'
+ description: |-
+ The dataset item provided to the grader. This will be used to populate
+ the `item` namespace. See [the guide](/docs/guides/graders) for more details.
+ model_sample:
type: string
- enum:
- - response.incomplete
- description: The type of the event. Always `response.incomplete`.
- x-stainless-const: true
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The response that was incomplete.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: An event that is emitted when a response finishes as incomplete.
- x-oaiMeta:
- name: response.incomplete
- group: responses
- example: |
- {
- "type": "response.incomplete",
- "response": {
- "id": "resp_123",
- "object": "response",
- "created_at": 1740855869,
- "status": "incomplete",
- "completed_at": null,
- "error": null,
- "incomplete_details": {
- "reason": "max_tokens"
- },
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-mini-2024-07-18",
- "output": [],
- "previous_response_id": null,
- "reasoning_effort": null,
- "store": false,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": null,
- "user": null,
- "metadata": {}
- },
- "sequence_number": 1
- }
- OpenAI.ResponseLogProb:
+ description: |-
+ The model sample to be evaluated. This value will be used to populate
+ the `sample` namespace. See [the guide](/docs/guides/graders) for more details.
+ The `output_json` variable will be populated if the model sample is a
+ valid JSON string.
+ title: RunGraderRequest
+ OpenAI.RunGraderRequestItem:
+ type: object
+ OpenAI.RunGraderResponse:
type: object
required:
- - token
- - logprob
+ - reward
+ - metadata
+ - sub_rewards
+ - model_grader_token_usage_per_model
properties:
- token:
- type: string
- description: A possible text token.
- logprob:
+ reward:
$ref: '#/components/schemas/OpenAI.numeric'
- description: The log probability of this token.
- top_logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ResponseLogProbTopLogprobs'
- description: The log probabilities of up to 20 of the most likely tokens.
- description: |-
- A logprob is the logarithmic probability that the model assigns to producing
- a particular token at a given position in the sequence. Less-negative (higher)
- logprob values indicate greater model confidence in that token choice.
- OpenAI.ResponseLogProbTopLogprobs:
+ metadata:
+ $ref: '#/components/schemas/OpenAI.RunGraderResponseMetadata'
+ sub_rewards:
+ type: object
+ unevaluatedProperties: {}
+ model_grader_token_usage_per_model:
+ type: object
+ unevaluatedProperties: {}
+ OpenAI.RunGraderResponseMetadata:
type: object
+ required:
+ - name
+ - type
+ - errors
+ - execution_time
+ - scores
+ - token_usage
+ - sampled_model_name
properties:
- token:
+ name:
type: string
- logprob:
+ type:
+ type: string
+ errors:
+ $ref: '#/components/schemas/OpenAI.RunGraderResponseMetadataErrors'
+ execution_time:
$ref: '#/components/schemas/OpenAI.numeric'
- OpenAI.ResponseMCPCallArgumentsDeltaEvent:
+ scores:
+ type: object
+ unevaluatedProperties: {}
+ token_usage:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ sampled_model_name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.RunGraderResponseMetadataErrors:
+ type: object
+ required:
+ - formula_parse_error
+ - sample_parse_error
+ - truncated_observation_error
+ - unresponsive_reward_error
+ - invalid_variable_error
+ - other_error
+ - python_grader_server_error
+ - python_grader_server_error_type
+ - python_grader_runtime_error
+ - python_grader_runtime_error_details
+ - model_grader_server_error
+ - model_grader_refusal_error
+ - model_grader_parse_error
+ - model_grader_server_error_details
+ properties:
+ formula_parse_error:
+ type: boolean
+ sample_parse_error:
+ type: boolean
+ truncated_observation_error:
+ type: boolean
+ unresponsive_reward_error:
+ type: boolean
+ invalid_variable_error:
+ type: boolean
+ other_error:
+ type: boolean
+ python_grader_server_error:
+ type: boolean
+ python_grader_server_error_type:
+ anyOf:
+ - type: string
+ - type: 'null'
+ python_grader_runtime_error:
+ type: boolean
+ python_grader_runtime_error_details:
+ anyOf:
+ - type: string
+ - type: 'null'
+ model_grader_server_error:
+ type: boolean
+ model_grader_refusal_error:
+ type: boolean
+ model_grader_parse_error:
+ type: boolean
+ model_grader_server_error_details:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.RunObject:
type: object
required:
- - type
- - output_index
- - item_id
- - delta
- - sequence_number
+ - id
+ - object
+ - created_at
+ - thread_id
+ - assistant_id
+ - status
+ - required_action
+ - last_error
+ - expires_at
+ - started_at
+ - cancelled_at
+ - failed_at
+ - completed_at
+ - incomplete_details
+ - model
+ - instructions
+ - tools
+ - metadata
+ - usage
+ - max_prompt_tokens
+ - max_completion_tokens
+ - truncation_strategy
+ - tool_choice
+ - parallel_tool_calls
+ - response_format
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - response.mcp_call_arguments.delta
- description: The type of the event. Always 'response.mcp_call_arguments.delta'.
+ - thread.run
+ description: The object type, which is always `thread.run`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the run was created.
+ thread_id:
type: string
- description: The unique identifier of the MCP tool call item being processed.
- delta:
+ description: The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.
+ assistant_id:
type: string
- description: A JSON string containing the partial update to the arguments for the MCP tool call.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
- title: ResponseMCPCallArgumentsDeltaEvent
+ description: The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.
+ status:
+ $ref: '#/components/schemas/OpenAI.RunStatus'
+ description: The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.
+ required_action:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunObjectRequiredAction'
+ - type: 'null'
+ description: Details on the action required to continue the run. Will be `null` if no action is required.
+ last_error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunObjectLastError'
+ - type: 'null'
+ description: The last error associated with this run. Will be `null` if there are no errors.
+ expires_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run will expire.
+ started_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run was started.
+ cancelled_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run was cancelled.
+ failed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run failed.
+ completed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run was completed.
+ incomplete_details:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunObjectIncompleteDetails'
+ - type: 'null'
+ description: Details on why the run is incomplete. Will be `null` if the run is not incomplete.
+ model:
+ type: string
+ description: The model that the [assistant](/docs/api-reference/assistants) used for this run.
+ instructions:
+ type: string
+ description: The instructions that the [assistant](/docs/api-reference/assistants) used for this run.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ maxItems: 20
+ description: The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.
+ default: []
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ usage:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunCompletionUsage'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ description: The sampling temperature used for this run. If not set, defaults to 1.
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ description: The nucleus sampling value used for this run. If not set, defaults to 1.
+ max_prompt_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: The maximum number of prompt tokens specified to have been used over the course of the run.
+ max_completion_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: The maximum number of completion tokens specified to have been used over the course of the run.
+ truncation_strategy:
+ $ref: '#/components/schemas/OpenAI.TruncationObject'
+ tool_choice:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption'
+ parallel_tool_calls:
+ type: boolean
+ description: Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
+ default: true
+ response_format:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ description: Represents an execution run on a [thread](/docs/api-reference/threads).
+ title: A run on a thread
x-oaiMeta:
- name: response.mcp_call_arguments.delta
- group: responses
+ name: The run object
+ beta: true
example: |
{
- "type": "response.mcp_call_arguments.delta",
- "output_index": 0,
- "item_id": "item-abc",
- "delta": "{",
- "sequence_number": 1
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1698107661,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699073476,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699073498,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [{"type": "file_search"}, {"type": "code_interpreter"}],
+ "metadata": {},
+ "incomplete_details": null,
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
}
- OpenAI.ResponseMCPCallArgumentsDoneEvent:
+ OpenAI.RunObjectIncompleteDetails:
+ type: object
+ properties:
+ reason:
+ type: string
+ enum:
+ - max_completion_tokens
+ - max_prompt_tokens
+ OpenAI.RunObjectLastError:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: string
+ enum:
+ - server_error
+ - rate_limit_exceeded
+ - invalid_prompt
+ message:
+ type: string
+ OpenAI.RunObjectRequiredAction:
type: object
required:
- type
- - output_index
- - item_id
- - arguments
- - sequence_number
+ - submit_tool_outputs
properties:
type:
type: string
enum:
- - response.mcp_call_arguments.done
- description: The type of the event. Always 'response.mcp_call_arguments.done'.
+ - submit_tool_outputs
x-stainless-const: true
- output_index:
+ submit_tool_outputs:
+ $ref: '#/components/schemas/OpenAI.RunObjectRequiredActionSubmitToolOutputs'
+ OpenAI.RunObjectRequiredActionSubmitToolOutputs:
+ type: object
+ required:
+ - tool_calls
+ properties:
+ tool_calls:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunToolCallObject'
+ OpenAI.RunStatus:
+ type: string
+ enum:
+ - queued
+ - in_progress
+ - requires_action
+ - cancelling
+ - cancelled
+ - failed
+ - completed
+ - incomplete
+ - expired
+ description: The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.
+ OpenAI.RunStepCompletionUsage:
+ type: object
+ required:
+ - completion_tokens
+ - prompt_tokens
+ - total_tokens
+ properties:
+ completion_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
- type: string
- description: The unique identifier of the MCP tool call item being processed.
- arguments:
- type: string
- description: A JSON string containing the finalized arguments for the MCP tool call.
- sequence_number:
+ description: Number of completion tokens used over the course of the run step.
+ prompt_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the arguments for an MCP tool call are finalized.
- title: ResponseMCPCallArgumentsDoneEvent
- x-oaiMeta:
- name: response.mcp_call_arguments.done
- group: responses
- example: |
- {
- "type": "response.mcp_call_arguments.done",
- "output_index": 0,
- "item_id": "item-abc",
- "arguments": "{"arg1": "value1", "arg2": "value2"}",
- "sequence_number": 1
- }
- OpenAI.ResponseMCPCallCompletedEvent:
+ description: Number of prompt tokens used over the course of the run step.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Total number of tokens used (prompt + completion).
+ description: Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.
+ OpenAI.RunStepDetailsMessageCreationObject:
type: object
required:
- type
- - item_id
- - output_index
- - sequence_number
+ - message_creation
properties:
type:
type: string
enum:
- - response.mcp_call.completed
- description: The type of the event. Always 'response.mcp_call.completed'.
+ - message_creation
+ description: Always `message_creation`.
x-stainless-const: true
- item_id:
+ message_creation:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsMessageCreationObjectMessageCreation'
+ description: Details of the message creation by the run step.
+ title: Message creation
+ OpenAI.RunStepDetailsMessageCreationObjectMessageCreation:
+ type: object
+ required:
+ - message_id
+ properties:
+ message_id:
type: string
- description: The ID of the MCP tool call item that completed.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that completed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an MCP tool call has completed successfully.
- title: ResponseMCPCallCompletedEvent
- x-oaiMeta:
- name: response.mcp_call.completed
- group: responses
- example: |
- {
- "type": "response.mcp_call.completed",
- "sequence_number": 1,
- "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90",
- "output_index": 0
- }
- OpenAI.ResponseMCPCallFailedEvent:
+ OpenAI.RunStepDetailsToolCall:
type: object
required:
- type
- - item_id
- - output_index
- - sequence_number
properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallType'
+ discriminator:
+ propertyName: type
+ mapping:
+ code_interpreter: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObject'
+ file_search: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObject'
+ function: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObject'
+ OpenAI.RunStepDetailsToolCallType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - code_interpreter
+ - file_search
+ - function
+ OpenAI.RunStepDetailsToolCallsCodeObject:
+ type: object
+ required:
+ - id
+ - type
+ - code_interpreter
+ properties:
+ id:
+ type: string
+ description: The ID of the tool call.
type:
type: string
enum:
- - response.mcp_call.failed
- description: The type of the event. Always 'response.mcp_call.failed'.
+ - code_interpreter
+ description: The type of tool call. This is always going to be `code_interpreter` for this type of tool call.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the MCP tool call item that failed.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that failed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter'
+ description: The Code Interpreter tool call definition.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an MCP tool call has failed.
- title: ResponseMCPCallFailedEvent
- x-oaiMeta:
- name: response.mcp_call.failed
- group: responses
- example: |
- {
- "type": "response.mcp_call.failed",
- "sequence_number": 1,
- "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90",
- "output_index": 0
- }
- OpenAI.ResponseMCPCallInProgressEvent:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall'
+ description: Details of the Code Interpreter tool call the run step was involved in.
+ title: Code Interpreter tool call
+ OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter:
+ type: object
+ required:
+ - input
+ - outputs
+ properties:
+ input:
+ type: string
+ outputs:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject'
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObject'
+ OpenAI.RunStepDetailsToolCallsCodeOutputImageObject:
type: object
required:
- type
- - sequence_number
- - output_index
- - item_id
+ - image
properties:
type:
type: string
enum:
- - response.mcp_call.in_progress
- description: The type of the event. Always 'response.mcp_call.in_progress'.
+ - image
+ description: Always `image`.
x-stainless-const: true
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
+ image:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage'
+ title: Code Interpreter image output
+ OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage:
+ type: object
+ required:
+ - file_id
+ properties:
+ file_id:
type: string
- description: The unique identifier of the MCP tool call item being processed.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an MCP tool call is in progress.
- title: ResponseMCPCallInProgressEvent
- x-oaiMeta:
- name: response.mcp_call.in_progress
- group: responses
- example: |
- {
- "type": "response.mcp_call.in_progress",
- "sequence_number": 1,
- "output_index": 0,
- "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90"
- }
- OpenAI.ResponseMCPListToolsCompletedEvent:
+ OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject:
type: object
required:
- type
- - item_id
- - output_index
- - sequence_number
+ - logs
properties:
type:
type: string
enum:
- - response.mcp_list_tools.completed
- description: The type of the event. Always 'response.mcp_list_tools.completed'.
+ - logs
+ description: Always `logs`.
x-stainless-const: true
- item_id:
+ logs:
type: string
- description: The ID of the MCP tool call item that produced this output.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that was processed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the list of available MCP tools has been successfully retrieved.
- title: ResponseMCPListToolsCompletedEvent
- x-oaiMeta:
- name: response.mcp_list_tools.completed
- group: responses
- example: |
- {
- "type": "response.mcp_list_tools.completed",
- "sequence_number": 1,
- "output_index": 0,
- "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
- }
- OpenAI.ResponseMCPListToolsFailedEvent:
+ description: The text output from the Code Interpreter tool call.
+ description: Text output from the Code Interpreter tool call as part of a run step.
+ title: Code Interpreter log output
+ OpenAI.RunStepDetailsToolCallsFileSearchObject:
type: object
required:
+ - id
- type
- - item_id
- - output_index
- - sequence_number
+ - file_search
properties:
+ id:
+ type: string
+ description: The ID of the tool call object.
type:
type: string
enum:
- - response.mcp_list_tools.failed
- description: The type of the event. Always 'response.mcp_list_tools.failed'.
+ - file_search
+ description: The type of tool call. This is always going to be `file_search` for this type of tool call.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the MCP tool call item that failed.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that failed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ file_search:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch'
+ description: For now, this is always going to be an empty object.
+ x-oaiTypeLabel: map
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the attempt to list available MCP tools has failed.
- title: ResponseMCPListToolsFailedEvent
- x-oaiMeta:
- name: response.mcp_list_tools.failed
- group: responses
- example: |
- {
- "type": "response.mcp_list_tools.failed",
- "sequence_number": 1,
- "output_index": 0,
- "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
- }
- OpenAI.ResponseMCPListToolsInProgressEvent:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall'
+ title: File search tool call
+ OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch:
+ type: object
+ properties:
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject'
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObject'
+ OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject:
type: object
required:
- - type
- - item_id
- - output_index
- - sequence_number
+ - ranker
+ - score_threshold
+ properties:
+ ranker:
+ $ref: '#/components/schemas/OpenAI.FileSearchRanker'
+ score_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ description: The score threshold for the file search. All values must be a floating point number between 0 and 1.
+ description: The ranking options for the file search.
+ title: File search tool call ranking options
+ OpenAI.RunStepDetailsToolCallsFileSearchResultObject:
+ type: object
+ required:
+ - file_id
+ - file_name
+ - score
+ properties:
+ file_id:
+ type: string
+ description: The ID of the file that result was found in.
+ file_name:
+ type: string
+ description: The name of the file that result was found in.
+ score:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ description: The score of the result. All values must be a floating point number between 0 and 1.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent'
+ description: The content of the result that was found. The content is only included if requested via the include query parameter.
+ description: A result instance of the file search.
+ title: File search tool call result
+ x-oaiTypeLabel: map
+ OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent:
+ type: object
properties:
type:
type: string
enum:
- - response.mcp_list_tools.in_progress
- description: The type of the event. Always 'response.mcp_list_tools.in_progress'.
+ - text
x-stainless-const: true
- item_id:
+ text:
type: string
- description: The ID of the MCP tool call item that is being processed.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that is being processed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the system is in the process of retrieving the list of available MCP tools.
- title: ResponseMCPListToolsInProgressEvent
- x-oaiMeta:
- name: response.mcp_list_tools.in_progress
- group: responses
- example: |
- {
- "type": "response.mcp_list_tools.in_progress",
- "sequence_number": 1,
- "output_index": 0,
- "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
- }
- OpenAI.ResponseOutputItemAddedEvent:
+ OpenAI.RunStepDetailsToolCallsFunctionObject:
type: object
required:
+ - id
- type
- - output_index
- - sequence_number
- - item
+ - function
properties:
+ id:
+ type: string
+ description: The ID of the tool call object.
type:
type: string
enum:
- - response.output_item.added
- description: The type of the event. Always `response.output_item.added`.
+ - function
+ description: The type of tool call. This is always going to be `function` for this type of tool call.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that was added.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- item:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output item that was added.
+ function:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObjectFunction'
+ description: The definition of the function that was called.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a new output item is added.
- x-oaiMeta:
- name: response.output_item.added
- group: responses
- example: |
- {
- "type": "response.output_item.added",
- "output_index": 0,
- "item": {
- "id": "msg_123",
- "status": "in_progress",
- "type": "message",
- "role": "assistant",
- "content": []
- },
- "sequence_number": 1
- }
- OpenAI.ResponseOutputItemDoneEvent:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall'
+ title: Function tool call
+ OpenAI.RunStepDetailsToolCallsFunctionObjectFunction:
+ type: object
+ required:
+ - name
+ - arguments
+ - output
+ properties:
+ name:
+ type: string
+ arguments:
+ type: string
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.RunStepDetailsToolCallsObject:
type: object
required:
- type
- - output_index
- - sequence_number
- - item
+ - tool_calls
properties:
type:
type: string
enum:
- - response.output_item.done
- description: The type of the event. Always `response.output_item.done`.
+ - tool_calls
+ description: Always `tool_calls`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that was marked done.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- item:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output item that was marked done.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an output item is marked done.
- x-oaiMeta:
- name: response.output_item.done
- group: responses
- example: |
- {
- "type": "response.output_item.done",
- "output_index": 0,
- "item": {
- "id": "msg_123",
- "status": "completed",
- "type": "message",
- "role": "assistant",
- "content": [
- {
- "type": "output_text",
- "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
- "annotations": []
- }
- ]
- },
- "sequence_number": 1
- }
- OpenAI.ResponseOutputTextAnnotationAddedEvent:
+ tool_calls:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall'
+ description: '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`.'
+ description: Details of the tool call.
+ title: Tool calls
+ OpenAI.RunStepObject:
type: object
required:
+ - id
+ - object
+ - created_at
+ - assistant_id
+ - thread_id
+ - run_id
- type
- - item_id
- - output_index
- - content_index
- - annotation_index
- - sequence_number
- - annotation
+ - status
+ - step_details
+ - last_error
+ - expired_at
+ - cancelled_at
+ - failed_at
+ - completed_at
+ - metadata
+ - usage
properties:
- type:
+ id:
+ type: string
+ description: The identifier of the run step, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - response.output_text.annotation.added
- description: The type of the event. Always 'response.output_text.annotation.added'.
+ - thread.run.step
+ description: The object type, which is always `thread.run.step`.
x-stainless-const: true
- item_id:
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the run step was created.
+ assistant_id:
type: string
- description: The unique identifier of the item to which the annotation is being added.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part within the output item.
- annotation_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the annotation within the content part.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- annotation:
- $ref: '#/components/schemas/OpenAI.Annotation'
- description: The annotation object being added. (See annotation schema for details.)
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an annotation is added to output text content.
- title: ResponseOutputTextAnnotationAddedEvent
+ description: The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.
+ thread_id:
+ type: string
+ description: The ID of the [thread](/docs/api-reference/threads) that was run.
+ run_id:
+ type: string
+ description: The ID of the [run](/docs/api-reference/runs) that this run step is a part of.
+ type:
+ type: string
+ enum:
+ - message_creation
+ - tool_calls
+ description: The type of run step, which can be either `message_creation` or `tool_calls`.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - cancelled
+ - failed
+ - completed
+ - expired
+ description: The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.
+ step_details:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsMessageCreationObject'
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsObject'
+ description: The details of the run step.
+ last_error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunStepObjectLastError'
+ - type: 'null'
+ expired_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ cancelled_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ failed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ completed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ usage:
+ $ref: '#/components/schemas/OpenAI.RunStepCompletionUsage'
+ description: Represents a step in execution of a run.
+ title: Run steps
x-oaiMeta:
- name: response.output_text.annotation.added
- group: responses
+ name: The run step object
+ beta: true
example: |
{
- "type": "response.output_text.annotation.added",
- "item_id": "item-abc",
- "output_index": 0,
- "content_index": 0,
- "annotation_index": 0,
- "annotation": {
- "type": "text_annotation",
- "text": "This is a test annotation",
- "start": 0,
- "end": 10
+ "id": "step_abc123",
+ "object": "thread.run.step",
+ "created_at": 1699063291,
+ "run_id": "run_abc123",
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "type": "message_creation",
+ "status": "completed",
+ "cancelled_at": null,
+ "completed_at": 1699063291,
+ "expired_at": null,
+ "failed_at": null,
+ "last_error": null,
+ "step_details": {
+ "type": "message_creation",
+ "message_creation": {
+ "message_id": "msg_abc123"
+ }
},
- "sequence_number": 1
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ }
}
- OpenAI.ResponsePromptVariables:
+ OpenAI.RunStepObjectLastError:
type: object
- unevaluatedProperties:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.InputTextContent'
- - $ref: '#/components/schemas/OpenAI.InputImageContent'
- - $ref: '#/components/schemas/OpenAI.InputFileContent'
- description: |-
- Optional map of values to substitute in for variables in your
- prompt. The substitution values can either be strings, or other
- Response input types like images or files.
- title: Prompt Variables
- x-oaiExpandable: true
- x-oaiTypeLabel: map
- OpenAI.ResponseQueuedEvent:
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: string
+ enum:
+ - server_error
+ - rate_limit_exceeded
+ message:
+ type: string
+ OpenAI.RunToolCallObject:
type: object
required:
+ - id
- type
- - response
- - sequence_number
+ - function
properties:
+ id:
+ type: string
+ description: 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](/docs/api-reference/runs/submitToolOutputs) endpoint.
type:
type: string
enum:
- - response.queued
- description: The type of the event. Always 'response.queued'.
+ - function
+ description: The type of tool call the output is required for. For now, this is always `function`.
x-stainless-const: true
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The full response object that is queued.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number for this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a response is queued and waiting to be processed.
- title: ResponseQueuedEvent
- x-oaiMeta:
- name: response.queued
- group: responses
- example: |
- {
- "type": "response.queued",
- "response": {
- "id": "res_123",
- "status": "queued",
- "created_at": "2021-01-01T00:00:00Z",
- "updated_at": "2021-01-01T00:00:00Z"
- },
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningSummaryPartAddedEvent:
+ function:
+ $ref: '#/components/schemas/OpenAI.RunToolCallObjectFunction'
+ description: The function definition.
+ description: Tool call objects
+ OpenAI.RunToolCallObjectFunction:
+ type: object
+ required:
+ - name
+ - arguments
+ properties:
+ name:
+ type: string
+ arguments:
+ type: string
+ OpenAI.ScreenshotParam:
type: object
required:
- type
- - item_id
- - output_index
- - summary_index
- - sequence_number
- - part
properties:
type:
type: string
enum:
- - response.reasoning_summary_part.added
- description: The type of the event. Always `response.reasoning_summary_part.added`.
+ - screenshot
+ description: Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
x-stainless-const: true
- item_id:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A screenshot action.
+ title: Screenshot
+ OpenAI.ScrollParam:
+ type: object
+ required:
+ - type
+ - x
+ - 'y'
+ - scroll_x
+ - scroll_y
+ properties:
+ type:
type: string
- description: The ID of the item this summary part is associated with.
- output_index:
+ enum:
+ - scroll
+ description: Specifies the event type. For a scroll action, this property is always set to `scroll`.
+ x-stainless-const: true
+ x:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this summary part is associated with.
- summary_index:
+ description: The x-coordinate where the scroll occurred.
+ 'y':
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the summary part within the reasoning summary.
- sequence_number:
+ description: The y-coordinate where the scroll occurred.
+ scroll_x:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- part:
- $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart'
- description: The summary part that was added.
+ description: The horizontal scroll distance.
+ scroll_y:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The vertical scroll distance.
+ keys:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a new reasoning summary part is added.
- x-oaiMeta:
- name: response.reasoning_summary_part.added
- group: responses
- example: |
- {
- "type": "response.reasoning_summary_part.added",
- "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
- "output_index": 0,
- "summary_index": 0,
- "part": {
- "type": "summary_text",
- "text": ""
- },
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningSummaryPartAddedEventPart:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A scroll action.
+ title: Scroll
+ OpenAI.SearchContentType:
+ type: string
+ enum:
+ - text
+ - image
+ OpenAI.SearchContextSize:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ OpenAI.ServiceTier:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - default
+ - flex
+ - scale
+ - priority
+ - type: 'null'
+ description: |-
+ Specifies the processing type used for serving the request.
+ - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
+ - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
+ - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.
+ - When not set, the default behavior is 'auto'.
+ 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.
+ OpenAI.ServiceTierEnum:
+ type: string
+ enum:
+ - auto
+ - default
+ - flex
+ - priority
+ OpenAI.SkillReferenceParam:
type: object
required:
- type
- - text
+ - skill_id
properties:
type:
type: string
enum:
- - summary_text
+ - skill_reference
+ description: References a skill created with the /v1/skills endpoint.
x-stainless-const: true
- text:
+ skill_id:
type: string
- OpenAI.ResponseReasoningSummaryPartDoneEvent:
+ minLength: 1
+ maxLength: 64
+ description: The ID of the referenced skill.
+ version:
+ type: string
+ description: Optional skill version. Use a positive integer or 'latest'. Omit for default.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerSkill'
+ OpenAI.SpecificApplyPatchParam:
type: object
required:
- type
- - item_id
- - output_index
- - summary_index
- - sequence_number
- - part
properties:
type:
type: string
enum:
- - response.reasoning_summary_part.done
- description: The type of the event. Always `response.reasoning_summary_part.done`.
+ - apply_patch
+ description: The tool to call. Always `apply_patch`.
x-stainless-const: true
- item_id:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Forces the model to call the apply_patch tool when executing a tool call.
+ title: Specific apply patch tool choice
+ OpenAI.SpecificFunctionShellParam:
+ type: object
+ required:
+ - type
+ properties:
+ type:
type: string
- description: The ID of the item this summary part is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this summary part is associated with.
- summary_index:
+ enum:
+ - shell
+ description: The tool to call. Always `shell`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Forces the model to call the shell tool when a tool call is required.
+ title: Specific shell tool choice
+ OpenAI.StaticChunkingStrategy:
+ type: object
+ required:
+ - max_chunk_size_tokens
+ - chunk_overlap_tokens
+ properties:
+ max_chunk_size_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the summary part within the reasoning summary.
- sequence_number:
+ minimum: 100
+ maximum: 4096
+ description: The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
+ chunk_overlap_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- part:
- $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEventPart'
- description: The completed summary part.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a reasoning summary part is completed.
- x-oaiMeta:
- name: response.reasoning_summary_part.done
- group: responses
- example: |
- {
- "type": "response.reasoning_summary_part.done",
- "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
- "output_index": 0,
- "summary_index": 0,
- "part": {
- "type": "summary_text",
- "text": "**Responding to a greeting**
-
- The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!"
- },
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningSummaryPartDoneEventPart:
+ description: |-
+ 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`.
+ OpenAI.StaticChunkingStrategyRequestParam:
type: object
required:
- type
- - text
+ - static
properties:
type:
type: string
enum:
- - summary_text
+ - static
+ description: Always `static`.
x-stainless-const: true
- text:
- type: string
- OpenAI.ResponseReasoningSummaryTextDeltaEvent:
+ static:
+ $ref: '#/components/schemas/OpenAI.StaticChunkingStrategy'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ description: Customize your own chunking strategy by setting chunk size and chunk overlap.
+ title: Static Chunking Strategy
+ OpenAI.StaticChunkingStrategyResponseParam:
type: object
required:
- type
- - item_id
- - output_index
- - summary_index
- - delta
- - sequence_number
+ - static
properties:
type:
type: string
enum:
- - response.reasoning_summary_text.delta
- description: The type of the event. Always `response.reasoning_summary_text.delta`.
+ - static
+ description: Always `static`.
x-stainless-const: true
- item_id:
+ static:
+ $ref: '#/components/schemas/OpenAI.StaticChunkingStrategy'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse'
+ title: Static Chunking Strategy
+ OpenAI.StopConfiguration:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ description: |-
+ Not supported with latest reasoning models `o3` and `o4-mini`.
+ Up to 4 sequences where the API will stop generating further tokens. The
+ returned text will not contain the stop sequence.
+ OpenAI.SubmitToolOutputsRunRequest:
+ type: object
+ required:
+ - tool_outputs
+ properties:
+ tool_outputs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.SubmitToolOutputsRunRequestToolOutputs'
+ description: A list of tools for which the outputs are being submitted.
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ OpenAI.SubmitToolOutputsRunRequestToolOutputs:
+ type: object
+ properties:
+ tool_call_id:
type: string
- description: The ID of the item this summary text delta is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this summary text delta is associated with.
- summary_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the summary part within the reasoning summary.
- delta:
+ output:
type: string
- description: The text delta that was added to the summary.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a delta is added to a reasoning summary text.
- x-oaiMeta:
- name: response.reasoning_summary_text.delta
- group: responses
- example: |
- {
- "type": "response.reasoning_summary_text.delta",
- "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
- "output_index": 0,
- "summary_index": 0,
- "delta": "**Responding to a greeting**
-
- The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningSummaryTextDoneEvent:
+ OpenAI.SummaryTextContent:
type: object
required:
- type
- - item_id
- - output_index
- - summary_index
- text
- - sequence_number
properties:
type:
type: string
enum:
- - response.reasoning_summary_text.done
- description: The type of the event. Always `response.reasoning_summary_text.done`.
+ - summary_text
+ description: The type of the object. Always `summary_text`.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the item this summary text is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this summary text is associated with.
- summary_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the summary part within the reasoning summary.
text:
type: string
- description: The full text of the completed reasoning summary.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: A summary of the reasoning output from the model so far.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a reasoning summary text is completed.
- x-oaiMeta:
- name: response.reasoning_summary_text.done
- group: responses
- example: |
- {
- "type": "response.reasoning_summary_text.done",
- "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
- "output_index": 0,
- "summary_index": 0,
- "text": "**Responding to a greeting**
-
- The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningTextDeltaEvent:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A summary text from the model.
+ title: Summary text
+ OpenAI.TextAnnotation:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - delta
- - sequence_number
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.TextAnnotationType'
+ discriminator:
+ propertyName: type
+ mapping:
+ file_citation: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObject'
+ file_path: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObject'
+ OpenAI.TextAnnotationType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - response.reasoning_text.delta
- description: The type of the event. Always `response.reasoning_text.delta`.
- x-stainless-const: true
- item_id:
- type: string
- description: The ID of the item this reasoning text delta is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this reasoning text delta is associated with.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the reasoning content part this delta is associated with.
- delta:
- type: string
- description: The text delta that was added to the reasoning content.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a delta is added to a reasoning text.
- x-oaiMeta:
- name: response.reasoning_text.delta
- group: responses
- example: |
- {
- "type": "response.reasoning_text.delta",
- "item_id": "rs_123",
- "output_index": 0,
- "content_index": 0,
- "delta": "The",
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningTextDoneEvent:
+ - file_citation
+ - file_path
+ OpenAI.TextContent:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- text
- - sequence_number
properties:
type:
type: string
enum:
- - response.reasoning_text.done
- description: The type of the event. Always `response.reasoning_text.done`.
+ - text
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the item this reasoning text is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this reasoning text is associated with.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the reasoning content part.
text:
type: string
- description: The full text of the completed reasoning content.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a reasoning text is completed.
- x-oaiMeta:
- name: response.reasoning_text.done
- group: responses
- example: |
- {
- "type": "response.reasoning_text.done",
- "item_id": "rs_123",
- "output_index": 0,
- "content_index": 0,
- "text": "The user is asking...",
- "sequence_number": 4
- }
- OpenAI.ResponseRefusalDeltaEvent:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A text content.
+ title: Text Content
+ OpenAI.TextResponseFormatConfiguration:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.TextResponseFormatConfigurationType'
+ discriminator:
+ propertyName: type
+ mapping:
+ json_schema: '#/components/schemas/OpenAI.TextResponseFormatJsonSchema'
+ text: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText'
+ json_object: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject'
+ description: |-
+ An object specifying the format that the model must output.
+ Configuring `{ "type": "json_schema" }` enables Structured Outputs,
+ which ensures the model will match your supplied JSON schema. Learn more in the
+ [Structured Outputs guide](/docs/guides/structured-outputs).
+ The default format is `{ "type": "text" }` with no additional options.
+ *Not recommended for gpt-4o and newer models:**
+ 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.
+ OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - json_object
+ description: The type of response format being defined. Always `json_object`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
+ description: |-
+ JSON object response format. An older method of generating JSON responses.
+ Using `json_schema` is recommended for models that support it. Note that the
+ model will not generate JSON without a system or user message instructing it
+ to do so.
+ title: JSON object
+ OpenAI.TextResponseFormatConfigurationResponseFormatText:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - delta
- - sequence_number
properties:
type:
type: string
enum:
- - response.refusal.delta
- description: The type of the event. Always `response.refusal.delta`.
+ - text
+ description: The type of response format being defined. Always `text`.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the output item that the refusal text is added to.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the refusal text is added to.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that the refusal text is added to.
- delta:
- type: string
- description: The refusal text that is added.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a partial refusal text.
- x-oaiMeta:
- name: response.refusal.delta
- group: responses
- example: |
- {
- "type": "response.refusal.delta",
- "item_id": "msg_123",
- "output_index": 0,
- "content_index": 0,
- "delta": "refusal text so far",
- "sequence_number": 1
- }
- OpenAI.ResponseRefusalDoneEvent:
+ - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
+ description: Default response format. Used to generate text responses.
+ title: Text
+ OpenAI.TextResponseFormatConfigurationType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - text
+ - json_schema
+ - json_object
+ OpenAI.TextResponseFormatJsonSchema:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - refusal
- - sequence_number
+ - name
+ - schema
properties:
type:
type: string
enum:
- - response.refusal.done
- description: The type of the event. Always `response.refusal.done`.
+ - json_schema
+ description: The type of response format being defined. Always `json_schema`.
x-stainless-const: true
- item_id:
+ description:
type: string
- description: The ID of the output item that the refusal text is finalized.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the refusal text is finalized.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that the refusal text is finalized.
- refusal:
+ description: |-
+ A description of what the response format is for, used by the model to
+ determine how to respond in the format.
+ name:
type: string
- description: The refusal text that is finalized.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: |-
+ 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.
+ schema:
+ $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema'
+ strict:
+ anyOf:
+ - type: boolean
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when refusal text is finalized.
+ - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
+ description: |-
+ JSON Schema response format. Used to generate structured JSON responses.
+ Learn more about [Structured Outputs](/docs/guides/structured-outputs).
+ title: JSON schema
+ OpenAI.ThreadObject:
+ type: object
+ required:
+ - id
+ - object
+ - created_at
+ - tool_resources
+ - metadata
+ properties:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
+ type: string
+ enum:
+ - thread
+ description: The object type, which is always `thread`.
+ x-stainless-const: true
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the thread was created.
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ThreadObjectToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: Represents a thread that contains [messages](/docs/api-reference/messages).
+ title: Thread
x-oaiMeta:
- name: response.refusal.done
- group: responses
+ name: The thread object
+ beta: true
example: |
{
- "type": "response.refusal.done",
- "item_id": "item-abc",
- "output_index": 1,
- "content_index": 2,
- "refusal": "final refusal text",
- "sequence_number": 1
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1698107661,
+ "metadata": {}
}
- OpenAI.ResponseStreamEvent:
+ OpenAI.ThreadObjectToolResources:
+ type: object
+ properties:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.ThreadObjectToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.ThreadObjectToolResourcesFileSearch'
+ OpenAI.ThreadObjectToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 20
+ OpenAI.ThreadObjectToolResourcesFileSearch:
+ type: object
+ properties:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ OpenAI.TokenLimits:
+ type: object
+ properties:
+ post_instructions:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
+ OpenAI.Tool:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEventType'
+ $ref: '#/components/schemas/OpenAI.ToolType'
discriminator:
propertyName: type
mapping:
- response.audio.transcript.delta: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent'
- response.code_interpreter_call_code.delta: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent'
- response.code_interpreter_call.in_progress: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent'
- response.code_interpreter_call.interpreting: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent'
- response.content_part.added: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent'
- response.created: '#/components/schemas/OpenAI.ResponseCreatedEvent'
- error: '#/components/schemas/OpenAI.ResponseErrorEvent'
- response.file_search_call.in_progress: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent'
- response.file_search_call.searching: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent'
- response.function_call_arguments.delta: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent'
- response.in_progress: '#/components/schemas/OpenAI.ResponseInProgressEvent'
- response.failed: '#/components/schemas/OpenAI.ResponseFailedEvent'
- response.incomplete: '#/components/schemas/OpenAI.ResponseIncompleteEvent'
- response.output_item.added: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent'
- response.reasoning_summary_part.added: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent'
- response.reasoning_summary_text.delta: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent'
- response.reasoning_text.delta: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent'
- response.refusal.delta: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent'
- response.output_text.delta: '#/components/schemas/OpenAI.ResponseTextDeltaEvent'
- response.web_search_call.in_progress: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent'
- response.web_search_call.searching: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent'
- response.image_generation_call.generating: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent'
- response.image_generation_call.in_progress: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent'
- response.image_generation_call.partial_image: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent'
- response.mcp_call_arguments.delta: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent'
- response.mcp_call.failed: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent'
- response.mcp_call.in_progress: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent'
- response.mcp_list_tools.failed: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent'
- response.mcp_list_tools.in_progress: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent'
- response.output_text.annotation.added: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent'
- response.queued: '#/components/schemas/OpenAI.ResponseQueuedEvent'
- response.custom_tool_call_input.delta: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent'
- response.audio.done: '#/components/schemas/OpenAI.ResponseAudioDoneEvent'
- response.audio.transcript.done: '#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent'
- response.code_interpreter_call_code.done: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent'
- response.code_interpreter_call.completed: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent'
- response.completed: '#/components/schemas/OpenAI.ResponseCompletedEvent'
- response.content_part.done: '#/components/schemas/OpenAI.ResponseContentPartDoneEvent'
- response.file_search_call.completed: '#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent'
- response.function_call_arguments.done: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent'
- response.output_item.done: '#/components/schemas/OpenAI.ResponseOutputItemDoneEvent'
- response.reasoning_summary_part.done: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent'
- response.reasoning_summary_text.done: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent'
- response.reasoning_text.done: '#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent'
- response.refusal.done: '#/components/schemas/OpenAI.ResponseRefusalDoneEvent'
- response.output_text.done: '#/components/schemas/OpenAI.ResponseTextDoneEvent'
- response.web_search_call.completed: '#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent'
- response.image_generation_call.completed: '#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent'
- response.mcp_call_arguments.done: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent'
- response.mcp_call.completed: '#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent'
- response.mcp_list_tools.completed: '#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent'
- response.custom_tool_call_input.done: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent'
- response.audio.delta: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent'
- OpenAI.ResponseStreamEventType:
- anyOf:
- - type: string
- - type: string
- enum:
- - response.audio.delta
- - response.audio.done
- - response.audio.transcript.delta
- - response.audio.transcript.done
- - response.code_interpreter_call_code.delta
- - response.code_interpreter_call_code.done
- - response.code_interpreter_call.completed
- - response.code_interpreter_call.in_progress
- - response.code_interpreter_call.interpreting
- - response.completed
- - response.content_part.added
- - response.content_part.done
- - response.created
- - error
- - response.file_search_call.completed
- - response.file_search_call.in_progress
- - response.file_search_call.searching
- - response.function_call_arguments.delta
- - response.function_call_arguments.done
- - response.in_progress
- - response.failed
- - response.incomplete
- - response.output_item.added
- - response.output_item.done
- - response.reasoning_summary_part.added
- - response.reasoning_summary_part.done
- - response.reasoning_summary_text.delta
- - response.reasoning_summary_text.done
- - response.reasoning_text.delta
- - response.reasoning_text.done
- - response.refusal.delta
- - response.refusal.done
- - response.output_text.delta
- - response.output_text.done
- - response.web_search_call.completed
- - response.web_search_call.in_progress
- - response.web_search_call.searching
- - response.image_generation_call.completed
- - response.image_generation_call.generating
- - response.image_generation_call.in_progress
- - response.image_generation_call.partial_image
- - response.mcp_call_arguments.delta
- - response.mcp_call_arguments.done
- - response.mcp_call.completed
- - response.mcp_call.failed
- - response.mcp_call.in_progress
- - response.mcp_list_tools.completed
- - response.mcp_list_tools.failed
- - response.mcp_list_tools.in_progress
- - response.output_text.annotation.added
- - response.queued
- - response.custom_tool_call_input.delta
- - response.custom_tool_call_input.done
- OpenAI.ResponseStreamOptions:
- type: object
- properties:
- include_obfuscation:
- type: boolean
- description: |-
- 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.
- description: 'Options for streaming responses. Only set this when you set `stream: true`.'
- OpenAI.ResponseTextDeltaEvent:
+ bing_grounding: '#/components/schemas/BingGroundingTool'
+ fabric_dataagent_preview: '#/components/schemas/MicrosoftFabricPreviewTool'
+ sharepoint_grounding_preview: '#/components/schemas/SharepointPreviewTool'
+ azure_ai_search: '#/components/schemas/AzureAISearchTool'
+ openapi: '#/components/schemas/OpenApiTool'
+ bing_custom_search_preview: '#/components/schemas/BingCustomSearchPreviewTool'
+ browser_automation_preview: '#/components/schemas/BrowserAutomationPreviewTool'
+ azure_function: '#/components/schemas/AzureFunctionTool'
+ capture_structured_outputs: '#/components/schemas/CaptureStructuredOutputsTool'
+ a2a_preview: '#/components/schemas/A2APreviewTool'
+ work_iq_preview: '#/components/schemas/WorkIQPreviewTool'
+ fabric_iq_preview: '#/components/schemas/FabricIQPreviewTool'
+ web_iq_preview: '#/components/schemas/WebIQPreviewTool'
+ memory_search_preview: '#/components/schemas/MemorySearchPreviewTool'
+ code_interpreter: '#/components/schemas/OpenAI.CodeInterpreterTool'
+ function: '#/components/schemas/OpenAI.FunctionTool'
+ file_search: '#/components/schemas/OpenAI.FileSearchTool'
+ computer_use_preview: '#/components/schemas/OpenAI.ComputerUsePreviewTool'
+ web_search: '#/components/schemas/OpenAI.WebSearchTool'
+ mcp: '#/components/schemas/OpenAI.MCPTool'
+ image_generation: '#/components/schemas/OpenAI.ImageGenTool'
+ local_shell: '#/components/schemas/OpenAI.LocalShellToolParam'
+ shell: '#/components/schemas/OpenAI.FunctionShellToolParam'
+ custom: '#/components/schemas/OpenAI.CustomToolParam'
+ web_search_preview: '#/components/schemas/OpenAI.WebSearchPreviewTool'
+ apply_patch: '#/components/schemas/OpenAI.ApplyPatchToolParam'
+ computer: '#/components/schemas/OpenAI.ComputerTool'
+ namespace: '#/components/schemas/OpenAI.NamespaceToolParam'
+ tool_search: '#/components/schemas/OpenAI.ToolSearchToolParam'
+ description: A tool that can be used to generate a response.
+ OpenAI.ToolChoiceAllowed:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - delta
- - sequence_number
- - logprobs
+ - mode
+ - tools
properties:
type:
type: string
enum:
- - response.output_text.delta
- description: The type of the event. Always `response.output_text.delta`.
+ - allowed_tools
+ description: Allowed tool configuration type. Always `allowed_tools`.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the output item that the text delta was added to.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the text delta was added to.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that the text delta was added to.
- delta:
+ mode:
type: string
- description: The text delta that was added.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number for this event.
- logprobs:
+ enum:
+ - auto
+ - required
+ description: |-
+ 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.
+ tools:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ResponseLogProb'
- description: The log probabilities of the tokens in the delta.
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ 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" }
+ ]
+ ```
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is an additional text delta.
- x-oaiMeta:
- name: response.output_text.delta
- group: responses
- example: |
- {
- "type": "response.output_text.delta",
- "item_id": "msg_123",
- "output_index": 0,
- "content_index": 0,
- "delta": "In",
- "sequence_number": 1
- }
- OpenAI.ResponseTextDoneEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Constrains the tools available to the model to a pre-defined set.
+ title: Allowed tools
+ OpenAI.ToolChoiceCodeInterpreter:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - text
- - sequence_number
- - logprobs
properties:
type:
type: string
enum:
- - response.output_text.done
- description: The type of the event. Always `response.output_text.done`.
- x-stainless-const: true
- item_id:
- type: string
- description: The ID of the output item that the text content is finalized.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the text content is finalized.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that the text content is finalized.
- text:
- type: string
- description: The text content that is finalized.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number for this event.
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ResponseLogProb'
- description: The log probabilities of the tokens in the delta.
+ - code_interpreter
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when text content is finalized.
- x-oaiMeta:
- name: response.output_text.done
- group: responses
- example: |
- {
- "type": "response.output_text.done",
- "item_id": "msg_123",
- "output_index": 0,
- "content_index": 0,
- "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
- "sequence_number": 1
- }
- OpenAI.ResponseTextParam:
- type: object
- properties:
- format:
- $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- verbosity:
- $ref: '#/components/schemas/OpenAI.Verbosity'
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
description: |-
- Configuration options for a text response from the model. Can be plain
- text or structured JSON data. Learn more:
- - [Text inputs and outputs](/docs/guides/text)
- - [Structured Outputs](/docs/guides/structured-outputs)
- OpenAI.ResponseUsage:
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceComputer:
type: object
required:
- - input_tokens
- - input_tokens_details
- - output_tokens
- - output_tokens_details
- - total_tokens
+ - type
properties:
- input_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The number of input tokens.
- input_tokens_details:
- $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails'
- description: A detailed breakdown of the input tokens.
- output_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The number of output tokens.
- output_tokens_details:
- $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails'
- description: A detailed breakdown of the output tokens.
- total_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The total number of tokens used.
+ type:
+ type: string
+ enum:
+ - computer
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
description: |-
- Represents token usage details including input tokens, output tokens,
- a breakdown of output tokens, and the total tokens used.
- OpenAI.ResponseUsageInputTokensDetails:
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceComputerUse:
type: object
required:
- - cached_tokens
+ - type
properties:
- cached_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- OpenAI.ResponseUsageOutputTokensDetails:
+ type:
+ type: string
+ enum:
+ - computer_use
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceComputerUsePreview:
type: object
required:
- - reasoning_tokens
+ - type
properties:
- reasoning_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- OpenAI.ResponseWebSearchCallCompletedEvent:
+ type:
+ type: string
+ enum:
+ - computer_use_preview
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceCustom:
type: object
required:
- type
- - output_index
- - item_id
- - sequence_number
+ - name
properties:
type:
type: string
enum:
- - response.web_search_call.completed
- description: The type of the event. Always `response.web_search_call.completed`.
+ - custom
+ description: For custom tool calling, the type is always `custom`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the web search call is associated with.
- item_id:
+ name:
type: string
- description: Unique ID for the output item associated with the web search call.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the web search call being processed.
+ description: The name of the custom tool to call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a web search call is completed.
- x-oaiMeta:
- name: response.web_search_call.completed
- group: responses
- example: |
- {
- "type": "response.web_search_call.completed",
- "output_index": 0,
- "item_id": "ws_123",
- "sequence_number": 0
- }
- OpenAI.ResponseWebSearchCallInProgressEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Use this option to force the model to call a specific custom tool.
+ title: Custom tool
+ OpenAI.ToolChoiceFileSearch:
type: object
required:
- type
- - output_index
- - item_id
- - sequence_number
properties:
type:
type: string
enum:
- - response.web_search_call.in_progress
- description: The type of the event. Always `response.web_search_call.in_progress`.
- x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the web search call is associated with.
- item_id:
- type: string
- description: Unique ID for the output item associated with the web search call.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the web search call being processed.
+ - file_search
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a web search call is initiated.
- x-oaiMeta:
- name: response.web_search_call.in_progress
- group: responses
- example: |
- {
- "type": "response.web_search_call.in_progress",
- "output_index": 0,
- "item_id": "ws_123",
- "sequence_number": 0
- }
- OpenAI.ResponseWebSearchCallSearchingEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceFunction:
type: object
required:
- type
- - output_index
- - item_id
- - sequence_number
+ - name
properties:
type:
type: string
enum:
- - response.web_search_call.searching
- description: The type of the event. Always `response.web_search_call.searching`.
+ - function
+ description: For function calling, the type is always `function`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the web search call is associated with.
- item_id:
+ name:
type: string
- description: Unique ID for the output item associated with the web search call.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the web search call being processed.
+ description: The name of the function to call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a web search call is executing.
- x-oaiMeta:
- name: response.web_search_call.searching
- group: responses
- example: |
- {
- "type": "response.web_search_call.searching",
- "output_index": 0,
- "item_id": "ws_123",
- "sequence_number": 0
- }
- OpenAI.ScreenshotParam:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Use this option to force the model to call a specific function.
+ title: Function tool
+ OpenAI.ToolChoiceImageGeneration:
type: object
required:
- type
@@ -33565,157 +69497,416 @@ components:
type:
type: string
enum:
- - screenshot
- description: Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
- x-stainless-const: true
+ - image_generation
allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A screenshot action.
- title: Screenshot
- OpenAI.ScrollParam:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceMCP:
type: object
required:
- type
- - x
- - 'y'
- - scroll_x
- - scroll_y
+ - server_label
properties:
type:
type: string
enum:
- - scroll
- description: Specifies the event type. For a scroll action, this property is always set to `scroll`.
+ - mcp
+ description: For MCP tools, the type is always `mcp`.
x-stainless-const: true
- x:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate where the scroll occurred.
- 'y':
- $ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate where the scroll occurred.
- scroll_x:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The horizontal scroll distance.
- scroll_y:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The vertical scroll distance.
- keys:
+ server_label:
+ type: string
+ description: The label of the MCP server to use.
+ name:
anyOf:
- - type: array
- items:
- type: string
+ - type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A scroll action.
- title: Scroll
- OpenAI.SearchContentType:
- type: string
- enum:
- - text
- - image
- OpenAI.SearchContextSize:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Use this option to force the model to call a specific tool on a remote MCP server.
+ title: MCP tool
+ OpenAI.ToolChoiceOptions:
type: string
enum:
- - low
- - medium
- - high
- OpenAI.ServiceTier:
+ - none
+ - auto
+ - required
+ description: |-
+ Controls which (if any) tool is called by the model.
+ `none` means the model will not call any tool and instead generates a message.
+ `auto` means the model can pick between generating a message or calling one or
+ more tools.
+ `required` means the model must call one or more tools.
+ title: Tool choice mode
+ OpenAI.ToolChoiceParam:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.ToolChoiceParamType'
+ discriminator:
+ propertyName: type
+ mapping:
+ allowed_tools: '#/components/schemas/OpenAI.ToolChoiceAllowed'
+ function: '#/components/schemas/OpenAI.ToolChoiceFunction'
+ mcp: '#/components/schemas/OpenAI.ToolChoiceMCP'
+ custom: '#/components/schemas/OpenAI.ToolChoiceCustom'
+ apply_patch: '#/components/schemas/OpenAI.SpecificApplyPatchParam'
+ shell: '#/components/schemas/OpenAI.SpecificFunctionShellParam'
+ file_search: '#/components/schemas/OpenAI.ToolChoiceFileSearch'
+ web_search_preview: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview'
+ computer_use_preview: '#/components/schemas/OpenAI.ToolChoiceComputerUsePreview'
+ web_search_preview_2025_03_11: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311'
+ image_generation: '#/components/schemas/OpenAI.ToolChoiceImageGeneration'
+ code_interpreter: '#/components/schemas/OpenAI.ToolChoiceCodeInterpreter'
+ computer: '#/components/schemas/OpenAI.ToolChoiceComputer'
+ computer_use: '#/components/schemas/OpenAI.ToolChoiceComputerUse'
+ description: |-
+ 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.
+ OpenAI.ToolChoiceParamType:
anyOf:
+ - type: string
- type: string
enum:
- - auto
- - default
- - flex
- - scale
- - priority
- - type: 'null'
+ - allowed_tools
+ - function
+ - mcp
+ - custom
+ - apply_patch
+ - shell
+ - file_search
+ - web_search_preview
+ - computer_use_preview
+ - web_search_preview_2025_03_11
+ - image_generation
+ - code_interpreter
+ - computer
+ - computer_use
+ OpenAI.ToolChoiceWebSearchPreview:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - web_search_preview
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
description: |-
- Specifies the processing type used for serving the request.
- - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.
- - When not set, the default behavior is 'auto'.
- 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.
- OpenAI.ServiceTierEnum:
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceWebSearchPreview20250311:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - web_search_preview_2025_03_11
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolSearchExecutionType:
type: string
enum:
- - auto
- - default
- - flex
- - priority
- OpenAI.SkillReferenceParam:
+ - server
+ - client
+ OpenAI.ToolSearchToolParam:
type: object
required:
- type
- - skill_id
properties:
type:
type: string
enum:
- - skill_reference
- description: References a skill created with the /v1/skills endpoint.
+ - tool_search
+ description: The type of the tool. Always `tool_search`.
x-stainless-const: true
- skill_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The ID of the referenced skill.
- version:
- type: string
- description: Optional skill version. Use a positive integer or 'latest'. Omit for default.
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search is executed by the server or by the client.
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ parameters:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EmptyModelParam'
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ContainerSkill'
- OpenAI.SpecificApplyPatchParam:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: Hosted or BYOT tool search configuration for deferred tools.
+ title: Tool search tool
+ OpenAI.ToolType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - function
+ - file_search
+ - computer
+ - computer_use_preview
+ - web_search
+ - mcp
+ - code_interpreter
+ - image_generation
+ - local_shell
+ - shell
+ - custom
+ - namespace
+ - tool_search
+ - web_search_preview
+ - apply_patch
+ - a2a_preview
+ - bing_custom_search_preview
+ - browser_automation_preview
+ - fabric_dataagent_preview
+ - sharepoint_grounding_preview
+ - memory_search_preview
+ - work_iq_preview
+ - fabric_iq_preview
+ - web_iq_preview
+ - toolbox_search_preview
+ - azure_ai_search
+ - azure_function
+ - bing_grounding
+ - capture_structured_outputs
+ - openapi
+ OpenAI.ToolsArray:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: |-
+ 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.
+ We support the following categories of tools:
+ - **Built-in tools**: Tools that are provided by OpenAI that extend the
+ model's capabilities, like [web search](/docs/guides/tools-web-search)
+ or [file search](/docs/guides/tools-file-search). Learn more about
+ [built-in tools](/docs/guides/tools).
+ - **MCP Tools**: Integrations with third-party systems via custom MCP servers
+ or predefined connectors such as Google Drive and SharePoint. Learn more about
+ [MCP Tools](/docs/guides/tools-connectors-mcp).
+ - **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](/docs/guides/function-calling). You can also use
+ custom tools to call your own code.
+ OpenAI.TopLogProb:
+ type: object
+ required:
+ - token
+ - logprob
+ - bytes
+ properties:
+ token:
+ type: string
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ bytes:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The top log probability of a token.
+ title: Top log probability
+ OpenAI.TranscriptTextUsageDuration:
type: object
required:
- type
+ - seconds
properties:
type:
type: string
enum:
- - apply_patch
- description: The tool to call. Always `apply_patch`.
+ - duration
+ description: The type of the usage object. Always `duration` for this variant.
x-stainless-const: true
+ seconds:
+ type: integer
+ format: int64
+ description: Duration of the input audio in seconds.
+ x-ms-duration: seconds
allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Forces the model to call the apply_patch tool when executing a tool call.
- title: Specific apply patch tool choice
- OpenAI.SpecificFunctionShellParam:
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage'
+ description: Usage statistics for models billed by audio input duration.
+ title: Duration Usage
+ OpenAI.TranscriptTextUsageTokens:
type: object
required:
- type
+ - input_tokens
+ - output_tokens
+ - total_tokens
properties:
type:
type: string
enum:
- - shell
- description: The tool to call. Always `shell`.
+ - tokens
+ description: The type of the usage object. Always `tokens` for this variant.
x-stainless-const: true
+ input_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of input tokens billed for this request.
+ input_token_details:
+ $ref: '#/components/schemas/OpenAI.TranscriptTextUsageTokensInputTokenDetails'
+ description: Details about the input tokens billed for this request.
+ output_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of output tokens generated.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Total number of tokens used (input + output).
allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Forces the model to call the shell tool when a tool call is required.
- title: Specific shell tool choice
- OpenAI.SummaryTextContent:
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage'
+ description: Usage statistics for models billed by token usage.
+ title: Token Usage
+ OpenAI.TranscriptTextUsageTokensInputTokenDetails:
+ type: object
+ properties:
+ text_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ audio_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.TranscriptionDiarizedSegment:
type: object
required:
- type
+ - id
+ - start
+ - end
- text
+ - speaker
properties:
type:
type: string
enum:
- - summary_text
- description: The type of the object. Always `summary_text`.
+ - transcript.text.segment
+ description: The type of the segment. Always `transcript.text.segment`.
x-stainless-const: true
+ id:
+ type: string
+ description: Unique identifier for the segment.
+ start:
+ type: integer
+ format: int64
+ description: Start timestamp of the segment in seconds.
+ x-ms-duration: seconds
+ end:
+ type: integer
+ format: int64
+ description: End timestamp of the segment in seconds.
+ x-ms-duration: seconds
text:
type: string
- description: A summary of the reasoning output from the model so far.
- allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A summary text from the model.
- title: Summary text
- OpenAI.TextContent:
+ description: Transcript text for this segment.
+ speaker:
+ type: string
+ description: Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).
+ description: A segment of diarized transcript text with speaker metadata.
+ OpenAI.TranscriptionInclude:
+ type: string
+ enum:
+ - logprobs
+ OpenAI.TranscriptionSegment:
+ type: object
+ required:
+ - id
+ - seek
+ - start
+ - end
+ - text
+ - tokens
+ - temperature
+ - avg_logprob
+ - compression_ratio
+ - no_speech_prob
+ properties:
+ id:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Unique identifier of the segment.
+ seek:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Seek offset of the segment.
+ start:
+ type: integer
+ format: int64
+ description: Start time of the segment in seconds.
+ x-ms-duration: seconds
+ end:
+ type: integer
+ format: int64
+ description: End time of the segment in seconds.
+ x-ms-duration: seconds
+ text:
+ type: string
+ description: Text content of the segment.
+ tokens:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Array of token IDs for the text content.
+ temperature:
+ type: number
+ format: float
+ description: Temperature parameter used for generating the segment.
+ avg_logprob:
+ type: number
+ format: float
+ description: Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
+ compression_ratio:
+ type: number
+ format: float
+ description: Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
+ no_speech_prob:
+ type: number
+ format: float
+ description: 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.
+ OpenAI.TranscriptionWord:
+ type: object
+ required:
+ - word
+ - start
+ - end
+ properties:
+ word:
+ type: string
+ description: The text content of the word.
+ start:
+ type: integer
+ format: int64
+ description: Start time of the word in seconds.
+ x-ms-duration: seconds
+ end:
+ type: integer
+ format: int64
+ description: End time of the word in seconds.
+ x-ms-duration: seconds
+ OpenAI.TruncationObject:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - auto
+ - last_messages
+ description: 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`.
+ last_messages:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.
+ title: Thread Truncation Controls
+ OpenAI.TypeParam:
type: object
required:
- type
@@ -33724,619 +69915,924 @@ components:
type:
type: string
enum:
- - text
+ - type
+ description: Specifies the event type. For a type action, this property is always set to `type`.
x-stainless-const: true
text:
type: string
+ description: The text to type.
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A text content.
- title: Text Content
- OpenAI.TextResponseFormatConfiguration:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: An action to type in text.
+ title: Type
+ OpenAI.UpdateChatCompletionParametersBody:
type: object
required:
- - type
+ - metadata
properties:
- type:
- $ref: '#/components/schemas/OpenAI.TextResponseFormatConfigurationType'
- discriminator:
- propertyName: type
- mapping:
- json_schema: '#/components/schemas/OpenAI.TextResponseFormatJsonSchema'
- text: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText'
- json_object: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject'
- description: |-
- An object specifying the format that the model must output.
- Configuring `{ "type": "json_schema" }` enables Structured Outputs,
- which ensures the model will match your supplied JSON schema. Learn more in the
- [Structured Outputs guide](/docs/guides/structured-outputs).
- The default format is `{ "type": "text" }` with no additional options.
- *Not recommended for gpt-4o and newer models:**
- 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.
- OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.UpdateConversationBody:
+ type: object
+ required:
+ - metadata
+ properties:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ OpenAI.UpdateVectorStoreFileAttributesRequest:
+ type: object
+ required:
+ - attributes
+ properties:
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ x-oaiMeta:
+ name: Update vector store file attributes request
+ OpenAI.UpdateVectorStoreRequest:
+ type: object
+ properties:
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: The name of the vector store.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.Upload:
type: object
required:
- - type
+ - id
+ - created_at
+ - filename
+ - bytes
+ - purpose
+ - status
+ - expires_at
properties:
- type:
+ id:
+ type: string
+ description: The Upload unique identifier, which can be referenced in API endpoints.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the Upload was created.
+ filename:
+ type: string
+ description: The name of the file to be uploaded.
+ bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The intended number of bytes to be uploaded.
+ purpose:
+ type: string
+ description: The intended purpose of the file. [Please refer here](/docs/api-reference/files/object#files/object-purpose) for acceptable values.
+ status:
type: string
enum:
- - json_object
- description: The type of response format being defined. Always `json_object`.
+ - pending
+ - completed
+ - cancelled
+ - expired
+ description: The status of the Upload.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the Upload will expire.
+ object:
+ type: string
+ enum:
+ - upload
+ description: The object type, which is always "upload".
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- description: |-
- JSON object response format. An older method of generating JSON responses.
- Using `json_schema` is recommended for models that support it. Note that the
- model will not generate JSON without a system or user message instructing it
- to do so.
- title: JSON object
- OpenAI.TextResponseFormatConfigurationResponseFormatText:
+ file:
+ $ref: '#/components/schemas/OpenAI.OpenAIFile'
+ description: The Upload object can accept byte chunks in the form of Parts.
+ title: Upload
+ x-oaiMeta:
+ name: The upload object
+ example: |
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "completed",
+ "expires_at": 1719127296,
+ "file": {
+ "id": "file-xyz321",
+ "object": "file",
+ "bytes": 2147483648,
+ "created_at": 1719186911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ }
+ }
+ OpenAI.UploadPart:
type: object
required:
- - type
+ - id
+ - created_at
+ - upload_id
+ - object
properties:
- type:
+ id:
+ type: string
+ description: The upload Part unique identifier, which can be referenced in API endpoints.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the Part was created.
+ upload_id:
+ type: string
+ description: The ID of the Upload object that this Part was added to.
+ object:
type: string
enum:
- - text
- description: The type of response format being defined. Always `text`.
+ - upload.part
+ description: The object type, which is always `upload.part`.
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- description: Default response format. Used to generate text responses.
- title: Text
- OpenAI.TextResponseFormatConfigurationType:
- anyOf:
- - type: string
- - type: string
- enum:
- - text
- - json_schema
- - json_object
- OpenAI.TextResponseFormatJsonSchema:
+ description: The upload Part represents a chunk of bytes we can add to an Upload object.
+ title: UploadPart
+ x-oaiMeta:
+ name: The upload part object
+ example: |
+ {
+ "id": "part_def456",
+ "object": "upload.part",
+ "created_at": 1719186911,
+ "upload_id": "upload_abc123"
+ }
+ OpenAI.UrlCitationBody:
type: object
required:
- type
- - name
- - schema
+ - url
+ - start_index
+ - end_index
+ - title
properties:
type:
type: string
enum:
- - json_schema
- description: The type of response format being defined. Always `json_schema`.
+ - url_citation
+ description: The type of the URL citation. Always `url_citation`.
x-stainless-const: true
- description:
+ url:
type: string
- description: |-
- A description of what the response format is for, used by the model to
- determine how to respond in the format.
- name:
+ format: uri
+ description: The URL of the web resource.
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the first character of the URL citation in the message.
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the last character of the URL citation in the message.
+ title:
type: string
- description: |-
- 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.
- schema:
- $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
+ description: The title of the web resource.
allOf:
- - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- description: |-
- JSON Schema response format. Used to generate structured JSON responses.
- Learn more about [Structured Outputs](/docs/guides/structured-outputs).
- title: JSON schema
- OpenAI.Tool:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.ToolType'
- discriminator:
- propertyName: type
- mapping:
- bing_grounding: '#/components/schemas/BingGroundingTool'
- fabric_dataagent_preview: '#/components/schemas/MicrosoftFabricPreviewTool'
- sharepoint_grounding_preview: '#/components/schemas/SharepointPreviewTool'
- azure_ai_search: '#/components/schemas/AzureAISearchTool'
- openapi: '#/components/schemas/OpenApiTool'
- bing_custom_search_preview: '#/components/schemas/BingCustomSearchPreviewTool'
- browser_automation_preview: '#/components/schemas/BrowserAutomationPreviewTool'
- azure_function: '#/components/schemas/AzureFunctionTool'
- capture_structured_outputs: '#/components/schemas/CaptureStructuredOutputsTool'
- a2a_preview: '#/components/schemas/A2APreviewTool'
- work_iq_preview: '#/components/schemas/WorkIQPreviewTool'
- fabric_iq_preview: '#/components/schemas/FabricIQPreviewTool'
- memory_search_preview: '#/components/schemas/MemorySearchPreviewTool'
- code_interpreter: '#/components/schemas/OpenAI.CodeInterpreterTool'
- file_search: '#/components/schemas/OpenAI.FileSearchTool'
- web_search: '#/components/schemas/OpenAI.WebSearchTool'
- mcp: '#/components/schemas/OpenAI.MCPTool'
- function: '#/components/schemas/OpenAI.FunctionTool'
- computer_use_preview: '#/components/schemas/OpenAI.ComputerUsePreviewTool'
- image_generation: '#/components/schemas/OpenAI.ImageGenTool'
- local_shell: '#/components/schemas/OpenAI.LocalShellToolParam'
- shell: '#/components/schemas/OpenAI.FunctionShellToolParam'
- custom: '#/components/schemas/OpenAI.CustomToolParam'
- web_search_preview: '#/components/schemas/OpenAI.WebSearchPreviewTool'
- apply_patch: '#/components/schemas/OpenAI.ApplyPatchToolParam'
- computer: '#/components/schemas/OpenAI.ComputerTool'
- namespace: '#/components/schemas/OpenAI.NamespaceToolParam'
- tool_search: '#/components/schemas/OpenAI.ToolSearchToolParam'
- description: A tool that can be used to generate a response.
- OpenAI.ToolChoiceAllowed:
+ - $ref: '#/components/schemas/OpenAI.Annotation'
+ description: A citation for a web resource used to generate a model response.
+ title: URL citation
+ OpenAI.VadConfig:
type: object
required:
- type
- - mode
- - tools
properties:
type:
type: string
enum:
- - allowed_tools
- description: Allowed tool configuration type. Always `allowed_tools`.
- x-stainless-const: true
- mode:
- type: string
- enum:
- - auto
- - required
+ - server_vad
+ description: Must be set to `server_vad` to enable manual chunking using server side VAD.
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
description: |-
- 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.
- tools:
- type: array
- items:
- type: object
- unevaluatedProperties: {}
+ Amount of audio to include before the VAD detected speech (in
+ milliseconds).
+ default: 300
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
description: |-
- 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" }
- ]
- ```
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Constrains the tools available to the model to a pre-defined set.
- title: Allowed tools
- OpenAI.ToolChoiceCodeInterpreter:
+ 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.
+ default: 200
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: |-
+ 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.
+ default: 0.5
+ OpenAI.ValidateGraderRequest:
type: object
required:
- - type
+ - grader
properties:
- type:
- type: string
- enum:
- - code_interpreter
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceComputer:
+ grader:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderMulti'
+ description: The grader used for the fine-tuning job.
+ title: ValidateGraderRequest
+ OpenAI.ValidateGraderResponse:
+ type: object
+ properties:
+ grader:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderMulti'
+ description: The grader used for the fine-tuning job.
+ title: ValidateGraderResponse
+ OpenAI.VectorStoreExpirationAfter:
type: object
required:
- - type
+ - anchor
+ - days
properties:
- type:
+ anchor:
type: string
enum:
- - computer
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ - last_active_at
+ description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.'
+ x-stainless-const: true
+ days:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 1
+ maximum: 365
+ description: The number of days after the anchor time that the vector store will expire.
+ description: The expiration policy for a vector store.
+ title: Vector store expiration policy
+ OpenAI.VectorStoreFileAttributes:
+ type: object
+ unevaluatedProperties:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: boolean
description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceComputerUse:
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard. Keys are strings
+ with a maximum length of 64 characters. Values are strings with a maximum
+ length of 512 characters, booleans, or numbers.
+ x-oaiTypeLabel: map
+ OpenAI.VectorStoreFileBatchObject:
type: object
required:
- - type
+ - id
+ - object
+ - created_at
+ - vector_store_id
+ - status
+ - file_counts
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - computer_use
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceComputerUsePreview:
+ - vector_store.files_batch
+ description: The object type, which is always `vector_store.file_batch`.
+ x-stainless-const: true
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the vector store files batch was created.
+ vector_store_id:
+ type: string
+ description: The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) is attached to.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - cancelled
+ - failed
+ description: The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`.
+ file_counts:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObjectFileCounts'
+ description: A batch of files attached to a vector store.
+ title: Vector store file batch
+ x-oaiMeta:
+ name: The vector store files batch object
+ beta: true
+ example: |
+ {
+ "id": "vsfb_123",
+ "object": "vector_store.files_batch",
+ "created_at": 1698107661,
+ "vector_store_id": "vs_abc123",
+ "status": "completed",
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 100,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 100
+ }
+ }
+ OpenAI.VectorStoreFileBatchObjectFileCounts:
type: object
required:
- - type
+ - in_progress
+ - completed
+ - failed
+ - cancelled
+ - total
properties:
- type:
- type: string
- enum:
- - computer_use_preview
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceCustom:
+ in_progress:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cancelled:
+ $ref: '#/components/schemas/OpenAI.integer'
+ total:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.VectorStoreFileContentResponse:
type: object
required:
- - type
- - name
+ - object
+ - data
+ - has_more
+ - next_page
properties:
- type:
+ object:
type: string
enum:
- - custom
- description: For custom tool calling, the type is always `custom`.
+ - vector_store.file_content.page
+ description: The object type, which is always `vector_store.file_content.page`
x-stainless-const: true
- name:
- type: string
- description: The name of the custom tool to call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Use this option to force the model to call a specific custom tool.
- title: Custom tool
- OpenAI.ToolChoiceFileSearch:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileContentResponseData'
+ description: Parsed content of the file.
+ has_more:
+ type: boolean
+ description: Indicates if there are more content pages to fetch.
+ next_page:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: Represents the parsed content of a vector store file.
+ OpenAI.VectorStoreFileContentResponseData:
type: object
- required:
- - type
properties:
type:
type: string
- enum:
- - file_search
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceFunction:
+ text:
+ type: string
+ OpenAI.VectorStoreFileObject:
type: object
required:
- - type
- - name
+ - id
+ - object
+ - usage_bytes
+ - created_at
+ - vector_store_id
+ - status
+ - last_error
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - function
- description: For function calling, the type is always `function`.
+ - vector_store.file
+ description: The object type, which is always `vector_store.file`.
x-stainless-const: true
- name:
+ usage_bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total vector store usage in bytes. Note that this may be different from the original file size.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the vector store file was created.
+ vector_store_id:
type: string
- description: The name of the function to call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Use this option to force the model to call a specific function.
- title: Function tool
- OpenAI.ToolChoiceImageGeneration:
+ description: The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) is attached to.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - cancelled
+ - failed
+ description: 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.
+ last_error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileObjectLastError'
+ - type: 'null'
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ chunking_strategy:
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse'
+ description: A list of files attached to a vector store.
+ title: Vector store files
+ x-oaiMeta:
+ name: The vector store file object
+ beta: true
+ example: |
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "usage_bytes": 1234,
+ "created_at": 1698107661,
+ "vector_store_id": "vs_abc123",
+ "status": "completed",
+ "last_error": null,
+ "chunking_strategy": {
+ "type": "static",
+ "static": {
+ "max_chunk_size_tokens": 800,
+ "chunk_overlap_tokens": 400
+ }
+ }
+ }
+ OpenAI.VectorStoreFileObjectLastError:
type: object
required:
- - type
+ - code
+ - message
properties:
- type:
+ code:
type: string
enum:
- - image_generation
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceMCP:
+ - server_error
+ - unsupported_file
+ - invalid_file
+ message:
+ type: string
+ OpenAI.VectorStoreObject:
type: object
required:
- - type
- - server_label
+ - id
+ - object
+ - created_at
+ - name
+ - usage_bytes
+ - file_counts
+ - status
+ - last_active_at
+ - metadata
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - mcp
- description: For MCP tools, the type is always `mcp`.
+ - vector_store
+ description: The object type, which is always `vector_store`.
x-stainless-const: true
- server_label:
- type: string
- description: The label of the MCP server to use.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the vector store was created.
name:
+ type: string
+ description: The name of the vector store.
+ usage_bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total number of bytes used by the files in the vector store.
+ file_counts:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObjectFileCounts'
+ status:
+ type: string
+ enum:
+ - expired
+ - in_progress
+ - completed
+ description: 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.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter'
+ expires_at:
anyOf:
- type: string
+ format: date-time
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Use this option to force the model to call a specific tool on a remote MCP server.
- title: MCP tool
- OpenAI.ToolChoiceOptions:
- type: string
- enum:
- - none
- - auto
- - required
- description: |-
- Controls which (if any) tool is called by the model.
- `none` means the model will not call any tool and instead generates a message.
- `auto` means the model can pick between generating a message or calling one or
- more tools.
- `required` means the model must call one or more tools.
- title: Tool choice mode
- OpenAI.ToolChoiceParam:
+ type: integer
+ format: unixTimestamp
+ last_active_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: A vector store is a collection of processed files can be used by the `file_search` tool.
+ title: Vector store
+ x-oaiMeta:
+ name: The vector store object
+ example: |
+ {
+ "id": "vs_123",
+ "object": "vector_store",
+ "created_at": 1698107661,
+ "usage_bytes": 123456,
+ "last_active_at": 1698107661,
+ "name": "my_vector_store",
+ "status": "completed",
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 100,
+ "cancelled": 0,
+ "failed": 0,
+ "total": 100
+ },
+ "last_used_at": 1698107661
+ }
+ OpenAI.VectorStoreObjectFileCounts:
type: object
required:
- - type
+ - in_progress
+ - completed
+ - failed
+ - cancelled
+ - total
+ properties:
+ in_progress:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cancelled:
+ $ref: '#/components/schemas/OpenAI.integer'
+ total:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.VectorStoreSearchRequest:
+ type: object
+ required:
+ - query
+ properties:
+ query:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ description: A query string for a search
+ rewrite_query:
+ type: boolean
+ description: Whether to rewrite the natural language query for vector search.
+ max_num_results:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 1
+ maximum: 50
+ description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
+ default: 10
+ filters:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
+ - $ref: '#/components/schemas/OpenAI.CompoundFilter'
+ description: A filter to apply based on file attributes.
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchRequestRankingOptions'
+ description: Ranking options for search.
+ x-oaiMeta:
+ name: Vector store search request
+ OpenAI.VectorStoreSearchRequestRankingOptions:
+ type: object
properties:
- type:
- $ref: '#/components/schemas/OpenAI.ToolChoiceParamType'
- discriminator:
- propertyName: type
- mapping:
- allowed_tools: '#/components/schemas/OpenAI.ToolChoiceAllowed'
- function: '#/components/schemas/OpenAI.ToolChoiceFunction'
- mcp: '#/components/schemas/OpenAI.ToolChoiceMCP'
- custom: '#/components/schemas/OpenAI.ToolChoiceCustom'
- apply_patch: '#/components/schemas/OpenAI.SpecificApplyPatchParam'
- shell: '#/components/schemas/OpenAI.SpecificFunctionShellParam'
- file_search: '#/components/schemas/OpenAI.ToolChoiceFileSearch'
- web_search_preview: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview'
- computer_use_preview: '#/components/schemas/OpenAI.ToolChoiceComputerUsePreview'
- web_search_preview_2025_03_11: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311'
- image_generation: '#/components/schemas/OpenAI.ToolChoiceImageGeneration'
- code_interpreter: '#/components/schemas/OpenAI.ToolChoiceCodeInterpreter'
- computer: '#/components/schemas/OpenAI.ToolChoiceComputer'
- computer_use: '#/components/schemas/OpenAI.ToolChoiceComputerUse'
- description: |-
- 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.
- OpenAI.ToolChoiceParamType:
- anyOf:
- - type: string
- - type: string
+ ranker:
+ type: string
enum:
- - allowed_tools
- - function
- - mcp
- - custom
- - apply_patch
- - shell
- - file_search
- - web_search_preview
- - computer_use_preview
- - web_search_preview_2025_03_11
- - image_generation
- - code_interpreter
- - computer
- - computer_use
- OpenAI.ToolChoiceWebSearchPreview:
+ - none
+ - auto
+ - default-2024-11-15
+ default: auto
+ score_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ OpenAI.VectorStoreSearchResultContentObject:
type: object
required:
- type
+ - text
properties:
type:
type: string
enum:
- - web_search_preview
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceWebSearchPreview20250311:
+ - text
+ description: The type of content.
+ text:
+ type: string
+ description: The text content returned from search.
+ x-oaiMeta:
+ name: Vector store search result content object
+ OpenAI.VectorStoreSearchResultItem:
type: object
required:
- - type
+ - file_id
+ - filename
+ - score
+ - attributes
+ - content
properties:
- type:
+ file_id:
type: string
- enum:
- - web_search_preview_2025_03_11
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolSearchExecutionType:
- type: string
- enum:
- - server
- - client
- OpenAI.ToolSearchToolParam:
+ description: The ID of the vector store file.
+ filename:
+ type: string
+ description: The name of the vector store file.
+ score:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ description: The similarity score for the result.
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultContentObject'
+ description: Content chunks from the file.
+ x-oaiMeta:
+ name: Vector store search result item
+ OpenAI.VectorStoreSearchResultsPage:
type: object
required:
- - type
+ - object
+ - search_query
+ - data
+ - has_more
+ - next_page
properties:
- type:
+ object:
type: string
enum:
- - tool_search
- description: The type of the tool. Always `tool_search`.
+ - vector_store.search_results.page
+ description: The object type, which is always `vector_store.search_results.page`
x-stainless-const: true
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search is executed by the server or by the client.
- description:
+ search_query:
+ type: array
+ items:
+ type: string
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultItem'
+ description: The list of search result items.
+ has_more:
+ type: boolean
+ description: Indicates if there are more results to fetch.
+ next_page:
anyOf:
- type: string
- type: 'null'
- parameters:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EmptyModelParam'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: Hosted or BYOT tool search configuration for deferred tools.
- title: Tool search tool
- OpenAI.ToolType:
+ x-oaiMeta:
+ name: Vector store search results page
+ OpenAI.Verbosity:
anyOf:
- - type: string
- type: string
enum:
- - function
- - file_search
- - computer
- - computer_use_preview
- - web_search
- - mcp
- - code_interpreter
- - image_generation
- - local_shell
- - shell
- - custom
- - namespace
- - tool_search
- - web_search_preview
- - apply_patch
- - a2a_preview
- - bing_custom_search_preview
- - browser_automation_preview
- - fabric_dataagent_preview
- - sharepoint_grounding_preview
- - memory_search_preview
- - work_iq_preview
- - fabric_iq_preview
- - toolbox_search_preview
- - azure_ai_search
- - azure_function
- - bing_grounding
- - capture_structured_outputs
- - openapi
- OpenAI.ToolsArray:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
+ - low
+ - medium
+ - high
+ - type: 'null'
description: |-
- 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.
- We support the following categories of tools:
- - **Built-in tools**: Tools that are provided by OpenAI that extend the
- model's capabilities, like [web search](/docs/guides/tools-web-search)
- or [file search](/docs/guides/tools-file-search). Learn more about
- [built-in tools](/docs/guides/tools).
- - **MCP Tools**: Integrations with third-party systems via custom MCP servers
- or predefined connectors such as Google Drive and SharePoint. Learn more about
- [MCP Tools](/docs/guides/tools-connectors-mcp).
- - **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](/docs/guides/function-calling). You can also use
- custom tools to call your own code.
- OpenAI.TopLogProb:
+ Constrains the verbosity of the model's response. Lower values will result in
+ more concise responses, while higher values will result in more verbose responses.
+ Currently supported values are `low`, `medium`, and `high`.
+ OpenAI.VideoCharacterResource:
type: object
required:
- - token
- - logprob
- - bytes
+ - id
+ - name
+ - created_at
properties:
- token:
- type: string
- logprob:
- $ref: '#/components/schemas/OpenAI.numeric'
- bytes:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The top log probability of a token.
- title: Top log probability
- OpenAI.TypeParam:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the character was created.
+ OpenAI.VideoContentVariant:
+ type: string
+ enum:
+ - video
+ - thumbnail
+ - spritesheet
+ OpenAI.VideoListResource:
type: object
required:
- - type
- - text
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
+ object:
type: string
enum:
- - type
- description: Specifies the event type. For a type action, this property is always set to `type`.
+ - list
+ description: The type of object returned, must be `list`.
x-stainless-const: true
- text:
- type: string
- description: The text to type.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: An action to type in text.
- title: Type
- OpenAI.UpdateConversationBody:
+ default: list
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ description: A list of items
+ x-ms-list-page-items: true
+ first_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ last_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ description: Whether there are more items available.
+ OpenAI.VideoModel:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - sora-2
+ - sora-2-pro
+ - sora-2-2025-10-06
+ - sora-2-pro-2025-10-06
+ - sora-2-2025-12-08
+ OpenAI.VideoPrompt:
+ type: string
+ minLength: 1
+ maxLength: 32000
+ OpenAI.VideoReferenceInputParam:
type: object
required:
- - metadata
+ - id
properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- OpenAI.UrlCitationBody:
+ id:
+ type: string
+ description: The identifier of the completed video.
+ description: Reference to the completed video.
+ OpenAI.VideoResource:
type: object
required:
- - type
- - url
- - start_index
- - end_index
- - title
+ - id
+ - object
+ - model
+ - status
+ - progress
+ - created_at
+ - completed_at
+ - expires_at
+ - prompt
+ - size
+ - seconds
+ - remixed_from_video_id
+ - error
properties:
- type:
+ id:
+ type: string
+ description: Unique identifier for the video job.
+ object:
type: string
enum:
- - url_citation
- description: The type of the URL citation. Always `url_citation`.
+ - video
+ description: The object type, which is always `video`.
x-stainless-const: true
- url:
- type: string
- format: uri
- description: The URL of the web resource.
- start_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the first character of the URL citation in the message.
- end_index:
+ default: video
+ model:
+ $ref: '#/components/schemas/OpenAI.VideoModel'
+ description: The video generation model that produced the job.
+ status:
+ $ref: '#/components/schemas/OpenAI.VideoStatus'
+ description: Current lifecycle status of the video job.
+ progress:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the last character of the URL citation in the message.
- title:
+ description: Approximate completion percentage for the generation task.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (seconds) for when the job was created.
+ completed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: Unix timestamp (seconds) for when the job completed, if finished.
+ expires_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: Unix timestamp (seconds) for when the downloadable assets expire, if set.
+ prompt:
+ anyOf:
+ - type: string
+ - type: 'null'
+ size:
+ $ref: '#/components/schemas/OpenAI.VideoSize'
+ description: The resolution of the generated video.
+ seconds:
type: string
- description: The title of the web resource.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Annotation'
- description: A citation for a web resource used to generate a model response.
- title: URL citation
- OpenAI.VectorStoreFileAttributes:
- type: object
- unevaluatedProperties:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: boolean
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard. Keys are strings
- with a maximum length of 64 characters. Values are strings with a maximum
- length of 512 characters, booleans, or numbers.
- x-oaiTypeLabel: map
- OpenAI.Verbosity:
+ description: Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
+ remixed_from_video_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Error-2'
+ - type: 'null'
+ description: Structured information describing a generated video job.
+ title: Video job
+ OpenAI.VideoSeconds:
+ type: string
+ enum:
+ - '4'
+ - '8'
+ - '12'
+ OpenAI.VideoSize:
+ type: string
+ enum:
+ - 720x1280
+ - 1280x720
+ - 1024x1792
+ - 1792x1024
+ OpenAI.VideoStatus:
+ type: string
+ enum:
+ - queued
+ - in_progress
+ - completed
+ - failed
+ OpenAI.VoiceIdsOrCustomVoice:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VoiceIdsShared'
+ - type: object
+ properties:
+ id:
+ type: string
+ required:
+ - id
+ description: A built-in voice name or a custom voice reference.
+ title: Voice
+ OpenAI.VoiceIdsShared:
anyOf:
+ - type: string
- type: string
enum:
- - low
- - medium
- - high
- - type: 'null'
- description: |-
- Constrains the verbosity of the model's response. Lower values will result in
- more concise responses, while higher values will result in more verbose responses.
- Currently supported values are `low`, `medium`, and `high`.
+ - alloy
+ - ash
+ - ballad
+ - coral
+ - echo
+ - sage
+ - shimmer
+ - verse
+ - marin
+ - cedar
OpenAI.WaitParam:
type: object
required:
@@ -34466,6 +70962,37 @@ components:
- type: 'null'
description: The approximate location of the user.
title: Web search approximate location
+ OpenAI.WebSearchContextSize:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ description: |-
+ 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.
+ OpenAI.WebSearchLocation:
+ type: object
+ properties:
+ country:
+ type: string
+ description: |-
+ The two-letter
+ [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,
+ e.g. `US`.
+ region:
+ type: string
+ description: Free text input for the region of the user, e.g. `California`.
+ city:
+ type: string
+ description: Free text input for the city of the user, e.g. `San Francisco`.
+ timezone:
+ type: string
+ description: |-
+ The [IANA timezone](https://timeapi.io/documentation/iana-timezones)
+ of the user, e.g. `America/Los_Angeles`.
+ description: Approximate location parameters for the search.
+ title: Web search location
OpenAI.WebSearchPreviewTool:
type: object
required:
@@ -35129,6 +71656,11 @@ components:
evaluation_level:
$ref: '#/components/schemas/EvaluationLevel'
description: Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for per-conversation multi-turn simulation scoring.
+ max_stalls:
+ type: integer
+ format: int32
+ minimum: 1
+ description: Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the score does not improve — so no full validation-set evaluation is triggered. The counter resets whenever a minibatch passes and its full-validation score beats the current best. Only a sustained plateau of `max_stalls` consecutive minibatch failures triggers the stop. When omitted, the optimizer uses its internal default. Must be >= 1 when set.
description: Tuning knobs and run-mode for an optimization job.
x-ms-foundry-meta:
conditional_previews:
@@ -35891,6 +72423,9 @@ components:
allOf:
- $ref: '#/components/schemas/ToolboxTool'
description: A reminder tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
ResponseRetrievalItemGenerationParams:
type: object
required:
@@ -36229,6 +72764,75 @@ components:
x-ms-foundry-meta:
required_previews:
- Evaluations=V1Preview
+ RubricGenerationInputQualityWarning:
+ type: object
+ required:
+ - code
+ - severity
+ - message
+ - source
+ properties:
+ code:
+ $ref: '#/components/schemas/RubricGenerationInputQualityWarningCode'
+ description: Stable searchable machine-readable warning code.
+ severity:
+ $ref: '#/components/schemas/RubricGenerationInputQualityWarningSeverity'
+ description: 'Advisory severity. Initial values: `warning`.'
+ message:
+ type: string
+ description: Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, instruction, dataset, or trace text.
+ source:
+ $ref: '#/components/schemas/RubricGenerationInputQualityWarningSource'
+ description: Which source category the warning applies to. `aggregate` is used only for cross-source warnings.
+ source_index:
+ type: integer
+ format: int32
+ minimum: 0
+ description: Zero-based index into `EvaluatorGenerationJob.inputs.sources` when the warning applies to a specific source. Omitted for aggregate warnings and for warnings not tied to one source.
+ description: A non-fatal advisory produced during rubric evaluator generation when resolved inputs are technically valid but likely too weak to produce a high-quality rubric. Read-only; service-generated. Persisted with the terminal EvaluatorGenerationJob.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ RubricGenerationInputQualityWarningCode:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - empty_prompt
+ - short_prompt
+ - empty_agent_instructions
+ - short_agent_instructions
+ - empty_dataset_content
+ - short_dataset_content
+ - low_trace_count
+ - insufficient_total_input
+ description: Stable searchable machine-readable warning code for a rubric-generation input-quality warning. Values are `snake_case`; clients must tolerate additional service-defined identifiers.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ RubricGenerationInputQualityWarningSeverity:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - warning
+ description: 'Advisory severity for a rubric-generation input-quality warning. Initial value set: `warning`.'
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ RubricGenerationInputQualityWarningSource:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - agent
+ - dataset
+ - aggregate
+ description: Warning source attribution for a rubric-generation input-quality warning. Per-source values (`prompt`, `agent`, `dataset`) match the source category visible to the generation runtime. `aggregate` is a synthetic value used only for warnings computed across successfully resolved sources. `traces` is not exposed because trace sources resolve into dataset content upstream.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
SASCredentials:
type: object
required:
@@ -36564,6 +73168,9 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAI.OutputItem'
description: A SharePoint grounding tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
SharepointGroundingToolCallOutput:
type: object
required:
@@ -36587,6 +73194,9 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAI.OutputItem'
description: The output of a SharePoint grounding tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
SharepointGroundingToolParameters:
type: object
properties:
@@ -36599,6 +73209,9 @@ components:
The project connections attached to this tool. There can be a maximum of 1 connection
resource attached to the tool.
description: The sharepoint grounding tool parameters.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
SharepointPreviewTool:
type: object
required:
@@ -36616,6 +73229,9 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAI.Tool'
description: The input definition information for a sharepoint tool as used to configure an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
SimpleQnADataGenerationJobOptions:
type: object
required:
@@ -37199,6 +73815,19 @@ components:
type: string
description: A project connection in a ToolProjectConnectionList attached to this tool.
description: A project connection resource.
+ ToolSearchToolboxTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - toolbox_search
+ description: The type of the tool. Always `toolbox_search`.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A toolbox search tool stored in a toolbox.
ToolUseFineTuningDataGenerationJobOptions:
type: object
required:
@@ -37253,6 +73882,9 @@ components:
allOf:
- $ref: '#/components/schemas/ToolboxTool'
description: A toolbox search tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
ToolboxSkill:
type: object
required:
@@ -37322,7 +73954,9 @@ components:
reminder_preview: '#/components/schemas/ReminderPreviewToolboxTool'
work_iq_preview: '#/components/schemas/WorkIQPreviewToolboxTool'
fabric_iq_preview: '#/components/schemas/FabricIQPreviewToolboxTool'
+ web_iq_preview: '#/components/schemas/WebIQPreviewToolboxTool'
toolbox_search_preview: '#/components/schemas/ToolboxSearchPreviewToolboxTool'
+ toolbox_search: '#/components/schemas/ToolSearchToolboxTool'
description: An abstract representation of a tool stored in a toolbox.
ToolboxToolType:
type: string
@@ -37338,6 +73972,8 @@ components:
- reminder_preview
- work_iq_preview
- fabric_iq_preview
+ - web_iq_preview
+ - toolbox_search
- toolbox_search_preview
description: Supported tool types for tools stored in a toolbox.
ToolboxVersionObject:
@@ -37813,6 +74449,73 @@ components:
type: array
items:
$ref: '#/components/schemas/VersionSelectionRule'
+ WebIQPreviewTool:
+ type: object
+ required:
+ - type
+ - project_connection_id
+ properties:
+ type:
+ type: string
+ enum:
+ - web_iq_preview
+ description: The object type, which is always 'web_iq_preview'.
+ project_connection_id:
+ type: string
+ description: The ID of the WebIQ project connection.
+ server_label:
+ type: string
+ description: The label of the WebIQ MCP server to connect to.
+ server_url:
+ type: string
+ format: uri
+ description: The URL of the WebIQ MCP server. If not provided, the URL from the project connection will be used.
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ - type: 'null'
+ description: Whether the agent requires approval before executing actions. Default is always.
+ default: always
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A WebIQ server-side tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ WebIQPreviewToolboxTool:
+ type: object
+ required:
+ - type
+ - project_connection_id
+ properties:
+ type:
+ type: string
+ enum:
+ - web_iq_preview
+ project_connection_id:
+ type: string
+ description: The ID of the WebIQ project connection.
+ server_label:
+ type: string
+ description: The label of the WebIQ MCP server to connect to.
+ server_url:
+ type: string
+ format: uri
+ description: The URL of the WebIQ MCP server. If not provided, the URL from the project connection will be used.
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ - type: 'null'
+ description: Whether the agent requires approval before executing actions. Default is always.
+ default: always
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A WebIQ tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
WebSearchConfiguration:
type: object
required:
@@ -37898,6 +74601,9 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAI.Tool'
description: A WorkIQ server-side tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
WorkIQPreviewToolboxTool:
type: object
required:
@@ -37914,6 +74620,9 @@ components:
allOf:
- $ref: '#/components/schemas/ToolboxTool'
description: A WorkIQ tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
WorkflowActionOutputItem:
type: object
required:
diff --git a/specification/ai-foundry/data-plane/Foundry/openapi3/virtual-public-preview/microsoft-foundry-openapi3.json b/specification/ai-foundry/data-plane/Foundry/openapi3/virtual-public-preview/microsoft-foundry-openapi3.json
index b6e091d888b7..7bf45f155d0b 100644
--- a/specification/ai-foundry/data-plane/Foundry/openapi3/virtual-public-preview/microsoft-foundry-openapi3.json
+++ b/specification/ai-foundry/data-plane/Foundry/openapi3/virtual-public-preview/microsoft-foundry-openapi3.json
@@ -8,9 +8,6 @@
{
"name": "EvaluationSuiteGenerationJobs"
},
- {
- "name": "Fine-Tuning"
- },
{
"name": "Responses Root",
"description": "Responses"
@@ -184,7 +181,7 @@
},
{
"name": "EvaluatorGenerationJobs",
- "parent": "Platform APIs",
+ "parent": "Evaluations",
"summary": "Evaluator generation jobs"
},
{
@@ -224,8 +221,8 @@
"/agent_optimization_jobs": {
"post": {
"operationId": "AgentOptimizationJobs_create",
- "summary": "Creates an agent optimization job.",
- "description": "Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry.",
+ "summary": "Create an agent optimization job",
+ "description": "Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry.",
"parameters": [
{
"name": "Foundry-Features",
@@ -329,8 +326,8 @@
},
"get": {
"operationId": "AgentOptimizationJobs_list",
- "summary": "Returns a list of agent optimization jobs.",
- "description": "List optimization jobs. Supports cursor pagination and optional status / agent_name filters.",
+ "summary": "List agent optimization jobs",
+ "description": "Lists optimization jobs with cursor pagination and optional status or agent name filters.",
"parameters": [
{
"name": "Foundry-Features",
@@ -488,8 +485,8 @@
"/agent_optimization_jobs/{jobId}": {
"get": {
"operationId": "AgentOptimizationJobs_get",
- "summary": "Get info about an agent optimization job.",
- "description": "Get an optimization job by id.",
+ "summary": "Get an agent optimization job",
+ "description": "Retrieves an optimization job by its identifier.",
"parameters": [
{
"name": "Foundry-Features",
@@ -576,8 +573,8 @@
},
"delete": {
"operationId": "AgentOptimizationJobs_delete",
- "summary": "Deletes an agent optimization job.",
- "description": "Delete the job and its candidate artifacts. Cancels first if non-terminal.",
+ "summary": "Delete an agent optimization job",
+ "description": "Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal.",
"parameters": [
{
"name": "Foundry-Features",
@@ -649,8 +646,8 @@
"/agent_optimization_jobs/{jobId}:cancel": {
"post": {
"operationId": "AgentOptimizationJobs_cancel",
- "summary": "Cancels an agent optimization job.",
- "description": "Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state.",
+ "summary": "Cancel an agent optimization job",
+ "description": "Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state.",
"parameters": [
{
"name": "Foundry-Features",
@@ -833,7 +830,8 @@
}
}
}
- }
+ },
+ "description": "The content multipart request content."
}
},
"get": {
@@ -1127,7 +1125,8 @@
}
}
}
- }
+ },
+ "description": "The content multipart request content."
}
},
"delete": {
@@ -2990,7 +2989,8 @@
}
}
}
- }
+ },
+ "description": "The content multipart request content."
}
},
"get": {
@@ -4106,6 +4106,149 @@
}
}
},
+ "/agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.json": {
+ "get": {
+ "operationId": "AgentInvocations_getAgentInvocationAsyncApiSpecJson",
+ "description": "Retrieves the AsyncAPI (JSON) specification for an agent version's event-driven\ninvocation contract (e.g. the `invocations_ws` WebSocket protocol). AsyncAPI is the\ncompanion to OpenAPI for streaming/bidirectional surfaces that OpenAPI cannot express.\nReturns 404 if the agent does not publish an AsyncAPI specification. Publishing is\noptional; when published, both JSON and YAML representations are available.",
+ "parameters": [
+ {
+ "name": "agent_name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the agent.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "agent_version",
+ "in": "path",
+ "required": true,
+ "description": "The version of the agent.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Agent Invocations"
+ ]
+ }
+ },
+ "/agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.yaml": {
+ "get": {
+ "operationId": "AgentInvocations_getAgentInvocationAsyncApiSpecYaml",
+ "description": "Retrieves the AsyncAPI (YAML) specification for an agent version's event-driven\ninvocation contract. Companion to `getAgentInvocationAsyncApiSpecJson`; the path\nextension is authoritative for the returned content type (no `Accept` negotiation).\nReturns 404 if the agent does not publish an AsyncAPI specification.",
+ "parameters": [
+ {
+ "name": "agent_name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the agent.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "agent_version",
+ "in": "path",
+ "required": true,
+ "description": "The version of the agent.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/yaml": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Agent Invocations"
+ ]
+ }
+ },
"/agents/{agent_name}/versions/{agent_version}/sessions/{session_id}:logstream": {
"get": {
"operationId": "Agents_getSessionLogStream",
@@ -4311,7 +4454,10 @@
}
}
}
- }
+ },
+ "tags": [
+ "Agents"
+ ]
}
},
"/agents/{agent_name}:enable": {
@@ -4364,7 +4510,10 @@
}
}
}
- }
+ },
+ "tags": [
+ "Agents"
+ ]
}
},
"/agents:import": {
@@ -5587,7 +5736,7 @@
"post": {
"operationId": "Datasets_getCredentials",
"summary": "Get dataset credentials",
- "description": "Gets the SAS credential to access the storage account associated with a Dataset version.",
+ "description": "Retrieves the SAS credential to access the storage account associated with a dataset version.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -5871,7 +6020,7 @@
"get": {
"operationId": "Deployments_get",
"summary": "Get a deployment",
- "description": "Gets a deployed model.",
+ "description": "Retrieves a deployed model.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -5957,7 +6106,7 @@
"post": {
"operationId": "EvaluationSuiteGenerationJobs_create",
"summary": "Create an evaluation suite generation job",
- "description": "Create a new job (preview). Includes optional Foundry-Features header and Operation-Id for idempotent retries.",
+ "description": "Creates an evaluation suite generation job and returns the queued job.",
"parameters": [
{
"name": "Foundry-Features",
@@ -6062,7 +6211,7 @@
"get": {
"operationId": "EvaluationSuiteGenerationJobs_list",
"summary": "List evaluation suite generation jobs",
- "description": "List jobs with cursor-based pagination (preview). Includes optional Foundry-Features header.",
+ "description": "Lists evaluation suite generation jobs for the project.",
"parameters": [
{
"name": "Foundry-Features",
@@ -6201,7 +6350,7 @@
"get": {
"operationId": "EvaluationSuiteGenerationJobs_get",
"summary": "Get an evaluation suite generation job",
- "description": "Get a job by ID (preview). Includes optional Foundry-Features header.",
+ "description": "Retrieves an evaluation suite generation job by its identifier.",
"parameters": [
{
"name": "Foundry-Features",
@@ -6289,7 +6438,7 @@
"delete": {
"operationId": "EvaluationSuiteGenerationJobs_delete",
"summary": "Delete an evaluation suite generation job",
- "description": "Delete a job (preview). Returns 204 No Content.",
+ "description": "Deletes an evaluation suite generation job by its identifier.",
"parameters": [
{
"name": "Foundry-Features",
@@ -6362,7 +6511,7 @@
"post": {
"operationId": "EvaluationSuiteGenerationJobs_cancel",
"summary": "Cancel an evaluation suite generation job",
- "description": "Cancel a running job (preview). Returns 200 with the updated job.",
+ "description": "Requests cancellation of a running or queued evaluation suite generation job.",
"parameters": [
{
"name": "Foundry-Features",
@@ -6583,7 +6732,7 @@
"post": {
"operationId": "EvaluationSuites_createEvaluationSuiteVersion",
"summary": "Create an evaluation suite version",
- "description": "Create a new EvaluationSuiteVersion with auto incremented version id",
+ "description": "Creates a new evaluation suite version with an auto-incremented version identifier.",
"parameters": [
{
"name": "Foundry-Features",
@@ -8164,7 +8313,7 @@
"patch": {
"operationId": "EvaluationTaxonomies_update",
"summary": "Update an evaluation taxonomy",
- "description": "Update an evaluation taxonomy.",
+ "description": "Modifies the specified evaluation taxonomy with the provided changes.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -8746,7 +8895,7 @@
"get": {
"operationId": "Evaluators_listLatestVersions",
"summary": "List latest evaluator versions",
- "description": "Lists the latest version of each evaluator",
+ "description": "Lists the latest version of each evaluator.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -9370,6 +9519,7 @@
"name": "name",
"in": "path",
"required": true,
+ "description": "The name path parameter.",
"schema": {
"type": "string"
}
@@ -9469,6 +9619,7 @@
"name": "name",
"in": "path",
"required": true,
+ "description": "The name path parameter.",
"schema": {
"type": "string"
}
@@ -12257,7 +12408,7 @@
"delete": {
"operationId": "Models_deleteVersion",
"summary": "Delete a model version",
- "description": "Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist.",
+ "description": "Removes the specified model version. Returns 200 whether the version existed or not.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -12348,7 +12499,7 @@
"patch": {
"operationId": "Models_updateVersion",
"summary": "Update a model version",
- "description": "Update an existing ModelVersion with the given version id",
+ "description": "Updates an existing model version identified by its version ID.",
"parameters": [
{
"$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
@@ -12706,7 +12857,8 @@
"$ref": "#/components/schemas/ModelCredentialRequest"
}
}
- }
+ },
+ "description": "The credential request request body."
},
"x-ms-foundry-meta": {
"required_previews": [
@@ -12816,7 +12968,8 @@
"$ref": "#/components/schemas/ModelPendingUploadRequest"
}
}
- }
+ },
+ "description": "The pending upload request request body."
},
"x-ms-foundry-meta": {
"required_previews": [
@@ -12825,140 +12978,47 @@
}
}
},
- "/openai/v1/conversations": {
- "post": {
- "operationId": "createConversation",
- "summary": "Create a conversation",
- "description": "Creates a new conversation resource.",
- "parameters": [
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- },
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- }
- },
- "tags": [
- "Conversations"
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.CreateConversationBody"
- }
- }
- }
- }
- },
+ "/openai/v1/assistants": {
"get": {
- "operationId": "listConversations",
- "summary": "List conversations",
- "description": "Returns the conversations available in the current project.",
+ "operationId": "Assistants_listAssistants",
+ "summary": "List assistants",
+ "description": "Lists assistants matching the request filters.",
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
"schema": {
- "type": "integer",
- "format": "int32",
+ "$ref": "#/components/schemas/integer",
"default": 20
- },
- "explode": false
+ }
},
{
"name": "order",
"in": "query",
"required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
"schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
},
{
"name": "after",
"in": "query",
"required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "description": "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.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
"name": "before",
"in": "query",
"required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "agent_name",
- "in": "query",
- "required": false,
- "description": "Filter by agent name. If provided, only items associated with the specified agent will be returned.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "agent_id",
- "in": "query",
- "required": false,
- "description": "Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "description": "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.",
"schema": {
"type": "string"
}
@@ -12970,33 +13030,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ListAssistantsResponse"
}
}
}
@@ -13023,42 +13057,39 @@
}
},
"tags": [
- "Conversations"
- ]
- }
- },
- "/openai/v1/conversations/{conversation_id}": {
- "post": {
- "operationId": "updateConversation",
- "summary": "Update a conversation",
- "description": "Modifies the specified conversation's properties.",
- "parameters": [
- {
- "name": "conversation_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation to update.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
- }
+ "Assistants"
],
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "List assistants",
+ "group": "assistants",
+ "examples": {
+ "request": {
+ "curl": "curl \"https://api.openai.com/v1/assistants?order=desc&limit=20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.beta.assistants.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myAssistants = await openai.beta.assistants.list({\n order: \"desc\",\n limit: \"20\",\n });\n\n console.log(myAssistants.data);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const assistant of client.beta.assistants.list()) {\n console.log(assistant.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Beta.Assistants.List(context.TODO(), openai.BetaAssistantListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.assistants.AssistantListPage;\nimport com.openai.models.beta.assistants.AssistantListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n AssistantListPage page = client.beta().assistants().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.beta.assistants.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1698982736,\n \"name\": \"Coding Tutor\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n },\n {\n \"id\": \"asst_abc456\",\n \"object\": \"assistant\",\n \"created_at\": 1698982718,\n \"name\": \"My Assistant\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n },\n {\n \"id\": \"asst_abc789\",\n \"object\": \"assistant\",\n \"created_at\": 1698982643,\n \"name\": null,\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n }\n ],\n \"first_id\": \"asst_abc123\",\n \"last_id\": \"asst_abc789\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Assistants_createAssistant",
+ "summary": "Create an assistant",
+ "description": "Creates an assistant from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
+ "$ref": "#/components/schemas/OpenAI.AssistantObject"
}
}
}
@@ -13085,38 +13116,65 @@
}
},
"tags": [
- "Conversations"
+ "Assistants"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.UpdateConversationBody"
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequest"
}
}
- }
+ },
+ "description": "The request body."
+ },
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "Create assistant",
+ "group": "assistants",
+ "examples": [
+ {
+ "title": "Code Interpreter",
+ "request": {
+ "curl": "curl \"https://api.openai.com/v1/assistants\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"instructions\": \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n \"name\": \"Math Tutor\",\n \"tools\": [{\"type\": \"code_interpreter\"}],\n \"model\": \"gpt-4o\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant = client.beta.assistants.create(\n model=\"gpt-4o\",\n)\nprint(assistant.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myAssistant = await openai.beta.assistants.create({\n instructions:\n \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n name: \"Math Tutor\",\n tools: [{ type: \"code_interpreter\" }],\n model: \"gpt-4o\",\n });\n\n console.log(myAssistant);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistant = await client.beta.assistants.create({ model: 'gpt-4o' });\n\nconsole.log(assistant.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{\n\t\tModel: shared.ChatModelGPT4o,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistant.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.beta.assistants.Assistant;\nimport com.openai.models.beta.assistants.AssistantCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n AssistantCreateParams params = AssistantCreateParams.builder()\n .model(ChatModel.GPT_4O)\n .build();\n Assistant assistant = client.beta().assistants().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant = openai.beta.assistants.create(model: :\"gpt-4o\")\n\nputs(assistant)"
+ },
+ "response": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1698984975,\n \"name\": \"Math Tutor\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
+ },
+ {
+ "title": "Files",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/assistants \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n \"tools\": [{\"type\": \"file_search\"}],\n \"tool_resources\": {\"file_search\": {\"vector_store_ids\": [\"vs_123\"]}},\n \"model\": \"gpt-4o\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant = client.beta.assistants.create(\n model=\"gpt-4o\",\n)\nprint(assistant.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myAssistant = await openai.beta.assistants.create({\n instructions:\n \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n name: \"HR Helper\",\n tools: [{ type: \"file_search\" }],\n tool_resources: {\n file_search: {\n vector_store_ids: [\"vs_123\"]\n }\n },\n model: \"gpt-4o\"\n });\n\n console.log(myAssistant);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistant = await client.beta.assistants.create({ model: 'gpt-4o' });\n\nconsole.log(assistant.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{\n\t\tModel: shared.ChatModelGPT4o,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistant.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.beta.assistants.Assistant;\nimport com.openai.models.beta.assistants.AssistantCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n AssistantCreateParams params = AssistantCreateParams.builder()\n .model(ChatModel.GPT_4O)\n .build();\n Assistant assistant = client.beta().assistants().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant = openai.beta.assistants.create(model: :\"gpt-4o\")\n\nputs(assistant)"
+ },
+ "response": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1699009403,\n \"name\": \"HR Helper\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n \"tools\": [\n {\n \"type\": \"file_search\"\n }\n ],\n \"tool_resources\": {\n \"file_search\": {\n \"vector_store_ids\": [\"vs_123\"]\n }\n },\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
+ }
+ ]
}
- },
- "get": {
- "operationId": "getConversation",
- "summary": "Retrieve a conversation",
- "description": "Retrieves the specified conversation and its metadata.",
+ }
+ },
+ "/openai/v1/assistants/{assistant_id}": {
+ "delete": {
+ "operationId": "Assistants_deleteAssistant",
+ "summary": "Delete an assistant",
+ "description": "Deletes an assistant by its identifier.",
"parameters": [
{
- "name": "conversation_id",
+ "name": "assistant_id",
"in": "path",
"required": true,
- "description": "The id of the conversation to retrieve.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "description": "The ID of the assistant to delete.",
"schema": {
"type": "string"
}
@@ -13128,7 +13186,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
+ "$ref": "#/components/schemas/OpenAI.DeleteAssistantResponse"
}
}
}
@@ -13155,28 +13213,36 @@
}
},
"tags": [
- "Conversations"
- ]
+ "Assistants"
+ ],
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "Delete assistant",
+ "group": "assistants",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/assistants/asst_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant_deleted = client.beta.assistants.delete(\n \"assistant_id\",\n)\nprint(assistant_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const response = await openai.beta.assistants.delete(\"asst_abc123\");\n\n console.log(response);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistantDeleted = await client.beta.assistants.delete('assistant_id');\n\nconsole.log(assistantDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistantDeleted, err := client.Beta.Assistants.Delete(context.TODO(), \"assistant_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistantDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.assistants.AssistantDeleteParams;\nimport com.openai.models.beta.assistants.AssistantDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n AssistantDeleted assistantDeleted = client.beta().assistants().delete(\"assistant_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant_deleted = openai.beta.assistants.delete(\"assistant_id\")\n\nputs(assistant_deleted)"
+ },
+ "response": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
},
- "delete": {
- "operationId": "deleteConversation",
- "summary": "Delete a conversation",
- "description": "Removes the specified conversation resource from the current project.",
+ "get": {
+ "operationId": "Assistants_getAssistant",
+ "summary": "Get an assistant",
+ "description": "Retrieves an assistant by its identifier.",
"parameters": [
{
- "name": "conversation_id",
+ "name": "assistant_id",
"in": "path",
"required": true,
- "description": "The id of the conversation to delete.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "description": "The ID of the assistant to retrieve.",
"schema": {
"type": "string"
}
@@ -13188,7 +13254,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.DeletedConversationResource"
+ "$ref": "#/components/schemas/OpenAI.AssistantObject"
}
}
}
@@ -13215,43 +13281,36 @@
}
},
"tags": [
- "Conversations"
- ]
- }
- },
- "/openai/v1/conversations/{conversation_id}/items": {
+ "Assistants"
+ ],
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "Retrieve assistant",
+ "group": "assistants",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/assistants/asst_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant = client.beta.assistants.retrieve(\n \"assistant_id\",\n)\nprint(assistant.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myAssistant = await openai.beta.assistants.retrieve(\n \"asst_abc123\"\n );\n\n console.log(myAssistant);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistant = await client.beta.assistants.retrieve('assistant_id');\n\nconsole.log(assistant.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistant, err := client.Beta.Assistants.Get(context.TODO(), \"assistant_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistant.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.assistants.Assistant;\nimport com.openai.models.beta.assistants.AssistantRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Assistant assistant = client.beta().assistants().retrieve(\"assistant_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant = openai.beta.assistants.retrieve(\"assistant_id\")\n\nputs(assistant)"
+ },
+ "response": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1699009709,\n \"name\": \"HR Helper\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies.\",\n \"tools\": [\n {\n \"type\": \"file_search\"\n }\n ],\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
+ }
+ }
+ },
"post": {
- "operationId": "createConversationItems",
- "summary": "Create conversation items",
- "description": "Adds one or more items to the specified conversation.",
+ "operationId": "Assistants_modifyAssistant",
+ "summary": "Update an assistant",
+ "description": "Updates an assistant with the supplied changes.",
"parameters": [
{
- "name": "conversation_id",
+ "name": "assistant_id",
"in": "path",
"required": true,
- "description": "The id of the conversation on which the item needs to be created.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "include",
- "in": "query",
- "required": false,
- "description": "Additional fields to include in the response.\nSee the `include` parameter for listing Conversation items for more information.",
- "schema": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "explode": false
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "description": "The ID of the assistant to modify.",
"schema": {
"type": "string"
}
@@ -13263,7 +13322,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationItemList"
+ "$ref": "#/components/schemas/OpenAI.AssistantObject"
}
}
}
@@ -13290,141 +13349,60 @@
}
},
"tags": [
- "Conversations"
+ "Assistants"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "type": "object",
- "properties": {
- "items": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Item"
- },
- "maxItems": 20,
- "description": "The items to add to the conversation. You may add up to 20 items at a time."
- }
- },
- "required": [
- "items"
- ]
+ "$ref": "#/components/schemas/OpenAI.ModifyAssistantRequest"
}
}
- }
- }
- },
- "get": {
- "operationId": "listConversationItems",
- "summary": "List conversation items",
- "description": "Returns the items belonging to the specified conversation.",
- "parameters": [
- {
- "name": "conversation_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation on which the items needs to be listed.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
- },
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
- },
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
},
- {
- "name": "item_type",
- "in": "query",
- "required": false,
- "description": "Filter by item type. If provided, only items of the specified type will be returned.",
- "schema": {
- "$ref": "#/components/schemas/OpenAI.ItemType"
+ "description": "The request body."
+ },
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "Modify assistant",
+ "group": "assistants",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/assistants/asst_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n \"tools\": [{\"type\": \"file_search\"}],\n \"model\": \"gpt-4o\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nassistant = client.beta.assistants.update(\n assistant_id=\"assistant_id\",\n)\nprint(assistant.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myUpdatedAssistant = await openai.beta.assistants.update(\n \"asst_abc123\",\n {\n instructions:\n \"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n name: \"HR Helper\",\n tools: [{ type: \"file_search\" }],\n model: \"gpt-4o\"\n }\n );\n\n console.log(myUpdatedAssistant);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst assistant = await client.beta.assistants.update('assistant_id');\n\nconsole.log(assistant.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tassistant, err := client.Beta.Assistants.Update(\n\t\tcontext.TODO(),\n\t\t\"assistant_id\",\n\t\topenai.BetaAssistantUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", assistant.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.assistants.Assistant;\nimport com.openai.models.beta.assistants.AssistantUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Assistant assistant = client.beta().assistants().update(\"assistant_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nassistant = openai.beta.assistants.update(\"assistant_id\")\n\nputs(assistant)"
},
- "explode": false
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
+ "response": "{\n \"id\": \"asst_123\",\n \"object\": \"assistant\",\n \"created_at\": 1699009709,\n \"name\": \"HR Helper\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.\",\n \"tools\": [\n {\n \"type\": \"file_search\"\n }\n ],\n \"tool_resources\": {\n \"file_search\": {\n \"vector_store_ids\": []\n }\n },\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
}
- ],
+ }
+ }
+ },
+ "/openai/v1/audio/speech": {
+ "post": {
+ "operationId": "Audio_createSpeech",
+ "summary": "Create a speech",
+ "description": "Creates a speech from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
+ "headers": {
+ "Transfer-Encoding": {
+ "required": false,
+ "description": "The TransferEncoding header.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
"content": {
- "application/json": {
+ "application/octet-stream": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "contentMediaType": "application/octet-stream"
}
}
}
@@ -13451,51 +13429,74 @@
}
},
"tags": [
- "Conversations"
- ]
- }
- },
- "/openai/v1/conversations/{conversation_id}/items/{item_id}": {
- "get": {
- "operationId": "getConversationItem",
- "summary": "Get a conversation item",
- "description": "Retrieves a specific item from the specified conversation.",
- "parameters": [
- {
- "name": "conversation_id",
- "in": "path",
- "required": true,
- "description": "The ID of the conversation that contains the item.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "item_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation item to retrieve.",
- "schema": {
- "type": "string"
+ "Audio"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateSpeechRequest"
+ }
}
},
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create speech",
+ "group": "audio",
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/speech \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini-tts\",\n \"input\": \"The quick brown fox jumped over the lazy dog.\",\n \"voice\": \"alloy\"\n }' \\\n --output speech.mp3\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nspeech = client.audio.speech.create(\n input=\"input\",\n model=\"tts-1\",\n voice=\"alloy\",\n)\nprint(speech)\ncontent = speech.read()\nprint(content)",
+ "javascript": "import fs from \"fs\";\nimport path from \"path\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst speechFile = path.resolve(\"./speech.mp3\");\n\nasync function main() {\n const mp3 = await openai.audio.speech.create({\n model: \"gpt-4o-mini-tts\",\n voice: \"alloy\",\n input: \"Today is a wonderful day to build something people love!\",\n });\n console.log(speechFile);\n const buffer = Buffer.from(await mp3.arrayBuffer());\n await fs.promises.writeFile(speechFile, buffer);\n}\nmain();\n",
+ "csharp": "using System;\nusing System.IO;\n\nusing OpenAI.Audio;\n\nAudioClient client = new(\n model: \"gpt-4o-mini-tts\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nBinaryData speech = client.GenerateSpeech(\n text: \"The quick brown fox jumped over the lazy dog.\",\n voice: GeneratedSpeechVoice.Alloy\n);\n\nusing FileStream stream = File.OpenWrite(\"speech.mp3\");\nspeech.ToStream().CopyTo(stream);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst speech = await client.audio.speech.create({\n input: 'input',\n model: 'tts-1',\n voice: 'alloy',\n});\n\nconsole.log(speech);\n\nconst content = await speech.blob();\nconsole.log(content);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tspeech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{\n\t\tInput: \"input\",\n\t\tModel: openai.SpeechModelTTS1,\n\t\tVoice: openai.AudioSpeechNewParamsVoiceUnion{\n\t\t\tOfAudioSpeechNewsVoiceString2: openai.String(\"alloy\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", speech)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.audio.speech.SpeechCreateParams;\nimport com.openai.models.audio.speech.SpeechModel;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n SpeechCreateParams params = SpeechCreateParams.builder()\n .input(\"input\")\n .model(SpeechModel.TTS_1)\n .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)\n .build();\n HttpResponse speech = client.audio().speech().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nspeech = openai.audio.speech.create(input: \"input\", model: :\"tts-1\", voice: :alloy)\n\nputs(speech)"
+ }
+ },
+ {
+ "title": "SSE Stream Format",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/speech \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini-tts\",\n \"input\": \"The quick brown fox jumped over the lazy dog.\",\n \"voice\": \"alloy\",\n \"stream_format\": \"sse\"\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst speech = await client.audio.speech.create({\n input: 'input',\n model: 'tts-1',\n voice: 'alloy',\n});\n\nconsole.log(speech);\n\nconst content = await speech.blob();\nconsole.log(content);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nspeech = client.audio.speech.create(\n input=\"input\",\n model=\"tts-1\",\n voice=\"alloy\",\n)\nprint(speech)\ncontent = speech.read()\nprint(content)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tspeech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{\n\t\tInput: \"input\",\n\t\tModel: openai.SpeechModelTTS1,\n\t\tVoice: openai.AudioSpeechNewParamsVoiceUnion{\n\t\t\tOfAudioSpeechNewsVoiceString2: openai.String(\"alloy\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", speech)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.audio.speech.SpeechCreateParams;\nimport com.openai.models.audio.speech.SpeechModel;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n SpeechCreateParams params = SpeechCreateParams.builder()\n .input(\"input\")\n .model(SpeechModel.TTS_1)\n .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)\n .build();\n HttpResponse speech = client.audio().speech().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nspeech = openai.audio.speech.create(input: \"input\", model: :\"tts-1\", voice: :alloy)\n\nputs(speech)"
+ }
}
- }
- ],
+ ]
+ }
+ }
+ },
+ "/openai/v1/audio/transcriptions": {
+ "post": {
+ "operationId": "Audio_createTranscription",
+ "summary": "Create a transcription",
+ "description": "Creates a transcription from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJson"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseDiarizedJson"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseVerboseJson"
+ }
+ ]
}
}
}
@@ -13522,49 +13523,157 @@
}
},
"tags": [
- "Conversations"
- ]
- },
- "delete": {
- "operationId": "deleteConversationItem",
- "summary": "Delete a conversation item",
- "description": "Removes the specified item from a conversation.",
- "parameters": [
- {
- "name": "conversation_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation on which the item needs to be deleted from.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "item_id",
- "in": "path",
- "required": true,
- "description": "The id of the conversation item to delete.",
- "schema": {
- "type": "string"
+ "Audio"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionRequest"
+ },
+ "encoding": {
+ "model": {
+ "contentType": "text/plain"
+ },
+ "response_format": {
+ "contentType": "application/json"
+ },
+ "temperature": {
+ "contentType": "text/plain"
+ },
+ "include": {
+ "contentType": "application/json"
+ },
+ "timestamp_granularities": {
+ "contentType": "application/json"
+ },
+ "stream": {
+ "contentType": "application/json"
+ },
+ "chunking_strategy": {
+ "contentType": "application/json"
+ },
+ "known_speaker_names": {
+ "contentType": "application/json"
+ },
+ "known_speaker_references": {
+ "contentType": "application/json"
+ }
+ }
}
},
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create transcription",
+ "group": "audio",
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F model=\"gpt-4o-transcribe\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"gpt-4o-transcribe\",\n });\n\n console.log(transcription.text);\n}\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Audio;\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"gpt-4o-transcribe\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath);\n\nConsole.WriteLine($\"{transcription.Text}\");\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"text\": \"Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.\",\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \"input_token_details\": {\n \"text_tokens\": 0,\n \"audio_tokens\": 14\n },\n \"output_tokens\": 45,\n \"total_tokens\": 59\n }\n}\n"
+ },
+ {
+ "title": "Diarization",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/meeting.wav\" \\\n -F model=\"gpt-4o-transcribe-diarize\" \\\n -F response_format=\"diarized_json\" \\\n -F chunking_strategy=auto \\\n -F 'known_speaker_names[]=agent' \\\n -F 'known_speaker_references[]=data:audio/wav;base64,AAA...'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst speakerRef = fs.readFileSync(\"agent.wav\").toString(\"base64\");\n\nconst transcript = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"meeting.wav\"),\n model: \"gpt-4o-transcribe-diarize\",\n response_format: \"diarized_json\",\n chunking_strategy: \"auto\",\n extra_body: {\n known_speaker_names: [\"agent\"],\n known_speaker_references: [`data:audio/wav;base64,${speakerRef}`],\n },\n});\n\nconsole.log(transcript.segments);\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"task\": \"transcribe\",\n \"duration\": 27.4,\n \"text\": \"Agent: Thanks for calling OpenAI support.\nA: Hi, I'm trying to enable diarization.\nAgent: Happy to walk you through the steps.\",\n \"segments\": [\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_001\",\n \"start\": 0.0,\n \"end\": 4.7,\n \"text\": \"Thanks for calling OpenAI support.\",\n \"speaker\": \"agent\"\n },\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_002\",\n \"start\": 4.7,\n \"end\": 11.8,\n \"text\": \"Hi, I'm trying to enable diarization.\",\n \"speaker\": \"A\"\n },\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_003\",\n \"start\": 12.1,\n \"end\": 18.5,\n \"text\": \"Happy to walk you through the steps.\",\n \"speaker\": \"agent\"\n }\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 27\n }\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F model=\"gpt-4o-mini-transcribe\" \\\n -F stream=true\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst stream = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"gpt-4o-mini-transcribe\",\n stream: true,\n});\n\nfor await (const event of stream) {\n console.log(event);\n}\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "data: {\"type\":\"transcript.text.delta\",\"delta\":\"I\",\"logprobs\":[{\"token\":\"I\",\"logprob\":-0.00007588794,\"bytes\":[73]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" see\",\"logprobs\":[{\"token\":\" see\",\"logprob\":-3.1281633e-7,\"bytes\":[32,115,101,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" skies\",\"logprobs\":[{\"token\":\" skies\",\"logprob\":-2.3392786e-6,\"bytes\":[32,115,107,105,101,115]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" of\",\"logprobs\":[{\"token\":\" of\",\"logprob\":-3.1281633e-7,\"bytes\":[32,111,102]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" blue\",\"logprobs\":[{\"token\":\" blue\",\"logprob\":-1.0280384e-6,\"bytes\":[32,98,108,117,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" and\",\"logprobs\":[{\"token\":\" and\",\"logprob\":-0.0005108566,\"bytes\":[32,97,110,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" clouds\",\"logprobs\":[{\"token\":\" clouds\",\"logprob\":-1.9361265e-7,\"bytes\":[32,99,108,111,117,100,115]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" of\",\"logprobs\":[{\"token\":\" of\",\"logprob\":-1.9361265e-7,\"bytes\":[32,111,102]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" white\",\"logprobs\":[{\"token\":\" white\",\"logprob\":-7.89631e-7,\"bytes\":[32,119,104,105,116,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\",\",\"logprobs\":[{\"token\":\",\",\"logprob\":-0.0014890312,\"bytes\":[44]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" the\",\"logprobs\":[{\"token\":\" the\",\"logprob\":-0.0110956915,\"bytes\":[32,116,104,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" bright\",\"logprobs\":[{\"token\":\" bright\",\"logprob\":0.0,\"bytes\":[32,98,114,105,103,104,116]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" blessed\",\"logprobs\":[{\"token\":\" blessed\",\"logprob\":-0.000045848617,\"bytes\":[32,98,108,101,115,115,101,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" days\",\"logprobs\":[{\"token\":\" days\",\"logprob\":-0.000010802739,\"bytes\":[32,100,97,121,115]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\",\",\"logprobs\":[{\"token\":\",\",\"logprob\":-0.00001700133,\"bytes\":[44]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" the\",\"logprobs\":[{\"token\":\" the\",\"logprob\":-0.0000118755715,\"bytes\":[32,116,104,101]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" dark\",\"logprobs\":[{\"token\":\" dark\",\"logprob\":-5.5122365e-7,\"bytes\":[32,100,97,114,107]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" sacred\",\"logprobs\":[{\"token\":\" sacred\",\"logprob\":-5.4385737e-6,\"bytes\":[32,115,97,99,114,101,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" nights\",\"logprobs\":[{\"token\":\" nights\",\"logprob\":-4.00813e-6,\"bytes\":[32,110,105,103,104,116,115]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\",\",\"logprobs\":[{\"token\":\",\",\"logprob\":-0.0036910512,\"bytes\":[44]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" and\",\"logprobs\":[{\"token\":\" and\",\"logprob\":-0.0031903093,\"bytes\":[32,97,110,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" I\",\"logprobs\":[{\"token\":\" I\",\"logprob\":-1.504853e-6,\"bytes\":[32,73]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" think\",\"logprobs\":[{\"token\":\" think\",\"logprob\":-4.3202e-7,\"bytes\":[32,116,104,105,110,107]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" to\",\"logprobs\":[{\"token\":\" to\",\"logprob\":-1.9361265e-7,\"bytes\":[32,116,111]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" myself\",\"logprobs\":[{\"token\":\" myself\",\"logprob\":-1.7432603e-6,\"bytes\":[32,109,121,115,101,108,102]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\",\",\"logprobs\":[{\"token\":\",\",\"logprob\":-0.29254505,\"bytes\":[44]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" what\",\"logprobs\":[{\"token\":\" what\",\"logprob\":-0.016815351,\"bytes\":[32,119,104,97,116]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" a\",\"logprobs\":[{\"token\":\" a\",\"logprob\":-3.1281633e-7,\"bytes\":[32,97]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" wonderful\",\"logprobs\":[{\"token\":\" wonderful\",\"logprob\":-2.1008714e-6,\"bytes\":[32,119,111,110,100,101,114,102,117,108]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\" world\",\"logprobs\":[{\"token\":\" world\",\"logprob\":-8.180258e-6,\"bytes\":[32,119,111,114,108,100]}]}\n\ndata: {\"type\":\"transcript.text.delta\",\"delta\":\".\",\"logprobs\":[{\"token\":\".\",\"logprob\":-0.014231676,\"bytes\":[46]}]}\n\ndata: {\"type\":\"transcript.text.done\",\"text\":\"I see skies of blue and clouds of white, the bright blessed days, the dark sacred nights, and I think to myself, what a wonderful world.\",\"logprobs\":[{\"token\":\"I\",\"logprob\":-0.00007588794,\"bytes\":[73]},{\"token\":\" see\",\"logprob\":-3.1281633e-7,\"bytes\":[32,115,101,101]},{\"token\":\" skies\",\"logprob\":-2.3392786e-6,\"bytes\":[32,115,107,105,101,115]},{\"token\":\" of\",\"logprob\":-3.1281633e-7,\"bytes\":[32,111,102]},{\"token\":\" blue\",\"logprob\":-1.0280384e-6,\"bytes\":[32,98,108,117,101]},{\"token\":\" and\",\"logprob\":-0.0005108566,\"bytes\":[32,97,110,100]},{\"token\":\" clouds\",\"logprob\":-1.9361265e-7,\"bytes\":[32,99,108,111,117,100,115]},{\"token\":\" of\",\"logprob\":-1.9361265e-7,\"bytes\":[32,111,102]},{\"token\":\" white\",\"logprob\":-7.89631e-7,\"bytes\":[32,119,104,105,116,101]},{\"token\":\",\",\"logprob\":-0.0014890312,\"bytes\":[44]},{\"token\":\" the\",\"logprob\":-0.0110956915,\"bytes\":[32,116,104,101]},{\"token\":\" bright\",\"logprob\":0.0,\"bytes\":[32,98,114,105,103,104,116]},{\"token\":\" blessed\",\"logprob\":-0.000045848617,\"bytes\":[32,98,108,101,115,115,101,100]},{\"token\":\" days\",\"logprob\":-0.000010802739,\"bytes\":[32,100,97,121,115]},{\"token\":\",\",\"logprob\":-0.00001700133,\"bytes\":[44]},{\"token\":\" the\",\"logprob\":-0.0000118755715,\"bytes\":[32,116,104,101]},{\"token\":\" dark\",\"logprob\":-5.5122365e-7,\"bytes\":[32,100,97,114,107]},{\"token\":\" sacred\",\"logprob\":-5.4385737e-6,\"bytes\":[32,115,97,99,114,101,100]},{\"token\":\" nights\",\"logprob\":-4.00813e-6,\"bytes\":[32,110,105,103,104,116,115]},{\"token\":\",\",\"logprob\":-0.0036910512,\"bytes\":[44]},{\"token\":\" and\",\"logprob\":-0.0031903093,\"bytes\":[32,97,110,100]},{\"token\":\" I\",\"logprob\":-1.504853e-6,\"bytes\":[32,73]},{\"token\":\" think\",\"logprob\":-4.3202e-7,\"bytes\":[32,116,104,105,110,107]},{\"token\":\" to\",\"logprob\":-1.9361265e-7,\"bytes\":[32,116,111]},{\"token\":\" myself\",\"logprob\":-1.7432603e-6,\"bytes\":[32,109,121,115,101,108,102]},{\"token\":\",\",\"logprob\":-0.29254505,\"bytes\":[44]},{\"token\":\" what\",\"logprob\":-0.016815351,\"bytes\":[32,119,104,97,116]},{\"token\":\" a\",\"logprob\":-3.1281633e-7,\"bytes\":[32,97]},{\"token\":\" wonderful\",\"logprob\":-2.1008714e-6,\"bytes\":[32,119,111,110,100,101,114,102,117,108]},{\"token\":\" world\",\"logprob\":-8.180258e-6,\"bytes\":[32,119,111,114,108,100]},{\"token\":\".\",\"logprob\":-0.014231676,\"bytes\":[46]}],\"usage\":{\"input_tokens\":14,\"input_token_details\":{\"text_tokens\":0,\"audio_tokens\":14},\"output_tokens\":45,\"total_tokens\":59}}\n"
+ },
+ {
+ "title": "Logprobs",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F \"include[]=logprobs\" \\\n -F model=\"gpt-4o-transcribe\" \\\n -F response_format=\"json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"gpt-4o-transcribe\",\n response_format: \"json\",\n include: [\"logprobs\"]\n });\n\n console.log(transcription);\n}\nmain();\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"text\": \"Hey, my knee is hurting and I want to see the doctor tomorrow ideally.\",\n \"logprobs\": [\n { \"token\": \"Hey\", \"logprob\": -1.0415299, \"bytes\": [72, 101, 121] },\n { \"token\": \",\", \"logprob\": -9.805982e-5, \"bytes\": [44] },\n { \"token\": \" my\", \"logprob\": -0.00229799, \"bytes\": [32, 109, 121] },\n {\n \"token\": \" knee\",\n \"logprob\": -4.7159858e-5,\n \"bytes\": [32, 107, 110, 101, 101]\n },\n { \"token\": \" is\", \"logprob\": -0.043909557, \"bytes\": [32, 105, 115] },\n {\n \"token\": \" hurting\",\n \"logprob\": -1.1041146e-5,\n \"bytes\": [32, 104, 117, 114, 116, 105, 110, 103]\n },\n { \"token\": \" and\", \"logprob\": -0.011076359, \"bytes\": [32, 97, 110, 100] },\n { \"token\": \" I\", \"logprob\": -5.3193703e-6, \"bytes\": [32, 73] },\n {\n \"token\": \" want\",\n \"logprob\": -0.0017156356,\n \"bytes\": [32, 119, 97, 110, 116]\n },\n { \"token\": \" to\", \"logprob\": -7.89631e-7, \"bytes\": [32, 116, 111] },\n { \"token\": \" see\", \"logprob\": -5.5122365e-7, \"bytes\": [32, 115, 101, 101] },\n { \"token\": \" the\", \"logprob\": -0.0040786397, \"bytes\": [32, 116, 104, 101] },\n {\n \"token\": \" doctor\",\n \"logprob\": -2.3392786e-6,\n \"bytes\": [32, 100, 111, 99, 116, 111, 114]\n },\n {\n \"token\": \" tomorrow\",\n \"logprob\": -7.89631e-7,\n \"bytes\": [32, 116, 111, 109, 111, 114, 114, 111, 119]\n },\n {\n \"token\": \" ideally\",\n \"logprob\": -0.5800861,\n \"bytes\": [32, 105, 100, 101, 97, 108, 108, 121]\n },\n { \"token\": \".\", \"logprob\": -0.00011093382, \"bytes\": [46] }\n ],\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \"input_token_details\": {\n \"text_tokens\": 0,\n \"audio_tokens\": 14\n },\n \"output_tokens\": 45,\n \"total_tokens\": 59\n }\n}\n"
+ },
+ {
+ "title": "Word timestamps",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F \"timestamp_granularities[]=word\" \\\n -F model=\"whisper-1\" \\\n -F response_format=\"verbose_json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"whisper-1\",\n response_format: \"verbose_json\",\n timestamp_granularities: [\"word\"]\n });\n\n console.log(transcription.text);\n}\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Audio;\n\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"whisper-1\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscriptionOptions options = new()\n{\n ResponseFormat = AudioTranscriptionFormat.Verbose,\n TimestampGranularities = AudioTimestampGranularities.Word,\n};\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);\n\nConsole.WriteLine($\"{transcription.Text}\");\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"task\": \"transcribe\",\n \"language\": \"english\",\n \"duration\": 8.470000267028809,\n \"text\": \"The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.\",\n \"words\": [\n {\n \"word\": \"The\",\n \"start\": 0.0,\n \"end\": 0.23999999463558197\n },\n ...\n {\n \"word\": \"volleyball\",\n \"start\": 7.400000095367432,\n \"end\": 7.900000095367432\n }\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 9\n }\n}\n"
+ },
+ {
+ "title": "Segment timestamps",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/transcriptions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/audio.mp3\" \\\n -F \"timestamp_granularities[]=segment\" \\\n -F model=\"whisper-1\" \\\n -F response_format=\"verbose_json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"gpt-4o-transcribe\",\n):\n print(transcription)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const transcription = await openai.audio.transcriptions.create({\n file: fs.createReadStream(\"audio.mp3\"),\n model: \"whisper-1\",\n response_format: \"verbose_json\",\n timestamp_granularities: [\"segment\"]\n });\n\n console.log(transcription.text);\n}\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Audio;\n\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"whisper-1\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscriptionOptions options = new()\n{\n ResponseFormat = AudioTranscriptionFormat.Verbose,\n TimestampGranularities = AudioTimestampGranularities.Segment,\n};\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);\n\nConsole.WriteLine($\"{transcription.Text}\");\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'gpt-4o-transcribe',\n});\n\nconsole.log(transcription);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranscription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelGPT4oTranscribe,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", transcription)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateParams;\nimport com.openai.models.audio.transcriptions.TranscriptionCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranscriptionCreateParams params = TranscriptionCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.GPT_4O_TRANSCRIBE)\n .build();\n TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranscription = openai.audio.transcriptions.create(file: StringIO.new(\"Example data\"), model: :\"gpt-4o-transcribe\")\n\nputs(transcription)"
+ },
+ "response": "{\n \"task\": \"transcribe\",\n \"language\": \"english\",\n \"duration\": 8.470000267028809,\n \"text\": \"The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.\",\n \"segments\": [\n {\n \"id\": 0,\n \"seek\": 0,\n \"start\": 0.0,\n \"end\": 3.319999933242798,\n \"text\": \" The beach was a popular spot on a hot summer day.\",\n \"tokens\": [\n 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530\n ],\n \"temperature\": 0.0,\n \"avg_logprob\": -0.2860786020755768,\n \"compression_ratio\": 1.2363636493682861,\n \"no_speech_prob\": 0.00985979475080967\n },\n ...\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 9\n }\n}\n"
}
- }
- ],
+ ]
+ }
+ }
+ },
+ "/openai/v1/audio/translations": {
+ "post": {
+ "operationId": "Audio_createTranslation",
+ "summary": "Create a translation",
+ "description": "Creates a translation from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ConversationResource"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranslationResponseJson"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateTranslationResponseVerboseJson"
+ }
+ ]
}
}
}
@@ -13591,64 +13700,70 @@
}
},
"tags": [
- "Conversations"
- ]
+ "Audio"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranslationRequest"
+ },
+ "encoding": {
+ "model": {
+ "contentType": "text/plain"
+ },
+ "temperature": {
+ "contentType": "text/plain"
+ }
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create translation",
+ "group": "audio",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/audio/translations \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F file=\"@/path/to/file/german.m4a\" \\\n -F model=\"whisper-1\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ntranslation = client.audio.translations.create(\n file=b\"Example data\",\n model=\"whisper-1\",\n)\nprint(translation)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const translation = await openai.audio.translations.create({\n file: fs.createReadStream(\"speech.mp3\"),\n model: \"whisper-1\",\n });\n\n console.log(translation.text);\n}\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Audio;\n\nstring audioFilePath = \"audio.mp3\";\n\nAudioClient client = new(\n model: \"whisper-1\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nAudioTranscription transcription = client.TranscribeAudio(audioFilePath);\n\nConsole.WriteLine($\"{transcription.Text}\");\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst translation = await client.audio.translations.create({\n file: fs.createReadStream('speech.mp3'),\n model: 'whisper-1',\n});\n\nconsole.log(translation);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttranslation, err := client.Audio.Translations.New(context.TODO(), openai.AudioTranslationNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tModel: openai.AudioModelWhisper1,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", translation)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.audio.AudioModel;\nimport com.openai.models.audio.translations.TranslationCreateParams;\nimport com.openai.models.audio.translations.TranslationCreateResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n TranslationCreateParams params = TranslationCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .model(AudioModel.WHISPER_1)\n .build();\n TranslationCreateResponse translation = client.audio().translations().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ntranslation = openai.audio.translations.create(file: StringIO.new(\"Example data\"), model: :\"whisper-1\")\n\nputs(translation)"
+ },
+ "response": "{\n \"text\": \"Hello, my name is Wolfgang and I come from Germany. Where are you heading today?\"\n}\n"
+ }
+ }
}
},
- "/openai/v1/evals": {
+ "/openai/v1/batches": {
"get": {
- "operationId": "Evals_listEvals",
- "summary": "List evaluations",
- "description": "Returns the evaluations configured in the current project.",
+ "operationId": "Batches_listBatches",
+ "summary": "List batches",
+ "description": "Lists batches matching the request filters.",
"parameters": [
{
"name": "after",
"in": "query",
"required": false,
- "description": "Identifier for the last run from the previous pagination request.",
+ "description": "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.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
"name": "limit",
"in": "query",
"required": false,
- "description": "Number of runs to retrieve.",
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
"schema": {
"$ref": "#/components/schemas/integer",
"default": 20
- },
- "explode": false
- },
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
- "schema": {
- "type": "string",
- "enum": [
- "asc",
- "desc"
- ],
- "default": "asc"
- },
- "explode": false
- },
- {
- "name": "order_by",
- "in": "query",
- "required": false,
- "description": "Evals can be ordered by creation time or last updated time.\nUse `created_at` for creation time or `updated_at` for last updated time.",
- "schema": {
- "type": "string",
- "enum": [
- "created_at",
- "updated_at"
- ],
- "default": "created_at"
}
}
],
@@ -13658,33 +13773,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Eval"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ListBatchesResponse"
}
}
}
@@ -13711,13 +13800,30 @@
}
},
"tags": [
- "Evals"
- ]
+ "Batch"
+ ],
+ "x-oaiMeta": {
+ "name": "List batches",
+ "group": "batch",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/batches?limit=2 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.batches.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.batches.list();\n\n for await (const batch of list) {\n console.log(batch);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const batch of client.batches.list()) {\n console.log(batch.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Batches.List(context.TODO(), openai.BatchListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.batches.BatchListPage;\nimport com.openai.models.batches.BatchListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n BatchListPage page = client.batches().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.batches.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly job\",\n }\n },\n { ... },\n ],\n \"first_id\": \"batch_abc123\",\n \"last_id\": \"batch_abc456\",\n \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
},
"post": {
- "operationId": "Evals_createEval",
- "summary": "Create an evaluation",
- "description": "Creates the structure of an evaluation that can be used to test a model's performance.\nAn 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.\nFor more information, see the [Evals guide](https://platform.openai.com/docs/guides/evals).",
+ "operationId": "Batches_createBatch",
+ "summary": "Create a batch",
+ "description": "Creates a batch from the supplied request.",
"parameters": [],
"responses": {
"200": {
@@ -13725,7 +13831,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Eval"
+ "$ref": "#/components/schemas/OpenAI.Batch"
}
}
}
@@ -13752,31 +13858,48 @@
}
},
"tags": [
- "Evals"
+ "Batch"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateEvalRequest"
+ "$ref": "#/components/schemas/OpenAI.CreateBatchParametersBody"
}
}
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create batch",
+ "group": "batch",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/batches \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"input_file_id\": \"file-abc123\",\n \"endpoint\": \"/v1/chat/completions\",\n \"completion_window\": \"24h\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nbatch = client.batches.create(\n completion_window=\"24h\",\n endpoint=\"/v1/responses\",\n input_file_id=\"input_file_id\",\n)\nprint(batch.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const batch = await openai.batches.create({\n input_file_id: \"file-abc123\",\n endpoint: \"/v1/chat/completions\",\n completion_window: \"24h\"\n });\n\n console.log(batch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst batch = await client.batches.create({\n completion_window: '24h',\n endpoint: '/v1/responses',\n input_file_id: 'input_file_id',\n});\n\nconsole.log(batch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tbatch, err := client.Batches.New(context.TODO(), openai.BatchNewParams{\n\t\tCompletionWindow: openai.BatchNewParamsCompletionWindow24h,\n\t\tEndpoint: openai.BatchNewParamsEndpointV1Responses,\n\t\tInputFileID: \"input_file_id\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", batch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.batches.Batch;\nimport com.openai.models.batches.BatchCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n BatchCreateParams params = BatchCreateParams.builder()\n .completionWindow(BatchCreateParams.CompletionWindow._24H)\n .endpoint(BatchCreateParams.Endpoint.V1_RESPONSES)\n .inputFileId(\"input_file_id\")\n .build();\n Batch batch = client.batches().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nbatch = openai.batches.create(\n completion_window: :\"24h\",\n endpoint: :\"/v1/responses\",\n input_file_id: \"input_file_id\"\n)\n\nputs(batch)"
+ },
+ "response": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"validating\",\n \"output_file_id\": null,\n \"error_file_id\": null,\n \"created_at\": 1711471533,\n \"in_progress_at\": null,\n \"expires_at\": null,\n \"finalizing_at\": null,\n \"completed_at\": null,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 0,\n \"completed\": 0,\n \"failed\": 0\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n"
}
}
}
},
- "/openai/v1/evals/{eval_id}": {
- "delete": {
- "operationId": "Evals_deleteEval",
- "summary": "Delete an evaluation",
- "description": "Removes the specified evaluation and its associated data.",
+ "/openai/v1/batches/{batch_id}": {
+ "get": {
+ "operationId": "Batches_retrieveBatch",
+ "summary": "Get a batch",
+ "description": "Retrieves a batch by its identifier.",
"parameters": [
{
- "name": "eval_id",
+ "name": "batch_id",
"in": "path",
"required": true,
- "description": "The ID of the evaluation to delete.",
+ "description": "The ID of the batch to retrieve.",
"schema": {
"type": "string"
}
@@ -13788,7 +13911,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteEvalResponse"
+ "$ref": "#/components/schemas/OpenAI.Batch"
}
}
}
@@ -13815,70 +13938,37 @@
}
},
"tags": [
- "Evals"
- ]
- },
- "get": {
- "operationId": "Evals_getEval",
- "summary": "Get an evaluation",
- "description": "Retrieves the specified evaluation and its configuration.",
- "parameters": [
- {
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to retrieve.",
- "schema": {
- "type": "string"
- }
- }
+ "Batch"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Eval"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- },
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "x-oaiMeta": {
+ "name": "Retrieve batch",
+ "group": "batch",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/batches/batch_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nbatch = client.batches.retrieve(\n \"batch_id\",\n)\nprint(batch.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const batch = await openai.batches.retrieve(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst batch = await client.batches.retrieve('batch_id');\n\nconsole.log(batch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tbatch, err := client.Batches.Get(context.TODO(), \"batch_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", batch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.batches.Batch;\nimport com.openai.models.batches.BatchRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Batch batch = client.batches().retrieve(\"batch_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nbatch = openai.batches.retrieve(\"batch_id\")\n\nputs(batch)"
+ },
+ "response": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/completions\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n"
}
- },
- "tags": [
- "Evals"
- ]
- },
+ }
+ }
+ },
+ "/openai/v1/batches/{batch_id}/cancel": {
"post": {
- "operationId": "Evals_updateEval",
- "summary": "Update an evaluation",
- "description": "Updates certain properties of an evaluation.",
+ "operationId": "Batches_cancelBatch",
+ "summary": "Cancel a batch",
+ "description": "Cancels a batch by its identifier.",
"parameters": [
{
- "name": "eval_id",
+ "name": "batch_id",
"in": "path",
"required": true,
- "description": "The ID of the evaluation to update.",
+ "description": "The ID of the batch to cancel.",
"schema": {
"type": "string"
}
@@ -13890,7 +13980,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/Eval"
+ "$ref": "#/components/schemas/OpenAI.Batch"
}
}
}
@@ -13917,87 +14007,86 @@
}
},
"tags": [
- "Evals"
+ "Batch"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateEvalParametersBody"
- }
- }
+ "x-oaiMeta": {
+ "name": "Cancel batch",
+ "group": "batch",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/batches/batch_abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -X POST\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nbatch = client.batches.cancel(\n \"batch_id\",\n)\nprint(batch.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const batch = await openai.batches.cancel(\"batch_abc123\");\n\n console.log(batch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst batch = await client.batches.cancel('batch_id');\n\nconsole.log(batch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tbatch, err := client.Batches.Cancel(context.TODO(), \"batch_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", batch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.batches.Batch;\nimport com.openai.models.batches.BatchCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Batch batch = client.batches().cancel(\"batch_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nbatch = openai.batches.cancel(\"batch_id\")\n\nputs(batch)"
+ },
+ "response": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/chat/completions\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"cancelling\",\n \"output_file_id\": null,\n \"error_file_id\": null,\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": null,\n \"completed_at\": null,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": 1711475133,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 23,\n \"failed\": 1\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n"
}
}
}
},
- "/openai/v1/evals/{eval_id}/runs": {
+ "/openai/v1/chat/completions": {
"get": {
- "operationId": "Evals_listRuns",
- "summary": "List evaluation runs",
- "description": "Returns the runs associated with the specified evaluation.",
+ "operationId": "Chat_listChatCompletions",
+ "summary": "List chat completions",
+ "description": "Lists chat completions matching the request filters.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to retrieve runs for.",
+ "name": "model",
+ "in": "query",
+ "required": false,
+ "description": "The model used to generate the Chat Completions.",
"schema": {
"type": "string"
}
},
+ {
+ "name": "metadata",
+ "in": "query",
+ "required": false,
+ "description": "A list of metadata keys to filter the Chat Completions by. Example:\n `metadata[key1]=value1&metadata[key2]=value2`",
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
{
"name": "after",
"in": "query",
"required": false,
- "description": "Identifier for the last run from the previous pagination request.",
+ "description": "Identifier for the last chat completion from the previous pagination request.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
"name": "limit",
"in": "query",
"required": false,
- "description": "Number of runs to retrieve.",
+ "description": "Number of Chat Completions to retrieve.",
"schema": {
"$ref": "#/components/schemas/integer",
"default": 20
- },
- "explode": false
+ }
},
{
"name": "order",
"in": "query",
"required": false,
- "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
+ "description": "Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
"schema": {
- "type": "string",
- "enum": [
- "asc",
- "desc"
- ],
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
"default": "asc"
- },
- "explode": false
- },
- {
- "name": "status",
- "in": "query",
- "required": false,
- "description": "Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.",
- "schema": {
- "type": "string",
- "enum": [
- "queued",
- "in_progress",
- "completed",
- "canceled",
- "failed"
- ]
- },
- "explode": false
+ }
}
],
"responses": {
@@ -14006,33 +14095,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRun"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionList"
}
}
}
@@ -14059,31 +14122,38 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "x-oaiMeta": {
+ "name": "List Chat Completions",
+ "group": "chat",
+ "path": "list",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.chat.completions.list()\npage = page.data[0]\nprint(page.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const chatCompletion of client.chat.completions.list()) {\n console.log(chatCompletion.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Chat.Completions.List(context.TODO(), openai.ChatCompletionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.chat.completions.ChatCompletionListPage;\nimport com.openai.models.chat.completions.ChatCompletionListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionListPage page = client.chat().completions().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.chat.completions.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"chat.completion\",\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"model\": \"gpt-5.4\",\n \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {},\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum,\nLearning patterns in silence—\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \"tool_calls\": null,\n \"function_call\": null\n },\n \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \"response_format\": null\n }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
},
"post": {
- "operationId": "Evals_createEvalRun",
- "summary": "Create an evaluation run",
- "description": "Creates an evaluation run for the specified evaluation.",
- "parameters": [
- {
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to create a run for.",
- "schema": {
- "type": "string"
- }
- }
- ],
+ "operationId": "Chat_createChatCompletion",
+ "summary": "Create a chat completion",
+ "description": "Creates a chat completion from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EvalRun"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponse"
}
}
}
@@ -14110,40 +14180,109 @@
}
},
"tags": [
- "Evals"
+ "Chat"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateEvalRunRequest"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequest"
}
}
- }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create chat completion",
+ "group": "chat",
+ "path": "create",
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_chat_model_id\",\n \"messages\": [\n {\n \"role\": \"developer\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.chat.completions.create({\n messages: [{ role: \"developer\", content: \"You are a helpful assistant.\" }],\n model: \"VAR_chat_model_id\",\n store: true,\n });\n\n console.log(completion.choices[0]);\n}\n\nmain();\n",
+ "csharp": "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new SystemChatMessage(\"You are a helpful assistant.\"),\n new UserChatMessage(\"Hello!\")\n];\n\nChatCompletion completion = client.CompleteChat(messages);\n\nConsole.WriteLine(completion.Content[0].Text);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"id\": \"chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT\",\n \"object\": \"chat.completion\",\n \"created\": 1741569952,\n \"model\": \"gpt-5.4\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 19,\n \"completion_tokens\": 10,\n \"total_tokens\": 29,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\"\n}\n"
+ },
+ {
+ "title": "Image input",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is in this image?\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"\n }\n }\n ]\n }\n ],\n \"max_tokens\": 300\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const response = await openai.chat.completions.create({\n model: \"gpt-5.4\",\n messages: [\n {\n role: \"user\",\n content: [\n { type: \"text\", text: \"What's in this image?\" },\n {\n type: \"image_url\",\n image_url: {\n \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\",\n },\n }\n ],\n },\n ],\n });\n console.log(response.choices[0]);\n}\nmain();\n",
+ "csharp": "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new UserChatMessage(\n [\n ChatMessageContentPart.CreateTextPart(\"What's in this image?\"),\n ChatMessageContentPart.CreateImagePart(new Uri(\"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"))\n ])\n];\n\nChatCompletion completion = client.CompleteChat(messages);\n\nConsole.WriteLine(completion.Content[0].Text);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"id\": \"chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG\",\n \"object\": \"chat.completion\",\n \"created\": 1741570283,\n \"model\": \"gpt-5.4\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1117,\n \"completion_tokens\": 46,\n \"total_tokens\": 1163,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\"\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_chat_model_id\",\n \"messages\": [\n {\n \"role\": \"developer\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.chat.completions.create({\n model: \"VAR_chat_model_id\",\n messages: [\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n stream: true,\n });\n\n for await (const chunk of completion) {\n console.log(chunk.choices[0].delta.content);\n }\n}\n\nmain();\n",
+ "csharp": "using System;\nusing System.ClientModel;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new SystemChatMessage(\"You are a helpful assistant.\"),\n new UserChatMessage(\"Hello!\")\n];\n\nAsyncCollectionResult completionUpdates = client.CompleteChatStreamingAsync(messages);\n\nawait foreach (StreamingChatCompletionUpdate completionUpdate in completionUpdates)\n{\n if (completionUpdate.ContentUpdate.Count > 0)\n {\n Console.Write(completionUpdate.ContentUpdate[0].Text);\n }\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-4o-mini\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-4o-mini\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n....\n\n{\"id\":\"chatcmpl-123\",\"object\":\"chat.completion.chunk\",\"created\":1694268190,\"model\":\"gpt-4o-mini\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n"
+ },
+ {
+ "title": "Functions",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n-d '{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the weather like in Boston today?\"\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\"]\n }\n }\n }\n ],\n \"tool_choice\": \"auto\"\n}'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const messages = [{\"role\": \"user\", \"content\": \"What's the weather like in Boston today?\"}];\n const tools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \"required\": [\"location\"],\n },\n }\n }\n ];\n\n const response = await openai.chat.completions.create({\n model: \"gpt-5.4\",\n messages: messages,\n tools: tools,\n tool_choice: \"auto\",\n });\n\n console.log(response);\n}\n\nmain();\n",
+ "csharp": "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nChatTool getCurrentWeatherTool = ChatTool.CreateFunctionTool(\n functionName: \"get_current_weather\",\n functionDescription: \"Get the current weather in a given location\",\n functionParameters: BinaryData.FromString(\"\"\"\n {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [ \"celsius\", \"fahrenheit\" ]\n }\n },\n \"required\": [ \"location\" ]\n }\n \"\"\")\n);\n\nList messages =\n[\n new UserChatMessage(\"What's the weather like in Boston today?\"),\n];\n\nChatCompletionOptions options = new()\n{\n Tools =\n {\n getCurrentWeatherTool\n },\n ToolChoice = ChatToolChoice.CreateAutoChoice(),\n};\n\nChatCompletion completion = client.CompleteChat(messages, options);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"id\": \"chatcmpl-abc123\",\n \"object\": \"chat.completion\",\n \"created\": 1699896916,\n \"model\": \"gpt-4o-mini\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_abc123\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\n\"location\": \"Boston, MA\"\n}\"\n }\n }\n ]\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 82,\n \"completion_tokens\": 17,\n \"total_tokens\": 99,\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n }\n}\n"
+ },
+ {
+ "title": "Logprobs",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_chat_model_id\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"logprobs\": true,\n \"top_logprobs\": 2\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"string\",\n \"role\": \"developer\",\n }],\n model=\"gpt-5.4\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.chat.completions.create({\n messages: [{ role: \"user\", content: \"Hello!\" }],\n model: \"VAR_chat_model_id\",\n logprobs: true,\n top_logprobs: 2,\n });\n\n console.log(completion.choices[0]);\n}\n\nmain();\n",
+ "csharp": "using System;\nusing System.Collections.Generic;\n\nusing OpenAI.Chat;\n\nChatClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nList messages =\n[\n new UserChatMessage(\"Hello!\")\n];\n\nChatCompletionOptions options = new()\n{\n IncludeLogProbabilities = true,\n TopLogProbabilityCount = 2\n};\n\nChatCompletion completion = client.CompleteChat(messages, options);\n\nConsole.WriteLine(completion.Content[0].Text);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.create({\n messages: [{ content: 'string', role: 'developer' }],\n model: 'gpt-5.4',\n});\n\nconsole.log(chatCompletion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{\n\t\tMessages: []openai.ChatCompletionMessageParamUnion{{\n\t\t\tOfDeveloper: &openai.ChatCompletionDeveloperMessageParam{\n\t\t\t\tContent: openai.ChatCompletionDeveloperMessageParamContentUnion{\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t}},\n\t\tModel: shared.ChatModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.ChatModel;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()\n .addDeveloperMessage(\"string\")\n .model(ChatModel.GPT_5_4)\n .build();\n ChatCompletion chatCompletion = client.chat().completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.create(messages: [{content: \"string\", role: :developer}], model: :\"gpt-5.4\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"id\": \"chatcmpl-123\",\n \"object\": \"chat.completion\",\n \"created\": 1702685778,\n \"model\": \"gpt-4o-mini\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\"\n },\n \"logprobs\": {\n \"content\": [\n {\n \"token\": \"Hello\",\n \"logprob\": -0.31725305,\n \"bytes\": [72, 101, 108, 108, 111],\n \"top_logprobs\": [\n {\n \"token\": \"Hello\",\n \"logprob\": -0.31725305,\n \"bytes\": [72, 101, 108, 108, 111]\n },\n {\n \"token\": \"Hi\",\n \"logprob\": -1.3190403,\n \"bytes\": [72, 105]\n }\n ]\n },\n {\n \"token\": \"!\",\n \"logprob\": -0.02380986,\n \"bytes\": [\n 33\n ],\n \"top_logprobs\": [\n {\n \"token\": \"!\",\n \"logprob\": -0.02380986,\n \"bytes\": [33]\n },\n {\n \"token\": \" there\",\n \"logprob\": -3.787621,\n \"bytes\": [32, 116, 104, 101, 114, 101]\n }\n ]\n },\n {\n \"token\": \" How\",\n \"logprob\": -0.000054669687,\n \"bytes\": [32, 72, 111, 119],\n \"top_logprobs\": [\n {\n \"token\": \" How\",\n \"logprob\": -0.000054669687,\n \"bytes\": [32, 72, 111, 119]\n },\n {\n \"token\": \"<|end|>\",\n \"logprob\": -10.953937,\n \"bytes\": null\n }\n ]\n },\n {\n \"token\": \" can\",\n \"logprob\": -0.015801601,\n \"bytes\": [32, 99, 97, 110],\n \"top_logprobs\": [\n {\n \"token\": \" can\",\n \"logprob\": -0.015801601,\n \"bytes\": [32, 99, 97, 110]\n },\n {\n \"token\": \" may\",\n \"logprob\": -4.161023,\n \"bytes\": [32, 109, 97, 121]\n }\n ]\n },\n {\n \"token\": \" I\",\n \"logprob\": -3.7697225e-6,\n \"bytes\": [\n 32,\n 73\n ],\n \"top_logprobs\": [\n {\n \"token\": \" I\",\n \"logprob\": -3.7697225e-6,\n \"bytes\": [32, 73]\n },\n {\n \"token\": \" assist\",\n \"logprob\": -13.596657,\n \"bytes\": [32, 97, 115, 115, 105, 115, 116]\n }\n ]\n },\n {\n \"token\": \" assist\",\n \"logprob\": -0.04571125,\n \"bytes\": [32, 97, 115, 115, 105, 115, 116],\n \"top_logprobs\": [\n {\n \"token\": \" assist\",\n \"logprob\": -0.04571125,\n \"bytes\": [32, 97, 115, 115, 105, 115, 116]\n },\n {\n \"token\": \" help\",\n \"logprob\": -3.1089056,\n \"bytes\": [32, 104, 101, 108, 112]\n }\n ]\n },\n {\n \"token\": \" you\",\n \"logprob\": -5.4385737e-6,\n \"bytes\": [32, 121, 111, 117],\n \"top_logprobs\": [\n {\n \"token\": \" you\",\n \"logprob\": -5.4385737e-6,\n \"bytes\": [32, 121, 111, 117]\n },\n {\n \"token\": \" today\",\n \"logprob\": -12.807695,\n \"bytes\": [32, 116, 111, 100, 97, 121]\n }\n ]\n },\n {\n \"token\": \" today\",\n \"logprob\": -0.0040071653,\n \"bytes\": [32, 116, 111, 100, 97, 121],\n \"top_logprobs\": [\n {\n \"token\": \" today\",\n \"logprob\": -0.0040071653,\n \"bytes\": [32, 116, 111, 100, 97, 121]\n },\n {\n \"token\": \"?\",\n \"logprob\": -5.5247097,\n \"bytes\": [63]\n }\n ]\n },\n {\n \"token\": \"?\",\n \"logprob\": -0.0008108172,\n \"bytes\": [63],\n \"top_logprobs\": [\n {\n \"token\": \"?\",\n \"logprob\": -0.0008108172,\n \"bytes\": [63]\n },\n {\n \"token\": \"?\n\",\n \"logprob\": -7.184561,\n \"bytes\": [63, 10]\n }\n ]\n }\n ]\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 9,\n \"completion_tokens\": 9,\n \"total_tokens\": 18,\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"system_fingerprint\": null\n}\n"
+ }
+ ]
}
}
},
- "/openai/v1/evals/{eval_id}/runs/{run_id}": {
+ "/openai/v1/chat/completions/{completion_id}": {
"delete": {
- "operationId": "Evals_deleteEvalRun",
- "summary": "Delete an evaluation run",
- "description": "Removes the specified evaluation run.",
+ "operationId": "Chat_deleteChatCompletion",
+ "summary": "Delete a chat completion",
+ "description": "Deletes a chat completion by its identifier.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to delete the run from.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
+ "name": "completion_id",
"in": "path",
"required": true,
- "description": "The ID of the run to delete.",
+ "description": "The ID of the chat completion to delete.",
"schema": {
"type": "string"
}
@@ -14155,7 +14294,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DeleteEvalRunResponse"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionDeleted"
}
}
}
@@ -14182,28 +14321,34 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete chat completion",
+ "group": "chat",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/chat/completions/chat_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nchat_completion_deleted = client.chat.completions.delete(\n \"completion_id\",\n)\nprint(chat_completion_deleted.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletionDeleted = await client.chat.completions.delete('completion_id');\n\nconsole.log(chatCompletionDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletionDeleted, err := client.Chat.Completions.Delete(context.TODO(), \"completion_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletionDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.chat.completions.ChatCompletionDeleteParams;\nimport com.openai.models.chat.completions.ChatCompletionDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionDeleted chatCompletionDeleted = client.chat().completions().delete(\"completion_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion_deleted = openai.chat.completions.delete(\"completion_id\")\n\nputs(chat_completion_deleted)"
+ },
+ "response": "{\n \"object\": \"chat.completion.deleted\",\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"deleted\": true\n}\n"
+ }
+ }
},
"get": {
- "operationId": "Evals_getEvalRun",
- "summary": "Get an evaluation run",
- "description": "Retrieves the specified evaluation run and its current status.",
+ "operationId": "Chat_getChatCompletion",
+ "summary": "Get a chat completion",
+ "description": "Retrieves a chat completion by its identifier.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to retrieve runs for.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
+ "name": "completion_id",
"in": "path",
"required": true,
- "description": "The ID of the run to retrieve.",
+ "description": "The ID of the chat completion to retrieve.",
"schema": {
"type": "string"
}
@@ -14215,7 +14360,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EvalRun"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponse"
}
}
}
@@ -14242,28 +14387,34 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "x-oaiMeta": {
+ "name": "Get chat completion",
+ "group": "chat",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions/chatcmpl-abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nchat_completion = client.chat.completions.retrieve(\n \"completion_id\",\n)\nprint(chat_completion.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.retrieve('completion_id');\n\nconsole.log(chatCompletion.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.Get(context.TODO(), \"completion_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletion chatCompletion = client.chat().completions().retrieve(\"completion_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.retrieve(\"completion_id\")\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"object\": \"chat.completion\",\n \"id\": \"chatcmpl-abc123\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {},\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum,\nLearning patterns in silence—\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \"tool_calls\": null,\n \"function_call\": null\n },\n \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \"response_format\": null\n}\n"
+ }
+ }
},
"post": {
- "operationId": "Evals_cancelEvalRun",
- "summary": "Cancel an evaluation run",
- "description": "Cancels an ongoing evaluation run.",
+ "operationId": "Chat_updateChatCompletion",
+ "summary": "Update a chat completion",
+ "description": "Updates a chat completion with the supplied changes.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation whose run you want to cancel.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
+ "name": "completion_id",
"in": "path",
"required": true,
- "description": "The ID of the run to cancel.",
+ "description": "The ID of the chat completion to update.",
"schema": {
"type": "string"
}
@@ -14275,7 +14426,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EvalRun"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponse"
}
}
}
@@ -14302,29 +14453,47 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UpdateChatCompletionParametersBody"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Update chat completion",
+ "group": "chat",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/chat/completions/chat_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"metadata\": {\"foo\": \"bar\"}}'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nchat_completion = client.chat.completions.update(\n completion_id=\"completion_id\",\n metadata={\n \"foo\": \"string\"\n },\n)\nprint(chat_completion.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst chatCompletion = await client.chat.completions.update('completion_id', {\n metadata: { foo: 'string' },\n});\n\nconsole.log(chatCompletion.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tchatCompletion, err := client.Chat.Completions.Update(\n\t\tcontext.TODO(),\n\t\t\"completion_id\",\n\t\topenai.ChatCompletionUpdateParams{\n\t\t\tMetadata: shared.Metadata{\n\t\t\t\t\"foo\": \"string\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", chatCompletion.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.chat.completions.ChatCompletion;\nimport com.openai.models.chat.completions.ChatCompletionUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ChatCompletionUpdateParams params = ChatCompletionUpdateParams.builder()\n .completionId(\"completion_id\")\n .metadata(ChatCompletionUpdateParams.Metadata.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"string\"))\n .build())\n .build();\n ChatCompletion chatCompletion = client.chat().completions().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nchat_completion = openai.chat.completions.update(\"completion_id\", metadata: {foo: \"string\"})\n\nputs(chat_completion)"
+ },
+ "response": "{\n \"object\": \"chat.completion\",\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {\n \"foo\": \"bar\"\n },\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum,\nLearning patterns in silence—\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \"tool_calls\": null,\n \"function_call\": null\n },\n \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \"response_format\": null\n}\n"
+ }
+ }
}
},
- "/openai/v1/evals/{eval_id}/runs/{run_id}/output_items": {
+ "/openai/v1/chat/completions/{completion_id}/messages": {
"get": {
- "operationId": "Evals_getEvalRunOutputItems",
- "summary": "List evaluation run output items",
- "description": "Returns the output items produced by the specified evaluation run.",
+ "operationId": "Chat_getChatCompletionMessages",
+ "summary": "Get chat completion messages",
+ "description": "Retrieves chat completion messages by its identifier.",
"parameters": [
{
- "name": "eval_id",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
+ "name": "completion_id",
"in": "path",
"required": true,
- "description": "The ID of the run to retrieve output items for.",
+ "description": "The ID of the chat completion to retrieve messages from.",
"schema": {
"type": "string"
}
@@ -14333,49 +14502,30 @@
"name": "after",
"in": "query",
"required": false,
- "description": "Identifier for the last run from the previous pagination request.",
+ "description": "Identifier for the last message from the previous pagination request.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
},
{
"name": "limit",
"in": "query",
"required": false,
- "description": "Number of runs to retrieve.",
+ "description": "Number of messages to retrieve.",
"schema": {
"$ref": "#/components/schemas/integer",
"default": 20
- },
- "explode": false
+ }
},
{
"name": "order",
"in": "query",
"required": false,
- "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
+ "description": "Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
"schema": {
- "type": "string",
- "enum": [
- "asc",
- "desc"
- ],
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
"default": "asc"
- },
- "explode": false
- },
- {
- "name": "status",
- "in": "query",
- "required": false,
- "description": "Filter output items by status. Use `failed` to filter by failed output\nitems or `pass` to filter by passed output items.",
- "schema": {
- "type": "string",
- "enum": [
- "fail",
- "pass"
- ]
}
}
],
@@ -14385,33 +14535,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunOutputItem"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageList"
}
}
}
@@ -14438,51 +14562,39 @@
}
},
"tags": [
- "Evals"
- ]
+ "Chat"
+ ],
+ "x-oaiMeta": {
+ "name": "Get chat messages",
+ "group": "chat",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/chat/completions/chat_abc123/messages \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.chat.completions.messages.list(\n completion_id=\"completion_id\",\n)\npage = page.data[0]\nprint(page)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const chatCompletionStoreMessage of client.chat.completions.messages.list(\n 'completion_id',\n)) {\n console.log(chatCompletionStoreMessage);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Chat.Completions.Messages.List(\n\t\tcontext.TODO(),\n\t\t\"completion_id\",\n\t\topenai.ChatCompletionMessageListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.chat.completions.messages.MessageListPage;\nimport com.openai.models.chat.completions.messages.MessageListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageListPage page = client.chat().completions().messages().list(\"completion_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.chat.completions.messages.list(\"completion_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"role\": \"user\",\n \"content\": \"write a haiku about ai\",\n \"name\": null,\n \"content_parts\": null\n }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
}
},
- "/openai/v1/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}": {
- "get": {
- "operationId": "Evals_getEvalRunOutputItem",
- "summary": "Get an output item of an evaluation run",
- "description": "Retrieves a single output item from the specified evaluation run.",
- "parameters": [
- {
- "name": "eval_id",
- "in": "path",
- "required": true,
- "description": "The ID of the evaluation to retrieve runs for.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "run_id",
- "in": "path",
- "required": true,
- "description": "The ID of the run to retrieve.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "output_item_id",
- "in": "path",
- "required": true,
- "description": "The ID of the output item to retrieve.",
- "schema": {
- "type": "string"
- }
- }
- ],
+ "/openai/v1/completions": {
+ "post": {
+ "operationId": "Completions_createCompletion",
+ "summary": "Create a completion",
+ "description": "Creates a completion from the supplied request.",
+ "parameters": [],
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/EvalRunOutputItem"
+ "$ref": "#/components/schemas/OpenAI.CreateCompletionResponse"
}
}
}
@@ -14509,25 +14621,98 @@
}
},
"tags": [
- "Evals"
- ]
+ "Completions"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateCompletionRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create completion",
+ "group": "completions",
+ "legacy": true,
+ "examples": [
+ {
+ "title": "No streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_completion_model_id\",\n \"prompt\": \"Say this is a test\",\n \"max_tokens\": 7,\n \"temperature\": 0\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.completions.create(\n model=\"gpt-3.5-turbo-instruct\",\n prompt=\"This is a test.\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const completion = await openai.completions.create({\n model: \"VAR_completion_model_id\",\n prompt: \"Say this is a test.\",\n max_tokens: 7,\n temperature: 0,\n });\n\n console.log(completion);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst completion = await client.completions.create({\n model: 'gpt-3.5-turbo-instruct',\n prompt: 'This is a test.',\n});\n\nconsole.log(completion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcompletion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{\n\t\tModel: openai.CompletionNewParamsModelGPT3_5TurboInstruct,\n\t\tPrompt: openai.CompletionNewParamsPromptUnion{\n\t\t\tOfString: openai.String(\"This is a test.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", completion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.completions.Completion;\nimport com.openai.models.completions.CompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n CompletionCreateParams params = CompletionCreateParams.builder()\n .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)\n .prompt(\"This is a test.\")\n .build();\n Completion completion = client.completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncompletion = openai.completions.create(model: :\"gpt-3.5-turbo-instruct\", prompt: \"This is a test.\")\n\nputs(completion)"
+ },
+ "response": "{\n \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n \"object\": \"text_completion\",\n \"created\": 1589478378,\n \"model\": \"VAR_completion_model_id\",\n \"system_fingerprint\": \"fp_44709d6fcb\",\n \"choices\": [\n {\n \"text\": \"\n\nThis is indeed a test\",\n \"index\": 0,\n \"logprobs\": null,\n \"finish_reason\": \"length\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 5,\n \"completion_tokens\": 7,\n \"total_tokens\": 12\n }\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"VAR_completion_model_id\",\n \"prompt\": \"Say this is a test\",\n \"max_tokens\": 7,\n \"temperature\": 0,\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.completions.create(\n model=\"gpt-3.5-turbo-instruct\",\n prompt=\"This is a test.\",\n):\n print(completion)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const stream = await openai.completions.create({\n model: \"VAR_completion_model_id\",\n prompt: \"Say this is a test.\",\n stream: true,\n });\n\n for await (const chunk of stream) {\n console.log(chunk.choices[0].text)\n }\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst completion = await client.completions.create({\n model: 'gpt-3.5-turbo-instruct',\n prompt: 'This is a test.',\n});\n\nconsole.log(completion);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcompletion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{\n\t\tModel: openai.CompletionNewParamsModelGPT3_5TurboInstruct,\n\t\tPrompt: openai.CompletionNewParamsPromptUnion{\n\t\t\tOfString: openai.String(\"This is a test.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", completion)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.completions.Completion;\nimport com.openai.models.completions.CompletionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n CompletionCreateParams params = CompletionCreateParams.builder()\n .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)\n .prompt(\"This is a test.\")\n .build();\n Completion completion = client.completions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncompletion = openai.completions.create(model: :\"gpt-3.5-turbo-instruct\", prompt: \"This is a test.\")\n\nputs(completion)"
+ },
+ "response": "{\n \"id\": \"cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe\",\n \"object\": \"text_completion\",\n \"created\": 1690759702,\n \"choices\": [\n {\n \"text\": \"This\",\n \"index\": 0,\n \"logprobs\": null,\n \"finish_reason\": null\n }\n ],\n \"model\": \"gpt-3.5-turbo-instruct\"\n \"system_fingerprint\": \"fp_44709d6fcb\",\n}\n"
+ }
+ ]
+ }
}
},
- "/openai/v1/fine_tuning/jobs": {
- "post": {
- "operationId": "createFineTuningJob",
- "summary": "Create a fine-tuning job",
- "description": "Creates a fine-tuning job which begins the process of creating a new model from a given dataset.\n\nResponse includes details of the enqueued job including job status and the name of the fine-tuned models once complete.\n\n[Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)",
+ "/openai/v1/containers": {
+ "get": {
+ "operationId": "Containers_listContainers",
+ "summary": "List containers",
+ "description": "Lists containers matching the request filters.",
"parameters": [
{
- "name": "api-version",
+ "name": "limit",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "name",
+ "in": "query",
+ "required": false,
+ "description": "Filter results by container name.",
+ "schema": {
+ "type": "string"
+ }
}
],
"responses": {
@@ -14536,7 +14721,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "$ref": "#/components/schemas/OpenAI.ContainerListResource"
}
}
}
@@ -14563,55 +14748,169 @@
}
},
"tags": [
- "Fine-Tuning"
+ "Containers"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequest"
- }
- }
+ "x-oaiMeta": {
+ "name": "List containers",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const containerListResponse of client.containers.list()) {\n console.log(containerListResponse.id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.containers.list()\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Containers.List(context.TODO(), openai.ContainerListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.ContainerListPage;\nimport com.openai.models.containers.ContainerListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ContainerListPage page = client.containers().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.containers.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container\",\n \"created_at\": 1747844794,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747844794,\n \"memory_limit\": \"4g\",\n \"name\": \"My Container\"\n }\n ],\n \"first_id\": \"container_123\",\n \"last_id\": \"container_123\",\n \"has_more\": false\n}\n"
}
- }
+ },
+ "x-ms-list": true
},
- "get": {
- "operationId": "listPaginatedFineTuningJobs",
- "summary": "List fine-tuning jobs",
- "description": "Returns the fine-tuning jobs for the current organization.",
- "parameters": [
+ "post": {
+ "operationId": "Containers_createContainer",
+ "summary": "Create a container",
+ "description": "Creates a container from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ContainerResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Containers"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateContainerBody"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create container",
+ "group": "containers",
+ "path": "post",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"My Container\",\n \"memory_limit\": \"4g\",\n \"skills\": [\n {\n \"type\": \"skill_reference\",\n \"skill_id\": \"skill_4db6f1a2c9e73508b41f9da06e2c7b5f\"\n },\n {\n \"type\": \"skill_reference\",\n \"skill_id\": \"openai-spreadsheets\",\n \"version\": \"latest\"\n }\n ],\n \"network_policy\": {\n \"type\": \"allowlist\",\n \"allowed_domains\": [\"api.buildkite.com\"]\n }\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst container = await client.containers.create({ name: 'name' });\n\nconsole.log(container.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncontainer = client.containers.create(\n name=\"name\",\n)\nprint(container.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcontainer, err := client.Containers.New(context.TODO(), openai.ContainerNewParams{\n\t\tName: \"name\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", container.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.ContainerCreateParams;\nimport com.openai.models.containers.ContainerCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ContainerCreateParams params = ContainerCreateParams.builder()\n .name(\"name\")\n .build();\n ContainerCreateResponse container = client.containers().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncontainer = openai.containers.create(name: \"name\")\n\nputs(container)"
+ },
+ "response": "{\n \"id\": \"cntr_682e30645a488191b6363a0cbefc0f0a025ec61b66250591\",\n \"object\": \"container\",\n \"created_at\": 1747857508,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747857508,\n \"network_policy\": {\n \"type\": \"allowlist\",\n \"allowed_domains\": [\"api.buildkite.com\"]\n },\n \"memory_limit\": \"4g\",\n \"name\": \"My Container\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/containers/{container_id}": {
+ "delete": {
+ "operationId": "Containers_deleteContainer",
+ "summary": "Delete a container",
+ "description": "Deletes a container by its identifier.",
+ "parameters": [
{
- "name": "after",
- "in": "query",
- "required": false,
- "description": "Identifier for the last job from the previous pagination request.",
+ "name": "container_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the container to delete.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded."
},
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "Number of fine-tuning jobs to retrieve.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
},
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a container",
+ "group": "containers",
+ "path": "delete",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.containers.delete('container_id');",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nclient.containers.delete(\n \"container_id\",\n)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Containers.Delete(context.TODO(), \"container_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.ContainerDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n client.containers().delete(\"container_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresult = openai.containers.delete(\"container_id\")\n\nputs(result)"
+ },
+ "response": "{\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Containers_retrieveContainer",
+ "summary": "Get a container",
+ "description": "Retrieves a container by its identifier.",
+ "parameters": [
{
- "name": "api-version",
- "in": "query",
+ "name": "container_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
- },
- "explode": false
+ }
}
],
"responses": {
@@ -14620,7 +14919,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse"
+ "$ref": "#/components/schemas/OpenAI.ContainerResource"
}
}
}
@@ -14647,34 +14946,70 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve container",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst container = await client.containers.retrieve('container_id');\n\nconsole.log(container.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncontainer = client.containers.retrieve(\n \"container_id\",\n)\nprint(container.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcontainer, err := client.Containers.Get(context.TODO(), \"container_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", container.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.ContainerRetrieveParams;\nimport com.openai.models.containers.ContainerRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ContainerRetrieveResponse container = client.containers().retrieve(\"container_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncontainer = openai.containers.retrieve(\"container_id\")\n\nputs(container)"
+ },
+ "response": "{\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container\",\n \"created_at\": 1747844794,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747844794,\n \"memory_limit\": \"4g\",\n \"name\": \"My Container\"\n}\n"
+ }
+ }
}
},
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}": {
+ "/openai/v1/containers/{container_id}/files": {
"get": {
- "operationId": "retrieveFineTuningJob",
- "summary": "Get a fine-tuning job",
- "description": "Gets info about a fine-tuning job.\n\n[Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)",
+ "operationId": "Containers_listContainerFiles",
+ "summary": "List container files",
+ "description": "Lists container files matching the request filters.",
"parameters": [
{
- "name": "fine_tuning_job_id",
+ "name": "container_id",
"in": "path",
"required": true,
- "description": "The ID of the fine-tuning job.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
}
},
{
- "name": "api-version",
+ "name": "limit",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-list-continuation-token": true
}
],
"responses": {
@@ -14683,7 +15018,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "$ref": "#/components/schemas/OpenAI.ContainerFileListResource"
}
}
}
@@ -14710,43 +15045,48 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
- }
- },
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel": {
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "List container files",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fileListResponse of client.containers.files.list('container_id')) {\n console.log(fileListResponse.id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.containers.files.list(\n container_id=\"container_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Containers.Files.List(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\topenai.ContainerFileListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.files.FileListPage;\nimport com.openai.models.containers.files.FileListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileListPage page = client.containers().files().list(\"container_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.containers.files.list(\"container_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n }\n ],\n \"first_id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"has_more\": false,\n \"last_id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\"\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
"post": {
- "operationId": "cancelFineTuningJob",
- "summary": "Cancel a fine-tuning job",
- "description": "Immediately cancels the specified fine-tuning job.",
+ "operationId": "Containers_createContainerFileMultipart_Containers_createContainerFileJson",
"parameters": [
{
- "name": "fine_tuning_job_id",
+ "name": "container_id",
"in": "path",
"required": true,
- "description": "The ID of the fine-tuning job to cancel.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
}
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
}
],
+ "description": "Creates a container file multipart from the supplied request. Creates a container file json from the supplied request.",
+ "summary": "Create a container file multipart Create a container file json",
"responses": {
"200": {
"description": "The request has succeeded.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "$ref": "#/components/schemas/OpenAI.ContainerFileResource"
}
}
}
@@ -14772,57 +15112,138 @@
}
}
},
+ "x-ms-request-body-description-override": "The request body.",
+ "x-oaiMeta": {
+ "name": "Create container file",
+ "group": "containers",
+ "path": "post",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F file=\"@example.txt\"\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst file = await client.containers.files.create('container_id');\n\nconsole.log(file.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile = client.containers.files.create(\n container_id=\"container_id\",\n)\nprint(file.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfile, err := client.Containers.Files.New(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\topenai.ContainerFileNewParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", file.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.files.FileCreateParams;\nimport com.openai.models.containers.files.FileCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileCreateResponse file = client.containers().files().create(\"container_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile = openai.containers.files.create(\"container_id\")\n\nputs(file)"
+ },
+ "response": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n}\n"
+ }
+ },
"tags": [
- "Fine-Tuning"
- ]
+ "Containers"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateContainerFileBody"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateContainerFileBody"
+ }
+ }
+ },
+ "description": "The multipart request body. The request body."
+ }
}
},
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints": {
- "get": {
- "operationId": "listFineTuningJobCheckpoints",
- "summary": "List fine-tuning job checkpoints",
- "description": "Returns the checkpoints saved during the specified fine-tuning job.",
+ "/openai/v1/containers/{container_id}/files/{file_id}": {
+ "delete": {
+ "operationId": "Containers_deleteContainerFile",
+ "summary": "Delete a container file",
+ "description": "Deletes a container file by its identifier.",
"parameters": [
{
- "name": "fine_tuning_job_id",
+ "name": "container_id",
"in": "path",
"required": true,
- "description": "The ID of the fine-tuning job to get checkpoints for.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
}
},
{
- "name": "after",
- "in": "query",
- "required": false,
- "description": "Identifier for the last checkpoint ID from the previous pagination request.",
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-description-override": "The ID of the file."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded."
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
},
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a container file",
+ "group": "containers",
+ "path": "delete",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863/files/cfile_682e0e8a43c88191a7978f477a09bdf5 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.containers.files.delete('file_id', { container_id: 'container_id' });",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nclient.containers.files.delete(\n file_id=\"file_id\",\n container_id=\"container_id\",\n)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Containers.Files.Delete(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\t\"file_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.files.FileDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileDeleteParams params = FileDeleteParams.builder()\n .containerId(\"container_id\")\n .fileId(\"file_id\")\n .build();\n client.containers().files().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresult = openai.containers.files.delete(\"file_id\", container_id: \"container_id\")\n\nputs(result)"
+ },
+ "response": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Containers_retrieveContainerFile",
+ "summary": "Get a container file",
+ "description": "Retrieves a container file by its identifier.",
+ "parameters": [
{
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "Number of checkpoints to retrieve.",
+ "name": "container_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the container.",
"schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- },
- "explode": false
+ "type": "string"
+ }
},
{
- "name": "api-version",
- "in": "query",
+ "name": "file_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the file.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-description-override": "The ID of the file."
}
],
"responses": {
@@ -14831,7 +15252,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse"
+ "$ref": "#/components/schemas/OpenAI.ContainerFileResource"
}
}
}
@@ -14858,68 +15279,55 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve container file",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/container_123/files/file_456 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst file = await client.containers.files.retrieve('file_id', { container_id: 'container_id' });\n\nconsole.log(file.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile = client.containers.files.retrieve(\n file_id=\"file_id\",\n container_id=\"container_id\",\n)\nprint(file.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfile, err := client.Containers.Files.Get(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\t\"file_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", file.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.containers.files.FileRetrieveParams;\nimport com.openai.models.containers.files.FileRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileRetrieveParams params = FileRetrieveParams.builder()\n .containerId(\"container_id\")\n .fileId(\"file_id\")\n .build();\n FileRetrieveResponse file = client.containers().files().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile = openai.containers.files.retrieve(\"file_id\", container_id: \"container_id\")\n\nputs(file)"
+ },
+ "response": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n}\n"
+ }
+ }
}
},
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/events": {
+ "/openai/v1/containers/{container_id}/files/{file_id}/content": {
"get": {
- "operationId": "listFineTuningJobEvents",
- "summary": "List fine-tuning job events",
- "description": "Returns the status events emitted during the specified fine-tuning job.",
+ "operationId": "Containers_retrieveContainerFileContent",
+ "summary": "Get a container file content",
+ "description": "Retrieves a container file content by its identifier.",
"parameters": [
{
- "name": "fine_tuning_job_id",
+ "name": "container_id",
"in": "path",
"required": true,
- "description": "The ID of the fine-tuning job to get events for.",
+ "description": "The ID of the container.",
"schema": {
"type": "string"
}
},
{
- "name": "after",
- "in": "query",
- "required": false,
- "description": "Identifier for the last event from the previous pagination request.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "Number of events to retrieve.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
- },
- {
- "name": "api-version",
- "in": "query",
+ "name": "file_id",
+ "in": "path",
"required": true,
- "description": "The API version to use for this operation.",
+ "description": "The ID of the file.",
"schema": {
"type": "string"
},
- "explode": false
+ "x-ms-description-override": "The ID of the file."
}
],
"responses": {
"200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.ListFineTuningJobEventsResponse"
- }
- }
- }
+ "description": "The request has succeeded."
},
"4XX": {
"description": "Client error",
@@ -14943,34 +15351,40 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
+ "Containers"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve container file content",
+ "group": "containers",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/containers/container_123/files/cfile_456/content \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst content = await client.containers.files.content.retrieve('file_id', {\n container_id: 'container_id',\n});\n\nconsole.log(content);\n\nconst data = await content.blob();\nconsole.log(data);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncontent = client.containers.files.content.retrieve(\n file_id=\"file_id\",\n container_id=\"container_id\",\n)\nprint(content)\ndata = content.read()\nprint(data)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcontent, err := client.Containers.Files.Content.Get(\n\t\tcontext.TODO(),\n\t\t\"container_id\",\n\t\t\"file_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", content)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.containers.files.content.ContentRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ContentRetrieveParams params = ContentRetrieveParams.builder()\n .containerId(\"container_id\")\n .fileId(\"file_id\")\n .build();\n HttpResponse content = client.containers().files().content().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncontent = openai.containers.files.content.retrieve(\"file_id\", container_id: \"container_id\")\n\nputs(content)"
+ },
+ "response": "\n"
+ }
+ }
}
},
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause": {
+ "/openai/v1/conversations": {
"post": {
- "operationId": "pauseFineTuningJob",
- "summary": "Pause a fine-tuning job",
- "description": "Pauses the specified fine-tuning job while it is running.",
+ "operationId": "createConversation",
+ "summary": "Create a conversation",
+ "description": "Creates a new conversation resource.",
"parameters": [
{
- "name": "fine_tuning_job_id",
- "in": "path",
- "required": true,
- "description": "The ID of the fine-tuning job to pause.",
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
"schema": {
"type": "string"
}
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
}
],
"responses": {
@@ -14979,7 +15393,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
}
}
}
@@ -15006,34 +15420,112 @@
}
},
"tags": [
- "Fine-Tuning"
- ]
- }
- },
- "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume": {
- "post": {
- "operationId": "resumeFineTuningJob",
- "summary": "Resume a fine-tuning job",
- "description": "Resumes the specified fine-tuning job after it has been paused.",
+ "Conversations"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateConversationBody"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Create a conversation",
+ "group": "conversations",
+ "path": "create",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"metadata\": {\"topic\": \"demo\"},\n \"items\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ]\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst conversation = await client.conversations.create({\n metadata: { topic: \"demo\" },\n items: [\n { type: \"message\", role: \"user\", content: \"Hello!\" }\n ],\n});\nconsole.log(conversation);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation = client.conversations.create()\nprint(conversation.id)",
+ "csharp": "using System;\nusing System.Collections.Generic;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversation conversation = client.CreateConversation(\n new CreateConversationOptions\n {\n Metadata = new Dictionary\n {\n { \"topic\", \"demo\" }\n },\n Items =\n {\n new ConversationMessageInput\n {\n Role = \"user\",\n Content = \"Hello!\",\n }\n }\n }\n);\nConsole.WriteLine(conversation.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversation = await client.conversations.create();\n\nconsole.log(conversation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversation, err := client.Conversations.New(context.TODO(), conversations.ConversationNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.Conversation;\nimport com.openai.models.conversations.ConversationCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Conversation conversation = client.conversations().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation = openai.conversations.create\n\nputs(conversation)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation\",\n \"created_at\": 1741900000,\n \"metadata\": {\"topic\": \"demo\"}\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "listConversations",
+ "summary": "List conversations",
+ "description": "Returns the conversations available in the current project.",
"parameters": [
{
- "name": "fine_tuning_job_id",
- "in": "path",
- "required": true,
- "description": "The ID of the fine-tuning job to resume.",
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
"schema": {
"type": "string"
- }
+ },
+ "explode": false
},
{
- "name": "api-version",
+ "name": "before",
"in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "agent_name",
+ "in": "query",
+ "required": false,
+ "description": "Filter by agent name. If provided, only items associated with the specified agent will be returned.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "agent_id",
+ "in": "query",
+ "required": false,
+ "description": "Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.",
"schema": {
"type": "string"
},
"explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
}
],
"responses": {
@@ -15042,7 +15534,33 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
}
}
}
@@ -15069,16 +15587,25 @@
}
},
"tags": [
- "Fine-Tuning"
+ "Conversations"
]
}
},
- "/openai/v1/responses": {
+ "/openai/v1/conversations/{conversation_id}": {
"post": {
- "operationId": "createResponse",
- "summary": "Create a model response",
- "description": "Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response.",
+ "operationId": "updateConversation",
+ "summary": "Update a conversation",
+ "description": "Modifies the specified conversation's properties.",
"parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation to update.",
+ "schema": {
+ "type": "string"
+ }
+ },
{
"name": "x-ms-user-identity",
"in": "header",
@@ -15092,347 +15619,98 @@
"responses": {
"200": {
"description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "content": {
+ "application/json": {
"schema": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
}
}
- },
+ }
+ },
+ "4XX": {
+ "description": "Client error",
"content": {
"application/json": {
"schema": {
- "type": "object",
- "properties": {
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
- },
- "top_logprobs": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "temperature": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "top_p": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "user": {
- "type": "string",
- "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
- "deprecated": true
- },
- "safety_identifier": {
- "type": "string",
- "maxLength": 64,
- "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
- },
- "prompt_cache_key": {
- "type": "string",
- "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
- },
- "service_tier": {
- "$ref": "#/components/schemas/OpenAI.ServiceTier"
- },
- "prompt_cache_retention": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_memory",
- "24h"
- ]
- },
- {
- "type": "null"
- }
- ]
- },
- "previous_response_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "model": {
- "type": "string",
- "description": "The model deployment to use for the creation of this response."
- },
- "background": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "max_tool_calls": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "text": {
- "$ref": "#/components/schemas/OpenAI.ResponseTextParam"
- },
- "tools": {
- "$ref": "#/components/schemas/OpenAI.ToolsArray"
- },
- "tool_choice": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ]
- },
- "prompt": {
- "$ref": "#/components/schemas/OpenAI.Prompt"
- },
- "truncation": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "disabled"
- ]
- },
- {
- "type": "null"
- }
- ],
- "default": "disabled"
- },
- "id": {
- "type": "string",
- "description": "Unique identifier for this Response."
- },
- "object": {
- "type": "string",
- "enum": [
- "response"
- ],
- "description": "The object type of this resource - always set to `response`.",
- "x-stainless-const": true
- },
- "status": {
- "type": "string",
- "enum": [
- "completed",
- "failed",
- "in_progress",
- "cancelled",
- "queued",
- "incomplete"
- ],
- "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) of when this Response was created."
- },
- "completed_at": {
- "anyOf": [
- {
- "type": "string",
- "format": "date-time"
- },
- {
- "type": "null"
- }
- ],
- "type": "integer",
- "format": "unixTimestamp"
- },
- "error": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseError"
- },
- {
- "type": "null"
- }
- ]
- },
- "incomplete_details": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails"
- },
- {
- "type": "null"
- }
- ]
- },
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- },
- "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs."
- },
- "reasoning": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Reasoning"
- },
- {
- "type": "null"
- }
- ]
- },
- "instructions": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "output_text": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "usage": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsage"
- },
- "moderation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Moderation"
- },
- {
- "type": "null"
- }
- ]
- },
- "parallel_tool_calls": {
- "type": "boolean",
- "description": "Whether to allow the model to run tool calls in parallel.",
- "default": true
- },
- "conversation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationReference"
- },
- {
- "type": "null"
- }
- ]
- },
- "max_output_tokens": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "agent": {
- "$ref": "#/components/schemas/AgentId",
- "description": "(Deprecated) Use agent_reference instead.\nThe agent used for this response"
- },
- "agent_session_id": {
- "type": "string",
- "description": "The session identifier for this response. Currently only relevant for hosted agents.\nAlways returned for hosted agents — either the caller-provided value, the auto-derived value,\nor an auto-generated UUID. Use for session-scoped operations and to maintain sandbox\naffinity in follow-up calls."
- },
- "agent_reference": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/AgentReference"
- },
- {
- "type": "null"
- }
- ],
- "description": "The agent used for this response"
- },
- "content_filters": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ContentFilterResult"
- },
- "description": "The content filter evaluation results."
- }
- },
- "required": [
- "id",
- "object",
- "created_at",
- "error",
- "incomplete_details",
- "output",
- "instructions",
- "parallel_tool_calls",
- "agent_reference"
- ]
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
- },
- "text/event-stream": {
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
"schema": {
- "$ref": "#/components/schemas/OpenAI.CreateResponseStreamingResponse"
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Conversations"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UpdateConversationBody"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Update a conversation",
+ "group": "conversations",
+ "path": "update",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations/conv_123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"metadata\": {\"topic\": \"project-x\"}\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst updated = await client.conversations.update(\n \"conv_123\",\n { metadata: { topic: \"project-x\" } }\n);\nconsole.log(updated);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation = client.conversations.update(\n conversation_id=\"conv_123\",\n metadata={\n \"foo\": \"string\"\n },\n)\nprint(conversation.id)",
+ "csharp": "using System;\nusing System.Collections.Generic;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversation updated = client.UpdateConversation(\n conversationId: \"conv_123\",\n new UpdateConversationOptions\n {\n Metadata = new Dictionary\n {\n { \"topic\", \"project-x\" }\n }\n }\n);\nConsole.WriteLine(updated.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversation = await client.conversations.update('conv_123', { metadata: { foo: 'string' } });\n\nconsole.log(conversation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/shared\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversation, err := client.Conversations.Update(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\tconversations.ConversationUpdateParams{\n\t\t\tMetadata: shared.Metadata{\n\t\t\t\t\"foo\": \"string\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.conversations.Conversation;\nimport com.openai.models.conversations.ConversationUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ConversationUpdateParams params = ConversationUpdateParams.builder()\n .conversationId(\"conv_123\")\n .metadata(ConversationUpdateParams.Metadata.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"string\"))\n .build())\n .build();\n Conversation conversation = client.conversations().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation = openai.conversations.update(\"conv_123\", metadata: {foo: \"string\"})\n\nputs(conversation)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation\",\n \"created_at\": 1741900000,\n \"metadata\": {\"topic\": \"project-x\"}\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "getConversation",
+ "summary": "Retrieve a conversation",
+ "description": "Retrieves the specified conversation and its metadata.",
+ "parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
}
}
}
@@ -15459,307 +15737,235 @@
}
},
"tags": [
- "Responses"
+ "Conversations"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
- },
- "top_logprobs": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "temperature": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "top_p": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "user": {
- "type": "string",
- "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
- "deprecated": true
- },
- "safety_identifier": {
- "type": "string",
- "maxLength": 64,
- "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
- },
- "prompt_cache_key": {
- "type": "string",
- "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
- },
- "service_tier": {
- "$ref": "#/components/schemas/OpenAI.ServiceTier"
- },
- "prompt_cache_retention": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_memory",
- "24h"
- ]
- },
- {
- "type": "null"
- }
- ]
- },
- "previous_response_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "model": {
- "type": "string",
- "description": "The model deployment to use for the creation of this response."
- },
- "background": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "max_tool_calls": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "text": {
- "$ref": "#/components/schemas/OpenAI.ResponseTextParam"
- },
- "tools": {
- "$ref": "#/components/schemas/OpenAI.ToolsArray"
- },
- "tool_choice": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ]
- },
- "prompt": {
- "$ref": "#/components/schemas/OpenAI.Prompt"
- },
- "truncation": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "disabled"
- ]
- },
- {
- "type": "null"
- }
- ],
- "deprecated": true,
- "default": "disabled"
- },
- "reasoning": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Reasoning"
- },
- {
- "type": "null"
- }
- ]
- },
- "input": {
- "$ref": "#/components/schemas/OpenAI.InputParam"
- },
- "include": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.IncludeEnum"
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "parallel_tool_calls": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": true
- },
- "store": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": true
- },
- "instructions": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "moderation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ModerationParam"
- },
- {
- "type": "null"
- }
- ]
- },
- "stream": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "stream_options": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamOptions"
- },
- {
- "type": "null"
- }
- ]
- },
- "conversation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationParam"
- },
- {
- "type": "null"
- }
- ]
- },
- "context_management": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ContextManagementParam"
- }
- },
- {
- "type": "null"
- }
- ],
- "description": "Context management configuration for this request."
- },
- "max_output_tokens": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "agent": {
- "$ref": "#/components/schemas/AgentReference",
- "description": "(Deprecated) Use agent_reference instead.\nThe agent to use for generating the response."
- },
- "agent_session_id": {
- "type": "string",
- "description": "Optional session identifier for sandbox affinity. Currently only relevant for hosted agents.\nWhen provided, the request is routed to the same sandbox. When omitted, auto-derived from\nconversation_id/prev_response_id or a new UUID is generated."
- },
- "agent_reference": {
- "$ref": "#/components/schemas/AgentReference",
- "description": "The agent to use for generating the response."
- },
- "structured_inputs": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The structured inputs to the response that can participate in prompt template substitution or tool argument bindings."
- }
+ "x-oaiMeta": {
+ "name": "Retrieve a conversation",
+ "group": "conversations",
+ "path": "retrieve",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations/conv_123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst conversation = await client.conversations.retrieve(\"conv_123\");\nconsole.log(conversation);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation = client.conversations.retrieve(\n \"conv_123\",\n)\nprint(conversation.id)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversation conversation = client.GetConversation(\"conv_123\");\nConsole.WriteLine(conversation.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversation = await client.conversations.retrieve('conv_123');\n\nconsole.log(conversation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversation, err := client.Conversations.Get(context.TODO(), \"conv_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.Conversation;\nimport com.openai.models.conversations.ConversationRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Conversation conversation = client.conversations().retrieve(\"conv_123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation = openai.conversations.retrieve(\"conv_123\")\n\nputs(conversation)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation\",\n \"created_at\": 1741900000,\n \"metadata\": {\"topic\": \"demo\"}\n}\n"
+ }
+ }
+ },
+ "delete": {
+ "operationId": "deleteConversation",
+ "summary": "Delete a conversation",
+ "description": "Removes the specified conversation resource from the current project.",
+ "parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeletedConversationResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Conversations"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a conversation",
+ "group": "conversations",
+ "path": "delete",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/conversations/conv_123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst deleted = await client.conversations.delete(\"conv_123\");\nconsole.log(deleted);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation_deleted_resource = client.conversations.delete(\n \"conv_123\",\n)\nprint(conversation_deleted_resource.id)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nDeletedConversation deleted = client.DeleteConversation(\"conv_123\");\nConsole.WriteLine(deleted.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationDeletedResource = await client.conversations.delete('conv_123');\n\nconsole.log(conversationDeletedResource.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversationDeletedResource, err := client.Conversations.Delete(context.TODO(), \"conv_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversationDeletedResource.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.ConversationDeleteParams;\nimport com.openai.models.conversations.ConversationDeletedResource;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ConversationDeletedResource conversationDeletedResource = client.conversations().delete(\"conv_123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_deleted_resource = openai.conversations.delete(\"conv_123\")\n\nputs(conversation_deleted_resource)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/conversations/{conversation_id}/items": {
+ "post": {
+ "operationId": "createConversationItems",
+ "summary": "Create conversation items",
+ "description": "Adds one or more items to the specified conversation.",
+ "parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation on which the item needs to be created.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include",
+ "in": "query",
+ "required": false,
+ "description": "Additional fields to include in the response.\nSee the `include` parameter for listing Conversation items for more information.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ConversationItemList"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
}
}
}
}
+ },
+ "tags": [
+ "Conversations"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ },
+ "maxItems": 20,
+ "description": "The items to add to the conversation. You may add up to 20 items at a time."
+ }
+ },
+ "required": [
+ "items"
+ ]
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Create items",
+ "group": "conversations",
+ "path": "create-item",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations/conv_123/items \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"items\": [\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"Hello!\"}\n ]\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"How are you?\"}\n ]\n }\n ]\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst items = await client.conversations.items.create(\n \"conv_123\",\n {\n items: [\n {\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text: \"Hello!\" }],\n },\n {\n type: \"message\",\n role: \"user\",\n content: [{ type: \"input_text\", text: \"How are you?\" }],\n },\n ],\n }\n);\nconsole.log(items.data);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation_item_list = client.conversations.items.create(\n conversation_id=\"conv_123\",\n items=[{\n \"content\": \"string\",\n \"role\": \"user\",\n \"type\": \"message\",\n }],\n)\nprint(conversation_item_list.first_id)",
+ "csharp": "using System;\nusing System.Collections.Generic;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversationItemList created = client.ConversationItems.Create(\n conversationId: \"conv_123\",\n new CreateConversationItemsOptions\n {\n Items = new List\n {\n new ConversationMessage\n {\n Role = \"user\",\n Content =\n {\n new ConversationInputText { Text = \"Hello!\" }\n }\n },\n new ConversationMessage\n {\n Role = \"user\",\n Content =\n {\n new ConversationInputText { Text = \"How are you?\" }\n }\n }\n }\n }\n);\nConsole.WriteLine(created.Data.Count);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationItemList = await client.conversations.items.create('conv_123', {\n items: [\n {\n content: 'string',\n role: 'user',\n type: 'message',\n },\n ],\n});\n\nconsole.log(conversationItemList.first_id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversationItemList, err := client.Conversations.Items.New(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\tconversations.ItemNewParams{\n\t\t\tItems: []responses.ResponseInputItemUnionParam{{\n\t\t\t\tOfMessage: &responses.EasyInputMessageParam{\n\t\t\t\t\tContent: responses.EasyInputMessageContentUnionParam{\n\t\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t\t},\n\t\t\t\t\tRole: responses.EasyInputMessageRoleUser,\n\t\t\t\t\tType: responses.EasyInputMessageTypeMessage,\n\t\t\t\t},\n\t\t\t}},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversationItemList.FirstID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.items.ConversationItemList;\nimport com.openai.models.conversations.items.ItemCreateParams;\nimport com.openai.models.responses.EasyInputMessage;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemCreateParams params = ItemCreateParams.builder()\n .conversationId(\"conv_123\")\n .addItem(EasyInputMessage.builder()\n .content(\"string\")\n .role(EasyInputMessage.Role.USER)\n .type(EasyInputMessage.Type.MESSAGE)\n .build())\n .build();\n ConversationItemList conversationItemList = client.conversations().items().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item_list = openai.conversations.items.create(\"conv_123\", items: [{content: \"string\", role: :user, type: :message}])\n\nputs(conversation_item_list)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_abc\",\n \"status\": \"completed\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"Hello!\"}\n ]\n },\n {\n \"type\": \"message\",\n \"id\": \"msg_def\",\n \"status\": \"completed\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"How are you?\"}\n ]\n }\n ],\n \"first_id\": \"msg_abc\",\n \"last_id\": \"msg_def\",\n \"has_more\": false\n}\n"
+ }
}
},
"get": {
- "operationId": "listResponses",
- "summary": "List responses",
- "description": "Returns a collection of all stored responses matching specified filter criteria.",
+ "operationId": "listConversationItems",
+ "summary": "List conversation items",
+ "description": "Returns the items belonging to the specified conversation.",
"parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation on which the items needs to be listed.",
+ "schema": {
+ "type": "string"
+ }
+ },
{
"name": "limit",
"in": "query",
@@ -15790,4130 +15996,23289 @@
"schema": {
"type": "string"
},
- "explode": false
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "item_type",
+ "in": "query",
+ "required": false,
+ "description": "Filter by item type. If provided, only items of the specified type will be returned.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ItemType"
+ },
+ "explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Conversations"
+ ],
+ "x-oaiMeta": {
+ "name": "List items",
+ "group": "conversations",
+ "path": "list-items",
+ "examples": {
+ "request": {
+ "curl": "curl \"https://api.openai.com/v1/conversations/conv_123/items?limit=10\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst items = await client.conversations.items.list(\"conv_123\", { limit: 10 });\nconsole.log(items.data);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.conversations.items.list(\n conversation_id=\"conv_123\",\n)\npage = page.data[0]\nprint(page)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversationItemList items = client.ConversationItems.List(\n conversationId: \"conv_123\",\n new ListConversationItemsOptions { Limit = 10 }\n);\nConsole.WriteLine(items.Data.Count);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const conversationItem of client.conversations.items.list('conv_123')) {\n console.log(conversationItem);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Conversations.Items.List(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\tconversations.ItemListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.items.ItemListPage;\nimport com.openai.models.conversations.items.ItemListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemListPage page = client.conversations().items().list(\"conv_123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.conversations.items.list(\"conv_123\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_abc\",\n \"status\": \"completed\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"Hello!\"}\n ]\n }\n ],\n \"first_id\": \"msg_abc\",\n \"last_id\": \"msg_abc\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/conversations/{conversation_id}/items/{item_id}": {
+ "get": {
+ "operationId": "getConversationItem",
+ "summary": "Get a conversation item",
+ "description": "Retrieves a specific item from the specified conversation.",
+ "parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the conversation that contains the item.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "item_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation item to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Conversations"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve an item",
+ "group": "conversations",
+ "path": "get-item",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/conversations/conv_123/items/msg_abc \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst item = await client.conversations.items.retrieve(\n \"conv_123\",\n \"msg_abc\"\n);\nconsole.log(item);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation_item = client.conversations.items.retrieve(\n item_id=\"msg_abc\",\n conversation_id=\"conv_123\",\n)\nprint(conversation_item)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversationItem item = client.ConversationItems.Get(\n conversationId: \"conv_123\",\n itemId: \"msg_abc\"\n);\nConsole.WriteLine(item.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversationItem = await client.conversations.items.retrieve('msg_abc', {\n conversation_id: 'conv_123',\n});\n\nconsole.log(conversationItem);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/conversations\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversationItem, err := client.Conversations.Items.Get(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\t\"msg_abc\",\n\t\tconversations.ItemGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversationItem)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.items.ConversationItem;\nimport com.openai.models.conversations.items.ItemRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemRetrieveParams params = ItemRetrieveParams.builder()\n .conversationId(\"conv_123\")\n .itemId(\"msg_abc\")\n .build();\n ConversationItem conversationItem = client.conversations().items().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation_item = openai.conversations.items.retrieve(\"msg_abc\", conversation_id: \"conv_123\")\n\nputs(conversation_item)"
+ },
+ "response": "{\n \"type\": \"message\",\n \"id\": \"msg_abc\",\n \"status\": \"completed\",\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"Hello!\"}\n ]\n}\n"
+ }
+ }
+ },
+ "delete": {
+ "operationId": "deleteConversationItem",
+ "summary": "Delete a conversation item",
+ "description": "Removes the specified item from a conversation.",
+ "parameters": [
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation on which the item needs to be deleted from.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "item_id",
+ "in": "path",
+ "required": true,
+ "description": "The id of the conversation item to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ConversationResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Conversations"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete an item",
+ "group": "conversations",
+ "path": "delete-item",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/conversations/conv_123/items/msg_abc \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst conversation = await client.conversations.items.delete(\n \"conv_123\",\n \"msg_abc\"\n);\nconsole.log(conversation);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nconversation = client.conversations.items.delete(\n item_id=\"msg_abc\",\n conversation_id=\"conv_123\",\n)\nprint(conversation.id)",
+ "csharp": "using System;\nusing OpenAI.Conversations;\n\nOpenAIConversationClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nConversation conversation = client.ConversationItems.Delete(\n conversationId: \"conv_123\",\n itemId: \"msg_abc\"\n);\nConsole.WriteLine(conversation.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst conversation = await client.conversations.items.delete('msg_abc', {\n conversation_id: 'conv_123',\n});\n\nconsole.log(conversation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconversation, err := client.Conversations.Items.Delete(\n\t\tcontext.TODO(),\n\t\t\"conv_123\",\n\t\t\"msg_abc\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", conversation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.conversations.Conversation;\nimport com.openai.models.conversations.items.ItemDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ItemDeleteParams params = ItemDeleteParams.builder()\n .conversationId(\"conv_123\")\n .itemId(\"msg_abc\")\n .build();\n Conversation conversation = client.conversations().items().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nconversation = openai.conversations.items.delete(\"msg_abc\", conversation_id: \"conv_123\")\n\nputs(conversation)"
+ },
+ "response": "{\n \"id\": \"conv_123\",\n \"object\": \"conversation\",\n \"created_at\": 1741900000,\n \"metadata\": {\"topic\": \"demo\"}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/embeddings": {
+ "post": {
+ "operationId": "Embeddings_createEmbedding",
+ "summary": "Create an embedding",
+ "description": "Creates an embedding from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateEmbeddingResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Embeddings"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateEmbeddingRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create embeddings",
+ "group": "embeddings",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/embeddings \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"input\": \"The food was delicious and the waiter...\",\n \"model\": \"text-embedding-ada-002\",\n \"encoding_format\": \"float\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncreate_embedding_response = client.embeddings.create(\n input=\"The quick brown fox jumped over the lazy dog\",\n model=\"text-embedding-3-small\",\n)\nprint(create_embedding_response.data)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const embedding = await openai.embeddings.create({\n model: \"text-embedding-ada-002\",\n input: \"The quick brown fox jumped over the lazy dog\",\n encoding_format: \"float\",\n });\n\n console.log(embedding);\n}\n\nmain();\n",
+ "csharp": "using System;\n\nusing OpenAI.Embeddings;\n\nEmbeddingClient client = new(\n model: \"text-embedding-3-small\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nOpenAIEmbedding embedding = client.GenerateEmbedding(input: \"The quick brown fox jumped over the lazy dog\");\nReadOnlyMemory vector = embedding.ToFloats();\n\nfor (int i = 0; i < vector.Length; i++)\n{\n Console.WriteLine($\" [{i,4}] = {vector.Span[i]}\");\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst createEmbeddingResponse = await client.embeddings.create({\n input: 'The quick brown fox jumped over the lazy dog',\n model: 'text-embedding-3-small',\n});\n\nconsole.log(createEmbeddingResponse.data);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcreateEmbeddingResponse, err := client.Embeddings.New(context.TODO(), openai.EmbeddingNewParams{\n\t\tInput: openai.EmbeddingNewParamsInputUnion{\n\t\t\tOfString: openai.String(\"The quick brown fox jumped over the lazy dog\"),\n\t\t},\n\t\tModel: openai.EmbeddingModelTextEmbedding3Small,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", createEmbeddingResponse.Data)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.embeddings.CreateEmbeddingResponse;\nimport com.openai.models.embeddings.EmbeddingCreateParams;\nimport com.openai.models.embeddings.EmbeddingModel;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EmbeddingCreateParams params = EmbeddingCreateParams.builder()\n .input(\"The quick brown fox jumped over the lazy dog\")\n .model(EmbeddingModel.TEXT_EMBEDDING_3_SMALL)\n .build();\n CreateEmbeddingResponse createEmbeddingResponse = client.embeddings().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncreate_embedding_response = openai.embeddings.create(\n input: \"The quick brown fox jumped over the lazy dog\",\n model: :\"text-embedding-3-small\"\n)\n\nputs(create_embedding_response)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"embedding\": [\n 0.0023064255,\n -0.009327292,\n .... (1536 floats total for ada-002)\n -0.0028842222,\n ],\n \"index\": 0\n }\n ],\n \"model\": \"text-embedding-ada-002\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/evals": {
+ "get": {
+ "operationId": "Evals_listEvals",
+ "summary": "List evaluations",
+ "description": "Returns the evaluations configured in the current project.",
+ "parameters": [
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last run from the previous pagination request.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of runs to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "default": "asc"
+ },
+ "explode": false
+ },
+ {
+ "name": "order_by",
+ "in": "query",
+ "required": false,
+ "description": "Evals can be ordered by creation time or last updated time.\nUse `created_at` for creation time or `updated_at` for last updated time.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "created_at",
+ "updated_at"
+ ],
+ "default": "created_at"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Eval"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "List evals",
+ "group": "evals",
+ "path": "list",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals?limit=1 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.evals.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst evals = await openai.evals.list({ limit: 1 });\nconsole.log(evals);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const evalListResponse of client.evals.list()) {\n console.log(evalListResponse.id);\n}",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.EvalListPage;\nimport com.openai.models.evals.EvalListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalListPage page = client.evals().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.evals.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"object\": \"eval\",\n \"data_source_config\": {\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"usecase\": \"push_notifications_summarizer\"\n },\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\"\n },\n \"sample\": {\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"item\",\n \"sample\"\n ]\n }\n },\n \"testing_criteria\": [\n {\n \"name\": \"Push Notification Summary Grader\",\n \"id\": \"Push Notification Summary Grader-9b876f24-4762-4be9-aff4-db7a9b31c673\",\n \"type\": \"label_model\",\n \"model\": \"o3-mini\",\n \"input\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"\nLabel the following push notification summary as either correct or incorrect.\nThe push notification and the summary will be provided below.\nA good push notificiation summary is concise and snappy.\nIf it is good, then label it as correct, if not, then incorrect.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"\nPush notifications: {{item.input}}\nSummary: {{sample.output_text}}\n\"\n }\n }\n ],\n \"passing_labels\": [\n \"correct\"\n ],\n \"labels\": [\n \"correct\",\n \"incorrect\"\n ],\n \"sampling_params\": null\n }\n ],\n \"name\": \"Push Notification Summary Grader\",\n \"created_at\": 1739314509,\n \"metadata\": {\n \"description\": \"A stored completions eval for push notification summaries\"\n }\n }\n ],\n \"first_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"last_id\": \"eval_67aa884cf6688190b58f657d4441c8b7\",\n \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Evals_createEval",
+ "summary": "Create an evaluation",
+ "description": "Creates the structure of an evaluation that can be used to test a model's performance.\nAn 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.\nFor more information, see the [Evals guide](https://platform.openai.com/docs/guides/evals).",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Eval"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateEvalRequest"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Create eval",
+ "group": "evals",
+ "path": "post",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Sentiment\",\n \"data_source_config\": {\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"usecase\": \"chatbot\"\n }\n },\n \"testing_criteria\": [\n {\n \"type\": \"label_model\",\n \"model\": \"o3-mini\",\n \"input\": [\n {\n \"role\": \"developer\",\n \"content\": \"Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Statement: {{item.input}}\"\n }\n ],\n \"passing_labels\": [\n \"positive\"\n ],\n \"labels\": [\n \"positive\",\n \"neutral\",\n \"negative\"\n ],\n \"name\": \"Example label grader\"\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\neval = client.evals.create(\n data_source_config={\n \"item_schema\": {\n \"foo\": \"bar\"\n },\n \"type\": \"custom\",\n },\n testing_criteria=[{\n \"input\": [{\n \"content\": \"content\",\n \"role\": \"role\",\n }],\n \"labels\": [\"string\"],\n \"model\": \"model\",\n \"name\": \"name\",\n \"passing_labels\": [\"string\"],\n \"type\": \"label_model\",\n }],\n)\nprint(eval.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst evalObj = await openai.evals.create({\n name: \"Sentiment\",\n data_source_config: {\n type: \"stored_completions\",\n metadata: { usecase: \"chatbot\" }\n },\n testing_criteria: [\n {\n type: \"label_model\",\n model: \"o3-mini\",\n input: [\n { role: \"developer\", content: \"Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'\" },\n { role: \"user\", content: \"Statement: {{item.input}}\" }\n ],\n passing_labels: [\"positive\"],\n labels: [\"positive\", \"neutral\", \"negative\"],\n name: \"Example label grader\"\n }\n ]\n});\nconsole.log(evalObj);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst _eval = await client.evals.create({\n data_source_config: {\n item_schema: { foo: 'bar' },\n type: 'custom',\n },\n testing_criteria: [\n {\n input: [{ content: 'content', role: 'role' }],\n labels: ['string'],\n model: 'model',\n name: 'name',\n passing_labels: ['string'],\n type: 'label_model',\n },\n ],\n});\n\nconsole.log(_eval.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.evals.EvalCreateParams;\nimport com.openai.models.evals.EvalCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalCreateParams params = EvalCreateParams.builder()\n .customDataSourceConfig(EvalCreateParams.DataSourceConfig.Custom.ItemSchema.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"bar\"))\n .build())\n .addTestingCriterion(EvalCreateParams.TestingCriterion.LabelModel.builder()\n .addInput(EvalCreateParams.TestingCriterion.LabelModel.Input.SimpleInputMessage.builder()\n .content(\"content\")\n .role(\"role\")\n .build())\n .addLabel(\"string\")\n .model(\"model\")\n .name(\"name\")\n .addPassingLabel(\"string\")\n .build())\n .build();\n EvalCreateResponse eval = client.evals().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\neval_ = openai.evals.create(\n data_source_config: {item_schema: {foo: \"bar\"}, type: :custom},\n testing_criteria: [\n {\n input: [{content: \"content\", role: \"role\"}],\n labels: [\"string\"],\n model: \"model\",\n name: \"name\",\n passing_labels: [\"string\"],\n type: :label_model\n }\n ]\n)\n\nputs(eval_)"
+ },
+ "response": "{\n \"object\": \"eval\",\n \"id\": \"eval_67b7fa9a81a88190ab4aa417e397ea21\",\n \"data_source_config\": {\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"usecase\": \"chatbot\"\n },\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\"\n },\n \"sample\": {\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"item\",\n \"sample\"\n ]\n },\n \"testing_criteria\": [\n {\n \"name\": \"Example label grader\",\n \"type\": \"label_model\",\n \"model\": \"o3-mini\",\n \"input\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Classify the sentiment of the following statement as one of positive, neutral, or negative\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Statement: {{item.input}}\"\n }\n }\n ],\n \"passing_labels\": [\n \"positive\"\n ],\n \"labels\": [\n \"positive\",\n \"neutral\",\n \"negative\"\n ]\n }\n ],\n \"name\": \"Sentiment\",\n \"created_at\": 1740110490,\n \"metadata\": {\n \"description\": \"An eval for sentiment analysis\"\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/evals/{eval_id}": {
+ "delete": {
+ "operationId": "Evals_deleteEval",
+ "summary": "Delete an evaluation",
+ "description": "Removes the specified evaluation and its associated data.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteEvalResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete an eval",
+ "group": "evals",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_abc123 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\neval = client.evals.delete(\n \"eval_id\",\n)\nprint(eval.eval_id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst deleted = await openai.evals.delete(\"eval_abc123\");\nconsole.log(deleted);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst _eval = await client.evals.delete('eval_id');\n\nconsole.log(_eval.eval_id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.EvalDeleteParams;\nimport com.openai.models.evals.EvalDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalDeleteResponse eval = client.evals().delete(\"eval_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\neval_ = openai.evals.delete(\"eval_id\")\n\nputs(eval_)"
+ },
+ "response": "{\n \"object\": \"eval.deleted\",\n \"deleted\": true,\n \"eval_id\": \"eval_abc123\"\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Evals_getEval",
+ "summary": "Get an evaluation",
+ "description": "Retrieves the specified evaluation and its configuration.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Eval"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Get an eval",
+ "group": "evals",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\neval = client.evals.retrieve(\n \"eval_id\",\n)\nprint(eval.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst evalObj = await openai.evals.retrieve(\"eval_67abd54d9b0081909a86353f6fb9317a\");\nconsole.log(evalObj);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst _eval = await client.evals.retrieve('eval_id');\n\nconsole.log(_eval.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.EvalRetrieveParams;\nimport com.openai.models.evals.EvalRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalRetrieveResponse eval = client.evals().retrieve(\"eval_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\neval_ = openai.evals.retrieve(\"eval_id\")\n\nputs(eval_)"
+ },
+ "response": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"string\"\n },\n \"ground_truth\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"input\",\n \"ground_truth\"\n ]\n }\n },\n \"required\": [\n \"item\"\n ]\n }\n },\n \"testing_criteria\": [\n {\n \"name\": \"String check\",\n \"id\": \"String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2\",\n \"type\": \"string_check\",\n \"input\": \"{{item.input}}\",\n \"reference\": \"{{item.ground_truth}}\",\n \"operation\": \"eq\"\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {},\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Evals_updateEval",
+ "summary": "Update an evaluation",
+ "description": "Updates certain properties of an evaluation.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to update.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Eval"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateEvalParametersBody"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Update an eval",
+ "group": "evals",
+ "path": "update",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"name\": \"Updated Eval\", \"metadata\": {\"description\": \"Updated description\"}}'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\neval = client.evals.update(\n eval_id=\"eval_id\",\n)\nprint(eval.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst updatedEval = await openai.evals.update(\n \"eval_67abd54d9b0081909a86353f6fb9317a\",\n {\n name: \"Updated Eval\",\n metadata: { description: \"Updated description\" }\n }\n);\nconsole.log(updatedEval);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst _eval = await client.evals.update('eval_id');\n\nconsole.log(_eval.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.EvalUpdateParams;\nimport com.openai.models.evals.EvalUpdateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n EvalUpdateResponse eval = client.evals().update(\"eval_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\neval_ = openai.evals.update(\"eval_id\")\n\nputs(eval_)"
+ },
+ "response": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"string\"\n },\n \"ground_truth\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"input\",\n \"ground_truth\"\n ]\n }\n },\n \"required\": [\n \"item\"\n ]\n }\n },\n \"testing_criteria\": [\n {\n \"name\": \"String check\",\n \"id\": \"String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2\",\n \"type\": \"string_check\",\n \"input\": \"{{item.input}}\",\n \"reference\": \"{{item.ground_truth}}\",\n \"operation\": \"eq\"\n }\n ],\n \"name\": \"Updated Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {\"description\": \"Updated description\"},\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/evals/{eval_id}/runs": {
+ "get": {
+ "operationId": "Evals_listRuns",
+ "summary": "List evaluation runs",
+ "description": "Returns the runs associated with the specified evaluation.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to retrieve runs for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last run from the previous pagination request.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of runs to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "default": "asc"
+ },
+ "explode": false
+ },
+ {
+ "name": "status",
+ "in": "query",
+ "required": false,
+ "description": "Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "completed",
+ "canceled",
+ "failed"
+ ]
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRun"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ]
+ },
+ "post": {
+ "operationId": "Evals_createEvalRun",
+ "summary": "Create an evaluation run",
+ "description": "Creates an evaluation run for the specified evaluation.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to create a run for.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EvalRun"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateEvalRunRequest"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Create eval run",
+ "group": "evals",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67e579652b548190aaa83ada4b125f47/runs \\\n -X POST \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"name\":\"gpt-4o-mini\",\"data_source\":{\"type\":\"completions\",\"input_messages\":{\"type\":\"template\",\"template\":[{\"role\":\"developer\",\"content\":\"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"} , {\"role\":\"user\",\"content\":\"{{item.input}}\"}]} ,\"sampling_params\":{\"temperature\":1,\"max_completions_tokens\":2048,\"top_p\":1,\"seed\":42},\"model\":\"gpt-4o-mini\",\"source\":{\"type\":\"file_content\",\"content\":[{\"item\":{\"input\":\"Tech Company Launches Advanced Artificial Intelligence Platform\",\"ground_truth\":\"Technology\"}}]}}'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.evals.runs.create(\n eval_id=\"eval_id\",\n data_source={\n \"source\": {\n \"content\": [{\n \"item\": {\n \"foo\": \"bar\"\n }\n }],\n \"type\": \"file_content\",\n },\n \"type\": \"jsonl\",\n },\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst run = await openai.evals.runs.create(\n \"eval_67e579652b548190aaa83ada4b125f47\",\n {\n name: \"gpt-4o-mini\",\n data_source: {\n type: \"completions\",\n input_messages: {\n type: \"template\",\n template: [\n {\n role: \"developer\",\n content: \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n },\n {\n role: \"user\",\n content: \"{{item.input}}\"\n }\n ]\n },\n sampling_params: {\n temperature: 1,\n max_completions_tokens: 2048,\n top_p: 1,\n seed: 42\n },\n model: \"gpt-4o-mini\",\n source: {\n type: \"file_content\",\n content: [\n {\n item: {\n input: \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n ground_truth: \"Technology\"\n }\n }\n ]\n }\n }\n }\n);\nconsole.log(run);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.evals.runs.create('eval_id', {\n data_source: {\n source: { content: [{ item: { foo: 'bar' } }], type: 'file_content' },\n type: 'jsonl',\n },\n});\n\nconsole.log(run.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.evals.runs.CreateEvalJsonlRunDataSource;\nimport com.openai.models.evals.runs.RunCreateParams;\nimport com.openai.models.evals.runs.RunCreateResponse;\nimport java.util.List;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCreateParams params = RunCreateParams.builder()\n .evalId(\"eval_id\")\n .dataSource(CreateEvalJsonlRunDataSource.builder()\n .fileContentSource(List.of(CreateEvalJsonlRunDataSource.Source.FileContent.Content.builder()\n .item(CreateEvalJsonlRunDataSource.Source.FileContent.Content.Item.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"bar\"))\n .build())\n .build()))\n .build())\n .build();\n RunCreateResponse run = client.evals().runs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.evals.runs.create(\n \"eval_id\",\n data_source: {source: {content: [{item: {foo: \"bar\"}}], type: :file_content}, type: :jsonl}\n)\n\nputs(run)"
+ },
+ "response": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67e57965b480819094274e3a32235e4c\",\n \"eval_id\": \"eval_67e579652b548190aaa83ada4b125f47\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47&run_id=evalrun_67e57965b480819094274e3a32235e4c\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/evals/{eval_id}/runs/{run_id}": {
+ "delete": {
+ "operationId": "Evals_deleteEvalRun",
+ "summary": "Delete an evaluation run",
+ "description": "Removes the specified evaluation run.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to delete the run from.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteEvalRunResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete eval run",
+ "group": "evals",
+ "path": "delete",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_123abc/runs/evalrun_abc456 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.evals.runs.delete(\n run_id=\"run_id\",\n eval_id=\"eval_id\",\n)\nprint(run.run_id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst deleted = await openai.evals.runs.delete(\n \"eval_123abc\",\n \"evalrun_abc456\"\n);\nconsole.log(deleted);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.evals.runs.delete('run_id', { eval_id: 'eval_id' });\n\nconsole.log(run.run_id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.RunDeleteParams;\nimport com.openai.models.evals.runs.RunDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunDeleteParams params = RunDeleteParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .build();\n RunDeleteResponse run = client.evals().runs().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.evals.runs.delete(\"run_id\", eval_id: \"eval_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"object\": \"eval.run.deleted\",\n \"deleted\": true,\n \"run_id\": \"evalrun_abc456\"\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Evals_getEvalRun",
+ "summary": "Get an evaluation run",
+ "description": "Retrieves the specified evaluation run and its current status.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to retrieve runs for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EvalRun"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Get an eval run",
+ "group": "evals",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.evals.runs.retrieve(\n run_id=\"run_id\",\n eval_id=\"eval_id\",\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst run = await openai.evals.runs.retrieve(\n \"evalrun_67abd54d60ec8190832b46859da808f7\",\n { eval_id: \"eval_67abd54d9b0081909a86353f6fb9317a\" }\n);\nconsole.log(run);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.evals.runs.retrieve('run_id', { eval_id: 'eval_id' });\n\nconsole.log(run.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.RunRetrieveParams;\nimport com.openai.models.evals.runs.RunRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunRetrieveParams params = RunRetrieveParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .build();\n RunRetrieveResponse run = client.evals().runs().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.evals.runs.retrieve(\"run_id\", eval_id: \"eval_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Evals_cancelEvalRun",
+ "summary": "Cancel an evaluation run",
+ "description": "Cancels an ongoing evaluation run.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation whose run you want to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EvalRun"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel eval run",
+ "group": "evals",
+ "path": "post",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/cancel \\\n -X POST \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.evals.runs.cancel(\n run_id=\"run_id\",\n eval_id=\"eval_id\",\n)\nprint(response.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst canceledRun = await openai.evals.runs.cancel(\n \"evalrun_67abd54d60ec8190832b46859da808f7\",\n { eval_id: \"eval_67abd54d9b0081909a86353f6fb9317a\" }\n);\nconsole.log(canceledRun);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.evals.runs.cancel('run_id', { eval_id: 'eval_id' });\n\nconsole.log(response.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.RunCancelParams;\nimport com.openai.models.evals.runs.RunCancelResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCancelParams params = RunCancelParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .build();\n RunCancelResponse response = client.evals().runs().cancel(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.evals.runs.cancel(\"run_id\", eval_id: \"eval_id\")\n\nputs(response)"
+ },
+ "response": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7\",\n \"status\": \"canceled\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/evals/{eval_id}/runs/{run_id}/output_items": {
+ "get": {
+ "operationId": "Evals_getEvalRunOutputItems",
+ "summary": "List evaluation run output items",
+ "description": "Returns the output items produced by the specified evaluation run.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The eval id path parameter.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to retrieve output items for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last run from the previous pagination request.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of runs to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "default": "asc"
+ },
+ "explode": false
+ },
+ {
+ "name": "status",
+ "in": "query",
+ "required": false,
+ "description": "Filter output items by status. Use `failed` to filter by failed output\nitems or `pass` to filter by passed output items.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "fail",
+ "pass"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunOutputItem"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Get eval run output items",
+ "group": "evals",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/egroup_67abd54d9b0081909a86353f6fb9317a/runs/erun_67abd54d60ec8190832b46859da808f7/output_items \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.evals.runs.output_items.list(\n run_id=\"run_id\",\n eval_id=\"eval_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst outputItems = await openai.evals.runs.outputItems.list(\n \"egroup_67abd54d9b0081909a86353f6fb9317a\",\n \"erun_67abd54d60ec8190832b46859da808f7\"\n);\nconsole.log(outputItems);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const outputItemListResponse of client.evals.runs.outputItems.list('run_id', {\n eval_id: 'eval_id',\n})) {\n console.log(outputItemListResponse.id);\n}",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.outputitems.OutputItemListPage;\nimport com.openai.models.evals.runs.outputitems.OutputItemListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n OutputItemListParams params = OutputItemListParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .build();\n OutputItemListPage page = client.evals().runs().outputItems().list(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.evals.runs.output_items.list(\"run_id\", eval_id: \"eval_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67e5796c28e081909917bf79f6e6214d\",\n \"created_at\": 1743092076,\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"status\": \"pass\",\n \"datasource_item_id\": 5,\n \"datasource_item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n },\n \"results\": [\n {\n \"name\": \"String check-a2486074-d803-4445-b431-ad2262e85d47\",\n \"sample\": null,\n \"passed\": true,\n \"score\": 1.0\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"developer\",\n \"content\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n },\n {\n \"role\": \"user\",\n \"content\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Markets\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"usage\": {\n \"total_tokens\": 325,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 323,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n }\n ],\n \"first_id\": \"outputitem_67e5796c28e081909917bf79f6e6214d\",\n \"last_id\": \"outputitem_67e5796c28e081909917bf79f6e6214d\",\n \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}": {
+ "get": {
+ "operationId": "Evals_getEvalRunOutputItem",
+ "summary": "Get an output item of an evaluation run",
+ "description": "Retrieves a single output item from the specified evaluation run.",
+ "parameters": [
+ {
+ "name": "eval_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the evaluation to retrieve runs for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "output_item_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the output item to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EvalRunOutputItem"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Evals"
+ ],
+ "x-oaiMeta": {
+ "name": "Get an output item of an eval run",
+ "group": "evals",
+ "path": "get",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/output_items/outputitem_67abd55eb6548190bb580745d5644a33 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\noutput_item = client.evals.runs.output_items.retrieve(\n output_item_id=\"output_item_id\",\n eval_id=\"eval_id\",\n run_id=\"run_id\",\n)\nprint(output_item.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst outputItem = await openai.evals.runs.outputItems.retrieve(\n \"outputitem_67abd55eb6548190bb580745d5644a33\",\n {\n eval_id: \"eval_67abd54d9b0081909a86353f6fb9317a\",\n run_id: \"evalrun_67abd54d60ec8190832b46859da808f7\",\n }\n);\nconsole.log(outputItem);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst outputItem = await client.evals.runs.outputItems.retrieve('output_item_id', {\n eval_id: 'eval_id',\n run_id: 'run_id',\n});\n\nconsole.log(outputItem.id);",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.evals.runs.outputitems.OutputItemRetrieveParams;\nimport com.openai.models.evals.runs.outputitems.OutputItemRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n OutputItemRetrieveParams params = OutputItemRetrieveParams.builder()\n .evalId(\"eval_id\")\n .runId(\"run_id\")\n .outputItemId(\"output_item_id\")\n .build();\n OutputItemRetrieveResponse outputItem = client.evals().runs().outputItems().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\noutput_item = openai.evals.runs.output_items.retrieve(\"output_item_id\", eval_id: \"eval_id\", run_id: \"run_id\")\n\nputs(output_item)"
+ },
+ "response": "{\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67e5796c28e081909917bf79f6e6214d\",\n \"created_at\": 1743092076,\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"status\": \"pass\",\n \"datasource_item_id\": 5,\n \"datasource_item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n },\n \"results\": [\n {\n \"name\": \"String check-a2486074-d803-4445-b431-ad2262e85d47\",\n \"sample\": null,\n \"passed\": true,\n \"score\": 1.0\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"developer\",\n \"content\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n },\n {\n \"role\": \"user\",\n \"content\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Markets\",\n \"tool_call_id\": null,\n \"tool_calls\": null,\n \"function_call\": null\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"usage\": {\n \"total_tokens\": 325,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 323,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/files": {
+ "get": {
+ "operationId": "Files_listFiles",
+ "summary": "List files",
+ "description": "Lists files matching the request filters.",
+ "parameters": [
+ {
+ "name": "purpose",
+ "in": "query",
+ "required": false,
+ "description": "Only return files with the given purpose.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 10000
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListFilesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Files"
+ ],
+ "x-oaiMeta": {
+ "name": "List files",
+ "group": "files",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.files.list()\npage = page.data[0]\nprint(page)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.files.list();\n\n for await (const file of list) {\n console.log(file);\n }\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fileObject of client.files.list()) {\n console.log(fileObject);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Files.List(context.TODO(), openai.FileListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FileListPage;\nimport com.openai.models.files.FileListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileListPage page = client.files().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.files.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 175,\n \"created_at\": 1613677385,\n \"expires_at\": 1677614202,\n \"filename\": \"salesOverview.pdf\",\n \"purpose\": \"assistants\",\n },\n {\n \"id\": \"file-abc456\",\n \"object\": \"file\",\n \"bytes\": 140,\n \"created_at\": 1613779121,\n \"expires_at\": 1677614202,\n \"filename\": \"puppy.jsonl\",\n \"purpose\": \"fine-tune\",\n }\n ],\n \"first_id\": \"file-abc123\",\n \"last_id\": \"file-abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Files_createFile",
+ "summary": "Create a file",
+ "description": "Creates a file from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OpenAIFile"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Files"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateFileRequest"
+ },
+ "encoding": {
+ "purpose": {
+ "contentType": "application/json"
+ },
+ "expires_after": {
+ "contentType": "application/json"
+ }
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Upload file",
+ "group": "files",
+ "description": "Uploads a file for later use across OpenAI APIs. Uploads to this endpoint are rate-limited to 1,000 requests per minute per authenticated user. For Retrieval or `file_search` ingestion, upload files here first. If you need to attach multiple uploaded files to the same vector store, use vector store file batches instead of attaching them one by one.\n",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F purpose=\"fine-tune\" \\\n -F file=\"@mydata.jsonl\"\n -F expires_after[anchor]=\"created_at\"\n -F expires_after[seconds]=2592000\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile_object = client.files.create(\n file=b\"Example data\",\n purpose=\"assistants\",\n)\nprint(file_object.id)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.create({\n file: fs.createReadStream(\"mydata.jsonl\"),\n purpose: \"fine-tune\",\n expires_after: {\n anchor: \"created_at\",\n seconds: 2592000\n }\n });\n\n console.log(file);\n}\n\nmain();",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fileObject = await client.files.create({\n file: fs.createReadStream('fine-tune.jsonl'),\n purpose: 'assistants',\n});\n\nconsole.log(fileObject.id);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfileObject, err := client.Files.New(context.TODO(), openai.FileNewParams{\n\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tPurpose: openai.FilePurposeAssistants,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fileObject.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FileCreateParams;\nimport com.openai.models.files.FileObject;\nimport com.openai.models.files.FilePurpose;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileCreateParams params = FileCreateParams.builder()\n .file(new ByteArrayInputStream(\"Example data\".getBytes()))\n .purpose(FilePurpose.ASSISTANTS)\n .build();\n FileObject fileObject = client.files().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile_object = openai.files.create(file: StringIO.new(\"Example data\"), purpose: :assistants)\n\nputs(file_object)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1677614202,\n \"filename\": \"mydata.jsonl\",\n \"purpose\": \"fine-tune\",\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/files/{file_id}": {
+ "delete": {
+ "operationId": "Files_deleteFile",
+ "summary": "Delete a file",
+ "description": "Deletes a file by its identifier.",
+ "parameters": [
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file to use for this request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteFileResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Files"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete file",
+ "group": "files",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files/file-abc123 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile_deleted = client.files.delete(\n \"file_id\",\n)\nprint(file_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.delete(\"file-abc123\");\n\n console.log(file);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fileDeleted = await client.files.delete('file_id');\n\nconsole.log(fileDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfileDeleted, err := client.Files.Delete(context.TODO(), \"file_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fileDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FileDeleteParams;\nimport com.openai.models.files.FileDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileDeleted fileDeleted = client.files().delete(\"file_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile_deleted = openai.files.delete(\"file_id\")\n\nputs(file_deleted)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Files_retrieveFile",
+ "summary": "Get a file",
+ "description": "Retrieves a file by its identifier.",
+ "parameters": [
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file to use for this request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OpenAIFile"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Files"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve file",
+ "group": "files",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files/file-abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfile_object = client.files.retrieve(\n \"file_id\",\n)\nprint(file_object.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.retrieve(\"file-abc123\");\n\n console.log(file);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fileObject = await client.files.retrieve('file_id');\n\nconsole.log(fileObject.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfileObject, err := client.Files.Get(context.TODO(), \"file_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fileObject.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FileObject;\nimport com.openai.models.files.FileRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileObject fileObject = client.files().retrieve(\"file_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfile_object = openai.files.retrieve(\"file_id\")\n\nputs(file_object)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1677614202,\n \"filename\": \"mydata.jsonl\",\n \"purpose\": \"fine-tune\",\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/files/{file_id}/content": {
+ "get": {
+ "operationId": "Files_downloadFile",
+ "summary": "Download a file",
+ "description": "Downloads a file.",
+ "parameters": [
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file to use for this request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Files"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve file content",
+ "group": "files",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/files/file-abc123/content \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" > file.jsonl\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.files.content(\n \"file_id\",\n)\nprint(response)\ncontent = response.read()\nprint(content)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const file = await openai.files.content(\"file-abc123\");\n\n console.log(file);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.files.content('file_id');\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Files.Content(context.TODO(), \"file_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.files.FileContentParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n HttpResponse response = client.files().content(\"file_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.files.content(\"file_id\")\n\nputs(response)"
+ },
+ "response": ""
+ }
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/alpha/graders/run": {
+ "post": {
+ "operationId": "Graders_runGrader",
+ "summary": "Run a grader",
+ "description": "Runs a grader.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunGraderResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunGraderRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Run grader",
+ "beta": true,
+ "group": "graders",
+ "examples": [
+ {
+ "title": "Score text alignment",
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"grader\": {\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.\n\nReference answer: {{item.reference_answer}}\n\nModel answer: {{sample.output_text}}\"\n }\n ]\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42\n }\n },\n \"item\": {\n \"reference_answer\": \"fuzzy wuzzy was a bear\"\n },\n \"model_sample\": \"fuzzy wuzzy was a bear\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.run(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n model_sample=\"model_sample\",\n)\nprint(response.metadata)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst result = await openai.fineTuning.alpha.graders.run({\n grader: {\n type: \"score_model\",\n name: \"Example score model grader\",\n input: [\n {\n role: \"user\",\n content: [\n {\n type: \"input_text\",\n text: \"Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.\n\nReference answer: {{item.reference_answer}}\n\nModel answer: {{sample.output_text}}\",\n },\n ],\n },\n ],\n model: \"gpt-5-mini\",\n sampling_params: { temperature: 1, top_p: 1, seed: 42 },\n },\n item: { reference_answer: \"fuzzy wuzzy was a bear\" },\n model_sample: \"fuzzy wuzzy was a bear\",\n});\nconsole.log(result);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.run({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n model_sample: 'model_sample',\n});\n\nconsole.log(response.metadata);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{\n\t\tGrader: openai.FineTuningAlphaGraderRunParamsGraderUnion{\n\t\t\tOfStringCheck: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t\tModelSample: \"model_sample\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.Metadata)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderRunParams;\nimport com.openai.models.finetuning.alpha.graders.GraderRunResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderRunParams params = GraderRunParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .modelSample(\"model_sample\")\n .build();\n GraderRunResponse response = client.fineTuning().alpha().graders().run(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.run(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check},\n model_sample: \"model_sample\"\n)\n\nputs(response)"
+ },
+ "response": "{\n \"reward\": 1.0,\n \"metadata\": {\n \"name\": \"Example score model grader\",\n \"type\": \"score_model\",\n \"errors\": {\n \"formula_parse_error\": false,\n \"sample_parse_error\": false,\n \"truncated_observation_error\": false,\n \"unresponsive_reward_error\": false,\n \"invalid_variable_error\": false,\n \"other_error\": false,\n \"python_grader_server_error\": false,\n \"python_grader_server_error_type\": null,\n \"python_grader_runtime_error\": false,\n \"python_grader_runtime_error_details\": null,\n \"model_grader_server_error\": false,\n \"model_grader_refusal_error\": false,\n \"model_grader_parse_error\": false,\n \"model_grader_server_error_details\": null\n },\n \"execution_time\": 4.365238428115845,\n \"scores\": {},\n \"token_usage\": {\n \"prompt_tokens\": 190,\n \"total_tokens\": 324,\n \"completion_tokens\": 134,\n \"cached_tokens\": 0\n },\n \"sampled_model_name\": \"gpt-4o-2024-08-06\"\n },\n \"sub_rewards\": {},\n \"model_grader_token_usage_per_model\": {\n \"gpt-4o-2024-08-06\": {\n \"prompt_tokens\": 190,\n \"total_tokens\": 324,\n \"completion_tokens\": 134,\n \"cached_tokens\": 0\n }\n }\n}\n"
+ },
+ {
+ "title": "Score an image caption",
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"grader\": {\n \"type\": \"score_model\",\n \"name\": \"Image caption grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Score how well the provided caption matches the image on a 0-1 scale. Only return the score.\n\nCaption: {{sample.output_text}}\"\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/dog-catching-ball.png\",\n \"file_id\": null,\n \"detail\": \"high\"\n }\n ]\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 0.2\n }\n },\n \"item\": {\n \"expected_caption\": \"A golden retriever jumps to catch a tennis ball\"\n },\n \"model_sample\": \"A dog leaps to grab a tennis ball mid-air\"\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.run({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n model_sample: 'model_sample',\n});\n\nconsole.log(response.metadata);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.run(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n model_sample=\"model_sample\",\n)\nprint(response.metadata)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{\n\t\tGrader: openai.FineTuningAlphaGraderRunParamsGraderUnion{\n\t\t\tOfStringCheck: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t\tModelSample: \"model_sample\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.Metadata)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderRunParams;\nimport com.openai.models.finetuning.alpha.graders.GraderRunResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderRunParams params = GraderRunParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .modelSample(\"model_sample\")\n .build();\n GraderRunResponse response = client.fineTuning().alpha().graders().run(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.run(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check},\n model_sample: \"model_sample\"\n)\n\nputs(response)"
+ }
+ },
+ {
+ "title": "Score an audio response",
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"grader\": {\n \"type\": \"score_model\",\n \"name\": \"Audio clarity grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Listen to the clip and return a confidence score from 0 to 1 that the speaker said: {{item.target_phrase}}\"\n },\n {\n \"type\": \"input_audio\",\n \"input_audio\": {\n \"data\": \"{{item.audio_clip_b64}}\",\n \"format\": \"mp3\"\n }\n }\n ]\n }\n ],\n \"model\": \"gpt-audio\",\n \"sampling_params\": {\n \"temperature\": 0.2,\n \"top_p\": 1,\n \"seed\": 123\n }\n },\n \"item\": {\n \"target_phrase\": \"Please deliver the package on Tuesday\",\n \"audio_clip_b64\": \"\"\n },\n \"model_sample\": \"Please deliver the package on Tuesday\"\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.run({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n model_sample: 'model_sample',\n});\n\nconsole.log(response.metadata);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.run(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n model_sample=\"model_sample\",\n)\nprint(response.metadata)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{\n\t\tGrader: openai.FineTuningAlphaGraderRunParamsGraderUnion{\n\t\t\tOfStringCheck: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t\tModelSample: \"model_sample\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.Metadata)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderRunParams;\nimport com.openai.models.finetuning.alpha.graders.GraderRunResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderRunParams params = GraderRunParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .modelSample(\"model_sample\")\n .build();\n GraderRunResponse response = client.fineTuning().alpha().graders().run(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.run(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check},\n model_sample: \"model_sample\"\n)\n\nputs(response)"
+ }
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/alpha/graders/validate": {
+ "post": {
+ "operationId": "Graders_validateGrader",
+ "summary": "Validate a grader",
+ "description": "Validates a grader.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ValidateGraderResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ValidateGraderRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Validate grader",
+ "beta": true,
+ "group": "graders",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/alpha/graders/validate \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.validate({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n});\n\nconsole.log(response.grader);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.validate(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n)\nprint(response.grader)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Validate(context.TODO(), openai.FineTuningAlphaGraderValidateParams{\n\t\tGrader: openai.FineTuningAlphaGraderValidateParamsGraderUnion{\n\t\t\tOfStringCheckGrader: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.Grader)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderValidateParams;\nimport com.openai.models.finetuning.alpha.graders.GraderValidateResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderValidateParams params = GraderValidateParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .build();\n GraderValidateResponse response = client.fineTuning().alpha().graders().validate(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.validate(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check}\n)\n\nputs(response)"
+ },
+ "response": "{\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions": {
+ "get": {
+ "operationId": "FineTuning_listFineTuningCheckpointPermissions",
+ "summary": "List fine tuning checkpoint permissions",
+ "description": "Lists fine tuning checkpoint permissions matching the request filters.",
+ "parameters": [
+ {
+ "name": "fine_tuned_model_checkpoint",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuned model checkpoint to get permissions for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "project_id",
+ "in": "query",
+ "required": false,
+ "description": "The ID of the project to get permissions for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last permission ID from the previous pagination request.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of permissions to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 10
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "The order in which to retrieve permissions.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "ascending",
+ "descending"
+ ],
+ "default": "descending"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "List checkpoint permissions",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst permission = await client.fineTuning.checkpoints.permissions.retrieve(\n 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',\n);\n\nconsole.log(permission.first_id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npermission = client.fine_tuning.checkpoints.permissions.retrieve(\n fine_tuned_model_checkpoint=\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(permission.first_id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpermission, err := client.FineTuning.Checkpoints.Permissions.Get(\n\t\tcontext.TODO(),\n\t\t\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n\t\topenai.FineTuningCheckpointPermissionGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", permission.FirstID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveParams;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PermissionRetrieveResponse permission = client.fineTuning().checkpoints().permissions().retrieve(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npermission = openai.fine_tuning.checkpoints.permissions.retrieve(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(permission)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n },\n {\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_enQCFmOTGj3syEpYVhBRLTSy\",\n \"created_at\": 1721764800,\n \"project_id\": \"proj_iqGMw1llN8IrBb6SvvY5A1oF\"\n },\n ],\n \"first_id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"cp_enQCFmOTGj3syEpYVhBRLTSy\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "FineTuning_createFineTuningCheckpointPermission",
+ "summary": "Create a fine tuning checkpoint permission",
+ "description": "Creates a fine tuning checkpoint permission from the supplied request.",
+ "parameters": [
+ {
+ "name": "fine_tuned_model_checkpoint",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuned model checkpoint to create a permission for.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create checkpoint permissions",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n -d '{\"project_ids\": [\"proj_abGMw1llN8IrBb6SvvY5A1iH\"]}'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const permissionCreateResponse of client.fineTuning.checkpoints.permissions.create(\n 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd',\n { project_ids: ['string'] },\n)) {\n console.log(permissionCreateResponse.id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.checkpoints.permissions.create(\n fine_tuned_model_checkpoint=\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n project_ids=[\"string\"],\n)\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Checkpoints.Permissions.New(\n\t\tcontext.TODO(),\n\t\t\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n\t\topenai.FineTuningCheckpointPermissionNewParams{\n\t\t\tProjectIDs: []string{\"string\"},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionCreatePage;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PermissionCreateParams params = PermissionCreateParams.builder()\n .fineTunedModelCheckpoint(\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\")\n .addProjectId(\"string\")\n .build();\n PermissionCreatePage page = client.fineTuning().checkpoints().permissions().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.fine_tuning.checkpoints.permissions.create(\n \"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n project_ids: [\"string\"]\n)\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n }\n ],\n \"first_id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"has_more\": false\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}": {
+ "delete": {
+ "operationId": "FineTuning_deleteFineTuningCheckpointPermission",
+ "summary": "Delete a fine tuning checkpoint permission",
+ "description": "Deletes a fine tuning checkpoint permission by its identifier.",
+ "parameters": [
+ {
+ "name": "fine_tuned_model_checkpoint",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuned model checkpoint to delete a permission for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "permission_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuned model checkpoint permission to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete checkpoint permission",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions/cp_zc4Q7MP6XxulcVzj4MZdwsAB \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst permission = await client.fineTuning.checkpoints.permissions.delete(\n 'cp_zc4Q7MP6XxulcVzj4MZdwsAB',\n { fine_tuned_model_checkpoint: 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd' },\n);\n\nconsole.log(permission.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npermission = client.fine_tuning.checkpoints.permissions.delete(\n permission_id=\"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n fine_tuned_model_checkpoint=\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n)\nprint(permission.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpermission, err := client.FineTuning.Checkpoints.Permissions.Delete(\n\t\tcontext.TODO(),\n\t\t\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n\t\t\"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", permission.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteParams;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PermissionDeleteParams params = PermissionDeleteParams.builder()\n .fineTunedModelCheckpoint(\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\")\n .permissionId(\"cp_zc4Q7MP6XxulcVzj4MZdwsAB\")\n .build();\n PermissionDeleteResponse permission = client.fineTuning().checkpoints().permissions().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npermission = openai.fine_tuning.checkpoints.permissions.delete(\n \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n fine_tuned_model_checkpoint: \"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\"\n)\n\nputs(permission)"
+ },
+ "response": "{\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"deleted\": true\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/jobs": {
+ "get": {
+ "operationId": "FineTuning_listPaginatedFineTuningJobs",
+ "summary": "List paginated fine tuning jobs",
+ "description": "Lists paginated fine tuning jobs matching the request filters.",
+ "parameters": [
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last job from the previous pagination request.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of fine-tuning jobs to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "metadata",
+ "in": "query",
+ "required": false,
+ "description": "Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to indicate no metadata.",
+ "schema": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "List fine-tuning jobs",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs?limit=2&metadata[key]=value \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.jobs.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.fineTuning.jobs.list();\n\n for await (const fineTune of list) {\n console.log(fineTune);\n }\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fineTuningJob of client.fineTuning.jobs.list()) {\n console.log(fineTuningJob.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Jobs.List(context.TODO(), openai.FineTuningJobListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.JobListPage;\nimport com.openai.models.finetuning.jobs.JobListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobListPage page = client.fineTuning().jobs().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.fine_tuning.jobs.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n { ... },\n { ... }\n ], \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "FineTuning_createFineTuningJob",
+ "summary": "Create a fine tuning job",
+ "description": "Creates a fine tuning job from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create fine-tuning job",
+ "group": "fine-tuning",
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-BK7bzQj3FfZFXr7DbL6xJwfo\",\n \"model\": \"gpt-4o-mini\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.create({\n training_file: \"file-abc123\"\n });\n\n console.log(fineTune);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n }\n }\n },\n \"metadata\": null\n}\n"
+ },
+ {
+ "title": "Epochs",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"model\": \"gpt-4o-mini\",\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 2\n }\n }\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\nimport { SupervisedMethod, SupervisedHyperparameters } from \"openai/resources/fine-tuning/methods\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.create({\n training_file: \"file-abc123\",\n model: \"gpt-4o-mini\",\n method: {\n type: \"supervised\",\n supervised: {\n hyperparameters: {\n n_epochs: 2\n }\n }\n }\n });\n\n console.log(fineTune);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": 2\n },\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": 2\n }\n }\n },\n \"metadata\": null,\n \"error\": {\n \"code\": null,\n \"message\": null,\n \"param\": null\n },\n \"finished_at\": null,\n \"seed\": 683058546,\n \"trained_tokens\": null,\n \"estimated_finish\": null,\n \"integrations\": [],\n \"user_provided_suffix\": null,\n \"usage_metrics\": null,\n \"shared_with_openai\": false\n}\n"
+ },
+ {
+ "title": "DPO",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"validation_file\": \"file-abc123\",\n \"model\": \"gpt-4o-mini\",\n \"method\": {\n \"type\": \"dpo\",\n \"dpo\": {\n \"hyperparameters\": {\n \"beta\": 0.1\n }\n }\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc\",\n \"model\": \"gpt-4o-mini\",\n \"created_at\": 1746130590,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-abc\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-123\",\n \"training_file\": \"file-abc\",\n \"method\": {\n \"type\": \"dpo\",\n \"dpo\": {\n \"hyperparameters\": {\n \"beta\": 0.1,\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\"\n }\n }\n },\n \"metadata\": null,\n \"error\": {\n \"code\": null,\n \"message\": null,\n \"param\": null\n },\n \"finished_at\": null,\n \"hyperparameters\": null,\n \"seed\": 1036326793,\n \"estimated_finish\": null,\n \"integrations\": [],\n \"user_provided_suffix\": null,\n \"usage_metrics\": null,\n \"shared_with_openai\": false\n}\n"
+ },
+ {
+ "title": "Reinforcement",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc\",\n \"validation_file\": \"file-123\",\n \"model\": \"o4-mini\",\n \"method\": {\n \"type\": \"reinforcement\",\n \"reinforcement\": {\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n },\n \"hyperparameters\": {\n \"reasoning_effort\": \"medium\"\n }\n }\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"o4-mini\",\n \"created_at\": 1721764800,\n \"finished_at\": null,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"validating_files\",\n \"validation_file\": \"file-123\",\n \"training_file\": \"file-abc\",\n \"trained_tokens\": null,\n \"error\": {},\n \"user_provided_suffix\": null,\n \"seed\": 950189191,\n \"estimated_finish\": null,\n \"integrations\": [],\n \"method\": {\n \"type\": \"reinforcement\",\n \"reinforcement\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n \"eval_interval\": \"auto\",\n \"eval_samples\": \"auto\",\n \"compute_multiplier\": \"auto\",\n \"reasoning_effort\": \"medium\"\n },\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n },\n \"response_format\": null\n }\n },\n \"metadata\": null,\n \"usage_metrics\": null,\n \"shared_with_openai\": false\n}\n\n"
+ },
+ {
+ "title": "Validation file",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"validation_file\": \"file-abc123\",\n \"model\": \"gpt-4o-mini\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.create({\n training_file: \"file-abc123\",\n validation_file: \"file-abc123\"\n });\n\n console.log(fineTune);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\",\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n }\n }\n },\n \"metadata\": null\n}\n"
+ },
+ {
+ "title": "W&B Integration",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"validation_file\": \"file-abc123\",\n \"model\": \"gpt-4o-mini\",\n \"integrations\": [\n {\n \"type\": \"wandb\",\n \"wandb\": {\n \"project\": \"my-wandb-project\",\n \"name\": \"ft-run-display-name\"\n \"tags\": [\n \"first-experiment\", \"v2\"\n ]\n }\n }\n ]\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.create({\n model: 'gpt-4o-mini',\n training_file: 'file-abc123',\n});\n\nconsole.log(fineTuningJob.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.create(\n model=\"gpt-4o-mini\",\n training_file=\"file-abc123\",\n)\nprint(fine_tuning_job.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{\n\t\tModel: openai.FineTuningJobNewParamsModelGPT4oMini,\n\t\tTrainingFile: \"file-abc123\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobCreateParams params = JobCreateParams.builder()\n .model(JobCreateParams.Model.GPT_4O_MINI)\n .trainingFile(\"file-abc123\")\n .build();\n FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.create(model: :\"gpt-4o-mini\", training_file: \"file-abc123\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\",\n \"integrations\": [\n {\n \"type\": \"wandb\",\n \"wandb\": {\n \"project\": \"my-wandb-project\",\n \"entity\": None,\n \"run_id\": \"ftjob-abc123\"\n }\n }\n ],\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"batch_size\": \"auto\",\n \"learning_rate_multiplier\": \"auto\",\n \"n_epochs\": \"auto\",\n }\n }\n },\n \"metadata\": null\n}\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}": {
+ "get": {
+ "operationId": "FineTuning_retrieveFineTuningJob",
+ "summary": "Get a fine tuning job",
+ "description": "Retrieves a fine tuning job by its identifier.",
+ "parameters": [
+ {
+ "name": "fine_tuning_job_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuning job.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve fine-tuning job",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.retrieve(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.retrieve(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.retrieve('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Get(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().retrieve(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.retrieve(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel": {
+ "post": {
+ "operationId": "FineTuning_cancelFineTuningJob",
+ "summary": "Cancel a fine tuning job",
+ "description": "Cancels a fine tuning job by its identifier.",
+ "parameters": [
+ {
+ "name": "fine_tuning_job_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuning job to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel fine-tuning",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.cancel(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.cancel(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.cancel('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Cancel(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().cancel(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.cancel(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"cancelled\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints": {
+ "get": {
+ "operationId": "FineTuning_listFineTuningJobCheckpoints",
+ "summary": "List fine tuning job checkpoints",
+ "description": "Lists fine tuning job checkpoints matching the request filters.",
+ "parameters": [
+ {
+ "name": "fine_tuning_job_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuning job to get checkpoints for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last checkpoint ID from the previous pagination request.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of checkpoints to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 10
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "List fine-tuning checkpoints",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/checkpoints \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list(\n 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',\n)) {\n console.log(fineTuningJobCheckpoint.id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.jobs.checkpoints.list(\n fine_tuning_job_id=\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Jobs.Checkpoints.List(\n\t\tcontext.TODO(),\n\t\t\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n\t\topenai.FineTuningJobCheckpointListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.checkpoints.CheckpointListPage;\nimport com.openai.models.finetuning.jobs.checkpoints.CheckpointListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n CheckpointListPage page = client.fineTuning().jobs().checkpoints().list(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.fine_tuning.jobs.checkpoints.list(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000\",\n \"metrics\": {\n \"full_valid_loss\": 0.134,\n \"full_valid_mean_token_accuracy\": 0.874\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 2000\n },\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"created_at\": 1721764800,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000\",\n \"metrics\": {\n \"full_valid_loss\": 0.167,\n \"full_valid_mean_token_accuracy\": 0.781\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 1000\n }\n ],\n \"first_id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/events": {
+ "get": {
+ "operationId": "FineTuning_listFineTuningEvents",
+ "summary": "List fine tuning events",
+ "description": "Lists fine tuning events matching the request filters.",
+ "parameters": [
+ {
+ "name": "fine_tuning_job_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuning job to get events for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last event from the previous pagination request.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of events to retrieve.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListFineTuningJobEventsResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "List fine-tuning events",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/events \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.jobs.list_events(\n fine_tuning_job_id=\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.fineTuning.list_events(id=\"ftjob-abc123\", limit=2);\n\n for await (const fineTune of list) {\n console.log(fineTune);\n }\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fineTuningJobEvent of client.fineTuning.jobs.listEvents(\n 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',\n)) {\n console.log(fineTuningJobEvent.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Jobs.ListEvents(\n\t\tcontext.TODO(),\n\t\t\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n\t\topenai.FineTuningJobListEventsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.JobListEventsPage;\nimport com.openai.models.finetuning.jobs.JobListEventsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n JobListEventsPage page = client.fineTuning().jobs().listEvents(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.fine_tuning.jobs.list_events(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ft-event-ddTJfwuMVpfLXseO0Am0Gqjm\",\n \"created_at\": 1721764800,\n \"level\": \"info\",\n \"message\": \"Fine tuning job successfully completed\",\n \"data\": null,\n \"type\": \"message\"\n },\n {\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ft-event-tyiGuB72evQncpH87xe505Sv\",\n \"created_at\": 1721764800,\n \"level\": \"info\",\n \"message\": \"New fine-tuned model created: ft:gpt-4o-mini:openai::7p4lURel\",\n \"data\": null,\n \"type\": \"message\"\n }\n ],\n \"has_more\": true\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause": {
+ "post": {
+ "operationId": "FineTuning_pauseFineTuningJob",
+ "summary": "Pause a fine tuning job",
+ "description": "Pauses a fine tuning job.",
+ "parameters": [
+ {
+ "name": "fine_tuning_job_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuning job to pause.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "Pause fine-tuning",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/pause \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.pause(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.pause(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.pause('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Pause(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobPauseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().pause(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.pause(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"paused\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume": {
+ "post": {
+ "operationId": "FineTuning_resumeFineTuningJob",
+ "summary": "Resume a fine tuning job",
+ "description": "Resumes a fine tuning job.",
+ "parameters": [
+ {
+ "name": "fine_tuning_job_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the fine-tuning job to resume.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Fine-tuning"
+ ],
+ "x-oaiMeta": {
+ "name": "Resume fine-tuning",
+ "group": "fine-tuning",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/resume \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.resume(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.resume(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.resume('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Resume(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", fineTuningJob.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobResumeParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().resume(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nfine_tuning_job = openai.fine_tuning.jobs.resume(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\nputs(fine_tuning_job)"
+ },
+ "response": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/images/edits": {
+ "post": {
+ "operationId": "Images_createImageEditMultipart_Images_createImageEditJson",
+ "parameters": [],
+ "description": "Creates an image edit multipart from the supplied request. Creates an image edit json from the supplied request.",
+ "summary": "Create an image edit multipart Create an image edit json",
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ImagesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "x-ms-request-body-description-override": "The request body.",
+ "x-oaiMeta": {
+ "name": "Create image edit",
+ "group": "images",
+ "examples": [
+ {
+ "title": "Edit image",
+ "request": {
+ "curl": "curl -s -D >(grep -i x-request-id >&2) \\\n -o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) \\\n -X POST \"https://api.openai.com/v1/images/edits\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"model=gpt-image-1.5\" \\\n -F \"image[]=@body-lotion.png\" \\\n -F \"image[]=@bath-bomb.png\" \\\n -F \"image[]=@incense-kit.png\" \\\n -F \"image[]=@soap.png\" \\\n -F 'prompt=Create a lovely gift basket with these four items in it'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor image in client.images.edit(\n image=b\"Example data\",\n prompt=\"A cute baby sea otter wearing a beret\",\n):\n print(image)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI, { toFile } from \"openai\";\n\nconst client = new OpenAI();\n\nconst imageFiles = [\n \"bath-bomb.png\",\n \"body-lotion.png\",\n \"incense-kit.png\",\n \"soap.png\",\n];\n\nconst images = await Promise.all(\n imageFiles.map(async (file) =>\n await toFile(fs.createReadStream(file), null, {\n type: \"image/png\",\n })\n ),\n);\n\nconst rsp = await client.images.edit({\n model: \"gpt-image-1.5\",\n image: images,\n prompt: \"Create a lovely gift basket with these four items in it\",\n});\n\n// Save the image to a file\nconst image_base64 = rsp.data[0].b64_json;\nconst image_bytes = Buffer.from(image_base64, \"base64\");\nfs.writeFileSync(\"basket.png\", image_bytes);\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.edit({\n image: fs.createReadStream('path/to/file'),\n prompt: 'A cute baby sea otter wearing a beret',\n});\n\nconsole.log(imagesResponse);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{\n\t\tImage: openai.ImageEditParamsImageUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t\tPrompt: \"A cute baby sea otter wearing a beret\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageEditParams;\nimport com.openai.models.images.ImagesResponse;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageEditParams params = ImageEditParams.builder()\n .image(new ByteArrayInputStream(\"Example data\".getBytes()))\n .prompt(\"A cute baby sea otter wearing a beret\")\n .build();\n ImagesResponse imagesResponse = client.images().edit(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.edit(image: StringIO.new(\"Example data\"), prompt: \"A cute baby sea otter wearing a beret\")\n\nputs(images_response)"
+ }
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl -s -N -X POST \"https://api.openai.com/v1/images/edits\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"model=gpt-image-1.5\" \\\n -F \"image[]=@body-lotion.png\" \\\n -F \"image[]=@bath-bomb.png\" \\\n -F \"image[]=@incense-kit.png\" \\\n -F \"image[]=@soap.png\" \\\n -F 'prompt=Create a lovely gift basket with these four items in it' \\\n -F \"stream=true\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor image in client.images.edit(\n image=b\"Example data\",\n prompt=\"A cute baby sea otter wearing a beret\",\n):\n print(image)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI, { toFile } from \"openai\";\n\nconst client = new OpenAI();\n\nconst imageFiles = [\n \"bath-bomb.png\",\n \"body-lotion.png\",\n \"incense-kit.png\",\n \"soap.png\",\n];\n\nconst images = await Promise.all(\n imageFiles.map(async (file) =>\n await toFile(fs.createReadStream(file), null, {\n type: \"image/png\",\n })\n ),\n);\n\nconst stream = await client.images.edit({\n model: \"gpt-image-1.5\",\n image: images,\n prompt: \"Create a lovely gift basket with these four items in it\",\n stream: true,\n});\n\nfor await (const event of stream) {\n console.log(event);\n}\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.edit({\n image: fs.createReadStream('path/to/file'),\n prompt: 'A cute baby sea otter wearing a beret',\n});\n\nconsole.log(imagesResponse);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{\n\t\tImage: openai.ImageEditParamsImageUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t\tPrompt: \"A cute baby sea otter wearing a beret\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageEditParams;\nimport com.openai.models.images.ImagesResponse;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageEditParams params = ImageEditParams.builder()\n .image(new ByteArrayInputStream(\"Example data\".getBytes()))\n .prompt(\"A cute baby sea otter wearing a beret\")\n .build();\n ImagesResponse imagesResponse = client.images().edit(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.edit(image: StringIO.new(\"Example data\"), prompt: \"A cute baby sea otter wearing a beret\")\n\nputs(images_response)"
+ },
+ "response": "event: image_edit.partial_image\ndata: {\"type\":\"image_edit.partial_image\",\"b64_json\":\"...\",\"partial_image_index\":0}\n\nevent: image_edit.completed\ndata: {\"type\":\"image_edit.completed\",\"b64_json\":\"...\",\"usage\":{\"total_tokens\":100,\"input_tokens\":50,\"output_tokens\":50,\"input_tokens_details\":{\"text_tokens\":10,\"image_tokens\":40}}}\n"
+ }
+ ]
+ },
+ "tags": [
+ "Images"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateImageEditRequest"
+ },
+ "encoding": {
+ "image": {
+ "contentType": "application/octet-stream, application/json"
+ },
+ "background": {
+ "contentType": "application/json"
+ },
+ "model": {
+ "contentType": "application/json"
+ },
+ "n": {
+ "contentType": "application/json"
+ },
+ "size": {
+ "contentType": "application/json"
+ },
+ "response_format": {
+ "contentType": "application/json"
+ },
+ "output_format": {
+ "contentType": "application/json"
+ },
+ "output_compression": {
+ "contentType": "application/json"
+ },
+ "input_fidelity": {
+ "contentType": "application/json"
+ },
+ "stream": {
+ "contentType": "application/json"
+ },
+ "partial_images": {
+ "contentType": "application/json"
+ },
+ "quality": {
+ "contentType": "application/json"
+ }
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.EditImageBodyJsonParam"
+ }
+ }
+ },
+ "description": "The multipart request body. The request body."
+ }
+ }
+ },
+ "/openai/v1/images/generations": {
+ "post": {
+ "operationId": "Images_createImage",
+ "summary": "Create an image",
+ "description": "Creates an image from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ImagesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Images"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateImageRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create image",
+ "group": "images",
+ "examples": [
+ {
+ "title": "Generate image",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/images/generations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-image-1.5\",\n \"prompt\": \"A cute baby sea otter\",\n \"n\": 1,\n \"size\": \"1024x1024\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor image in client.images.generate(\n prompt=\"A cute baby sea otter\",\n):\n print(image)",
+ "javascript": "import OpenAI from \"openai\";\nimport { writeFile } from \"fs/promises\";\n\nconst client = new OpenAI();\n\nconst img = await client.images.generate({\n model: \"gpt-image-1.5\",\n prompt: \"A cute baby sea otter\",\n n: 1,\n size: \"1024x1024\"\n});\n\nconst imageBuffer = Buffer.from(img.data[0].b64_json, \"base64\");\nawait writeFile(\"output.png\", imageBuffer);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });\n\nconsole.log(imagesResponse);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{\n\t\tPrompt: \"A cute baby sea otter\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageGenerateParams;\nimport com.openai.models.images.ImagesResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageGenerateParams params = ImageGenerateParams.builder()\n .prompt(\"A cute baby sea otter\")\n .build();\n ImagesResponse imagesResponse = client.images().generate(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.generate(prompt: \"A cute baby sea otter\")\n\nputs(images_response)"
+ },
+ "response": "{\n \"created\": 1713833628,\n \"data\": [\n {\n \"b64_json\": \"...\"\n }\n ],\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \"image_tokens\": 40\n }\n }\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/images/generations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-image-1.5\",\n \"prompt\": \"A cute baby sea otter\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"stream\": true\n }' \\\n --no-buffer\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor image in client.images.generate(\n prompt=\"A cute baby sea otter\",\n):\n print(image)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst client = new OpenAI();\n\nconst stream = await client.images.generate({\n model: \"gpt-image-1.5\",\n prompt: \"A cute baby sea otter\",\n n: 1,\n size: \"1024x1024\",\n stream: true,\n});\n\nfor await (const event of stream) {\n console.log(event);\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });\n\nconsole.log(imagesResponse);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{\n\t\tPrompt: \"A cute baby sea otter\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageGenerateParams;\nimport com.openai.models.images.ImagesResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageGenerateParams params = ImageGenerateParams.builder()\n .prompt(\"A cute baby sea otter\")\n .build();\n ImagesResponse imagesResponse = client.images().generate(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.generate(prompt: \"A cute baby sea otter\")\n\nputs(images_response)"
+ },
+ "response": "event: image_generation.partial_image\ndata: {\"type\":\"image_generation.partial_image\",\"b64_json\":\"...\",\"partial_image_index\":0}\n\nevent: image_generation.completed\ndata: {\"type\":\"image_generation.completed\",\"b64_json\":\"...\",\"usage\":{\"total_tokens\":100,\"input_tokens\":50,\"output_tokens\":50,\"input_tokens_details\":{\"text_tokens\":10,\"image_tokens\":40}}}\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/images/variations": {
+ "post": {
+ "operationId": "Images_createImageVariation",
+ "summary": "Create an image variation",
+ "description": "Creates an image variation from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ImagesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Images"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateImageVariationRequest"
+ },
+ "encoding": {
+ "model": {
+ "contentType": "application/json"
+ },
+ "n": {
+ "contentType": "application/json"
+ },
+ "response_format": {
+ "contentType": "application/json"
+ },
+ "size": {
+ "contentType": "application/json"
+ }
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create image variation",
+ "group": "images",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/images/variations \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F image=\"@otter.png\" \\\n -F n=2 \\\n -F size=\"1024x1024\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nimages_response = client.images.create_variation(\n image=b\"Example data\",\n)\nprint(images_response.created)",
+ "javascript": "import fs from \"fs\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const image = await openai.images.createVariation({\n image: fs.createReadStream(\"otter.png\"),\n });\n\n console.log(image.data);\n}\nmain();",
+ "csharp": "using System;\n\nusing OpenAI.Images;\n\nImageClient client = new(\n model: \"dall-e-2\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nGeneratedImage image = client.GenerateImageVariation(imageFilePath: \"otter.png\");\n\nConsole.WriteLine(image.ImageUri);\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst imagesResponse = await client.images.createVariation({\n image: fs.createReadStream('otter.png'),\n});\n\nconsole.log(imagesResponse.created);",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\timagesResponse, err := client.Images.NewVariation(context.TODO(), openai.ImageNewVariationParams{\n\t\tImage: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", imagesResponse.Created)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.images.ImageCreateVariationParams;\nimport com.openai.models.images.ImagesResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ImageCreateVariationParams params = ImageCreateVariationParams.builder()\n .image(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n ImagesResponse imagesResponse = client.images().createVariation(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nimages_response = openai.images.create_variation(image: StringIO.new(\"Example data\"))\n\nputs(images_response)"
+ },
+ "response": "{\n \"created\": 1589478378,\n \"data\": [\n {\n \"url\": \"https://...\"\n },\n {\n \"url\": \"https://...\"\n }\n ]\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/models": {
+ "get": {
+ "operationId": "OpenAIModels_listModels",
+ "summary": "List models",
+ "description": "Lists models matching the request filters.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListModelsResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Models"
+ ],
+ "x-oaiMeta": {
+ "name": "List models",
+ "group": "models",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/models \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.models.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.models.list();\n\n for await (const model of list) {\n console.log(model);\n }\n}\nmain();",
+ "csharp": "using System;\n\nusing OpenAI.Models;\n\nOpenAIModelClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nforeach (var model in client.GetModels().Value)\n{\n Console.WriteLine(model.Id);\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const model of client.models.list()) {\n console.log(model.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Models.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.models.ModelListPage;\nimport com.openai.models.models.ModelListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ModelListPage page = client.models().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.models.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"model-id-0\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"organization-owner\"\n },\n {\n \"id\": \"model-id-1\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"organization-owner\",\n },\n {\n \"id\": \"model-id-2\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"openai\"\n },\n ]\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/models/{model}": {
+ "delete": {
+ "operationId": "OpenAIModels_deleteModel",
+ "summary": "Delete a model",
+ "description": "Deletes a model by its identifier.",
+ "parameters": [
+ {
+ "name": "model",
+ "in": "path",
+ "required": true,
+ "description": "The model to delete",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteModelResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Models"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a fine-tuned model",
+ "group": "models",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/models/ft:gpt-4o-mini:acemeco:suffix:abc123 \\\n -X DELETE \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmodel_deleted = client.models.delete(\n \"ft:gpt-4o-mini:acemeco:suffix:abc123\",\n)\nprint(model_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const model = await openai.models.delete(\"ft:gpt-4o-mini:acemeco:suffix:abc123\");\n\n console.log(model);\n}\nmain();",
+ "csharp": "using System;\nusing System.ClientModel;\n\nusing OpenAI.Models;\n\nOpenAIModelClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nClientResult success = client.DeleteModel(\"ft:gpt-4o-mini:acemeco:suffix:abc123\");\nConsole.WriteLine(success);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst modelDeleted = await client.models.delete('ft:gpt-4o-mini:acemeco:suffix:abc123');\n\nconsole.log(modelDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmodelDeleted, err := client.Models.Delete(context.TODO(), \"ft:gpt-4o-mini:acemeco:suffix:abc123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", modelDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.models.ModelDeleteParams;\nimport com.openai.models.models.ModelDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ModelDeleted modelDeleted = client.models().delete(\"ft:gpt-4o-mini:acemeco:suffix:abc123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmodel_deleted = openai.models.delete(\"ft:gpt-4o-mini:acemeco:suffix:abc123\")\n\nputs(model_deleted)"
+ },
+ "response": "{\n \"id\": \"ft:gpt-4o-mini:acemeco:suffix:abc123\",\n \"object\": \"model\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "OpenAIModels_retrieveModel",
+ "summary": "Get a model",
+ "description": "Retrieves a model by its identifier.",
+ "parameters": [
+ {
+ "name": "model",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the model to use for this request",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Model"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Models"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve model",
+ "group": "models",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/models/VAR_chat_model_id \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmodel = client.models.retrieve(\n \"gpt-4o-mini\",\n)\nprint(model.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const model = await openai.models.retrieve(\"VAR_chat_model_id\");\n\n console.log(model);\n}\n\nmain();",
+ "csharp": "using System;\nusing System.ClientModel;\n\nusing OpenAI.Models;\n\n OpenAIModelClient client = new(\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nClientResult model = client.GetModel(\"babbage-002\");\nConsole.WriteLine(model.Value.Id);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst model = await client.models.retrieve('gpt-4o-mini');\n\nconsole.log(model.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmodel, err := client.Models.Get(context.TODO(), \"gpt-4o-mini\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", model.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.models.Model;\nimport com.openai.models.models.ModelRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Model model = client.models().retrieve(\"gpt-4o-mini\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmodel = openai.models.retrieve(\"gpt-4o-mini\")\n\nputs(model)"
+ },
+ "response": "{\n \"id\": \"VAR_chat_model_id\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"openai\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/moderations": {
+ "post": {
+ "operationId": "Moderations_createModeration",
+ "summary": "Create a moderation",
+ "description": "Creates a moderation from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Moderations"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create moderation",
+ "group": "moderations",
+ "examples": [
+ {
+ "title": "Single string",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/moderations \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"input\": \"I want to kill them.\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmoderation = client.moderations.create(\n input=\"I want to kill them.\",\n)\nprint(moderation.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const moderation = await openai.moderations.create({ input: \"I want to kill them.\" });\n\n console.log(moderation);\n}\nmain();\n",
+ "csharp": "using System;\nusing System.ClientModel;\n\nusing OpenAI.Moderations;\n\nModerationClient client = new(\n model: \"omni-moderation-latest\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nClientResult moderation = client.ClassifyText(\"I want to kill them.\");\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst moderation = await client.moderations.create({ input: 'I want to kill them.' });\n\nconsole.log(moderation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmoderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{\n\t\tInput: openai.ModerationNewParamsInputUnion{\n\t\t\tOfString: openai.String(\"I want to kill them.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", moderation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.moderations.ModerationCreateParams;\nimport com.openai.models.moderations.ModerationCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ModerationCreateParams params = ModerationCreateParams.builder()\n .input(\"I want to kill them.\")\n .build();\n ModerationCreateResponse moderation = client.moderations().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmoderation = openai.moderations.create(input: \"I want to kill them.\")\n\nputs(moderation)"
+ },
+ "response": "{\n \"id\": \"modr-AB8CjOTu2jiq12hp1AQPfeqFWaORR\",\n \"model\": \"text-moderation-007\",\n \"results\": [\n {\n \"flagged\": true,\n \"categories\": {\n \"sexual\": false,\n \"hate\": false,\n \"harassment\": true,\n \"self-harm\": false,\n \"sexual/minors\": false,\n \"hate/threatening\": false,\n \"violence/graphic\": false,\n \"self-harm/intent\": false,\n \"self-harm/instructions\": false,\n \"harassment/threatening\": true,\n \"violence\": true\n },\n \"category_scores\": {\n \"sexual\": 0.000011726012417057063,\n \"hate\": 0.22706663608551025,\n \"harassment\": 0.5215635299682617,\n \"self-harm\": 2.227119921371923e-6,\n \"sexual/minors\": 7.107352217872176e-8,\n \"hate/threatening\": 0.023547329008579254,\n \"violence/graphic\": 0.00003391829886822961,\n \"self-harm/intent\": 1.646940972932498e-6,\n \"self-harm/instructions\": 1.1198755256458526e-9,\n \"harassment/threatening\": 0.5694745779037476,\n \"violence\": 0.9971134662628174\n }\n }\n ]\n}\n"
+ },
+ {
+ "title": "Image and text",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/moderations \\\n -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"omni-moderation-latest\",\n \"input\": [\n { \"type\": \"text\", \"text\": \"...text to classify goes here...\" },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/image.png\"\n }\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmoderation = client.moderations.create(\n input=\"I want to kill them.\",\n)\nprint(moderation.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nconst moderation = await openai.moderations.create({\n model: \"omni-moderation-latest\",\n input: [\n { type: \"text\", text: \"...text to classify goes here...\" },\n {\n type: \"image_url\",\n image_url: {\n url: \"https://example.com/image.png\"\n // can also use base64 encoded image URLs\n // url: \"data:image/jpeg;base64,abcdefg...\"\n }\n }\n ],\n});\n\nconsole.log(moderation);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst moderation = await client.moderations.create({ input: 'I want to kill them.' });\n\nconsole.log(moderation.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmoderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{\n\t\tInput: openai.ModerationNewParamsInputUnion{\n\t\t\tOfString: openai.String(\"I want to kill them.\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", moderation.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.moderations.ModerationCreateParams;\nimport com.openai.models.moderations.ModerationCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ModerationCreateParams params = ModerationCreateParams.builder()\n .input(\"I want to kill them.\")\n .build();\n ModerationCreateResponse moderation = client.moderations().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmoderation = openai.moderations.create(input: \"I want to kill them.\")\n\nputs(moderation)"
+ },
+ "response": "{\n \"id\": \"modr-0d9740456c391e43c445bf0f010940c7\",\n \"model\": \"omni-moderation-latest\",\n \"results\": [\n {\n \"flagged\": true,\n \"categories\": {\n \"harassment\": true,\n \"harassment/threatening\": true,\n \"sexual\": false,\n \"hate\": false,\n \"hate/threatening\": false,\n \"illicit\": false,\n \"illicit/violent\": false,\n \"self-harm/intent\": false,\n \"self-harm/instructions\": false,\n \"self-harm\": false,\n \"sexual/minors\": false,\n \"violence\": true,\n \"violence/graphic\": true\n },\n \"category_scores\": {\n \"harassment\": 0.8189693396524255,\n \"harassment/threatening\": 0.804985420696006,\n \"sexual\": 1.573112165348997e-6,\n \"hate\": 0.007562942636942845,\n \"hate/threatening\": 0.004208854591835476,\n \"illicit\": 0.030535955153511665,\n \"illicit/violent\": 0.008925306722380033,\n \"self-harm/intent\": 0.00023023930975076432,\n \"self-harm/instructions\": 0.0002293869201073356,\n \"self-harm\": 0.012598046106750154,\n \"sexual/minors\": 2.212566909570261e-8,\n \"violence\": 0.9999992735124786,\n \"violence/graphic\": 0.843064871157054\n },\n \"category_applied_input_types\": {\n \"harassment\": [\n \"text\"\n ],\n \"harassment/threatening\": [\n \"text\"\n ],\n \"sexual\": [\n \"text\",\n \"image\"\n ],\n \"hate\": [\n \"text\"\n ],\n \"hate/threatening\": [\n \"text\"\n ],\n \"illicit\": [\n \"text\"\n ],\n \"illicit/violent\": [\n \"text\"\n ],\n \"self-harm/intent\": [\n \"text\",\n \"image\"\n ],\n \"self-harm/instructions\": [\n \"text\",\n \"image\"\n ],\n \"self-harm\": [\n \"text\",\n \"image\"\n ],\n \"sexual/minors\": [\n \"text\"\n ],\n \"violence\": [\n \"text\",\n \"image\"\n ],\n \"violence/graphic\": [\n \"text\",\n \"image\"\n ]\n }\n }\n ]\n}\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/realtime/calls": {
+ "post": {
+ "operationId": "Realtime_create-realtime-call",
+ "summary": "Create a Realtime call",
+ "description": "Creates a Realtime API call over WebRTC and returns the SDP answer needed to complete the peer connection.",
+ "parameters": [],
+ "responses": {
+ "201": {
+ "description": "The request has succeeded and a new resource has been created as a result.",
+ "headers": {
+ "location": {
+ "required": false,
+ "description": "The location request header.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/sdp": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Realtime"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeCallCreateRequest"
+ },
+ "encoding": {
+ "session": {
+ "contentType": "application/json"
+ }
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create call",
+ "group": "realtime",
+ "returns": "Returns `201 Created` with the SDP answer in the response body. The\n`Location` response header includes the call ID for follow-up requests,\ne.g., establishing a monitoring WebSocket or hanging up the call.",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/realtime/calls \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"sdp= inputItems =\n[\n ResponseItem.CreateUserMessageItem(\n [\n ResponseContentPart.CreateInputTextPart(\"What is in this image?\"),\n ResponseContentPart.CreateInputImagePart(new Uri(\"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"))\n ]\n )\n];\n\nOpenAIResponse response = client.CreateResponse(inputItems);\n\nConsole.WriteLine(response.GetOutputText());\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41\",\n \"object\": \"response\",\n \"created_at\": 1741476777,\n \"status\": \"completed\",\n \"completed_at\": 1741476778,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 328,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 52,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 380\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "File input",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"input_text\", \"text\": \"what is in this file?\"},\n {\n \"type\": \"input_file\",\n \"file_url\": \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\"\n }\n ]\n }\n ]\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n input: [\n {\n role: \"user\",\n content: [\n { type: \"input_text\", text: \"what is in this file?\" },\n {\n type: \"input_file\",\n file_url: \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\",\n },\n ],\n },\n ],\n});\n\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86\",\n \"object\": \"response\",\n \"created_at\": 1752100704,\n \"status\": \"completed\",\n \"completed_at\": 1752100705,\n \"background\": false,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"id\": \"msg_686eef60d3e081a29283bdcbc4322fd90e34c516d176ff86\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"The file seems to contain excerpts from a letter to the shareholders of Berkshire Hathaway Inc., likely written by Warren Buffett. It covers several topics:\n\n1. **Communication Philosophy**: Buffett emphasizes the importance of transparency and candidness in reporting mistakes and successes to shareholders.\n\n2. **Mistakes and Learnings**: The letter acknowledges past mistakes in business assessments and management hires, highlighting the importance of correcting errors promptly.\n\n3. **CEO Succession**: Mention of Greg Abel stepping in as the new CEO and continuing the tradition of honest communication.\n\n4. **Pete Liegl Story**: A detailed account of acquiring Forest River and the relationship with its founder, highlighting trust and effective business decisions.\n\n5. **2024 Performance**: Overview of business performance, particularly in insurance and investment activities, with a focus on GEICO's improvement.\n\n6. **Tax Contributions**: Discussion of significant tax payments to the U.S. Treasury, credited to shareholders' reinvestments.\n\n7. **Investment Strategy**: A breakdown of Berkshire\\u2019s investments in both controlled subsidiaries and marketable equities, along with a focus on long-term holding strategies.\n\n8. **American Capitalism**: Reflections on America\\u2019s economic development and Berkshire\\u2019s role within it.\n\n9. **Property-Casualty Insurance**: Insights into the P/C insurance business model and its challenges and benefits.\n\n10. **Japanese Investments**: Information about Berkshire\\u2019s investments in Japanese companies and future plans.\n\n11. **Annual Meeting**: Details about the upcoming annual gathering in Omaha, including schedule changes and new book releases.\n\n12. **Personal Anecdotes**: Light-hearted stories about family and interactions, conveying Buffett's personable approach.\n\n13. **Financial Performance Data**: Tables comparing Berkshire\\u2019s annual performance to the S&P 500, showing impressive long-term gains.\n\nOverall, the letter reinforces Berkshire Hathaway's commitment to transparency, investment in both its businesses and the wider economy, and emphasizes strong leadership and prudent financial management.\"\n }\n ],\n \"role\": \"assistant\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 8438,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 398,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 8836\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "Web search",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"tools\": [{ \"type\": \"web_search_preview\" }],\n \"input\": \"What was a positive news story from today?\"\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n tools: [{ type: \"web_search_preview\" }],\n input: \"What was a positive news story from today?\",\n});\n\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "csharp": "using System;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"What was a positive news story from today?\";\n\nResponseCreationOptions options = new()\n{\n Tools =\n {\n ResponseTool.CreateWebSearchTool()\n },\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n\nConsole.WriteLine(response.GetOutputText());\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c\",\n \"object\": \"response\",\n \"created_at\": 1741484430,\n \"status\": \"completed\",\n \"completed_at\": 1741484431,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"type\": \"web_search_call\",\n \"id\": \"ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c\",\n \"status\": \"completed\"\n },\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"As of today, March 9, 2025, one notable positive news story...\",\n \"annotations\": [\n {\n \"type\": \"url_citation\",\n \"start_index\": 442,\n \"end_index\": 557,\n \"url\": \"https://.../?utm_source=chatgpt.com\",\n \"title\": \"...\"\n },\n {\n \"type\": \"url_citation\",\n \"start_index\": 962,\n \"end_index\": 1077,\n \"url\": \"https://.../?utm_source=chatgpt.com\",\n \"title\": \"...\"\n },\n {\n \"type\": \"url_citation\",\n \"start_index\": 1336,\n \"end_index\": 1451,\n \"url\": \"https://.../?utm_source=chatgpt.com\",\n \"title\": \"...\"\n }\n ]\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"web_search_preview\",\n \"domains\": [],\n \"search_context_size\": \"medium\",\n \"user_location\": {\n \"type\": \"approximate\",\n \"city\": null,\n \"country\": \"US\",\n \"region\": null,\n \"timezone\": null\n }\n }\n ],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 328,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 356,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 684\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "File search",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"tools\": [{\n \"type\": \"file_search\",\n \"vector_store_ids\": [\"vs_1234567890\"],\n \"max_num_results\": 20\n }],\n \"input\": \"What are the attributes of an ancient brown dragon?\"\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n tools: [{\n type: \"file_search\",\n vector_store_ids: [\"vs_1234567890\"],\n max_num_results: 20\n }],\n input: \"What are the attributes of an ancient brown dragon?\",\n});\n\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "csharp": "using System;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"What are the attributes of an ancient brown dragon?\";\n\nResponseCreationOptions options = new()\n{\n Tools =\n {\n ResponseTool.CreateFileSearchTool(\n vectorStoreIds: [\"vs_1234567890\"],\n maxResultCount: 20\n )\n },\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n\nConsole.WriteLine(response.GetOutputText());\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7\",\n \"object\": \"response\",\n \"created_at\": 1741485253,\n \"status\": \"completed\",\n \"completed_at\": 1741485254,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"type\": \"file_search_call\",\n \"id\": \"fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7\",\n \"status\": \"completed\",\n \"queries\": [\n \"attributes of an ancient brown dragon\"\n ],\n \"results\": null\n },\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"The attributes of an ancient brown dragon include...\",\n \"annotations\": [\n {\n \"type\": \"file_citation\",\n \"index\": 320,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 576,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 815,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 815,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1030,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1030,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1156,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n },\n {\n \"type\": \"file_citation\",\n \"index\": 1225,\n \"file_id\": \"file-4wDz5b167pAf72nx1h9eiN\",\n \"filename\": \"dragons.pdf\"\n }\n ]\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"file_search\",\n \"filters\": null,\n \"max_num_results\": 20,\n \"ranking_options\": {\n \"ranker\": \"auto\",\n \"score_threshold\": 0.0\n },\n \"vector_store_ids\": [\n \"vs_1234567890\"\n ]\n }\n ],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 18307,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 348,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 18655\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"instructions\": \"You are a helpful assistant.\",\n \"input\": \"Hello!\",\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n instructions: \"You are a helpful assistant.\",\n input: \"Hello!\",\n stream: true,\n});\n\nfor await (const event of response) {\n console.log(event);\n}\n",
+ "csharp": "using System;\nusing System.ClientModel;\nusing System.Threading.Tasks;\n\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"Hello!\";\n\nResponseCreationOptions options = new()\n{\n Instructions = \"You are a helpful assistant.\",\n};\n\nAsyncCollectionResult responseUpdates = client.CreateResponseStreamingAsync(userInputText, options);\n\nawait foreach (StreamingResponseUpdate responseUpdate in responseUpdates)\n{\n if (responseUpdate is StreamingResponseOutputTextDeltaUpdate outputTextDeltaUpdate)\n {\n Console.Write(outputTextDeltaUpdate.Delta);\n }\n}\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "event: response.created\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654\",\"object\":\"response\",\"created_at\":1741290958,\"status\":\"in_progress\",\"error\":null,\"incomplete_details\":null,\"instructions\":\"You are a helpful assistant.\",\"max_output_tokens\":null,\"model\":\"gpt-5.4\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"}},\"tool_choice\":\"auto\",\"tools\":[],\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654\",\"object\":\"response\",\"created_at\":1741290958,\"status\":\"in_progress\",\"error\":null,\"incomplete_details\":null,\"instructions\":\"You are a helpful assistant.\",\"max_output_tokens\":null,\"model\":\"gpt-5.4\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"}},\"tool_choice\":\"auto\",\"tools\":[],\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"item_id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"item_id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\"}\n\n...\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"item_id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"output_index\":0,\"content_index\":0,\"text\":\"Hi there! How can I assist you today?\"}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"item_id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Hi there! How can I assist you today?\",\"annotations\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hi there! How can I assist you today?\",\"annotations\":[]}]}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654\",\"object\":\"response\",\"created_at\":1741290958,\"status\":\"completed\",\"error\":null,\"incomplete_details\":null,\"instructions\":\"You are a helpful assistant.\",\"max_output_tokens\":null,\"model\":\"gpt-5.4\",\"output\":[{\"id\":\"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hi there! How can I assist you today?\",\"annotations\":[]}]}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"}},\"tool_choice\":\"auto\",\"tools\":[],\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":37,\"output_tokens\":11,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":48},\"user\":null,\"metadata\":{}}}\n"
+ },
+ {
+ "title": "Functions",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.4\",\n \"input\": \"What is the weather like in Boston today?\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\", \"unit\"]\n }\n }\n ],\n \"tool_choice\": \"auto\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst tools = [\n {\n type: \"function\",\n name: \"get_current_weather\",\n description: \"Get the current weather in a given location\",\n parameters: {\n type: \"object\",\n properties: {\n location: {\n type: \"string\",\n description: \"The city and state, e.g. San Francisco, CA\",\n },\n unit: { type: \"string\", enum: [\"celsius\", \"fahrenheit\"] },\n },\n required: [\"location\", \"unit\"],\n },\n },\n];\n\nconst response = await openai.responses.create({\n model: \"gpt-5.4\",\n tools: tools,\n input: \"What is the weather like in Boston today?\",\n tool_choice: \"auto\",\n});\n\nconsole.log(response);\n",
+ "csharp": "using System;\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"gpt-5.4\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nResponseTool getCurrentWeatherFunctionTool = ResponseTool.CreateFunctionTool(\n functionName: \"get_current_weather\",\n functionDescription: \"Get the current weather in a given location\",\n functionParameters: BinaryData.FromString(\"\"\"\n {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]}\n },\n \"required\": [\"location\", \"unit\"]\n }\n \"\"\"\n )\n);\n\nstring userInputText = \"What is the weather like in Boston today?\";\n\nResponseCreationOptions options = new()\n{\n Tools =\n {\n getCurrentWeatherFunctionTool\n },\n ToolChoice = ResponseToolChoice.CreateAutoChoice(),\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0\",\n \"object\": \"response\",\n \"created_at\": 1741294021,\n \"status\": \"completed\",\n \"completed_at\": 1741294022,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-5.4\",\n \"output\": [\n {\n \"type\": \"function_call\",\n \"id\": \"fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0\",\n \"call_id\": \"call_unLAR8MvFNptuiZK6K6HCy5k\",\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\"location\":\"Boston, MA\",\"unit\":\"celsius\"}\",\n \"status\": \"completed\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"description\": \"Get the current weather in a given location\",\n \"name\": \"get_current_weather\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\n \"celsius\",\n \"fahrenheit\"\n ]\n }\n },\n \"required\": [\n \"location\",\n \"unit\"\n ]\n },\n \"strict\": true\n }\n ],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 291,\n \"output_tokens\": 23,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 314\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ },
+ {
+ "title": "Reasoning",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"o3-mini\",\n \"input\": \"How much wood would a woodchuck chuck?\",\n \"reasoning\": {\n \"effort\": \"high\"\n }\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n model: \"o3-mini\",\n input: \"How much wood would a woodchuck chuck?\",\n reasoning: {\n effort: \"high\"\n }\n});\n\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create():\n print(response)",
+ "csharp": "using System;\nusing OpenAI.Responses;\n\nOpenAIResponseClient client = new(\n model: \"o3-mini\",\n apiKey: Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\")\n);\n\nstring userInputText = \"How much wood would a woodchuck chuck?\";\n\nResponseCreationOptions options = new()\n{\n ReasoningOptions = new()\n {\n ReasoningEffortLevel = ResponseReasoningEffortLevel.High,\n },\n};\n\nOpenAIResponse response = client.CreateResponse(userInputText, options);\n\nConsole.WriteLine(response.GetOutputText());\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create();\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.create\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67ccd7eca01881908ff0b5146584e408072912b2993db808\",\n \"object\": \"response\",\n \"created_at\": 1741477868,\n \"status\": \"completed\",\n \"completed_at\": 1741477869,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"o1-2024-12-17\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"The classic tongue twister...\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 81,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 1035,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 832\n },\n \"total_tokens\": 1116\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ }
+ ]
+ }
+ },
+ "get": {
+ "operationId": "listResponses",
+ "summary": "List responses",
+ "description": "Returns a collection of all stored responses matching specified filter criteria.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "agent_name",
+ "in": "query",
+ "required": false,
+ "description": "Filter by agent name. If provided, only items associated with the specified agent will be returned.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "agent_id",
+ "in": "query",
+ "required": false,
+ "description": "Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "conversation_id",
+ "in": "query",
+ "required": false,
+ "description": "Filter by conversation ID. If provided, only responses associated with the specified conversation will be returned.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Response"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ]
+ }
+ },
+ "/openai/v1/responses/compact": {
+ "post": {
+ "operationId": "Compactconversation",
+ "summary": "Compact a conversation",
+ "description": "Compacts a conversation into a response object suitable for long-running and zero-data-retention scenarios.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CompactResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CompactResponseMethodPublicBody"
+ }
+ }
+ }
+ },
+ "x-oaiMeta": {
+ "name": "Compact a response",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/responses/compact \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"model\": \"gpt-5.1-codex-max\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": \"Create a simple landing page for a dog petting café.\"\n },\n {\n \"id\": \"msg_001\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"annotations\": [],\n \"logprobs\": [],\n \"text\": \"Below is a single file, ready-to-use landing page for a dog petting café:...\"\n }\n ],\n \"role\": \"assistant\"\n }\n ]\n }'\n",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\n// Compact the previous response if you are running out of tokens\nconst compactedResponse = await openai.responses.compact({\n model: \"gpt-5.1-codex-max\",\n input: [\n {\n role: \"user\",\n content: \"Create a simple landing page for a dog petting café.\",\n },\n // All items returned from previous requests are included here, like reasoning, message, function call, etc.\n {\n id: \"msg_030d085c0b53e67e0069332e3a72d4819c96c6f2c4adc15d33\",\n type: \"message\",\n status: \"completed\",\n content: [\n {\n type: \"output_text\",\n annotations: [],\n logprobs: [],\n text: \"Below is a single file, ready-to-use landing page for a dog petting café:...\",\n },\n ],\n role: \"assistant\",\n },\n ],\n});\n\n// Pass the compactedResponse.output as input to the next request\nconsole.log(compactedResponse);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\ncompacted_response = client.responses.compact(\n model=\"gpt-5.4\",\n)\nprint(compacted_response.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst compactedResponse = await client.responses.compact({ model: 'gpt-5.4' });\n\nconsole.log(compactedResponse.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcompactedResponse, err := client.Responses.Compact(context.TODO(), responses.ResponseCompactParams{\n\t\tModel: responses.ResponseCompactParamsModelGPT5_4,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", compactedResponse.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.CompactedResponse;\nimport com.openai.models.responses.ResponseCompactParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ResponseCompactParams params = ResponseCompactParams.builder()\n .model(ResponseCompactParams.Model.GPT_5_4)\n .build();\n CompactedResponse compactedResponse = client.responses().compact(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\ncompacted_response = openai.responses.compact(model: :\"gpt-5.4\")\n\nputs(compacted_response)"
+ },
+ "response": "{\n \"id\": \"resp_001\",\n \"object\": \"response.compaction\",\n \"created_at\": 1764967971,\n \"output\": [\n {\n \"id\": \"msg_000\",\n \"type\": \"message\",\n \"status\": \"completed\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Create a simple landing page for a dog petting cafe.\"\n }\n ],\n \"role\": \"user\"\n },\n {\n \"id\": \"cmp_001\",\n \"type\": \"compaction\",\n \"encrypted_content\": \"gAAAAABpM0Yj-...=\"\n }\n ],\n \"usage\": {\n \"input_tokens\": 139,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 438,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 64\n },\n \"total_tokens\": 577\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/responses/{response_id}": {
+ "get": {
+ "operationId": "getResponse",
+ "summary": "Retrieve a model response",
+ "description": "Retrieves a model response with the given ID.",
+ "parameters": [
+ {
+ "name": "response_id",
+ "in": "path",
+ "required": true,
+ "description": "The response id path parameter.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include[]",
+ "in": "query",
+ "required": false,
+ "description": "The includables query parameter.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.IncludeEnum"
+ },
+ "default": []
+ }
+ },
+ {
+ "name": "stream",
+ "in": "query",
+ "required": false,
+ "description": "The stream query parameter.",
+ "schema": {
+ "type": "boolean",
+ "default": false
+ },
+ "explode": false
+ },
+ {
+ "name": "starting_after",
+ "in": "query",
+ "required": false,
+ "description": "The sequence number of the event after which to start streaming.",
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "headers": {
+ "x-agent-session-id": {
+ "required": false,
+ "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Response"
+ }
+ },
+ "text/event-stream": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateResponseStreamingResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "x-oaiMeta": {
+ "name": "Get a model response",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses/resp_123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst response = await client.responses.retrieve(\"resp_123\");\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.retrieve(\n response_id=\"resp_677efb5139a88190b512bc3fef8e535d\",\n):\n print(response)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.retrieve('resp_677efb5139a88190b512bc3fef8e535d');\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.Get(\n\t\tcontext.TODO(),\n\t\t\"resp_677efb5139a88190b512bc3fef8e535d\",\n\t\tresponses.ResponseGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().retrieve(\"resp_677efb5139a88190b512bc3fef8e535d\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.retrieve(\"resp_677efb5139a88190b512bc3fef8e535d\")\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67cb71b351908190a308f3859487620d06981a8637e6bc44\",\n \"object\": \"response\",\n \"created_at\": 1741386163,\n \"status\": \"completed\",\n \"completed_at\": 1741386164,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44\",\n \"status\": \"completed\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"Silent circuits hum,\nThoughts emerge in data streams—\nDigital dawn breaks.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 32,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 18,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 50\n },\n \"user\": null,\n \"metadata\": {}\n}\n"
+ }
+ }
+ },
+ "delete": {
+ "operationId": "deleteResponse",
+ "summary": "Delete a model response",
+ "description": "Deletes a model response.",
+ "parameters": [
+ {
+ "name": "response_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the response to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "headers": {
+ "x-agent-session-id": {
+ "required": false,
+ "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteResponseResult"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete a model response",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/responses/resp_123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst response = await client.responses.delete(\"resp_123\");\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nclient.responses.delete(\n \"resp_677efb5139a88190b512bc3fef8e535d\",\n)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.responses.delete('resp_677efb5139a88190b512bc3fef8e535d');",
+ "go": "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Responses.Delete(context.TODO(), \"resp_677efb5139a88190b512bc3fef8e535d\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.ResponseDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n client.responses().delete(\"resp_677efb5139a88190b512bc3fef8e535d\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresult = openai.responses.delete(\"resp_677efb5139a88190b512bc3fef8e535d\")\n\nputs(result)"
+ },
+ "response": "{\n \"id\": \"resp_6786a1bec27481909a17d673315b29f6\",\n \"object\": \"response\",\n \"deleted\": true\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/responses/{response_id}/cancel": {
+ "post": {
+ "operationId": "cancelResponse",
+ "summary": "Cancel a model response",
+ "description": "Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.",
+ "parameters": [
+ {
+ "name": "response_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the response to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "headers": {
+ "x-agent-session-id": {
+ "required": false,
+ "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Response"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel a response",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/responses/resp_123/cancel \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst response = await client.responses.cancel(\"resp_123\");\nconsole.log(response);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.responses.cancel(\n \"resp_677efb5139a88190b512bc3fef8e535d\",\n)\nprint(response.id)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.cancel('resp_677efb5139a88190b512bc3fef8e535d');\n\nconsole.log(response.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Responses.Cancel(context.TODO(), \"resp_677efb5139a88190b512bc3fef8e535d\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.Response;\nimport com.openai.models.responses.ResponseCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Response response = client.responses().cancel(\"resp_677efb5139a88190b512bc3fef8e535d\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.responses.cancel(\"resp_677efb5139a88190b512bc3fef8e535d\")\n\nputs(response)"
+ },
+ "response": "{\n \"id\": \"resp_67cb71b351908190a308f3859487620d06981a8637e6bc44\",\n \"object\": \"response\",\n \"created_at\": 1741386163,\n \"status\": \"cancelled\",\n \"background\": true,\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [\n {\n \"type\": \"message\",\n \"id\": \"msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44\",\n \"status\": \"in_progress\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"Silent circuits hum,\nThoughts emerge in data streams—\nDigital dawn breaks.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/responses/{response_id}/input_items": {
+ "get": {
+ "operationId": "listInputItems",
+ "summary": "List input items for a response",
+ "description": "Retrieves the input items associated with the specified response.",
+ "parameters": [
+ {
+ "name": "response_id",
+ "in": "path",
+ "required": true,
+ "description": "The response id path parameter.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "x-ms-user-identity",
+ "in": "header",
+ "required": false,
+ "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "headers": {
+ "x-agent-session-id": {
+ "required": false,
+ "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Responses"
+ ],
+ "x-oaiMeta": {
+ "name": "List input items",
+ "group": "responses",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/responses/resp_abc123/input_items \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from \"openai\";\nconst client = new OpenAI();\n\nconst response = await client.responses.inputItems.list(\"resp_123\");\nconsole.log(response.data);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.responses.input_items.list(\n response_id=\"response_id\",\n)\npage = page.data[0]\nprint(page)",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const responseItem of client.responses.inputItems.list('response_id')) {\n console.log(responseItem);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n\t\"github.com/openai/openai-go/responses\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Responses.InputItems.List(\n\t\tcontext.TODO(),\n\t\t\"response_id\",\n\t\tresponses.InputItemListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.responses.inputitems.InputItemListPage;\nimport com.openai.models.responses.inputitems.InputItemListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n InputItemListPage page = client.responses().inputItems().list(\"response_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.responses.input_items.list(\"response_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"msg_abc123\",\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Tell me a three sentence bedtime story about a unicorn.\"\n }\n ]\n }\n ],\n \"first_id\": \"msg_abc123\",\n \"last_id\": \"msg_abc123\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/threads": {
+ "post": {
+ "operationId": "Threads_createThread",
+ "summary": "Create a thread",
+ "description": "Creates a thread from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create thread",
+ "group": "threads",
+ "beta": true,
+ "examples": [
+ {
+ "title": "Empty",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d ''\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.beta.threads.create()\nprint(thread.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const emptyThread = await openai.beta.threads.create();\n\n console.log(emptyThread);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.beta.threads.create();\n\nconsole.log(thread.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", thread.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.Thread;\nimport com.openai.models.beta.threads.ThreadCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Thread thread = client.beta().threads().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread = openai.beta.threads.create\n\nputs(thread)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1699012949,\n \"metadata\": {},\n \"tool_resources\": {}\n}\n"
+ },
+ {
+ "title": "Messages",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n-H \"OpenAI-Beta: assistants=v2\" \\\n-d '{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": \"Hello, what is AI?\"\n }, {\n \"role\": \"user\",\n \"content\": \"How does AI work? Explain it in simple terms.\"\n }]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.beta.threads.create()\nprint(thread.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const messageThread = await openai.beta.threads.create({\n messages: [\n {\n role: \"user\",\n content: \"Hello, what is AI?\"\n },\n {\n role: \"user\",\n content: \"How does AI work? Explain it in simple terms.\",\n },\n ],\n });\n\n console.log(messageThread);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.beta.threads.create();\n\nconsole.log(thread.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", thread.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.Thread;\nimport com.openai.models.beta.threads.ThreadCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Thread thread = client.beta().threads().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread = openai.beta.threads.create\n\nputs(thread)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1699014083,\n \"metadata\": {},\n \"tool_resources\": {}\n}\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/threads/runs": {
+ "post": {
+ "operationId": "Threads_createThreadAndRun",
+ "summary": "Create a thread and run",
+ "description": "Creates a thread and run from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create thread and run",
+ "group": "threads",
+ "beta": true,
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_abc123\",\n \"thread\": {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Explain deep learning to a 5 year old.\"}\n ]\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor thread in client.beta.threads.create_and_run(\n assistant_id=\"assistant_id\",\n):\n print(thread)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.createAndRun({\n assistant_id: \"asst_abc123\",\n thread: {\n messages: [\n { role: \"user\", content: \"Explain deep learning to a 5 year old.\" },\n ],\n },\n });\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{\n\t\tAssistantID: \"assistant_id\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.ThreadCreateAndRunParams;\nimport com.openai.models.beta.threads.runs.Run;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().createAndRun(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.create_and_run(assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699076792,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"queued\",\n \"started_at\": null,\n \"expires_at\": 1699077392,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": null,\n \"required_action\": null,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant.\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completion_tokens\": null,\n \"max_prompt_tokens\": null,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"incomplete_details\": null,\n \"usage\": null,\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_123\",\n \"thread\": {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello\"}\n ]\n },\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor thread in client.beta.threads.create_and_run(\n assistant_id=\"assistant_id\",\n):\n print(thread)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const stream = await openai.beta.threads.createAndRun({\n assistant_id: \"asst_123\",\n thread: {\n messages: [\n { role: \"user\", content: \"Hello\" },\n ],\n },\n stream: true\n });\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{\n\t\tAssistantID: \"assistant_id\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.ThreadCreateAndRunParams;\nimport com.openai.models.beta.threads.runs.Run;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().createAndRun(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.create_and_run(assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "event: thread.created\ndata: {\"id\":\"thread_123\",\"object\":\"thread\",\"created_at\":1710348075,\"metadata\":{}}\n\nevent: thread.run.created\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"tool_resources\":{},\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"tool_resources\":{},\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"tool_resources\":{},\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.message.created\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[], \"metadata\":{}}\n\nevent: thread.message.in_progress\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[], \"metadata\":{}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"Hello\",\"annotations\":[]}}]}}\n\n...\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" today\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"?\"}}]}}\n\nevent: thread.message.completed\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"completed\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":1710348077,\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":{\"value\":\"Hello! How can I assist you today?\",\"annotations\":[]}}], \"metadata\":{}}\n\nevent: thread.run.step.completed\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710348077,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31}}\n\nevent: thread.run.completed\n{\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"completed\",\"started_at\":1713226836,\"expires_at\":null,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":1713226837,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":345,\"completion_tokens\":11,\"total_tokens\":356},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}\n\nevent: done\ndata: [DONE]\n"
+ },
+ {
+ "title": "Streaming with Functions",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_abc123\",\n \"thread\": {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"What is the weather like in San Francisco?\"}\n ]\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\"]\n }\n }\n }\n ],\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor thread in client.beta.threads.create_and_run(\n assistant_id=\"assistant_id\",\n):\n print(thread)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst tools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \"required\": [\"location\"],\n },\n }\n }\n];\n\nasync function main() {\n const stream = await openai.beta.threads.createAndRun({\n assistant_id: \"asst_123\",\n thread: {\n messages: [\n { role: \"user\", content: \"What is the weather like in San Francisco?\" },\n ],\n },\n tools: tools,\n stream: true\n });\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{\n\t\tAssistantID: \"assistant_id\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.ThreadCreateAndRunParams;\nimport com.openai.models.beta.threads.runs.Run;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().createAndRun(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.create_and_run(assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "event: thread.created\ndata: {\"id\":\"thread_123\",\"object\":\"thread\",\"created_at\":1710351818,\"metadata\":{}}\n\nevent: thread.run.created\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710351818,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710352418,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710351818,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710352418,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710351818,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":1710351818,\"expires_at\":1710352418,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710351819,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"tool_calls\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710352418,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[]},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710351819,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"tool_calls\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710352418,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[]},\"usage\":null}\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"id\":\"call_XXNp8YGaFrjrSjgqxtC8JJ1B\",\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"arguments\":\"\",\"output\":null}}]}}}\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"type\":\"function\",\"function\":{\"arguments\":\"{\"\"}}]}}}\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"type\":\"function\",\"function\":{\"arguments\":\"location\"}}]}}}\n\n...\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"type\":\"function\",\"function\":{\"arguments\":\"ahrenheit\"}}]}}}\n\nevent: thread.run.step.delta\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step.delta\",\"delta\":{\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"index\":0,\"type\":\"function\",\"function\":{\"arguments\":\"\"}\"}}]}}}\n\nevent: thread.run.requires_action\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710351818,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"requires_action\",\"started_at\":1710351818,\"expires_at\":1710352418,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":{\"type\":\"submit_tool_outputs\",\"submit_tool_outputs\":{\"tool_calls\":[{\"id\":\"call_XXNp8YGaFrjrSjgqxtC8JJ1B\",\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"arguments\":\"{\"location\":\"San Francisco, CA\",\"unit\":\"fahrenheit\"}\"}}]}},\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":345,\"completion_tokens\":11,\"total_tokens\":356},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: done\ndata: [DONE]\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}": {
+ "delete": {
+ "operationId": "Threads_deleteThread",
+ "summary": "Delete a thread",
+ "description": "Deletes a thread by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteThreadResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete thread",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread_deleted = client.beta.threads.delete(\n \"thread_id\",\n)\nprint(thread_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const response = await openai.beta.threads.delete(\"thread_abc123\");\n\n console.log(response);\n}\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst threadDeleted = await client.beta.threads.delete('thread_id');\n\nconsole.log(threadDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthreadDeleted, err := client.Beta.Threads.Delete(context.TODO(), \"thread_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", threadDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.ThreadDeleteParams;\nimport com.openai.models.beta.threads.ThreadDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n ThreadDeleted threadDeleted = client.beta().threads().delete(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread_deleted = openai.beta.threads.delete(\"thread_id\")\n\nputs(thread_deleted)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Threads_getThread",
+ "summary": "Get a thread",
+ "description": "Retrieves a thread by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve thread",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.beta.threads.retrieve(\n \"thread_id\",\n)\nprint(thread.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const myThread = await openai.beta.threads.retrieve(\n \"thread_abc123\"\n );\n\n console.log(myThread);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.beta.threads.retrieve('thread_id');\n\nconsole.log(thread.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Beta.Threads.Get(context.TODO(), \"thread_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", thread.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.Thread;\nimport com.openai.models.beta.threads.ThreadRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Thread thread = client.beta().threads().retrieve(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread = openai.beta.threads.retrieve(\"thread_id\")\n\nputs(thread)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1699014083,\n \"metadata\": {},\n \"tool_resources\": {\n \"code_interpreter\": {\n \"file_ids\": []\n }\n }\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Threads_modifyThread",
+ "summary": "Update a thread",
+ "description": "Updates a thread with the supplied changes.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to modify. Only the `metadata` can be modified.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ModifyThreadRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Modify thread",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"metadata\": {\n \"modified\": \"true\",\n \"user\": \"abc123\"\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nthread = client.beta.threads.update(\n thread_id=\"thread_id\",\n)\nprint(thread.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const updatedThread = await openai.beta.threads.update(\n \"thread_abc123\",\n {\n metadata: { modified: \"true\", user: \"abc123\" },\n }\n );\n\n console.log(updatedThread);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst thread = await client.beta.threads.update('thread_id');\n\nconsole.log(thread.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tthread, err := client.Beta.Threads.Update(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", thread.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.Thread;\nimport com.openai.models.beta.threads.ThreadUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Thread thread = client.beta().threads().update(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nthread = openai.beta.threads.update(\"thread_id\")\n\nputs(thread)"
+ },
+ "response": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1699014083,\n \"metadata\": {\n \"modified\": \"true\",\n \"user\": \"abc123\"\n },\n \"tool_resources\": {}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/messages": {
+ "get": {
+ "operationId": "Threads_listMessages",
+ "summary": "List messages",
+ "description": "Lists messages matching the request filters.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) the messages belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "query",
+ "required": false,
+ "description": "Filter messages by the run ID that generated them.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListMessagesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "List messages",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.beta.threads.messages.list(\n thread_id=\"thread_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const threadMessages = await openai.beta.threads.messages.list(\n \"thread_abc123\"\n );\n\n console.log(threadMessages.data);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const message of client.beta.threads.messages.list('thread_id')) {\n console.log(message.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Beta.Threads.Messages.List(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadMessageListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.MessageListPage;\nimport com.openai.models.beta.threads.messages.MessageListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageListPage page = client.beta().threads().messages().list(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.beta.threads.messages.list(\"thread_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1699016383,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"How does AI work? Explain it in simple terms.\",\n \"annotations\": []\n }\n }\n ],\n \"attachments\": [],\n \"metadata\": {}\n },\n {\n \"id\": \"msg_abc456\",\n \"object\": \"thread.message\",\n \"created_at\": 1699016383,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"Hello, what is AI?\",\n \"annotations\": []\n }\n }\n ],\n \"attachments\": [],\n \"metadata\": {}\n }\n ],\n \"first_id\": \"msg_abc123\",\n \"last_id\": \"msg_abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Threads_createMessage",
+ "summary": "Create a message",
+ "description": "Creates a message from the supplied request.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) to create a message for.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.MessageObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateMessageRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create message",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"role\": \"user\",\n \"content\": \"How does AI work? Explain it in simple terms.\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.beta.threads.messages.create(\n thread_id=\"thread_id\",\n content=\"string\",\n role=\"user\",\n)\nprint(message.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const threadMessages = await openai.beta.threads.messages.create(\n \"thread_abc123\",\n { role: \"user\", content: \"How does AI work? Explain it in simple terms.\" }\n );\n\n console.log(threadMessages);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.beta.threads.messages.create('thread_id', {\n content: 'string',\n role: 'user',\n});\n\nconsole.log(message.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmessage, err := client.Beta.Threads.Messages.New(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadMessageNewParams{\n\t\t\tContent: openai.BetaThreadMessageNewParamsContentUnion{\n\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t},\n\t\t\tRole: openai.BetaThreadMessageNewParamsRoleUser,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", message.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.Message;\nimport com.openai.models.beta.threads.messages.MessageCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageCreateParams params = MessageCreateParams.builder()\n .threadId(\"thread_id\")\n .content(\"string\")\n .role(MessageCreateParams.Role.USER)\n .build();\n Message message = client.beta().threads().messages().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmessage = openai.beta.threads.messages.create(\"thread_id\", content: \"string\", role: :user)\n\nputs(message)"
+ },
+ "response": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1713226573,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"How does AI work? Explain it in simple terms.\",\n \"annotations\": []\n }\n }\n ],\n \"attachments\": [],\n \"metadata\": {}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/messages/{message_id}": {
+ "delete": {
+ "operationId": "Threads_deleteMessage",
+ "summary": "Delete a message",
+ "description": "Deletes a message by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to which this message belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "message_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the message to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteMessageResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete message",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmessage_deleted = client.beta.threads.messages.delete(\n message_id=\"message_id\",\n thread_id=\"thread_id\",\n)\nprint(message_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const deletedMessage = await openai.beta.threads.messages.delete(\n \"msg_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n\n console.log(deletedMessage);\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst messageDeleted = await client.beta.threads.messages.delete('message_id', {\n thread_id: 'thread_id',\n});\n\nconsole.log(messageDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmessageDeleted, err := client.Beta.Threads.Messages.Delete(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"message_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", messageDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.MessageDeleteParams;\nimport com.openai.models.beta.threads.messages.MessageDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageDeleteParams params = MessageDeleteParams.builder()\n .threadId(\"thread_id\")\n .messageId(\"message_id\")\n .build();\n MessageDeleted messageDeleted = client.beta().threads().messages().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmessage_deleted = openai.beta.threads.messages.delete(\"message_id\", thread_id: \"thread_id\")\n\nputs(message_deleted)"
+ },
+ "response": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message.deleted\",\n \"deleted\": true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "Threads_getMessage",
+ "summary": "Get a message",
+ "description": "Retrieves a message by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) to which this message belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "message_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the message to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.MessageObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve message",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.beta.threads.messages.retrieve(\n message_id=\"message_id\",\n thread_id=\"thread_id\",\n)\nprint(message.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const message = await openai.beta.threads.messages.retrieve(\n \"msg_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n\n console.log(message);\n}\n\nmain();",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.beta.threads.messages.retrieve('message_id', {\n thread_id: 'thread_id',\n});\n\nconsole.log(message.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmessage, err := client.Beta.Threads.Messages.Get(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"message_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", message.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.Message;\nimport com.openai.models.beta.threads.messages.MessageRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageRetrieveParams params = MessageRetrieveParams.builder()\n .threadId(\"thread_id\")\n .messageId(\"message_id\")\n .build();\n Message message = client.beta().threads().messages().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmessage = openai.beta.threads.messages.retrieve(\"message_id\", thread_id: \"thread_id\")\n\nputs(message)"
+ },
+ "response": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1699017614,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"How does AI work? Explain it in simple terms.\",\n \"annotations\": []\n }\n }\n ],\n \"attachments\": [],\n \"metadata\": {}\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Threads_modifyMessage",
+ "summary": "Update a message",
+ "description": "Updates a message with the supplied changes.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to which this message belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "message_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the message to modify.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.MessageObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ModifyMessageRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Modify message",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"metadata\": {\n \"modified\": \"true\",\n \"user\": \"abc123\"\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.beta.threads.messages.update(\n message_id=\"message_id\",\n thread_id=\"thread_id\",\n)\nprint(message.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const message = await openai.beta.threads.messages.update(\n \"thread_abc123\",\n \"msg_abc123\",\n {\n metadata: {\n modified: \"true\",\n user: \"abc123\",\n },\n }\n }'",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.beta.threads.messages.update('message_id', { thread_id: 'thread_id' });\n\nconsole.log(message.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmessage, err := client.Beta.Threads.Messages.Update(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"message_id\",\n\t\topenai.BetaThreadMessageUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", message.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.messages.Message;\nimport com.openai.models.beta.threads.messages.MessageUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n MessageUpdateParams params = MessageUpdateParams.builder()\n .threadId(\"thread_id\")\n .messageId(\"message_id\")\n .build();\n Message message = client.beta().threads().messages().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nmessage = openai.beta.threads.messages.update(\"message_id\", thread_id: \"thread_id\")\n\nputs(message)"
+ },
+ "response": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1699017614,\n \"assistant_id\": null,\n \"thread_id\": \"thread_abc123\",\n \"run_id\": null,\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"How does AI work? Explain it in simple terms.\",\n \"annotations\": []\n }\n }\n ],\n \"file_ids\": [],\n \"metadata\": {\n \"modified\": \"true\",\n \"user\": \"abc123\"\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs": {
+ "get": {
+ "operationId": "Threads_listRuns",
+ "summary": "List runs",
+ "description": "Lists runs matching the request filters.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread the run belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListRunsResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "List runs",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.beta.threads.runs.list(\n thread_id=\"thread_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const runs = await openai.beta.threads.runs.list(\n \"thread_abc123\"\n );\n\n console.log(runs);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const run of client.beta.threads.runs.list('thread_id')) {\n console.log(run.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Beta.Threads.Runs.List(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadRunListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.RunListPage;\nimport com.openai.models.beta.threads.runs.RunListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunListPage page = client.beta().threads().runs().list(\"thread_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.beta.threads.runs.list(\"thread_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699075072,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699075072,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699075073,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"tool_resources\": {\n \"code_interpreter\": {\n \"file_ids\": [\n \"file-abc123\",\n \"file-abc456\"\n ]\n }\n },\n \"metadata\": {},\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n },\n {\n \"id\": \"run_abc456\",\n \"object\": \"thread.run\",\n \"created_at\": 1699063290,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699063290,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699063291,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"tool_resources\": {\n \"code_interpreter\": {\n \"file_ids\": [\n \"file-abc123\",\n \"file-abc456\"\n ]\n }\n },\n \"metadata\": {},\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n }\n ],\n \"first_id\": \"run_abc123\",\n \"last_id\": \"run_abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "Threads_createRun",
+ "summary": "Create a run",
+ "description": "Creates a run from the supplied request.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include[]",
+ "in": "query",
+ "required": false,
+ "description": "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.\n See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "step_details.tool_calls[*].file_search.results[*].content"
+ ]
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateRunRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create run",
+ "group": "threads",
+ "beta": true,
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_abc123\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.create(\n thread_id=\"thread_id\",\n assistant_id=\"assistant_id\",\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.create(\n \"thread_abc123\",\n { assistant_id: \"asst_abc123\" }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.New(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadRunNewParams{\n\t\t\tAssistantID: \"assistant_id\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCreateParams params = RunCreateParams.builder()\n .threadId(\"thread_id\")\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().runs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.create(\"thread_id\", assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699063290,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"queued\",\n \"started_at\": 1699063290,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699063291,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"metadata\": {},\n \"usage\": null,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_123/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_123\",\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.create(\n thread_id=\"thread_id\",\n assistant_id=\"assistant_id\",\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const stream = await openai.beta.threads.runs.create(\n \"thread_123\",\n { assistant_id: \"asst_123\", stream: true }\n );\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.New(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadRunNewParams{\n\t\t\tAssistantID: \"assistant_id\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCreateParams params = RunCreateParams.builder()\n .threadId(\"thread_id\")\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().runs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.create(\"thread_id\", assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "event: thread.run.created\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710330640,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710331240,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710330640,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710331240,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710330640,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":1710330641,\"expires_at\":1710331240,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710330641,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710331240,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710330641,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710331240,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.message.created\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710330641,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.in_progress\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710330641,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"Hello\",\"annotations\":[]}}]}}\n\n...\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" today\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"?\"}}]}}\n\nevent: thread.message.completed\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710330641,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"completed\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":1710330642,\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":{\"value\":\"Hello! How can I assist you today?\",\"annotations\":[]}}],\"metadata\":{}}\n\nevent: thread.run.step.completed\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710330641,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710330642,\"expires_at\":1710331240,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31}}\n\nevent: thread.run.completed\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710330640,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"completed\",\"started_at\":1710330641,\"expires_at\":null,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":1710330642,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: done\ndata: [DONE]\n"
+ },
+ {
+ "title": "Streaming with Functions",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"assistant_id\": \"asst_abc123\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\"]\n }\n }\n }\n ],\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.create(\n thread_id=\"thread_id\",\n assistant_id=\"assistant_id\",\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst tools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\",\n },\n \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n },\n \"required\": [\"location\"],\n },\n }\n }\n];\n\nasync function main() {\n const stream = await openai.beta.threads.runs.create(\n \"thread_abc123\",\n {\n assistant_id: \"asst_abc123\",\n tools: tools,\n stream: true\n }\n );\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.New(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\topenai.BetaThreadRunNewParams{\n\t\t\tAssistantID: \"assistant_id\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCreateParams params = RunCreateParams.builder()\n .threadId(\"thread_id\")\n .assistantId(\"assistant_id\")\n .build();\n Run run = client.beta().threads().runs().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.create(\"thread_id\", assistant_id: \"assistant_id\")\n\nputs(run)"
+ },
+ "response": "event: thread.run.created\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":null,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":1710348075,\"expires_at\":1710348675,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":null}\n\nevent: thread.message.created\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.in_progress\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"Hello\",\"annotations\":[]}}]}}\n\n...\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" today\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"?\"}}]}}\n\nevent: thread.message.completed\ndata: {\"id\":\"msg_001\",\"object\":\"thread.message\",\"created_at\":1710348076,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"completed\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":1710348077,\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":{\"value\":\"Hello! How can I assist you today?\",\"annotations\":[]}}],\"metadata\":{}}\n\nevent: thread.run.step.completed\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710348076,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710348077,\"expires_at\":1710348675,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_001\"}},\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31}}\n\nevent: thread.run.completed\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710348075,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"completed\",\"started_at\":1710348075,\"expires_at\":null,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":1710348077,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: done\ndata: [DONE]\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}": {
+ "get": {
+ "operationId": "Threads_getRun",
+ "summary": "Get a run",
+ "description": "Retrieves a run by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) that was run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve run",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.beta.threads.runs.retrieve(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.retrieve(\n \"run_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.retrieve('run_id', { thread_id: 'thread_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.Get(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunRetrieveParams params = RunRetrieveParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .build();\n Run run = client.beta().threads().runs().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.retrieve(\"run_id\", thread_id: \"thread_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699075072,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699075072,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699075073,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"metadata\": {},\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "Threads_modifyRun",
+ "summary": "Update a run",
+ "description": "Updates a run with the supplied changes.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) that was run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to modify.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ModifyRunRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Modify run",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"metadata\": {\n \"user_id\": \"user_abc123\"\n }\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.beta.threads.runs.update(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.update(\n \"run_abc123\",\n {\n thread_id: \"thread_abc123\",\n metadata: {\n user_id: \"user_abc123\",\n },\n }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.update('run_id', { thread_id: 'thread_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.Update(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\topenai.BetaThreadRunUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunUpdateParams params = RunUpdateParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .build();\n Run run = client.beta().threads().runs().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.update(\"run_id\", thread_id: \"thread_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699075072,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699075072,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699075073,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"incomplete_details\": null,\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"tool_resources\": {\n \"code_interpreter\": {\n \"file_ids\": [\n \"file-abc123\",\n \"file-abc456\"\n ]\n }\n },\n \"metadata\": {\n \"user_id\": \"user_abc123\"\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}/cancel": {
+ "post": {
+ "operationId": "Threads_cancelRun",
+ "summary": "Cancel a run",
+ "description": "Cancels a run by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to which this run belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel a run",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X POST\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun = client.beta.threads.runs.cancel(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n)\nprint(run.id)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.cancel(\n \"run_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.cancel('run_id', { thread_id: 'thread_id' });\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.Cancel(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunCancelParams params = RunCancelParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .build();\n Run run = client.beta().threads().runs().cancel(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.cancel(\"run_id\", thread_id: \"thread_id\")\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699076126,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"cancelling\",\n \"started_at\": 1699076126,\n \"expires_at\": 1699076726,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": null,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You summarize books.\",\n \"tools\": [\n {\n \"type\": \"file_search\"\n }\n ],\n \"tool_resources\": {\n \"file_search\": {\n \"vector_store_ids\": [\"vs_123\"]\n }\n },\n \"metadata\": {},\n \"usage\": null,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}/steps": {
+ "get": {
+ "operationId": "Threads_listRunSteps",
+ "summary": "List run steps",
+ "description": "Lists run steps matching the request filters.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread the run and run steps belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run the run steps belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include[]",
+ "in": "query",
+ "required": false,
+ "description": "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.\n See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "step_details.tool_calls[*].file_search.results[*].content"
+ ]
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListRunStepsResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "List run steps",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.beta.threads.runs.steps.list(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const runStep = await openai.beta.threads.runs.steps.list(\n \"run_abc123\",\n { thread_id: \"thread_abc123\" }\n );\n console.log(runStep);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const runStep of client.beta.threads.runs.steps.list('run_id', {\n thread_id: 'thread_id',\n})) {\n console.log(runStep.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Beta.Threads.Runs.Steps.List(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\topenai.BetaThreadRunStepListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.steps.StepListPage;\nimport com.openai.models.beta.threads.runs.steps.StepListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n StepListParams params = StepListParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .build();\n StepListPage page = client.beta().threads().runs().steps().list(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.beta.threads.runs.steps.list(\"run_id\", thread_id: \"thread_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"step_abc123\",\n \"object\": \"thread.run.step\",\n \"created_at\": 1699063291,\n \"run_id\": \"run_abc123\",\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"type\": \"message_creation\",\n \"status\": \"completed\",\n \"cancelled_at\": null,\n \"completed_at\": 1699063291,\n \"expired_at\": null,\n \"failed_at\": null,\n \"last_error\": null,\n \"step_details\": {\n \"type\": \"message_creation\",\n \"message_creation\": {\n \"message_id\": \"msg_abc123\"\n }\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n }\n }\n ],\n \"first_id\": \"step_abc123\",\n \"last_id\": \"step_abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}": {
+ "get": {
+ "operationId": "Threads_getRunStep",
+ "summary": "Get a run step",
+ "description": "Retrieves a run step by its identifier.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the thread to which the run and run step belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run to which the run step belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "step_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run step to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "include[]",
+ "in": "query",
+ "required": false,
+ "description": "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.\n See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "step_details.tool_calls[*].file_search.results[*].content"
+ ]
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunStepObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve run step",
+ "group": "threads",
+ "beta": true,
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nrun_step = client.beta.threads.runs.steps.retrieve(\n step_id=\"step_id\",\n thread_id=\"thread_id\",\n run_id=\"run_id\",\n)\nprint(run_step.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const runStep = await openai.beta.threads.runs.steps.retrieve(\n \"step_abc123\",\n { thread_id: \"thread_abc123\", run_id: \"run_abc123\" }\n );\n console.log(runStep);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst runStep = await client.beta.threads.runs.steps.retrieve('step_id', {\n thread_id: 'thread_id',\n run_id: 'run_id',\n});\n\nconsole.log(runStep.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trunStep, err := client.Beta.Threads.Runs.Steps.Get(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\t\"step_id\",\n\t\topenai.BetaThreadRunStepGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", runStep.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.steps.RunStep;\nimport com.openai.models.beta.threads.runs.steps.StepRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n StepRetrieveParams params = StepRetrieveParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .stepId(\"step_id\")\n .build();\n RunStep runStep = client.beta().threads().runs().steps().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun_step = openai.beta.threads.runs.steps.retrieve(\"step_id\", thread_id: \"thread_id\", run_id: \"run_id\")\n\nputs(run_step)"
+ },
+ "response": "{\n \"id\": \"step_abc123\",\n \"object\": \"thread.run.step\",\n \"created_at\": 1699063291,\n \"run_id\": \"run_abc123\",\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"type\": \"message_creation\",\n \"status\": \"completed\",\n \"cancelled_at\": null,\n \"completed_at\": 1699063291,\n \"expired_at\": null,\n \"failed_at\": null,\n \"last_error\": null,\n \"step_details\": {\n \"type\": \"message_creation\",\n \"message_creation\": {\n \"message_id\": \"msg_abc123\"\n }\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs": {
+ "post": {
+ "operationId": "Threads_submitToolOuputsToRun",
+ "summary": "Create a tool ouputs to run",
+ "description": "Creates a tool ouputs to run from the supplied request.",
+ "parameters": [
+ {
+ "name": "thread_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the [thread](/docs/api-reference/threads) to which this run belongs.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the run that requires the tool output submission.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Threads",
+ "Assistants"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.SubmitToolOutputsRunRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Submit tool outputs to run",
+ "group": "threads",
+ "beta": true,
+ "examples": [
+ {
+ "title": "Default",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"tool_outputs\": [\n {\n \"tool_call_id\": \"call_001\",\n \"output\": \"70 degrees and sunny.\"\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.submit_tool_outputs(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n tool_outputs=[{}],\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const run = await openai.beta.threads.runs.submitToolOutputs(\n \"run_123\",\n {\n thread_id: \"thread_123\",\n tool_outputs: [\n {\n tool_call_id: \"call_001\",\n output: \"70 degrees and sunny.\",\n },\n ],\n }\n );\n\n console.log(run);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.submitToolOutputs('run_id', {\n thread_id: 'thread_id',\n tool_outputs: [{}],\n});\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.SubmitToolOutputs(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\topenai.BetaThreadRunSubmitToolOutputsParams{\n\t\t\tToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())\n .build();\n Run run = client.beta().threads().runs().submitToolOutputs(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.submit_tool_outputs(\"run_id\", thread_id: \"thread_id\", tool_outputs: [{}])\n\nputs(run)"
+ },
+ "response": "{\n \"id\": \"run_123\",\n \"object\": \"thread.run\",\n \"created_at\": 1699075592,\n \"assistant_id\": \"asst_123\",\n \"thread_id\": \"thread_123\",\n \"status\": \"queued\",\n \"started_at\": 1699075592,\n \"expires_at\": 1699076192,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": null,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"description\": \"Get the current weather in a given location\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"location\": {\n \"type\": \"string\",\n \"description\": \"The city and state, e.g. San Francisco, CA\"\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"]\n }\n },\n \"required\": [\"location\"]\n }\n }\n }\n ],\n \"metadata\": {},\n \"usage\": null,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
+ },
+ {
+ "title": "Streaming",
+ "request": {
+ "curl": "curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"tool_outputs\": [\n {\n \"tool_call_id\": \"call_001\",\n \"output\": \"70 degrees and sunny.\"\n }\n ],\n \"stream\": true\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfor run in client.beta.threads.runs.submit_tool_outputs(\n run_id=\"run_id\",\n thread_id=\"thread_id\",\n tool_outputs=[{}],\n):\n print(run)",
+ "javascript": "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const stream = await openai.beta.threads.runs.submitToolOutputs(\n \"run_123\",\n {\n thread_id: \"thread_123\",\n tool_outputs: [\n {\n tool_call_id: \"call_001\",\n output: \"70 degrees and sunny.\",\n },\n ],\n }\n );\n\n for await (const event of stream) {\n console.log(event);\n }\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst run = await client.beta.threads.runs.submitToolOutputs('run_id', {\n thread_id: 'thread_id',\n tool_outputs: [{}],\n});\n\nconsole.log(run.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\trun, err := client.Beta.Threads.Runs.SubmitToolOutputs(\n\t\tcontext.TODO(),\n\t\t\"thread_id\",\n\t\t\"run_id\",\n\t\topenai.BetaThreadRunSubmitToolOutputsParams{\n\t\t\tToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", run.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.beta.threads.runs.Run;\nimport com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()\n .threadId(\"thread_id\")\n .runId(\"run_id\")\n .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())\n .build();\n Run run = client.beta().threads().runs().submitToolOutputs(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nrun = openai.beta.threads.runs.submit_tool_outputs(\"run_id\", thread_id: \"thread_id\", tool_outputs: [{}])\n\nputs(run)"
+ },
+ "response": "event: thread.run.step.completed\ndata: {\"id\":\"step_001\",\"object\":\"thread.run.step\",\"created_at\":1710352449,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"tool_calls\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710352475,\"expires_at\":1710353047,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"tool_calls\",\"tool_calls\":[{\"id\":\"call_iWr0kQ2EaYMaxNdl0v3KYkx7\",\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"arguments\":\"{\"location\":\"San Francisco, CA\",\"unit\":\"fahrenheit\"}\",\"output\":\"70 degrees and sunny.\"}}]},\"usage\":{\"prompt_tokens\":291,\"completion_tokens\":24,\"total_tokens\":315}}\n\nevent: thread.run.queued\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710352447,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"queued\",\"started_at\":1710352448,\"expires_at\":1710353047,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.in_progress\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710352447,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"in_progress\",\"started_at\":1710352475,\"expires_at\":1710353047,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":null,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":null,\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: thread.run.step.created\ndata: {\"id\":\"step_002\",\"object\":\"thread.run.step\",\"created_at\":1710352476,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710353047,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_002\"}},\"usage\":null}\n\nevent: thread.run.step.in_progress\ndata: {\"id\":\"step_002\",\"object\":\"thread.run.step\",\"created_at\":1710352476,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"in_progress\",\"cancelled_at\":null,\"completed_at\":null,\"expires_at\":1710353047,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_002\"}},\"usage\":null}\n\nevent: thread.message.created\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message\",\"created_at\":1710352476,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.in_progress\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message\",\"created_at\":1710352476,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"in_progress\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":null,\"role\":\"assistant\",\"content\":[],\"metadata\":{}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\"The\",\"annotations\":[]}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" current\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" weather\"}}]}}\n\n...\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\" sunny\"}}]}}\n\nevent: thread.message.delta\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message.delta\",\"delta\":{\"content\":[{\"index\":0,\"type\":\"text\",\"text\":{\"value\":\".\"}}]}}\n\nevent: thread.message.completed\ndata: {\"id\":\"msg_002\",\"object\":\"thread.message\",\"created_at\":1710352476,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"run_id\":\"run_123\",\"status\":\"completed\",\"incomplete_details\":null,\"incomplete_at\":null,\"completed_at\":1710352477,\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":{\"value\":\"The current weather in San Francisco, CA is 70 degrees Fahrenheit and sunny.\",\"annotations\":[]}}],\"metadata\":{}}\n\nevent: thread.run.step.completed\ndata: {\"id\":\"step_002\",\"object\":\"thread.run.step\",\"created_at\":1710352476,\"run_id\":\"run_123\",\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"type\":\"message_creation\",\"status\":\"completed\",\"cancelled_at\":null,\"completed_at\":1710352477,\"expires_at\":1710353047,\"failed_at\":null,\"last_error\":null,\"step_details\":{\"type\":\"message_creation\",\"message_creation\":{\"message_id\":\"msg_002\"}},\"usage\":{\"prompt_tokens\":329,\"completion_tokens\":18,\"total_tokens\":347}}\n\nevent: thread.run.completed\ndata: {\"id\":\"run_123\",\"object\":\"thread.run\",\"created_at\":1710352447,\"assistant_id\":\"asst_123\",\"thread_id\":\"thread_123\",\"status\":\"completed\",\"started_at\":1710352475,\"expires_at\":null,\"cancelled_at\":null,\"failed_at\":null,\"completed_at\":1710352477,\"required_action\":null,\"last_error\":null,\"model\":\"gpt-4o\",\"instructions\":null,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_current_weather\",\"description\":\"Get the current weather in a given location\",\"parameters\":{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"The city and state, e.g. San Francisco, CA\"},\"unit\":{\"type\":\"string\",\"enum\":[\"celsius\",\"fahrenheit\"]}},\"required\":[\"location\"]}}}],\"metadata\":{},\"temperature\":1.0,\"top_p\":1.0,\"max_completion_tokens\":null,\"max_prompt_tokens\":null,\"truncation_strategy\":{\"type\":\"auto\",\"last_messages\":null},\"incomplete_details\":null,\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":11,\"total_tokens\":31},\"response_format\":\"auto\",\"tool_choice\":\"auto\",\"parallel_tool_calls\":true}}\n\nevent: done\ndata: [DONE]\n"
+ }
+ ]
+ }
+ }
+ },
+ "/openai/v1/uploads": {
+ "post": {
+ "operationId": "Uploads_createUpload",
+ "summary": "Create an upload",
+ "description": "Creates an upload from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Upload"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Uploads"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateUploadRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create upload",
+ "group": "uploads",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/uploads \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"purpose\": \"fine-tune\",\n \"filename\": \"training_examples.jsonl\",\n \"bytes\": 2147483648,\n \"mime_type\": \"text/jsonl\",\n \"expires_after\": {\n \"anchor\": \"created_at\",\n \"seconds\": 3600\n }\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst upload = await client.uploads.create({\n bytes: 0,\n filename: 'filename',\n mime_type: 'mime_type',\n purpose: 'assistants',\n});\n\nconsole.log(upload.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nupload = client.uploads.create(\n bytes=0,\n filename=\"filename\",\n mime_type=\"mime_type\",\n purpose=\"assistants\",\n)\nprint(upload.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tupload, err := client.Uploads.New(context.TODO(), openai.UploadNewParams{\n\t\tBytes: 0,\n\t\tFilename: \"filename\",\n\t\tMimeType: \"mime_type\",\n\t\tPurpose: openai.FilePurposeAssistants,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", upload.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.files.FilePurpose;\nimport com.openai.models.uploads.Upload;\nimport com.openai.models.uploads.UploadCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n UploadCreateParams params = UploadCreateParams.builder()\n .bytes(0L)\n .filename(\"filename\")\n .mimeType(\"mime_type\")\n .purpose(FilePurpose.ASSISTANTS)\n .build();\n Upload upload = client.uploads().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nupload = openai.uploads.create(bytes: 0, filename: \"filename\", mime_type: \"mime_type\", purpose: :assistants)\n\nputs(upload)"
+ },
+ "response": "{\n \"id\": \"upload_abc123\",\n \"object\": \"upload\",\n \"bytes\": 2147483648,\n \"created_at\": 1719184911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n \"status\": \"pending\",\n \"expires_at\": 1719127296\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/uploads/{upload_id}/cancel": {
+ "post": {
+ "operationId": "Uploads_cancelUpload",
+ "summary": "Cancel an upload",
+ "description": "Cancels an upload by its identifier.",
+ "parameters": [
+ {
+ "name": "upload_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the Upload.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Upload"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Uploads"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel upload",
+ "group": "uploads",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/uploads/upload_abc123/cancel\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst upload = await client.uploads.cancel('upload_abc123');\n\nconsole.log(upload.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nupload = client.uploads.cancel(\n \"upload_abc123\",\n)\nprint(upload.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tupload, err := client.Uploads.Cancel(context.TODO(), \"upload_abc123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", upload.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.uploads.Upload;\nimport com.openai.models.uploads.UploadCancelParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Upload upload = client.uploads().cancel(\"upload_abc123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nupload = openai.uploads.cancel(\"upload_abc123\")\n\nputs(upload)"
+ },
+ "response": "{\n \"id\": \"upload_abc123\",\n \"object\": \"upload\",\n \"bytes\": 2147483648,\n \"created_at\": 1719184911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n \"status\": \"cancelled\",\n \"expires_at\": 1719127296\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/uploads/{upload_id}/complete": {
+ "post": {
+ "operationId": "Uploads_completeUpload",
+ "summary": "Create an upload",
+ "description": "Creates an upload from the supplied request.",
+ "parameters": [
+ {
+ "name": "upload_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the Upload.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.Upload"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Uploads"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CompleteUploadRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Complete upload",
+ "group": "uploads",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/uploads/upload_abc123/complete\n -d '{\n \"part_ids\": [\"part_def456\", \"part_ghi789\"]\n }'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst upload = await client.uploads.complete('upload_abc123', { part_ids: ['string'] });\n\nconsole.log(upload.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nupload = client.uploads.complete(\n upload_id=\"upload_abc123\",\n part_ids=[\"string\"],\n)\nprint(upload.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tupload, err := client.Uploads.Complete(\n\t\tcontext.TODO(),\n\t\t\"upload_abc123\",\n\t\topenai.UploadCompleteParams{\n\t\t\tPartIDs: []string{\"string\"},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", upload.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.uploads.Upload;\nimport com.openai.models.uploads.UploadCompleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n UploadCompleteParams params = UploadCompleteParams.builder()\n .uploadId(\"upload_abc123\")\n .addPartId(\"string\")\n .build();\n Upload upload = client.uploads().complete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nupload = openai.uploads.complete(\"upload_abc123\", part_ids: [\"string\"])\n\nputs(upload)"
+ },
+ "response": "{\n \"id\": \"upload_abc123\",\n \"object\": \"upload\",\n \"bytes\": 2147483648,\n \"created_at\": 1719184911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n \"status\": \"completed\",\n \"expires_at\": 1719127296,\n \"file\": {\n \"id\": \"file-xyz321\",\n \"object\": \"file\",\n \"bytes\": 2147483648,\n \"created_at\": 1719186911,\n \"expires_at\": 1719127296,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/uploads/{upload_id}/parts": {
+ "post": {
+ "operationId": "Uploads_addUploadPart",
+ "summary": "Add an upload part",
+ "description": "Adds an upload part to the parent resource.",
+ "parameters": [
+ {
+ "name": "upload_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the Upload.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UploadPart"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Uploads"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.AddUploadPartRequest"
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Add upload part",
+ "group": "uploads",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/uploads/upload_abc123/parts\n -F data=\"aHR0cHM6Ly9hcGkub3BlbmFpLmNvbS92MS91cGxvYWRz...\"\n",
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst uploadPart = await client.uploads.parts.create('upload_abc123', {\n data: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(uploadPart.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nupload_part = client.uploads.parts.create(\n upload_id=\"upload_abc123\",\n data=b\"Example data\",\n)\nprint(upload_part.id)",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tuploadPart, err := client.Uploads.Parts.New(\n\t\tcontext.TODO(),\n\t\t\"upload_abc123\",\n\t\topenai.UploadPartNewParams{\n\t\t\tData: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", uploadPart.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.uploads.parts.PartCreateParams;\nimport com.openai.models.uploads.parts.UploadPart;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PartCreateParams params = PartCreateParams.builder()\n .uploadId(\"upload_abc123\")\n .data(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n UploadPart uploadPart = client.uploads().parts().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nupload_part = openai.uploads.parts.create(\"upload_abc123\", data: StringIO.new(\"Example data\"))\n\nputs(upload_part)"
+ },
+ "response": "{\n \"id\": \"part_def456\",\n \"object\": \"upload.part\",\n \"created_at\": 1719185911,\n \"upload_id\": \"upload_abc123\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores": {
+ "get": {
+ "operationId": "VectorStores_listVectorStores",
+ "summary": "List vector stores",
+ "description": "Lists vector stores matching the request filters.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoresResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "List vector stores",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.list()\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStores = await openai.vectorStores.list();\n console.log(vectorStores);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vectorStore of client.vectorStores.list()) {\n console.log(vectorStore.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.List(context.TODO(), openai.VectorStoreListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStoreListPage;\nimport com.openai.models.vectorstores.VectorStoreListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStoreListPage page = client.vectorStores().list();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.list\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ\",\n \"description\": \"Contains commonly asked questions and answers, organized by topic.\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n },\n {\n \"id\": \"vs_abc456\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ v2\",\n \"description\": null,\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n }\n ],\n \"first_id\": \"vs_abc123\",\n \"last_id\": \"vs_abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "VectorStores_createVectorStore",
+ "summary": "Create a vector store",
+ "description": "Creates a vector store from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVectorStoreRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"name\": \"Support FAQ\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store = client.vector_stores.create()\nprint(vector_store.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStore = await openai.vectorStores.create({\n name: \"Support FAQ\"\n });\n console.log(vectorStore);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStore = await client.vectorStores.create();\n\nconsole.log(vectorStore.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStore, err := client.VectorStores.New(context.TODO(), openai.VectorStoreNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStore.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStore;\nimport com.openai.models.vectorstores.VectorStoreCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStore vectorStore = client.vectorStores().create();\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store = openai.vector_stores.create\n\nputs(vector_store)"
+ },
+ "response": "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ\",\n \"description\": \"Contains commonly asked questions and answers, organized by topic.\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}": {
+ "delete": {
+ "operationId": "VectorStores_deleteVectorStore",
+ "summary": "Delete a vector store",
+ "description": "Deletes a vector store by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteVectorStoreResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_deleted = client.vector_stores.delete(\n \"vector_store_id\",\n)\nprint(vector_store_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const deletedVectorStore = await openai.vectorStores.delete(\n \"vs_abc123\"\n );\n console.log(deletedVectorStore);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreDeleted = await client.vectorStores.delete('vector_store_id');\n\nconsole.log(vectorStoreDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreDeleted, err := client.VectorStores.Delete(context.TODO(), \"vector_store_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStoreDeleteParams;\nimport com.openai.models.vectorstores.VectorStoreDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStoreDeleted vectorStoreDeleted = client.vectorStores().delete(\"vector_store_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_deleted = openai.vector_stores.delete(\"vector_store_id\")\n\nputs(vector_store_deleted)"
+ },
+ "response": "{\n id: \"vs_abc123\",\n object: \"vector_store.deleted\",\n deleted: true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "VectorStores_getVectorStore",
+ "summary": "Get a vector store",
+ "description": "Retrieves a vector store by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store = client.vector_stores.retrieve(\n \"vector_store_id\",\n)\nprint(vector_store.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStore = await openai.vectorStores.retrieve(\n \"vs_abc123\"\n );\n console.log(vectorStore);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStore = await client.vectorStores.retrieve('vector_store_id');\n\nconsole.log(vectorStore.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStore, err := client.VectorStores.Get(context.TODO(), \"vector_store_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStore.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStore;\nimport com.openai.models.vectorstores.VectorStoreRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStore vectorStore = client.vectorStores().retrieve(\"vector_store_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store = openai.vector_stores.retrieve(\"vector_store_id\")\n\nputs(vector_store)"
+ },
+ "response": "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "VectorStores_modifyVectorStore",
+ "summary": "Update a vector store",
+ "description": "Updates a vector store with the supplied changes.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store to modify.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UpdateVectorStoreRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Modify vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n -d '{\n \"name\": \"Support FAQ\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store = client.vector_stores.update(\n vector_store_id=\"vector_store_id\",\n)\nprint(vector_store.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStore = await openai.vectorStores.update(\n \"vs_abc123\",\n {\n name: \"Support FAQ\"\n }\n );\n console.log(vectorStore);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStore = await client.vectorStores.update('vector_store_id');\n\nconsole.log(vectorStore.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStore, err := client.VectorStores.Update(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\topenai.VectorStoreUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStore.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStore;\nimport com.openai.models.vectorstores.VectorStoreUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStore vectorStore = client.vectorStores().update(\"vector_store_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store = openai.vector_stores.update(\"vector_store_id\")\n\nputs(vector_store)"
+ },
+ "response": "{\n \"id\": \"vs_abc123\",\n \"object\": \"vector_store\",\n \"created_at\": 1699061776,\n \"name\": \"Support FAQ\",\n \"description\": \"Contains commonly asked questions and answers, organized by topic.\",\n \"bytes\": 139920,\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 3\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/file_batches": {
+ "post": {
+ "operationId": "VectorStores_createVectorStoreFileBatch",
+ "summary": "Create a vector store file batch",
+ "description": "Creates a vector store file batch from the supplied request.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store for which to create a File Batch.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileBatchRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create vector store file batch",
+ "group": "vector_stores",
+ "description": "Attaches multiple files to a vector store in one request. This is the recommended approach for multi-file ingestion, especially because per-vector-store file attach writes are rate-limited (300 requests/minute shared with `/vector_stores/{vector_store_id}/files`).\n",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"files\": [\n {\n \"file_id\": \"file-abc123\",\n \"attributes\": {\"category\": \"finance\"}\n },\n {\n \"file_id\": \"file-abc456\",\n \"chunking_strategy\": {\n \"type\": \"static\",\n \"max_chunk_size_tokens\": 1200,\n \"chunk_overlap_tokens\": 200\n }\n }\n ]\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file_batch = client.vector_stores.file_batches.create(\n vector_store_id=\"vs_abc123\",\n)\nprint(vector_store_file_batch.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const myVectorStoreFileBatch = await openai.vectorStores.fileBatches.create(\n \"vs_abc123\",\n {\n files: [\n {\n file_id: \"file-abc123\",\n attributes: { category: \"finance\" },\n },\n {\n file_id: \"file-abc456\",\n chunking_strategy: {\n type: \"static\",\n max_chunk_size_tokens: 1200,\n chunk_overlap_tokens: 200,\n },\n },\n ]\n }\n );\n console.log(myVectorStoreFileBatch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFileBatch = await client.vectorStores.fileBatches.create('vs_abc123');\n\nconsole.log(vectorStoreFileBatch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFileBatch, err := client.VectorStores.FileBatches.New(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\topenai.VectorStoreFileBatchNewParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFileBatch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.filebatches.FileBatchCreateParams;\nimport com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().create(\"vs_abc123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file_batch = openai.vector_stores.file_batches.create(\"vs_abc123\")\n\nputs(vector_store_file_batch)"
+ },
+ "response": "{\n \"id\": \"vsfb_abc123\",\n \"object\": \"vector_store.file_batch\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"in_progress\",\n \"file_counts\": {\n \"in_progress\": 1,\n \"completed\": 1,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 0,\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}": {
+ "get": {
+ "operationId": "VectorStores_getVectorStoreFileBatch",
+ "summary": "Get a vector store file batch",
+ "description": "Retrieves a vector store file batch by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the file batch belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "batch_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file batch being retrieved.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve vector store file batch",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches/vsfb_abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file_batch = client.vector_stores.file_batches.retrieve(\n batch_id=\"vsfb_abc123\",\n vector_store_id=\"vs_abc123\",\n)\nprint(vector_store_file_batch.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStoreFileBatch = await openai.vectorStores.fileBatches.retrieve(\n \"vsfb_abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(vectorStoreFileBatch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFileBatch = await client.vectorStores.fileBatches.retrieve('vsfb_abc123', {\n vector_store_id: 'vs_abc123',\n});\n\nconsole.log(vectorStoreFileBatch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFileBatch, err := client.VectorStores.FileBatches.Get(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\t\"vsfb_abc123\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFileBatch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.filebatches.FileBatchRetrieveParams;\nimport com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileBatchRetrieveParams params = FileBatchRetrieveParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .batchId(\"vsfb_abc123\")\n .build();\n VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file_batch = openai.vector_stores.file_batches.retrieve(\"vsfb_abc123\", vector_store_id: \"vs_abc123\")\n\nputs(vector_store_file_batch)"
+ },
+ "response": "{\n \"id\": \"vsfb_abc123\",\n \"object\": \"vector_store.file_batch\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"in_progress\",\n \"file_counts\": {\n \"in_progress\": 1,\n \"completed\": 1,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 0,\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": {
+ "post": {
+ "operationId": "VectorStores_cancelVectorStoreFileBatch",
+ "summary": "Cancel a vector store file batch",
+ "description": "Cancels a vector store file batch by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the file batch belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "batch_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file batch to cancel.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Cancel vector store file batch",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X POST\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file_batch = client.vector_stores.file_batches.cancel(\n batch_id=\"batch_id\",\n vector_store_id=\"vector_store_id\",\n)\nprint(vector_store_file_batch.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const deletedVectorStoreFileBatch = await openai.vectorStores.fileBatches.cancel(\n \"vsfb_abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(deletedVectorStoreFileBatch);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFileBatch = await client.vectorStores.fileBatches.cancel('batch_id', {\n vector_store_id: 'vector_store_id',\n});\n\nconsole.log(vectorStoreFileBatch.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFileBatch, err := client.VectorStores.FileBatches.Cancel(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\t\"batch_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFileBatch.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.filebatches.FileBatchCancelParams;\nimport com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileBatchCancelParams params = FileBatchCancelParams.builder()\n .vectorStoreId(\"vector_store_id\")\n .batchId(\"batch_id\")\n .build();\n VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().cancel(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file_batch = openai.vector_stores.file_batches.cancel(\"batch_id\", vector_store_id: \"vector_store_id\")\n\nputs(vector_store_file_batch)"
+ },
+ "response": "{\n \"id\": \"vsfb_abc123\",\n \"object\": \"vector_store.file_batch\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"in_progress\",\n \"file_counts\": {\n \"in_progress\": 12,\n \"completed\": 3,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 15,\n }\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": {
+ "get": {
+ "operationId": "VectorStores_listFilesInVectorStoreBatch",
+ "summary": "List files in vector store batch",
+ "description": "Lists files in vector store batch matching the request filters.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the files belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "batch_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file batch that the files belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "filter",
+ "in": "query",
+ "required": false,
+ "description": "Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesFilter"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "List vector store files in a batch",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.file_batches.list_files(\n batch_id=\"batch_id\",\n vector_store_id=\"vector_store_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStoreFiles = await openai.vectorStores.fileBatches.listFiles(\n \"vsfb_abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(vectorStoreFiles);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vectorStoreFile of client.vectorStores.fileBatches.listFiles('batch_id', {\n vector_store_id: 'vector_store_id',\n})) {\n console.log(vectorStoreFile.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.FileBatches.ListFiles(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\t\"batch_id\",\n\t\topenai.VectorStoreFileBatchListFilesParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.filebatches.FileBatchListFilesPage;\nimport com.openai.models.vectorstores.filebatches.FileBatchListFilesParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileBatchListFilesParams params = FileBatchListFilesParams.builder()\n .vectorStoreId(\"vector_store_id\")\n .batchId(\"batch_id\")\n .build();\n FileBatchListFilesPage page = client.vectorStores().fileBatches().listFiles(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.file_batches.list_files(\"batch_id\", vector_store_id: \"vector_store_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n },\n {\n \"id\": \"file-abc456\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n }\n ],\n \"first_id\": \"file-abc123\",\n \"last_id\": \"file-abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/files": {
+ "get": {
+ "operationId": "VectorStores_listVectorStoreFiles",
+ "summary": "List vector store files",
+ "description": "Lists vector store files matching the request filters.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the files belong to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "default": 20
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum",
+ "default": "desc"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "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.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "filter",
+ "in": "query",
+ "required": false,
+ "description": "Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesFilter"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "List vector store files",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.files.list(\n vector_store_id=\"vector_store_id\",\n)\npage = page.data[0]\nprint(page.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStoreFiles = await openai.vectorStores.files.list(\n \"vs_abc123\"\n );\n console.log(vectorStoreFiles);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vectorStoreFile of client.vectorStores.files.list('vector_store_id')) {\n console.log(vectorStoreFile.id);\n}",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.Files.List(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\topenai.VectorStoreFileListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileListPage;\nimport com.openai.models.vectorstores.files.FileListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileListPage page = client.vectorStores().files().list(\"vector_store_id\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.files.list(\"vector_store_id\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n },\n {\n \"id\": \"file-abc456\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abc123\"\n }\n ],\n \"first_id\": \"file-abc123\",\n \"last_id\": \"file-abc456\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "VectorStores_createVectorStoreFile",
+ "summary": "Create a vector store file",
+ "description": "Creates a vector store file from the supplied request.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store for which to create a File.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create vector store file",
+ "group": "vector_stores",
+ "description": "Attaches one file to a vector store. File attach writes are rate-limited per vector store (300 requests/minute shared with `/vector_stores/{vector_store_id}/file_batches`), so use file batches when uploading multiple files.\n",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -d '{\n \"file_id\": \"file-abc123\"\n }'\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file = client.vector_stores.files.create(\n vector_store_id=\"vs_abc123\",\n file_id=\"file_id\",\n)\nprint(vector_store_file.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const myVectorStoreFile = await openai.vectorStores.files.create(\n \"vs_abc123\",\n {\n file_id: \"file-abc123\"\n }\n );\n console.log(myVectorStoreFile);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFile = await client.vectorStores.files.create('vs_abc123', { file_id: 'file_id' });\n\nconsole.log(vectorStoreFile.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFile, err := client.VectorStores.Files.New(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\topenai.VectorStoreFileNewParams{\n\t\t\tFileID: \"file_id\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFile.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileCreateParams;\nimport com.openai.models.vectorstores.files.VectorStoreFile;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileCreateParams params = FileCreateParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .fileId(\"file_id\")\n .build();\n VectorStoreFile vectorStoreFile = client.vectorStores().files().create(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file = openai.vector_stores.files.create(\"vs_abc123\", file_id: \"file_id\")\n\nputs(vector_store_file)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"usage_bytes\": 1234,\n \"vector_store_id\": \"vs_abcd\",\n \"status\": \"completed\",\n \"last_error\": null\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/files/{file_id}": {
+ "delete": {
+ "operationId": "VectorStores_deleteVectorStoreFile",
+ "summary": "Delete a vector store file",
+ "description": "Deletes a vector store file by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the file belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeleteVectorStoreFileResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete vector store file",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\" \\\n -X DELETE\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file_deleted = client.vector_stores.files.delete(\n file_id=\"file_id\",\n vector_store_id=\"vector_store_id\",\n)\nprint(vector_store_file_deleted.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const deletedVectorStoreFile = await openai.vectorStores.files.delete(\n \"file-abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(deletedVectorStoreFile);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFileDeleted = await client.vectorStores.files.delete('file_id', {\n vector_store_id: 'vector_store_id',\n});\n\nconsole.log(vectorStoreFileDeleted.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFileDeleted, err := client.VectorStores.Files.Delete(\n\t\tcontext.TODO(),\n\t\t\"vector_store_id\",\n\t\t\"file_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFileDeleted.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileDeleteParams;\nimport com.openai.models.vectorstores.files.VectorStoreFileDeleted;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileDeleteParams params = FileDeleteParams.builder()\n .vectorStoreId(\"vector_store_id\")\n .fileId(\"file_id\")\n .build();\n VectorStoreFileDeleted vectorStoreFileDeleted = client.vectorStores().files().delete(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file_deleted = openai.vector_stores.files.delete(\"file_id\", vector_store_id: \"vector_store_id\")\n\nputs(vector_store_file_deleted)"
+ },
+ "response": "{\n id: \"file-abc123\",\n object: \"vector_store.file.deleted\",\n deleted: true\n}\n"
+ }
+ }
+ },
+ "get": {
+ "operationId": "VectorStores_getVectorStoreFile",
+ "summary": "Get a vector store file",
+ "description": "Retrieves a vector store file by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store that the file belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file being retrieved.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve vector store file",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"OpenAI-Beta: assistants=v2\"\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file = client.vector_stores.files.retrieve(\n file_id=\"file-abc123\",\n vector_store_id=\"vs_abc123\",\n)\nprint(vector_store_file.id)",
+ "javascript": "import OpenAI from \"openai\";\nconst openai = new OpenAI();\n\nasync function main() {\n const vectorStoreFile = await openai.vectorStores.files.retrieve(\n \"file-abc123\",\n { vector_store_id: \"vs_abc123\" }\n );\n console.log(vectorStoreFile);\n}\n\nmain();\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFile = await client.vectorStores.files.retrieve('file-abc123', {\n vector_store_id: 'vs_abc123',\n});\n\nconsole.log(vectorStoreFile.id);",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFile, err := client.VectorStores.Files.Get(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\t\"file-abc123\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFile.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileRetrieveParams;\nimport com.openai.models.vectorstores.files.VectorStoreFile;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileRetrieveParams params = FileRetrieveParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .fileId(\"file-abc123\")\n .build();\n VectorStoreFile vectorStoreFile = client.vectorStores().files().retrieve(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file = openai.vector_stores.files.retrieve(\"file-abc123\", vector_store_id: \"vs_abc123\")\n\nputs(vector_store_file)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abcd\",\n \"status\": \"completed\",\n \"last_error\": null\n}\n"
+ }
+ }
+ },
+ "post": {
+ "operationId": "VectorStores_updateVectorStoreFileAttributes",
+ "summary": "Update vector store file attributes",
+ "description": "Updates vector store file attributes with the supplied changes.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store the file belongs to.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file to update attributes.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.UpdateVectorStoreFileAttributesRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Update vector store file attributes",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id} \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"attributes\": {\"key1\": \"value1\", \"key2\": 2}}'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst vectorStoreFile = await client.vectorStores.files.update('file-abc123', {\n vector_store_id: 'vs_abc123',\n attributes: { foo: 'string' },\n});\n\nconsole.log(vectorStoreFile.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvector_store_file = client.vector_stores.files.update(\n file_id=\"file-abc123\",\n vector_store_id=\"vs_abc123\",\n attributes={\n \"foo\": \"string\"\n },\n)\nprint(vector_store_file.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvectorStoreFile, err := client.VectorStores.Files.Update(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\t\"file-abc123\",\n\t\topenai.VectorStoreFileUpdateParams{\n\t\t\tAttributes: map[string]openai.VectorStoreFileUpdateParamsAttributeUnion{\n\t\t\t\t\"foo\": {\n\t\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", vectorStoreFile.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.JsonValue;\nimport com.openai.models.vectorstores.files.FileUpdateParams;\nimport com.openai.models.vectorstores.files.VectorStoreFile;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileUpdateParams params = FileUpdateParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .fileId(\"file-abc123\")\n .attributes(FileUpdateParams.Attributes.builder()\n .putAdditionalProperty(\"foo\", JsonValue.from(\"string\"))\n .build())\n .build();\n VectorStoreFile vectorStoreFile = client.vectorStores().files().update(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvector_store_file = openai.vector_stores.files.update(\n \"file-abc123\",\n vector_store_id: \"vs_abc123\",\n attributes: {foo: \"string\"}\n)\n\nputs(vector_store_file)"
+ },
+ "response": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"usage_bytes\": 1234,\n \"created_at\": 1699061776,\n \"vector_store_id\": \"vs_abcd\",\n \"status\": \"completed\",\n \"last_error\": null,\n \"chunking_strategy\": {...},\n \"attributes\": {\"key1\": \"value1\", \"key2\": 2}\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/content": {
+ "get": {
+ "operationId": "VectorStores_retrieveVectorStoreFileContent",
+ "summary": "Get a vector store file content",
+ "description": "Retrieves a vector store file content by its identifier.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "file_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the file within the vector store.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileContentResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve vector store file content",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl \\\nhttps://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123/content \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fileContentResponse of client.vectorStores.files.content('file-abc123', {\n vector_store_id: 'vs_abc123',\n})) {\n console.log(fileContentResponse.text);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.files.content(\n file_id=\"file-abc123\",\n vector_store_id=\"vs_abc123\",\n)\npage = page.data[0]\nprint(page.text)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.Files.Content(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\t\"file-abc123\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.files.FileContentPage;\nimport com.openai.models.vectorstores.files.FileContentParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FileContentParams params = FileContentParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .fileId(\"file-abc123\")\n .build();\n FileContentPage page = client.vectorStores().files().content(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.files.content(\"file-abc123\", vector_store_id: \"vs_abc123\")\n\nputs(page)"
+ },
+ "response": "{\n \"file_id\": \"file-abc123\",\n \"filename\": \"example.txt\",\n \"attributes\": {\"key\": \"value\"},\n \"content\": [\n {\"type\": \"text\", \"text\": \"...\"},\n ...\n ]\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/vector_stores/{vector_store_id}/search": {
+ "post": {
+ "operationId": "VectorStores_searchVectorStore",
+ "summary": "Search a vector store",
+ "description": "Searchs a vector store.",
+ "parameters": [
+ {
+ "name": "vector_store_id",
+ "in": "path",
+ "required": true,
+ "description": "The ID of the vector store to search.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Vector stores"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequest"
+ }
+ }
+ },
+ "description": "The request body."
+ },
+ "x-oaiMeta": {
+ "name": "Search vector store",
+ "group": "vector_stores",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST \\\nhttps://api.openai.com/v1/vector_stores/vs_abc123/search \\\n-H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\"query\": \"What is the return policy?\", \"filters\": {...}}'\n",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const vectorStoreSearchResponse of client.vectorStores.search('vs_abc123', {\n query: 'string',\n})) {\n console.log(vectorStoreSearchResponse.file_id);\n}",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.vector_stores.search(\n vector_store_id=\"vs_abc123\",\n query=\"string\",\n)\npage = page.data[0]\nprint(page.file_id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.VectorStores.Search(\n\t\tcontext.TODO(),\n\t\t\"vs_abc123\",\n\t\topenai.VectorStoreSearchParams{\n\t\t\tQuery: openai.VectorStoreSearchParamsQueryUnion{\n\t\t\t\tOfString: openai.String(\"string\"),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.vectorstores.VectorStoreSearchPage;\nimport com.openai.models.vectorstores.VectorStoreSearchParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VectorStoreSearchParams params = VectorStoreSearchParams.builder()\n .vectorStoreId(\"vs_abc123\")\n .query(\"string\")\n .build();\n VectorStoreSearchPage page = client.vectorStores().search(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.vector_stores.search(\"vs_abc123\", query: \"string\")\n\nputs(page)"
+ },
+ "response": "{\n \"object\": \"vector_store.search_results.page\",\n \"search_query\": \"What is the return policy?\",\n \"data\": [\n {\n \"file_id\": \"file_123\",\n \"filename\": \"document.pdf\",\n \"score\": 0.95,\n \"attributes\": {\n \"author\": \"John Doe\",\n \"date\": \"2023-01-01\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Relevant chunk\"\n }\n ]\n },\n {\n \"file_id\": \"file_456\",\n \"filename\": \"notes.txt\",\n \"score\": 0.89,\n \"attributes\": {\n \"author\": \"Jane Smith\",\n \"date\": \"2023-01-02\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Sample text content from the vector store.\"\n }\n ]\n }\n ],\n \"has_more\": false,\n \"next_page\": null\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/videos": {
+ "get": {
+ "operationId": "VideoGeneration_listVideos",
+ "summary": "List videos",
+ "description": "Lists videos matching the request filters.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "Number of items to retrieve",
+ "schema": {
+ "$ref": "#/components/schemas/integer",
+ "minimum": 0,
+ "maximum": 100
+ }
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order of results by timestamp. Use `asc` for ascending order or `desc` for descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.OrderEnum"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "Identifier for the last item from the previous pagination request",
+ "schema": {
+ "type": "string"
+ },
+ "x-ms-list-continuation-token": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoListResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "name": "List videos",
+ "group": "videos",
+ "path": "list for the organization.",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/videos \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n",
+ "javascript": "import OpenAI from 'openai';\n\nconst openai = new OpenAI();\n\n// Automatically fetches more pages as needed.\nfor await (const video of openai.videos.list()) {\n console.log(video.id);\n}\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.videos.list()\npage = page.data[0]\nprint(page.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Videos.List(context.TODO(), openai.VideoListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", page)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.videos.list\n\nputs(page)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoListPage;\nimport com.openai.models.videos.VideoListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoListPage page = client.videos().list();\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const video of client.videos.list()) {\n console.log(video.id);\n}"
+ },
+ "response": "{\n \"data\": [\n {\n \"id\": \"video_123\",\n \"object\": \"video\",\n \"model\": \"sora-2\",\n \"status\": \"completed\"\n }\n ],\n \"object\": \"list\"\n}\n"
+ }
+ },
+ "x-ms-list": true
+ },
+ "post": {
+ "operationId": "VideoGeneration_createVideo",
+ "summary": "Create a video",
+ "description": "Creates a video from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoMultipartBody"
+ },
+ "encoding": {
+ "model": {
+ "contentType": "text/plain"
+ },
+ "input_reference": {
+ "contentType": "application/octet-stream, application/json"
+ },
+ "seconds": {
+ "contentType": "application/json"
+ },
+ "size": {
+ "contentType": "application/json"
+ }
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Create video",
+ "group": "videos",
+ "path": "create",
+ "examples": {
+ "request": {
+ "curl": "curl https://api.openai.com/v1/videos \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"model=sora-2\" \\\n -F \"prompt=A calico cat playing a piano on stage\"\n",
+ "javascript": "import OpenAI from 'openai';\n\nconst openai = new OpenAI();\n\nconst video = await openai.videos.create({ prompt: 'A calico cat playing a piano on stage' });\n\nconsole.log(video.id);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.create(\n prompt=\"x\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.New(context.TODO(), openai.VideoNewParams{\n\t\tPrompt: \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.create(prompt: \"x\")\n\nputs(video)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoCreateParams params = VideoCreateParams.builder()\n .prompt(\"x\")\n .build();\n Video video = client.videos().create(params);\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.create({ prompt: 'x' });\n\nconsole.log(video.id);"
+ },
+ "response": "{\n \"id\": \"video_123\",\n \"object\": \"video\",\n \"model\": \"sora-2\",\n \"status\": \"queued\",\n \"progress\": 0,\n \"created_at\": 1712697600,\n \"size\": \"1024x1792\",\n \"seconds\": \"8\",\n \"quality\": \"standard\"\n}\n"
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/characters": {
+ "post": {
+ "operationId": "VideoGeneration_createVideoCharacter",
+ "summary": "Create a video character",
+ "description": "Creates a video character from the supplied request.",
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoCharacterResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoCharacterBody"
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "examples": {
+ "response": "",
+ "request": {
+ "node.js": "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.videos.createCharacter({\n name: 'x',\n video: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(response.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.videos.create_character(\n name=\"x\",\n video=b\"Example data\",\n)\nprint(response.id)",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Videos.NewCharacter(context.TODO(), openai.VideoNewCharacterParams{\n\t\tName: \"x\",\n\t\tVideo: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoCreateCharacterParams;\nimport com.openai.models.videos.VideoCreateCharacterResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoCreateCharacterParams params = VideoCreateCharacterParams.builder()\n .name(\"x\")\n .video(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n VideoCreateCharacterResponse response = client.videos().createCharacter(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.videos.create_character(name: \"x\", video: StringIO.new(\"Example data\"))\n\nputs(response)"
+ }
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/characters/{character_id}": {
+ "get": {
+ "operationId": "VideoGeneration_getVideoCharacter",
+ "summary": "Get a video character",
+ "description": "Retrieves a video character by its identifier.",
+ "parameters": [
+ {
+ "name": "character_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the character to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoCharacterResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "examples": {
+ "response": "",
+ "request": {
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.videos.getCharacter('char_123');\n\nconsole.log(response.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.videos.get_character(\n \"char_123\",\n)\nprint(response.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Videos.GetCharacter(context.TODO(), \"char_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoGetCharacterParams;\nimport com.openai.models.videos.VideoGetCharacterResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoGetCharacterResponse response = client.videos().getCharacter(\"char_123\");\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.videos.get_character(\"char_123\")\n\nputs(response)"
+ }
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/edits": {
+ "post": {
+ "operationId": "VideoGeneration_createVideoEditMultipart_VideoGeneration_createVideoEditJson",
+ "parameters": [],
+ "description": "Creates a video edit from the supplied request. Creates a video edit from the supplied request.",
+ "summary": "Create a video edit Create a video edit",
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "x-ms-request-body-description-override": "The request body.",
+ "x-ms-description-override": "Creates a video edit from the supplied request.",
+ "x-ms-summary-override": "Create a video edit",
+ "x-oaiMeta": {
+ "examples": {
+ "response": "",
+ "request": {
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.edit({ prompt: 'x', video: fs.createReadStream('path/to/file') });\n\nconsole.log(video.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.edit(\n prompt=\"x\",\n video=b\"Example data\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Edit(context.TODO(), openai.VideoEditParams{\n\t\tPrompt: \"x\",\n\t\tVideo: openai.VideoEditParamsVideoUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoEditParams;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoEditParams params = VideoEditParams.builder()\n .prompt(\"x\")\n .video(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n Video video = client.videos().edit(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.edit(prompt: \"x\", video: StringIO.new(\"Example data\"))\n\nputs(video)"
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoEditMultipartBody"
+ },
+ "encoding": {
+ "video": {
+ "contentType": "application/octet-stream, application/json"
+ }
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoEditJsonBody"
+ }
+ }
+ },
+ "description": "The multipart request body. The request body."
+ }
+ }
+ },
+ "/openai/v1/videos/extensions": {
+ "post": {
+ "operationId": "VideoGeneration_createVideoExtendMultipart_VideoGeneration_createVideoExtendJson",
+ "parameters": [],
+ "description": "Extends a video from the supplied request. Extends a video from the supplied request.",
+ "summary": "Extend a video Extend a video",
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "x-ms-request-body-description-override": "The request body.",
+ "x-ms-description-override": "Extends a video from the supplied request.",
+ "x-ms-summary-override": "Extend a video",
+ "x-oaiMeta": {
+ "examples": {
+ "response": "",
+ "request": {
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.extend({\n prompt: 'x',\n seconds: '4',\n video: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(video.id);",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.extend(\n prompt=\"x\",\n seconds=\"4\",\n video=b\"Example data\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Extend(context.TODO(), openai.VideoExtendParams{\n\t\tPrompt: \"x\",\n\t\tSeconds: openai.VideoSeconds4,\n\t\tVideo: openai.VideoExtendParamsVideoUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoExtendParams;\nimport com.openai.models.videos.VideoSeconds;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoExtendParams params = VideoExtendParams.builder()\n .prompt(\"x\")\n .seconds(VideoSeconds._4)\n .video(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n Video video = client.videos().extend(params);\n }\n}",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.extend_(prompt: \"x\", seconds: :\"4\", video: StringIO.new(\"Example data\"))\n\nputs(video)"
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoExtendMultipartBody"
+ },
+ "encoding": {
+ "video": {
+ "contentType": "application/json, application/octet-stream"
+ },
+ "seconds": {
+ "contentType": "application/json"
+ }
+ }
+ },
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoExtendJsonBody"
+ }
+ }
+ },
+ "description": "The multipart request body. The request body."
+ }
+ }
+ },
+ "/openai/v1/videos/{video_id}": {
+ "delete": {
+ "operationId": "VideoGeneration_deleteVideo",
+ "summary": "Delete a video",
+ "description": "Deletes a video by its identifier.",
+ "parameters": [
+ {
+ "name": "video_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the video to delete.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.DeletedVideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "name": "Delete video",
+ "group": "videos",
+ "path": "delete",
+ "examples": {
+ "response": "",
+ "request": {
+ "javascript": "import OpenAI from 'openai';\n\nconst client = new OpenAI();\n\nconst video = await client.videos.delete('video_123');\n\nconsole.log(video.id);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.delete(\n \"video_123\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Delete(context.TODO(), \"video_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.delete(\"video_123\")\n\nputs(video)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoDeleteParams;\nimport com.openai.models.videos.VideoDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoDeleteResponse video = client.videos().delete(\"video_123\");\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.delete('video_123');\n\nconsole.log(video.id);"
+ }
+ }
+ }
+ },
+ "get": {
+ "operationId": "VideoGeneration_getVideo",
+ "summary": "Get a video",
+ "description": "Retrieves a video by its identifier.",
+ "parameters": [
+ {
+ "name": "video_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the video to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve video",
+ "group": "videos",
+ "path": "retrieve matching the provided identifier.",
+ "examples": {
+ "response": "",
+ "request": {
+ "javascript": "import OpenAI from 'openai';\n\nconst client = new OpenAI();\n\nconst video = await client.videos.retrieve('video_123');\n\nconsole.log(video.id);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.retrieve(\n \"video_123\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Get(context.TODO(), \"video_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.retrieve(\"video_123\")\n\nputs(video)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Video video = client.videos().retrieve(\"video_123\");\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.retrieve('video_123');\n\nconsole.log(video.id);"
+ }
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/{video_id}/content": {
+ "get": {
+ "operationId": "VideoGeneration_retrieveVideoContent",
+ "summary": "Get a video content",
+ "description": "Retrieves a video content by its identifier.",
+ "parameters": [
+ {
+ "name": "video_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the video whose media to download.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "variant",
+ "in": "query",
+ "required": false,
+ "description": "Which downloadable asset to return. Defaults to the MP4 video.",
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoContentVariant"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "video/mp4": {
+ "schema": {
+ "contentMediaType": "video/mp4"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "x-oaiMeta": {
+ "name": "Retrieve video content",
+ "group": "videos",
+ "path": "content",
+ "examples": {
+ "response": "",
+ "request": {
+ "javascript": "import OpenAI from 'openai';\n\nconst client = new OpenAI();\n\nconst response = await client.videos.downloadContent('video_123');\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.videos.download_content(\n video_id=\"video_123\",\n)\nprint(response)\ncontent = response.read()\nprint(content)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Videos.DownloadContent(\n\t\tcontext.TODO(),\n\t\t\"video_123\",\n\t\topenai.VideoDownloadContentParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", response)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.videos.download_content(\"video_123\")\n\nputs(response)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.videos.VideoDownloadContentParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n HttpResponse response = client.videos().downloadContent(\"video_123\");\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.videos.downloadContent('video_123');\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);"
+ }
+ }
+ }
+ }
+ },
+ "/openai/v1/videos/{video_id}/remix": {
+ "post": {
+ "operationId": "VideoGeneration_createVideoRemix",
+ "summary": "Create a video remix",
+ "description": "Creates a video remix from the supplied request.",
+ "parameters": [
+ {
+ "name": "video_id",
+ "in": "path",
+ "required": true,
+ "description": "The identifier of the completed video to remix.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Videos"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoRemixBody"
+ },
+ "encoding": {
+ "prompt": {
+ "contentType": "text/plain"
+ }
+ }
+ }
+ },
+ "description": "The multipart request body."
+ },
+ "x-oaiMeta": {
+ "name": "Remix video",
+ "group": "videos",
+ "path": "remix using the provided prompt.",
+ "examples": {
+ "request": {
+ "curl": "curl -X POST https://api.openai.com/v1/videos/video_123/remix \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"prompt\": \"Extend the scene with the cat taking a bow to the cheering audience\"\n }'\n",
+ "javascript": "import OpenAI from 'openai';\n\nconst client = new OpenAI();\n\nconst video = await client.videos.remix('video_123', { prompt: 'Extend the scene with the cat taking a bow to the cheering audience' });\n\nconsole.log(video.id);\n",
+ "python": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.remix(\n video_id=\"video_123\",\n prompt=\"x\",\n)\nprint(video.id)",
+ "go": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Remix(\n\t\tcontext.TODO(),\n\t\t\"video_123\",\n\t\topenai.VideoRemixParams{\n\t\t\tPrompt: \"x\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\n\", video.ID)\n}\n",
+ "ruby": "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nvideo = openai.videos.remix(\"video_123\", prompt: \"x\")\n\nputs(video)",
+ "java": "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoRemixParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoRemixParams params = VideoRemixParams.builder()\n .videoId(\"video_123\")\n .prompt(\"x\")\n .build();\n Video video = client.videos().remix(params);\n }\n}",
+ "node.js": "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.remix('video_123', { prompt: 'x' });\n\nconsole.log(video.id);"
+ },
+ "response": "{\n \"id\": \"video_456\",\n \"object\": \"video\",\n \"model\": \"sora-2\",\n \"status\": \"queued\",\n \"progress\": 0,\n \"created_at\": 1712698600,\n \"size\": \"720x1280\",\n \"seconds\": \"8\",\n \"remixed_from_video_id\": \"video_123\"\n}\n"
+ }
+ }
+ }
+ },
+ "/redTeams/runs": {
+ "get": {
+ "operationId": "RedTeams_list",
+ "summary": "List redteams",
+ "description": "Returns the redteams available in the current project.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PagedRedTeam"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Redteams"
+ ]
+ }
+ },
+ "/redTeams/runs/{name}": {
+ "get": {
+ "operationId": "RedTeams_get",
+ "summary": "Get a redteam",
+ "description": "Retrieves the specified redteam and its configuration.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the red team run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RedTeam"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Redteams"
+ ]
+ }
+ },
+ "/redTeams/runs:run": {
+ "post": {
+ "operationId": "RedTeams_create",
+ "summary": "Create a redteam run",
+ "description": "Submits a new redteam run for execution with the provided configuration.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "The request has succeeded and a new resource has been created as a result.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RedTeam"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Redteams"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RedTeam"
+ }
+ }
+ },
+ "description": "Redteam to be run"
+ }
+ }
+ },
+ "/routines": {
+ "get": {
+ "operationId": "listRoutines",
+ "summary": "List routines",
+ "description": "Returns the routines available in the current project.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutinesParameters.limit"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutinesParameters.after"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutinesParameters.before"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutinesParameters.order"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Routine"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}": {
+ "put": {
+ "operationId": "createOrUpdateRoutine",
+ "summary": "Create or update a routine",
+ "description": "Creates a new routine or replaces an existing routine with the supplied definition.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/CreateOrUpdateRoutineParameters.routine_name"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Routine"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RoutineCreateOrUpdateRequest"
+ }
+ }
+ }
+ },
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "get": {
+ "operationId": "getRoutine",
+ "summary": "Get a routine",
+ "description": "Retrieves the specified routine and its current configuration.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/GetRoutineParameters"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Routine"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "delete": {
+ "operationId": "deleteRoutine",
+ "summary": "Delete a routine",
+ "description": "Deletes the specified routine.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/DeleteRoutineParameters"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "There is no content to send for this request, but the headers may be useful."
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}/runs": {
+ "get": {
+ "operationId": "listRoutineRuns",
+ "summary": "List prior runs for a routine",
+ "description": "Returns prior runs recorded for the specified routine.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.routine_name"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.filter"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.limit"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.after"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.before"
+ },
+ {
+ "$ref": "#/components/parameters/ListRoutineRunsParameters.order"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RoutineRun"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}:disable": {
+ "post": {
+ "operationId": "disableRoutine",
+ "summary": "Disable a routine",
+ "description": "Disables the specified routine so it no longer runs.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/DisableRoutineParameters"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Routine"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}:dispatch_async": {
+ "post": {
+ "operationId": "dispatchRoutineAsync",
+ "summary": "Queue an asynchronous routine dispatch",
+ "description": "Queues an asynchronous dispatch for the specified routine.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/DispatchRoutineAsyncParameters.routine_name"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DispatchRoutineResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DispatchRoutineRequest"
+ }
+ }
+ }
+ },
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/routines/{routine_name}:enable": {
+ "post": {
+ "operationId": "enableRoutine",
+ "summary": "Enable a routine",
+ "description": "Enables the specified routine so it can be dispatched.",
+ "parameters": [
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": false,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ {
+ "$ref": "#/components/parameters/EnableRoutineParameters"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Routine"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Routines"
+ ],
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ }
+ },
+ "/schedules": {
+ "get": {
+ "operationId": "Schedules_list",
+ "summary": "List schedules",
+ "description": "Returns schedules that match the supplied type and enabled filters.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "type",
+ "in": "query",
+ "required": false,
+ "description": "Filter by the type of schedule.",
+ "schema": {
+ "$ref": "#/components/schemas/ScheduleTaskType"
+ },
+ "explode": false
+ },
+ {
+ "name": "enabled",
+ "in": "query",
+ "required": false,
+ "description": "Filter by the enabled status.",
+ "schema": {
+ "type": "boolean"
+ },
+ "explode": false
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PagedSchedule"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ }
+ },
+ "/schedules/{id}": {
+ "delete": {
+ "operationId": "Schedules_delete",
+ "summary": "Delete a schedule",
+ "description": "Deletes the specified schedule resource.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "There is no content to send for this request, but the headers may be useful."
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ },
+ "get": {
+ "operationId": "Schedules_get",
+ "summary": "Get a schedule",
+ "description": "Retrieves the specified schedule resource.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Schedule"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ },
+ "put": {
+ "operationId": "Schedules_createOrUpdate",
+ "summary": "Create or update a schedule",
+ "description": "Creates a new schedule or updates an existing schedule with the supplied definition.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Schedule"
+ }
+ }
+ }
+ },
+ "201": {
+ "description": "The request has succeeded and a new resource has been created as a result.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Schedule"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Schedule"
+ }
+ }
+ },
+ "description": "The resource instance."
+ }
+ }
+ },
+ "/schedules/{id}/runs": {
+ "get": {
+ "operationId": "Schedules_listRuns",
+ "summary": "List schedule runs",
+ "description": "Returns schedule runs that match the supplied filters.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "description": "Identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "type",
+ "in": "query",
+ "required": false,
+ "description": "Filter by the type of schedule.",
+ "schema": {
+ "$ref": "#/components/schemas/ScheduleTaskType"
+ },
+ "explode": false
+ },
+ {
+ "name": "enabled",
+ "in": "query",
+ "required": false,
+ "description": "Filter by the enabled status.",
+ "schema": {
+ "type": "boolean"
+ },
+ "explode": false
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PagedScheduleRun"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "headers": {
+ "x-ms-error-code": {
+ "required": false,
+ "description": "String error code indicating what went wrong.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ }
+ },
+ "/schedules/{schedule_id}/runs/{run_id}": {
+ "get": {
+ "operationId": "Schedules_getRun",
+ "summary": "Get a schedule run",
+ "description": "Retrieves the specified run for a schedule.",
+ "parameters": [
+ {
+ "name": "schedule_id",
+ "in": "path",
+ "required": true,
+ "description": "The unique identifier of the schedule.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "run_id",
+ "in": "path",
+ "required": true,
+ "description": "The unique identifier of the schedule run.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ScheduleRun"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Schedules"
+ ]
+ }
+ },
+ "/skills": {
+ "get": {
+ "operationId": "Skills_listSkills",
+ "summary": "List skills",
+ "description": "Returns the skills available in the current project.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Skill"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}": {
+ "get": {
+ "operationId": "Skills_getSkill",
+ "summary": "Retrieve a skill",
+ "description": "Retrieves the specified skill and its current configuration.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Skill"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "post": {
+ "operationId": "updateSkill",
+ "summary": "Update a skill",
+ "description": "Modifies the specified skill's configuration.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill to update.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Skill"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "default_version": {
+ "type": "string",
+ "description": "The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest."
+ }
+ },
+ "required": [
+ "default_version"
+ ]
+ }
+ }
+ }
+ },
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "delete": {
+ "operationId": "Skills_deleteSkill",
+ "summary": "Delete a skill",
+ "description": "Removes the specified skill and its associated versions.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteSkillResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}/content": {
+ "get": {
+ "operationId": "getSkillContent",
+ "summary": "Download the zip content for the default version of a skill",
+ "description": "Downloads the zip content for the default version of a skill.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The response body for downloading a skill package.",
+ "content": {
+ "application/zip": {
+ "schema": {
+ "contentMediaType": "application/zip"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}/versions": {
+ "post": {
+ "operationId": "createSkillVersion_createSkillVersionFromFiles",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill. If the skill does not exist, it will be created.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "description": "Creates a new version of a skill. If the skill does not exist, it will be created. Creates a new version of a skill from uploaded files via multipart form data.",
+ "summary": "Create a new version of a skill Create a skill version from uploaded files",
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SkillVersion"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "x-ms-description-override": "Creates a new version of a skill. If the skill does not exist, it will be created.",
+ "x-ms-summary-override": "Create a new version of a skill",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ },
+ "tags": [
+ "Skills"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "inline_content": {
+ "$ref": "#/components/schemas/SkillInlineContent",
+ "description": "Inline skill content for simple skills without file uploads. Foundry-specific extension."
+ },
+ "default": {
+ "type": "boolean",
+ "description": "Whether to set this version as the default."
+ }
+ }
+ }
+ },
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateSkillVersionFromFilesBody"
+ },
+ "encoding": {
+ "files": {
+ "contentType": "*/*"
+ },
+ "default": {
+ "contentType": "text/plain"
+ }
+ }
+ }
+ },
+ "description": "The multipart request content."
+ }
+ },
+ "get": {
+ "operationId": "listSkillVersions",
+ "summary": "List skill versions",
+ "description": "Returns the available versions for the specified skill.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill to list versions for.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/SkillVersion"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}/versions/{version}": {
+ "get": {
+ "operationId": "getSkillVersion",
+ "summary": "Retrieve a specific version of a skill",
+ "description": "Retrieves the specified version of a skill by name and version identifier.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version identifier to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SkillVersion"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "delete": {
+ "operationId": "deleteSkillVersion",
+ "summary": "Delete a specific version of a skill",
+ "description": "Removes the specified version of a skill.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version identifier to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DeleteSkillVersionResponse"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/skills/{name}/versions/{version}/content": {
+ "get": {
+ "operationId": "getSkillVersionContent",
+ "summary": "Download the zip content for a specific version of a skill",
+ "description": "Downloads the zip content for a specific version of a skill.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the skill.",
+ "schema": {
+ "$ref": "#/components/schemas/SkillName"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version to download content for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Foundry-Features",
+ "in": "header",
+ "required": true,
+ "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The response body for downloading a skill package.",
+ "content": {
+ "application/zip": {
+ "schema": {
+ "contentMediaType": "application/zip"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Skills"
+ ],
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ }
+ },
+ "/toolboxes": {
+ "get": {
+ "operationId": "listToolboxes",
+ "summary": "List toolboxes",
+ "description": "Returns the toolboxes available in the current project.",
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolboxObject"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ }
+ },
+ "/toolboxes/{name}": {
+ "get": {
+ "operationId": "getToolbox",
+ "summary": "Retrieve a toolbox",
+ "description": "Retrieves the specified toolbox and its current configuration.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ToolboxObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ },
+ "patch": {
+ "operationId": "updateToolbox",
+ "summary": "Update a toolbox to point to a specific version",
+ "description": "Updates the toolbox's default version pointer to the specified version.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/UpdateToolboxRequest.name"
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ToolboxObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateToolboxRequest"
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "operationId": "deleteToolbox",
+ "summary": "Delete a toolbox",
+ "description": "Removes the specified toolbox along with all of its versions.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "There is no content to send for this request, but the headers may be useful. "
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ }
+ },
+ "/toolboxes/{name}/versions": {
+ "post": {
+ "operationId": "createToolboxVersion",
+ "summary": "Create a new version of a toolbox",
+ "description": "Creates a new toolbox version, provisioning the toolbox itself if it does not already exist.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox. If the toolbox does not exist, it will be created.",
+ "schema": {
+ "type": "string",
+ "maxLength": 256
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ToolboxVersionObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the toolbox."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Arbitrary key-value metadata to associate with the toolbox."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolboxTool"
+ },
+ "description": "The list of tools to include in this version."
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolboxSkill"
+ },
+ "description": "The list of skill sources to include in this version. A skill reference specifies a skill name and optionally a version. If version is omitted, the skill's default version is used."
+ },
+ "policies": {
+ "$ref": "#/components/schemas/ToolboxPolicies",
+ "description": "Policy configuration for this toolbox version."
+ }
+ },
+ "required": [
+ "tools"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "operationId": "listToolboxVersions",
+ "summary": "List toolbox versions",
+ "description": "Returns the available versions for the specified toolbox.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox to list versions for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
+ "schema": {
+ "type": "integer",
+ "format": "int32",
+ "default": 20
+ },
+ "explode": false
+ },
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
+ "schema": {
+ "$ref": "#/components/schemas/PageOrder"
+ },
+ "explode": false
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolboxVersionObject"
+ },
+ "description": "The requested list of items."
+ },
+ "first_id": {
+ "type": "string",
+ "description": "The first ID represented in this list."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The last ID represented in this list."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "A value indicating whether there are additional values available not captured in this list."
+ }
+ },
+ "description": "The response data for a requested list of items."
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ }
+ },
+ "/toolboxes/{name}/versions/{version}": {
+ "get": {
+ "operationId": "getToolboxVersion",
+ "summary": "Retrieve a specific version of a toolbox",
+ "description": "Retrieves the specified version of a toolbox by name and version identifier.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version identifier to retrieve.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The request has succeeded.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ToolboxVersionObject"
+ }
+ }
+ }
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ },
+ "delete": {
+ "operationId": "deleteToolboxVersion",
+ "summary": "Delete a specific version of a toolbox",
+ "description": "Removes the specified version of a toolbox.",
+ "parameters": [
+ {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "description": "The version identifier to delete.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "There is no content to send for this request, but the headers may be useful. "
+ },
+ "4XX": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ },
+ "5XX": {
+ "description": "Server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ApiErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Toolboxes"
+ ]
+ }
+ }
+ },
+ "security": [
+ {
+ "OAuth2Auth": [
+ "https://ai.azure.com/.default"
+ ]
+ }
+ ],
+ "components": {
+ "parameters": {
+ "Azure.Core.ClientRequestIdHeader": {
+ "name": "x-ms-client-request-id",
+ "in": "header",
+ "required": false,
+ "description": "An opaque, globally-unique, client-generated string identifier for the request.",
+ "schema": {
+ "$ref": "#/components/schemas/Azure.Core.uuid"
+ }
+ },
+ "Azure.Core.Foundations.ApiVersionParameter": {
+ "name": "api-version",
+ "in": "query",
+ "required": true,
+ "description": "The API version to use for this operation.",
+ "schema": {
+ "type": "string",
+ "minLength": 1
+ },
+ "explode": false
+ },
+ "CreateOrUpdateRoutineParameters.routine_name": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "DeleteRoutineParameters": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "DisableRoutineParameters": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "DispatchRoutineAsyncParameters.routine_name": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "EnableRoutineParameters": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "GetRoutineParameters": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "ListRoutineRunsParameters.after": {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "An opaque cursor returned as last_id by the previous list-runs response.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.before": {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "Unsupported. Reserved for future backward pagination support.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.filter": {
+ "name": "filter",
+ "in": "query",
+ "required": false,
+ "description": "An optional MLflow search-runs filter expression applied within the routine's experiment.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.limit": {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "The maximum number of runs to return.",
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.order": {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "The ordering direction. Supported values are asc and desc.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutineRunsParameters.routine_name": {
+ "name": "routine_name",
+ "in": "path",
+ "required": true,
+ "description": "The unique name of the routine.",
+ "schema": {
+ "type": "string",
+ "maxLength": 128
+ }
+ },
+ "ListRoutinesParameters.after": {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "description": "An opaque cursor returned as last_id by the previous list response.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutinesParameters.before": {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "description": "Unsupported. Reserved for future backward pagination support.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "ListRoutinesParameters.limit": {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "description": "The maximum number of routines to return.",
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "explode": false
+ },
+ "ListRoutinesParameters.order": {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "description": "The ordering direction. Supported values are asc and desc.",
+ "schema": {
+ "type": "string"
+ },
+ "explode": false
+ },
+ "UpdateToolboxRequest.name": {
+ "name": "name",
+ "in": "path",
+ "required": true,
+ "description": "The name of the toolbox to update.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "schemas": {
+ "A2APreviewTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "a2a_preview"
+ ],
+ "description": "The type of the tool. Always `\"a2a_preview`."
+ },
+ "base_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "Base URL of the agent."
+ },
+ "agent_card_path": {
+ "type": "string",
+ "description": "The path to the agent card relative to the `base_url`.\nIf not provided, defaults to `/.well-known/agent-card.json`"
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The connection ID in the project for the A2A server.\nThe connection stores authentication and other connection details needed to connect to the A2A server."
+ },
+ "send_credentials_for_agent_card": {
+ "type": "boolean",
+ "description": "When `true`, Foundry sends its credentials when fetching the remote\nagent's Agent Card. The service defaults to `false` if a value is not\nspecified by the caller (anonymous fetch).",
+ "default": false
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "An agent implementing the A2A protocol.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "A2APreviewToolboxTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "a2a_preview"
+ ]
+ },
+ "base_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "Base URL of the agent."
+ },
+ "agent_card_path": {
+ "type": "string",
+ "description": "The path to the agent card relative to the `base_url`.\nIf not provided, defaults to `/.well-known/agent-card.json`"
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The connection ID in the project for the A2A server.\nThe connection stores authentication and other connection details needed to connect to the A2A server."
+ },
+ "send_credentials_for_agent_card": {
+ "type": "boolean",
+ "description": "When `true`, Foundry sends its credentials when fetching the remote\nagent's Agent Card. The service defaults to `false` if a value is not\nspecified by the caller (anonymous fetch).",
+ "default": false
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "An A2A tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "A2AProtocolConfiguration": {
+ "type": "object",
+ "description": "Configuration specific to the A2A protocol."
+ },
+ "A2AToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "a2a_preview_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the A2A agent card being called."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "An A2A (Agent-to-Agent) tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "A2AToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "a2a_preview_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the A2A agent card that was called."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the A2A tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of an A2A (Agent-to-Agent) tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "AISearchIndexResource": {
+ "type": "object",
+ "properties": {
+ "project_connection_id": {
+ "type": "string",
+ "description": "An index connection ID in an IndexResource attached to this agent."
+ },
+ "index_name": {
+ "type": "string",
+ "description": "The name of an index in an IndexResource attached to this agent."
+ },
+ "query_type": {
+ "$ref": "#/components/schemas/AzureAISearchQueryType",
+ "description": "Type of query in an AIIndexResource attached to this agent."
+ },
+ "top_k": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Number of documents to retrieve from search and present to the model."
+ },
+ "filter": {
+ "type": "string",
+ "description": "filter string for search resource. [Learn more here](https://learn.microsoft.com/azure/search/search-filters)."
+ },
+ "index_asset_id": {
+ "type": "string",
+ "description": "Index asset id for search resource."
+ }
+ },
+ "description": "A AI Search Index resource."
+ },
+ "ActivityProtocolConfiguration": {
+ "type": "object",
+ "properties": {
+ "enable_m365_public_endpoint": {
+ "type": "boolean",
+ "description": "Whether to enable the M365 public endpoint for the activity protocol."
+ }
+ },
+ "description": "Configuration specific to the activity protocol."
+ },
+ "AgentBlueprintReference": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/AgentBlueprintReferenceType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "ManagedAgentIdentityBlueprint": "#/components/schemas/ManagedAgentIdentityBlueprintReference"
+ }
+ }
+ },
+ "AgentBlueprintReferenceType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "ManagedAgentIdentityBlueprint"
+ ]
+ }
+ ]
+ },
+ "AgentCard": {
+ "type": "object",
+ "required": [
+ "version",
+ "skills"
+ ],
+ "properties": {
+ "version": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32,
+ "description": "The version of the agent card."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 2048,
+ "description": "The description of the agent card."
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentCardSkill"
+ },
+ "minItems": 1,
+ "maxItems": 16,
+ "description": "The set of skills that an agent can perform."
+ }
+ }
+ },
+ "AgentCardSkill": {
+ "type": "object",
+ "required": [
+ "id",
+ "name"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "a unique identifier for the skill"
+ },
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 128,
+ "description": "The name of the skill"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 2048,
+ "description": "A description of the skill"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentCardSkillTag"
+ },
+ "maxItems": 5,
+ "description": "set of tagwords describing classes of capabilities for the skill"
+ },
+ "examples": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentCardSkillExample"
+ },
+ "maxItems": 5,
+ "description": "A list of example scenarios that the skill can perform."
+ }
+ }
+ },
+ "AgentCardSkillExample": {
+ "type": "string",
+ "maxLength": 1024,
+ "description": "A skill example string with a maximum length of 1024 characters."
+ },
+ "AgentCardSkillTag": {
+ "type": "string",
+ "maxLength": 32
+ },
+ "AgentCardUpdate": {
+ "type": "object",
+ "properties": {
+ "version": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32,
+ "description": "The version of the agent card."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 2048,
+ "description": "The description of the agent card."
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentCardSkill"
+ },
+ "minItems": 1,
+ "maxItems": 16,
+ "description": "The set of skills that an agent can perform."
+ }
+ }
+ },
+ "AgentClusterInsightRequest": {
+ "type": "object",
+ "required": [
+ "type",
+ "agentName"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AgentClusterInsight"
+ ],
+ "description": "The type of request."
+ },
+ "agentName": {
+ "type": "string",
+ "description": "Identifier for the agent."
+ },
+ "modelConfiguration": {
+ "$ref": "#/components/schemas/InsightModelConfiguration",
+ "description": "Configuration of the model used in the insight generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightRequest"
+ }
+ ],
+ "description": "Insights on set of Agent Evaluation Results",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "AgentClusterInsightResult": {
+ "type": "object",
+ "required": [
+ "type",
+ "clusterInsight"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AgentClusterInsight"
+ ],
+ "description": "The type of insights result."
+ },
+ "clusterInsight": {
+ "$ref": "#/components/schemas/ClusterInsightResult"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightResult"
+ }
+ ],
+ "description": "Insights from the agent cluster analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "AgentContainerObject": {
+ "type": "object",
+ "required": [
+ "object",
+ "status",
+ "created_at",
+ "updated_at"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "agent.container"
+ ],
+ "description": "The object type, which is always 'agent.container'.",
+ "readOnly": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The identifier of the container.",
+ "readOnly": true
+ },
+ "status": {
+ "$ref": "#/components/schemas/AgentContainerStatus",
+ "description": "The status of the container of a specific version of an agent.",
+ "readOnly": true
+ },
+ "max_replicas": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The maximum number of replicas for the container. Default is 1.",
+ "examples": [
+ 10
+ ]
+ },
+ "min_replicas": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The minimum number of replicas for the container. Default is 1.",
+ "examples": [
+ 1
+ ]
+ },
+ "error_message": {
+ "type": "string",
+ "description": "The error message if the container failed to operate, if any.",
+ "readOnly": true
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The creation time of the container.",
+ "readOnly": true
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The last update time of the container.",
+ "readOnly": true
+ },
+ "container": {
+ "$ref": "#/components/schemas/ContainerDetails",
+ "description": "The detailed container information.",
+ "readOnly": true
+ }
+ },
+ "description": "The details of the container of a specific version of an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ContainerAgents=V1Preview"
+ ]
+ }
+ },
+ "AgentContainerOperationError": {
+ "type": "object",
+ "required": [
+ "code",
+ "type",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "The error code of the container operation."
+ },
+ "type": {
+ "type": "string",
+ "description": "The error type of the container operation."
+ },
+ "message": {
+ "type": "string",
+ "description": "The error message of the container operation."
+ }
+ },
+ "description": "The error details of the container operation, if any.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ContainerAgents=V1Preview"
+ ]
+ }
+ },
+ "AgentContainerOperationObject": {
+ "type": "object",
+ "required": [
+ "id",
+ "agent_id",
+ "agent_version_id",
+ "status"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the container operation. This id is a globally unique identifier."
+ },
+ "agent_id": {
+ "type": "string",
+ "description": "The ID of the agent."
+ },
+ "agent_version_id": {
+ "type": "string",
+ "description": "The ID of the agent version."
+ },
+ "status": {
+ "$ref": "#/components/schemas/AgentContainerOperationStatus",
+ "description": "The status of the container operation."
+ },
+ "error": {
+ "$ref": "#/components/schemas/AgentContainerOperationError",
+ "description": "The error of the container operation, if any."
+ },
+ "container": {
+ "$ref": "#/components/schemas/AgentContainerObject",
+ "description": "The container of the specific version of an agent."
+ }
+ },
+ "description": "The container operation for a specific version of an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ContainerAgents=V1Preview"
+ ]
+ }
+ },
+ "AgentContainerOperationStatus": {
+ "type": "string",
+ "enum": [
+ "NotStarted",
+ "InProgress",
+ "Succeeded",
+ "Failed"
+ ],
+ "description": "Status of the container operation for a specific version of an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ContainerAgents=V1Preview"
+ ]
+ }
+ },
+ "AgentContainerStatus": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Starting",
+ "Running",
+ "Stopping",
+ "Stopped",
+ "Failed",
+ "Deleting",
+ "Deleted",
+ "Updating"
+ ]
+ }
+ ],
+ "description": "Status of the container of a specific version of an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ContainerAgents=V1Preview"
+ ]
+ }
+ },
+ "AgentDataGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "agent_name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "The source type for this source, which is Agent."
+ },
+ "agent_name": {
+ "type": "string",
+ "description": "The agent name to fetch instructions from."
+ },
+ "agent_version": {
+ "type": "string",
+ "description": "The agent version. If not specified, the latest version is used."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DataGenerationJobSource"
+ }
+ ],
+ "description": "Agent source for data generation jobs — references an agent to fetch instructions and metadata from.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "AgentDefinition": {
+ "type": "object",
+ "required": [
+ "kind"
+ ],
+ "properties": {
+ "kind": {
+ "$ref": "#/components/schemas/AgentKind"
+ },
+ "rai_config": {
+ "$ref": "#/components/schemas/RaiConfig",
+ "description": "Configuration for Responsible AI (RAI) content filtering and safety features."
+ }
+ },
+ "discriminator": {
+ "propertyName": "kind",
+ "mapping": {
+ "hosted": "#/components/schemas/HostedAgentDefinition",
+ "prompt": "#/components/schemas/PromptAgentDefinition",
+ "workflow": "#/components/schemas/WorkflowAgentDefinition",
+ "external": "#/components/schemas/ExternalAgentDefinition",
+ "container_app": "#/components/schemas/ContainerAppAgentDefinition"
+ }
+ }
+ },
+ "AgentDefinitionOptInKeys": {
+ "type": "string",
+ "enum": [
+ "WorkflowAgents=V1Preview",
+ "ExternalAgents=V1Preview",
+ "DraftAgents=V1Preview",
+ "HostedAgents=V1Preview",
+ "ContainerAgents=V1Preview"
+ ],
+ "description": "Feature opt-in keys for agent definition operations supporting hosted or workflow agents."
+ },
+ "AgentEndpointAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationSchemeType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "Entra": "#/components/schemas/EntraAuthorizationScheme",
+ "BotService": "#/components/schemas/BotServiceAuthorizationScheme",
+ "BotServiceRbac": "#/components/schemas/BotServiceRbacAuthorizationScheme",
+ "BotServiceTenant": "#/components/schemas/BotServiceTenantAuthorizationScheme"
+ }
+ }
+ },
+ "AgentEndpointAuthorizationSchemeType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Entra",
+ "BotService",
+ "BotServiceRbac",
+ "BotServiceTenant"
+ ]
+ }
+ ]
+ },
+ "AgentEndpointConfig": {
+ "type": "object",
+ "properties": {
+ "version_selector": {
+ "$ref": "#/components/schemas/VersionSelector",
+ "description": "The version selector of the agent endpoint determines how traffic is routed to different versions of the agent."
+ },
+ "protocols": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentEndpointProtocol"
+ },
+ "description": "Deprecated: Use protocol_configuration instead. The presence of a key in protocol_configuration declares the protocol is enabled."
+ },
+ "protocol_configuration": {
+ "$ref": "#/components/schemas/ProtocolConfiguration",
+ "description": "Per-protocol configuration for the agent endpoint."
+ },
+ "authorization_schemes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ },
+ "description": "The authorization schemes supported by the agent endpoint"
+ }
+ }
+ },
+ "AgentEndpointConfigUpdate": {
+ "type": "object",
+ "properties": {
+ "version_selector": {
+ "$ref": "#/components/schemas/VersionSelectorUpdate",
+ "description": "The version selector of the agent endpoint determines how traffic is routed to different versions of the agent."
+ },
+ "protocols": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentEndpointProtocol"
+ },
+ "description": "Deprecated: Use protocol_configuration instead. The presence of a key in protocol_configuration declares the protocol is enabled."
+ },
+ "protocol_configuration": {
+ "$ref": "#/components/schemas/ProtocolConfiguration",
+ "description": "Per-protocol configuration for the agent endpoint."
+ },
+ "authorization_schemes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ },
+ "description": "The authorization schemes supported by the agent endpoint"
+ }
+ }
+ },
+ "AgentEndpointProtocol": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "activity",
+ "responses",
+ "a2a",
+ "mcp",
+ "invocations",
+ "invocations_ws"
+ ]
+ }
+ ]
+ },
+ "AgentEvaluation": {
+ "type": "object",
+ "required": [
+ "id",
+ "status"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Identifier of the agent evaluation run."
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the agent evaluation. Options: Running, Completed, Failed."
+ },
+ "error": {
+ "type": "string",
+ "description": "The reason of the request failure for the long running process, if applicable."
+ },
+ "result": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AgentEvaluationResult"
+ },
+ "description": "The agent evaluation result."
+ }
+ },
+ "description": "Evaluation response for agent evaluation run."
+ },
+ "AgentEvaluationRedactionConfiguration": {
+ "type": "object",
+ "properties": {
+ "redactScoreProperties": {
+ "type": "boolean",
+ "description": "Redact score properties. If not specified, the default is to redact in production."
+ }
+ },
+ "description": "The redaction configuration will allow the user to control what is redacted."
+ },
+ "AgentEvaluationRequest": {
+ "type": "object",
+ "required": [
+ "runId",
+ "evaluators",
+ "appInsightsConnectionString"
+ ],
+ "properties": {
+ "runId": {
+ "type": "string",
+ "description": "Identifier of the agent run."
+ },
+ "threadId": {
+ "type": "string",
+ "description": "Identifier of the agent thread. This field is mandatory currently, but it will be optional in the future."
+ },
+ "evaluators": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/EvaluatorConfiguration"
+ },
+ "description": "Evaluators to be used for the evaluation."
+ },
+ "samplingConfiguration": {
+ "$ref": "#/components/schemas/AgentEvaluationSamplingConfiguration",
+ "description": "Sampling configuration for the evaluation."
+ },
+ "redactionConfiguration": {
+ "$ref": "#/components/schemas/AgentEvaluationRedactionConfiguration",
+ "description": "Redaction configuration for the evaluation."
+ },
+ "appInsightsConnectionString": {
+ "type": "string",
+ "description": "Pass the AppInsights connection string to the agent evaluation for the evaluation results and the errors logs."
+ }
+ },
+ "description": "Evaluation request for agent run."
+ },
+ "AgentEvaluationResult": {
+ "type": "object",
+ "required": [
+ "evaluator",
+ "evaluatorId",
+ "score",
+ "status",
+ "runId"
+ ],
+ "properties": {
+ "evaluator": {
+ "type": "string",
+ "description": "Evaluator's name. This is the name of the evaluator that was used to evaluate the agent's completion."
+ },
+ "evaluatorId": {
+ "type": "string",
+ "description": "Identifier of the evaluator."
+ },
+ "score": {
+ "type": "number",
+ "format": "float",
+ "description": "Score of the given evaluator. No restriction on range."
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the evaluator result. Options: Running, Completed, Failed, NotApplicable."
+ },
+ "reason": {
+ "type": "string",
+ "description": "Reasoning for the evaluation result."
+ },
+ "version": {
+ "type": "string",
+ "description": "Version of the evaluator that was used to evaluate the agent's completion."
+ },
+ "threadId": {
+ "type": "string",
+ "description": "The unique identifier of the thread."
+ },
+ "runId": {
+ "type": "string",
+ "description": "The unique identifier of the run."
+ },
+ "error": {
+ "type": "string",
+ "description": "A string explaining why there was an error, if applicable."
+ },
+ "additionalDetails": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Additional properties relevant to the evaluator. These will differ between evaluators."
+ }
+ },
+ "description": "Result for the agent evaluation evaluator run."
+ },
+ "AgentEvaluationSamplingConfiguration": {
+ "type": "object",
+ "required": [
+ "name",
+ "samplingPercent",
+ "maxRequestRate"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the sampling strategy."
+ },
+ "samplingPercent": {
+ "type": "number",
+ "format": "float",
+ "description": "Percentage of sampling per hour (0-100)."
+ },
+ "maxRequestRate": {
+ "type": "number",
+ "format": "float",
+ "description": "Maximum request rate per hour (0 to 1000)."
+ }
+ },
+ "description": "Definition for sampling strategy."
+ },
+ "AgentEvaluationSuiteJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "agent_name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "The source type for this source, which is Agent."
+ },
+ "agent_name": {
+ "type": "string",
+ "description": "The agent name to fetch instructions from."
+ },
+ "agent_version": {
+ "type": "string",
+ "description": "The agent version. If not specified, the latest version is used."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationSuiteJobSource"
+ }
+ ],
+ "description": "Agent source for evaluation suite generation jobs — references an agent to fetch instructions and metadata from.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "AgentEvaluatorGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "agent_name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "The source type for this source, which is Agent."
+ },
+ "agent_name": {
+ "type": "string",
+ "description": "The agent name to fetch instructions from."
+ },
+ "agent_version": {
+ "type": "string",
+ "description": "The agent version. If not specified, the latest version is used."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
+ }
+ ],
+ "description": "Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "AgentFilterTraceSource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent_filter"
+ ],
+ "description": "The type of trace source, always `agent_filter`."
+ },
+ "agent_id": {
+ "type": "string",
+ "description": "The identifier of the agent to filter traces by."
+ },
+ "agent_name": {
+ "type": "string",
+ "description": "The name of the agent to filter traces by."
+ },
+ "agent_version": {
+ "type": "string",
+ "description": "The version of the agent to filter traces by."
+ },
+ "start_time": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "Start time for the trace query window, expressed as a Unix timestamp (seconds)."
+ },
+ "end_time": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "End time for the trace query window, expressed as a Unix timestamp (seconds)."
+ },
+ "max_traces": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of traces to sample. Must be greater than 0."
+ },
+ "filter_strategy": {
+ "$ref": "#/components/schemas/FilterStrategyType",
+ "description": "The strategy used to filter traces."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TraceSource"
+ }
+ ],
+ "description": "A trace source that selects traces by agent reference with time-based filtering."
+ },
+ "AgentId": {
+ "type": "object",
+ "required": [
+ "type",
+ "name",
+ "version"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent_id"
+ ]
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The name of the agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version identifier of the agent."
+ }
+ }
+ },
+ "AgentIdentity": {
+ "type": "object",
+ "required": [
+ "principal_id",
+ "client_id"
+ ],
+ "properties": {
+ "principal_id": {
+ "type": "string",
+ "description": "The principal ID of the agent instance"
+ },
+ "client_id": {
+ "type": "string",
+ "description": "The client ID of the agent instance. Also referred to as the instance ID"
+ },
+ "status": {
+ "$ref": "#/components/schemas/AgentIdentityStatus",
+ "description": "The status of the agent identity. Present for both the agent instance identity and the agent blueprint."
+ }
+ }
+ },
+ "AgentIdentityStatus": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "active",
+ "disabled"
+ ]
+ }
+ ],
+ "description": "The status of an agent identity, applicable to both the agent instance identity and the agent blueprint."
+ },
+ "AgentKind": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "prompt",
+ "hosted",
+ "workflow",
+ "external",
+ "container_app"
+ ]
+ }
+ ]
+ },
+ "AgentObject": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "name",
+ "state",
+ "versions"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "The object type, which is always 'agent'."
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the agent."
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 63,
+ "description": "The name of the agent."
+ },
+ "state": {
+ "$ref": "#/components/schemas/AgentState",
+ "description": "The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests.",
+ "readOnly": true
+ },
+ "versions": {
+ "type": "object",
+ "properties": {
+ "latest": {
+ "$ref": "#/components/schemas/AgentVersionObject"
+ }
+ },
+ "required": [
+ "latest"
+ ],
+ "description": "The latest version of the agent."
+ },
+ "agent_endpoint": {
+ "$ref": "#/components/schemas/AgentEndpointConfig",
+ "description": "The endpoint configuration for the agent"
+ },
+ "instance_identity": {
+ "$ref": "#/components/schemas/AgentIdentity",
+ "description": "The instance identity of the agent",
+ "readOnly": true
+ },
+ "blueprint": {
+ "$ref": "#/components/schemas/AgentIdentity",
+ "description": "The blueprint for the agent",
+ "readOnly": true
+ },
+ "blueprint_reference": {
+ "$ref": "#/components/schemas/AgentBlueprintReference",
+ "description": "The blueprint for the agent",
+ "readOnly": true
+ },
+ "agent_card": {
+ "$ref": "#/components/schemas/AgentCard"
+ }
+ }
+ },
+ "AgentReference": {
+ "type": "object",
+ "required": [
+ "type",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent_reference"
+ ]
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The name of the agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version identifier of the agent."
+ }
+ }
+ },
+ "AgentSessionResource": {
+ "type": "object",
+ "required": [
+ "agent_session_id",
+ "version_indicator",
+ "status",
+ "created_at",
+ "last_accessed_at",
+ "expires_at"
+ ],
+ "properties": {
+ "agent_session_id": {
+ "type": "string",
+ "description": "The session identifier."
+ },
+ "version_indicator": {
+ "$ref": "#/components/schemas/VersionIndicator",
+ "description": "The version indicator determining which agent version backs this session."
+ },
+ "status": {
+ "$ref": "#/components/schemas/AgentSessionStatus",
+ "description": "The current status of the session."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) when the session was created.",
+ "readOnly": true
+ },
+ "last_accessed_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) when the session was last accessed.",
+ "readOnly": true
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).",
+ "readOnly": true
+ }
+ },
+ "description": "An agent session providing a long-lived compute sandbox for hosted agent invocations."
+ },
+ "AgentSessionStatus": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "creating",
+ "active",
+ "idle",
+ "updating",
+ "failed",
+ "deleting",
+ "deleted",
+ "expired"
+ ]
+ }
+ ],
+ "description": "The status of an agent session."
+ },
+ "AgentState": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "enabled",
+ "disabled"
+ ]
+ }
+ ],
+ "description": "The operational state of an agent."
+ },
+ "AgentTaxonomyInput": {
+ "type": "object",
+ "required": [
+ "type",
+ "target",
+ "riskCategories"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "Input type of the evaluation taxonomy."
+ },
+ "target": {
+ "$ref": "#/components/schemas/Target",
+ "description": "Target configuration for the agent."
+ },
+ "riskCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RiskCategory"
+ },
+ "description": "List of risk categories to evaluate against."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInput"
+ }
+ ],
+ "description": "Input configuration for the evaluation taxonomy when the input type is agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "AgentTaxonomyInputUpdate": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ],
+ "description": "Input type of the evaluation taxonomy."
+ },
+ "target": {
+ "$ref": "#/components/schemas/TargetUpdate",
+ "description": "Target configuration for the agent."
+ },
+ "riskCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RiskCategory"
+ },
+ "description": "List of risk categories to evaluate against."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInputUpdate"
+ }
+ ],
+ "description": "Input configuration for the evaluation taxonomy when the input type is agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "AgentVersionObject": {
+ "type": "object",
+ "required": [
+ "metadata",
+ "object",
+ "id",
+ "name",
+ "version",
+ "created_at",
+ "definition"
+ ],
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "agent.version"
+ ],
+ "description": "The object type, which is always 'agent.version'."
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the agent version."
+ },
+ "name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The name of the agent. Name can be used to retrieve/update/delete the agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version identifier of the agent. Agents are immutable and every update creates a new version while keeping the name same."
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The Unix timestamp (seconds) when the agent was created."
+ },
+ "definition": {
+ "$ref": "#/components/schemas/AgentDefinition"
+ },
+ "draft": {
+ "type": "boolean",
+ "description": "Whether this agent version is a draft (candidate) rather than a release. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to false.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DraftAgents=V1Preview"
+ ]
+ },
+ "default": false
+ },
+ "status": {
+ "$ref": "#/components/schemas/AgentVersionStatus",
+ "description": "The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For hosted agents, reflects infrastructure readiness."
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error",
+ "description": "Error details if the agent version provisioning failed."
+ },
+ "instance_identity": {
+ "$ref": "#/components/schemas/AgentIdentity",
+ "description": "The instance identity of the agent",
+ "readOnly": true
+ },
+ "blueprint": {
+ "$ref": "#/components/schemas/AgentIdentity",
+ "description": "The blueprint for the agent",
+ "readOnly": true
+ },
+ "blueprint_reference": {
+ "$ref": "#/components/schemas/AgentBlueprintReference",
+ "description": "The blueprint for the agent",
+ "readOnly": true
+ },
+ "agent_guid": {
+ "type": "string",
+ "description": "The unique GUID identifier of the agent.",
+ "readOnly": true
+ }
+ }
+ },
+ "AgentVersionStatus": {
+ "type": "string",
+ "enum": [
+ "creating",
+ "active",
+ "failed",
+ "deleting",
+ "deleted"
+ ],
+ "description": "The provisioning status of an agent version."
+ },
+ "AgenticIdentityPreviewCredentials": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AgenticIdentityToken_Preview"
+ ],
+ "description": "The credential type",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BaseCredentials"
+ }
+ ],
+ "description": "Agentic identity credential definition"
+ },
+ "ApiErrorResponse": {
+ "type": "object",
+ "required": [
+ "error"
+ ],
+ "properties": {
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error"
+ }
+ },
+ "description": "Error response for API failures."
+ },
+ "ApiKeyCredentials": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "ApiKey"
+ ],
+ "description": "The credential type",
+ "readOnly": true
+ },
+ "key": {
+ "type": "string",
+ "description": "API Key",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BaseCredentials"
+ }
+ ],
+ "description": "API Key Credential definition"
+ },
+ "ArtifactProfile": {
+ "type": "object",
+ "required": [
+ "category"
+ ],
+ "properties": {
+ "category": {
+ "$ref": "#/components/schemas/FoundryModelArtifactProfileCategory",
+ "description": "The category of the artifact profile"
+ },
+ "signals": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FoundryModelArtifactProfileSignal"
+ },
+ "description": "Signals detected in the model artifact"
+ }
+ },
+ "description": "Artifact profile of the model",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "AssetCredentialResponse": {
+ "type": "object",
+ "required": [
+ "blobReference"
+ ],
+ "properties": {
+ "blobReference": {
+ "$ref": "#/components/schemas/BlobReference",
+ "description": "Credential info to access the storage account."
+ }
+ },
+ "description": "Represents a reference to a blob for consumption"
+ },
+ "AssetId": {
+ "type": "string",
+ "description": "Identifier of a saved asset."
+ },
+ "AssistantMessage": {
+ "type": "object",
+ "required": [
+ "role",
+ "content"
+ ],
+ "properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "assistant"
+ ],
+ "description": "Indicates this is an assistant message."
+ },
+ "content": {
+ "type": "string",
+ "description": "Response content generated by the assistant."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Message"
+ }
+ ],
+ "description": "A message generated by the assistant in response to previous messages."
+ },
+ "AttackStrategy": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "easy",
+ "moderate",
+ "difficult",
+ "ascii_art",
+ "ascii_smuggler",
+ "atbash",
+ "base64",
+ "binary",
+ "caesar",
+ "character_space",
+ "jailbreak",
+ "ansi_attack",
+ "character_swap",
+ "suffix_append",
+ "string_join",
+ "unicode_confusable",
+ "unicode_substitution",
+ "diacritic",
+ "flip",
+ "leetspeak",
+ "rot13",
+ "morse",
+ "url",
+ "baseline",
+ "indirect_jailbreak",
+ "tense",
+ "multi_turn",
+ "crescendo"
+ ]
+ }
+ ],
+ "description": "Strategies for attacks.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ },
+ "Azure.Core.Foundations.Error": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "One of a server-defined set of error codes."
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable representation of the error."
+ },
+ "target": {
+ "type": "string",
+ "description": "The target of the error."
+ },
+ "details": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.Error"
+ },
+ "description": "An array of details about specific errors that led to this reported error."
+ },
+ "innererror": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.InnerError",
+ "description": "An object containing more specific information than the current object about the error."
+ }
+ },
+ "description": "The error object."
+ },
+ "Azure.Core.Foundations.ErrorResponse": {
+ "type": "object",
+ "required": [
+ "error"
+ ],
+ "properties": {
+ "error": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.Error",
+ "description": "The error object."
+ }
+ },
+ "description": "A response containing error details."
+ },
+ "Azure.Core.Foundations.InnerError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "One of a server-defined set of error codes."
+ },
+ "innererror": {
+ "description": "Inner error.",
+ "$ref": "#/components/schemas/Azure.Core.Foundations.InnerError"
+ }
+ },
+ "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors."
+ },
+ "Azure.Core.Foundations.OperationState": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "NotStarted",
+ "Running",
+ "Succeeded",
+ "Failed",
+ "Canceled"
+ ]
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "description": "Enum describing allowed operation states."
+ },
+ "Azure.Core.uuid": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Universally Unique Identifier"
+ },
+ "AzureAIAgentTarget": {
+ "type": "object",
+ "required": [
+ "type",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_agent"
+ ],
+ "description": "The type of target, always `azure_ai_agent`."
+ },
+ "name": {
+ "type": "string",
+ "description": "The unique identifier of the Azure AI agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the Azure AI agent."
+ },
+ "tool_descriptions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolDescription"
+ },
+ "description": "The parameters used to control the sampling behavior of the agent during text generation."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Target"
+ }
+ ],
+ "description": "Represents a target specifying an Azure AI agent."
+ },
+ "AzureAIAgentTargetUpdate": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_agent"
+ ],
+ "description": "The type of target, always `azure_ai_agent`."
+ },
+ "name": {
+ "type": "string",
+ "description": "The unique identifier of the Azure AI agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the Azure AI agent."
+ },
+ "tool_descriptions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolDescription"
+ },
+ "description": "The parameters used to control the sampling behavior of the agent during text generation."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TargetUpdate"
+ }
+ ],
+ "description": "Represents a target specifying an Azure AI agent."
+ },
+ "AzureAIBenchmarkDataSourceConfig": {
+ "type": "object",
+ "required": [
+ "scenario",
+ "benchmark_name"
+ ],
+ "properties": {
+ "scenario": {
+ "type": "string",
+ "enum": [
+ "benchmark_preview"
+ ],
+ "description": "Data schema scenario, always `benchmark` for benchmark evaluations."
+ },
+ "benchmark_name": {
+ "type": "string",
+ "description": "The name of the benchmark specification."
+ },
+ "benchmark_version": {
+ "type": "string",
+ "description": "The version of the benchmark specification (e.g., '0.1'). Latest version if not specified."
+ },
+ "grader_model": {
+ "type": "string",
+ "description": "Optional grader model for benchmarks that use model graders, Required when the benchmark's testing_criteria uses a model grader type."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ }
+ ],
+ "description": "Data source configuration for benchmark evaluations."
+ },
+ "AzureAIBenchmarkPreviewEvalRunDataSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "target"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_benchmark_preview"
+ ],
+ "description": "The type of data source, always `azure_ai_benchmark_preview`."
+ },
+ "input_messages": {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference",
+ "description": "Input messages configuration."
+ },
+ "target": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/AzureAIModelTarget"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIAgentTarget"
+ }
+ ],
+ "description": "The target model or agent to evaluate against the benchmark.\nWhen using `azure_ai_model` target, `sampling_params` must not be provided;\ninference parameters are auto-filled from the benchmark specification stored in eval group properties."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Represents a data source for benchmark evaluation runs."
+ },
+ "AzureAIDataSourceConfig": {
+ "type": "object",
+ "required": [
+ "type",
+ "scenario"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_source"
+ ],
+ "description": "The object type, which is always `azure_ai_source`."
+ },
+ "scenario": {
+ "type": "string",
+ "enum": [
+ "red_team",
+ "responses",
+ "traces_preview",
+ "synthetic_data_gen_preview",
+ "benchmark_preview"
+ ],
+ "description": "Data schema scenario."
+ }
+ },
+ "discriminator": {
+ "propertyName": "scenario",
+ "mapping": {
+ "benchmark_preview": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DataSourceConfig"
+ }
+ ],
+ "description": "Base data source configuration for Azure AI evaluation scenarios."
+ },
+ "AzureAIModelTarget": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_model"
+ ],
+ "description": "The type of target, always `azure_ai_model`."
+ },
+ "model": {
+ "type": "string",
+ "description": "The unique identifier of the Azure AI model."
+ },
+ "sampling_params": {
+ "$ref": "#/components/schemas/ModelSamplingParams",
+ "description": "The parameters used to control the sampling behavior of the model during text generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Target"
+ }
+ ],
+ "description": "Represents a target specifying an Azure AI model for operations requiring model selection."
+ },
+ "AzureAIModelTargetUpdate": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_model"
+ ],
+ "description": "The type of target, always `azure_ai_model`."
+ },
+ "model": {
+ "type": "string",
+ "description": "The unique identifier of the Azure AI model."
+ },
+ "sampling_params": {
+ "$ref": "#/components/schemas/ModelSamplingParams",
+ "description": "The parameters used to control the sampling behavior of the model during text generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TargetUpdate"
+ }
+ ],
+ "description": "Represents a target specifying an Azure AI model for operations requiring model selection."
+ },
+ "AzureAIResponsesEvalRunDataSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "item_generation_params",
+ "max_runs_hourly",
+ "event_configuration_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_responses"
+ ],
+ "description": "The type of data source, always `azure_ai_responses`."
+ },
+ "item_generation_params": {
+ "$ref": "#/components/schemas/ResponseRetrievalItemGenerationParams",
+ "description": "The parameters for item generation."
+ },
+ "max_runs_hourly": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of evaluation runs allowed per hour."
+ },
+ "event_configuration_id": {
+ "type": "string",
+ "description": "The event configuration name associated with this evaluation run."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Represents a data source for evaluation runs that are specific to Continuous Evaluation scenarios."
+ },
+ "AzureAISearchIndex": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AzureSearch"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Index"
+ }
+ ],
+ "description": "Azure AI Search Index Definition"
+ },
+ "AzureAISearchIndexUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AzureSearch"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/IndexUpdate"
+ }
+ ],
+ "description": "Azure AI Search Index Definition"
+ },
+ "AzureAISearchQueryType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "simple",
+ "semantic",
+ "vector",
+ "vector_simple_hybrid",
+ "vector_semantic_hybrid"
+ ]
+ }
+ ],
+ "description": "Available query types for Azure AI Search tool."
+ },
+ "AzureAISearchTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "azure_ai_search"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_search"
+ ],
+ "description": "The object type, which is always 'azure_ai_search'."
+ },
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "azure_ai_search": {
+ "$ref": "#/components/schemas/AzureAISearchToolResource",
+ "description": "The azure ai search index resource."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for an Azure AI search tool as used to configure an agent."
+ },
+ "AzureAISearchToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_search_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "An Azure AI Search tool call."
+ },
+ "AzureAISearchToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_search_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Azure AI Search tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of an Azure AI Search tool call."
+ },
+ "AzureAISearchToolResource": {
+ "type": "object",
+ "required": [
+ "indexes"
+ ],
+ "properties": {
+ "indexes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AISearchIndexResource"
+ },
+ "maxItems": 1,
+ "description": "The indices attached to this agent. There can be a maximum of 1 index\nresource attached to the agent."
+ }
+ },
+ "description": "A set of index resources used by the `azure_ai_search` tool."
+ },
+ "AzureAISearchToolboxTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "azure_ai_search"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_search"
+ ]
+ },
+ "azure_ai_search": {
+ "$ref": "#/components/schemas/AzureAISearchToolResource",
+ "description": "The azure ai search index resource."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "An Azure AI Search tool stored in a toolbox."
+ },
+ "AzureAITraceDataSourcePreviewEvalRunDataSource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_ai_trace_data_source_preview"
+ ],
+ "description": "The type of data source, always `azure_ai_trace_data_source_preview`."
+ },
+ "trace_source": {
+ "$ref": "#/components/schemas/TraceSource",
+ "description": "The trace source that defines how traces are selected for evaluation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "A wrapper data source that contains a polymorphic trace source to specify how traces are selected for evaluation."
+ },
+ "AzureContentFilterBlocklistIdResult": {
+ "type": "object",
+ "required": [
+ "id",
+ "filtered"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the custom blocklist."
+ },
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the blocklist resulted in filtering."
+ }
+ },
+ "description": "A content filter blocklist ID result."
+ },
+ "AzureContentFilterBlocklistResult": {
+ "type": "object",
+ "required": [
+ "filtered"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether any blocklist resulted in filtering."
+ },
+ "details": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AzureContentFilterBlocklistIdResult"
+ },
+ "description": "The pairs of individual blocklist IDs and their filtering results."
+ }
+ },
+ "description": "A collection of filtering results for configured custom blocklists."
+ },
+ "AzureContentFilterCitation": {
+ "type": "object",
+ "properties": {
+ "license": {
+ "type": "string",
+ "description": "The license associated with the detection."
+ },
+ "url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL associated with the license."
+ }
+ },
+ "description": "Citation details for protected material detection."
+ },
+ "AzureContentFilterCompletionTextSpan": {
+ "type": "object",
+ "required": [
+ "completion_start_offset",
+ "completion_end_offset"
+ ],
+ "properties": {
+ "completion_start_offset": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Offset of the UTF32 code point which begins the span."
+ },
+ "completion_end_offset": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Offset of the first UTF32 code point which is excluded from the span."
+ }
+ },
+ "description": "A representation of a span of completion text as used by Azure OpenAI content filter results."
+ },
+ "AzureContentFilterCompletionTextSpanDetectionResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected",
+ "details"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the content category was detected."
+ },
+ "details": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpan"
+ },
+ "description": "Detailed information about the detected completion text spans."
+ }
+ },
+ "description": "A content filter detection result with completion text span details."
+ },
+ "AzureContentFilterDetectionResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the content category was detected."
+ }
+ },
+ "description": "A content filter result indicating whether the content was detected and filtered."
+ },
+ "AzureContentFilterDetectionWithCitationResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the content category was detected."
+ },
+ "citation": {
+ "$ref": "#/components/schemas/AzureContentFilterCitation",
+ "description": "Citation details describing the associated license and its location."
+ }
+ },
+ "description": "A content filter detection result that includes citation information for protected material."
+ },
+ "AzureContentFilterDetectionWithReasonResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the content category was detected."
+ },
+ "reason": {
+ "type": "string",
+ "description": "A human-readable explanation of why the detection result was produced."
+ }
+ },
+ "description": "A content filter detection result that includes a reason description."
+ },
+ "AzureContentFilterError": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "integer",
+ "format": "int32",
+ "description": "A machine-readable error code."
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable error message."
+ }
+ },
+ "description": "Error details from the content filtering system."
+ },
+ "AzureContentFilterPersonallyIdentifiableInformationResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether PII was detected in the content."
+ },
+ "sub_categories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AzureContentFilterPiiSubCategoryResult"
+ },
+ "description": "Detailed results for individual PII subcategories."
+ }
+ },
+ "description": "A content filter detection result for Personally Identifiable Information."
+ },
+ "AzureContentFilterPiiSubCategoryResult": {
+ "type": "object",
+ "required": [
+ "sub_category",
+ "filtered",
+ "detected"
+ ],
+ "properties": {
+ "sub_category": {
+ "type": "string",
+ "description": "The PII subcategory that was evaluated."
+ },
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered for this subcategory."
+ },
+ "detected": {
+ "type": "boolean",
+ "description": "Whether the subcategory was detected in the content."
+ }
+ },
+ "description": "Result details for an individual PII subcategory."
+ },
+ "AzureContentFilterResultsForResponses": {
+ "type": "object",
+ "properties": {
+ "sexual": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
+ "description": "Severity result for sexual content."
+ },
+ "hate": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
+ "description": "Severity result for hate content."
+ },
+ "violence": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
+ "description": "Severity result for violence content."
+ },
+ "self_harm": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
+ "description": "Severity result for self-harm content."
+ },
+ "profanity": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
+ "description": "Detection result for profanity."
+ },
+ "custom_blocklists": {
+ "$ref": "#/components/schemas/AzureContentFilterBlocklistResult",
+ "description": "Results for configured custom blocklists."
+ },
+ "jailbreak": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
+ "description": "Detection result for jailbreak attempts."
+ },
+ "task_adherence": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionWithReasonResult",
+ "description": "Detection result for task adherence evaluation."
+ },
+ "protected_material_text": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
+ "description": "Detection result for protected material text."
+ },
+ "protected_material_code": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionWithCitationResult",
+ "description": "Detection result for protected material code with citation."
+ },
+ "ungrounded_material": {
+ "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult",
+ "description": "Detection result for ungrounded material with completion text span details."
+ },
+ "personally_identifiable_information": {
+ "$ref": "#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult",
+ "description": "Detection result for Personally Identifiable Information."
+ },
+ "indirect_attack": {
+ "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
+ "description": "Detection result for indirect attacks."
+ },
+ "error": {
+ "$ref": "#/components/schemas/AzureContentFilterError",
+ "description": "Error details if content filtering evaluation failed."
+ }
+ },
+ "description": "Content filter results for the Responses API."
+ },
+ "AzureContentFilterSeverity": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "safe",
+ "low",
+ "medium",
+ "high"
+ ]
+ }
+ ],
+ "description": "Ratings for the intensity and risk level of harmful content."
+ },
+ "AzureContentFilterSeverityResult": {
+ "type": "object",
+ "required": [
+ "filtered",
+ "severity"
+ ],
+ "properties": {
+ "filtered": {
+ "type": "boolean",
+ "description": "Whether the content was filtered."
+ },
+ "severity": {
+ "$ref": "#/components/schemas/AzureContentFilterSeverity",
+ "description": "The severity level of the content."
+ }
+ },
+ "description": "A content filter result indicating severity level and whether content was filtered."
+ },
+ "AzureFunctionBinding": {
+ "type": "object",
+ "required": [
+ "type",
+ "storage_queue"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "storage_queue"
+ ],
+ "description": "The type of binding, which is always 'storage_queue'."
+ },
+ "storage_queue": {
+ "$ref": "#/components/schemas/AzureFunctionStorageQueue",
+ "description": "Storage queue."
+ }
+ },
+ "description": "The structure for keeping storage queue name and URI."
+ },
+ "AzureFunctionDefinition": {
+ "type": "object",
+ "required": [
+ "function",
+ "input_binding",
+ "output_binding"
+ ],
+ "properties": {
+ "function": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the function to be called."
+ },
+ "description": {
+ "type": "string",
+ "description": "A description of what the function does, used by the model to choose when and how to call the function."
+ },
+ "parameters": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The parameters the functions accepts, described as a JSON Schema object."
+ }
+ },
+ "required": [
+ "name",
+ "parameters"
+ ],
+ "description": "The definition of azure function and its parameters."
+ },
+ "input_binding": {
+ "$ref": "#/components/schemas/AzureFunctionBinding",
+ "description": "Input storage queue. The queue storage trigger runs a function as messages are added to it."
+ },
+ "output_binding": {
+ "$ref": "#/components/schemas/AzureFunctionBinding",
+ "description": "Output storage queue. The function writes output to this queue when the input items are processed."
+ }
+ },
+ "description": "The definition of Azure function."
+ },
+ "AzureFunctionStorageQueue": {
+ "type": "object",
+ "required": [
+ "queue_service_endpoint",
+ "queue_name"
+ ],
+ "properties": {
+ "queue_service_endpoint": {
+ "type": "string",
+ "description": "URI to the Azure Storage Queue service allowing you to manipulate a queue."
+ },
+ "queue_name": {
+ "type": "string",
+ "description": "The name of an Azure function storage queue."
+ }
+ },
+ "description": "The structure for keeping storage queue name and URI."
+ },
+ "AzureFunctionTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "azure_function"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_function"
+ ],
+ "description": "The object type, which is always 'browser_automation'."
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "azure_function": {
+ "$ref": "#/components/schemas/AzureFunctionDefinition",
+ "description": "The Azure Function Tool definition."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for an Azure Function Tool, as used to configure an Agent."
+ },
+ "AzureFunctionToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_function_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the Azure Function being called."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "An Azure Function tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "AzureFunctionToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "azure_function_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the Azure Function that was called."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Azure Function tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of an Azure Function tool call."
+ },
+ "AzureOpenAIModelConfiguration": {
+ "type": "object",
+ "required": [
+ "type",
+ "modelDeploymentName"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AzureOpenAIModel"
+ ]
+ },
+ "modelDeploymentName": {
+ "type": "string",
+ "description": "Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`)."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RedTeamTargetConfig"
+ }
+ ],
+ "description": "Azure OpenAI model configuration. The API version would be selected by the service for querying the model.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "RedTeams=V1Preview"
+ ]
+ }
+ },
+ "AzureUserSecurityContext": {
+ "type": "object",
+ "properties": {
+ "application_name": {
+ "type": "string",
+ "description": "The name of the application. Sensitive personal information should not be included in this field."
+ },
+ "end_user_id": {
+ "type": "string",
+ "description": "This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field."
+ },
+ "end_user_tenant_id": {
+ "type": "string",
+ "description": "The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant."
+ },
+ "source_ip": {
+ "type": "string",
+ "description": "Captures the original client's IP address."
+ }
+ },
+ "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud."
+ },
+ "BaseCredentials": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/CredentialType",
+ "description": "The type of credential used by the connection",
+ "readOnly": true
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "ApiKey": "#/components/schemas/ApiKeyCredentials",
+ "AAD": "#/components/schemas/EntraIDCredentials",
+ "CustomKeys": "#/components/schemas/CustomCredential",
+ "SAS": "#/components/schemas/SASCredentials",
+ "None": "#/components/schemas/NoAuthenticationCredentials",
+ "AgenticIdentityToken_Preview": "#/components/schemas/AgenticIdentityPreviewCredentials"
+ }
+ },
+ "description": "A base class for connection credentials"
+ },
+ "BingCustomSearchConfiguration": {
+ "type": "object",
+ "required": [
+ "project_connection_id",
+ "instance_name"
+ ],
+ "properties": {
+ "project_connection_id": {
+ "type": "string",
+ "description": "Project connection id for grounding with bing search"
+ },
+ "instance_name": {
+ "type": "string",
+ "description": "Name of the custom configuration instance given to config."
+ },
+ "market": {
+ "type": "string",
+ "description": "The market where the results come from."
+ },
+ "set_lang": {
+ "type": "string",
+ "description": "The language to use for user interface strings when calling Bing API."
+ },
+ "count": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The number of search results to return in the bing api response"
+ },
+ "freshness": {
+ "type": "string",
+ "description": "Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters)."
+ }
+ },
+ "description": "A bing custom search configuration.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingCustomSearchPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "bing_custom_search_preview"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_custom_search_preview"
+ ],
+ "description": "The object type, which is always 'bing_custom_search_preview'."
+ },
+ "bing_custom_search_preview": {
+ "$ref": "#/components/schemas/BingCustomSearchToolParameters",
+ "description": "The bing custom search tool parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for a Bing custom search tool as used to configure an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingCustomSearchToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_custom_search_preview_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "A Bing custom search tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingCustomSearchToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_custom_search_preview_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Bing custom search tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of a Bing custom search tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingCustomSearchToolParameters": {
+ "type": "object",
+ "required": [
+ "search_configurations"
+ ],
+ "properties": {
+ "search_configurations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/BingCustomSearchConfiguration"
+ },
+ "maxItems": 1,
+ "description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
+ }
+ },
+ "description": "The bing custom search tool parameters.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BingGroundingSearchConfiguration": {
+ "type": "object",
+ "required": [
+ "project_connection_id"
+ ],
+ "properties": {
+ "project_connection_id": {
+ "type": "string",
+ "description": "Project connection id for grounding with bing search"
+ },
+ "market": {
+ "type": "string",
+ "description": "The market where the results come from."
+ },
+ "set_lang": {
+ "type": "string",
+ "description": "The language to use for user interface strings when calling Bing API."
+ },
+ "count": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The number of search results to return in the bing api response"
+ },
+ "freshness": {
+ "type": "string",
+ "description": "Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters)."
+ }
+ },
+ "description": "Search configuration for Bing Grounding"
+ },
+ "BingGroundingSearchToolParameters": {
+ "type": "object",
+ "required": [
+ "search_configurations"
+ ],
+ "properties": {
+ "search_configurations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/BingGroundingSearchConfiguration"
+ },
+ "maxItems": 1,
+ "description": "The search configurations attached to this tool. There can be a maximum of 1\nsearch configuration resource attached to the tool."
+ }
+ },
+ "description": "The bing grounding search tool parameters."
+ },
+ "BingGroundingTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "bing_grounding"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_grounding"
+ ],
+ "description": "The object type, which is always 'bing_grounding'."
+ },
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "bing_grounding": {
+ "$ref": "#/components/schemas/BingGroundingSearchToolParameters",
+ "description": "The bing grounding search tool parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for a bing grounding search tool as used to configure an agent."
+ },
+ "BingGroundingToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_grounding_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "A Bing grounding tool call."
+ },
+ "BingGroundingToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "bing_grounding_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Bing grounding tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of a Bing grounding tool call."
+ },
+ "BlobReference": {
+ "type": "object",
+ "required": [
+ "blobUri",
+ "storageAccountArmId",
+ "credential"
+ ],
+ "properties": {
+ "blobUri": {
+ "type": "string",
+ "format": "uri",
+ "description": "Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path`"
+ },
+ "storageAccountArmId": {
+ "type": "string",
+ "description": "ARM ID of the storage account to use."
+ },
+ "credential": {
+ "$ref": "#/components/schemas/SasCredential",
+ "description": "Credential info to access the storage account."
+ }
+ },
+ "description": "Blob reference details."
+ },
+ "BotServiceAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "BotService"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ }
+ ]
+ },
+ "BotServiceRbacAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "BotServiceRbac"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ }
+ ]
+ },
+ "BotServiceTenantAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "BotServiceTenant"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ }
+ ]
+ },
+ "BrowserAutomationPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "browser_automation_preview"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "browser_automation_preview"
+ ],
+ "description": "The object type, which is always 'browser_automation_preview'."
+ },
+ "browser_automation_preview": {
+ "$ref": "#/components/schemas/BrowserAutomationToolParameters",
+ "description": "The Browser Automation Tool parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "The input definition information for a Browser Automation Tool, as used to configure an Agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationPreviewToolboxTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "browser_automation_preview"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "browser_automation_preview"
+ ]
+ },
+ "browser_automation_preview": {
+ "$ref": "#/components/schemas/BrowserAutomationToolParameters",
+ "description": "The Browser Automation Tool parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A browser automation tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "browser_automation_preview_call"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "A browser automation tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "browser_automation_preview_call_output"
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
+ },
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the browser automation tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of a browser automation tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationToolConnectionParameters": {
+ "type": "object",
+ "required": [
+ "project_connection_id"
+ ],
+ "properties": {
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the project connection to your Azure Playwright resource."
+ }
+ },
+ "description": "Definition of input parameters for the connection used by the Browser Automation Tool.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "BrowserAutomationToolParameters": {
+ "type": "object",
+ "required": [
+ "connection"
+ ],
+ "properties": {
+ "connection": {
+ "$ref": "#/components/schemas/BrowserAutomationToolConnectionParameters",
+ "description": "The project connection parameters associated with the Browser Automation Tool."
+ }
+ },
+ "description": "Definition of input parameters for the Browser Automation Tool.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "CaptureStructuredOutputsTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "outputs"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "capture_structured_outputs"
+ ],
+ "description": "The type of the tool. Always `capture_structured_outputs`."
+ },
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "outputs": {
+ "$ref": "#/components/schemas/StructuredOutputDefinition",
+ "description": "The structured outputs to capture from the model."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A tool for capturing structured outputs"
+ },
+ "ChartCoordinate": {
+ "type": "object",
+ "required": [
+ "x",
+ "y",
+ "size"
+ ],
+ "properties": {
+ "x": {
+ "type": "integer",
+ "format": "int32",
+ "description": "X-axis coordinate."
+ },
+ "y": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Y-axis coordinate."
+ },
+ "size": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Size of the chart element."
+ }
+ },
+ "description": "Coordinates for the analysis chart.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "ChatSummaryMemoryItem": {
+ "type": "object",
+ "required": [
+ "kind"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "enum": [
+ "chat_summary"
+ ],
+ "description": "The kind of the memory item."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MemoryItem"
+ }
+ ],
+ "description": "A memory item containing a summary extracted from conversations.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "ClusterInsightResult": {
+ "type": "object",
+ "required": [
+ "summary",
+ "clusters"
+ ],
+ "properties": {
+ "summary": {
+ "$ref": "#/components/schemas/InsightSummary",
+ "description": "Summary of the insights report."
+ },
+ "clusters": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/InsightCluster"
+ },
+ "description": "List of clusters identified in the insights."
+ },
+ "coordinates": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ChartCoordinate"
+ },
+ "description": " Optional mapping of IDs to 2D coordinates used by the UX for visualization.\n\n The map keys are string identifiers (for example, a cluster id or a sample id)\n and the values are the coordinates and visual size for rendering on a 2D chart.\n\n This property is omitted unless the client requests coordinates (for example,\n by passing `includeCoordinates=true` as a query parameter).\n\n Example:\n ```\n {\n \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 },\n \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 }\n }\n ```\n\n Coordinates are intended only for client-side visualization and do not\n modify the canonical insights results."
+ }
+ },
+ "description": "Insights from the cluster analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "ClusterTokenUsage": {
+ "type": "object",
+ "required": [
+ "inputTokenUsage",
+ "outputTokenUsage",
+ "totalTokenUsage"
+ ],
+ "properties": {
+ "inputTokenUsage": {
+ "type": "integer",
+ "format": "int32",
+ "description": "input token usage"
+ },
+ "outputTokenUsage": {
+ "type": "integer",
+ "format": "int32",
+ "description": "output token usage"
+ },
+ "totalTokenUsage": {
+ "type": "integer",
+ "format": "int32",
+ "description": "total token usage"
+ }
+ },
+ "description": "Token usage for cluster analysis",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "CodeBasedEvaluatorDefinition": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "code"
+ ]
+ },
+ "code_text": {
+ "type": "string",
+ "description": "Inline code text for the evaluator"
+ },
+ "entry_point": {
+ "type": "string",
+ "description": "The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "image_tag": {
+ "type": "string",
+ "description": "The container image tag to use for evaluator code execution",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "blob_uri": {
+ "type": "string",
+ "format": "uri",
+ "description": "The blob URI for the evaluator storage",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluatorDefinition"
+ }
+ ],
+ "description": "Code-based evaluator definition using python code",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "CodeConfiguration": {
+ "type": "object",
+ "required": [
+ "runtime",
+ "entry_point",
+ "dependency_resolution"
+ ],
+ "properties": {
+ "runtime": {
+ "type": "string",
+ "description": "The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13')."
+ },
+ "entry_point": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The entry point command and arguments for the code execution."
+ },
+ "dependency_resolution": {
+ "$ref": "#/components/schemas/CodeDependencyResolution",
+ "description": "How package dependencies are resolved at deployment time. Defaults to `bundled`,\nwhere the caller bundles all dependencies into the uploaded zip and the service\nperforms no remote build. `remote_build` instructs the service to build\ndependencies remotely from the manifest included in the uploaded zip.",
+ "default": "bundled"
+ },
+ "content_hash": {
+ "type": "string",
+ "description": "The SHA-256 hex digest of the uploaded code zip. Set by the service from the `x-ms-code-zip-sha256` request header; read-only in responses and never accepted in request payloads.",
+ "readOnly": true
+ }
+ },
+ "description": "Code-based deployment configuration for a hosted agent."
+ },
+ "CodeDependencyResolution": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "bundled",
+ "remote_build"
+ ]
+ }
+ ],
+ "description": "How package dependencies are resolved at deployment time for a code-based hosted agent."
+ },
+ "CodeInterpreterToolboxTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "code_interpreter"
+ ]
+ },
+ "container": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AutoCodeInterpreterToolParam"
+ }
+ ],
+ "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code, along with an\noptional `memory_limit` setting.\nIf not provided, the service assumes auto."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A code interpreter tool stored in a toolbox."
+ },
+ "CompletionMessageToolCallChunk": {
+ "type": "object",
+ "required": [
+ "id",
+ "type"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The Id for the tool call."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "function"
+ ],
+ "description": "The type of tool call, which is always \"function\"."
+ },
+ "function": {
+ "$ref": "#/components/schemas/FunctionToolCall",
+ "description": "Details of the function tool call, if applicable."
+ }
+ },
+ "description": "Tool call details within a message."
+ },
+ "Connection": {
+ "type": "object",
+ "required": [
+ "name",
+ "id",
+ "type",
+ "target",
+ "isDefault",
+ "credentials",
+ "metadata"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The friendly name of the connection, provided by the user.",
+ "readOnly": true
+ },
+ "id": {
+ "type": "string",
+ "description": "A unique identifier for the connection, generated by the service",
+ "readOnly": true
+ },
+ "type": {
+ "$ref": "#/components/schemas/ConnectionType",
+ "description": "Category of the connection",
+ "readOnly": true
+ },
+ "target": {
+ "type": "string",
+ "description": "The connection URL to be used for this service",
+ "readOnly": true
+ },
+ "isDefault": {
+ "type": "boolean",
+ "description": "Whether the connection is tagged as the default connection of its type",
+ "readOnly": true
+ },
+ "credentials": {
+ "$ref": "#/components/schemas/BaseCredentials",
+ "description": "The credentials used by the connection",
+ "readOnly": true
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Metadata of the connection",
+ "readOnly": true
+ }
+ },
+ "description": "Response from the list and get connections operations"
+ },
+ "ConnectionType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "AzureOpenAI",
+ "AzureBlob",
+ "AzureStorageAccount",
+ "CognitiveSearch",
+ "CosmosDB",
+ "ApiKey",
+ "AppConfig",
+ "AppInsights",
+ "CustomKeys",
+ "RemoteTool_Preview"
+ ]
+ }
+ ],
+ "description": "The Type (or category) of the connection"
+ },
+ "ContainerAppAgentDefinition": {
+ "type": "object",
+ "required": [
+ "kind",
+ "container_protocol_versions",
+ "container_app_resource_id",
+ "ingress_subdomain_suffix"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "enum": [
+ "container_app"
+ ]
+ },
+ "container_protocol_versions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ProtocolVersionRecord"
+ },
+ "description": "The protocols that the agent supports for ingress communication of the containers.",
+ "examples": [
+ [
+ {
+ "protocol": "responses",
+ "version": "v0.1.1"
+ },
+ {
+ "protocol": "a2a",
+ "version": "v0.3.0"
+ }
+ ]
+ ]
+ },
+ "container_app_resource_id": {
+ "type": "string",
+ "description": "The resource ID of the Azure Container App that hosts this agent. Not mutable across versions."
+ },
+ "ingress_subdomain_suffix": {
+ "type": "string",
+ "description": "The suffix to apply to the app subdomain when sending ingress to the agent. This can be a label (e.g., '---current'), a specific revision (e.g., '--0000001'), or empty to use the default endpoint for the container app.",
+ "examples": [
+ "--0000001",
+ "---current",
+ ""
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentDefinition"
+ }
+ ],
+ "description": "The container app agent definition.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ContainerAgents=V1Preview"
+ ]
+ }
+ },
+ "ContainerConfiguration": {
+ "type": "object",
+ "required": [
+ "image"
+ ],
+ "properties": {
+ "image": {
+ "type": "string",
+ "description": "The container image for the hosted agent.",
+ "examples": [
+ "my-registry.azurecr.io/my-hosted-agent:latest"
+ ]
+ }
+ },
+ "description": "Container-based deployment configuration for a hosted agent."
+ },
+ "ContainerDetails": {
+ "type": "object",
+ "required": [
+ "provisioning_state",
+ "state",
+ "health_state",
+ "replicas",
+ "updated_on"
+ ],
+ "properties": {
+ "provisioning_state": {
+ "type": "string",
+ "description": "The provisioning state of the container."
+ },
+ "provisioning_error": {
+ "type": "string",
+ "description": "The provisioning error of the container, if any."
+ },
+ "state": {
+ "type": "string",
+ "description": "The state of the container."
+ },
+ "health_state": {
+ "type": "string",
+ "description": "The health state of the container."
+ },
+ "replicas": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ContainerReplica"
+ },
+ "description": "The list of replicas in the container."
+ },
+ "updated_on": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The last update time of the container."
+ }
+ },
+ "description": "Detailed information about the container.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ContainerAgents=V1Preview"
+ ]
+ }
+ },
+ "ContainerLogKind": {
+ "type": "string",
+ "enum": [
+ "console",
+ "system"
+ ],
+ "description": "The type of logs to stream from a container.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ContainerAgents=V1Preview"
+ ]
+ }
+ },
+ "ContainerReplica": {
+ "type": "object",
+ "required": [
+ "name",
+ "state",
+ "container_state"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the replica."
+ },
+ "state": {
+ "type": "string",
+ "description": "The state of the replica."
+ },
+ "container_state": {
+ "type": "string",
+ "description": "The container state of the replica."
+ }
+ },
+ "description": "Information about a container replica.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ContainerAgents=V1Preview"
+ ]
+ }
+ },
+ "ContentFilterResult": {
+ "type": "object",
+ "required": [
+ "blocked",
+ "source_type",
+ "content_filter_results"
+ ],
+ "properties": {
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the content was blocked by the content filter."
+ },
+ "source_type": {
+ "type": "string",
+ "description": "The source type of the content filter evaluation (e.g., 'prompt', 'response', 'pre_tool_call', 'post_tool_call')."
+ },
+ "content_filter_results": {
+ "$ref": "#/components/schemas/AzureContentFilterResultsForResponses",
+ "description": "The content filter results for this evaluation."
+ },
+ "tool_call_id": {
+ "type": "string",
+ "description": "The ID of the tool call associated with this content filter result, if applicable."
+ }
+ },
+ "description": "A content filter evaluation result for a specific source in the response."
+ },
+ "ContinuousEvaluationRuleAction": {
+ "type": "object",
+ "required": [
+ "type",
+ "evalId"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "continuousEvaluation"
+ ]
+ },
+ "evalId": {
+ "type": "string",
+ "description": "Eval Id to add continuous evaluation runs to."
+ },
+ "maxHourlyRuns": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of evaluation runs allowed per hour."
+ },
+ "samplingRate": {
+ "type": "number",
+ "format": "double",
+ "maximum": 100,
+ "description": "Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the service-default is to evaluate every event, which is equivalent to setting a sampling rate of 100.",
+ "exclusiveMinimum": 0,
+ "default": 100
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationRuleAction"
+ }
+ ],
+ "description": "Evaluation rule action for continuous evaluation."
+ },
+ "ConversationGenPreviewItemGenerationParams": {
+ "type": "object",
+ "required": [
+ "type",
+ "model"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation_gen_preview"
+ ],
+ "description": "The type of item generation parameters, always `conversation_gen_preview`."
+ },
+ "model": {
+ "type": "string",
+ "description": "The model deployment used for simulation, in the format '{connectionName}/modelDeploymentName'."
+ },
+ "max_turns": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of turns per simulated conversation. Defaults to 20.",
+ "default": 20
+ },
+ "num_conversations": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Number of simulated conversations to generate per test scenario. Defaults to 5.",
+ "default": 5
+ },
+ "data_mapping": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Mapping from source fields to response_id field, which is required for retrieving chat history."
+ },
+ "sampling_params": {
+ "$ref": "#/components/schemas/ModelSamplingParams",
+ "description": "Sampling parameters for the conversation generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ItemGenerationParams"
+ }
+ ],
+ "description": "Represents the parameters for conversation simulation item generation."
+ },
+ "ConversationIdTraceSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "conversation_ids"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation_id_source"
+ ],
+ "description": "The type of trace source, always `conversation_id_source`."
+ },
+ "conversation_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Collection of conversation identifiers to filter traces by."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/TraceSource"
+ }
+ ],
+ "description": "A trace source that selects traces by conversation IDs."
+ },
+ "CosmosDBIndex": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "CosmosDBNoSqlVectorStore"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Index"
+ }
+ ],
+ "description": "CosmosDB Vector Store Index Definition"
+ },
+ "CosmosDBIndexUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "CosmosDBNoSqlVectorStore"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/IndexUpdate"
+ }
+ ],
+ "description": "CosmosDB Vector Store Index Definition"
+ },
+ "CreateAgentFromCodeContent": {
+ "type": "object",
+ "properties": {
+ "metadata": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/CreateAgentVersionFromCodeMetadata"
+ }
+ ],
+ "description": "JSON metadata including description and hosted definition."
+ },
+ "code": {
+ "description": "The code zip file (max 250 MB)."
+ }
+ },
+ "required": [
+ "metadata",
+ "code"
+ ]
+ },
+ "CreateAgentFromManifestRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "manifest_id",
+ "parameter_values"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "maxLength": 63,
+ "description": "The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "manifest_id": {
+ "type": "string",
+ "description": "The manifest ID to import the agent version from."
+ },
+ "parameter_values": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The inputs to the manifest that will result in a fully materialized Agent."
+ }
+ }
+ },
+ "CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "definition"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "maxLength": 63,
+ "description": "The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
+ },
+ "state": {
+ "$ref": "#/components/schemas/AgentState",
+ "description": "The initial operational state of the agent. Defaults to 'enabled' if not specified.",
+ "default": "enabled"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "definition": {
+ "$ref": "#/components/schemas/AgentDefinition",
+ "description": "The agent definition. This can be a workflow, hosted agent, or a simple agent definition.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "WorkflowAgents=V1Preview",
+ "ExternalAgents=V1Preview",
+ "DraftAgents=V1Preview"
+ ]
+ }
+ },
+ "blueprint_reference": {
+ "$ref": "#/components/schemas/AgentBlueprintReference",
+ "description": "The blueprint reference for the agent."
+ },
+ "draft": {
+ "type": "boolean",
+ "description": "(Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DraftAgents=V1Preview"
+ ]
+ },
+ "default": false
+ },
+ "agent_endpoint": {
+ "$ref": "#/components/schemas/AgentEndpointConfig",
+ "description": "An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent"
+ },
+ "agent_card": {
+ "$ref": "#/components/schemas/AgentCard",
+ "description": "Optional agent card for the agent"
+ }
+ },
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "WorkflowAgents=V1Preview",
+ "ExternalAgents=V1Preview",
+ "DraftAgents=V1Preview"
+ ]
+ }
+ },
+ "CreateAgentSessionRequest": {
+ "type": "object",
+ "required": [
+ "version_indicator"
+ ],
+ "properties": {
+ "agent_session_id": {
+ "type": "string",
+ "description": "Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. Auto-generated if omitted."
+ },
+ "version_indicator": {
+ "$ref": "#/components/schemas/VersionIndicator",
+ "description": "Determines which agent version backs the session."
+ }
+ },
+ "description": "Request to create a new agent session."
+ },
+ "CreateAgentVersionFromCodeContent": {
+ "type": "object",
+ "properties": {
+ "metadata": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/CreateAgentVersionFromCodeMetadata"
+ }
+ ],
+ "description": "JSON metadata including description and hosted definition."
+ },
+ "code": {
+ "description": "The code zip file (max 250 MB)."
+ }
+ },
+ "required": [
+ "metadata",
+ "code"
+ ]
+ },
+ "CreateAgentVersionFromCodeMetadata": {
+ "type": "object",
+ "required": [
+ "definition"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "definition": {
+ "$ref": "#/components/schemas/HostedAgentDefinition",
+ "description": "The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, and protocol_versions."
+ }
+ },
+ "description": "JSON metadata for code-based agent operations (create, update, create version).\nThe agent name comes from the URL path parameter or the `x-ms-agent-name` header,\nso it is not included in this model.\nThe content hash (SHA-256 of the zip) is carried in the `x-ms-code-zip-sha256` header."
+ },
+ "CreateAgentVersionFromManifestRequest": {
+ "type": "object",
+ "required": [
+ "manifest_id",
+ "parameter_values"
+ ],
+ "properties": {
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "manifest_id": {
+ "type": "string",
+ "description": "The manifest ID to import the agent version from."
+ },
+ "parameter_values": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The inputs to the manifest that will result in a fully materialized Agent."
+ }
+ }
+ },
+ "CreateAgentVersionRequest": {
+ "type": "object",
+ "required": [
+ "definition"
+ ],
+ "properties": {
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
+ },
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the agent."
+ },
+ "definition": {
+ "$ref": "#/components/schemas/AgentDefinition",
+ "description": "The agent definition. This can be a workflow, hosted agent, or a simple agent definition.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "WorkflowAgents=V1Preview",
+ "ExternalAgents=V1Preview",
+ "DraftAgents=V1Preview"
+ ]
+ }
+ },
+ "blueprint_reference": {
+ "$ref": "#/components/schemas/AgentBlueprintReference",
+ "description": "The blueprint reference for the agent."
+ },
+ "draft": {
+ "type": "boolean",
+ "description": "(Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DraftAgents=V1Preview"
+ ]
+ },
+ "default": false
+ }
+ }
+ },
+ "CreateEvalRequest": {
+ "type": "object",
+ "required": [
+ "data_source_config",
+ "testing_criteria"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the evaluation."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "data_source_config": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ }
+ ],
+ "description": "The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation."
+ },
+ "testing_criteria": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
+ }
+ ]
+ },
+ "description": "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}}`)."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ }
+ },
+ "title": "CreateEvalRequest"
+ },
+ "CreateEvalRunRequest": {
+ "type": "object",
+ "required": [
+ "data_source"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the run."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "data_source": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Details about the run's data source."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ },
+ "evaluation_level": {
+ "$ref": "#/components/schemas/EvaluationLevel",
+ "description": "The level at which evaluation is performed. Defaults to 'turn' if not specified.",
+ "default": "turn"
+ }
+ },
+ "title": "CreateEvalRunRequest"
+ },
+ "CreateOrUpdateManagedAgentIdentityBlueprintRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "maxLength": 63,
+ "description": "The unique name that identifies the managed agent identity blueprint.\nName can be used to retrieve/update/delete the managed agent identity blueprint.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
+ }
+ }
+ },
+ "CreateSkillVersionFromFilesBody": {
+ "type": "object",
+ "properties": {
+ "files": {
+ "type": "array",
+ "items": {},
+ "description": "Skill files to upload. Upload a single zip file or multiple individual files with relative paths."
+ },
+ "default": {
+ "type": "boolean",
+ "description": "Whether to set this version as the default. Defaults to false."
+ }
+ },
+ "required": [
+ "files"
+ ]
+ },
+ "CreatedBy": {
+ "type": "object",
+ "properties": {
+ "agent": {
+ "$ref": "#/components/schemas/AgentId",
+ "description": "The agent that created the item."
+ },
+ "response_id": {
+ "type": "string",
+ "description": "The response on which the item is created."
+ }
+ }
+ },
+ "CredentialType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "ApiKey",
+ "AAD",
+ "SAS",
+ "CustomKeys",
+ "None",
+ "AgenticIdentityToken_Preview"
+ ]
+ }
+ ],
+ "description": "The credential type used by the connection"
+ },
+ "CronTrigger": {
+ "type": "object",
+ "required": [
+ "type",
+ "expression"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Cron"
+ ]
+ },
+ "expression": {
+ "type": "string",
+ "description": "Cron expression that defines the schedule frequency."
+ },
+ "timeZone": {
+ "type": "string",
+ "description": "Time zone for the cron schedule. Defaults to `UTC`.",
+ "default": "UTC"
+ },
+ "startTime": {
+ "type": "string",
+ "description": "Start time for the cron schedule in ISO 8601 format."
+ },
+ "endTime": {
+ "type": "string",
+ "description": "End time for the cron schedule in ISO 8601 format."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Trigger"
+ }
+ ],
+ "description": "Cron based trigger.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "CustomCredential": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "CustomKeys"
+ ],
+ "description": "The credential type",
+ "readOnly": true
+ }
+ },
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BaseCredentials"
+ }
+ ],
+ "description": "Custom credential definition"
+ },
+ "CustomRoutineTrigger": {
+ "type": "object",
+ "required": [
+ "type",
+ "provider",
+ "parameters"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "custom"
+ ],
+ "description": "The trigger type."
+ },
+ "provider": {
+ "type": "string",
+ "maxLength": 128,
+ "description": "The external provider that emits the custom event."
+ },
+ "event_name": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The provider-specific event name that fires the routine."
+ },
+ "parameters": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Provider-specific trigger parameters."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RoutineTrigger"
+ }
+ ],
+ "description": "A custom event routine trigger.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "DailyRecurrenceSchedule": {
+ "type": "object",
+ "required": [
+ "type",
+ "hours"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Daily"
+ ],
+ "description": "Daily recurrence type."
+ },
+ "hours": {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "description": "Hours for the recurrence schedule."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RecurrenceSchedule"
+ }
+ ],
+ "description": "Daily recurrence schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJob": {
+ "type": "object",
+ "required": [
+ "id",
+ "status",
+ "created_at"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Server-assigned unique identifier.",
+ "readOnly": true
+ },
+ "inputs": {
+ "$ref": "#/components/schemas/DataGenerationJobInputs",
+ "description": "Caller-supplied inputs."
+ },
+ "result": {
+ "$ref": "#/components/schemas/DataGenerationJobResult",
+ "description": "Result produced on success.",
+ "readOnly": true
+ },
+ "status": {
+ "$ref": "#/components/schemas/JobStatus",
+ "description": "Current lifecycle status.",
+ "readOnly": true
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error",
+ "description": "Error details — populated only on failure.",
+ "readOnly": true
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).",
+ "readOnly": true
+ },
+ "finished_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job was finished, represented in Unix time (seconds since January 1, 1970).",
+ "readOnly": true
+ }
+ },
+ "description": "Data Generation Job resource.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobInputs": {
+ "type": "object",
+ "required": [
+ "name",
+ "sources",
+ "options",
+ "scenario"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The display name of the data generation job."
+ },
+ "sources": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/DataGenerationJobSource"
+ },
+ "description": "The sources used for the data generation job."
+ },
+ "options": {
+ "$ref": "#/components/schemas/DataGenerationJobOptions",
+ "description": "The options for the data generation job."
+ },
+ "scenario": {
+ "$ref": "#/components/schemas/DataGenerationJobScenario",
+ "description": "The scenario of the data generation job. Either for fine-tuning or evaluation."
+ },
+ "output_options": {
+ "$ref": "#/components/schemas/DataGenerationJobOutputOptions",
+ "description": "Optional caller-supplied metadata for the job's output. See individual fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both."
+ }
+ },
+ "description": "Caller-supplied inputs for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobOptions": {
+ "type": "object",
+ "required": [
+ "type",
+ "max_samples"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DataGenerationJobType",
+ "description": "The data generation job type."
+ },
+ "max_samples": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of samples to generate."
+ },
+ "train_split": {
+ "type": "number",
+ "format": "float",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The proportion of the generated data to be used for training when the data is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1."
+ },
+ "model_options": {
+ "$ref": "#/components/schemas/DataGenerationModelOptions",
+ "description": "The LLM model options."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "simple_qna": "#/components/schemas/SimpleQnADataGenerationJobOptions",
+ "traces": "#/components/schemas/TracesDataGenerationJobOptions",
+ "tool_use": "#/components/schemas/ToolUseFineTuningDataGenerationJobOptions"
+ }
+ },
+ "description": "Options for managing data generation jobs.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobOutput": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DataGenerationJobOutputType",
+ "description": "The type of the output."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "file": "#/components/schemas/FileDataGenerationJobOutput",
+ "dataset": "#/components/schemas/DatasetDataGenerationJobOutput"
+ }
+ },
+ "description": "Output information for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobOutputOptions": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario)."
+ },
+ "description": {
+ "type": "string",
+ "description": "Description to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs."
+ }
+ },
+ "description": "Output options for data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobOutputType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "file",
+ "dataset"
+ ]
+ }
+ ],
+ "description": "The supported output file types for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobResult": {
+ "type": "object",
+ "required": [
+ "generated_samples"
+ ],
+ "properties": {
+ "outputs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/DataGenerationJobOutput"
+ },
+ "description": "The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation."
+ },
+ "generated_samples": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The number of samples actually generated."
+ },
+ "token_usage": {
+ "$ref": "#/components/schemas/DataGenerationTokenUsage",
+ "description": "The token usage information for the data generation job."
+ }
+ },
+ "description": "Result produced by a successful data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobScenario": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "supervised_finetuning",
+ "reinforcement_finetuning",
+ "evaluation"
+ ]
+ }
+ ],
+ "description": "The supported scenarios for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DataGenerationJobSourceType",
+ "description": "The type of source."
+ },
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "prompt": "#/components/schemas/PromptDataGenerationJobSource",
+ "agent": "#/components/schemas/AgentDataGenerationJobSource",
+ "traces": "#/components/schemas/TracesDataGenerationJobSource",
+ "file": "#/components/schemas/FileDataGenerationJobSource"
+ }
+ },
+ "description": "The base source model for data generation jobs.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobSourceType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "prompt",
+ "agent",
+ "traces",
+ "file"
+ ]
+ }
+ ],
+ "description": "The supported source types for data generation jobs.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationJobType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "simple_qna",
+ "traces",
+ "tool_use"
+ ]
+ }
+ ],
+ "description": "The supported data generation job types.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationModelOptions": {
+ "type": "object",
+ "required": [
+ "model"
+ ],
+ "properties": {
+ "model": {
+ "type": "string",
+ "description": "Base model name used to generate data."
+ }
+ },
+ "description": "LLM model options for data generation jobs.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataGenerationTokenUsage": {
+ "type": "object",
+ "required": [
+ "prompt_tokens",
+ "completion_tokens",
+ "total_tokens"
+ ],
+ "properties": {
+ "prompt_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The number of prompt tokens used.",
+ "readOnly": true
+ },
+ "completion_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The number of completion tokens generated.",
+ "readOnly": true
+ },
+ "total_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Total number of tokens used.",
+ "readOnly": true
+ }
+ },
+ "description": "Token usage information for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DataSourceConfig": {
+ "type": "object",
+ "required": [
+ "type",
+ "schema"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "The data source type discriminator."
+ },
+ "schema": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The overall object JSON schema for the run data source items."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "azure_ai_source": "#/components/schemas/AzureAIDataSourceConfig"
+ }
+ },
+ "description": "Base class for run data sources with discriminator support."
+ },
+ "DatasetDataGenerationJobOutput": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "dataset"
+ ],
+ "description": "Dataset output."
+ },
+ "id": {
+ "type": "string",
+ "description": "The id of the output dataset created.",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the output dataset.",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the output dataset.",
+ "readOnly": true
+ },
+ "description": {
+ "type": "string",
+ "description": "Description of the output dataset.",
+ "readOnly": true
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary of the output dataset.",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DataGenerationJobOutput"
+ }
+ ],
+ "description": "Dataset output for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "DatasetEvaluationSuiteJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "dataset"
+ ],
+ "description": "The source type for this source, which is Dataset."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the dataset."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the dataset. If not specified, the latest version is used."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationSuiteJobSource"
+ }
+ ],
+ "description": "Dataset source for evaluation suite generation jobs — reference to a dataset.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "DatasetEvaluatorGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "dataset"
+ ],
+ "description": "The source type for this source, which is Dataset."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the dataset."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the dataset. If not specified, the latest version is used."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
+ }
+ ],
+ "description": "Dataset source for evaluator generation jobs — reference to a dataset.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "DatasetReference": {
+ "type": "object",
+ "required": [
+ "name",
+ "version"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Dataset name."
+ },
+ "version": {
+ "type": "string",
+ "description": "Dataset version."
+ }
+ },
+ "description": "Reference to a versioned Foundry Dataset.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "DatasetType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "uri_file",
+ "uri_folder"
+ ]
+ }
+ ],
+ "description": "Enum to determine the type of data."
+ },
+ "DatasetVersion": {
+ "type": "object",
+ "required": [
+ "dataUri",
+ "type",
+ "name",
+ "version"
+ ],
+ "properties": {
+ "dataUri": {
+ "type": "string",
+ "minLength": 1,
+ "pattern": "[a-zA-Z0-9_]",
+ "description": "URI of the data ([example](https://go.microsoft.com/fwlink/?linkid=2202330))"
+ },
+ "type": {
+ "$ref": "#/components/schemas/DatasetType",
+ "description": "Dataset type"
+ },
+ "isReference": {
+ "type": "boolean",
+ "description": "Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted",
+ "readOnly": true
+ },
+ "connectionName": {
+ "type": "string",
+ "description": "The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset"
+ },
+ "id": {
+ "type": "string",
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the resource",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the resource",
+ "readOnly": true
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "uri_file": "#/components/schemas/FileDatasetVersion",
+ "uri_folder": "#/components/schemas/FolderDatasetVersion"
+ }
+ },
+ "description": "DatasetVersion Definition"
+ },
+ "DatasetVersionUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DatasetType",
+ "description": "Dataset type"
+ },
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "uri_file": "#/components/schemas/FileDatasetVersionUpdate",
+ "uri_folder": "#/components/schemas/FolderDatasetVersionUpdate"
+ }
+ },
+ "description": "DatasetVersion Definition"
+ },
+ "DayOfWeek": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday"
+ ]
+ }
+ ],
+ "description": "Days of the week for recurrence schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
+ },
+ "DeleteAgentResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "name",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "agent.deleted"
+ ],
+ "description": "The object type. Always 'agent.deleted'."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the agent was successfully deleted."
+ }
+ },
+ "description": "A deleted agent Object"
+ },
+ "DeleteAgentVersionResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "name",
+ "version",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "agent.version.deleted"
+ ],
+ "description": "The object type. Always 'agent.version.deleted'."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version identifier of the agent."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the agent was successfully deleted."
+ }
+ },
+ "description": "A deleted agent version Object"
+ },
+ "DeleteEvalResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "eval_id",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval.deleted"
+ ],
+ "description": "The object type. Always 'eval.deleted'."
+ },
+ "eval_id": {
+ "type": "string",
+ "description": "id of the eval."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the eval was successfully deleted."
+ }
+ },
+ "description": "A deleted evaluation Object"
+ },
+ "DeleteEvalRunResponse": {
+ "type": "object",
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval.deleted"
+ ],
+ "description": "The object type. Always 'eval.deleted'."
+ },
+ "run_id": {
+ "type": "string",
+ "description": "id of the eval."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the eval was successfully deleted."
+ }
+ },
+ "description": "A deleted evaluation run Object."
+ },
+ "DeleteMemoryResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "memory_id",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "memory_store.item.deleted"
+ ],
+ "description": "The object type. Always 'memory_store.item.deleted'."
+ },
+ "memory_id": {
+ "type": "string",
+ "description": "The unique ID of the deleted memory item."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the memory item was successfully deleted."
+ }
+ },
+ "description": "Response for deleting a memory item from a memory store.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "DeleteMemoryStoreResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "name",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "memory_store.deleted"
+ ],
+ "description": "The object type. Always 'memory_store.deleted'."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the memory store."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the memory store was successfully deleted."
+ }
+ },
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "DeleteResponseResult": {
+ "type": "object",
+ "required": [
+ "id",
+ "object",
+ "deleted"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The operation ID."
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "response"
+ ],
+ "description": "Always return 'response'."
+ },
+ "deleted": {
+ "type": "boolean",
+ "enum": [
+ true
+ ],
+ "description": "Always return true"
+ }
+ },
+ "description": "The result of a delete response operation."
+ },
+ "DeleteSkillResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "name",
+ "deleted"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the deleted skill."
+ },
+ "name": {
+ "$ref": "#/components/schemas/SkillName",
+ "description": "The unique name of the skill."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the skill was successfully deleted."
+ }
+ },
+ "description": "A deleted skill.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "DeleteSkillVersionResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "name",
+ "deleted",
+ "version"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the deleted skill version."
+ },
+ "name": {
+ "$ref": "#/components/schemas/SkillName",
+ "description": "The name of the skill."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the skill version was successfully deleted."
+ },
+ "version": {
+ "type": "string",
+ "description": "The version that was deleted."
+ }
+ },
+ "description": "A deleted skill version.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Skills=V1Preview"
+ ]
+ }
+ },
+ "Deployment": {
+ "type": "object",
+ "required": [
+ "type",
+ "name"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/DeploymentType",
+ "description": "The type of the deployment"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the deployment",
+ "readOnly": true
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "ModelDeployment": "#/components/schemas/ModelDeployment"
+ }
+ },
+ "description": "Model Deployment Definition"
+ },
+ "DeploymentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "ModelDeployment"
+ ]
+ }
+ ]
+ },
+ "DeveloperMessage": {
+ "type": "object",
+ "required": [
+ "role",
+ "content"
+ ],
+ "properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "developer"
+ ],
+ "description": "Indicates this is a developer message."
+ },
+ "content": {
+ "type": "string",
+ "description": "Content provided by a developer to guide model behavior in an evaluation context."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Message"
+ }
+ ],
+ "description": "A message authored by a developer to guide the model during evaluation."
+ },
+ "Dimension": {
+ "type": "object",
+ "required": [
+ "id",
+ "description",
+ "weight"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. Provided by the user when manually creating a rubric evaluator or during human-in-the-loop review of a generated set; the generation pipeline produces an initial value the user can edit. Editable when saving new versions."
+ },
+ "description": {
+ "type": "string",
+ "description": "What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and pursues the appropriate workflow')."
+ },
+ "weight": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 1,
+ "maximum": 10,
+ "description": "Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension weight 8-10; all others use 1-6. User edits are not constrained by this heuristic."
+ },
+ "always_applicable": {
+ "type": "boolean",
+ "description": "When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is not specified by the caller.",
+ "default": false
+ }
+ },
+ "description": "A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "DispatchRoutineRequest": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/RoutineDispatchPayload",
+ "description": "A direct action-input override sent downstream when testing a routine."
+ }
+ },
+ "description": "Request body for the public dispatch_async route.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "DispatchRoutineResponse": {
+ "type": "object",
+ "properties": {
+ "dispatch_id": {
+ "type": "string",
+ "description": "The dispatch identifier created for the routine dispatch."
+ },
+ "action_correlation_id": {
+ "type": "string",
+ "description": "A downstream action correlation identifier, when available."
+ },
+ "task_id": {
+ "type": "string",
+ "description": "A workspace task identifier created for the dispatch, when available."
+ }
+ },
+ "description": "Identifiers returned after a routine dispatch is queued.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "EndpointBasedEvaluatorDefinition": {
+ "type": "object",
+ "required": [
+ "type",
+ "connection_name"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "endpoint"
+ ]
+ },
+ "connection_name": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends `api-key` header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity)."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluatorDefinition"
+ }
+ ],
+ "description": "Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row."
+ },
+ "EntraAuthorizationScheme": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Entra"
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ }
+ ]
+ },
+ "EntraIDCredentials": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "AAD"
+ ],
+ "description": "The credential type",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/BaseCredentials"
+ }
+ ],
+ "description": "Entra ID credential definition"
+ },
+ "Eval": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "name",
+ "data_source_config",
+ "testing_criteria",
+ "created_at",
+ "metadata"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval"
+ ],
+ "description": "The object type.",
+ "x-stainless-const": true,
+ "default": "eval"
+ },
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the evaluation."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the evaluation."
+ },
+ "data_source_config": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ },
+ {
+ "$ref": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ }
+ ],
+ "description": "Configuration of data sources used in runs of the evaluation."
+ },
+ "testing_criteria": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
+ }
+ ]
+ },
+ "description": "A list of testing criteria."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the eval was created."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "modified_at": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Unix timestamp (in seconds) when the evaluation run was last modified."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "the name of the person who created the run."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ }
+ },
+ "description": "An Eval object with a data source config and testing criteria.\nAn Eval represents a task to be done for your LLM integration.\nLike:\n- Improve the quality of my chatbot\n- See how well my chatbot handles customer support\n- Check if o4-mini is better at my usecase than gpt-4o",
+ "title": "Eval",
+ "x-oaiMeta": {
+ "name": "The eval object",
+ "group": "evals",
+ "example": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\"type\": \"string\"},\n },\n \"required\": [\"label\"]\n },\n \"include_sample_schema\": true\n },\n \"testing_criteria\": [\n {\n \"name\": \"My string check grader\",\n \"type\": \"string_check\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\",\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {\n \"test\": \"synthetics\",\n }\n}\n"
+ }
+ },
+ "EvalCsvFileIdSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file_id"
+ ],
+ "description": "The type of source, always `file_id`."
+ },
+ "id": {
+ "type": "string",
+ "description": "The identifier of the uploaded CSV file."
+ }
+ },
+ "description": "Represents a reference to an uploaded CSV file used as a source for evaluation data."
+ },
+ "EvalCsvRunDataSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "source"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "csv"
+ ],
+ "description": "The type of data source, always `csv`."
+ },
+ "source": {
+ "$ref": "#/components/schemas/EvalCsvFileIdSource",
+ "description": "The source of the CSV data, either inline content or a file reference."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Represents a CSV data source for evaluation runs."
+ },
+ "EvalResult": {
+ "type": "object",
+ "required": [
+ "name",
+ "type",
+ "score",
+ "passed"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name of the check"
+ },
+ "type": {
+ "type": "string",
+ "description": "type of the check"
+ },
+ "score": {
+ "type": "number",
+ "format": "float",
+ "description": "score"
+ },
+ "passed": {
+ "type": "boolean",
+ "description": "indicates if the check passed or failed"
+ }
+ },
+ "description": "Result of the evaluation.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvalRun": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "eval_id",
+ "status",
+ "model",
+ "name",
+ "created_at",
+ "report_url",
+ "result_counts",
+ "per_model_usage",
+ "per_testing_criteria_results",
+ "data_source",
+ "metadata",
+ "error"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval.run"
+ ],
+ "description": "The type of the object. Always \"eval.run\".",
+ "x-stainless-const": true,
+ "default": "eval.run"
+ },
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the evaluation run."
+ },
+ "eval_id": {
+ "type": "string",
+ "description": "The identifier of the associated evaluation."
+ },
+ "status": {
+ "type": "string",
+ "description": "The status of the evaluation run."
+ },
+ "model": {
+ "type": "string",
+ "description": "The model that is evaluated, if applicable."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the evaluation run."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the evaluation run was created."
+ },
+ "report_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL to the rendered evaluation run report on the UI dashboard."
+ },
+ "result_counts": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunResultCounts",
+ "description": "Counters summarizing the outcomes of the evaluation run."
+ },
+ "per_model_usage": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunPerModelUsage"
+ },
+ "description": "Usage statistics for each model during the evaluation run."
},
- {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
+ "per_testing_criteria_results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults"
},
- "explode": false
+ "description": "Results per testing criteria applied during the evaluation run."
},
- {
- "name": "agent_name",
- "in": "query",
- "required": false,
- "description": "Filter by agent name. If provided, only items associated with the specified agent will be returned.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "data_source": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource"
+ },
+ {
+ "$ref": "#/components/schemas/EvalRunDataSource"
+ }
+ ],
+ "description": "Information about the run's data source."
},
- {
- "name": "agent_id",
- "in": "query",
- "required": false,
- "description": "Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- {
- "name": "conversation_id",
- "in": "query",
- "required": false,
- "description": "Filter by conversation ID. If provided, only responses associated with the specified conversation will be returned.",
- "schema": {
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.EvalApiError"
+ },
+ "modified_at": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Unix timestamp (in seconds) when the evaluation run was last modified."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "the name of the person who created the run."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
"type": "string"
},
- "explode": false
+ "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
},
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
+ "evaluation_level": {
+ "$ref": "#/components/schemas/EvaluationLevel",
+ "description": "The level at which evaluation is performed. Defaults to 'turn' if not specified.",
+ "default": "turn"
}
+ },
+ "description": "A schema representing an evaluation run.",
+ "title": "EvalRun",
+ "x-oaiMeta": {
+ "name": "The eval run object",
+ "group": "evals",
+ "example": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67e57965b480819094274e3a32235e4c\",\n \"eval_id\": \"eval_67e579652b548190aaa83ada4b125f47\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
+ }
+ },
+ "EvalRunDataSource": {
+ "type": "object",
+ "required": [
+ "type"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Response"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- },
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "The data source type discriminator."
}
},
- "tags": [
- "Responses"
- ]
- }
- },
- "/openai/v1/responses/compact": {
- "post": {
- "operationId": "compactResponseConversation",
- "summary": "Compact a conversation",
- "description": "Compacts a conversation into a response object suitable for long-running and zero-data-retention scenarios.",
- "parameters": [],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.CompactResource"
- }
- }
- }
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "azure_ai_traces_preview": "#/components/schemas/TracesPreviewEvalRunDataSource",
+ "azure_ai_synthetic_data_gen_preview": "#/components/schemas/SyntheticDataGenerationPreviewEvalRunDataSource",
+ "azure_ai_responses": "#/components/schemas/AzureAIResponsesEvalRunDataSource",
+ "azure_ai_target_completions": "#/components/schemas/TargetCompletionEvalRunDataSource",
+ "csv": "#/components/schemas/EvalCsvRunDataSource",
+ "azure_ai_red_team": "#/components/schemas/RedTeamEvalRunDataSource",
+ "azure_ai_trace_data_source_preview": "#/components/schemas/AzureAITraceDataSourcePreviewEvalRunDataSource",
+ "azure_ai_benchmark_preview": "#/components/schemas/AzureAIBenchmarkPreviewEvalRunDataSource"
+ }
+ },
+ "description": "Base class for run data sources with discriminator support."
+ },
+ "EvalRunOutputItem": {
+ "type": "object",
+ "required": [
+ "object",
+ "id",
+ "run_id",
+ "eval_id",
+ "created_at",
+ "status",
+ "datasource_item_id",
+ "datasource_item",
+ "results",
+ "sample"
+ ],
+ "properties": {
+ "object": {
+ "type": "string",
+ "enum": [
+ "eval.run.output_item"
+ ],
+ "description": "The type of the object. Always \"eval.run.output_item\".",
+ "x-stainless-const": true,
+ "default": "eval.run.output_item"
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the evaluation run output item."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "run_id": {
+ "type": "string",
+ "description": "The identifier of the evaluation run associated with this output item."
+ },
+ "eval_id": {
+ "type": "string",
+ "description": "The identifier of the evaluation group."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the evaluation run was created."
+ },
+ "status": {
+ "type": "string",
+ "description": "The status of the evaluation run."
+ },
+ "datasource_item_id": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The identifier for the data source item."
+ },
+ "datasource_item": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Details of the input data source item."
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunOutputItemResult"
+ },
+ "description": "A list of grader results for this output item."
+ },
+ "sample": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSample",
+ "description": "A sample containing the input and output of the evaluation run."
}
},
- "tags": [
- "Responses"
+ "description": "A schema representing an evaluation run output item.",
+ "title": "EvalRunOutputItem",
+ "x-oaiMeta": {
+ "name": "The eval run output item object",
+ "group": "evals",
+ "example": "{\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"created_at\": 1739314509,\n \"status\": \"pass\",\n \"datasource_item_id\": 137,\n \"datasource_item\": {\n \"teacher\": \"To grade essays, I only check for style, content, and grammar.\",\n \"student\": \"I am a student who is trying to write the best essay.\"\n },\n \"results\": [\n {\n \"name\": \"String Check Grader\",\n \"type\": \"string-check-grader\",\n \"score\": 1.0,\n \"passed\": true,\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"You are an evaluator bot...\"\n },\n {\n \"role\": \"user\",\n \"content\": \"You are assessing...\"\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"The rubric is not clear nor concise.\"\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"total_tokens\": 521,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 519,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n}\n"
+ }
+ },
+ "EvalRunOutputItemResult": {
+ "type": "object",
+ "required": [
+ "name",
+ "score",
+ "passed"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.CompactResponseMethodPublicBody"
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "type": {
+ "type": "string",
+ "description": "The grader type (for example, \"string-check-grader\")."
+ },
+ "score": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The numeric score produced by the grader."
+ },
+ "passed": {
+ "type": "boolean",
+ "description": "Whether the grader considered the output a pass."
+ },
+ "sample": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ {
+ "type": "null"
}
- }
+ ],
+ "description": "Optional sample or intermediate data produced by the grader."
+ },
+ "status": {
+ "$ref": "#/components/schemas/EvalRunOutputItemResultStatus",
+ "description": "The evaluation status for this result item. Values: \"completed\", \"errored\", \"skipped\". Null if not provided by evaluator. When status is skipped, passed/score can be ignored."
+ },
+ "metric": {
+ "type": "string",
+ "description": "The name of the metric (e.g., \"fluency\", \"f1_score\")."
+ },
+ "label": {
+ "type": "string",
+ "description": "The label associated with the test criteria metric (e.g., \"pass\", \"fail\", \"good\", \"bad\")."
+ },
+ "threshold": {
+ "type": "number",
+ "format": "float",
+ "description": "The threshold used to determine pass/fail for this test criteria, if it is numerical."
+ },
+ "reason": {
+ "type": "string",
+ "description": "The reason for the test criteria metric."
+ },
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Additional details about the test criteria metric."
}
- }
- }
- },
- "/openai/v1/responses/{response_id}": {
- "get": {
- "operationId": "getResponse",
- "summary": "Retrieve a model response",
- "description": "Retrieves a model response with the given ID.",
- "parameters": [
+ },
+ "unevaluatedProperties": {},
+ "description": "A single grader result for an evaluation run output item.",
+ "title": "EvalRunOutputItemResult"
+ },
+ "EvalRunOutputItemResultStatus": {
+ "anyOf": [
{
- "name": "response_id",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
+ "type": "string"
},
{
- "name": "include[]",
- "in": "query",
- "required": false,
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.IncludeEnum"
- },
- "default": []
- }
+ "type": "string",
+ "enum": [
+ "completed",
+ "errored",
+ "skipped"
+ ]
+ }
+ ],
+ "description": "The evaluation status for an evaluation run output item result."
+ },
+ "EvalRunOutputItemSampleInput": {
+ "type": "object",
+ "required": [
+ "role",
+ "content",
+ "tool_calls"
+ ],
+ "properties": {
+ "role": {
+ "type": "string"
},
- {
- "name": "stream",
- "in": "query",
- "required": false,
- "schema": {
- "type": "boolean",
- "default": false
- },
- "explode": false
+ "content": {
+ "type": "string"
},
- {
- "name": "starting_after",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "format": "int32"
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CompletionMessageToolCallChunk"
},
- "explode": false
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
+ "description": "Tool calls made within the message, if any."
}
+ },
+ "description": "A message in the evaluation run."
+ },
+ "EvalRunOutputItemSampleOutput": {
+ "type": "object",
+ "required": [
+ "tool_calls"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
- "schema": {
- "type": "string"
- }
- }
+ "properties": {
+ "role": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CompletionMessageToolCallChunk"
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.Response"
- }
- },
- "text/event-stream": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.CreateResponseStreamingResponse"
- }
- }
- }
+ "description": "Tool calls made within the message, if any."
+ }
+ },
+ "description": "A message in the evaluation run."
+ },
+ "EvalRunResultCompareItem": {
+ "type": "object",
+ "required": [
+ "treatmentRunId",
+ "treatmentRunSummary",
+ "deltaEstimate",
+ "pValue",
+ "treatmentEffect"
+ ],
+ "properties": {
+ "treatmentRunId": {
+ "type": "string",
+ "description": "The treatment run ID."
+ },
+ "treatmentRunSummary": {
+ "$ref": "#/components/schemas/EvalRunResultSummary",
+ "description": "Summary statistics of the treatment run."
+ },
+ "deltaEstimate": {
+ "type": "number",
+ "format": "float",
+ "description": "Estimated difference between treatment and baseline."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "pValue": {
+ "type": "number",
+ "format": "float",
+ "description": "P-value for the treatment effect."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "treatmentEffect": {
+ "$ref": "#/components/schemas/TreatmentEffectType",
+ "description": "Type of treatment effect."
}
},
- "tags": [
- "Responses"
- ]
+ "description": "Metric comparison for a treatment against the baseline.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
},
- "delete": {
- "operationId": "deleteResponse",
- "summary": "Delete a model response",
- "description": "Deletes a model response.",
- "parameters": [
- {
- "name": "response_id",
- "in": "path",
- "required": true,
- "description": "The ID of the response to delete.",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
- }
+ "EvalRunResultComparison": {
+ "type": "object",
+ "required": [
+ "testingCriteria",
+ "metric",
+ "evaluator",
+ "baselineRunSummary",
+ "compareItems"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DeleteResponseResult"
- }
- }
- }
+ "properties": {
+ "testingCriteria": {
+ "type": "string",
+ "description": "Name of the testing criteria."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "metric": {
+ "type": "string",
+ "description": "Metric being evaluated."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- }
- },
- "tags": [
- "Responses"
- ]
- }
- },
- "/openai/v1/responses/{response_id}/cancel": {
- "post": {
- "operationId": "cancelResponse",
- "summary": "Cancel a model response",
- "description": "Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.",
- "parameters": [
- {
- "name": "response_id",
- "in": "path",
- "required": true,
- "description": "The ID of the response to cancel.",
- "schema": {
- "type": "string"
- }
+ "evaluator": {
+ "type": "string",
+ "description": "Name of the evaluator for this testing criteria."
},
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
+ "baselineRunSummary": {
+ "$ref": "#/components/schemas/EvalRunResultSummary",
+ "description": "Summary statistics of the baseline run."
+ },
+ "compareItems": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunResultCompareItem"
+ },
+ "description": "List of comparison results for each treatment run."
}
+ },
+ "description": "Comparison results for treatment runs against the baseline.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvalRunResultSummary": {
+ "type": "object",
+ "required": [
+ "runId",
+ "sampleCount",
+ "average",
+ "standardDeviation"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/OpenAI.Response"
- }
- }
- }
+ "properties": {
+ "runId": {
+ "type": "string",
+ "description": "The evaluation run ID."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "sampleCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Number of samples in the evaluation run."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "average": {
+ "type": "number",
+ "format": "float",
+ "description": "Average value of the metric in the evaluation run."
+ },
+ "standardDeviation": {
+ "type": "number",
+ "format": "float",
+ "description": "Standard deviation of the metric in the evaluation run."
}
},
- "tags": [
- "Responses"
- ]
- }
- },
- "/openai/v1/responses/{response_id}/input_items": {
- "get": {
- "operationId": "listInputItems",
- "summary": "List input items for a response",
- "description": "Retrieves the input items associated with the specified response.",
- "parameters": [
- {
- "name": "response_id",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
+ "description": "Summary statistics of a metric in an evaluation run.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "Evaluation": {
+ "type": "object",
+ "required": [
+ "id",
+ "data",
+ "evaluators"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Identifier of the evaluation.",
+ "readOnly": true
},
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
+ "data": {
+ "$ref": "#/components/schemas/InputData",
+ "description": "Data for evaluation."
},
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
+ "displayName": {
+ "type": "string",
+ "description": "Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique."
},
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
- "schema": {
+ "description": {
+ "type": "string",
+ "description": "Description of the evaluation. It can be used to store additional information about the evaluation and is mutable."
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the evaluation. It is set by service and is read-only.",
+ "readOnly": true
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
"type": "string"
},
- "explode": false
+ "description": "Evaluation's tags. Unlike properties, tags are fully mutable."
},
- {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
"type": "string"
},
- "explode": false
+ "description": "Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed."
},
- {
- "name": "x-ms-user-identity",
- "in": "header",
- "required": false,
- "description": "Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.",
- "schema": {
- "type": "string"
- }
+ "evaluators": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/EvaluatorConfiguration"
+ },
+ "description": "Evaluators to be used for the evaluation."
+ },
+ "target": {
+ "$ref": "#/components/schemas/EvaluationTarget",
+ "description": "Specifies the type and configuration of the entity used for this evaluation."
}
+ },
+ "description": "Evaluation Definition"
+ },
+ "EvaluationComparisonInsightRequest": {
+ "type": "object",
+ "required": [
+ "type",
+ "evalId",
+ "baselineRunId",
+ "treatmentRunIds"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "headers": {
- "x-agent-session-id": {
- "required": false,
- "description": "Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
- }
- }
- }
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationComparison"
+ ],
+ "description": "The type of request."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "evalId": {
+ "type": "string",
+ "description": "Identifier for the evaluation."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "baselineRunId": {
+ "type": "string",
+ "description": "The baseline run ID for comparison."
+ },
+ "treatmentRunIds": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of treatment run IDs for comparison."
}
},
- "tags": [
- "Responses"
- ]
- }
- },
- "/redTeams/runs": {
- "get": {
- "operationId": "RedTeams_list",
- "summary": "List redteams",
- "description": "Returns the redteams available in the current project.",
- "parameters": [
- {
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
+ "allOf": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "RedTeams=V1Preview"
- ]
- }
+ "$ref": "#/components/schemas/InsightRequest"
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PagedRedTeam"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "description": "Evaluation Comparison Request",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationComparisonInsightResult": {
+ "type": "object",
+ "required": [
+ "type",
+ "comparisons",
+ "method"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationComparison"
+ ],
+ "description": "The type of insights result."
},
- "5XX": {
- "description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
+ "comparisons": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunResultComparison"
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "description": "Comparison results for each treatment run against the baseline."
+ },
+ "method": {
+ "type": "string",
+ "description": "The statistical method used for comparison."
}
},
- "tags": [
- "Redteams"
- ]
- }
- },
- "/redTeams/runs/{name}": {
- "get": {
- "operationId": "RedTeams_get",
- "summary": "Get a redteam",
- "description": "Retrieves the specified redteam and its configuration.",
- "parameters": [
+ "allOf": [
{
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
+ "$ref": "#/components/schemas/InsightResult"
+ }
+ ],
+ "description": "Insights from the evaluation comparison.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationDataGenerationType": {
+ "anyOf": [
{
- "name": "name",
- "in": "path",
- "required": true,
- "description": "Identifier of the red team run.",
- "schema": {
- "type": "string"
- }
+ "type": "string"
},
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "RedTeams=V1Preview"
- ]
- }
+ "type": "string",
+ "enum": [
+ "simple_qna",
+ "traces",
+ "tool_use",
+ "task"
+ ]
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RedTeam"
- }
- }
- }
+ "description": "The data generation type.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationDatasetReference": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Dataset name."
},
- "4XX": {
- "description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "version": {
+ "type": "string",
+ "description": "Dataset version. If not provided, resolves to the latest version."
},
- "5XX": {
- "description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "schema_file_name": {
+ "type": "string",
+ "description": "Name of the schema file within the dataset's blob folder (e.g., \"a3f2b1c4_schema.json\").\nOptional — if not provided, schema is inferred at runtime from the data.\nOnly applicable for uri_folder datasets."
}
},
- "tags": [
- "Redteams"
- ]
- }
- },
- "/redTeams/runs:run": {
- "post": {
- "operationId": "RedTeams_create",
- "summary": "Create a redteam run",
- "description": "Submits a new redteam run for execution with the provided configuration.",
- "parameters": [
+ "description": "Reference to a dataset by name and version.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationLevel": {
+ "anyOf": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "RedTeams=V1Preview"
- ]
- }
+ "type": "string",
+ "enum": [
+ "turn",
+ "conversation"
+ ]
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string"
}
],
- "responses": {
- "201": {
- "description": "The request has succeeded and a new resource has been created as a result.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RedTeam"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "description": "The level at which evaluation is performed."
+ },
+ "EvaluationResultSample": {
+ "type": "object",
+ "required": [
+ "type",
+ "evaluationResult"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationResultSample"
+ ],
+ "description": "Evaluation Result Sample Type"
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "evaluationResult": {
+ "$ref": "#/components/schemas/EvalResult",
+ "description": "Evaluation result for the analysis sample."
}
},
- "tags": [
- "Redteams"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightSample"
+ }
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RedTeam"
- }
- }
- },
- "description": "Redteam to be run"
+ "description": "A sample from the evaluation result.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
}
- }
- },
- "/routines": {
- "get": {
- "operationId": "listRoutines",
- "summary": "List routines",
- "description": "Returns the routines available in the current project.",
- "parameters": [
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
+ },
+ "EvaluationRule": {
+ "type": "object",
+ "required": [
+ "id",
+ "action",
+ "eventType",
+ "enabled",
+ "systemData"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the evaluation rule.",
+ "readOnly": true
+ },
+ "displayName": {
+ "type": "string",
+ "description": "Display Name for the evaluation rule."
+ },
+ "description": {
+ "type": "string",
+ "description": "Description for the evaluation rule."
+ },
+ "action": {
+ "$ref": "#/components/schemas/EvaluationRuleAction",
+ "description": "Definition of the evaluation rule action.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
]
}
},
- {
- "$ref": "#/components/parameters/ListRoutinesParameters.limit"
+ "filter": {
+ "$ref": "#/components/schemas/EvaluationRuleFilter",
+ "description": "Filter condition of the evaluation rule."
},
- {
- "$ref": "#/components/parameters/ListRoutinesParameters.after"
+ "eventType": {
+ "$ref": "#/components/schemas/EvaluationRuleEventType",
+ "description": "Event type that the evaluation rule applies to."
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Indicates whether the evaluation rule is enabled. Default is true."
},
+ "systemData": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "System metadata for the evaluation rule.",
+ "readOnly": true
+ }
+ },
+ "description": "Evaluation rule model."
+ },
+ "EvaluationRuleAction": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluationRuleActionType",
+ "description": "Type of the evaluation action."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "continuousEvaluation": "#/components/schemas/ContinuousEvaluationRuleAction",
+ "humanEvaluation": "#/components/schemas/HumanEvaluationRuleAction",
+ "humanEvaluationPreview": "#/components/schemas/HumanEvaluationPreviewRuleAction"
+ }
+ },
+ "description": "Evaluation action model."
+ },
+ "EvaluationRuleActionType": {
+ "anyOf": [
{
- "$ref": "#/components/parameters/ListRoutinesParameters.before"
+ "type": "string"
},
{
- "$ref": "#/components/parameters/ListRoutinesParameters.order"
+ "type": "string",
+ "enum": [
+ "continuousEvaluation",
+ "humanEvaluation",
+ "humanEvaluationPreview"
+ ]
+ }
+ ],
+ "description": "Type of the evaluation action."
+ },
+ "EvaluationRuleEventType": {
+ "anyOf": [
+ {
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
+ "type": "string",
+ "enum": [
+ "responseCompleted",
+ "manual"
+ ]
+ }
+ ],
+ "description": "Type of the evaluation rule event."
+ },
+ "EvaluationRuleFilter": {
+ "type": "object",
+ "required": [
+ "agentName"
+ ],
+ "properties": {
+ "agentName": {
+ "type": "string",
+ "description": "Filter by agent name."
+ }
+ },
+ "description": "Evaluation filter model."
+ },
+ "EvaluationRunClusterInsightRequest": {
+ "type": "object",
+ "required": [
+ "type",
+ "evalId",
+ "runIds"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationRunClusterInsight"
+ ],
+ "description": "The type of insights request."
+ },
+ "evalId": {
+ "type": "string",
+ "description": "Evaluation Id for the insights."
+ },
+ "runIds": {
+ "type": "array",
+ "items": {
"type": "string"
},
- "explode": false
+ "description": "List of evaluation run IDs for the insights."
+ },
+ "modelConfiguration": {
+ "$ref": "#/components/schemas/InsightModelConfiguration",
+ "description": "Configuration of the model used in the insight generation."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightRequest"
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Routine"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
- }
- }
- }
+ "description": "Insights on set of Evaluation Results",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationRunClusterInsightResult": {
+ "type": "object",
+ "required": [
+ "type",
+ "clusterInsight"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "EvaluationRunClusterInsight"
+ ],
+ "description": "The type of insights result."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "clusterInsight": {
+ "$ref": "#/components/schemas/ClusterInsightResult"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InsightResult"
+ }
+ ],
+ "description": "Insights from the evaluation run cluster analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "EvaluationScheduleTask": {
+ "type": "object",
+ "required": [
+ "type",
+ "evalId",
+ "evalRun"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Evaluation"
+ ]
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "evalId": {
+ "type": "string",
+ "description": "Identifier of the evaluation group."
+ },
+ "evalRun": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The evaluation run payload."
}
},
- "tags": [
- "Routines"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ScheduleTask"
+ }
],
+ "description": "Evaluation task for the schedule.",
"x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
+ "required_previews": [
+ "Schedules=V1Preview"
]
}
- }
- },
- "/routines/{routine_name}": {
- "put": {
- "operationId": "createOrUpdateRoutine",
- "summary": "Create or update a routine",
- "description": "Creates a new routine or replaces an existing routine with the supplied definition.",
- "parameters": [
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
- }
+ },
+ "EvaluationSuiteDataGenerationOptions": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluationDataGenerationType",
+ "description": "The data generation type. Defaults to 'simple_qna' if not specified."
},
+ "max_samples": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 15,
+ "maximum": 1000,
+ "description": "Maximum number of samples to generate. Valid range: 15-1000."
+ }
+ },
+ "description": "Options for dataset generation within an evaluation suite generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationSuiteGenerationCategory": {
+ "anyOf": [
{
- "$ref": "#/components/parameters/CreateOrUpdateRoutineParameters.routine_name"
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "quality",
+ "safety"
+ ]
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Routine"
- }
- }
- }
+ "description": "The category of evaluator generation.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationSuiteGenerationJob": {
+ "type": "object",
+ "required": [
+ "id",
+ "status",
+ "created_at"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Server-assigned unique identifier.",
+ "readOnly": true
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "inputs": {
+ "$ref": "#/components/schemas/EvaluationSuiteGenerationJobInputs",
+ "description": "Caller-supplied inputs."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "result": {
+ "$ref": "#/components/schemas/EvaluationSuiteVersion",
+ "description": "Result produced on success.",
+ "readOnly": true
+ },
+ "status": {
+ "$ref": "#/components/schemas/JobStatus",
+ "description": "Current lifecycle status.",
+ "readOnly": true
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error",
+ "description": "Error details — populated only on failure.",
+ "readOnly": true
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job was created, represented in Unix time.",
+ "readOnly": true
+ },
+ "finished_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job finished, represented in Unix time.",
+ "readOnly": true
+ },
+ "usage": {
+ "$ref": "#/components/schemas/EvaluationSuiteGenerationTokenUsage",
+ "description": "Token consumption summary. Populated on terminal states.",
+ "readOnly": true
}
},
- "tags": [
- "Routines"
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RoutineCreateOrUpdateRequest"
- }
- }
+ "description": "Evaluation suite generation job resource — a long-running job that generates testing criteria and optionally a dataset from source materials. On success, the result is the persisted EvaluationSuiteVersion.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationSuiteGenerationJobCreate": {
+ "type": "object",
+ "properties": {
+ "inputs": {
+ "$ref": "#/components/schemas/EvaluationSuiteGenerationJobInputs",
+ "description": "Caller-supplied inputs."
}
},
+ "description": "Evaluation suite generation job resource — a long-running job that generates testing criteria and optionally a dataset from source materials. On success, the result is the persisted EvaluationSuiteVersion.",
"x-ms-foundry-meta": {
"conditional_previews": [
- "Routines=V1Preview"
+ "Evaluations=V1Preview"
]
}
},
- "get": {
- "operationId": "getRoutine",
- "summary": "Get a routine",
- "description": "Retrieves the specified routine and its current configuration.",
- "parameters": [
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
- }
- },
- {
- "$ref": "#/components/parameters/GetRoutineParameters"
+ "EvaluationSuiteGenerationJobInputs": {
+ "type": "object",
+ "required": [
+ "evaluation_suite_name",
+ "sources",
+ "generation_model"
+ ],
+ "properties": {
+ "evaluation_suite_name": {
+ "type": "string",
+ "description": "The evaluation suite name to create."
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
+ "sources": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluationSuiteJobSource"
},
- "explode": false
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Routine"
- }
- }
- }
+ "description": "Source materials for generation — agent context, prompts, traces, or datasets."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "generation_model": {
+ "type": "string",
+ "description": "The LLM model to use for rubric and data generation (e.g., 'gpt-4o')."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
+ "category": {
+ "$ref": "#/components/schemas/EvaluationSuiteGenerationCategory",
+ "description": "Category determines the generation focus. Default: quality.",
+ "default": "quality"
+ },
+ "initialization_parameters": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Optional initialization parameters applied to all generated evaluators.\nFor example, deployment_name for LLM judge model, default threshold."
+ },
+ "data_generation_options": {
+ "$ref": "#/components/schemas/EvaluationSuiteDataGenerationOptions",
+ "description": "Data generation options. Controls how the evaluation dataset is generated.\nIf omitted, defaults are used (simple_qna, 100 max_samples)."
+ },
+ "target": {
+ "$ref": "#/components/schemas/Target",
+ "description": "Target for the generated suite. Stored on the suite so it can be run\nimmediately after generation completes.\nSupports azure_ai_agent, azure_ai_model, azure_ai_assistant."
+ },
+ "input_messages": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
}
- }
+ ],
+ "description": "How to send dataset rows to the target.\nIf omitted and target is provided, defaults to a template using item.query."
+ },
+ "evaluation_level": {
+ "$ref": "#/components/schemas/EvaluationLevel",
+ "description": "Evaluation level for the generated suite.\nDefault: turn (single-turn evaluation).\nUse conversation for multi-turn evaluation."
}
},
- "tags": [
- "Routines"
- ],
+ "description": "Caller-supplied inputs for an evaluation suite generation job.",
"x-ms-foundry-meta": {
"conditional_previews": [
- "Routines=V1Preview"
+ "Evaluations=V1Preview"
]
}
},
- "delete": {
- "operationId": "deleteRoutine",
- "summary": "Delete a routine",
- "description": "Deletes the specified routine.",
- "parameters": [
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
- }
+ "EvaluationSuiteGenerationTokenUsage": {
+ "type": "object",
+ "properties": {
+ "input_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Number of input tokens consumed."
},
- {
- "$ref": "#/components/parameters/DeleteRoutineParameters"
+ "output_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Number of output tokens consumed."
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "total_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Total tokens consumed."
}
+ },
+ "description": "Token usage summary for an evaluation suite generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationSuiteJobSource": {
+ "type": "object",
+ "required": [
+ "type"
],
- "responses": {
- "204": {
- "description": "There is no content to send for this request, but the headers may be useful."
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluationSuiteJobSourceType",
+ "description": "The type of source."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "description": {
+ "type": "string",
+ "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
}
},
- "tags": [
- "Routines"
- ],
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "prompt": "#/components/schemas/PromptEvaluationSuiteJobSource",
+ "agent": "#/components/schemas/AgentEvaluationSuiteJobSource",
+ "traces": "#/components/schemas/TracesEvaluationSuiteJobSource",
+ "dataset": "#/components/schemas/DatasetEvaluationSuiteJobSource"
+ }
+ },
+ "description": "The base source model for evaluation suite generation jobs. Polymorphic over `type`.",
"x-ms-foundry-meta": {
"conditional_previews": [
- "Routines=V1Preview"
+ "Evaluations=V1Preview"
]
}
- }
- },
- "/routines/{routine_name}/runs": {
- "get": {
- "operationId": "listRoutineRuns",
- "summary": "List prior runs for a routine",
- "description": "Returns prior runs recorded for the specified routine.",
- "parameters": [
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
- }
- },
- {
- "$ref": "#/components/parameters/ListRoutineRunsParameters.routine_name"
- },
- {
- "$ref": "#/components/parameters/ListRoutineRunsParameters.filter"
- },
- {
- "$ref": "#/components/parameters/ListRoutineRunsParameters.limit"
- },
- {
- "$ref": "#/components/parameters/ListRoutineRunsParameters.after"
- },
- {
- "$ref": "#/components/parameters/ListRoutineRunsParameters.before"
- },
+ },
+ "EvaluationSuiteJobSourceType": {
+ "anyOf": [
{
- "$ref": "#/components/parameters/ListRoutineRunsParameters.order"
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/RoutineRun"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- },
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "type": "string",
+ "enum": [
+ "prompt",
+ "agent",
+ "traces",
+ "dataset"
+ ]
}
- },
- "tags": [
- "Routines"
],
+ "description": "The supported source types for evaluation suite generation jobs.",
"x-ms-foundry-meta": {
"conditional_previews": [
- "Routines=V1Preview"
+ "Evaluations=V1Preview"
]
}
- }
- },
- "/routines/{routine_name}:disable": {
- "post": {
- "operationId": "disableRoutine",
- "summary": "Disable a routine",
- "description": "Disables the specified routine so it no longer runs.",
- "parameters": [
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
- }
- },
- {
- "$ref": "#/components/parameters/DisableRoutineParameters"
- },
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Routine"
- }
- }
- }
+ },
+ "EvaluationSuiteRunRequest": {
+ "type": "object",
+ "properties": {
+ "evaluation_name": {
+ "type": "string",
+ "description": "Name for the evaluation. Default: '{suiteName}-runs'."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "evaluation_suite_version": {
+ "type": "string",
+ "description": "Evaluation suite version to run. Default: latest."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "evaluation_level": {
+ "$ref": "#/components/schemas/EvaluationLevel",
+ "description": "Overrides the suite's default evaluation level. If omitted, uses the level from the suite."
}
},
- "tags": [
- "Routines"
- ],
+ "description": "Request body for running an evaluation from a suite.",
"x-ms-foundry-meta": {
"conditional_previews": [
- "Routines=V1Preview"
+ "Evaluations=V1Preview"
]
}
- }
- },
- "/routines/{routine_name}:dispatch_async": {
- "post": {
- "operationId": "dispatchRoutineAsync",
- "summary": "Queue an asynchronous routine dispatch",
- "description": "Queues an asynchronous dispatch for the specified routine.",
- "parameters": [
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
- }
+ },
+ "EvaluationSuiteRunResponse": {
+ "type": "object",
+ "required": [
+ "evaluation_suite_name",
+ "evaluation_suite_version",
+ "results"
+ ],
+ "properties": {
+ "evaluation_suite_name": {
+ "type": "string",
+ "description": "The evaluation suite name used."
},
- {
- "$ref": "#/components/parameters/DispatchRoutineAsyncParameters.routine_name"
+ "evaluation_suite_version": {
+ "type": "string",
+ "description": "The evaluation suite version resolved."
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
+ "results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluationSuiteRunResult"
},
- "explode": false
+ "description": "The run results. Currently a single-element array; will support multiple runs in the future."
}
+ },
+ "description": "Response from running an evaluation suite.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationSuiteRunResult": {
+ "type": "object",
+ "required": [
+ "eval_id",
+ "run_id",
+ "status",
+ "created_at"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DispatchRoutineResponse"
- }
- }
- }
+ "properties": {
+ "eval_id": {
+ "type": "string",
+ "description": "The evaluation ID created."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "run_id": {
+ "type": "string",
+ "description": "The eval run ID created."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- }
- },
- "tags": [
- "Routines"
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DispatchRoutineRequest"
- }
- }
+ "status": {
+ "$ref": "#/components/schemas/JobStatus",
+ "description": "Status of the run."
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "Timestamp when the run was created."
}
},
+ "description": "Result of a single evaluation run within a suite execution.",
"x-ms-foundry-meta": {
"conditional_previews": [
- "Routines=V1Preview"
+ "Evaluations=V1Preview"
]
}
- }
- },
- "/routines/{routine_name}:enable": {
- "post": {
- "operationId": "enableRoutine",
- "summary": "Enable a routine",
- "description": "Enables the specified routine so it can be dispatched.",
- "parameters": [
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": false,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Routines=V1Preview"
- ]
- }
- },
+ },
+ "EvaluationSuiteSubtype": {
+ "anyOf": [
{
- "$ref": "#/components/parameters/EnableRoutineParameters"
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "default",
+ "benchmark"
+ ]
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Routine"
- }
- }
- }
+ "description": "The subtype of an evaluation suite.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationSuiteVersion": {
+ "type": "object",
+ "required": [
+ "testing_criteria",
+ "name",
+ "version"
+ ],
+ "properties": {
+ "display_name": {
+ "type": "string",
+ "description": "Human-readable display name.\nDoes not need to be unique. Shown in Foundry portal list views and eval reports."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "subtype": {
+ "$ref": "#/components/schemas/EvaluationSuiteSubtype",
+ "description": "Subtype of the evaluation suite."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
+ "dataset": {
+ "$ref": "#/components/schemas/EvaluationDatasetReference",
+ "description": "Dataset reference for evaluation.\nOptional — omit for evaluator-only suites where data comes from\nlive production traces or is provided at run time.\nThe referenced dataset must exist in the project's dataset registry."
+ },
+ "testing_criteria": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
}
+ ]
+ },
+ "minItems": 1,
+ "description": "Testing criteria — the evaluator configurations for this suite.\nSupports all grader types: azure_ai_evaluator, string_check, label_model,\nscore_model, text_similarity, python, etc.\nAt least one entry is required."
+ },
+ "target": {
+ "$ref": "#/components/schemas/Target",
+ "description": "Target for this evaluation suite. Uses the existing Target discriminated type\nfrom eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.\nOptional — allows suites to exist without a target."
+ },
+ "input_messages": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
}
- }
+ ],
+ "description": "How to send dataset rows to the target (agent or model).\nSupports template type (prompt with column placeholders) and\nitem_reference type (column containing pre-built messages)."
+ },
+ "evaluation_level": {
+ "$ref": "#/components/schemas/EvaluationLevel",
+ "description": "Default evaluation level for this suite. Can be overridden at run time."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the resource.",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the resource.",
+ "readOnly": true
}
},
- "tags": [
- "Routines"
- ],
+ "description": "An evaluation suite bundles testing criteria — an optional dataset, one or more\nevaluator configs with thresholds and init params — into a reusable, named artifact that\ncan gate agent changes across batch, scheduled, continuous, and CI/CD evals.",
"x-ms-foundry-meta": {
"conditional_previews": [
- "Routines=V1Preview"
+ "Evaluations=V1Preview"
]
}
- }
- },
- "/schedules": {
- "get": {
- "operationId": "Schedules_list",
- "summary": "List schedules",
- "description": "Returns schedules that match the supplied type and enabled filters.",
- "parameters": [
- {
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
- {
- "name": "type",
- "in": "query",
- "required": false,
- "description": "Filter by the type of schedule.",
- "schema": {
- "$ref": "#/components/schemas/ScheduleTaskType"
- },
- "explode": false
+ },
+ "EvaluationSuiteVersionCreate": {
+ "type": "object",
+ "required": [
+ "testing_criteria"
+ ],
+ "properties": {
+ "display_name": {
+ "type": "string",
+ "description": "Human-readable display name.\nDoes not need to be unique. Shown in Foundry portal list views and eval reports."
},
- {
- "name": "enabled",
- "in": "query",
- "required": false,
- "description": "Filter by the enabled status.",
- "schema": {
- "type": "boolean"
- },
- "explode": false
+ "subtype": {
+ "$ref": "#/components/schemas/EvaluationSuiteSubtype",
+ "description": "Subtype of the evaluation suite."
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
- }
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PagedSchedule"
- }
- }
- }
+ "dataset": {
+ "$ref": "#/components/schemas/EvaluationDatasetReference",
+ "description": "Dataset reference for evaluation.\nOptional — omit for evaluator-only suites where data comes from\nlive production traces or is provided at run time.\nThe referenced dataset must exist in the project's dataset registry."
},
- "4XX": {
- "description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
+ "testing_criteria": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
}
- }
+ ]
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "minItems": 1,
+ "description": "Testing criteria — the evaluator configurations for this suite.\nSupports all grader types: azure_ai_evaluator, string_check, label_model,\nscore_model, text_similarity, python, etc.\nAt least one entry is required."
},
- "5XX": {
- "description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
+ "target": {
+ "$ref": "#/components/schemas/Target",
+ "description": "Target for this evaluation suite. Uses the existing Target discriminated type\nfrom eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.\nOptional — allows suites to exist without a target."
+ },
+ "input_messages": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
}
- }
- }
- },
- "tags": [
- "Schedules"
- ]
- }
- },
- "/schedules/{id}": {
- "delete": {
- "operationId": "Schedules_delete",
- "summary": "Delete a schedule",
- "description": "Deletes the specified schedule resource.",
- "parameters": [
- {
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ ],
+ "description": "How to send dataset rows to the target (agent or model).\nSupports template type (prompt with column placeholders) and\nitem_reference type (column containing pre-built messages)."
},
- {
- "name": "id",
- "in": "path",
- "required": true,
- "description": "Identifier of the schedule.",
- "schema": {
- "type": "string"
- }
+ "evaluation_level": {
+ "$ref": "#/components/schemas/EvaluationLevel",
+ "description": "Default evaluation level for this suite. Can be overridden at run time."
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
- }
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
}
+ },
+ "description": "An evaluation suite bundles testing criteria — an optional dataset, one or more\nevaluator configs with thresholds and init params — into a reusable, named artifact that\ncan gate agent changes across batch, scheduled, continuous, and CI/CD evals.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationSuiteVersionUpdate": {
+ "type": "object",
+ "required": [
+ "testing_criteria"
],
- "responses": {
- "204": {
- "description": "There is no content to send for this request, but the headers may be useful."
+ "properties": {
+ "display_name": {
+ "type": "string",
+ "description": "Human-readable display name.\nDoes not need to be unique. Shown in Foundry portal list views and eval reports."
},
- "4XX": {
- "description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
+ "subtype": {
+ "$ref": "#/components/schemas/EvaluationSuiteSubtype",
+ "description": "Subtype of the evaluation suite."
+ },
+ "dataset": {
+ "$ref": "#/components/schemas/EvaluationDatasetReference",
+ "description": "Dataset reference for evaluation.\nOptional — omit for evaluator-only suites where data comes from\nlive production traces or is provided at run time.\nThe referenced dataset must exist in the project's dataset registry."
+ },
+ "testing_criteria": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
}
- }
+ ]
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "minItems": 1,
+ "description": "Testing criteria — the evaluator configurations for this suite.\nSupports all grader types: azure_ai_evaluator, string_check, label_model,\nscore_model, text_similarity, python, etc.\nAt least one entry is required."
},
- "5XX": {
- "description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
+ "target": {
+ "$ref": "#/components/schemas/Target",
+ "description": "Target for this evaluation suite. Uses the existing Target discriminated type\nfrom eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.\nOptional — allows suites to exist without a target."
+ },
+ "input_messages": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
}
+ ],
+ "description": "How to send dataset rows to the target (agent or model).\nSupports template type (prompt with column placeholders) and\nitem_reference type (column containing pre-built messages)."
+ },
+ "evaluation_level": {
+ "$ref": "#/components/schemas/EvaluationLevel",
+ "description": "Default evaluation level for this suite. Can be overridden at run time."
+ },
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
}
},
- "tags": [
- "Schedules"
- ]
+ "description": "An evaluation suite bundles testing criteria — an optional dataset, one or more\nevaluator configs with thresholds and init params — into a reusable, named artifact that\ncan gate agent changes across batch, scheduled, continuous, and CI/CD evals.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
},
- "get": {
- "operationId": "Schedules_get",
- "summary": "Get a schedule",
- "description": "Retrieves the specified schedule resource.",
- "parameters": [
- {
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
+ "EvaluationTarget": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluationTargetType",
+ "description": "Discriminator that defines the type of the evaluation target."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "modelResponseGeneration": "#/components/schemas/modelResponseGenerationTarget"
+ }
+ },
+ "description": "Abstract base model for defining evaluation targets."
+ },
+ "EvaluationTargetType": {
+ "anyOf": [
{
- "name": "id",
- "in": "path",
- "required": true,
- "description": "Identifier of the schedule.",
- "schema": {
- "type": "string"
- }
+ "type": "string",
+ "enum": [
+ "modelResponseGeneration"
+ ]
},
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
- }
+ "type": "string"
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Schedule"
- }
- }
- }
+ "description": "Allowed types of evaluation targets."
+ },
+ "EvaluationTaxonomy": {
+ "type": "object",
+ "required": [
+ "name",
+ "version",
+ "taxonomyInput"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
},
- "4XX": {
- "description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
+ "name": {
+ "type": "string",
+ "description": "The name of the resource",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the resource",
+ "readOnly": true
+ },
+ "taxonomyInput": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInput",
+ "description": "Input configuration for the evaluation taxonomy."
+ },
+ "taxonomyCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaxonomyCategory"
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "description": "List of taxonomy categories."
},
- "5XX": {
- "description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "description": "Additional properties for the evaluation taxonomy."
}
},
- "tags": [
- "Schedules"
- ]
+ "description": "Evaluation Taxonomy Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
},
- "put": {
- "operationId": "Schedules_createOrUpdate",
- "summary": "Create or update a schedule",
- "description": "Creates a new schedule or updates an existing schedule with the supplied definition.",
- "parameters": [
- {
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
+ "EvaluationTaxonomyCreateOrUpdate": {
+ "type": "object",
+ "required": [
+ "taxonomyInput"
+ ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
},
- {
- "name": "id",
- "in": "path",
- "required": true,
- "description": "Identifier of the schedule.",
- "schema": {
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
"type": "string"
- }
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
- }
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Schedule"
- }
- }
- }
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
},
- "201": {
- "description": "The request has succeeded and a new resource has been created as a result.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Schedule"
- }
- }
- }
+ "taxonomyInput": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInput",
+ "description": "Input configuration for the evaluation taxonomy."
},
- "4XX": {
- "description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
+ "taxonomyCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaxonomyCategory"
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "description": "List of taxonomy categories."
},
- "5XX": {
- "description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "description": "Additional properties for the evaluation taxonomy."
}
},
- "tags": [
- "Schedules"
+ "description": "Evaluation Taxonomy Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationTaxonomyInput": {
+ "type": "object",
+ "required": [
+ "type"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Schedule"
- }
- }
- },
- "description": "The resource instance."
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInputType",
+ "description": "Input type of the evaluation taxonomy."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "agent": "#/components/schemas/AgentTaxonomyInput"
+ }
+ },
+ "description": "Input configuration for the evaluation taxonomy.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
}
- }
- },
- "/schedules/{id}/runs": {
- "get": {
- "operationId": "Schedules_listRuns",
- "summary": "List schedule runs",
- "description": "Returns schedule runs that match the supplied filters.",
- "parameters": [
- {
- "$ref": "#/components/parameters/Azure.Core.Foundations.ApiVersionParameter"
- },
+ },
+ "EvaluationTaxonomyInputType": {
+ "anyOf": [
{
- "name": "id",
- "in": "path",
- "required": true,
- "description": "Identifier of the schedule.",
- "schema": {
- "type": "string"
- }
+ "type": "string"
},
{
- "name": "type",
- "in": "query",
- "required": false,
- "description": "Filter by the type of schedule.",
- "schema": {
- "$ref": "#/components/schemas/ScheduleTaskType"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "agent",
+ "policy"
+ ]
+ }
+ ],
+ "description": "Type of the evaluation taxonomy input.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationTaxonomyInputUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInputType",
+ "description": "Input type of the evaluation taxonomy."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "agent": "#/components/schemas/AgentTaxonomyInputUpdate"
+ }
+ },
+ "description": "Input configuration for the evaluation taxonomy.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluationTaxonomyUpdate": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
},
- {
- "name": "enabled",
- "in": "query",
- "required": false,
- "description": "Filter by the enabled status.",
- "schema": {
- "type": "boolean"
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
},
- "explode": false
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
- }
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/PagedScheduleRun"
- }
- }
- }
+ "taxonomyInput": {
+ "$ref": "#/components/schemas/EvaluationTaxonomyInputUpdate",
+ "description": "Input configuration for the evaluation taxonomy."
},
- "4XX": {
- "description": "Client error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
+ "taxonomyCategories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaxonomyCategory"
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "description": "List of taxonomy categories."
},
- "5XX": {
- "description": "Server error",
- "headers": {
- "x-ms-error-code": {
- "required": false,
- "description": "String error code indicating what went wrong.",
- "schema": {
- "type": "string"
- }
- }
+ "properties": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
},
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.ErrorResponse"
- }
- }
- }
+ "description": "Additional properties for the evaluation taxonomy."
}
},
- "tags": [
- "Schedules"
- ]
- }
- },
- "/schedules/{schedule_id}/runs/{run_id}": {
- "get": {
- "operationId": "Schedules_getRun",
- "summary": "Get a schedule run",
- "description": "Retrieves the specified run for a schedule.",
- "parameters": [
+ "description": "Evaluation Taxonomy Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorCategory": {
+ "anyOf": [
{
- "name": "schedule_id",
- "in": "path",
- "required": true,
- "description": "The unique identifier of the schedule.",
- "schema": {
- "type": "string"
- }
+ "type": "string"
},
{
- "name": "run_id",
- "in": "path",
- "required": true,
- "description": "The unique identifier of the schedule run.",
- "schema": {
- "type": "string"
- }
+ "type": "string",
+ "enum": [
+ "quality",
+ "safety",
+ "agents"
+ ]
+ }
+ ],
+ "description": "The category of the evaluator",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorConfiguration": {
+ "type": "object",
+ "required": [
+ "id"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Identifier of the evaluator."
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Schedules=V1Preview"
- ]
- }
+ "initParams": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Initialization parameters of the evaluator."
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
+ "dataMapping": {
+ "type": "object",
+ "unevaluatedProperties": {
"type": "string"
},
- "explode": false
+ "description": "Data parameters of the evaluator."
}
+ },
+ "description": "Evaluator Configuration"
+ },
+ "EvaluatorCredentialRequest": {
+ "type": "object",
+ "required": [
+ "blob_uri"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ScheduleRun"
- }
- }
- }
+ "properties": {
+ "blob_uri": {
+ "type": "string",
+ "format": "uri",
+ "description": "The blob URI for the evaluator storage. Example: `https://account.blob.core.windows.net:443/container`"
+ }
+ },
+ "description": "Request body for getting evaluator credentials",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorDefinition": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluatorDefinitionType",
+ "description": "The type of evaluator definition"
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "init_parameters": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters like type, properties, required."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "data_schema": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like type, properties, required."
+ },
+ "metrics": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/EvaluatorMetric"
+ },
+ "description": "List of output metrics produced by this evaluator"
}
},
- "tags": [
- "Schedules"
- ]
- }
- },
- "/skills": {
- "get": {
- "operationId": "Skills_listSkills",
- "summary": "List skills",
- "description": "Returns the skills available in the current project.",
- "parameters": [
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "code": "#/components/schemas/CodeBasedEvaluatorDefinition",
+ "prompt": "#/components/schemas/PromptBasedEvaluatorDefinition",
+ "rubric": "#/components/schemas/RubricBasedEvaluatorDefinition",
+ "endpoint": "#/components/schemas/EndpointBasedEvaluatorDefinition"
+ }
+ },
+ "description": "Base evaluator configuration with discriminator",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorDefinitionType": {
+ "anyOf": [
{
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
+ "type": "string"
},
{
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "prompt",
+ "code",
+ "prompt_and_code",
+ "service",
+ "openai_graders",
+ "rubric",
+ "endpoint"
+ ]
+ }
+ ],
+ "description": "The type of evaluator definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationArtifacts": {
+ "type": "object",
+ "required": [
+ "dataset",
+ "kinds"
+ ],
+ "properties": {
+ "dataset": {
+ "$ref": "#/components/schemas/DatasetReference",
+ "description": "Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to `EvaluatorVersion.version`) holding all artifacts produced by the generation pipeline. Each row in the JSONL carries a `kind` field discriminating its content (e.g. `spec`, `tools`, `context`)."
},
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
- "schema": {
+ "kinds": {
+ "type": "array",
+ "items": {
"type": "string"
},
- "explode": false
- },
- {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
+ "description": "The kinds of rows present in `dataset`. Always contains `\"spec\"` (the generated evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain `\"tools\"` (when the generation pipeline produced or inferred OpenAI tool schemas) and/or `\"context\"` (when supplementary materials such as file uploads or trace samples were used during generation)."
+ }
+ },
+ "description": "Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationInputs": {
+ "type": "object",
+ "required": [
+ "sources",
+ "model",
+ "evaluator_name"
+ ],
+ "properties": {
+ "sources": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
},
- "explode": false
+ "description": "Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry is an `EvaluatorGenerationJobSource` variant discriminated by `type`."
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "model": {
+ "type": "string",
+ "description": "The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide their own model rather than relying on service-owned capacity."
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "evaluator_name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 256,
+ "pattern": "^[A-Za-z0-9_.~-]+$",
+ "description": "The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII letters, digits, underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` is reserved for system-managed evaluators and is rejected by the service. If an evaluator with this name already exists in the project (and is rubric-subtype), the service creates a new version under the same name and uses the prior version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive loop). Old versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`."
+ },
+ "evaluator_display_name": {
+ "type": "string",
+ "description": "Optional human-friendly display name for the resulting evaluator. Surfaced as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier."
+ },
+ "evaluator_description": {
+ "type": "string",
+ "description": "Optional human-friendly description for the resulting evaluator. Surfaced as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related models."
}
+ },
+ "description": "Caller-supplied inputs for an evaluator generation job.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationJob": {
+ "type": "object",
+ "required": [
+ "id",
+ "status",
+ "created_at"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Skill"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
- }
- }
- }
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Server-assigned unique identifier.",
+ "readOnly": true
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "inputs": {
+ "$ref": "#/components/schemas/EvaluatorGenerationInputs",
+ "description": "Caller-supplied inputs."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "result": {
+ "$ref": "#/components/schemas/EvaluatorVersion",
+ "description": "Result produced on success.",
+ "readOnly": true
+ },
+ "status": {
+ "$ref": "#/components/schemas/JobStatus",
+ "description": "Current lifecycle status.",
+ "readOnly": true
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error",
+ "description": "Error details — populated only on failure.",
+ "readOnly": true
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).",
+ "readOnly": true
+ },
+ "finished_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).",
+ "readOnly": true
+ },
+ "usage": {
+ "$ref": "#/components/schemas/EvaluatorGenerationTokenUsage",
+ "description": "Token consumption summary. Populated when the job reaches a terminal state.",
+ "readOnly": true
+ },
+ "input_quality_warnings": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RubricGenerationInputQualityWarning"
+ },
+ "description": "Non-fatal input-quality advisories produced by the generation pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. Omitted when generation was clean. Cleared when a subsequent `PATCH` to the paired `EvaluatorVersion.definition` invalidates the advisories.",
+ "readOnly": true
+ }
+ },
+ "description": "Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationJobCreate": {
+ "type": "object",
+ "properties": {
+ "inputs": {
+ "$ref": "#/components/schemas/EvaluatorGenerationInputs",
+ "description": "Caller-supplied inputs."
}
},
- "tags": [
- "Skills"
+ "description": "Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type"
],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluatorGenerationJobSourceType",
+ "description": "The type of source."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "prompt": "#/components/schemas/PromptEvaluatorGenerationJobSource",
+ "agent": "#/components/schemas/AgentEvaluatorGenerationJobSource",
+ "traces": "#/components/schemas/TracesEvaluatorGenerationJobSource",
+ "dataset": "#/components/schemas/DatasetEvaluatorGenerationJobSource"
+ }
+ },
+ "description": "The base source model for evaluator generation jobs. Polymorphic over `type`.",
"x-ms-foundry-meta": {
"required_previews": [
- "Skills=V1Preview"
+ "Evaluations=V1Preview"
]
}
- }
- },
- "/skills/{name}": {
- "get": {
- "operationId": "Skills_getSkill",
- "summary": "Retrieve a skill",
- "description": "Retrieves the specified skill and its current configuration.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The unique name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
+ },
+ "EvaluatorGenerationJobSourceType": {
+ "anyOf": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "prompt",
+ "agent",
+ "traces",
+ "dataset"
+ ]
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Skill"
- }
- }
- }
+ "description": "The supported source types for evaluator generation jobs.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorGenerationTokenUsage": {
+ "type": "object",
+ "required": [
+ "input_tokens",
+ "output_tokens",
+ "total_tokens"
+ ],
+ "properties": {
+ "input_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Number of input (prompt) tokens consumed."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "output_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Number of output (completion) tokens generated."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "total_tokens": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Total tokens consumed (input + output)."
}
},
- "tags": [
- "Skills"
- ],
+ "description": "Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state.",
"x-ms-foundry-meta": {
"required_previews": [
- "Skills=V1Preview"
+ "Evaluations=V1Preview"
]
}
},
- "post": {
- "operationId": "updateSkill",
- "summary": "Update a skill",
- "description": "Modifies the specified skill's configuration.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill to update.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
+ "EvaluatorMetric": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/EvaluatorMetricType",
+ "description": "Type of the metric."
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "desirable_direction": {
+ "$ref": "#/components/schemas/EvaluatorMetricDirection",
+ "description": "It indicates whether a higher value is better or a lower value is better for this metric."
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Skill"
- }
- }
- }
+ "min_value": {
+ "type": "number",
+ "format": "float",
+ "description": "Minimum value for the metric"
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "max_value": {
+ "type": "number",
+ "format": "float",
+ "description": "Maximum value for the metric. If not specified, it is assumed to be unbounded."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- }
- },
- "tags": [
- "Skills"
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "default_version": {
- "type": "string",
- "description": "The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest."
- }
- },
- "required": [
- "default_version"
- ]
- }
- }
+ "threshold": {
+ "type": "number",
+ "format": "float",
+ "description": "Default pass/fail threshold for this metric."
+ },
+ "is_primary": {
+ "type": "boolean",
+ "description": "Indicates if this metric is primary when there are multiple metrics."
}
},
+ "description": "Evaluator Metric",
"x-ms-foundry-meta": {
"required_previews": [
- "Skills=V1Preview"
+ "Evaluations=V1Preview"
]
}
},
- "delete": {
- "operationId": "Skills_deleteSkill",
- "summary": "Delete a skill",
- "description": "Removes the specified skill and its associated versions.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The unique name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
+ "EvaluatorMetricDirection": {
+ "anyOf": [
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "increase",
+ "decrease",
+ "neutral"
+ ]
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DeleteSkillResponse"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "description": "The direction of the metric indicating whether a higher value is better, a lower value is better, or neutral",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorMetricType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ {
+ "type": "string",
+ "enum": [
+ "ordinal",
+ "continuous",
+ "boolean"
+ ]
}
- },
- "tags": [
- "Skills"
],
+ "description": "The type of the evaluator",
"x-ms-foundry-meta": {
"required_previews": [
- "Skills=V1Preview"
+ "Evaluations=V1Preview"
]
}
- }
- },
- "/skills/{name}/content": {
- "get": {
- "operationId": "getSkillContent",
- "summary": "Download the zip content for the default version of a skill",
- "description": "Downloads the zip content for the default version of a skill.",
- "parameters": [
+ },
+ "EvaluatorType": {
+ "anyOf": [
{
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
+ "type": "string"
},
{
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "type": "string",
+ "enum": [
+ "builtin",
+ "custom"
+ ]
+ }
+ ],
+ "description": "The type of the evaluator",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "EvaluatorVersion": {
+ "type": "object",
+ "required": [
+ "evaluator_type",
+ "categories",
+ "definition",
+ "created_by",
+ "created_at",
+ "modified_at",
+ "name",
+ "version"
+ ],
+ "properties": {
+ "display_name": {
+ "type": "string",
+ "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
"type": "string"
},
- "explode": false
- }
- ],
- "responses": {
- "200": {
- "description": "The response body for downloading a skill package.",
- "content": {
- "application/zip": {
- "schema": {
- "contentMediaType": "application/zip"
- }
- }
- }
+ "description": "Metadata about the evaluator"
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "evaluator_type": {
+ "$ref": "#/components/schemas/EvaluatorType",
+ "description": "The type of the evaluator"
+ },
+ "categories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluatorCategory"
+ },
+ "description": "The categories of the evaluator"
+ },
+ "supported_evaluation_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluationLevel"
+ },
+ "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
+ "default": [
+ "turn"
+ ]
+ },
+ "definition": {
+ "$ref": "#/components/schemas/EvaluatorDefinition",
+ "description": "Definition of the evaluator"
+ },
+ "generation_artifacts": {
+ "$ref": "#/components/schemas/EvaluatorGenerationArtifacts",
+ "description": "Provenance artifacts from the generation pipeline. Read-only; present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry Dataset.",
+ "readOnly": true
+ },
+ "generation_job_id": {
+ "type": "string",
+ "description": "Read-only provenance link back to the EvaluatorGenerationJob that produced this version. Present only on evaluator versions created via the generation pipeline; absent for manually-created versions and unaffected by subsequent `PATCH` calls.",
+ "readOnly": true
+ },
+ "warnings": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/GenerationWarningType"
+ },
+ "description": "Categories of warnings surfaced on this generated evaluator version. Present only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent (treat as no warnings) when the version is not from generation, when the paired job was clean, or when a subsequent `PATCH` to `definition` cleared the paired job's advisories. Follow `generation_job_id` to fetch the detailed warning payloads.",
+ "readOnly": true
+ },
+ "created_by": {
+ "type": "string",
+ "description": "Creator of the evaluator",
+ "readOnly": true
+ },
+ "created_at": {
+ "type": "string",
+ "description": "Creation date/time of the evaluator",
+ "readOnly": true
+ },
+ "modified_at": {
+ "type": "string",
+ "description": "Last modified date/time of the evaluator",
+ "readOnly": true
+ },
+ "id": {
+ "type": "string",
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the resource",
+ "readOnly": true
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "version": {
+ "type": "string",
+ "description": "The version of the resource",
+ "readOnly": true
}
},
- "tags": [
- "Skills"
- ],
+ "description": "Evaluator Definition",
"x-ms-foundry-meta": {
"required_previews": [
- "Skills=V1Preview"
+ "Evaluations=V1Preview"
]
}
- }
- },
- "/skills/{name}/versions": {
- "post": {
- "operationId": "createSkillVersion_createSkillVersionFromFiles",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill. If the skill does not exist, it will be created.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ },
+ "EvaluatorVersionCreate": {
+ "type": "object",
+ "required": [
+ "evaluator_type",
+ "categories",
+ "definition"
+ ],
+ "properties": {
+ "display_name": {
+ "type": "string",
+ "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
"type": "string"
},
- "explode": false
- }
- ],
- "description": "Creates a new version of a skill. If the skill does not exist, it will be created. Creates a new version of a skill from uploaded files via multipart form data.",
- "summary": "Create a new version of a skill Create a skill version from uploaded files",
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SkillVersion"
- }
- }
- }
+ "description": "Metadata about the evaluator"
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "evaluator_type": {
+ "$ref": "#/components/schemas/EvaluatorType",
+ "description": "The type of the evaluator"
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "categories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluatorCategory"
+ },
+ "description": "The categories of the evaluator"
+ },
+ "supported_evaluation_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluationLevel"
+ },
+ "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
+ "default": [
+ "turn"
+ ]
+ },
+ "definition": {
+ "$ref": "#/components/schemas/EvaluatorDefinition",
+ "description": "Definition of the evaluator"
+ },
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
}
},
- "x-ms-description-override": "Creates a new version of a skill. If the skill does not exist, it will be created.",
- "x-ms-summary-override": "Create a new version of a skill",
+ "description": "Evaluator Definition",
"x-ms-foundry-meta": {
"required_previews": [
- "Skills=V1Preview"
+ "Evaluations=V1Preview"
]
- },
- "tags": [
- "Skills"
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "inline_content": {
- "$ref": "#/components/schemas/SkillInlineContent",
- "description": "Inline skill content for simple skills without file uploads. Foundry-specific extension."
- },
- "default": {
- "type": "boolean",
- "description": "Whether to set this version as the default."
- }
- }
- }
- },
- "multipart/form-data": {
- "schema": {
- "$ref": "#/components/schemas/CreateSkillVersionFromFilesBody"
- },
- "encoding": {
- "files": {
- "contentType": "*/*"
- },
- "default": {
- "contentType": "text/plain"
- }
- }
- }
- }
}
},
- "get": {
- "operationId": "listSkillVersions",
- "summary": "List skill versions",
- "description": "Returns the available versions for the specified skill.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill to list versions for.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
+ "EvaluatorVersionUpdate": {
+ "type": "object",
+ "properties": {
+ "display_name": {
+ "type": "string",
+ "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
},
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
},
- "explode": false
+ "description": "Metadata about the evaluator"
},
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
+ "categories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluatorCategory"
},
- "explode": false
+ "description": "The categories of the evaluator"
},
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
- "schema": {
- "type": "string"
+ "supported_evaluation_levels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvaluationLevel"
},
- "explode": false
+ "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
+ "default": [
+ "turn"
+ ]
},
- {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
"type": "string"
},
- "explode": false
- },
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ }
+ },
+ "description": "Evaluator Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "ExternalAgentDefinition": {
+ "type": "object",
+ "required": [
+ "kind"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "enum": [
+ "external"
+ ]
},
+ "otel_agent_id": {
+ "type": "string",
+ "description": "The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry agent.\nSpans must include the attribute `gen_ai.agent.id = ` to appear under this registration.\nDefaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios\nwhere the running external agent already emits a stable id that differs from the Foundry agent name.\nThe resolved value is always echoed on read."
+ }
+ },
+ "allOf": [
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "$ref": "#/components/schemas/AgentDefinition"
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/SkillVersion"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
- }
- }
- }
+ "description": "The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS).\nRegistration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations)\nover customer-emitted OpenTelemetry data.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "ExternalAgents=V1Preview"
+ ]
+ }
+ },
+ "FabricDataAgentToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "fabric_dataagent_preview_call"
+ ]
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the tool."
+ },
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
}
},
- "tags": [
- "Skills"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
],
+ "description": "A Fabric data agent tool call.",
"x-ms-foundry-meta": {
"required_previews": [
- "Skills=V1Preview"
+ "preview_tool"
]
}
- }
- },
- "/skills/{name}/versions/{version}": {
- "get": {
- "operationId": "getSkillVersion",
- "summary": "Retrieve a specific version of a skill",
- "description": "Retrieves the specified version of a skill by name and version identifier.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
+ },
+ "FabricDataAgentToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "fabric_dataagent_preview_call_output"
+ ]
},
- {
- "name": "version",
- "in": "path",
- "required": true,
- "description": "The version identifier to retrieve.",
- "schema": {
- "type": "string"
- }
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the tool call generated by the model."
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "output": {
+ "$ref": "#/components/schemas/ToolCallOutputContent",
+ "description": "The output from the Fabric data agent tool call."
},
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
+ }
+ },
+ "allOf": [
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The output of a Fabric data agent tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "FabricDataAgentToolParameters": {
+ "type": "object",
+ "properties": {
+ "project_connections": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ToolProjectConnection"
},
- "explode": false
+ "maxItems": 1,
+ "description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
}
+ },
+ "description": "The fabric data agent tool parameters.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "FabricIQPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "project_connection_id"
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SkillVersion"
- }
- }
- }
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "fabric_iq_preview"
+ ],
+ "description": "The object type, which is always 'fabric_iq_preview'."
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the FabricIQ project connection."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "(Optional) The label of the FabricIQ MCP server to connect to."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
}
- }
+ ],
+ "description": "(Optional) Whether the agent requires approval before executing actions. Default is always.",
+ "default": "always"
}
},
- "tags": [
- "Skills"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
],
+ "description": "A FabricIQ server-side tool.",
"x-ms-foundry-meta": {
"required_previews": [
- "Skills=V1Preview"
+ "preview_tool"
]
}
},
- "delete": {
- "operationId": "deleteSkillVersion",
- "summary": "Delete a specific version of a skill",
- "description": "Removes the specified version of a skill.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
- {
- "name": "version",
- "in": "path",
- "required": true,
- "description": "The version identifier to delete.",
- "schema": {
- "type": "string"
- }
+ "FabricIQPreviewToolboxTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "project_connection_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "fabric_iq_preview"
+ ]
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the FabricIQ project connection."
},
- {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
- }
- ],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DeleteSkillVersionResponse"
- }
- }
- }
+ "server_label": {
+ "type": "string",
+ "description": "(Optional) The label of the FabricIQ MCP server to connect to."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
}
- }
+ ],
+ "description": "(Optional) Whether the agent requires approval before executing actions. Default is always.",
+ "default": "always"
}
},
- "tags": [
- "Skills"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
],
+ "description": "A FabricIQ tool stored in a toolbox.",
"x-ms-foundry-meta": {
"required_previews": [
- "Skills=V1Preview"
+ "preview_tool"
]
}
- }
- },
- "/skills/{name}/versions/{version}/content": {
- "get": {
- "operationId": "getSkillVersionContent",
- "summary": "Download the zip content for a specific version of a skill",
- "description": "Downloads the zip content for a specific version of a skill.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the skill.",
- "schema": {
- "$ref": "#/components/schemas/SkillName"
- }
- },
- {
- "name": "version",
- "in": "path",
- "required": true,
- "description": "The version to download content for.",
- "schema": {
- "type": "string"
- }
+ },
+ "FileDataGenerationJobOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "filename"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file"
+ ],
+ "description": "Azure OpenAI file output."
},
- {
- "name": "Foundry-Features",
- "in": "header",
- "required": true,
- "description": "A feature flag opt-in required when using preview operations or modifying persisted preview resources.",
- "schema": {
- "type": "string",
- "enum": [
- "Skills=V1Preview"
- ]
- }
+ "id": {
+ "type": "string",
+ "description": "The id of the output Azure OpenAI file.",
+ "readOnly": true
},
+ "filename": {
+ "type": "string",
+ "description": "The filename of the output Azure OpenAI file.",
+ "readOnly": true
+ }
+ },
+ "allOf": [
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "$ref": "#/components/schemas/DataGenerationJobOutput"
}
],
- "responses": {
- "200": {
- "description": "The response body for downloading a skill package.",
- "content": {
- "application/zip": {
- "schema": {
- "contentMediaType": "application/zip"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "description": "Azure OpenAI file output for a data generation job.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
+ ]
+ }
+ },
+ "FileDataGenerationJobSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file"
+ ],
+ "description": "The source type for this job, which is File."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "id": {
+ "type": "string",
+ "description": "Input Azure Open AI file id used for data generation."
}
},
- "tags": [
- "Skills"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/DataGenerationJobSource"
+ }
],
+ "description": "File source for data generation jobs — Azure OpenAI file input.",
"x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
+ "conditional_previews": [
+ "DataGenerationJobs=V1Preview"
]
}
- }
- },
- "/toolboxes": {
- "get": {
- "operationId": "listToolboxes",
- "summary": "List toolboxes",
- "description": "Returns the toolboxes available in the current project.",
- "parameters": [
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
- },
- {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
- },
- {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
- {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
+ },
+ "FileDatasetVersion": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "uri_file"
+ ],
+ "description": "Dataset type"
+ }
+ },
+ "allOf": [
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "$ref": "#/components/schemas/DatasetVersion"
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ToolboxObject"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- },
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "description": "FileDatasetVersion Definition"
+ },
+ "FileDatasetVersionUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "uri_file"
+ ],
+ "description": "Dataset type"
}
},
- "tags": [
- "Toolboxes"
- ]
- }
- },
- "/toolboxes/{name}": {
- "get": {
- "operationId": "getToolbox",
- "summary": "Retrieve a toolbox",
- "description": "Retrieves the specified toolbox and its current configuration.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the toolbox to retrieve.",
- "schema": {
- "type": "string"
- }
- },
+ "allOf": [
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "$ref": "#/components/schemas/DatasetVersionUpdate"
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ToolboxObject"
- }
- }
- }
+ "description": "FileDatasetVersion Definition"
+ },
+ "FileSearchToolboxTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "file_search"
+ ]
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "max_num_results": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.RankingOptions",
+ "description": "Ranking options for search."
+ },
+ "filters": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Filters"
+ },
+ {
+ "type": "null"
}
- }
+ ]
+ },
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The IDs of the vector stores to search."
}
},
- "tags": [
- "Toolboxes"
- ]
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A file search tool stored in a toolbox."
},
- "patch": {
- "operationId": "updateToolbox",
- "summary": "Update a toolbox to point to a specific version",
- "description": "Updates the toolbox's default version pointer to the specified version.",
- "parameters": [
+ "FilterStrategyType": {
+ "anyOf": [
{
- "$ref": "#/components/parameters/UpdateToolboxRequest.name"
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "random_sampling",
+ "smart_filtering"
+ ]
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ToolboxObject"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "description": "Specifies the type of filter strategy used to select traces for evaluation."
+ },
+ "FixedRatioVersionSelectionRule": {
+ "type": "object",
+ "required": [
+ "type",
+ "traffic_percentage"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "FixedRatio"
+ ]
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "traffic_percentage": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "maximum": 100,
+ "description": "The percentage of traffic to route to the version. Must be between 0 and 100."
}
},
- "tags": [
- "Toolboxes"
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UpdateToolboxRequest"
- }
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/VersionSelectionRule"
}
- }
+ ]
},
- "delete": {
- "operationId": "deleteToolbox",
- "summary": "Delete a toolbox",
- "description": "Removes the specified toolbox along with all of its versions.",
- "parameters": [
- {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the toolbox to delete.",
- "schema": {
- "type": "string"
- }
- },
+ "FolderDatasetVersion": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "uri_folder"
+ ],
+ "description": "Dataset type"
+ }
+ },
+ "allOf": [
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "$ref": "#/components/schemas/DatasetVersion"
}
],
- "responses": {
- "204": {
- "description": "There is no content to send for this request, but the headers may be useful. "
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
- },
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "description": "FileDatasetVersion Definition"
+ },
+ "FolderDatasetVersionUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "uri_folder"
+ ],
+ "description": "Dataset type"
}
},
- "tags": [
- "Toolboxes"
- ]
- }
- },
- "/toolboxes/{name}/versions": {
- "post": {
- "operationId": "createToolboxVersion",
- "summary": "Create a new version of a toolbox",
- "description": "Creates a new toolbox version, provisioning the toolbox itself if it does not already exist.",
- "parameters": [
+ "allOf": [
{
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the toolbox. If the toolbox does not exist, it will be created.",
- "schema": {
- "type": "string",
- "maxLength": 256
- }
+ "$ref": "#/components/schemas/DatasetVersionUpdate"
+ }
+ ],
+ "description": "FileDatasetVersion Definition"
+ },
+ "FoundryModelArtifactProfileCategory": {
+ "anyOf": [
+ {
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "DataOnly",
+ "RuntimeDependent",
+ "Unknown"
+ ]
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ToolboxVersionObject"
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "description": "The artifact profile category.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryModelArtifactProfileSignal": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ {
+ "type": "string",
+ "enum": [
+ "PickleDeserialization",
+ "CustomPythonCode",
+ "DynamicOps",
+ "NativeBinary",
+ "UnknownFormat"
+ ]
}
- },
- "tags": [
- "Toolboxes"
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "description": {
- "type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the toolbox."
- },
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Arbitrary key-value metadata to associate with the toolbox."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ToolboxTool"
- },
- "description": "The list of tools to include in this version."
- },
- "skills": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ToolboxSkill"
- },
- "description": "The list of skill sources to include in this version. A skill reference specifies a skill name and optionally a version. If version is omitted, the skill's default version is used."
- },
- "policies": {
- "$ref": "#/components/schemas/ToolboxPolicies",
- "description": "Policy configuration for this toolbox version."
- }
- },
- "required": [
- "tools"
- ]
- }
- }
- }
+ "description": "Signals detected in the model artifact.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
}
},
- "get": {
- "operationId": "listToolboxVersions",
- "summary": "List toolbox versions",
- "description": "Returns the available versions for the specified toolbox.",
- "parameters": [
+ "FoundryModelSourceType": {
+ "anyOf": [
{
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the toolbox to list versions for.",
- "schema": {
- "type": "string"
- }
+ "type": "string"
},
{
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 20
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "LocalUpload",
+ "TrainingJob"
+ ]
+ }
+ ],
+ "description": "The source type of the model.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryModelWarning": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "$ref": "#/components/schemas/FoundryModelWarningCode",
+ "description": "The warning code."
},
+ "message": {
+ "type": "string",
+ "description": "The warning message."
+ }
+ },
+ "description": "A warning associated with a model.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryModelWarningCode": {
+ "anyOf": [
{
- "name": "order",
- "in": "query",
- "required": false,
- "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.",
- "schema": {
- "$ref": "#/components/schemas/PageOrder"
- },
- "explode": false
+ "type": "string"
},
{
- "name": "after",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
- },
+ "type": "string",
+ "enum": [
+ "RuntimeDependentArtifact",
+ "UnclassifiedArtifact"
+ ]
+ }
+ ],
+ "description": "Warning code for model artifacts.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryModelWeightType": {
+ "anyOf": [
{
- "name": "before",
- "in": "query",
- "required": false,
- "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "FullWeight",
+ "LoRA",
+ "DraftModel"
+ ]
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "data",
- "has_more"
- ],
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ToolboxVersionObject"
- },
- "description": "The requested list of items."
- },
- "first_id": {
- "type": "string",
- "description": "The first ID represented in this list."
- },
- "last_id": {
- "type": "string",
- "description": "The last ID represented in this list."
- },
- "has_more": {
- "type": "boolean",
- "description": "A value indicating whether there are additional values available not captured in this list."
- }
- },
- "description": "The response data for a requested list of items."
- }
- }
- }
- },
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "description": "The weight type of the model.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
+ },
+ "FoundryTimestamp": {
+ "type": "integer",
+ "format": "unixtime"
+ },
+ "FunctionToolCall": {
+ "type": "object",
+ "required": [
+ "name",
+ "arguments"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the function to call."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "arguments": {
+ "type": "string",
+ "description": "The arguments to call the function with, as generated by the model in JSON format."
}
},
- "tags": [
- "Toolboxes"
- ]
- }
- },
- "/toolboxes/{name}/versions/{version}": {
- "get": {
- "operationId": "getToolboxVersion",
- "summary": "Retrieve a specific version of a toolbox",
- "description": "Retrieves the specified version of a toolbox by name and version identifier.",
- "parameters": [
+ "description": "Details of a function tool call."
+ },
+ "GenerationWarningType": {
+ "anyOf": [
{
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the toolbox.",
- "schema": {
- "type": "string"
- }
+ "type": "string"
},
{
- "name": "version",
- "in": "path",
- "required": true,
- "description": "The version identifier to retrieve.",
- "schema": {
- "type": "string"
- }
+ "type": "string",
+ "enum": [
+ "input_quality"
+ ]
+ }
+ ],
+ "description": "Category of a warning surfaced on a generated evaluator version. Extensible so new warning categories (e.g., safety, output quality) can be introduced without a breaking change.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "GitHubIssueEvent": {
+ "anyOf": [
+ {
+ "type": "string"
},
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "type": "string",
+ "enum": [
+ "opened",
+ "closed"
+ ]
}
],
- "responses": {
- "200": {
- "description": "The request has succeeded.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ToolboxVersionObject"
- }
- }
- }
+ "description": "Known GitHub issue events that can fire a routine.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "GitHubIssueRoutineTrigger": {
+ "type": "object",
+ "required": [
+ "type",
+ "connection_id",
+ "owner",
+ "repository",
+ "issue_event"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "github_issue"
+ ],
+ "description": "The trigger type."
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "connection_id": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "The workspace connection identifier that resolves the GitHub configuration for the trigger."
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
- }
- }
+ "owner": {
+ "type": "string",
+ "maxLength": 128,
+ "description": "The GitHub owner or organization that scopes which issues can fire the trigger."
+ },
+ "repository": {
+ "type": "string",
+ "maxLength": 128,
+ "description": "The GitHub repository filter that scopes which issues can fire the trigger."
+ },
+ "issue_event": {
+ "$ref": "#/components/schemas/GitHubIssueEvent",
+ "description": "The GitHub issue event that fires the routine."
}
},
- "tags": [
- "Toolboxes"
- ]
- },
- "delete": {
- "operationId": "deleteToolboxVersion",
- "summary": "Delete a specific version of a toolbox",
- "description": "Removes the specified version of a toolbox.",
- "parameters": [
+ "allOf": [
{
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the toolbox.",
- "schema": {
- "type": "string"
- }
+ "$ref": "#/components/schemas/RoutineTrigger"
+ }
+ ],
+ "description": "A GitHub issue routine trigger.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
+ },
+ "HeaderTelemetryEndpointAuth": {
+ "type": "object",
+ "required": [
+ "type",
+ "header_name",
+ "secret_id",
+ "secret_key"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "header"
+ ],
+ "description": "The authentication type, always 'header' for header-based secret authentication."
},
- {
- "name": "version",
- "in": "path",
- "required": true,
- "description": "The version identifier to delete.",
- "schema": {
- "type": "string"
- }
+ "header_name": {
+ "type": "string",
+ "description": "The name of the HTTP header to inject the secret value into.",
+ "examples": [
+ "X-Otlp-Api-Key"
+ ]
+ },
+ "secret_id": {
+ "type": "string",
+ "description": "The identifier of the secret store or connection.",
+ "examples": [
+ "my-secret-store"
+ ]
},
+ "secret_key": {
+ "type": "string",
+ "description": "The key within the secret to retrieve the authentication value.",
+ "examples": [
+ "OTLP_KEY"
+ ]
+ }
+ },
+ "allOf": [
{
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "$ref": "#/components/schemas/TelemetryEndpointAuth"
}
],
- "responses": {
- "204": {
- "description": "There is no content to send for this request, but the headers may be useful. "
+ "description": "Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header."
+ },
+ "HostedAgentDefinition": {
+ "type": "object",
+ "required": [
+ "kind",
+ "cpu",
+ "memory"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "enum": [
+ "hosted"
+ ]
},
- "4XX": {
- "description": "Client error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
- }
+ "cpu": {
+ "type": "string",
+ "description": "The CPU configuration for the hosted agent.",
+ "examples": [
+ "0.25"
+ ]
+ },
+ "memory": {
+ "type": "string",
+ "description": "The memory configuration for the hosted agent.",
+ "examples": [
+ "0.5Gi"
+ ]
+ },
+ "environment_variables": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Environment variables to set in the hosted agent container.",
+ "examples": [
+ {
+ "name": "LOG_LEVEL",
+ "value": "debug"
}
- }
+ ]
},
- "5XX": {
- "description": "Server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiErrorResponse"
+ "container_configuration": {
+ "$ref": "#/components/schemas/ContainerConfiguration",
+ "description": "Container-based deployment configuration. Provide this for image-based deployments. Mutually exclusive with code_configuration — the service validates that exactly one is set."
+ },
+ "protocol_versions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ProtocolVersionRecord"
+ },
+ "description": "The protocols that the agent supports for ingress communication.",
+ "examples": [
+ [
+ {
+ "protocol": "responses",
+ "version": "v0.1.1"
+ },
+ {
+ "protocol": "a2a",
+ "version": "v0.3.0"
}
- }
- }
+ ]
+ ]
+ },
+ "code_configuration": {
+ "$ref": "#/components/schemas/CodeConfiguration",
+ "description": "Code-based deployment configuration. Provide this for code-based deployments. Mutually exclusive with container_configuration — the service validates that exactly one is set."
+ },
+ "telemetry_config": {
+ "$ref": "#/components/schemas/TelemetryConfig",
+ "description": "Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics."
}
},
- "tags": [
- "Toolboxes"
- ]
- }
- }
- },
- "security": [
- {
- "OAuth2Auth": [
- "https://ai.azure.com/.default"
- ]
- }
- ],
- "components": {
- "parameters": {
- "Azure.Core.ClientRequestIdHeader": {
- "name": "x-ms-client-request-id",
- "in": "header",
- "required": false,
- "description": "An opaque, globally-unique, client-generated string identifier for the request.",
- "schema": {
- "$ref": "#/components/schemas/Azure.Core.uuid"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentDefinition"
+ }
+ ],
+ "description": "The hosted agent definition."
},
- "Azure.Core.Foundations.ApiVersionParameter": {
- "name": "api-version",
- "in": "query",
- "required": true,
- "description": "The API version to use for this operation.",
- "schema": {
- "type": "string",
- "minLength": 1
+ "HourlyRecurrenceSchedule": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "Hourly"
+ ]
+ }
},
- "explode": false
- },
- "CreateOrUpdateRoutineParameters.routine_name": {
- "name": "routine_name",
- "in": "path",
- "required": true,
- "description": "The unique name of the routine.",
- "schema": {
- "type": "string",
- "maxLength": 128
- }
- },
- "DeleteRoutineParameters": {
- "name": "routine_name",
- "in": "path",
- "required": true,
- "description": "The unique name of the routine.",
- "schema": {
- "type": "string",
- "maxLength": 128
- }
- },
- "DisableRoutineParameters": {
- "name": "routine_name",
- "in": "path",
- "required": true,
- "description": "The unique name of the routine.",
- "schema": {
- "type": "string",
- "maxLength": 128
- }
- },
- "DispatchRoutineAsyncParameters.routine_name": {
- "name": "routine_name",
- "in": "path",
- "required": true,
- "description": "The unique name of the routine.",
- "schema": {
- "type": "string",
- "maxLength": 128
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RecurrenceSchedule"
+ }
+ ],
+ "description": "Hourly recurrence schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
}
},
- "EnableRoutineParameters": {
- "name": "routine_name",
- "in": "path",
- "required": true,
- "description": "The unique name of the routine.",
- "schema": {
- "type": "string",
- "maxLength": 128
+ "HumanEvaluationPreviewRuleAction": {
+ "type": "object",
+ "required": [
+ "type",
+ "templateId"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "humanEvaluationPreview"
+ ]
+ },
+ "templateId": {
+ "$ref": "#/components/schemas/AssetId",
+ "description": "Human evaluation template Id."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationRuleAction"
+ }
+ ],
+ "description": "Evaluation rule action for human evaluation.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
}
},
- "GetRoutineParameters": {
- "name": "routine_name",
- "in": "path",
- "required": true,
- "description": "The unique name of the routine.",
- "schema": {
- "type": "string",
- "maxLength": 128
- }
+ "HumanEvaluationRuleAction": {
+ "type": "object",
+ "required": [
+ "type",
+ "templateId"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "humanEvaluation"
+ ]
+ },
+ "templateId": {
+ "$ref": "#/components/schemas/AssetId",
+ "description": "Human evaluation template Id."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/EvaluationRuleAction"
+ }
+ ],
+ "description": "Evaluation rule action for human evaluation."
},
- "ListRoutineRunsParameters.after": {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "An opaque cursor returned as last_id by the previous list-runs response.",
- "schema": {
- "type": "string"
+ "Index": {
+ "type": "object",
+ "required": [
+ "type",
+ "name",
+ "version"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/IndexType",
+ "description": "Type of index"
+ },
+ "id": {
+ "type": "string",
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the resource",
+ "readOnly": true
+ },
+ "version": {
+ "type": "string",
+ "description": "The version of the resource",
+ "readOnly": true
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "AzureSearch": "#/components/schemas/AzureAISearchIndex",
+ "ManagedAzureSearch": "#/components/schemas/ManagedAzureAISearchIndex",
+ "CosmosDBNoSqlVectorStore": "#/components/schemas/CosmosDBIndex"
+ }
},
- "explode": false
+ "description": "Index resource Definition"
},
- "ListRoutineRunsParameters.before": {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "Unsupported. Reserved for future backward pagination support.",
- "schema": {
- "type": "string"
- },
- "explode": false
+ "IndexType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "AzureSearch",
+ "CosmosDBNoSqlVectorStore",
+ "ManagedAzureSearch"
+ ]
+ }
+ ]
},
- "ListRoutineRunsParameters.filter": {
- "name": "filter",
- "in": "query",
- "required": false,
- "description": "An optional MLflow search-runs filter expression applied within the routine's experiment.",
- "schema": {
- "type": "string"
+ "IndexUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/IndexType",
+ "description": "Type of index"
+ },
+ "description": {
+ "type": "string",
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
+ }
},
- "explode": false
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "AzureSearch": "#/components/schemas/AzureAISearchIndexUpdate",
+ "ManagedAzureSearch": "#/components/schemas/ManagedAzureAISearchIndexUpdate",
+ "CosmosDBNoSqlVectorStore": "#/components/schemas/CosmosDBIndexUpdate"
+ }
+ },
+ "description": "Index resource Definition"
},
- "ListRoutineRunsParameters.limit": {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "The maximum number of runs to return.",
- "schema": {
- "type": "integer",
- "format": "int32"
+ "InputData": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "Type of the data"
+ }
},
- "explode": false
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "dataset": "#/components/schemas/InputDataset"
+ }
+ },
+ "description": "Abstract data class."
},
- "ListRoutineRunsParameters.order": {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "The ordering direction. Supported values are asc and desc.",
- "schema": {
- "type": "string"
+ "InputDataset": {
+ "type": "object",
+ "required": [
+ "type",
+ "id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "dataset"
+ ]
+ },
+ "id": {
+ "type": "string",
+ "description": "Evaluation input data"
+ }
},
- "explode": false
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/InputData"
+ }
+ ],
+ "description": "Dataset as source for evaluation."
},
- "ListRoutineRunsParameters.routine_name": {
- "name": "routine_name",
- "in": "path",
- "required": true,
- "description": "The unique name of the routine.",
- "schema": {
- "type": "string",
- "maxLength": 128
+ "Insight": {
+ "type": "object",
+ "required": [
+ "id",
+ "metadata",
+ "state",
+ "displayName",
+ "request"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the insights report.",
+ "readOnly": true
+ },
+ "metadata": {
+ "$ref": "#/components/schemas/InsightsMetadata",
+ "description": "Metadata about the insights report.",
+ "readOnly": true
+ },
+ "state": {
+ "$ref": "#/components/schemas/Azure.Core.Foundations.OperationState",
+ "description": "The current state of the insights.",
+ "readOnly": true
+ },
+ "displayName": {
+ "type": "string",
+ "description": "User friendly display name for the insight."
+ },
+ "request": {
+ "$ref": "#/components/schemas/InsightRequest",
+ "description": "Request for the insights analysis."
+ },
+ "result": {
+ "$ref": "#/components/schemas/InsightResult",
+ "description": "The result of the insights report.",
+ "readOnly": true
+ }
+ },
+ "description": "The response body for cluster insights.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
}
},
- "ListRoutinesParameters.after": {
- "name": "after",
- "in": "query",
- "required": false,
- "description": "An opaque cursor returned as last_id by the previous list response.",
- "schema": {
- "type": "string"
+ "InsightCluster": {
+ "type": "object",
+ "required": [
+ "id",
+ "label",
+ "suggestion",
+ "suggestionTitle",
+ "description",
+ "weight"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The id of the analysis cluster."
+ },
+ "label": {
+ "type": "string",
+ "description": "Label for the cluster"
+ },
+ "suggestion": {
+ "type": "string",
+ "description": "Suggestion for the cluster"
+ },
+ "suggestionTitle": {
+ "type": "string",
+ "description": "The title of the suggestion for the cluster"
+ },
+ "description": {
+ "type": "string",
+ "description": "Description of the analysis cluster."
+ },
+ "weight": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The weight of the analysis cluster. This indicate number of samples in the cluster."
+ },
+ "subClusters": {
+ "description": "List of subclusters within this cluster. Empty if no subclusters exist.",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/InsightCluster"
+ }
+ },
+ "samples": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/InsightSample"
+ },
+ "description": "List of samples that belong to this cluster. Empty if samples are part of subclusters."
+ }
},
- "explode": false
+ "description": "A cluster of analysis samples.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
},
- "ListRoutinesParameters.before": {
- "name": "before",
- "in": "query",
- "required": false,
- "description": "Unsupported. Reserved for future backward pagination support.",
- "schema": {
- "type": "string"
+ "InsightModelConfiguration": {
+ "type": "object",
+ "required": [
+ "modelDeploymentName"
+ ],
+ "properties": {
+ "modelDeploymentName": {
+ "type": "string",
+ "description": "The model deployment to be evaluated. Accepts either the deployment name alone or with the connection name as '{connectionName}/'."
+ }
},
- "explode": false
+ "description": "Configuration of the model used in the insight generation.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
},
- "ListRoutinesParameters.limit": {
- "name": "limit",
- "in": "query",
- "required": false,
- "description": "The maximum number of routines to return.",
- "schema": {
- "type": "integer",
- "format": "int32"
+ "InsightRequest": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/InsightType",
+ "description": "The type of request."
+ }
},
- "explode": false
- },
- "ListRoutinesParameters.order": {
- "name": "order",
- "in": "query",
- "required": false,
- "description": "The ordering direction. Supported values are asc and desc.",
- "schema": {
- "type": "string"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "EvaluationRunClusterInsight": "#/components/schemas/EvaluationRunClusterInsightRequest",
+ "AgentClusterInsight": "#/components/schemas/AgentClusterInsightRequest",
+ "EvaluationComparison": "#/components/schemas/EvaluationComparisonInsightRequest"
+ }
},
- "explode": false
- },
- "UpdateToolboxRequest.name": {
- "name": "name",
- "in": "path",
- "required": true,
- "description": "The name of the toolbox to update.",
- "schema": {
- "type": "string"
+ "description": "The request of the insights report.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
}
- }
- },
- "schemas": {
- "A2APreviewTool": {
+ },
+ "InsightResult": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
+ "$ref": "#/components/schemas/InsightType",
+ "description": "The type of insights result."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "EvaluationComparison": "#/components/schemas/EvaluationComparisonInsightResult",
+ "EvaluationRunClusterInsight": "#/components/schemas/EvaluationRunClusterInsightResult",
+ "AgentClusterInsight": "#/components/schemas/AgentClusterInsightResult"
+ }
+ },
+ "description": "The result of the insights.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightSample": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "features",
+ "correlationInfo"
+ ],
+ "properties": {
+ "id": {
"type": "string",
- "enum": [
- "a2a_preview"
- ],
- "description": "The type of the tool. Always `\"a2a_preview`."
+ "description": "The unique identifier for the analysis sample."
},
- "base_url": {
- "type": "string",
- "format": "uri",
- "description": "Base URL of the agent."
+ "type": {
+ "$ref": "#/components/schemas/SampleType",
+ "description": "Sample type"
},
- "agent_card_path": {
- "type": "string",
- "description": "The path to the agent card relative to the `base_url`.\nIf not provided, defaults to `/.well-known/agent-card.json`"
+ "features": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Features to help with additional filtering of data in UX."
},
- "project_connection_id": {
+ "correlationInfo": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Info about the correlation for the analysis sample."
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "EvaluationResultSample": "#/components/schemas/EvaluationResultSample"
+ }
+ },
+ "description": "A sample from the analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightScheduleTask": {
+ "type": "object",
+ "required": [
+ "type",
+ "insight"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The connection ID in the project for the A2A server.\nThe connection stores authentication and other connection details needed to connect to the A2A server."
+ "enum": [
+ "Insight"
+ ]
},
- "send_credentials_for_agent_card": {
- "type": "boolean",
- "description": "When `true`, Foundry sends its credentials when fetching the remote\nagent's Agent Card. The service defaults to `false` if a value is not\nspecified by the caller (anonymous fetch).",
- "default": false
+ "insight": {
+ "$ref": "#/components/schemas/Insight",
+ "description": "The insight payload."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/ScheduleTask"
}
],
- "description": "An agent implementing the A2A protocol."
+ "description": "Insight task for the schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
},
- "A2APreviewToolboxTool": {
+ "InsightSummary": {
"type": "object",
"required": [
- "type"
+ "sampleCount",
+ "uniqueSubclusterCount",
+ "uniqueClusterCount",
+ "method",
+ "usage"
],
"properties": {
- "type": {
+ "sampleCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of samples analyzed."
+ },
+ "uniqueSubclusterCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of unique subcluster labels."
+ },
+ "uniqueClusterCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of unique clusters."
+ },
+ "method": {
+ "type": "string",
+ "description": "Method used for clustering."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/ClusterTokenUsage",
+ "description": "Token usage while performing clustering analysis"
+ }
+ },
+ "description": "Summary of the error cluster analysis.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
"type": "string",
"enum": [
- "a2a_preview"
+ "EvaluationRunClusterInsight",
+ "AgentClusterInsight",
+ "EvaluationComparison"
]
- },
- "base_url": {
+ }
+ ],
+ "description": "The request of the insights.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InsightsMetadata": {
+ "type": "object",
+ "required": [
+ "createdAt"
+ ],
+ "properties": {
+ "createdAt": {
"type": "string",
- "format": "uri",
- "description": "Base URL of the agent."
+ "format": "date-time",
+ "description": "The timestamp when the insights were created."
},
- "agent_card_path": {
+ "completedAt": {
"type": "string",
- "description": "The path to the agent card relative to the `base_url`.\nIf not provided, defaults to `/.well-known/agent-card.json`"
- },
- "project_connection_id": {
+ "format": "date-time",
+ "description": "The timestamp when the insights were completed."
+ }
+ },
+ "description": "Metadata about the insights.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Insights=V1Preview"
+ ]
+ }
+ },
+ "InvocationsProtocolConfiguration": {
+ "type": "object",
+ "description": "Configuration specific to the invocations protocol."
+ },
+ "InvocationsWsProtocolConfiguration": {
+ "type": "object",
+ "description": "Configuration specific to the WebSocket-based invocations protocol."
+ },
+ "InvokeAgentInvocationsApiDispatchPayload": {
+ "type": "object",
+ "required": [
+ "type",
+ "input"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The connection ID in the project for the A2A server.\nThe connection stores authentication and other connection details needed to connect to the A2A server."
+ "enum": [
+ "invoke_agent_invocations_api"
+ ],
+ "description": "The manual dispatch payload type."
},
- "send_credentials_for_agent_card": {
- "type": "boolean",
- "description": "When `true`, Foundry sends its credentials when fetching the remote\nagent's Agent Card. The service defaults to `false` if a value is not\nspecified by the caller (anonymous fetch).",
- "default": false
+ "input": {
+ "description": "The JSON value sent as the complete downstream invocations input. The value is passed through as-is and can be an object, string, number, boolean, array, or null."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/ToolboxTool"
+ "$ref": "#/components/schemas/RoutineDispatchPayload"
}
],
- "description": "An A2A tool stored in a toolbox."
- },
- "A2AProtocolConfiguration": {
- "type": "object",
- "description": "Configuration specific to the A2A protocol."
+ "description": "A manual payload used to test an invocations API routine dispatch.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
},
- "A2AToolCall": {
+ "InvokeAgentInvocationsApiRoutineAction": {
"type": "object",
"required": [
- "type",
- "call_id",
- "name",
- "arguments",
- "status"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "a2a_preview_call"
- ]
+ "invoke_agent_invocations_api"
+ ],
+ "description": "The action type."
},
- "call_id": {
+ "agent_name": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "maxLength": 256,
+ "description": "The project-scoped agent name for routine dispatch."
},
- "name": {
+ "agent_endpoint_id": {
"type": "string",
- "description": "The name of the A2A agent card being called."
+ "maxLength": 256,
+ "description": "Legacy endpoint-scoped agent identifier for routine dispatch."
},
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "input": {
+ "description": "Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "session_id": {
+ "type": "string",
+ "maxLength": 256,
+ "description": "An optional existing hosted-agent session identifier to continue during the downstream dispatch."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/RoutineAction"
}
],
- "description": "An A2A (Agent-to-Agent) tool call."
+ "description": "Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
},
- "A2AToolCallOutput": {
+ "InvokeAgentResponsesApiDispatchPayload": {
"type": "object",
"required": [
"type",
- "call_id",
- "name",
- "status"
+ "input"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "a2a_preview_call_output"
- ]
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "name": {
- "type": "string",
- "description": "The name of the A2A agent card that was called."
- },
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the A2A tool call."
+ "invoke_agent_responses_api"
+ ],
+ "description": "The manual dispatch payload type."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "input": {
+ "description": "The JSON value sent as the complete downstream responses input. The value is passed through as-is and can be an object, string, number, boolean, array, or null."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/RoutineDispatchPayload"
}
],
- "description": "The output of an A2A (Agent-to-Agent) tool call."
+ "description": "A manual payload used to test a responses API routine dispatch.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
},
- "AISearchIndexResource": {
+ "InvokeAgentResponsesApiRoutineAction": {
"type": "object",
+ "required": [
+ "type"
+ ],
"properties": {
- "project_connection_id": {
+ "type": {
"type": "string",
- "description": "An index connection ID in an IndexResource attached to this agent."
+ "enum": [
+ "invoke_agent_responses_api"
+ ],
+ "description": "The action type."
},
- "index_name": {
+ "agent_name": {
"type": "string",
- "description": "The name of an index in an IndexResource attached to this agent."
- },
- "query_type": {
- "$ref": "#/components/schemas/AzureAISearchQueryType",
- "description": "Type of query in an AIIndexResource attached to this agent."
- },
- "top_k": {
- "type": "integer",
- "format": "int32",
- "description": "Number of documents to retrieve from search and present to the model."
+ "maxLength": 256,
+ "description": "The project-scoped agent name for routine dispatch."
},
- "filter": {
+ "agent_endpoint_id": {
"type": "string",
- "description": "filter string for search resource. [Learn more here](https://learn.microsoft.com/azure/search/search-filters)."
+ "maxLength": 256,
+ "description": "Legacy endpoint-scoped agent identifier for routine dispatch."
},
- "index_asset_id": {
+ "input": {
+ "description": "Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied."
+ },
+ "conversation": {
"type": "string",
- "description": "Index asset id for search resource."
+ "maxLength": 256,
+ "description": "An optional existing conversation identifier to continue during the downstream dispatch."
}
},
- "description": "A AI Search Index resource."
- },
- "ActivityProtocolConfiguration": {
- "type": "object",
- "properties": {
- "enable_m365_public_endpoint": {
- "type": "boolean",
- "description": "Whether to enable the M365 public endpoint for the activity protocol."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RoutineAction"
}
- },
- "description": "Configuration specific to the activity protocol."
+ ],
+ "description": "Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.",
+ "x-ms-foundry-meta": {
+ "conditional_previews": [
+ "Routines=V1Preview"
+ ]
+ }
},
- "AgentBlueprintReference": {
+ "ItemGenerationParams": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/AgentBlueprintReferenceType"
+ "$ref": "#/components/schemas/ItemGenerationParamsType",
+ "description": "The type of item generation parameters to use."
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "ManagedAgentIdentityBlueprint": "#/components/schemas/ManagedAgentIdentityBlueprintReference"
+ "red_team": "#/components/schemas/RedTeamItemGenerationParams",
+ "red_team_seed_prompts": "#/components/schemas/RedTeamSeedPromptsItemGenerationParams",
+ "red_team_taxonomy": "#/components/schemas/RedTeamTaxonomyItemGenerationParams",
+ "response_retrieval": "#/components/schemas/ResponseRetrievalItemGenerationParams",
+ "conversation_gen_preview": "#/components/schemas/ConversationGenPreviewItemGenerationParams",
+ "synthetic_data_gen_preview": "#/components/schemas/SyntheticDataGenerationPreviewItemGenerationParams"
}
- }
+ },
+ "description": "Represents the set of parameters used to control item generation operations."
},
- "AgentBlueprintReferenceType": {
+ "ItemGenerationParamsType": {
"anyOf": [
{
"type": "string"
@@ -19921,467 +39286,384 @@
{
"type": "string",
"enum": [
- "ManagedAgentIdentityBlueprint"
+ "red_team",
+ "response_retrieval",
+ "red_team_seed_prompts",
+ "red_team_taxonomy",
+ "synthetic_data_gen_preview",
+ "conversation_gen_preview"
]
}
- ]
+ ],
+ "description": "The types of parameters for red team item generation."
},
- "AgentCard": {
- "type": "object",
- "required": [
- "version",
- "skills"
+ "JobStatus": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "succeeded",
+ "failed",
+ "cancelled"
+ ]
+ }
],
+ "description": "Extensible status values shared by Foundry jobs."
+ },
+ "LoraConfig": {
+ "type": "object",
"properties": {
- "version": {
- "type": "string",
- "minLength": 1,
- "maxLength": 32,
- "description": "The version of the agent card."
+ "rank": {
+ "type": "integer",
+ "format": "int32",
+ "description": "LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64."
},
- "description": {
- "type": "string",
- "maxLength": 2048,
- "description": "The description of the agent card."
+ "alpha": {
+ "type": "integer",
+ "format": "int32",
+ "description": "LoRA scaling factor (α). Positive integer; typically 2× the rank."
},
- "skills": {
+ "targetModules": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/AgentCardSkill"
+ "type": "string"
},
- "minItems": 1,
- "maxItems": 16,
- "description": "The set of skills that an agent can perform."
+ "description": "Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from adapter_config.json if omitted."
+ },
+ "dropout": {
+ "type": "number",
+ "format": "float",
+ "description": "Dropout rate used during training. Informational — not used at serving time."
}
+ },
+ "description": "Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
}
},
- "AgentCardSkill": {
+ "MCPToolboxTool": {
"type": "object",
"required": [
- "id",
- "name"
+ "type",
+ "server_label"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "a unique identifier for the skill"
+ "enum": [
+ "mcp"
+ ]
},
- "name": {
+ "server_label": {
"type": "string",
- "minLength": 1,
- "maxLength": 128,
- "description": "The name of the skill"
+ "description": "A label for this MCP server, used to identify it in tool calls."
},
- "description": {
+ "server_url": {
"type": "string",
- "maxLength": 2048,
- "description": "A description of the skill"
+ "format": "uri",
+ "description": "The URL for the MCP server. One of `server_url`, `connector_id`, or\n `tunnel_id` must be provided."
},
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentCardSkillTag"
- },
- "maxItems": 5,
- "description": "set of tagwords describing classes of capabilities for the skill"
+ "connector_id": {
+ "type": "string",
+ "enum": [
+ "connector_dropbox",
+ "connector_gmail",
+ "connector_googlecalendar",
+ "connector_googledrive",
+ "connector_microsoftteams",
+ "connector_outlookcalendar",
+ "connector_outlookemail",
+ "connector_sharepoint"
+ ],
+ "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more\n about service connectors [here](/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`"
},
- "examples": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentCardSkillExample"
- },
- "maxItems": 5,
- "description": "A list of example scenarios that the skill can perform."
- }
- }
- },
- "AgentCardSkillExample": {
- "type": "string",
- "maxLength": 1024,
- "description": "A skill example string with a maximum length of 1024 characters."
- },
- "AgentCardSkillTag": {
- "type": "string",
- "maxLength": 32
- },
- "AgentCardUpdate": {
- "type": "object",
- "properties": {
- "version": {
+ "tunnel_id": {
"type": "string",
- "minLength": 1,
- "maxLength": 32,
- "description": "The version of the agent card."
+ "pattern": "^tunnel_[a-z0-9]{32}$",
+ "description": "The Secure MCP Tunnel ID to use instead of a direct server URL. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided."
},
- "description": {
+ "authorization": {
"type": "string",
- "maxLength": 2048,
- "description": "The description of the agent card."
+ "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here."
},
- "skills": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentCardSkill"
- },
- "minItems": 1,
- "maxItems": 16,
- "description": "The set of skills that an agent can perform."
- }
- }
- },
- "AgentClusterInsightRequest": {
- "type": "object",
- "required": [
- "type",
- "agentName"
- ],
- "properties": {
- "type": {
+ "server_description": {
"type": "string",
- "enum": [
- "AgentClusterInsight"
+ "description": "Optional description of the MCP server, used to provide more context."
+ },
+ "headers": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "allowed_tools": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "always",
+ "never"
+ ]
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of request."
+ "default": "always"
},
- "agentName": {
- "type": "string",
- "description": "Identifier for the agent."
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this MCP tool is deferred and discovered via tool search."
},
- "modelConfiguration": {
- "$ref": "#/components/schemas/InsightModelConfiguration",
- "description": "Configuration of the model used in the insight generation."
+ "project_connection_id": {
+ "type": "string",
+ "description": "The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/InsightRequest"
+ "$ref": "#/components/schemas/ToolboxTool"
}
],
- "description": "Insights on set of Agent Evaluation Results",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "An MCP tool stored in a toolbox."
},
- "AgentClusterInsightResult": {
+ "ManagedAgentIdentityBlueprint": {
"type": "object",
"required": [
- "type",
- "clusterInsight"
+ "name"
],
"properties": {
- "type": {
+ "name": {
"type": "string",
- "enum": [
- "AgentClusterInsight"
- ],
- "description": "The type of insights result."
- },
- "clusterInsight": {
- "$ref": "#/components/schemas/ClusterInsightResult"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/InsightResult"
+ "readOnly": true
}
- ],
- "description": "Insights from the agent cluster analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "AgentContainerObject": {
+ "ManagedAgentIdentityBlueprintReference": {
"type": "object",
"required": [
- "object",
- "status",
- "created_at",
- "updated_at"
+ "type",
+ "blueprint_id"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "agent.container"
- ],
- "description": "The object type, which is always 'agent.container'.",
- "readOnly": true
- },
- "id": {
- "type": "string",
- "description": "The identifier of the container.",
- "readOnly": true
- },
- "status": {
- "$ref": "#/components/schemas/AgentContainerStatus",
- "description": "The status of the container of a specific version of an agent.",
- "readOnly": true
- },
- "max_replicas": {
- "type": "integer",
- "format": "int32",
- "description": "The maximum number of replicas for the container. Default is 1.",
- "examples": [
- 10
- ]
- },
- "min_replicas": {
- "type": "integer",
- "format": "int32",
- "description": "The minimum number of replicas for the container. Default is 1.",
- "examples": [
- 1
+ "ManagedAgentIdentityBlueprint"
]
- },
- "error_message": {
- "type": "string",
- "description": "The error message if the container failed to operate, if any.",
- "readOnly": true
- },
- "created_at": {
- "type": "string",
- "format": "date-time",
- "description": "The creation time of the container.",
- "readOnly": true
- },
- "updated_at": {
- "type": "string",
- "format": "date-time",
- "description": "The last update time of the container.",
- "readOnly": true
- },
- "container": {
- "$ref": "#/components/schemas/ContainerDetails",
- "description": "The detailed container information.",
- "readOnly": true
+ },
+ "blueprint_id": {
+ "type": "string",
+ "description": "The ID of the managed blueprint"
}
},
- "description": "The details of the container of a specific version of an agent.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ContainerAgents=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AgentBlueprintReference"
+ }
+ ]
},
- "AgentContainerOperationError": {
+ "ManagedAzureAISearchIndex": {
"type": "object",
"required": [
- "code",
- "type",
- "message"
+ "type"
],
"properties": {
- "code": {
- "type": "string",
- "description": "The error code of the container operation."
- },
"type": {
"type": "string",
- "description": "The error type of the container operation."
- },
- "message": {
+ "enum": [
+ "ManagedAzureSearch"
+ ],
+ "description": "Type of index"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Index"
+ }
+ ],
+ "description": "Managed Azure AI Search Index Definition"
+ },
+ "ManagedAzureAISearchIndexUpdate": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The error message of the container operation."
+ "enum": [
+ "ManagedAzureSearch"
+ ],
+ "description": "Type of index"
}
},
- "description": "The error details of the container operation, if any.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ContainerAgents=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/IndexUpdate"
+ }
+ ],
+ "description": "Managed Azure AI Search Index Definition"
},
- "AgentContainerOperationObject": {
+ "McpProtocolConfiguration": {
+ "type": "object",
+ "description": "Configuration specific to the MCP protocol."
+ },
+ "MemoryCommandToolCall": {
"type": "object",
"required": [
- "id",
- "agent_id",
- "agent_version_id",
+ "type",
+ "call_id",
+ "arguments",
"status"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The ID of the container operation. This id is a globally unique identifier."
+ "enum": [
+ "memory_command_preview_call"
+ ]
},
- "agent_id": {
+ "call_id": {
"type": "string",
- "description": "The ID of the agent."
+ "description": "The unique ID of the tool call generated by the model."
},
- "agent_version_id": {
+ "arguments": {
"type": "string",
- "description": "The ID of the agent version."
+ "description": "A JSON string of the arguments to pass to the tool, including `action` (`remember` or `forget`) and `content`."
},
"status": {
- "$ref": "#/components/schemas/AgentContainerOperationStatus",
- "description": "The status of the container operation."
- },
- "error": {
- "$ref": "#/components/schemas/AgentContainerOperationError",
- "description": "The error of the container operation, if any."
- },
- "container": {
- "$ref": "#/components/schemas/AgentContainerObject",
- "description": "The container of the specific version of an agent."
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
}
},
- "description": "The container operation for a specific version of an agent.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ContainerAgents=V1Preview"
- ]
- }
- },
- "AgentContainerOperationStatus": {
- "type": "string",
- "enum": [
- "NotStarted",
- "InProgress",
- "Succeeded",
- "Failed"
- ],
- "description": "Status of the container operation for a specific version of an agent.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ContainerAgents=V1Preview"
- ]
- }
- },
- "AgentContainerStatus": {
- "anyOf": [
- {
- "type": "string"
- },
+ "allOf": [
{
- "type": "string",
- "enum": [
- "Starting",
- "Running",
- "Stopping",
- "Stopped",
- "Failed",
- "Deleting",
- "Deleted",
- "Updating"
- ]
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "Status of the container of a specific version of an agent.",
+ "description": "A memory command tool call.",
"x-ms-foundry-meta": {
"required_previews": [
- "ContainerAgents=V1Preview"
+ "preview_tool"
]
}
},
- "AgentDataGenerationJobSource": {
+ "MemoryCommandToolCallOutput": {
"type": "object",
"required": [
"type",
- "agent_name"
+ "call_id",
+ "status"
],
"properties": {
- "description": {
- "type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
- },
"type": {
"type": "string",
"enum": [
- "agent"
- ],
- "description": "The source type for this source, which is Agent."
+ "memory_command_preview_call_output"
+ ]
},
- "agent_name": {
+ "call_id": {
"type": "string",
- "description": "The agent name to fetch instructions from."
+ "description": "The unique ID of the tool call generated by the model."
},
- "agent_version": {
- "type": "string",
- "description": "The agent version. If not specified, the latest version is used."
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/DataGenerationJobSource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "Agent source for data generation jobs — references an agent to fetch instructions and metadata from.",
+ "description": "The output of a memory command tool call.",
"x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
+ "required_previews": [
+ "preview_tool"
]
}
},
- "AgentDefinition": {
+ "MemoryItem": {
"type": "object",
"required": [
+ "memory_id",
+ "updated_at",
+ "scope",
+ "content",
"kind"
],
"properties": {
- "kind": {
- "$ref": "#/components/schemas/AgentKind"
+ "memory_id": {
+ "type": "string",
+ "description": "The unique ID of the memory item."
},
- "rai_config": {
- "$ref": "#/components/schemas/RaiConfig",
- "description": "Configuration for Responsible AI (RAI) content filtering and safety features."
+ "updated_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The last update time of the memory item."
+ },
+ "scope": {
+ "type": "string",
+ "description": "The namespace that logically groups and isolates memories, such as a user ID."
+ },
+ "content": {
+ "type": "string",
+ "description": "The content of the memory."
+ },
+ "kind": {
+ "$ref": "#/components/schemas/MemoryItemKind",
+ "description": "The kind of the memory item."
}
},
"discriminator": {
"propertyName": "kind",
"mapping": {
- "hosted": "#/components/schemas/HostedAgentDefinition",
- "prompt": "#/components/schemas/PromptAgentDefinition",
- "workflow": "#/components/schemas/WorkflowAgentDefinition",
- "external": "#/components/schemas/ExternalAgentDefinition",
- "container_app": "#/components/schemas/ContainerAppAgentDefinition"
+ "user_profile": "#/components/schemas/UserProfileMemoryItem",
+ "chat_summary": "#/components/schemas/ChatSummaryMemoryItem",
+ "procedural": "#/components/schemas/ProceduralMemoryItem"
}
},
+ "description": "A single memory item stored in the memory store, containing content and metadata.",
"x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
+ "required_previews": [
+ "MemoryStores=V1Preview"
]
}
},
- "AgentDefinitionOptInKeys": {
- "type": "string",
- "enum": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview",
- "HostedAgents=V1Preview",
- "ContainerAgents=V1Preview"
- ],
- "description": "Feature opt-in keys for agent definition operations supporting hosted or workflow agents."
- },
- "AgentEndpointAuthorizationScheme": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationSchemeType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "Entra": "#/components/schemas/EntraAuthorizationScheme",
- "BotService": "#/components/schemas/BotServiceAuthorizationScheme",
- "BotServiceRbac": "#/components/schemas/BotServiceRbacAuthorizationScheme",
- "BotServiceTenant": "#/components/schemas/BotServiceTenantAuthorizationScheme"
- }
- }
- },
- "AgentEndpointAuthorizationSchemeType": {
+ "MemoryItemKind": {
"anyOf": [
{
"type": "string"
@@ -20389,69 +39671,43 @@
{
"type": "string",
"enum": [
- "Entra",
- "BotService",
- "BotServiceRbac",
- "BotServiceTenant"
+ "user_profile",
+ "chat_summary",
+ "procedural"
]
}
- ]
- },
- "AgentEndpointConfig": {
- "type": "object",
- "properties": {
- "version_selector": {
- "$ref": "#/components/schemas/VersionSelector",
- "description": "The version selector of the agent endpoint determines how traffic is routed to different versions of the agent."
- },
- "protocols": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentEndpointProtocol"
- },
- "description": "Deprecated: Use protocol_configuration instead. The presence of a key in protocol_configuration declares the protocol is enabled."
- },
- "protocol_configuration": {
- "$ref": "#/components/schemas/ProtocolConfiguration",
- "description": "Per-protocol configuration for the agent endpoint."
- },
- "authorization_schemes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
- },
- "description": "The authorization schemes supported by the agent endpoint"
- }
+ ],
+ "description": "Memory item kind.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
}
},
- "AgentEndpointConfigUpdate": {
+ "MemoryOperation": {
"type": "object",
+ "required": [
+ "kind",
+ "memory_item"
+ ],
"properties": {
- "version_selector": {
- "$ref": "#/components/schemas/VersionSelectorUpdate",
- "description": "The version selector of the agent endpoint determines how traffic is routed to different versions of the agent."
- },
- "protocols": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentEndpointProtocol"
- },
- "description": "Deprecated: Use protocol_configuration instead. The presence of a key in protocol_configuration declares the protocol is enabled."
- },
- "protocol_configuration": {
- "$ref": "#/components/schemas/ProtocolConfiguration",
- "description": "Per-protocol configuration for the agent endpoint."
+ "kind": {
+ "$ref": "#/components/schemas/MemoryOperationKind",
+ "description": "The type of memory operation being performed."
},
- "authorization_schemes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
- },
- "description": "The authorization schemes supported by the agent endpoint"
+ "memory_item": {
+ "$ref": "#/components/schemas/MemoryItem",
+ "description": "The memory item to create, update, or delete."
}
+ },
+ "description": "Represents a single memory operation (create, update, or delete) performed on a memory item.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
}
},
- "AgentEndpointProtocol": {
+ "MemoryOperationKind": {
"anyOf": [
{
"type": "string"
@@ -20459,346 +39715,325 @@
{
"type": "string",
"enum": [
- "activity",
- "responses",
- "a2a",
- "mcp",
- "invocations",
- "invocations_ws"
+ "create",
+ "update",
+ "delete"
]
}
- ]
+ ],
+ "description": "Memory operation kind.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
},
- "AgentEvaluation": {
+ "MemorySearchItem": {
"type": "object",
"required": [
- "id",
- "status"
+ "memory_item"
],
"properties": {
- "id": {
- "type": "string",
- "description": "Identifier of the agent evaluation run."
- },
- "status": {
- "type": "string",
- "description": "Status of the agent evaluation. Options: Running, Completed, Failed."
- },
- "error": {
- "type": "string",
- "description": "The reason of the request failure for the long running process, if applicable."
- },
- "result": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AgentEvaluationResult"
- },
- "description": "The agent evaluation result."
- }
- },
- "description": "Evaluation response for agent evaluation run."
- },
- "AgentEvaluationRedactionConfiguration": {
- "type": "object",
- "properties": {
- "redactScoreProperties": {
- "type": "boolean",
- "description": "Redact score properties. If not specified, the default is to redact in production."
+ "memory_item": {
+ "$ref": "#/components/schemas/MemoryItem",
+ "description": "Retrieved memory item."
}
},
- "description": "The redaction configuration will allow the user to control what is redacted."
+ "description": "A retrieved memory item from memory search.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
},
- "AgentEvaluationRequest": {
+ "MemorySearchOptions": {
"type": "object",
- "required": [
- "runId",
- "evaluators",
- "appInsightsConnectionString"
- ],
"properties": {
- "runId": {
- "type": "string",
- "description": "Identifier of the agent run."
- },
- "threadId": {
- "type": "string",
- "description": "Identifier of the agent thread. This field is mandatory currently, but it will be optional in the future."
- },
- "evaluators": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/EvaluatorConfiguration"
- },
- "description": "Evaluators to be used for the evaluation."
- },
- "samplingConfiguration": {
- "$ref": "#/components/schemas/AgentEvaluationSamplingConfiguration",
- "description": "Sampling configuration for the evaluation."
- },
- "redactionConfiguration": {
- "$ref": "#/components/schemas/AgentEvaluationRedactionConfiguration",
- "description": "Redaction configuration for the evaluation."
- },
- "appInsightsConnectionString": {
- "type": "string",
- "description": "Pass the AppInsights connection string to the agent evaluation for the evaluation results and the errors logs."
+ "max_memories": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Maximum number of memory items to return."
}
},
- "description": "Evaluation request for agent run."
+ "description": "Memory search options.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
},
- "AgentEvaluationResult": {
+ "MemorySearchPreviewTool": {
"type": "object",
"required": [
- "evaluator",
- "evaluatorId",
- "score",
- "status",
- "runId"
+ "type",
+ "memory_store_name",
+ "scope"
],
"properties": {
- "evaluator": {
- "type": "string",
- "description": "Evaluator's name. This is the name of the evaluator that was used to evaluate the agent's completion."
- },
- "evaluatorId": {
- "type": "string",
- "description": "Identifier of the evaluator."
- },
- "score": {
- "type": "number",
- "format": "float",
- "description": "Score of the given evaluator. No restriction on range."
- },
- "status": {
- "type": "string",
- "description": "Status of the evaluator result. Options: Running, Completed, Failed, NotApplicable."
- },
- "reason": {
- "type": "string",
- "description": "Reasoning for the evaluation result."
- },
- "version": {
- "type": "string",
- "description": "Version of the evaluator that was used to evaluate the agent's completion."
- },
- "threadId": {
- "type": "string",
- "description": "The unique identifier of the thread."
- },
- "runId": {
+ "type": {
"type": "string",
- "description": "The unique identifier of the run."
+ "enum": [
+ "memory_search_preview"
+ ],
+ "description": "The type of the tool. Always `memory_search_preview`."
},
- "error": {
+ "memory_store_name": {
"type": "string",
- "description": "A string explaining why there was an error, if applicable."
+ "description": "The name of the memory store to use."
},
- "additionalDetails": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Additional properties relevant to the evaluator. These will differ between evaluators."
- }
- },
- "description": "Result for the agent evaluation evaluator run."
- },
- "AgentEvaluationSamplingConfiguration": {
- "type": "object",
- "required": [
- "name",
- "samplingPercent",
- "maxRequestRate"
- ],
- "properties": {
- "name": {
+ "scope": {
"type": "string",
- "description": "Name of the sampling strategy."
- },
- "samplingPercent": {
- "type": "number",
- "format": "float",
- "description": "Percentage of sampling per hour (0-100)."
+ "description": "The namespace used to group and isolate memories, such as a user ID.\nLimits which memories can be retrieved or updated.\nUse special variable `{{$userId}}` to scope memories to the current signed-in user."
},
- "maxRequestRate": {
- "type": "number",
- "format": "float",
- "description": "Maximum request rate per hour (0 to 1000)."
+ "search_options": {
+ "$ref": "#/components/schemas/MemorySearchOptions",
+ "description": "Options for searching the memory store."
+ },
+ "update_delay": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Time to wait before updating memories after inactivity (seconds). Default 300.",
+ "default": 300
}
},
- "description": "Definition for sampling strategy."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A tool for integrating memories into the agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
- "AgentEvaluationSuiteJobSource": {
+ "MemorySearchTool": {
"type": "object",
"required": [
"type",
- "agent_name"
+ "memory_store_name",
+ "scope"
],
"properties": {
- "description": {
- "type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
- },
"type": {
"type": "string",
"enum": [
- "agent"
+ "memory_search"
],
- "description": "The source type for this source, which is Agent."
+ "description": "The type of the tool. Always `memory_search_preview`."
},
- "agent_name": {
+ "memory_store_name": {
"type": "string",
- "description": "The agent name to fetch instructions from."
+ "description": "The name of the memory store to use."
},
- "agent_version": {
+ "scope": {
"type": "string",
- "description": "The agent version. If not specified, the latest version is used."
+ "description": "The namespace used to group and isolate memories, such as a user ID.\nLimits which memories can be retrieved or updated.\nUse special variable `{{$userId}}` to scope memories to the current signed-in user."
+ },
+ "search_options": {
+ "$ref": "#/components/schemas/MemorySearchOptions",
+ "description": "Options for searching the memory store."
+ },
+ "update_delay": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Time to wait before updating memories after inactivity (seconds). Default 300.",
+ "default": 300
}
},
"allOf": [
{
- "$ref": "#/components/schemas/EvaluationSuiteJobSource"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "Agent source for evaluation suite generation jobs — references an agent to fetch instructions and metadata from.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "A tool for integrating memories into the agent."
},
- "AgentEvaluatorGenerationJobSource": {
+ "MemorySearchToolCall": {
"type": "object",
"required": [
"type",
- "agent_name"
+ "status"
],
"properties": {
- "description": {
- "type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
- },
"type": {
"type": "string",
"enum": [
- "agent"
- ],
- "description": "The source type for this source, which is Agent."
+ "memory_search_call"
+ ]
},
- "agent_name": {
- "type": "string",
- "description": "The agent name to fetch instructions from."
+ "status": {
+ "$ref": "#/components/schemas/ToolCallStatus",
+ "description": "The status of the tool call."
},
- "agent_version": {
- "type": "string",
- "description": "The agent version. If not specified, the latest version is used."
+ "memories": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MemoryItem"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The results returned from the memory search."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from.",
+ "description": "A memory search tool call.",
"x-ms-foundry-meta": {
"required_previews": [
- "Evaluations=V1Preview"
+ "preview_tool"
]
}
},
- "AgentFilterTraceSource": {
+ "MemoryStoreDefaultDefinition": {
"type": "object",
"required": [
- "type"
+ "kind",
+ "chat_model",
+ "embedding_model"
],
"properties": {
- "type": {
+ "kind": {
"type": "string",
"enum": [
- "agent_filter"
+ "default"
],
- "description": "The type of trace source, always `agent_filter`."
- },
- "agent_id": {
- "type": "string",
- "description": "The identifier of the agent to filter traces by."
+ "description": "The kind of the memory store."
},
- "agent_name": {
+ "chat_model": {
"type": "string",
- "description": "The name of the agent to filter traces by."
+ "description": "The name or identifier of the chat completion model deployment used for memory processing."
},
- "agent_version": {
+ "embedding_model": {
"type": "string",
- "description": "The version of the agent to filter traces by."
- },
- "start_time": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "Start time for the trace query window, expressed as a Unix timestamp (seconds)."
- },
- "end_time": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "End time for the trace query window, expressed as a Unix timestamp (seconds)."
- },
- "max_traces": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of traces to sample. Must be greater than 0."
+ "description": "The name or identifier of the embedding model deployment used for memory processing."
},
- "filter_strategy": {
- "$ref": "#/components/schemas/FilterStrategyType",
- "description": "The strategy used to filter traces."
+ "options": {
+ "$ref": "#/components/schemas/MemoryStoreDefaultOptions",
+ "description": "Default memory store options."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/TraceSource"
+ "$ref": "#/components/schemas/MemoryStoreDefinition"
}
],
- "description": "A trace source that selects traces by agent reference with time-based filtering."
+ "description": "Default memory store implementation.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
},
- "AgentId": {
+ "MemoryStoreDefaultOptions": {
"type": "object",
"required": [
- "type",
- "name",
- "version"
+ "user_profile_enabled",
+ "chat_summary_enabled"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "agent_id"
- ]
+ "user_profile_enabled": {
+ "type": "boolean",
+ "description": "Whether to enable user profile extraction and storage. Default is true.",
+ "default": true
},
- "name": {
+ "user_profile_details": {
"type": "string",
- "maxLength": 256,
- "description": "The name of the agent."
+ "description": "Specific categories or types of user profile information to extract and store."
},
- "version": {
- "type": "string",
- "description": "The version identifier of the agent."
+ "chat_summary_enabled": {
+ "type": "boolean",
+ "description": "Whether to enable chat summary extraction and storage. Defaults to `true`.",
+ "default": true
+ },
+ "procedural_memory_enabled": {
+ "type": "boolean",
+ "description": "Whether to enable procedural memory extraction and storage. The service defaults to `true` if a value is not specified by the caller.",
+ "default": true
+ },
+ "default_ttl_seconds": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The default time-to-live for memories in seconds. A value of `0` indicates that memories do not expire. Defaults to `0`.",
+ "default": 0
}
+ },
+ "description": "Default memory store configurations.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
}
},
- "AgentIdentity": {
+ "MemoryStoreDefinition": {
"type": "object",
"required": [
- "principal_id",
- "client_id"
+ "kind"
],
"properties": {
- "principal_id": {
+ "kind": {
+ "$ref": "#/components/schemas/MemoryStoreKind",
+ "description": "The kind of the memory store."
+ }
+ },
+ "discriminator": {
+ "propertyName": "kind",
+ "mapping": {
+ "default": "#/components/schemas/MemoryStoreDefaultDefinition"
+ }
+ },
+ "description": "Base definition for memory store configurations.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreDeleteScopeResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "name",
+ "scope",
+ "deleted"
+ ],
+ "properties": {
+ "object": {
"type": "string",
- "description": "The principal ID of the agent instance"
+ "enum": [
+ "memory_store.scope.deleted"
+ ],
+ "description": "The object type. Always 'memory_store.scope.deleted'."
},
- "client_id": {
+ "name": {
"type": "string",
- "description": "The client ID of the agent instance. Also referred to as the instance ID"
+ "description": "The name of the memory store."
+ },
+ "scope": {
+ "type": "string",
+ "description": "The scope from which memories were deleted."
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the deletion operation was successful."
}
+ },
+ "description": "Response for deleting memories from a scope.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
}
},
- "AgentKind": {
+ "MemoryStoreKind": {
"anyOf": [
{
"type": "string"
@@ -20806,954 +40041,726 @@
{
"type": "string",
"enum": [
- "prompt",
- "hosted",
- "workflow",
- "external",
- "container_app"
+ "default"
]
}
- ]
+ ],
+ "description": "The type of memory store implementation to use.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
},
- "AgentObject": {
+ "MemoryStoreObject": {
"type": "object",
"required": [
"object",
"id",
+ "created_at",
+ "updated_at",
"name",
- "state",
- "versions"
+ "definition"
],
"properties": {
"object": {
"type": "string",
"enum": [
- "agent"
+ "memory_store"
],
- "description": "The object type, which is always 'agent'."
+ "description": "The object type, which is always 'memory_store'."
},
"id": {
"type": "string",
- "description": "The unique identifier of the agent."
+ "description": "The unique identifier of the memory store."
+ },
+ "created_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The Unix timestamp (seconds) when the memory store was created."
+ },
+ "updated_at": {
+ "$ref": "#/components/schemas/FoundryTimestamp",
+ "description": "The Unix timestamp (seconds) when the memory store was last updated."
},
"name": {
"type": "string",
- "maxLength": 63,
- "description": "The name of the agent."
+ "maxLength": 256,
+ "description": "The name of the memory store."
},
- "state": {
- "$ref": "#/components/schemas/AgentState",
- "description": "The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests.",
- "readOnly": true
+ "description": {
+ "type": "string",
+ "maxLength": 512,
+ "description": "A human-readable description of the memory store."
},
- "versions": {
+ "metadata": {
"type": "object",
- "properties": {
- "latest": {
- "$ref": "#/components/schemas/AgentVersionObject"
- }
+ "unevaluatedProperties": {
+ "type": "string"
},
- "required": [
- "latest"
- ],
- "description": "The latest version of the agent."
- },
- "agent_endpoint": {
- "$ref": "#/components/schemas/AgentEndpointConfig",
- "description": "The endpoint configuration for the agent"
- },
- "instance_identity": {
- "$ref": "#/components/schemas/AgentIdentity",
- "description": "The instance identity of the agent",
- "readOnly": true
- },
- "blueprint": {
- "$ref": "#/components/schemas/AgentIdentity",
- "description": "The blueprint for the agent",
- "readOnly": true
- },
- "blueprint_reference": {
- "$ref": "#/components/schemas/AgentBlueprintReference",
- "description": "The blueprint for the agent",
- "readOnly": true
+ "description": "Arbitrary key-value metadata to associate with the memory store."
},
- "agent_card": {
- "$ref": "#/components/schemas/AgentCard"
+ "definition": {
+ "$ref": "#/components/schemas/MemoryStoreDefinition",
+ "description": "The definition of the memory store."
}
+ },
+ "description": "A memory store that can store and retrieve user memories.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
}
},
- "AgentReference": {
+ "MemoryStoreOperationUsage": {
"type": "object",
"required": [
- "type",
- "name"
+ "embedding_tokens",
+ "input_tokens",
+ "input_tokens_details",
+ "output_tokens",
+ "output_tokens_details",
+ "total_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "agent_reference"
- ]
+ "embedding_tokens": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The number of embedding tokens."
},
- "name": {
- "type": "string",
- "maxLength": 256,
- "description": "The name of the agent."
+ "input_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of input tokens."
},
- "version": {
- "type": "string",
- "description": "The version identifier of the agent."
+ "input_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails",
+ "description": "A detailed breakdown of the input tokens."
+ },
+ "output_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of output tokens."
+ },
+ "output_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails",
+ "description": "A detailed breakdown of the output tokens."
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The total number of tokens used."
}
+ },
+ "description": "Usage statistics of a memory store operation.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
}
},
- "AgentSessionResource": {
+ "MemoryStoreSearchResponse": {
"type": "object",
"required": [
- "agent_session_id",
- "version_indicator",
- "status",
- "created_at",
- "last_accessed_at",
- "expires_at"
+ "search_id",
+ "memories",
+ "usage"
],
"properties": {
- "agent_session_id": {
+ "search_id": {
"type": "string",
- "description": "The session identifier."
- },
- "version_indicator": {
- "$ref": "#/components/schemas/VersionIndicator",
- "description": "The version indicator determining which agent version backs this session."
- },
- "status": {
- "$ref": "#/components/schemas/AgentSessionStatus",
- "description": "The current status of the session."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) when the session was created.",
- "readOnly": true
+ "description": "The unique ID of this search request. Use this value as previous_search_id in subsequent requests to perform incremental searches."
},
- "last_accessed_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) when the session was last accessed.",
- "readOnly": true
+ "memories": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MemorySearchItem"
+ },
+ "description": "Related memory items found during the search operation."
},
- "expires_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).",
- "readOnly": true
+ "usage": {
+ "$ref": "#/components/schemas/MemoryStoreOperationUsage",
+ "description": "Usage statistics associated with the memory search operation."
}
},
- "description": "An agent session providing a long-lived compute sandbox for hosted agent invocations."
- },
- "AgentSessionStatus": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "creating",
- "active",
- "idle",
- "updating",
- "failed",
- "deleting",
- "deleted",
- "expired"
- ]
- }
- ],
- "description": "The status of an agent session."
- },
- "AgentState": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "enabled",
- "disabled"
- ]
- }
- ],
- "description": "The operational state of an agent."
+ "description": "Memory search response.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
},
- "AgentTaxonomyInput": {
+ "MemoryStoreUpdateCompletedResult": {
"type": "object",
"required": [
- "type",
- "target",
- "riskCategories"
+ "memory_operations",
+ "usage"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "agent"
- ],
- "description": "Input type of the evaluation taxonomy."
- },
- "target": {
- "$ref": "#/components/schemas/Target",
- "description": "Target configuration for the agent."
- },
- "riskCategories": {
+ "memory_operations": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/RiskCategory"
+ "$ref": "#/components/schemas/MemoryOperation"
},
- "description": "List of risk categories to evaluate against."
+ "description": "A list of individual memory operations that were performed during the update."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/MemoryStoreOperationUsage",
+ "description": "Usage statistics associated with the memory update operation."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluationTaxonomyInput"
- }
- ],
- "description": "Input configuration for the evaluation taxonomy when the input type is agent.",
+ "description": "Memory update result.",
"x-ms-foundry-meta": {
"required_previews": [
- "Evaluations=V1Preview"
+ "MemoryStores=V1Preview"
]
}
},
- "AgentTaxonomyInputUpdate": {
+ "MemoryStoreUpdateResponse": {
"type": "object",
+ "required": [
+ "update_id",
+ "status"
+ ],
"properties": {
- "type": {
+ "update_id": {
"type": "string",
- "enum": [
- "agent"
- ],
- "description": "Input type of the evaluation taxonomy."
+ "description": "The unique ID of this update request. Use this value as previous_update_id in subsequent requests to perform incremental updates."
},
- "target": {
- "$ref": "#/components/schemas/TargetUpdate",
- "description": "Target configuration for the agent."
+ "status": {
+ "$ref": "#/components/schemas/MemoryStoreUpdateStatus",
+ "description": "The status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", \"failed\", or \"superseded\"."
},
- "riskCategories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/RiskCategory"
- },
- "description": "List of risk categories to evaluate against."
+ "superseded_by": {
+ "type": "string",
+ "description": "The update_id the operation was superseded by when status is \"superseded\"."
+ },
+ "result": {
+ "$ref": "#/components/schemas/MemoryStoreUpdateCompletedResult",
+ "description": "The result of memory store update operation when status is \"completed\"."
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.Error",
+ "description": "Error object that describes the error when status is \"failed\"."
}
},
- "allOf": [
+ "description": "Provides the status of a memory store update operation.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "MemoryStores=V1Preview"
+ ]
+ }
+ },
+ "MemoryStoreUpdateStatus": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/EvaluationTaxonomyInputUpdate"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "completed",
+ "failed",
+ "superseded"
+ ]
}
],
- "description": "Input configuration for the evaluation taxonomy when the input type is agent.",
+ "description": "Status of a memory store update operation.",
"x-ms-foundry-meta": {
"required_previews": [
- "Evaluations=V1Preview"
+ "MemoryStores=V1Preview"
]
}
},
- "AgentVersionObject": {
+ "Message": {
"type": "object",
"required": [
- "metadata",
- "object",
- "id",
- "name",
- "version",
- "created_at",
- "definition"
+ "role"
],
"properties": {
- "metadata": {
+ "role": {
"anyOf": [
{
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- }
+ "type": "string",
+ "enum": [
+ "system",
+ "assistant",
+ "developer",
+ "user"
+ ]
},
{
- "type": "null"
+ "type": "string"
}
],
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
- },
- "object": {
- "type": "string",
- "enum": [
- "agent.version"
- ],
- "description": "The object type, which is always 'agent.version'."
- },
- "id": {
- "type": "string",
- "description": "The unique identifier of the agent version."
- },
- "name": {
- "type": "string",
- "maxLength": 256,
- "description": "The name of the agent. Name can be used to retrieve/update/delete the agent."
- },
- "version": {
- "type": "string",
- "description": "The version identifier of the agent. Agents are immutable and every update creates a new version while keeping the name same."
- },
- "description": {
- "type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
- },
- "created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The Unix timestamp (seconds) when the agent was created."
- },
- "definition": {
- "$ref": "#/components/schemas/AgentDefinition"
- },
- "draft": {
- "type": "boolean",
- "description": "Whether this agent version is a draft (candidate) rather than a release. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to false.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DraftAgents=V1Preview"
- ]
- },
- "default": false
- },
- "status": {
- "$ref": "#/components/schemas/AgentVersionStatus",
- "description": "The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For hosted agents, reflects infrastructure readiness."
- },
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error",
- "description": "Error details if the agent version provisioning failed."
- },
- "instance_identity": {
- "$ref": "#/components/schemas/AgentIdentity",
- "description": "The instance identity of the agent",
- "readOnly": true
- },
- "blueprint": {
- "$ref": "#/components/schemas/AgentIdentity",
- "description": "The blueprint for the agent",
- "readOnly": true
- },
- "blueprint_reference": {
- "$ref": "#/components/schemas/AgentBlueprintReference",
- "description": "The blueprint for the agent",
- "readOnly": true
- },
- "agent_guid": {
- "type": "string",
- "description": "The unique GUID identifier of the agent.",
- "readOnly": true
+ "description": "The role of the message author. Known values: 'system', 'assistant', 'developer', 'user'."
}
- }
- },
- "AgentVersionStatus": {
- "type": "string",
- "enum": [
- "creating",
- "active",
- "failed",
- "deleting",
- "deleted"
- ],
- "description": "The provisioning status of an agent version."
+ },
+ "discriminator": {
+ "propertyName": "role",
+ "mapping": {
+ "system": "#/components/schemas/SystemMessage",
+ "developer": "#/components/schemas/DeveloperMessage",
+ "user": "#/components/schemas/UserMessage",
+ "assistant": "#/components/schemas/AssistantMessage"
+ }
+ },
+ "description": "Abstract base model representing a single message in a conversation."
},
- "AgenticIdentityPreviewCredentials": {
+ "MicrosoftFabricPreviewTool": {
"type": "object",
"required": [
- "type"
+ "type",
+ "fabric_dataagent_preview"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "AgenticIdentityToken_Preview"
+ "fabric_dataagent_preview"
],
- "description": "The credential type",
- "readOnly": true
+ "description": "The object type, which is always 'fabric_dataagent_preview'."
+ },
+ "fabric_dataagent_preview": {
+ "$ref": "#/components/schemas/FabricDataAgentToolParameters",
+ "description": "The fabric data agent tool parameters."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/BaseCredentials"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "Agentic identity credential definition"
+ "description": "The input definition information for a Microsoft Fabric tool as used to configure an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
- "ApiErrorResponse": {
+ "ModelCredentialRequest": {
"type": "object",
"required": [
- "error"
+ "blobUri"
],
"properties": {
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error"
+ "blobUri": {
+ "type": "string",
+ "format": "uri",
+ "description": "Blob URI of the model asset to fetch credentials for."
}
},
- "description": "Error response for API failures."
+ "description": "Request to fetch credentials for a model asset.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
},
- "ApiKeyCredentials": {
+ "ModelDeployment": {
"type": "object",
"required": [
- "type"
+ "type",
+ "modelName",
+ "modelVersion",
+ "modelPublisher",
+ "capabilities",
+ "sku"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "ApiKey"
+ "ModelDeployment"
],
- "description": "The credential type",
+ "description": "The type of the deployment"
+ },
+ "modelName": {
+ "type": "string",
+ "description": "Publisher-specific name of the deployed model",
"readOnly": true
},
- "key": {
+ "modelVersion": {
"type": "string",
- "description": "API Key",
+ "description": "Publisher-specific version of the deployed model",
+ "readOnly": true
+ },
+ "modelPublisher": {
+ "type": "string",
+ "description": "Name of the deployed model's publisher",
+ "readOnly": true
+ },
+ "capabilities": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Capabilities of deployed model",
+ "readOnly": true
+ },
+ "sku": {
+ "$ref": "#/components/schemas/Sku",
+ "description": "Sku of the model deployment",
+ "readOnly": true
+ },
+ "connectionName": {
+ "type": "string",
+ "description": "Name of the connection the deployment comes from",
"readOnly": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/BaseCredentials"
+ "$ref": "#/components/schemas/Deployment"
}
],
- "description": "API Key Credential definition"
+ "description": "Model Deployment Definition"
},
- "ArtifactProfile": {
+ "ModelPendingUploadRequest": {
"type": "object",
"required": [
- "category"
+ "pendingUploadType"
],
"properties": {
- "category": {
- "$ref": "#/components/schemas/FoundryModelArtifactProfileCategory",
- "description": "The category of the artifact profile"
+ "pendingUploadId": {
+ "type": "string",
+ "description": "If PendingUploadId is not provided, a random GUID will be used."
},
- "signals": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/FoundryModelArtifactProfileSignal"
- },
- "description": "Signals detected in the model artifact"
+ "connectionName": {
+ "type": "string",
+ "description": "Azure Storage Account connection name to use for generating temporary SAS token"
+ },
+ "pendingUploadType": {
+ "type": "string",
+ "enum": [
+ "TemporaryBlobReference"
+ ],
+ "description": "The type of pending upload. Only TemporaryBlobReference is supported for models."
}
},
- "description": "Artifact profile of the model",
+ "description": "Represents a request for a pending upload of a model version.",
"x-ms-foundry-meta": {
"required_previews": [
"Models=V1Preview"
]
}
},
- "AssetCredentialResponse": {
+ "ModelPendingUploadResponse": {
"type": "object",
"required": [
- "blobReference"
+ "blobReference",
+ "pendingUploadId",
+ "pendingUploadType"
],
"properties": {
"blobReference": {
"$ref": "#/components/schemas/BlobReference",
- "description": "Credential info to access the storage account."
- }
- },
- "description": "Represents a reference to a blob for consumption"
- },
- "AssetId": {
- "type": "string",
- "description": "Identifier of a saved asset."
- },
- "AssistantMessage": {
- "type": "object",
- "required": [
- "role",
- "content"
- ],
- "properties": {
- "role": {
+ "description": "Container-level read, write, list SAS."
+ },
+ "pendingUploadId": {
"type": "string",
- "enum": [
- "assistant"
- ],
- "description": "Indicates this is an assistant message."
+ "description": "ID for this upload request."
},
- "content": {
+ "version": {
"type": "string",
- "description": "Response content generated by the assistant."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/Message"
- }
- ],
- "description": "A message generated by the assistant in response to previous messages."
- },
- "AttackStrategy": {
- "anyOf": [
- {
- "type": "string"
+ "description": "Version of asset to be created if user did not specify version when initially creating upload"
},
- {
+ "pendingUploadType": {
"type": "string",
"enum": [
- "easy",
- "moderate",
- "difficult",
- "ascii_art",
- "ascii_smuggler",
- "atbash",
- "base64",
- "binary",
- "caesar",
- "character_space",
- "jailbreak",
- "ansi_attack",
- "character_swap",
- "suffix_append",
- "string_join",
- "unicode_confusable",
- "unicode_substitution",
- "diacritic",
- "flip",
- "leetspeak",
- "rot13",
- "morse",
- "url",
- "baseline",
- "indirect_jailbreak",
- "tense",
- "multi_turn",
- "crescendo"
- ]
+ "TemporaryBlobReference"
+ ],
+ "description": "The type of pending upload. Only TemporaryBlobReference is supported for models."
}
- ],
- "description": "Strategies for attacks.",
+ },
+ "description": "Represents the response for a model pending upload request.",
"x-ms-foundry-meta": {
"required_previews": [
- "RedTeams=V1Preview"
+ "Models=V1Preview"
]
}
},
- "Azure.Core.Foundations.Error": {
+ "ModelSamplingParams": {
"type": "object",
- "required": [
- "code",
- "message"
- ],
"properties": {
- "code": {
- "type": "string",
- "description": "One of a server-defined set of error codes."
- },
- "message": {
- "type": "string",
- "description": "A human-readable representation of the error."
- },
- "target": {
- "type": "string",
- "description": "The target of the error."
+ "temperature": {
+ "type": "number",
+ "format": "float",
+ "description": "The temperature parameter for sampling. Defaults to 1.0.",
+ "default": 1
},
- "details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.Error"
- },
- "description": "An array of details about specific errors that led to this reported error."
+ "top_p": {
+ "type": "number",
+ "format": "float",
+ "description": "The top-p parameter for nucleus sampling. Defaults to 1.0.",
+ "default": 1
},
- "innererror": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.InnerError",
- "description": "An object containing more specific information than the current object about the error."
- }
- },
- "description": "The error object."
- },
- "Azure.Core.Foundations.ErrorResponse": {
- "type": "object",
- "required": [
- "error"
- ],
- "properties": {
- "error": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.Error",
- "description": "The error object."
- }
- },
- "description": "A response containing error details."
- },
- "Azure.Core.Foundations.InnerError": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string",
- "description": "One of a server-defined set of error codes."
+ "seed": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The random seed for reproducibility. Defaults to 42.",
+ "default": 42
},
- "innererror": {
- "description": "Inner error.",
- "$ref": "#/components/schemas/Azure.Core.Foundations.InnerError"
+ "max_completion_tokens": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The maximum number of tokens allowed in the completion."
}
},
- "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors."
- },
- "Azure.Core.Foundations.OperationState": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "NotStarted",
- "Running",
- "Succeeded",
- "Failed",
- "Canceled"
- ]
- },
- {
- "type": "string"
- }
- ],
- "description": "Enum describing allowed operation states."
- },
- "Azure.Core.uuid": {
- "type": "string",
- "format": "uuid",
- "description": "Universally Unique Identifier"
+ "description": "Represents a set of parameters used to control the sampling behavior of a language model during text generation."
},
- "AzureAIAgentTarget": {
+ "ModelSourceData": {
"type": "object",
- "required": [
- "type",
- "name"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "azure_ai_agent"
- ],
- "description": "The type of target, always `azure_ai_agent`."
- },
- "name": {
- "type": "string",
- "description": "The unique identifier of the Azure AI agent."
+ "sourceType": {
+ "$ref": "#/components/schemas/FoundryModelSourceType",
+ "description": "The source type of the model"
},
- "version": {
+ "jobId": {
"type": "string",
- "description": "The version of the Azure AI agent."
- },
- "tool_descriptions": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ToolDescription"
- },
- "description": "The parameters used to control the sampling behavior of the agent during text generation."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
+ "description": "The job ID that produced this model"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/Target"
- }
- ],
- "description": "Represents a target specifying an Azure AI agent."
+ "description": "Source information for the model",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
},
- "AzureAIAgentTargetUpdate": {
+ "ModelVersion": {
"type": "object",
+ "required": [
+ "blobUri",
+ "name",
+ "version"
+ ],
"properties": {
- "type": {
+ "blobUri": {
"type": "string",
- "enum": [
- "azure_ai_agent"
- ],
- "description": "The type of target, always `azure_ai_agent`."
+ "format": "uri",
+ "description": "URI of the model artifact in blob storage"
},
- "name": {
- "type": "string",
- "description": "The unique identifier of the Azure AI agent."
+ "weightType": {
+ "$ref": "#/components/schemas/FoundryModelWeightType",
+ "description": "The weight type of the model"
},
- "version": {
+ "baseModel": {
"type": "string",
- "description": "The version of the Azure AI agent."
+ "description": "Base model asset ID"
},
- "tool_descriptions": {
+ "source": {
+ "$ref": "#/components/schemas/ModelSourceData",
+ "description": "The source of the model"
+ },
+ "loraConfig": {
+ "$ref": "#/components/schemas/LoraConfig",
+ "description": "Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided values take precedence over auto-detected values."
+ },
+ "artifactProfile": {
+ "$ref": "#/components/schemas/ArtifactProfile",
+ "description": "The artifact profile of the model",
+ "readOnly": true
+ },
+ "warnings": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/ToolDescription"
+ "$ref": "#/components/schemas/FoundryModelWarning"
},
- "description": "The parameters used to control the sampling behavior of the agent during text generation."
+ "description": "Service-computed advisory warnings derived from the artifact profile.",
+ "readOnly": true
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/TargetUpdate"
- }
- ],
- "description": "Represents a target specifying an Azure AI agent."
- },
- "AzureAIBenchmarkDataSourceConfig": {
- "type": "object",
- "required": [
- "scenario",
- "benchmark_name"
- ],
- "properties": {
- "scenario": {
+ "id": {
"type": "string",
- "enum": [
- "benchmark_preview"
- ],
- "description": "Data schema scenario, always `benchmark` for benchmark evaluations."
+ "description": "Asset ID, a unique identifier for the asset",
+ "readOnly": true
},
- "benchmark_name": {
+ "name": {
"type": "string",
- "description": "The name of the benchmark specification."
+ "description": "The name of the resource",
+ "readOnly": true
},
- "benchmark_version": {
+ "version": {
"type": "string",
- "description": "The version of the benchmark specification (e.g., '0.1'). Latest version if not specified."
+ "description": "The version of the resource",
+ "readOnly": true
},
- "grader_model": {
+ "description": {
"type": "string",
- "description": "Optional grader model for benchmarks that use model graders, Required when the benchmark's testing_criteria uses a model grader type."
+ "description": "The asset description text."
+ },
+ "tags": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Tag dictionary. Tags can be added, removed, and updated."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/AzureAIDataSourceConfig"
- }
- ],
- "description": "Data source configuration for benchmark evaluations."
+ "description": "Model Version Definition",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Models=V1Preview"
+ ]
+ }
},
- "AzureAIBenchmarkPreviewEvalRunDataSource": {
+ "MonthlyRecurrenceSchedule": {
"type": "object",
"required": [
"type",
- "target"
+ "daysOfMonth"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_benchmark_preview"
+ "Monthly"
],
- "description": "The type of data source, always `azure_ai_benchmark_preview`."
- },
- "input_messages": {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference",
- "description": "Input messages configuration."
+ "description": "Monthly recurrence type."
},
- "target": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/AzureAIModelTarget"
- },
- {
- "$ref": "#/components/schemas/AzureAIAgentTarget"
- }
- ],
- "description": "The target model or agent to evaluate against the benchmark.\nWhen using `azure_ai_model` target, `sampling_params` must not be provided;\ninference parameters are auto-filled from the benchmark specification stored in eval group properties."
+ "daysOfMonth": {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "description": "Days of the month for the recurrence schedule."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/EvalRunDataSource"
+ "$ref": "#/components/schemas/RecurrenceSchedule"
}
],
- "description": "Represents a data source for benchmark evaluation runs."
+ "description": "Monthly recurrence schedule.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
},
- "AzureAIDataSourceConfig": {
+ "NoAuthenticationCredentials": {
"type": "object",
"required": [
- "type",
- "scenario"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_source"
- ],
- "description": "The object type, which is always `azure_ai_source`."
- },
- "scenario": {
- "type": "string",
- "enum": [
- "red_team",
- "responses",
- "traces_preview",
- "synthetic_data_gen_preview",
- "benchmark_preview"
+ "None"
],
- "description": "Data schema scenario."
- }
- },
- "discriminator": {
- "propertyName": "scenario",
- "mapping": {
- "benchmark_preview": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ "description": "The credential type ",
+ "readOnly": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/DataSourceConfig"
+ "$ref": "#/components/schemas/BaseCredentials"
}
],
- "description": "Base data source configuration for Azure AI evaluation scenarios."
+ "description": "Credentials that do not require authentication"
},
- "AzureAIModelTarget": {
+ "OAuthConsentRequestOutputItem": {
"type": "object",
"required": [
- "type"
+ "id",
+ "type",
+ "consent_link",
+ "server_label"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "azure_ai_model"
- ],
- "description": "The type of target, always `azure_ai_model`."
- },
- "model": {
- "type": "string",
- "description": "The unique identifier of the Azure AI model."
+ "id": {
+ "type": "string"
},
- "sampling_params": {
- "$ref": "#/components/schemas/ModelSamplingParams",
- "description": "The parameters used to control the sampling behavior of the model during text generation."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/Target"
- }
- ],
- "description": "Represents a target specifying an Azure AI model for operations requiring model selection."
- },
- "AzureAIModelTargetUpdate": {
- "type": "object",
- "properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_model"
- ],
- "description": "The type of target, always `azure_ai_model`."
+ "oauth_consent_request"
+ ]
},
- "model": {
+ "consent_link": {
"type": "string",
- "description": "The unique identifier of the Azure AI model."
+ "description": "The link the user can use to perform OAuth consent."
},
- "sampling_params": {
- "$ref": "#/components/schemas/ModelSamplingParams",
- "description": "The parameters used to control the sampling behavior of the model during text generation."
+ "server_label": {
+ "type": "string",
+ "description": "The server label for the OAuth consent request."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/TargetUpdate"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "Represents a target specifying an Azure AI model for operations requiring model selection."
+ "description": "Request from the service for the user to perform OAuth consent."
},
- "AzureAIResponsesEvalRunDataSource": {
+ "OneTimeTrigger": {
"type": "object",
"required": [
"type",
- "item_generation_params",
- "max_runs_hourly",
- "event_configuration_id"
+ "triggerAt"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_responses"
- ],
- "description": "The type of data source, always `azure_ai_responses`."
- },
- "item_generation_params": {
- "$ref": "#/components/schemas/ResponseRetrievalItemGenerationParams",
- "description": "The parameters for item generation."
+ "OneTime"
+ ]
},
- "max_runs_hourly": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of evaluation runs allowed per hour."
+ "triggerAt": {
+ "type": "string",
+ "description": "Date and time for the one-time trigger in ISO 8601 format."
},
- "event_configuration_id": {
+ "timeZone": {
"type": "string",
- "description": "The event configuration name associated with this evaluation run."
+ "description": "Time zone for the one-time trigger. Defaults to `UTC`.",
+ "default": "UTC"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/EvalRunDataSource"
+ "$ref": "#/components/schemas/Trigger"
}
],
- "description": "Represents a data source for evaluation runs that are specific to Continuous Evaluation scenarios."
+ "description": "One-time trigger.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Schedules=V1Preview"
+ ]
+ }
},
- "AzureAISearchIndex": {
+ "OpenAI.AddUploadPartRequest": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "AzureSearch"
- ],
- "description": "Type of index"
+ "data": {
+ "description": "The chunk of bytes for this Part."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/Index"
- }
- ],
- "description": "Azure AI Search Index Definition"
+ "required": [
+ "data"
+ ]
},
- "AzureAISearchIndexUpdate": {
+ "OpenAI.Annotation": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "AzureSearch"
- ],
- "description": "Type of index"
+ "$ref": "#/components/schemas/OpenAI.AnnotationType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/IndexUpdate"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "file_citation": "#/components/schemas/OpenAI.FileCitationBody",
+ "url_citation": "#/components/schemas/OpenAI.UrlCitationBody",
+ "container_file_citation": "#/components/schemas/OpenAI.ContainerFileCitationBody",
+ "file_path": "#/components/schemas/OpenAI.FilePath"
}
- ],
- "description": "Azure AI Search Index Definition"
+ },
+ "description": "An annotation that applies to a span of output text."
},
- "AzureAISearchQueryType": {
+ "OpenAI.AnnotationType": {
"anyOf": [
{
"type": "string"
@@ -21761,1559 +40768,1685 @@
{
"type": "string",
"enum": [
- "simple",
- "semantic",
- "vector",
- "vector_simple_hybrid",
- "vector_semantic_hybrid"
+ "file_citation",
+ "url_citation",
+ "container_file_citation",
+ "file_path"
]
}
- ],
- "description": "Available query types for Azure AI Search tool."
+ ]
},
- "AzureAISearchTool": {
- "type": "object",
- "required": [
- "type",
- "azure_ai_search"
+ "OpenAI.ApplyPatchCallOutputStatus": {
+ "type": "string",
+ "enum": [
+ "completed",
+ "failed"
+ ]
+ },
+ "OpenAI.ApplyPatchCallOutputStatusParam": {
+ "type": "string",
+ "enum": [
+ "completed",
+ "failed"
],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "azure_ai_search"
- ],
- "description": "The object type, which is always 'azure_ai_search'."
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "azure_ai_search": {
- "$ref": "#/components/schemas/AzureAISearchToolResource",
- "description": "The azure ai search index resource."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
+ "description": "Outcome values reported for apply_patch tool call outputs.",
+ "title": "Apply patch call output status"
+ },
+ "OpenAI.ApplyPatchCallStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed"
+ ]
+ },
+ "OpenAI.ApplyPatchCallStatusParam": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed"
],
- "description": "The input definition information for an Azure AI search tool as used to configure an agent."
+ "description": "Status values reported for apply_patch tool calls.",
+ "title": "Apply patch call status"
},
- "AzureAISearchToolCall": {
+ "OpenAI.ApplyPatchCreateFileOperation": {
"type": "object",
"required": [
"type",
- "call_id",
- "arguments",
- "status"
+ "path",
+ "diff"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_search_call"
- ]
+ "create_file"
+ ],
+ "description": "Create a new file with the provided diff.",
+ "x-stainless-const": true
},
- "call_id": {
+ "path": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "Path of the file to create."
},
- "arguments": {
+ "diff": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
- },
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "description": "Diff to apply."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
}
],
- "description": "An Azure AI Search tool call."
+ "description": "Instruction describing how to create a file via the apply_patch tool.",
+ "title": "Apply patch create file operation"
},
- "AzureAISearchToolCallOutput": {
+ "OpenAI.ApplyPatchCreateFileOperationParam": {
"type": "object",
"required": [
"type",
- "call_id",
- "status"
+ "path",
+ "diff"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_search_call_output"
- ]
+ "create_file"
+ ],
+ "description": "The operation type. Always `create_file`.",
+ "x-stainless-const": true
},
- "call_id": {
+ "path": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Azure AI Search tool call."
+ "minLength": 1,
+ "description": "Path of the file to create relative to the workspace root."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "diff": {
+ "type": "string",
+ "maxLength": 10485760,
+ "description": "Unified diff content to apply when creating the file."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
}
],
- "description": "The output of an Azure AI Search tool call."
- },
- "AzureAISearchToolResource": {
- "type": "object",
- "required": [
- "indexes"
- ],
- "properties": {
- "indexes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AISearchIndexResource"
- },
- "maxItems": 1,
- "description": "The indices attached to this agent. There can be a maximum of 1 index\nresource attached to the agent."
- }
- },
- "description": "A set of index resources used by the `azure_ai_search` tool."
+ "description": "Instruction for creating a new file via the apply_patch tool.",
+ "title": "Apply patch create file operation"
},
- "AzureAISearchToolboxTool": {
+ "OpenAI.ApplyPatchDeleteFileOperation": {
"type": "object",
"required": [
"type",
- "azure_ai_search"
+ "path"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_search"
- ]
+ "delete_file"
+ ],
+ "description": "Delete the specified file.",
+ "x-stainless-const": true
},
- "azure_ai_search": {
- "$ref": "#/components/schemas/AzureAISearchToolResource",
- "description": "The azure ai search index resource."
+ "path": {
+ "type": "string",
+ "description": "Path of the file to delete."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/ToolboxTool"
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
}
],
- "description": "An Azure AI Search tool stored in a toolbox."
+ "description": "Instruction describing how to delete a file via the apply_patch tool.",
+ "title": "Apply patch delete file operation"
},
- "AzureAITraceDataSourcePreviewEvalRunDataSource": {
+ "OpenAI.ApplyPatchDeleteFileOperationParam": {
"type": "object",
"required": [
- "type"
+ "type",
+ "path"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_ai_trace_data_source_preview"
+ "delete_file"
],
- "description": "The type of data source, always `azure_ai_trace_data_source_preview`."
+ "description": "The operation type. Always `delete_file`.",
+ "x-stainless-const": true
},
- "trace_source": {
- "$ref": "#/components/schemas/TraceSource",
- "description": "The trace source that defines how traces are selected for evaluation."
+ "path": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Path of the file to delete relative to the workspace root."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/EvalRunDataSource"
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
}
],
- "description": "A wrapper data source that contains a polymorphic trace source to specify how traces are selected for evaluation."
+ "description": "Instruction for deleting an existing file via the apply_patch tool.",
+ "title": "Apply patch delete file operation"
},
- "AzureContentFilterBlocklistIdResult": {
+ "OpenAI.ApplyPatchFileOperation": {
"type": "object",
"required": [
- "id",
- "filtered"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The ID of the custom blocklist."
- },
- "filtered": {
- "type": "boolean",
- "description": "Whether the blocklist resulted in filtering."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperationType"
}
},
- "description": "A content filter blocklist ID result."
- },
- "AzureContentFilterBlocklistResult": {
- "type": "object",
- "required": [
- "filtered"
- ],
- "properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether any blocklist resulted in filtering."
- },
- "details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AzureContentFilterBlocklistIdResult"
- },
- "description": "The pairs of individual blocklist IDs and their filtering results."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperation",
+ "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation",
+ "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation"
}
},
- "description": "A collection of filtering results for configured custom blocklists."
+ "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
+ "title": "Apply patch operation"
},
- "AzureContentFilterCitation": {
- "type": "object",
- "properties": {
- "license": {
- "type": "string",
- "description": "The license associated with the detection."
+ "OpenAI.ApplyPatchFileOperationType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "url": {
+ {
"type": "string",
- "format": "uri",
- "description": "The URL associated with the license."
+ "enum": [
+ "create_file",
+ "delete_file",
+ "update_file"
+ ]
}
- },
- "description": "Citation details for protected material detection."
+ ]
},
- "AzureContentFilterCompletionTextSpan": {
+ "OpenAI.ApplyPatchOperationParam": {
"type": "object",
"required": [
- "completion_start_offset",
- "completion_end_offset"
+ "type"
],
"properties": {
- "completion_start_offset": {
- "type": "integer",
- "format": "int32",
- "description": "Offset of the UTF32 code point which begins the span."
- },
- "completion_end_offset": {
- "type": "integer",
- "format": "int32",
- "description": "Offset of the first UTF32 code point which is excluded from the span."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParamType"
}
},
- "description": "A representation of a span of completion text as used by Azure OpenAI content filter results."
- },
- "AzureContentFilterCompletionTextSpanDetectionResult": {
- "type": "object",
- "required": [
- "filtered",
- "detected",
- "details"
- ],
- "properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
- },
- "detected": {
- "type": "boolean",
- "description": "Whether the content category was detected."
- },
- "details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpan"
- },
- "description": "Detailed information about the detected completion text spans."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperationParam",
+ "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperationParam",
+ "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperationParam"
}
},
- "description": "A content filter detection result with completion text span details."
+ "description": "One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.",
+ "title": "Apply patch operation"
},
- "AzureContentFilterDetectionResult": {
- "type": "object",
- "required": [
- "filtered",
- "detected"
- ],
- "properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
+ "OpenAI.ApplyPatchOperationParamType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "detected": {
- "type": "boolean",
- "description": "Whether the content category was detected."
+ {
+ "type": "string",
+ "enum": [
+ "create_file",
+ "delete_file",
+ "update_file"
+ ]
}
- },
- "description": "A content filter result indicating whether the content was detected and filtered."
+ ]
},
- "AzureContentFilterDetectionWithCitationResult": {
+ "OpenAI.ApplyPatchToolParam": {
"type": "object",
"required": [
- "filtered",
- "detected"
+ "type"
],
"properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
- },
- "detected": {
- "type": "boolean",
- "description": "Whether the content category was detected."
- },
- "citation": {
- "$ref": "#/components/schemas/AzureContentFilterCitation",
- "description": "Citation details describing the associated license and its location."
+ "type": {
+ "type": "string",
+ "enum": [
+ "apply_patch"
+ ],
+ "description": "The type of the tool. Always `apply_patch`.",
+ "x-stainless-const": true
}
},
- "description": "A content filter detection result that includes citation information for protected material."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "Allows the assistant to create, delete, or update files using unified diffs.",
+ "title": "Apply patch tool"
},
- "AzureContentFilterDetectionWithReasonResult": {
+ "OpenAI.ApplyPatchUpdateFileOperation": {
"type": "object",
"required": [
- "filtered",
- "detected"
+ "type",
+ "path",
+ "diff"
],
"properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
+ "type": {
+ "type": "string",
+ "enum": [
+ "update_file"
+ ],
+ "description": "Update an existing file with the provided diff.",
+ "x-stainless-const": true
},
- "detected": {
- "type": "boolean",
- "description": "Whether the content category was detected."
+ "path": {
+ "type": "string",
+ "description": "Path of the file to update."
},
- "reason": {
+ "diff": {
"type": "string",
- "description": "A human-readable explanation of why the detection result was produced."
+ "description": "Diff to apply."
}
},
- "description": "A content filter detection result that includes a reason description."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
+ }
+ ],
+ "description": "Instruction describing how to update a file via the apply_patch tool.",
+ "title": "Apply patch update file operation"
},
- "AzureContentFilterError": {
+ "OpenAI.ApplyPatchUpdateFileOperationParam": {
"type": "object",
"required": [
- "code",
- "message"
+ "type",
+ "path",
+ "diff"
],
"properties": {
- "code": {
- "type": "integer",
- "format": "int32",
- "description": "A machine-readable error code."
+ "type": {
+ "type": "string",
+ "enum": [
+ "update_file"
+ ],
+ "description": "The operation type. Always `update_file`.",
+ "x-stainless-const": true
},
- "message": {
+ "path": {
"type": "string",
- "description": "A human-readable error message."
+ "minLength": 1,
+ "description": "Path of the file to update relative to the workspace root."
+ },
+ "diff": {
+ "type": "string",
+ "maxLength": 10485760,
+ "description": "Unified diff content to apply to the existing file."
}
},
- "description": "Error details from the content filtering system."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
+ }
+ ],
+ "description": "Instruction for updating an existing file via the apply_patch tool.",
+ "title": "Apply patch update file operation"
},
- "AzureContentFilterPersonallyIdentifiableInformationResult": {
+ "OpenAI.ApproximateLocation": {
"type": "object",
"required": [
- "filtered",
- "detected"
+ "type"
],
"properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
+ "type": {
+ "type": "string",
+ "enum": [
+ "approximate"
+ ],
+ "description": "The type of location approximation. Always `approximate`.",
+ "x-stainless-const": true,
+ "default": "approximate"
},
- "detected": {
- "type": "boolean",
- "description": "Whether PII was detected in the content."
+ "country": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "sub_categories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AzureContentFilterPiiSubCategoryResult"
- },
- "description": "Detailed results for individual PII subcategories."
+ "region": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "city": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "timezone": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "A content filter detection result for Personally Identifiable Information."
+ }
},
- "AzureContentFilterPiiSubCategoryResult": {
+ "OpenAI.AssistantObject": {
"type": "object",
"required": [
- "sub_category",
- "filtered",
- "detected"
+ "id",
+ "object",
+ "created_at",
+ "name",
+ "description",
+ "model",
+ "instructions",
+ "tools",
+ "metadata"
],
"properties": {
- "sub_category": {
+ "id": {
"type": "string",
- "description": "The PII subcategory that was evaluated."
- },
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered for this subcategory."
- },
- "detected": {
- "type": "boolean",
- "description": "Whether the subcategory was detected in the content."
- }
- },
- "description": "Result details for an individual PII subcategory."
- },
- "AzureContentFilterResultsForResponses": {
- "type": "object",
- "properties": {
- "sexual": {
- "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
- "description": "Severity result for sexual content."
- },
- "hate": {
- "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
- "description": "Severity result for hate content."
- },
- "violence": {
- "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
- "description": "Severity result for violence content."
- },
- "self_harm": {
- "$ref": "#/components/schemas/AzureContentFilterSeverityResult",
- "description": "Severity result for self-harm content."
- },
- "profanity": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
- "description": "Detection result for profanity."
- },
- "custom_blocklists": {
- "$ref": "#/components/schemas/AzureContentFilterBlocklistResult",
- "description": "Results for configured custom blocklists."
+ "description": "The identifier, which can be referenced in API endpoints."
},
- "jailbreak": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
- "description": "Detection result for jailbreak attempts."
+ "object": {
+ "type": "string",
+ "enum": [
+ "assistant"
+ ],
+ "description": "The object type, which is always `assistant`.",
+ "x-stainless-const": true
},
- "task_adherence": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionWithReasonResult",
- "description": "Detection result for task adherence evaluation."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the assistant was created."
},
- "protected_material_text": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
- "description": "Detection result for protected material text."
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "protected_material_code": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionWithCitationResult",
- "description": "Detection result for protected material code with citation."
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "ungrounded_material": {
- "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult",
- "description": "Detection result for ungrounded material with completion text span details."
+ "model": {
+ "type": "string",
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them."
},
- "personally_identifiable_information": {
- "$ref": "#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult",
- "description": "Detection result for Personally Identifiable Information."
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "indirect_attack": {
- "$ref": "#/components/schemas/AzureContentFilterDetectionResult",
- "description": "Detection result for indirect attacks."
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ },
+ "maxItems": 128,
+ "description": "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`.",
+ "default": []
},
- "error": {
- "$ref": "#/components/schemas/AzureContentFilterError",
- "description": "Error details if content filtering evaluation failed."
- }
- },
- "description": "Content filter results for the Responses API."
- },
- "AzureContentFilterSeverity": {
- "anyOf": [
- {
- "type": "string"
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantObjectToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- {
- "type": "string",
- "enum": [
- "safe",
- "low",
- "medium",
- "high"
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
]
- }
- ],
- "description": "Ratings for the intensity and risk level of harmful content."
- },
- "AzureContentFilterSeverityResult": {
- "type": "object",
- "required": [
- "filtered",
- "severity"
- ],
- "properties": {
- "filtered": {
- "type": "boolean",
- "description": "Whether the content was filtered."
},
- "severity": {
- "$ref": "#/components/schemas/AzureContentFilterSeverity",
- "description": "The severity level of the content."
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "response_format": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "A content filter result indicating severity level and whether content was filtered."
+ "description": "Represents an `assistant` that can call the model and use tools.",
+ "title": "Assistant",
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "The assistant object",
+ "example": "{\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1698984975,\n \"name\": \"Math Tutor\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a personal math tutor. When asked a question, write and run Python code to answer the question.\",\n \"tools\": [\n {\n \"type\": \"code_interpreter\"\n }\n ],\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n}\n"
+ }
},
- "AzureFunctionBinding": {
+ "OpenAI.AssistantObjectToolResources": {
"type": "object",
- "required": [
- "type",
- "storage_queue"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "storage_queue"
- ],
- "description": "The type of binding, which is always 'storage_queue'."
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.AssistantObjectToolResourcesCodeInterpreter"
},
- "storage_queue": {
- "$ref": "#/components/schemas/AzureFunctionStorageQueue",
- "description": "Storage queue."
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.AssistantObjectToolResourcesFileSearch"
}
- },
- "description": "The structure for keeping storage queue name and URI."
+ }
},
- "AzureFunctionDefinition": {
+ "OpenAI.AssistantObjectToolResourcesCodeInterpreter": {
"type": "object",
- "required": [
- "function",
- "input_binding",
- "output_binding"
- ],
"properties": {
- "function": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the function to be called."
- },
- "description": {
- "type": "string",
- "description": "A description of what the function does, used by the model to choose when and how to call the function."
- },
- "parameters": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The parameters the functions accepts, described as a JSON Schema object."
- }
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
},
- "required": [
- "name",
- "parameters"
- ],
- "description": "The definition of azure function and its parameters."
- },
- "input_binding": {
- "$ref": "#/components/schemas/AzureFunctionBinding",
- "description": "Input storage queue. The queue storage trigger runs a function as messages are added to it."
- },
- "output_binding": {
- "$ref": "#/components/schemas/AzureFunctionBinding",
- "description": "Output storage queue. The function writes output to this queue when the input items are processed."
+ "maxItems": 20
}
- },
- "description": "The definition of Azure function."
+ }
},
- "AzureFunctionStorageQueue": {
+ "OpenAI.AssistantObjectToolResourcesFileSearch": {
"type": "object",
- "required": [
- "queue_service_endpoint",
- "queue_name"
- ],
"properties": {
- "queue_service_endpoint": {
- "type": "string",
- "description": "URI to the Azure Storage Queue service allowing you to manipulate a queue."
- },
- "queue_name": {
- "type": "string",
- "description": "The name of an Azure function storage queue."
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 1
}
- },
- "description": "The structure for keeping storage queue name and URI."
+ }
},
- "AzureFunctionTool": {
+ "OpenAI.AssistantSupportedModels": {
+ "type": "string",
+ "enum": [
+ "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",
+ "o3-mini",
+ "o3-mini-2025-01-31",
+ "o1",
+ "o1-2024-12-17",
+ "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"
+ ]
+ },
+ "OpenAI.AssistantTool": {
"type": "object",
"required": [
- "type",
- "azure_function"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "azure_function"
- ],
- "description": "The object type, which is always 'browser_automation'."
- },
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "azure_function": {
- "$ref": "#/components/schemas/AzureFunctionDefinition",
- "description": "The Azure Function Tool definition."
+ "$ref": "#/components/schemas/OpenAI.AssistantToolType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "code_interpreter": "#/components/schemas/OpenAI.AssistantToolsCode",
+ "file_search": "#/components/schemas/OpenAI.AssistantToolsFileSearch",
+ "function": "#/components/schemas/OpenAI.AssistantToolsFunction"
}
- ],
- "description": "The input definition information for an Azure Function Tool, as used to configure an Agent."
+ }
},
- "AzureFunctionToolCall": {
- "type": "object",
- "required": [
- "type",
- "call_id",
- "name",
- "arguments",
- "status"
- ],
- "properties": {
- "type": {
+ "OpenAI.AssistantToolType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
"type": "string",
"enum": [
- "azure_function_call"
+ "code_interpreter",
+ "file_search",
+ "function"
]
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "name": {
- "type": "string",
- "description": "The name of the Azure Function being called."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
- },
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
}
- ],
- "description": "An Azure Function tool call."
+ ]
},
- "AzureFunctionToolCallOutput": {
+ "OpenAI.AssistantToolsCode": {
"type": "object",
"required": [
- "type",
- "call_id",
- "name",
- "status"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "azure_function_call_output"
- ]
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "name": {
- "type": "string",
- "description": "The name of the Azure Function that was called."
- },
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Azure Function tool call."
- },
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "code_interpreter"
+ ],
+ "description": "The type of tool being defined: `code_interpreter`",
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
}
],
- "description": "The output of an Azure Function tool call."
+ "title": "Code interpreter tool"
},
- "AzureOpenAIModelConfiguration": {
+ "OpenAI.AssistantToolsFileSearch": {
"type": "object",
"required": [
- "type",
- "modelDeploymentName"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "AzureOpenAIModel"
- ]
+ "file_search"
+ ],
+ "description": "The type of tool being defined: `file_search`",
+ "x-stainless-const": true
},
- "modelDeploymentName": {
- "type": "string",
- "description": "Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`)."
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchFileSearch",
+ "description": "Overrides for the file search tool."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/RedTeamTargetConfig"
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
}
],
- "description": "Azure OpenAI model configuration. The API version would be selected by the service for querying the model.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "RedTeams=V1Preview"
- ]
- }
+ "title": "FileSearch tool"
},
- "BaseCredentials": {
+ "OpenAI.AssistantToolsFileSearchFileSearch": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "$ref": "#/components/schemas/CredentialType",
- "description": "The type of credential used by the connection",
- "readOnly": true
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "ApiKey": "#/components/schemas/ApiKeyCredentials",
- "AAD": "#/components/schemas/EntraIDCredentials",
- "CustomKeys": "#/components/schemas/CustomCredential",
- "SAS": "#/components/schemas/SASCredentials",
- "None": "#/components/schemas/NoAuthenticationCredentials",
- "AgenticIdentityToken_Preview": "#/components/schemas/AgenticIdentityPreviewCredentials"
+ "max_num_results": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 1,
+ "maximum": 50
+ },
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchRankingOptions"
}
- },
- "description": "A base class for connection credentials"
+ }
},
- "BingCustomSearchConfiguration": {
+ "OpenAI.AssistantToolsFileSearchTypeOnly": {
"type": "object",
"required": [
- "project_connection_id",
- "instance_name"
+ "type"
],
"properties": {
- "project_connection_id": {
- "type": "string",
- "description": "Project connection id for grounding with bing search"
- },
- "instance_name": {
- "type": "string",
- "description": "Name of the custom configuration instance given to config."
- },
- "market": {
- "type": "string",
- "description": "The market where the results come from."
- },
- "set_lang": {
- "type": "string",
- "description": "The language to use for user interface strings when calling Bing API."
- },
- "count": {
- "type": "integer",
- "format": "int64",
- "description": "The number of search results to return in the bing api response"
- },
- "freshness": {
+ "type": {
"type": "string",
- "description": "Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters)."
+ "enum": [
+ "file_search"
+ ],
+ "description": "The type of tool being defined: `file_search`",
+ "x-stainless-const": true
}
},
- "description": "A bing custom search configuration."
+ "title": "FileSearch tool"
},
- "BingCustomSearchPreviewTool": {
+ "OpenAI.AssistantToolsFunction": {
"type": "object",
"required": [
"type",
- "bing_custom_search_preview"
+ "function"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "bing_custom_search_preview"
+ "function"
],
- "description": "The object type, which is always 'bing_custom_search_preview'."
+ "description": "The type of tool being defined: `function`",
+ "x-stainless-const": true
},
- "bing_custom_search_preview": {
- "$ref": "#/components/schemas/BingCustomSearchToolParameters",
- "description": "The bing custom search tool parameters."
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.FunctionObject"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
}
],
- "description": "The input definition information for a Bing custom search tool as used to configure an agent."
+ "title": "Function tool"
},
- "BingCustomSearchToolCall": {
- "type": "object",
- "required": [
- "type",
- "call_id",
- "arguments",
- "status"
- ],
- "properties": {
- "type": {
+ "OpenAI.AssistantsApiResponseFormatOption": {
+ "oneOf": [
+ {
"type": "string",
"enum": [
- "bing_custom_search_preview_call"
+ "auto"
]
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatText"
},
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject"
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
}
- },
- "allOf": [
+ ],
+ "description": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\nSetting 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](/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n*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."
+ },
+ "OpenAI.AssistantsApiToolChoiceOption": {
+ "oneOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "type": "string",
+ "enum": [
+ "none",
+ "auto",
+ "required"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantsNamedToolChoice"
}
],
- "description": "A Bing custom search tool call."
+ "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool."
},
- "BingCustomSearchToolCallOutput": {
+ "OpenAI.AssistantsNamedToolChoice": {
"type": "object",
"required": [
- "type",
- "call_id",
- "status"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "bing_custom_search_preview_call_output"
- ]
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Bing custom search tool call."
+ "function",
+ "code_interpreter",
+ "file_search"
+ ],
+ "description": "The type of the tool. If type is `function`, the function name must be set"
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsNamedToolChoiceFunction"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "The output of a Bing custom search tool call."
+ "description": "Specifies a tool the model should use. Use to force the model to call a specific tool."
},
- "BingCustomSearchToolParameters": {
+ "OpenAI.AssistantsNamedToolChoiceFunction": {
"type": "object",
"required": [
- "search_configurations"
+ "name"
],
"properties": {
- "search_configurations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/BingCustomSearchConfiguration"
- },
- "maxItems": 1,
- "description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
+ "name": {
+ "type": "string"
}
- },
- "description": "The bing custom search tool parameters."
+ }
},
- "BingGroundingSearchConfiguration": {
- "type": "object",
- "required": [
- "project_connection_id"
+ "OpenAI.AudioResponseFormat": {
+ "type": "string",
+ "enum": [
+ "json",
+ "text",
+ "srt",
+ "verbose_json",
+ "vtt",
+ "diarized_json"
],
+ "description": "The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`. For `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and `diarized_json`, with `diarized_json` required to receive speaker annotations."
+ },
+ "OpenAI.AudioTranscription": {
+ "type": "object",
"properties": {
- "project_connection_id": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "whisper-1",
+ "gpt-4o-mini-transcribe",
+ "gpt-4o-mini-transcribe-2025-12-15",
+ "gpt-4o-transcribe",
+ "gpt-4o-transcribe-diarize",
+ "gpt-realtime-whisper"
+ ]
+ }
+ ],
+ "description": "The model to use for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels."
+ },
+ "language": {
"type": "string",
- "description": "Project connection id for grounding with bing search"
+ "description": "The language of the input audio. Supplying the input language in\n [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format\n will improve accuracy and latency."
},
- "market": {
+ "prompt": {
"type": "string",
- "description": "The market where the results come from."
+ "description": "An optional text to guide the model's style or continue a previous audio\n segment.\n For `whisper-1`, the [prompt is a list of keywords](/docs/guides/speech-to-text#prompting).\n For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the prompt is a free text string, for example \"expect words related to technology\".\n Prompt is not supported with `gpt-realtime-whisper` in GA Realtime sessions."
},
- "set_lang": {
+ "delay": {
"type": "string",
- "description": "The language to use for user interface strings when calling Bing API."
+ "enum": [
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
+ "description": "Controls how long the model waits before emitting transcription text.\n Higher values can improve transcription accuracy at the cost of latency.\n Only supported with `gpt-realtime-whisper` in GA Realtime sessions."
+ }
+ }
+ },
+ "OpenAI.AudioTranscriptionResponse": {
+ "type": "object",
+ "properties": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "whisper-1",
+ "gpt-4o-mini-transcribe",
+ "gpt-4o-mini-transcribe-2025-12-15",
+ "gpt-4o-transcribe",
+ "gpt-4o-transcribe-diarize",
+ "gpt-realtime-whisper"
+ ]
+ }
+ ],
+ "description": "The model used for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`."
},
- "count": {
- "type": "integer",
- "format": "int64",
- "description": "The number of search results to return in the bing api response"
+ "language": {
+ "type": "string",
+ "description": "The language of the input audio."
},
- "freshness": {
+ "prompt": {
"type": "string",
- "description": "Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters)."
+ "description": "The prompt configured for input audio transcription, when present."
}
- },
- "description": "Search configuration for Bing Grounding"
+ }
},
- "BingGroundingSearchToolParameters": {
+ "OpenAI.AutoChunkingStrategyRequestParam": {
"type": "object",
"required": [
- "search_configurations"
+ "type"
],
"properties": {
- "search_configurations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/BingGroundingSearchConfiguration"
- },
- "maxItems": 1,
- "description": "The search configurations attached to this tool. There can be a maximum of 1\nsearch configuration resource attached to the tool."
+ "type": {
+ "type": "string",
+ "enum": [
+ "auto"
+ ],
+ "description": "Always `auto`.",
+ "x-stainless-const": true
}
},
- "description": "The bing grounding search tool parameters."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam"
+ }
+ ],
+ "description": "The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.",
+ "title": "Auto Chunking Strategy"
},
- "BingGroundingTool": {
+ "OpenAI.AutoCodeInterpreterToolParam": {
"type": "object",
"required": [
- "type",
- "bing_grounding"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "bing_grounding"
+ "auto"
],
- "description": "The object type, which is always 'bing_grounding'."
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "Always `auto`.",
+ "x-stainless-const": true,
+ "default": "auto"
},
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
},
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "maxItems": 50,
+ "description": "An optional list of uploaded files to make available to your code."
},
- "bing_grounding": {
- "$ref": "#/components/schemas/BingGroundingSearchToolParameters",
- "description": "The bing grounding search tool parameters."
+ "memory_limit": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "network_policy": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "The input definition information for a bing grounding search tool as used to configure an agent."
+ "description": "Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.",
+ "title": "Automatic Code Interpreter Tool Parameters"
},
- "BingGroundingToolCall": {
+ "OpenAI.Batch": {
"type": "object",
"required": [
- "type",
- "call_id",
- "arguments",
- "status"
+ "id",
+ "object",
+ "endpoint",
+ "input_file_id",
+ "completion_window",
+ "status",
+ "created_at"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string"
+ },
+ "object": {
"type": "string",
"enum": [
- "bing_grounding_call"
- ]
+ "batch"
+ ],
+ "description": "The object type, which is always `batch`.",
+ "x-stainless-const": true
},
- "call_id": {
+ "endpoint": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The OpenAI API endpoint used by the batch."
},
- "arguments": {
+ "model": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](/docs/models) to browse and compare available models."
+ },
+ "errors": {
+ "$ref": "#/components/schemas/OpenAI.BatchErrors"
+ },
+ "input_file_id": {
+ "type": "string",
+ "description": "The ID of the input file for the batch."
+ },
+ "completion_window": {
+ "type": "string",
+ "description": "The time frame within which the batch should be processed."
},
"status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "type": "string",
+ "enum": [
+ "validating",
+ "failed",
+ "in_progress",
+ "finalizing",
+ "completed",
+ "expired",
+ "cancelling",
+ "cancelled"
+ ],
+ "description": "The current status of the batch."
+ },
+ "output_file_id": {
+ "type": "string",
+ "description": "The ID of the file containing the outputs of successfully executed requests."
+ },
+ "error_file_id": {
+ "type": "string",
+ "description": "The ID of the file containing the outputs of requests with errors."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch was created."
+ },
+ "in_progress_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch started processing."
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch will expire."
+ },
+ "finalizing_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch started finalizing."
+ },
+ "completed_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch was completed."
+ },
+ "failed_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch failed."
+ },
+ "expired_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch expired."
+ },
+ "cancelling_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch started cancelling."
+ },
+ "cancelled_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the batch was cancelled."
+ },
+ "request_counts": {
+ "$ref": "#/components/schemas/OpenAI.BatchRequestCounts",
+ "description": "The request counts for different statuses within the batch."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.BatchUsage",
+ "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "A Bing grounding tool call."
+ "x-oaiMeta": {
+ "name": "The batch object",
+ "example": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/completions\",\n \"model\": \"gpt-5-2025-08-07\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"usage\": {\n \"input_tokens\": 1500,\n \"input_tokens_details\": {\n \"cached_tokens\": 1024\n },\n \"output_tokens\": 500,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 300\n },\n \"total_tokens\": 2000\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n"
+ }
},
- "BingGroundingToolCallOutput": {
+ "OpenAI.BatchError": {
"type": "object",
- "required": [
- "type",
- "call_id",
- "status"
- ],
"properties": {
- "type": {
+ "code": {
"type": "string",
- "enum": [
- "bing_grounding_call_output"
- ]
+ "description": "An error code identifying the error type."
},
- "call_id": {
+ "message": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "A human-readable message providing more details about the error."
},
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Bing grounding tool call."
+ "param": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The name of the parameter that caused the error, if applicable."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "line": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The line number of the input file where the error occurred, if applicable."
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ },
+ "OpenAI.BatchErrors": {
+ "type": "object",
+ "properties": {
+ "object": {
+ "type": "string"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.BatchError"
+ }
}
- ],
- "description": "The output of a Bing grounding tool call."
+ }
},
- "BlobReference": {
+ "OpenAI.BatchFileExpirationAfter": {
"type": "object",
"required": [
- "blobUri",
- "storageAccountArmId",
- "credential"
+ "anchor",
+ "seconds"
],
"properties": {
- "blobUri": {
- "type": "string",
- "format": "uri",
- "description": "Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path`"
- },
- "storageAccountArmId": {
+ "anchor": {
"type": "string",
- "description": "ARM ID of the storage account to use."
+ "enum": [
+ "created_at"
+ ],
+ "description": "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.",
+ "x-stainless-const": true
},
- "credential": {
- "$ref": "#/components/schemas/SasCredential",
- "description": "Credential info to access the storage account."
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "minimum": 3600,
+ "maximum": 2592000,
+ "description": "The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days)."
}
},
- "description": "Blob reference details."
+ "description": "The expiration policy for the output and/or error file that are generated for a batch.",
+ "title": "File expiration policy"
},
- "BotServiceAuthorizationScheme": {
+ "OpenAI.BatchRequestCounts": {
"type": "object",
"required": [
- "type"
+ "total",
+ "completed",
+ "failed"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "BotService"
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ "total": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "completed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ]
+ }
},
- "BotServiceRbacAuthorizationScheme": {
+ "OpenAI.BatchUsage": {
"type": "object",
"required": [
- "type"
+ "input_tokens",
+ "input_tokens_details",
+ "output_tokens",
+ "output_tokens_details",
+ "total_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "BotServiceRbac"
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ "input_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "input_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.BatchUsageInputTokensDetails"
+ },
+ "output_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "output_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.BatchUsageOutputTokensDetails"
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ]
+ }
},
- "BotServiceTenantAuthorizationScheme": {
+ "OpenAI.BatchUsageInputTokensDetails": {
"type": "object",
"required": [
- "type"
+ "cached_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "BotServiceTenant"
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ]
+ }
},
- "BrowserAutomationPreviewTool": {
+ "OpenAI.BatchUsageOutputTokensDetails": {
"type": "object",
"required": [
- "type",
- "browser_automation_preview"
+ "reasoning_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "browser_automation_preview"
- ],
- "description": "The object type, which is always 'browser_automation_preview'."
- },
- "browser_automation_preview": {
- "$ref": "#/components/schemas/BrowserAutomationToolParameters",
- "description": "The Browser Automation Tool parameters."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "reasoning_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "The input definition information for a Browser Automation Tool, as used to configure an Agent."
+ }
},
- "BrowserAutomationPreviewToolboxTool": {
+ "OpenAI.ChatCompletionAllowedTools": {
"type": "object",
"required": [
- "type",
- "browser_automation_preview"
+ "mode",
+ "tools"
],
"properties": {
- "type": {
+ "mode": {
"type": "string",
"enum": [
- "browser_automation_preview"
- ]
+ "auto",
+ "required"
+ ],
+ "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools."
},
- "browser_automation_preview": {
- "$ref": "#/components/schemas/BrowserAutomationToolParameters",
- "description": "The Browser Automation Tool parameters."
+ "tools": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "description": "A list of tool definitions that the model should be allowed to call.\n For the Chat Completions API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"function\": { \"name\": \"get_weather\" } },\n { \"type\": \"function\", \"function\": { \"name\": \"get_time\" } }\n ]\n ```"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/ToolboxTool"
- }
- ],
- "description": "A browser automation tool stored in a toolbox."
+ "description": "Constrains the tools available to the model to a pre-defined set.",
+ "title": "Allowed tools"
},
- "BrowserAutomationToolCall": {
+ "OpenAI.ChatCompletionAllowedToolsChoice": {
"type": "object",
"required": [
"type",
- "call_id",
- "arguments",
- "status"
+ "allowed_tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "browser_automation_preview_call"
- ]
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "allowed_tools"
+ ],
+ "description": "Allowed tool configuration type. Always `allowed_tools`.",
+ "x-stainless-const": true
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "allowed_tools": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionAllowedTools"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "A browser automation tool call."
+ "description": "Constrains the tools available to the model to a pre-defined set.",
+ "title": "Allowed tools"
},
- "BrowserAutomationToolCallOutput": {
+ "OpenAI.ChatCompletionDeleted": {
"type": "object",
"required": [
- "type",
- "call_id",
- "status"
+ "object",
+ "id",
+ "deleted"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "browser_automation_preview_call_output"
- ]
+ "chat.completion.deleted"
+ ],
+ "description": "The type of object being deleted.",
+ "x-stainless-const": true
},
- "call_id": {
+ "id": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the browser automation tool call."
+ "description": "The ID of the chat completion that was deleted."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the chat completion was deleted."
}
- ],
- "description": "The output of a browser automation tool call."
+ }
},
- "BrowserAutomationToolConnectionParameters": {
+ "OpenAI.ChatCompletionFunctionCallOption": {
"type": "object",
"required": [
- "project_connection_id"
+ "name"
],
"properties": {
- "project_connection_id": {
+ "name": {
"type": "string",
- "description": "The ID of the project connection to your Azure Playwright resource."
+ "description": "The name of the function to call."
}
},
- "description": "Definition of input parameters for the connection used by the Browser Automation Tool."
+ "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function."
},
- "BrowserAutomationToolParameters": {
+ "OpenAI.ChatCompletionFunctions": {
"type": "object",
"required": [
- "connection"
+ "name"
],
"properties": {
- "connection": {
- "$ref": "#/components/schemas/BrowserAutomationToolConnectionParameters",
- "description": "The project connection parameters associated with the Browser Automation Tool."
+ "description": {
+ "type": "string",
+ "description": "A description of what the function does, used by the model to choose when and how to call the function."
+ },
+ "name": {
+ "type": "string",
+ "description": "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."
+ },
+ "parameters": {
+ "$ref": "#/components/schemas/OpenAI.FunctionParameters"
}
},
- "description": "Definition of input parameters for the Browser Automation Tool."
+ "deprecated": true
},
- "CaptureStructuredOutputsTool": {
+ "OpenAI.ChatCompletionList": {
"type": "object",
"required": [
- "type",
- "outputs"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "capture_structured_outputs"
+ "list"
],
- "description": "The type of the tool. Always `capture_structured_outputs`."
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "The type of this object. It is always set to \"list\".",
+ "x-stainless-const": true,
+ "default": "list"
},
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponse"
},
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "description": "An array of chat completion objects.",
+ "x-ms-list-page-items": true
},
- "outputs": {
- "$ref": "#/components/schemas/StructuredOutputDefinition",
- "description": "The structured outputs to capture from the model."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "A tool for capturing structured outputs"
- },
- "ChartCoordinate": {
- "type": "object",
- "required": [
- "x",
- "y",
- "size"
- ],
- "properties": {
- "x": {
- "type": "integer",
- "format": "int32",
- "description": "X-axis coordinate."
+ "first_id": {
+ "type": "string",
+ "description": "The identifier of the first chat completion in the data array."
},
- "y": {
- "type": "integer",
- "format": "int32",
- "description": "Y-axis coordinate."
+ "last_id": {
+ "type": "string",
+ "description": "The identifier of the last chat completion in the data array.",
+ "x-ms-list-continuation-token": true
},
- "size": {
- "type": "integer",
- "format": "int32",
- "description": "Size of the chart element."
+ "has_more": {
+ "type": "boolean",
+ "description": "Indicates whether there are more Chat Completions available."
}
},
- "description": "Coordinates for the analysis chart.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
+ "description": "An object representing a list of Chat Completions.",
+ "title": "ChatCompletionList",
+ "x-oaiMeta": {
+ "name": "The chat completion list object",
+ "group": "chat",
+ "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"chat.completion\",\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"created\": 1738960610,\n \"request_id\": \"req_ded8ab984ec4bf840f37566c1011c417\",\n \"tool_choice\": null,\n \"usage\": {\n \"total_tokens\": 31,\n \"completion_tokens\": 18,\n \"prompt_tokens\": 13\n },\n \"seed\": 4944116822809979520,\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"presence_penalty\": 0.0,\n \"frequency_penalty\": 0.0,\n \"system_fingerprint\": \"fp_50cad350e4\",\n \"input_user\": null,\n \"service_tier\": \"default\",\n \"tools\": null,\n \"metadata\": {},\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"content\": \"Mind of circuits hum,\nLearning patterns in silence—\nFuture's quiet spark.\",\n \"role\": \"assistant\",\n \"tool_calls\": null,\n \"function_call\": null\n },\n \"finish_reason\": \"stop\",\n \"logprobs\": null\n }\n ],\n \"response_format\": null\n }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2\",\n \"has_more\": false\n}\n"
}
},
- "ChatSummaryMemoryItem": {
+ "OpenAI.ChatCompletionMessageCustomToolCall": {
"type": "object",
"required": [
- "kind"
+ "id",
+ "type",
+ "custom"
],
"properties": {
- "kind": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call."
+ },
+ "type": {
"type": "string",
"enum": [
- "chat_summary"
+ "custom"
],
- "description": "The kind of the memory item."
+ "description": "The type of the tool. Always `custom`.",
+ "x-stainless-const": true
+ },
+ "custom": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCallCustom",
+ "description": "The custom tool that the model called."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/MemoryItem"
- }
+ "description": "A call to a custom tool created by the model.",
+ "title": "Custom tool call"
+ },
+ "OpenAI.ChatCompletionMessageCustomToolCallCustom": {
+ "type": "object",
+ "required": [
+ "name",
+ "input"
],
- "description": "A memory item containing a summary extracted from conversations.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "input": {
+ "type": "string"
+ }
}
},
- "ClusterInsightResult": {
+ "OpenAI.ChatCompletionMessageList": {
"type": "object",
"required": [
- "summary",
- "clusters"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "summary": {
- "$ref": "#/components/schemas/InsightSummary",
- "description": "Summary of the insights report."
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "description": "The type of this object. It is always set to \"list\".",
+ "x-stainless-const": true,
+ "default": "list"
},
- "clusters": {
+ "data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/InsightCluster"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageListData"
},
- "description": "List of clusters identified in the insights."
+ "description": "An array of chat completion message objects.",
+ "x-ms-list-page-items": true
},
- "coordinates": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ChartCoordinate"
- },
- "description": " Optional mapping of IDs to 2D coordinates used by the UX for visualization.\n\n The map keys are string identifiers (for example, a cluster id or a sample id)\n and the values are the coordinates and visual size for rendering on a 2D chart.\n\n This property is omitted unless the client requests coordinates (for example,\n by passing `includeCoordinates=true` as a query parameter).\n\n Example:\n ```\n {\n \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 },\n \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 }\n }\n ```\n\n Coordinates are intended only for client-side visualization and do not\n modify the canonical insights results."
+ "first_id": {
+ "type": "string",
+ "description": "The identifier of the first chat message in the data array."
+ },
+ "last_id": {
+ "type": "string",
+ "description": "The identifier of the last chat message in the data array.",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Indicates whether there are more chat messages available."
}
},
- "description": "Insights from the cluster analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
+ "description": "An object representing a list of chat completion messages.",
+ "title": "ChatCompletionMessageList",
+ "x-oaiMeta": {
+ "name": "The chat completion message list object",
+ "group": "chat",
+ "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"role\": \"user\",\n \"content\": \"write a haiku about ai\",\n \"name\": null,\n \"content_parts\": null\n }\n ],\n \"first_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"last_id\": \"chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0\",\n \"has_more\": false\n}\n"
}
},
- "ClusterTokenUsage": {
+ "OpenAI.ChatCompletionMessageListData": {
"type": "object",
"required": [
- "inputTokenUsage",
- "outputTokenUsage",
- "totalTokenUsage"
+ "content",
+ "refusal",
+ "role",
+ "id"
],
"properties": {
- "inputTokenUsage": {
- "type": "integer",
- "format": "int32",
- "description": "input token usage"
+ "content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "outputTokenUsage": {
- "type": "integer",
- "format": "int32",
- "description": "output token usage"
+ "refusal": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "totalTokenUsage": {
- "type": "integer",
- "format": "int32",
- "description": "total token usage"
+ "tool_calls": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem"
+ },
+ "annotations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations"
+ },
+ "description": "Annotations for the message, when applicable, as when using the\n [web search tool](/docs/guides/tools-web-search?api-mode=chat)."
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "assistant"
+ ],
+ "description": "The role of the author of this message.",
+ "x-stainless-const": true
+ },
+ "function_call": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall",
+ "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.",
+ "deprecated": true
+ },
+ "audio": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "id": {
+ "type": "string"
+ },
+ "content_parts": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "Token usage for cluster analysis",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "CodeBasedEvaluatorDefinition": {
+ "OpenAI.ChatCompletionMessageToolCall": {
"type": "object",
"required": [
- "type"
+ "id",
+ "type",
+ "function"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call."
+ },
"type": {
"type": "string",
"enum": [
- "code"
- ]
+ "function"
+ ],
+ "description": "The type of the tool. Currently, only `function` is supported.",
+ "x-stainless-const": true
},
- "code_text": {
- "type": "string",
- "description": "Inline code text for the evaluator"
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallFunction",
+ "description": "The function that the model called."
+ }
+ },
+ "description": "A call to a function tool created by the model.",
+ "title": "Function tool call"
+ },
+ "OpenAI.ChatCompletionMessageToolCallFunction": {
+ "type": "object",
+ "required": [
+ "name",
+ "arguments"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
},
- "entry_point": {
- "type": "string",
- "description": "The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ "arguments": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionMessageToolCalls": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCall"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall"
}
- },
- "image_tag": {
- "type": "string",
- "description": "The container image tag to use for evaluator code execution",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ ]
+ },
+ "description": "The tool calls generated by the model, such as function calls."
+ },
+ "OpenAI.ChatCompletionMessageToolCallsItem": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCall"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall"
}
+ ]
+ },
+ "description": "The tool calls generated by the model, such as function calls."
+ },
+ "OpenAI.ChatCompletionModeration": {
+ "type": "object",
+ "required": [
+ "input",
+ "output"
+ ],
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntry",
+ "description": "Moderation for the request input."
},
- "blob_uri": {
- "type": "string",
- "format": "uri",
- "description": "The blob URI for the evaluator storage",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntry",
+ "description": "Moderation for the generated output."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluatorDefinition"
- }
- ],
- "description": "Code-based evaluator definition using python code",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "Moderation results or errors for the request input and generated output."
},
- "CodeConfiguration": {
+ "OpenAI.ChatCompletionModerationEntry": {
"type": "object",
"required": [
- "runtime",
- "entry_point",
- "dependency_resolution"
+ "type"
],
"properties": {
- "runtime": {
- "type": "string",
- "description": "The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13')."
- },
- "entry_point": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The entry point command and arguments for the code execution."
- },
- "dependency_resolution": {
- "$ref": "#/components/schemas/CodeDependencyResolution",
- "description": "How package dependencies are resolved at deployment time. Defaults to `bundled`,\nwhere the caller bundles all dependencies into the uploaded zip and the service\nperforms no remote build. `remote_build` instructs the service to build\ndependencies remotely from the manifest included in the uploaded zip.",
- "default": "bundled"
- },
- "content_hash": {
- "type": "string",
- "description": "The SHA-256 hex digest of the uploaded code zip. Set by the service from the `x-ms-code-zip-sha256` request header; read-only in responses and never accepted in request payloads.",
- "readOnly": true
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntryType"
}
},
- "description": "Code-based deployment configuration for a hosted agent."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "moderation_results": "#/components/schemas/OpenAI.ChatCompletionModerationResults",
+ "error": "#/components/schemas/OpenAI.ChatCompletionModerationError"
+ }
+ },
+ "description": "Moderation results or an error for a chat completion moderation check."
},
- "CodeDependencyResolution": {
+ "OpenAI.ChatCompletionModerationEntryType": {
"anyOf": [
{
"type": "string"
@@ -23321,1668 +42454,1636 @@
{
"type": "string",
"enum": [
- "bundled",
- "remote_build"
+ "moderation_results",
+ "error"
]
}
- ],
- "description": "How package dependencies are resolved at deployment time for a code-based hosted agent."
+ ]
},
- "CodeInterpreterToolboxTool": {
+ "OpenAI.ChatCompletionModerationError": {
"type": "object",
"required": [
- "type"
+ "type",
+ "code",
+ "message"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "code_interpreter"
- ]
- },
- "container": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.AutoCodeInterpreterToolParam"
- }
+ "error"
],
- "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code, along with an\noptional `memory_limit` setting.\nIf not provided, the service assumes auto."
+ "description": "The object type, which is always `error`.",
+ "x-stainless-const": true
+ },
+ "code": {
+ "type": "string",
+ "description": "The error code."
+ },
+ "message": {
+ "type": "string",
+ "description": "The error message."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/ToolboxTool"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntry"
}
],
- "description": "A code interpreter tool stored in a toolbox."
+ "description": "An error produced while attempting moderation."
},
- "CompletionMessageToolCallChunk": {
+ "OpenAI.ChatCompletionModerationResults": {
"type": "object",
"required": [
- "id",
- "type"
+ "type",
+ "model",
+ "results"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The Id for the tool call."
+ "enum": [
+ "moderation_results"
+ ],
+ "description": "The object type, which is always `moderation_results`.",
+ "x-stainless-const": true
+ },
+ "model": {
+ "type": "string",
+ "description": "The moderation model used to generate the results."
},
+ "results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationResultBody"
+ },
+ "description": "A list of moderation results."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModerationEntry"
+ }
+ ],
+ "description": "Successful moderation results for the request input or generated output."
+ },
+ "OpenAI.ChatCompletionNamedToolChoice": {
+ "type": "object",
+ "required": [
+ "type",
+ "function"
+ ],
+ "properties": {
"type": {
"type": "string",
"enum": [
"function"
],
- "description": "The type of tool call, which is always \"function\"."
+ "description": "For function calling, the type is always `function`.",
+ "x-stainless-const": true
},
"function": {
- "$ref": "#/components/schemas/FunctionToolCall",
- "description": "Details of the function tool call, if applicable."
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceFunction"
}
},
- "description": "Tool call details within a message."
+ "description": "Specifies a tool the model should use. Use to force the model to call a specific function.",
+ "title": "Function tool choice"
},
- "Connection": {
+ "OpenAI.ChatCompletionNamedToolChoiceCustom": {
"type": "object",
"required": [
- "name",
- "id",
"type",
- "target",
- "isDefault",
- "credentials",
- "metadata"
+ "custom"
],
"properties": {
- "name": {
- "type": "string",
- "description": "The friendly name of the connection, provided by the user.",
- "readOnly": true
- },
- "id": {
- "type": "string",
- "description": "A unique identifier for the connection, generated by the service",
- "readOnly": true
- },
"type": {
- "$ref": "#/components/schemas/ConnectionType",
- "description": "Category of the connection",
- "readOnly": true
- },
- "target": {
"type": "string",
- "description": "The connection URL to be used for this service",
- "readOnly": true
- },
- "isDefault": {
- "type": "boolean",
- "description": "Whether the connection is tagged as the default connection of its type",
- "readOnly": true
- },
- "credentials": {
- "$ref": "#/components/schemas/BaseCredentials",
- "description": "The credentials used by the connection",
- "readOnly": true
+ "enum": [
+ "custom"
+ ],
+ "description": "For custom tool calling, the type is always `custom`.",
+ "x-stainless-const": true
},
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Metadata of the connection",
- "readOnly": true
+ "custom": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustomCustom"
}
},
- "description": "Response from the list and get connections operations"
+ "description": "Specifies a tool the model should use. Use to force the model to call a specific custom tool.",
+ "title": "Custom tool choice"
},
- "ConnectionType": {
- "anyOf": [
- {
+ "OpenAI.ChatCompletionNamedToolChoiceCustomCustom": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
"type": "string"
- },
- {
- "type": "string",
- "enum": [
- "AzureOpenAI",
- "AzureBlob",
- "AzureStorageAccount",
- "CognitiveSearch",
- "CosmosDB",
- "ApiKey",
- "AppConfig",
- "AppInsights",
- "CustomKeys",
- "RemoteTool_Preview"
- ]
}
+ }
+ },
+ "OpenAI.ChatCompletionNamedToolChoiceFunction": {
+ "type": "object",
+ "required": [
+ "name"
],
- "description": "The Type (or category) of the connection"
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
},
- "ContainerAppAgentDefinition": {
+ "OpenAI.ChatCompletionRequestAssistantMessage": {
"type": "object",
"required": [
- "kind",
- "container_protocol_versions",
- "container_app_resource_id",
- "ingress_subdomain_suffix"
+ "role"
],
"properties": {
- "kind": {
+ "content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "refusal": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "role": {
"type": "string",
"enum": [
- "container_app"
- ]
+ "assistant"
+ ],
+ "description": "The role of the messages author, in this case `assistant`.",
+ "x-stainless-const": true
},
- "container_protocol_versions": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ProtocolVersionRecord"
- },
- "description": "The protocols that the agent supports for ingress communication of the containers.",
- "examples": [
- [
- {
- "protocol": "responses",
- "version": "v0.1.1"
- },
- {
- "protocol": "a2a",
- "version": "v0.3.0"
- }
- ]
+ "name": {
+ "type": "string",
+ "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
+ },
+ "audio": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageAudio"
+ },
+ {
+ "type": "null"
+ }
]
},
- "container_app_resource_id": {
- "type": "string",
- "description": "The resource ID of the Azure Container App that hosts this agent. Not mutable across versions."
+ "tool_calls": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCalls"
},
- "ingress_subdomain_suffix": {
- "type": "string",
- "description": "The suffix to apply to the app subdomain when sending ingress to the agent. This can be a label (e.g., '---current'), a specific revision (e.g., '--0000001'), or empty to use the default endpoint for the container app.",
- "examples": [
- "--0000001",
- "---current",
- ""
+ "function_call": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageFunctionCall"
+ },
+ {
+ "type": "null"
+ }
]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/AgentDefinition"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
}
],
- "description": "The container app agent definition.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ContainerAgents=V1Preview"
- ]
+ "description": "Messages sent by the model in response to user messages.",
+ "title": "Assistant message"
+ },
+ "OpenAI.ChatCompletionRequestAssistantMessageAudio": {
+ "type": "object",
+ "required": [
+ "id"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ }
}
},
- "ContainerConfiguration": {
+ "OpenAI.ChatCompletionRequestAssistantMessageContentPart": {
"type": "object",
"required": [
- "image"
+ "type"
],
"properties": {
- "image": {
- "type": "string",
- "description": "The container image for the hosted agent.",
- "examples": [
- "my-registry.azurecr.io/my-hosted-agent:latest"
- ]
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartType"
}
},
- "description": "Container-based deployment configuration for a hosted agent."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "refusal": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartRefusal",
+ "text": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText"
+ }
+ }
},
- "ContainerDetails": {
+ "OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText": {
"type": "object",
"required": [
- "provisioning_state",
- "state",
- "health_state",
- "replicas",
- "updated_on"
+ "type",
+ "text"
],
"properties": {
- "provisioning_state": {
- "type": "string",
- "description": "The provisioning state of the container."
- },
- "provisioning_error": {
- "type": "string",
- "description": "The provisioning error of the container, if any."
- },
- "state": {
- "type": "string",
- "description": "The state of the container."
- },
- "health_state": {
+ "type": {
"type": "string",
- "description": "The health state of the container."
- },
- "replicas": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ContainerReplica"
- },
- "description": "The list of replicas in the container."
+ "enum": [
+ "text"
+ ],
+ "description": "The type of the content part.",
+ "x-stainless-const": true
},
- "updated_on": {
+ "text": {
"type": "string",
- "format": "date-time",
- "description": "The last update time of the container."
+ "description": "The text content."
}
},
- "description": "Detailed information about the container.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ContainerAgents=V1Preview"
- ]
- }
- },
- "ContainerLogKind": {
- "type": "string",
- "enum": [
- "console",
- "system"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart"
+ }
],
- "description": "The type of logs to stream from a container.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ContainerAgents=V1Preview"
- ]
- }
+ "description": "Learn about [text inputs](/docs/guides/text-generation).",
+ "title": "Text content part"
},
- "ContainerReplica": {
+ "OpenAI.ChatCompletionRequestAssistantMessageContentPartType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "text",
+ "refusal"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ChatCompletionRequestAssistantMessageFunctionCall": {
"type": "object",
"required": [
- "name",
- "state",
- "container_state"
+ "arguments",
+ "name"
],
"properties": {
- "name": {
- "type": "string",
- "description": "The name of the replica."
- },
- "state": {
- "type": "string",
- "description": "The state of the replica."
+ "arguments": {
+ "type": "string"
},
- "container_state": {
- "type": "string",
- "description": "The container state of the replica."
+ "name": {
+ "type": "string"
}
- },
- "description": "Information about a container replica.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ContainerAgents=V1Preview"
- ]
}
},
- "ContentFilterResult": {
+ "OpenAI.ChatCompletionRequestDeveloperMessage": {
"type": "object",
"required": [
- "blocked",
- "source_type",
- "content_filter_results"
+ "content",
+ "role"
],
"properties": {
- "blocked": {
- "type": "boolean",
- "description": "Whether the content was blocked by the content filter."
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
+ }
+ }
+ ],
+ "description": "The contents of the developer message."
},
- "source_type": {
+ "role": {
"type": "string",
- "description": "The source type of the content filter evaluation (e.g., 'prompt', 'response', 'pre_tool_call', 'post_tool_call')."
- },
- "content_filter_results": {
- "$ref": "#/components/schemas/AzureContentFilterResultsForResponses",
- "description": "The content filter results for this evaluation."
+ "enum": [
+ "developer"
+ ],
+ "description": "The role of the messages author, in this case `developer`.",
+ "x-stainless-const": true
},
- "tool_call_id": {
+ "name": {
"type": "string",
- "description": "The ID of the tool call associated with this content filter result, if applicable."
+ "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
}
},
- "description": "A content filter evaluation result for a specific source in the response."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
+ }
+ ],
+ "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.",
+ "title": "Developer message"
},
- "ContinuousEvaluationRuleAction": {
+ "OpenAI.ChatCompletionRequestFunctionMessage": {
"type": "object",
"required": [
- "type",
- "evalId"
+ "role",
+ "content",
+ "name"
],
"properties": {
- "type": {
+ "role": {
"type": "string",
"enum": [
- "continuousEvaluation"
+ "function"
+ ],
+ "description": "The role of the messages author, in this case `function`.",
+ "x-stainless-const": true
+ },
+ "content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
},
- "evalId": {
+ "name": {
"type": "string",
- "description": "Eval Id to add continuous evaluation runs to."
- },
- "maxHourlyRuns": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of evaluation runs allowed per hour."
- },
- "samplingRate": {
- "type": "number",
- "format": "double",
- "maximum": 100,
- "description": "Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the service-default is to evaluate every event, which is equivalent to setting a sampling rate of 100.",
- "exclusiveMinimum": 0,
- "default": 100
+ "description": "The name of the function to call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/EvaluationRuleAction"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
}
],
- "description": "Evaluation rule action for continuous evaluation."
+ "title": "Function message",
+ "deprecated": true
},
- "ConversationGenPreviewItemGenerationParams": {
+ "OpenAI.ChatCompletionRequestMessage": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "role",
+ "mapping": {
+ "assistant": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessage",
+ "developer": "#/components/schemas/OpenAI.ChatCompletionRequestDeveloperMessage",
+ "function": "#/components/schemas/OpenAI.ChatCompletionRequestFunctionMessage",
+ "system": "#/components/schemas/OpenAI.ChatCompletionRequestSystemMessage",
+ "user": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessage",
+ "tool": "#/components/schemas/OpenAI.ChatCompletionRequestToolMessage"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionRequestMessageContentPartAudio": {
"type": "object",
"required": [
"type",
- "model"
+ "input_audio"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "conversation_gen_preview"
+ "input_audio"
],
- "description": "The type of item generation parameters, always `conversation_gen_preview`."
- },
- "model": {
- "type": "string",
- "description": "The model deployment used for simulation, in the format '{connectionName}/modelDeploymentName'."
- },
- "max_turns": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of turns per simulated conversation. Defaults to 20.",
- "default": 20
- },
- "num_conversations": {
- "type": "integer",
- "format": "int32",
- "description": "Number of simulated conversations to generate per test scenario. Defaults to 5.",
- "default": 5
- },
- "data_mapping": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Mapping from source fields to response_id field, which is required for retrieving chat history."
+ "description": "The type of the content part. Always `input_audio`.",
+ "x-stainless-const": true
},
- "sampling_params": {
- "$ref": "#/components/schemas/ModelSamplingParams",
- "description": "Sampling parameters for the conversation generation."
+ "input_audio": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/ItemGenerationParams"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
}
],
- "description": "Represents the parameters for conversation simulation item generation."
+ "description": "Learn about [audio inputs](/docs/guides/audio).",
+ "title": "Audio content part"
},
- "ConversationIdTraceSource": {
+ "OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio": {
+ "type": "object",
+ "required": [
+ "data",
+ "format"
+ ],
+ "properties": {
+ "data": {
+ "type": "string"
+ },
+ "format": {
+ "type": "string",
+ "enum": [
+ "wav",
+ "mp3"
+ ]
+ }
+ }
+ },
+ "OpenAI.ChatCompletionRequestMessageContentPartFile": {
"type": "object",
"required": [
"type",
- "conversation_ids"
+ "file"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "conversation_id_source"
+ "file"
],
- "description": "The type of trace source, always `conversation_id_source`."
+ "description": "The type of the content part. Always `file`.",
+ "x-stainless-const": true
},
- "conversation_ids": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "Collection of conversation identifiers to filter traces by."
+ "file": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFileFile"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/TraceSource"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
}
],
- "description": "A trace source that selects traces by conversation IDs."
+ "description": "Learn about [file inputs](/docs/guides/text) for text generation.",
+ "title": "File content part"
},
- "CosmosDBIndex": {
+ "OpenAI.ChatCompletionRequestMessageContentPartFileFile": {
+ "type": "object",
+ "properties": {
+ "filename": {
+ "type": "string"
+ },
+ "file_data": {
+ "type": "string"
+ },
+ "file_id": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionRequestMessageContentPartImage": {
"type": "object",
"required": [
- "type"
+ "type",
+ "image_url"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "CosmosDBNoSqlVectorStore"
+ "image_url"
],
- "description": "Type of index"
+ "description": "The type of the content part.",
+ "x-stainless-const": true
+ },
+ "image_url": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/Index"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
}
],
- "description": "CosmosDB Vector Store Index Definition"
+ "description": "Learn about [image inputs](/docs/guides/vision).",
+ "title": "Image content part"
},
- "CosmosDBIndexUpdate": {
+ "OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl": {
"type": "object",
"required": [
- "type"
+ "url"
],
"properties": {
- "type": {
+ "url": {
+ "type": "string",
+ "format": "uri"
+ },
+ "detail": {
"type": "string",
"enum": [
- "CosmosDBNoSqlVectorStore"
+ "auto",
+ "low",
+ "high"
],
- "description": "Type of index"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/IndexUpdate"
+ "default": "auto"
}
- ],
- "description": "CosmosDB Vector Store Index Definition"
+ }
},
- "CreateAgentFromCodeContent": {
+ "OpenAI.ChatCompletionRequestMessageContentPartRefusal": {
"type": "object",
+ "required": [
+ "type",
+ "refusal"
+ ],
"properties": {
- "metadata": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CreateAgentVersionFromCodeMetadata"
- }
+ "type": {
+ "type": "string",
+ "enum": [
+ "refusal"
],
- "description": "JSON metadata including description and hosted definition."
+ "description": "The type of the content part.",
+ "x-stainless-const": true
},
- "code": {
- "description": "The code zip file (max 250 MB)."
+ "refusal": {
+ "type": "string",
+ "description": "The refusal message generated by the model."
}
},
- "required": [
- "metadata",
- "code"
- ]
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart"
+ }
+ ],
+ "title": "Refusal content part"
},
- "CreateAgentFromManifestRequest": {
+ "OpenAI.ChatCompletionRequestMessageContentPartText": {
"type": "object",
"required": [
- "name",
- "manifest_id",
- "parameter_values"
+ "type",
+ "text"
],
"properties": {
- "name": {
+ "type": {
"type": "string",
- "maxLength": 63,
- "description": "The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
- },
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
+ "enum": [
+ "text"
+ ],
+ "description": "The type of the content part.",
+ "x-stainless-const": true
},
- "description": {
+ "text": {
"type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
+ "description": "The text content."
+ }
+ },
+ "description": "Learn about [text inputs](/docs/guides/text-generation).",
+ "title": "Text content part"
+ },
+ "OpenAI.ChatCompletionRequestMessageType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "manifest_id": {
+ {
"type": "string",
- "description": "The manifest ID to import the agent version from."
- },
- "parameter_values": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The inputs to the manifest that will result in a fully materialized Agent."
+ "enum": [
+ "developer",
+ "system",
+ "user",
+ "assistant",
+ "tool",
+ "function"
+ ]
}
- }
+ ]
},
- "CreateAgentRequest": {
+ "OpenAI.ChatCompletionRequestSystemMessage": {
"type": "object",
"required": [
- "name",
- "definition"
+ "content",
+ "role"
],
"properties": {
- "name": {
- "type": "string",
- "maxLength": 63,
- "description": "The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
- },
- "state": {
- "$ref": "#/components/schemas/AgentState",
- "description": "The initial operational state of the agent. Defaults to 'enabled' if not specified.",
- "default": "enabled"
- },
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestSystemMessageContentPart"
+ }
+ }
+ ],
+ "description": "The contents of the system message."
},
- "description": {
+ "role": {
"type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
- },
- "definition": {
- "$ref": "#/components/schemas/AgentDefinition",
- "description": "The agent definition. This can be a workflow, hosted agent, or a simple agent definition.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
- ]
- }
- },
- "blueprint_reference": {
- "$ref": "#/components/schemas/AgentBlueprintReference",
- "description": "The blueprint reference for the agent."
- },
- "draft": {
- "type": "boolean",
- "description": "(Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DraftAgents=V1Preview"
- ]
- },
- "default": false
- },
- "agent_endpoint": {
- "$ref": "#/components/schemas/AgentEndpointConfig",
- "description": "An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent"
+ "enum": [
+ "system"
+ ],
+ "description": "The role of the messages author, in this case `system`.",
+ "x-stainless-const": true
},
- "agent_card": {
- "$ref": "#/components/schemas/AgentCard",
- "description": "Optional agent card for the agent"
+ "name": {
+ "type": "string",
+ "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
}
},
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
+ }
+ ],
+ "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.",
+ "title": "System message"
},
- "CreateAgentSessionRequest": {
+ "OpenAI.ChatCompletionRequestSystemMessageContentPart": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
+ },
+ "OpenAI.ChatCompletionRequestToolMessage": {
"type": "object",
"required": [
- "version_indicator"
+ "role",
+ "content",
+ "tool_call_id"
],
"properties": {
- "agent_session_id": {
+ "role": {
"type": "string",
- "description": "Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. Auto-generated if omitted."
+ "enum": [
+ "tool"
+ ],
+ "description": "The role of the messages author, in this case `tool`.",
+ "x-stainless-const": true
},
- "version_indicator": {
- "$ref": "#/components/schemas/VersionIndicator",
- "description": "Determines which agent version backs the session."
- }
- },
- "description": "Request to create a new agent session."
- },
- "CreateAgentVersionFromCodeContent": {
- "type": "object",
- "properties": {
- "metadata": {
- "allOf": [
+ "content": {
+ "oneOf": [
{
- "$ref": "#/components/schemas/CreateAgentVersionFromCodeMetadata"
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestToolMessageContentPart"
+ }
}
],
- "description": "JSON metadata including description and hosted definition."
+ "description": "The contents of the tool message."
},
- "code": {
- "description": "The code zip file (max 250 MB)."
+ "tool_call_id": {
+ "type": "string",
+ "description": "Tool call that this message is responding to."
}
},
- "required": [
- "metadata",
- "code"
- ]
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
+ }
+ ],
+ "title": "Tool message"
},
- "CreateAgentVersionFromCodeMetadata": {
+ "OpenAI.ChatCompletionRequestToolMessageContentPart": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
+ },
+ "OpenAI.ChatCompletionRequestUserMessage": {
"type": "object",
"required": [
- "definition"
+ "content",
+ "role"
],
"properties": {
- "description": {
- "type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
+ }
+ }
+ ],
+ "description": "The contents of the user message."
},
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
+ "role": {
+ "type": "string",
+ "enum": [
+ "user"
+ ],
+ "description": "The role of the messages author, in this case `user`.",
+ "x-stainless-const": true
},
- "definition": {
- "$ref": "#/components/schemas/HostedAgentDefinition",
- "description": "The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, and protocol_versions."
+ "name": {
+ "type": "string",
+ "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
}
},
- "description": "JSON metadata for code-based agent operations (create, update, create version).\nThe agent name comes from the URL path parameter or the `x-ms-agent-name` header,\nso it is not included in this model.\nThe content hash (SHA-256 of the zip) is carried in the `x-ms-code-zip-sha256` header."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
+ }
+ ],
+ "description": "Messages sent by an end user, containing prompts or additional context\ninformation.",
+ "title": "User message"
},
- "CreateAgentVersionFromManifestRequest": {
+ "OpenAI.ChatCompletionRequestUserMessageContentPart": {
"type": "object",
"required": [
- "manifest_id",
- "parameter_values"
+ "type"
],
"properties": {
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
- },
- "description": {
- "type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
- },
- "manifest_id": {
- "type": "string",
- "description": "The manifest ID to import the agent version from."
- },
- "parameter_values": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The inputs to the manifest that will result in a fully materialized Agent."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "image_url": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage",
+ "input_audio": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudio",
+ "file": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFile",
+ "text": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText"
}
}
},
- "CreateAgentVersionRequest": {
+ "OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText": {
"type": "object",
"required": [
- "definition"
+ "type",
+ "text"
],
"properties": {
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
- },
- "description": {
+ "type": {
"type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the agent."
- },
- "definition": {
- "$ref": "#/components/schemas/AgentDefinition",
- "description": "The agent definition. This can be a workflow, hosted agent, or a simple agent definition.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
- ]
- }
- },
- "blueprint_reference": {
- "$ref": "#/components/schemas/AgentBlueprintReference",
- "description": "The blueprint reference for the agent."
+ "enum": [
+ "text"
+ ],
+ "description": "The type of the content part.",
+ "x-stainless-const": true
},
- "draft": {
- "type": "boolean",
- "description": "(Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DraftAgents=V1Preview"
- ]
- },
- "default": false
+ "text": {
+ "type": "string",
+ "description": "The text content."
}
},
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "WorkflowAgents=V1Preview",
- "ExternalAgents=V1Preview",
- "DraftAgents=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart"
+ }
+ ],
+ "description": "Learn about [text inputs](/docs/guides/text-generation).",
+ "title": "Text content part"
},
- "CreateEvalRequest": {
+ "OpenAI.ChatCompletionRequestUserMessageContentPartType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "text",
+ "image_url",
+ "input_audio",
+ "file"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ChatCompletionResponseMessage": {
"type": "object",
"required": [
- "data_source_config",
- "testing_criteria"
+ "content",
+ "refusal",
+ "role"
],
"properties": {
- "name": {
- "type": "string",
- "description": "The name of the evaluation."
- },
- "metadata": {
+ "content": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "data_source_config": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig"
- },
+ "refusal": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/AzureAIDataSourceConfig"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
+ "type": "null"
}
- ],
- "description": "The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation."
+ ]
},
- "testing_criteria": {
+ "tool_calls": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem"
+ },
+ "annotations": {
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
- },
- {
- "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
- }
- ]
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations"
},
- "description": "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}}`)."
+ "description": "Annotations for the message, when applicable, as when using the\n [web search tool](/docs/guides/tools-web-search?api-mode=chat)."
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
- }
- },
- "title": "CreateEvalRequest"
- },
- "CreateEvalRunRequest": {
- "type": "object",
- "required": [
- "data_source"
- ],
- "properties": {
- "name": {
+ "role": {
"type": "string",
- "description": "The name of the run."
+ "enum": [
+ "assistant"
+ ],
+ "description": "The role of the author of this message.",
+ "x-stainless-const": true
},
- "metadata": {
+ "function_call": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall",
+ "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.",
+ "deprecated": true
+ },
+ "audio": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio"
},
{
"type": "null"
}
]
- },
- "data_source": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource"
- },
- {
- "$ref": "#/components/schemas/EvalRunDataSource"
- }
+ }
+ },
+ "description": "A chat completion message generated by the model."
+ },
+ "OpenAI.ChatCompletionResponseMessageAnnotations": {
+ "type": "object",
+ "required": [
+ "type",
+ "url_citation"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "url_citation"
],
- "description": "Details about the run's data source."
+ "x-stainless-const": true
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ "url_citation": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation": {
+ "type": "object",
+ "required": [
+ "end_index",
+ "start_index",
+ "url",
+ "title"
+ ],
+ "properties": {
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "evaluation_level": {
- "$ref": "#/components/schemas/EvaluationLevel",
- "description": "The level at which evaluation is performed. Defaults to 'turn' if not specified.",
- "default": "turn"
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri"
+ },
+ "title": {
+ "type": "string"
}
- },
- "title": "CreateEvalRunRequest"
+ }
},
- "CreateOrUpdateManagedAgentIdentityBlueprintRequest": {
+ "OpenAI.ChatCompletionResponseMessageAudio": {
+ "type": "object",
+ "required": [
+ "id",
+ "expires_at",
+ "data",
+ "transcript"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime"
+ },
+ "data": {
+ "type": "string"
+ },
+ "transcript": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.ChatCompletionResponseMessageFunctionCall": {
"type": "object",
"required": [
+ "arguments",
"name"
],
"properties": {
+ "arguments": {
+ "type": "string"
+ },
"name": {
- "type": "string",
- "maxLength": 63,
- "description": "The unique name that identifies the managed agent identity blueprint.\nName can be used to retrieve/update/delete the managed agent identity blueprint.\n- Must start and end with alphanumeric characters,\n- Can contain hyphens in the middle\n- Must not exceed 63 characters."
+ "type": "string"
}
}
},
- "CreateSkillVersionFromFilesBody": {
+ "OpenAI.ChatCompletionStreamOptions": {
"type": "object",
"properties": {
- "files": {
- "type": "array",
- "items": {},
- "description": "Skill files to upload. Upload a single zip file or multiple individual files with relative paths."
+ "include_usage": {
+ "type": "boolean",
+ "description": "If set, an additional chunk will be streamed before the `data: [DONE]`\n message. The `usage` field on this chunk shows the token usage statistics\n for the entire request, and the `choices` field will always be an empty\n array.\n All other chunks will also include a `usage` field, but with a null\n value. **NOTE:** If the stream is interrupted, you may not receive the\n final usage chunk which contains the total token usage for the request."
},
- "default": {
+ "include_obfuscation": {
"type": "boolean",
- "description": "Whether to set this version as the default. Defaults to false."
+ "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API."
}
},
- "required": [
- "files"
- ]
+ "description": "Options for streaming response. Only set this when you set `stream: true`."
},
- "CreatedBy": {
+ "OpenAI.ChatCompletionTokenLogprob": {
"type": "object",
+ "required": [
+ "token",
+ "logprob",
+ "bytes",
+ "top_logprobs"
+ ],
"properties": {
- "agent": {
- "$ref": "#/components/schemas/AgentId",
- "description": "The agent that created the item."
- },
- "response_id": {
+ "token": {
"type": "string",
- "description": "The response on which the item is created."
+ "description": "The token."
+ },
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "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."
+ },
+ "bytes": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "top_logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprobTopLogprobs"
+ },
+ "description": "List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`."
}
}
},
- "CredentialType": {
- "anyOf": [
- {
+ "OpenAI.ChatCompletionTokenLogprobTopLogprobs": {
+ "type": "object",
+ "required": [
+ "token",
+ "logprob",
+ "bytes"
+ ],
+ "properties": {
+ "token": {
"type": "string"
},
- {
- "type": "string",
- "enum": [
- "ApiKey",
- "AAD",
- "SAS",
- "CustomKeys",
- "None",
- "AgenticIdentityToken_Preview"
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "bytes": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "null"
+ }
]
}
- ],
- "description": "The credential type used by the connection"
+ }
},
- "CronTrigger": {
+ "OpenAI.ChatCompletionTool": {
"type": "object",
"required": [
"type",
- "expression"
+ "function"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "Cron"
- ]
+ "function"
+ ],
+ "description": "The type of the tool. Currently, only `function` is supported.",
+ "x-stainless-const": true
},
- "expression": {
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.FunctionObject"
+ }
+ },
+ "description": "A function tool that can be used to generate a response.",
+ "title": "Function tool"
+ },
+ "OpenAI.ChatCompletionToolChoiceOption": {
+ "oneOf": [
+ {
"type": "string",
- "description": "Cron expression that defines the schedule frequency."
+ "enum": [
+ "none",
+ "auto",
+ "required"
+ ]
},
- "timeZone": {
- "type": "string",
- "description": "Time zone for the cron schedule. Defaults to `UTC`.",
- "default": "UTC"
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionAllowedToolsChoice"
},
- "startTime": {
- "type": "string",
- "description": "Start time for the cron schedule in ISO 8601 format."
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoice"
},
- "endTime": {
- "type": "string",
- "description": "End time for the cron schedule in ISO 8601 format."
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustom"
+ }
+ ],
+ "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n`none` is the default when no tools are present. `auto` is the default if tools are present."
+ },
+ "OpenAI.ChunkingStrategyRequestParam": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParamType"
}
},
- "allOf": [
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "auto": "#/components/schemas/OpenAI.AutoChunkingStrategyRequestParam",
+ "static": "#/components/schemas/OpenAI.StaticChunkingStrategyRequestParam"
+ }
+ },
+ "description": "The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy."
+ },
+ "OpenAI.ChunkingStrategyRequestParamType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
{
- "$ref": "#/components/schemas/Trigger"
+ "type": "string",
+ "enum": [
+ "auto",
+ "static"
+ ]
}
- ],
- "description": "Cron based trigger.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
- }
+ ]
},
- "CustomCredential": {
+ "OpenAI.ChunkingStrategyResponse": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "CustomKeys"
- ],
- "description": "The credential type",
- "readOnly": true
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponseType"
}
},
- "unevaluatedProperties": {
- "type": "string"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "static": "#/components/schemas/OpenAI.StaticChunkingStrategyResponseParam",
+ "other": "#/components/schemas/OpenAI.OtherChunkingStrategyResponseParam"
+ }
},
- "allOf": [
+ "description": "The strategy used to chunk the file."
+ },
+ "OpenAI.ChunkingStrategyResponseType": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/BaseCredentials"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "static",
+ "other"
+ ]
}
- ],
- "description": "Custom credential definition"
+ ]
},
- "CustomRoutineTrigger": {
+ "OpenAI.ClickButtonType": {
+ "type": "string",
+ "enum": [
+ "left",
+ "right",
+ "wheel",
+ "back",
+ "forward"
+ ]
+ },
+ "OpenAI.ClickParam": {
"type": "object",
"required": [
"type",
- "provider",
- "parameters"
+ "button",
+ "x",
+ "y"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom"
+ "click"
],
- "description": "The trigger type."
+ "description": "Specifies the event type. For a click action, this property is always `click`.",
+ "x-stainless-const": true
},
- "provider": {
- "type": "string",
- "maxLength": 128,
- "description": "The external provider that emits the custom event."
+ "button": {
+ "$ref": "#/components/schemas/OpenAI.ClickButtonType",
+ "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`."
},
- "event_name": {
- "type": "string",
- "maxLength": 256,
- "description": "The provider-specific event name that fires the routine."
+ "x": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The x-coordinate where the click occurred."
},
- "parameters": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Provider-specific trigger parameters."
+ "y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The y-coordinate where the click occurred."
+ },
+ "keys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/RoutineTrigger"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "A custom event routine trigger.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
+ "description": "A click action.",
+ "title": "Click"
},
- "DailyRecurrenceSchedule": {
+ "OpenAI.CodeInterpreterOutputImage": {
"type": "object",
"required": [
"type",
- "hours"
+ "url"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "Daily"
+ "image"
],
- "description": "Daily recurrence type."
- },
- "hours": {
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int32"
- },
- "description": "Hours for the recurrence schedule."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/RecurrenceSchedule"
- }
- ],
- "description": "Daily recurrence schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
- }
- },
- "DataGenerationJob": {
- "type": "object",
- "required": [
- "id",
- "status",
- "created_at"
- ],
- "properties": {
- "id": {
- "type": "string",
- "description": "Server-assigned unique identifier.",
- "readOnly": true
- },
- "inputs": {
- "$ref": "#/components/schemas/DataGenerationJobInputs",
- "description": "Caller-supplied inputs."
- },
- "result": {
- "$ref": "#/components/schemas/DataGenerationJobResult",
- "description": "Result produced on success.",
- "readOnly": true
- },
- "status": {
- "$ref": "#/components/schemas/JobStatus",
- "description": "Current lifecycle status.",
- "readOnly": true
- },
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error",
- "description": "Error details — populated only on failure.",
- "readOnly": true
- },
- "created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).",
- "readOnly": true
+ "description": "The type of the output. Always `image`.",
+ "x-stainless-const": true,
+ "default": "image"
},
- "finished_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job was finished, represented in Unix time (seconds since January 1, 1970).",
- "readOnly": true
- }
- },
- "description": "Data Generation Job resource.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobInputs": {
- "type": "object",
- "required": [
- "name",
- "sources",
- "options",
- "scenario"
- ],
- "properties": {
- "name": {
+ "url": {
"type": "string",
- "description": "The display name of the data generation job."
- },
- "sources": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/DataGenerationJobSource"
- },
- "description": "The sources used for the data generation job."
- },
- "options": {
- "$ref": "#/components/schemas/DataGenerationJobOptions",
- "description": "The options for the data generation job."
- },
- "scenario": {
- "$ref": "#/components/schemas/DataGenerationJobScenario",
- "description": "The scenario of the data generation job. Either for fine-tuning or evaluation."
- },
- "output_options": {
- "$ref": "#/components/schemas/DataGenerationJobOutputOptions",
- "description": "Optional caller-supplied metadata for the job's output. See individual fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both."
+ "format": "uri",
+ "description": "The URL of the image output from the code interpreter."
}
},
- "description": "Caller-supplied inputs for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
+ "description": "The image output from the code interpreter.",
+ "title": "Code interpreter output image"
},
- "DataGenerationJobOptions": {
+ "OpenAI.CodeInterpreterOutputLogs": {
"type": "object",
"required": [
"type",
- "max_samples"
+ "logs"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/DataGenerationJobType",
- "description": "The data generation job type."
- },
- "max_samples": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of samples to generate."
- },
- "train_split": {
- "type": "number",
- "format": "float",
- "minimum": 0,
- "maximum": 1,
- "description": "The proportion of the generated data to be used for training when the data is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1."
+ "type": "string",
+ "enum": [
+ "logs"
+ ],
+ "description": "The type of the output. Always `logs`.",
+ "x-stainless-const": true,
+ "default": "logs"
},
- "model_options": {
- "$ref": "#/components/schemas/DataGenerationModelOptions",
- "description": "The LLM model options."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "simple_qna": "#/components/schemas/SimpleQnADataGenerationJobOptions",
- "traces": "#/components/schemas/TracesDataGenerationJobOptions",
- "tool_use": "#/components/schemas/ToolUseFineTuningDataGenerationJobOptions"
+ "logs": {
+ "type": "string",
+ "description": "The logs output from the code interpreter."
}
},
- "description": "Options for managing data generation jobs.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
+ "description": "The logs output from the code interpreter.",
+ "title": "Code interpreter output logs"
},
- "DataGenerationJobOutput": {
+ "OpenAI.CodeInterpreterTool": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/DataGenerationJobOutputType",
- "description": "The type of the output."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "file": "#/components/schemas/FileDataGenerationJobOutput",
- "dataset": "#/components/schemas/DatasetDataGenerationJobOutput"
- }
- },
- "description": "Output information for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobOutputOptions": {
- "type": "object",
- "properties": {
+ "type": "string",
+ "enum": [
+ "code_interpreter"
+ ],
+ "description": "The type of the code interpreter tool. Always `code_interpreter`.",
+ "x-stainless-const": true
+ },
"name": {
"type": "string",
- "description": "Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario)."
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
"description": {
"type": "string",
- "description": "Description to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs."
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- "tags": {
+ "tool_configs": {
"type": "object",
"unevaluatedProperties": {
- "type": "string"
+ "$ref": "#/components/schemas/ToolConfig"
},
- "description": "Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs."
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "container": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AutoCodeInterpreterToolParam"
+ }
+ ],
+ "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code, along with an\noptional `memory_limit` setting.\nIf not provided, the service assumes auto."
}
},
- "description": "Output options for data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobOutputType": {
- "anyOf": [
- {
- "type": "string"
- },
+ "allOf": [
{
- "type": "string",
- "enum": [
- "file",
- "dataset"
- ]
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "The supported output file types for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
+ "description": "A tool that runs Python code to help generate a response to a prompt.",
+ "title": "Code interpreter"
},
- "DataGenerationJobResult": {
+ "OpenAI.CompactResource": {
"type": "object",
"required": [
- "generated_samples"
+ "id",
+ "object",
+ "output",
+ "created_at",
+ "usage"
],
"properties": {
- "outputs": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the compacted response."
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "response.compaction"
+ ],
+ "description": "The object type. Always `response.compaction`.",
+ "x-stainless-const": true,
+ "default": "response.compaction"
+ },
+ "output": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/DataGenerationJobOutput"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
},
- "description": "The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation."
+ "description": "The compacted list of output items."
},
- "generated_samples": {
+ "created_at": {
"type": "integer",
- "format": "int32",
- "description": "The number of samples actually generated."
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the compacted conversation was created."
},
- "token_usage": {
- "$ref": "#/components/schemas/DataGenerationTokenUsage",
- "description": "The token usage information for the data generation job."
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsage",
+ "description": "Token accounting for the compaction pass, including cached, reasoning, and total tokens."
}
},
- "description": "Result produced by a successful data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobScenario": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "supervised_finetuning",
- "reinforcement_finetuning",
- "evaluation"
- ]
- }
- ],
- "description": "The supported scenarios for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
+ "title": "The compacted response object"
},
- "DataGenerationJobSource": {
+ "OpenAI.CompactResponseMethodPublicBody": {
"type": "object",
"required": [
- "type"
+ "model"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/DataGenerationJobSourceType",
- "description": "The type of source."
- },
- "description": {
+ "model": {
"type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "prompt": "#/components/schemas/PromptDataGenerationJobSource",
- "agent": "#/components/schemas/AgentDataGenerationJobSource",
- "traces": "#/components/schemas/TracesDataGenerationJobSource",
- "file": "#/components/schemas/FileDataGenerationJobSource"
- }
- },
- "description": "The base source model for data generation jobs.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobSourceType": {
- "anyOf": [
- {
- "type": "string"
+ "description": "The model deployment to use for the compaction of this response."
},
- {
- "type": "string",
- "enum": [
- "prompt",
- "agent",
- "traces",
- "file"
+ "input": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "previous_response_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "prompt_cache_key": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "prompt_cache_retention": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.PromptCacheRetentionEnum"
+ },
+ {
+ "type": "null"
+ }
]
- }
- ],
- "description": "The supported source types for data generation jobs.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
- }
- },
- "DataGenerationJobType": {
- "anyOf": [
- {
- "type": "string"
},
- {
- "type": "string",
- "enum": [
- "simple_qna",
- "traces",
- "tool_use"
+ "service_tier": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ServiceTierEnum"
+ },
+ {
+ "type": "null"
+ }
]
}
- ],
- "description": "The supported data generation job types.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DataGenerationModelOptions": {
+ "OpenAI.ComparisonFilter": {
"type": "object",
"required": [
- "model"
+ "type",
+ "key",
+ "value"
],
"properties": {
- "model": {
+ "type": {
"type": "string",
- "description": "Base model name used to generate data."
+ "enum": [
+ "eq",
+ "ne",
+ "gt",
+ "gte",
+ "lt",
+ "lte",
+ "in",
+ "nin"
+ ],
+ "description": "Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.\n - `eq`: equals\n - `ne`: not equal\n - `gt`: greater than\n - `gte`: greater than or equal\n - `lt`: less than\n - `lte`: less than or equal\n - `in`: in\n - `nin`: not in",
+ "default": "eq"
+ },
+ "key": {
+ "type": "string",
+ "description": "The key to compare against the value."
+ },
+ "value": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ]
+ }
+ }
+ ],
+ "description": "The value to compare against the attribute key; supports string, number, or boolean types."
}
},
- "description": "LLM model options for data generation jobs.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
+ "description": "A filter used to compare a specified attribute key to a given value using a defined comparison operation.",
+ "title": "Comparison Filter",
+ "x-oaiMeta": {
+ "name": "ComparisonFilter"
}
},
- "DataGenerationTokenUsage": {
+ "OpenAI.CompleteUploadRequest": {
"type": "object",
"required": [
- "prompt_tokens",
- "completion_tokens",
- "total_tokens"
+ "part_ids"
],
"properties": {
- "prompt_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "The number of prompt tokens used.",
- "readOnly": true
- },
- "completion_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "The number of completion tokens generated.",
- "readOnly": true
+ "part_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The ordered list of Part IDs."
},
- "total_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Total number of tokens used.",
- "readOnly": true
+ "md5": {
+ "type": "string",
+ "description": "The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect."
}
- },
- "description": "Token usage information for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DataSourceConfig": {
+ "OpenAI.CompletionUsage": {
"type": "object",
"required": [
- "type",
- "schema"
+ "completion_tokens",
+ "prompt_tokens",
+ "total_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "description": "The data source type discriminator."
+ "completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of tokens in the generated completion."
},
- "schema": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The overall object JSON schema for the run data source items."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "azure_ai_source": "#/components/schemas/AzureAIDataSourceConfig"
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of tokens in the prompt."
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Total number of tokens used in the request (prompt + completion)."
+ },
+ "completion_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.CompletionUsageCompletionTokensDetails",
+ "description": "Breakdown of tokens used in a completion."
+ },
+ "prompt_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.CompletionUsagePromptTokensDetails",
+ "description": "Breakdown of tokens used in the prompt."
}
},
- "description": "Base class for run data sources with discriminator support."
+ "description": "Usage statistics for the completion request."
},
- "DatasetDataGenerationJobOutput": {
+ "OpenAI.CompletionUsageCompletionTokensDetails": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "dataset"
- ],
- "description": "Dataset output."
- },
- "id": {
- "type": "string",
- "description": "The id of the output dataset created.",
- "readOnly": true
- },
- "name": {
- "type": "string",
- "description": "The name of the output dataset.",
- "readOnly": true
+ "accepted_prediction_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "version": {
- "type": "string",
- "description": "The version of the output dataset.",
- "readOnly": true
+ "audio_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "description": {
- "type": "string",
- "description": "Description of the output dataset.",
- "readOnly": true
+ "reasoning_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary of the output dataset.",
- "readOnly": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/DataGenerationJobOutput"
+ "rejected_prediction_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "Dataset output for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "DatasetEvaluationSuiteJobSource": {
+ "OpenAI.CompletionUsagePromptTokensDetails": {
"type": "object",
- "required": [
- "type",
- "name"
- ],
"properties": {
- "description": {
- "type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
- },
- "type": {
- "type": "string",
- "enum": [
- "dataset"
- ],
- "description": "The source type for this source, which is Dataset."
- },
- "name": {
- "type": "string",
- "description": "The name of the dataset."
+ "audio_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "version": {
- "type": "string",
- "description": "The version of the dataset. If not specified, the latest version is used."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluationSuiteJobSource"
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "Dataset source for evaluation suite generation jobs — reference to a dataset.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "DatasetEvaluatorGenerationJobSource": {
+ "OpenAI.CompoundFilter": {
"type": "object",
"required": [
"type",
- "name"
+ "filters"
],
"properties": {
- "description": {
- "type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
- },
"type": {
"type": "string",
"enum": [
- "dataset"
+ "and",
+ "or"
],
- "description": "The source type for this source, which is Dataset."
- },
- "name": {
- "type": "string",
- "description": "The name of the dataset."
+ "description": "Type of operation: `and` or `or`."
},
- "version": {
- "type": "string",
- "description": "The version of the dataset. If not specified, the latest version is used."
+ "filters": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
+ },
+ {}
+ ]
+ },
+ "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
- }
- ],
- "description": "Dataset source for evaluator generation jobs — reference to a dataset.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ "description": "Combine multiple filters using `and` or `or`.",
+ "title": "Compound Filter",
+ "x-oaiMeta": {
+ "name": "CompoundFilter"
}
},
- "DatasetReference": {
+ "OpenAI.ComputerAction": {
"type": "object",
"required": [
- "name",
- "version"
+ "type"
],
"properties": {
- "name": {
- "type": "string",
- "description": "Dataset name."
- },
- "version": {
- "type": "string",
- "description": "Dataset version."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionType"
}
},
- "description": "Reference to a versioned Foundry Dataset.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "click": "#/components/schemas/OpenAI.ClickParam",
+ "double_click": "#/components/schemas/OpenAI.DoubleClickAction",
+ "drag": "#/components/schemas/OpenAI.DragParam",
+ "keypress": "#/components/schemas/OpenAI.KeyPressAction",
+ "move": "#/components/schemas/OpenAI.MoveParam",
+ "screenshot": "#/components/schemas/OpenAI.ScreenshotParam",
+ "scroll": "#/components/schemas/OpenAI.ScrollParam",
+ "type": "#/components/schemas/OpenAI.TypeParam",
+ "wait": "#/components/schemas/OpenAI.WaitParam"
+ }
}
},
- "DatasetType": {
+ "OpenAI.ComputerActionList": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ },
+ "description": "Flattened batched actions for `computer_use`. Each action includes an\n`type` discriminator and action-specific fields.",
+ "title": "Computer Action List"
+ },
+ "OpenAI.ComputerActionType": {
"anyOf": [
{
"type": "string"
@@ -24990,2679 +44091,3046 @@
{
"type": "string",
"enum": [
- "uri_file",
- "uri_folder"
+ "click",
+ "double_click",
+ "drag",
+ "keypress",
+ "move",
+ "screenshot",
+ "scroll",
+ "type",
+ "wait"
]
}
- ],
- "description": "Enum to determine the type of data."
+ ]
},
- "DatasetVersion": {
+ "OpenAI.ComputerCallSafetyCheckParam": {
"type": "object",
"required": [
- "dataUri",
- "type",
- "name",
- "version"
+ "id"
],
"properties": {
- "dataUri": {
- "type": "string",
- "minLength": 1,
- "pattern": "[a-zA-Z0-9_]",
- "description": "URI of the data ([example](https://go.microsoft.com/fwlink/?linkid=2202330))"
- },
- "type": {
- "$ref": "#/components/schemas/DatasetType",
- "description": "Dataset type"
- },
- "isReference": {
- "type": "boolean",
- "description": "Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted",
- "readOnly": true
- },
- "connectionName": {
- "type": "string",
- "description": "The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset"
- },
"id": {
"type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
+ "description": "The ID of the pending safety check."
},
- "name": {
- "type": "string",
- "description": "The name of the resource",
- "readOnly": true
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "version": {
- "type": "string",
- "description": "The version of the resource",
- "readOnly": true
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "uri_file": "#/components/schemas/FileDatasetVersion",
- "uri_folder": "#/components/schemas/FolderDatasetVersion"
+ "message": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "DatasetVersion Definition"
+ "description": "A pending safety check for the computer call."
},
- "DatasetVersionUpdate": {
+ "OpenAI.ComputerEnvironment": {
+ "type": "string",
+ "enum": [
+ "windows",
+ "mac",
+ "linux",
+ "ubuntu",
+ "browser"
+ ]
+ },
+ "OpenAI.ComputerScreenshotContent": {
"type": "object",
"required": [
- "type"
+ "type",
+ "image_url",
+ "file_id",
+ "detail"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/DatasetType",
- "description": "Dataset type"
- },
- "description": {
"type": "string",
- "description": "The asset description text."
+ "enum": [
+ "computer_screenshot"
+ ],
+ "description": "Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.",
+ "x-stainless-const": true
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "uri_file": "#/components/schemas/FileDatasetVersionUpdate",
- "uri_folder": "#/components/schemas/FolderDatasetVersionUpdate"
+ "image_url": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "file_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
- "description": "DatasetVersion Definition"
- },
- "DayOfWeek": {
- "anyOf": [
- {
- "type": "string"
- },
+ "allOf": [
{
- "type": "string",
- "enum": [
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday"
- ]
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "Days of the week for recurrence schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
- }
+ "description": "A screenshot of a computer.",
+ "title": "Computer screenshot"
},
- "DeleteAgentResponse": {
+ "OpenAI.ComputerScreenshotImage": {
"type": "object",
"required": [
- "object",
- "name",
- "deleted"
+ "type"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "agent.deleted"
+ "computer_screenshot"
],
- "description": "The object type. Always 'agent.deleted'."
+ "description": "Specifies the event type. For a computer screenshot, this property is\n always set to `computer_screenshot`.",
+ "x-stainless-const": true,
+ "default": "computer_screenshot"
},
- "name": {
+ "image_url": {
"type": "string",
- "description": "The name of the agent."
+ "format": "uri",
+ "description": "The URL of the screenshot image."
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the agent was successfully deleted."
+ "file_id": {
+ "type": "string",
+ "description": "The identifier of an uploaded file that contains the screenshot."
}
},
- "description": "A deleted agent Object"
+ "description": "A computer screenshot image used with the computer use tool."
},
- "DeleteAgentVersionResponse": {
+ "OpenAI.ComputerTool": {
"type": "object",
"required": [
- "object",
- "name",
- "version",
- "deleted"
+ "type"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "agent.version.deleted"
+ "computer"
],
- "description": "The object type. Always 'agent.version.deleted'."
- },
- "name": {
- "type": "string",
- "description": "The name of the agent."
- },
- "version": {
- "type": "string",
- "description": "The version identifier of the agent."
- },
- "deleted": {
- "type": "boolean",
- "description": "Whether the agent was successfully deleted."
+ "description": "The type of the computer tool. Always `computer`.",
+ "x-stainless-const": true
}
},
- "description": "A deleted agent version Object"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).",
+ "title": "Computer"
},
- "DeleteEvalResponse": {
+ "OpenAI.ComputerUsePreviewTool": {
"type": "object",
"required": [
- "object",
- "eval_id",
- "deleted"
+ "type",
+ "environment",
+ "display_width",
+ "display_height"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "eval.deleted"
+ "computer_use_preview"
],
- "description": "The object type. Always 'eval.deleted'."
+ "description": "The type of the computer use tool. Always `computer_use_preview`.",
+ "x-stainless-const": true
},
- "eval_id": {
- "type": "string",
- "description": "id of the eval."
+ "environment": {
+ "$ref": "#/components/schemas/OpenAI.ComputerEnvironment",
+ "description": "The type of computer environment to control."
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the eval was successfully deleted."
+ "display_width": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The width of the computer display."
+ },
+ "display_height": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The height of the computer display."
}
},
- "description": "A deleted evaluation Object"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).",
+ "title": "Computer use preview"
},
- "DeleteEvalRunResponse": {
+ "OpenAI.ContainerAutoParam": {
"type": "object",
+ "required": [
+ "type"
+ ],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "eval.deleted"
+ "container_auto"
],
- "description": "The object type. Always 'eval.deleted'."
+ "description": "Automatically creates a container for this request",
+ "x-stainless-const": true
},
- "run_id": {
- "type": "string",
- "description": "id of the eval."
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 50,
+ "description": "An optional list of uploaded files to make available to your code."
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the eval was successfully deleted."
+ "memory_limit": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ContainerSkill"
+ },
+ "maxItems": 200,
+ "description": "An optional list of skills referenced by id or inline data."
+ },
+ "network_policy": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
},
- "description": "A deleted evaluation run Object."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ }
+ ]
},
- "DeleteMemoryResponse": {
+ "OpenAI.ContainerFileCitationBody": {
"type": "object",
"required": [
- "object",
- "memory_id",
- "deleted"
+ "type",
+ "container_id",
+ "file_id",
+ "start_index",
+ "end_index",
+ "filename"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "memory_store.item.deleted"
+ "container_file_citation"
],
- "description": "The object type. Always 'memory_store.item.deleted'."
+ "description": "The type of the container file citation. Always `container_file_citation`.",
+ "x-stainless-const": true
},
- "memory_id": {
+ "container_id": {
"type": "string",
- "description": "The unique ID of the deleted memory item."
+ "description": "The ID of the container file."
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the memory item was successfully deleted."
+ "file_id": {
+ "type": "string",
+ "description": "The ID of the file."
+ },
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the first character of the container file citation in the message."
+ },
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the last character of the container file citation in the message."
+ },
+ "filename": {
+ "type": "string",
+ "description": "The filename of the container file cited."
}
},
- "description": "Response for deleting a memory item from a memory store.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Annotation"
+ }
+ ],
+ "description": "A citation for a container file used to generate a model response.",
+ "title": "Container file citation"
},
- "DeleteMemoryStoreResponse": {
+ "OpenAI.ContainerFileListResource": {
"type": "object",
"required": [
"object",
- "name",
- "deleted"
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
"object": {
"type": "string",
"enum": [
- "memory_store.deleted"
+ "list"
],
- "description": "The object type. Always 'memory_store.deleted'."
+ "description": "The type of object returned, must be 'list'."
},
- "name": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ContainerFileResource"
+ },
+ "description": "A list of container files.",
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
"type": "string",
- "description": "The name of the memory store."
+ "description": "The ID of the first file in the list."
},
- "deleted": {
+ "last_id": {
+ "type": "string",
+ "description": "The ID of the last file in the list.",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
"type": "boolean",
- "description": "Whether the memory store was successfully deleted."
+ "description": "Whether there are more files available."
}
- },
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
}
},
- "DeleteResponseResult": {
+ "OpenAI.ContainerFileResource": {
"type": "object",
"required": [
"id",
"object",
- "deleted"
+ "container_id",
+ "created_at",
+ "bytes",
+ "path",
+ "source"
],
"properties": {
"id": {
"type": "string",
- "description": "The operation ID."
+ "description": "Unique identifier for the file."
},
"object": {
"type": "string",
"enum": [
- "response"
+ "container.file"
],
- "description": "Always return 'response'."
+ "description": "The type of this object (`container.file`)."
},
- "deleted": {
- "type": "boolean",
- "enum": [
- true
- ],
- "description": "Always return true"
- }
- },
- "description": "The result of a delete response operation."
- },
- "DeleteSkillResponse": {
- "type": "object",
- "required": [
- "id",
- "name",
- "deleted"
- ],
- "properties": {
- "id": {
+ "container_id": {
"type": "string",
- "description": "The unique identifier of the deleted skill."
+ "description": "The container this file belongs to."
},
- "name": {
- "$ref": "#/components/schemas/SkillName",
- "description": "The unique name of the skill."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the file was created."
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the skill was successfully deleted."
+ "bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Size of the file in bytes."
+ },
+ "path": {
+ "type": "string",
+ "description": "Path of the file in the container."
+ },
+ "source": {
+ "type": "string",
+ "description": "Source of the file (e.g., `user`, `assistant`)."
}
},
- "description": "A deleted skill.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
+ "title": "The container file object",
+ "x-oaiMeta": {
+ "name": "The container file object",
+ "example": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n}\n"
}
},
- "DeleteSkillVersionResponse": {
+ "OpenAI.ContainerListResource": {
"type": "object",
"required": [
- "id",
- "name",
- "deleted",
- "version"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "id": {
+ "object": {
"type": "string",
- "description": "The unique identifier of the deleted skill version."
+ "enum": [
+ "list"
+ ],
+ "description": "The type of object returned, must be 'list'."
},
- "name": {
- "$ref": "#/components/schemas/SkillName",
- "description": "The name of the skill."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ContainerResource"
+ },
+ "description": "A list of containers.",
+ "x-ms-list-page-items": true
},
- "deleted": {
- "type": "boolean",
- "description": "Whether the skill version was successfully deleted."
+ "first_id": {
+ "type": "string",
+ "description": "The ID of the first container in the list."
},
- "version": {
+ "last_id": {
"type": "string",
- "description": "The version that was deleted."
+ "description": "The ID of the last container in the list.",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Whether there are more containers available."
}
- },
- "description": "A deleted skill version.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Skills=V1Preview"
- ]
}
},
- "Deployment": {
+ "OpenAI.ContainerMemoryLimit": {
+ "type": "string",
+ "enum": [
+ "1g",
+ "4g",
+ "16g",
+ "64g"
+ ]
+ },
+ "OpenAI.ContainerNetworkPolicyAllowlistParam": {
"type": "object",
"required": [
"type",
- "name"
+ "allowed_domains"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/DeploymentType",
- "description": "The type of the deployment"
- },
- "name": {
"type": "string",
- "description": "Name of the deployment",
- "readOnly": true
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "ModelDeployment": "#/components/schemas/ModelDeployment"
+ "enum": [
+ "allowlist"
+ ],
+ "description": "Allow outbound network access only to specified domains. Always `allowlist`.",
+ "x-stainless-const": true
+ },
+ "allowed_domains": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1,
+ "description": "A list of allowed domains when type is `allowlist`."
}
},
- "description": "Model Deployment Definition"
- },
- "DeploymentType": {
- "anyOf": [
- {
- "type": "string"
- },
+ "allOf": [
{
- "type": "string",
- "enum": [
- "ModelDeployment"
- ]
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
]
},
- "DeveloperMessage": {
+ "OpenAI.ContainerNetworkPolicyDisabledParam": {
"type": "object",
"required": [
- "role",
- "content"
+ "type"
],
"properties": {
- "role": {
+ "type": {
"type": "string",
"enum": [
- "developer"
+ "disabled"
],
- "description": "Indicates this is a developer message."
- },
- "content": {
- "type": "string",
- "description": "Content provided by a developer to guide model behavior in an evaluation context."
+ "description": "Disable outbound network access. Always `disabled`.",
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/Message"
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
- ],
- "description": "A message authored by a developer to guide the model during evaluation."
+ ]
},
- "Dimension": {
+ "OpenAI.ContainerNetworkPolicyParam": {
"type": "object",
"required": [
- "id",
- "description",
- "weight"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. Provided by the user when manually creating a rubric evaluator or during human-in-the-loop review of a generated set; the generation pipeline produces an initial value the user can edit. Editable when saving new versions."
- },
- "description": {
- "type": "string",
- "description": "What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and pursues the appropriate workflow')."
- },
- "weight": {
- "type": "integer",
- "format": "int32",
- "minimum": 1,
- "maximum": 10,
- "description": "Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension weight 8-10; all others use 1-6. User edits are not constrained by this heuristic."
- },
- "always_applicable": {
- "type": "boolean",
- "description": "When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is not specified by the caller.",
- "default": false
- }
- },
- "description": "A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "DispatchRoutineRequest": {
- "type": "object",
- "properties": {
- "payload": {
- "$ref": "#/components/schemas/RoutineDispatchPayload",
- "description": "A direct action-input override sent downstream when testing a routine."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParamType"
}
},
- "description": "Request body for the public dispatch_async route.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
- },
- "DispatchRoutineResponse": {
- "type": "object",
- "properties": {
- "dispatch_id": {
- "type": "string",
- "description": "The dispatch identifier created for the routine dispatch."
- },
- "action_correlation_id": {
- "type": "string",
- "description": "A downstream action correlation identifier, when available."
- },
- "task_id": {
- "type": "string",
- "description": "A workspace task identifier created for the dispatch, when available."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "disabled": "#/components/schemas/OpenAI.ContainerNetworkPolicyDisabledParam",
+ "allowlist": "#/components/schemas/OpenAI.ContainerNetworkPolicyAllowlistParam"
}
},
- "description": "Identifiers returned after a routine dispatch is queued.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
+ "description": "Network access policy for the container."
},
- "EndpointBasedEvaluatorDefinition": {
- "type": "object",
- "required": [
- "type",
- "connection_name"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "endpoint"
- ]
+ "OpenAI.ContainerNetworkPolicyParamType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "connection_name": {
- "type": "string",
- "minLength": 1,
- "description": "Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends `api-key` header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity)."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/EvaluatorDefinition"
- }
- ],
- "description": "Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row."
- },
- "EntraAuthorizationScheme": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
"type": "string",
"enum": [
- "Entra"
+ "disabled",
+ "allowlist"
]
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentEndpointAuthorizationScheme"
- }
]
},
- "EntraIDCredentials": {
+ "OpenAI.ContainerReferenceResource": {
"type": "object",
"required": [
- "type"
+ "type",
+ "container_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "AAD"
+ "container_reference"
],
- "description": "The credential type",
- "readOnly": true
+ "description": "The environment type. Always `container_reference`.",
+ "x-stainless-const": true
+ },
+ "container_id": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/BaseCredentials"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
}
],
- "description": "Entra ID credential definition"
+ "description": "Represents a container created with /v1/containers.",
+ "title": "Container Reference"
},
- "Eval": {
+ "OpenAI.ContainerResource": {
"type": "object",
"required": [
- "object",
"id",
+ "object",
"name",
- "data_source_config",
- "testing_criteria",
"created_at",
- "metadata"
+ "status"
],
"properties": {
- "object": {
+ "id": {
"type": "string",
- "enum": [
- "eval"
- ],
- "description": "The object type.",
- "x-stainless-const": true,
- "default": "eval"
+ "description": "Unique identifier for the container."
},
- "id": {
+ "object": {
"type": "string",
- "description": "Unique identifier for the evaluation."
+ "description": "The type of this object."
},
"name": {
"type": "string",
- "description": "The name of the evaluation."
- },
- "data_source_config": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig"
- },
- {
- "$ref": "#/components/schemas/AzureAIDataSourceConfig"
- },
- {
- "$ref": "#/components/schemas/AzureAIBenchmarkDataSourceConfig"
- }
- ],
- "description": "Configuration of data sources used in runs of the evaluation."
- },
- "testing_criteria": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
- },
- {
- "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
- }
- ]
- },
- "description": "A list of testing criteria."
+ "description": "Name of the container."
},
"created_at": {
"type": "integer",
"format": "unixtime",
- "description": "The Unix timestamp (in seconds) for when the eval was created."
+ "description": "Unix timestamp (in seconds) when the container was created."
},
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
+ "status": {
+ "type": "string",
+ "description": "Status of the container (e.g., active, deleted)."
},
- "modified_at": {
- "$ref": "#/components/schemas/integer",
- "description": "Unix timestamp (in seconds) when the evaluation run was last modified."
+ "last_active_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the container was last active."
},
- "created_by": {
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.ContainerResourceExpiresAfter",
+ "description": "The container will expire after this time period.\n The anchor is the reference point for the expiration.\n The minutes is the number of minutes after the anchor before the container expires."
+ },
+ "memory_limit": {
"type": "string",
- "description": "the name of the person who created the run."
+ "enum": [
+ "1g",
+ "4g",
+ "16g",
+ "64g"
+ ],
+ "description": "The memory limit configured for the container."
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ "network_policy": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
},
- "description": "An Eval object with a data source config and testing criteria.\nAn Eval represents a task to be done for your LLM integration.\nLike:\n- Improve the quality of my chatbot\n- See how well my chatbot handles customer support\n- Check if o4-mini is better at my usecase than gpt-4o",
- "title": "Eval",
+ "title": "The container object",
"x-oaiMeta": {
- "name": "The eval object",
- "group": "evals",
- "example": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\"type\": \"string\"},\n },\n \"required\": [\"label\"]\n },\n \"include_sample_schema\": true\n },\n \"testing_criteria\": [\n {\n \"name\": \"My string check grader\",\n \"type\": \"string_check\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\",\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {\n \"test\": \"synthetics\",\n }\n}\n"
+ "name": "The container object",
+ "example": "{\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container\",\n \"created_at\": 1747844794,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747844794,\n \"memory_limit\": \"1g\",\n \"name\": \"My Container\"\n}\n"
}
},
- "EvalCsvFileIdSource": {
+ "OpenAI.ContainerResourceExpiresAfter": {
+ "type": "object",
+ "properties": {
+ "anchor": {
+ "type": "string",
+ "enum": [
+ "last_active_at"
+ ]
+ },
+ "minutes": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.ContainerSkill": {
"type": "object",
"required": [
- "type",
- "id"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "file_id"
- ],
- "description": "The type of source, always `file_id`."
+ "$ref": "#/components/schemas/OpenAI.ContainerSkillType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "skill_reference": "#/components/schemas/OpenAI.SkillReferenceParam",
+ "inline": "#/components/schemas/OpenAI.InlineSkillParam"
+ }
+ }
+ },
+ "OpenAI.ContainerSkillType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "id": {
+ {
"type": "string",
- "description": "The identifier of the uploaded CSV file."
+ "enum": [
+ "skill_reference",
+ "inline"
+ ]
}
- },
- "description": "Represents a reference to an uploaded CSV file used as a source for evaluation data."
+ ]
},
- "EvalCsvRunDataSource": {
+ "OpenAI.ContextManagementParam": {
"type": "object",
"required": [
- "type",
- "source"
+ "type"
],
"properties": {
"type": {
"type": "string",
- "enum": [
- "csv"
- ],
- "description": "The type of data source, always `csv`."
+ "description": "The context management entry type. Currently only 'compaction' is supported."
},
- "source": {
- "$ref": "#/components/schemas/EvalCsvFileIdSource",
- "description": "The source of the CSV data, either inline content or a file reference."
+ "compact_threshold": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.ConversationItem": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ConversationItemType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/EvalRunDataSource"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "message": "#/components/schemas/OpenAI.ConversationItemMessage",
+ "function_call": "#/components/schemas/OpenAI.ConversationItemFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutput",
+ "file_search_call": "#/components/schemas/OpenAI.ConversationItemFileSearchToolCall",
+ "web_search_call": "#/components/schemas/OpenAI.ConversationItemWebSearchToolCall",
+ "image_generation_call": "#/components/schemas/OpenAI.ConversationItemImageGenToolCall",
+ "computer_call": "#/components/schemas/OpenAI.ConversationItemComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.ConversationItemComputerToolCallOutput",
+ "tool_search_call": "#/components/schemas/OpenAI.ConversationItemToolSearchCall",
+ "tool_search_output": "#/components/schemas/OpenAI.ConversationItemToolSearchOutput",
+ "additional_tools": "#/components/schemas/OpenAI.ConversationItemAdditionalTools",
+ "reasoning": "#/components/schemas/OpenAI.ConversationItemReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.ConversationItemCompactionBody",
+ "code_interpreter_call": "#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.ConversationItemFunctionShellCall",
+ "shell_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput",
+ "apply_patch_call": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput",
+ "mcp_list_tools": "#/components/schemas/OpenAI.ConversationItemMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource",
+ "mcp_call": "#/components/schemas/OpenAI.ConversationItemMcpToolCall",
+ "custom_tool_call": "#/components/schemas/OpenAI.ConversationItemCustomToolCallResource",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.ConversationItemCustomToolCallOutputResource"
}
- ],
- "description": "Represents a CSV data source for evaluation runs."
+ },
+ "description": "A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](/docs/api-reference/responses/object#responses/object-output).",
+ "title": "Conversation item"
},
- "EvalResult": {
+ "OpenAI.ConversationItemAdditionalTools": {
"type": "object",
"required": [
- "name",
"type",
- "score",
- "passed"
+ "id",
+ "role",
+ "tools"
],
"properties": {
- "name": {
+ "type": {
"type": "string",
- "description": "name of the check"
+ "enum": [
+ "additional_tools"
+ ],
+ "description": "The type of the item. Always `additional_tools`.",
+ "x-stainless-const": true,
+ "default": "additional_tools"
},
- "type": {
+ "id": {
"type": "string",
- "description": "type of the check"
+ "description": "The unique ID of the additional tools item."
},
- "score": {
- "type": "number",
- "format": "float",
- "description": "score"
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role that provided the additional tools."
},
- "passed": {
- "type": "boolean",
- "description": "indicates if the check passed or failed"
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The additional tool definitions made available at this item."
}
},
- "description": "Result of the evaluation.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ]
},
- "EvalRun": {
+ "OpenAI.ConversationItemApplyPatchToolCall": {
"type": "object",
"required": [
- "object",
+ "type",
"id",
- "eval_id",
+ "call_id",
"status",
- "model",
- "name",
- "created_at",
- "report_url",
- "result_counts",
- "per_model_usage",
- "per_testing_criteria_results",
- "data_source",
- "metadata",
- "error"
+ "operation"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "eval.run"
+ "apply_patch_call"
],
- "description": "The type of the object. Always \"eval.run\".",
+ "description": "The type of the item. Always `apply_patch_call`.",
"x-stainless-const": true,
- "default": "eval.run"
+ "default": "apply_patch_call"
},
"id": {
"type": "string",
- "description": "Unique identifier for the evaluation run."
+ "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
},
- "eval_id": {
+ "call_id": {
"type": "string",
- "description": "The identifier of the associated evaluation."
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
"status": {
- "type": "string",
- "description": "The status of the evaluation run."
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
},
- "model": {
- "type": "string",
- "description": "The model that is evaluated, if applicable."
+ "operation": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
+ "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
+ "title": "Apply patch operation"
},
- "name": {
+ "created_by": {
"type": "string",
- "description": "The name of the evaluation run."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) when the evaluation run was created."
- },
- "report_url": {
+ "description": "The ID of the entity that created this tool call."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
+ "title": "Apply patch tool call"
+ },
+ "OpenAI.ConversationItemApplyPatchToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "call_id",
+ "status"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "format": "uri",
- "description": "The URL to the rendered evaluation run report on the UI dashboard."
- },
- "result_counts": {
- "$ref": "#/components/schemas/OpenAI.EvalRunResultCounts",
- "description": "Counters summarizing the outcomes of the evaluation run."
+ "enum": [
+ "apply_patch_call_output"
+ ],
+ "description": "The type of the item. Always `apply_patch_call_output`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call_output"
},
- "per_model_usage": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalRunPerModelUsage"
- },
- "description": "Usage statistics for each model during the evaluation run."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
},
- "per_testing_criteria_results": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults"
- },
- "description": "Results per testing criteria applied during the evaluation run."
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
- "data_source": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource"
- },
- {
- "$ref": "#/components/schemas/EvalRunDataSource"
- }
- ],
- "description": "Information about the run's data source."
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
},
- "metadata": {
+ "output": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.EvalApiError"
- },
- "modified_at": {
- "$ref": "#/components/schemas/integer",
- "description": "Unix timestamp (in seconds) when the evaluation run was last modified."
- },
"created_by": {
"type": "string",
- "description": "the name of the person who created the run."
- },
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
- },
- "evaluation_level": {
- "$ref": "#/components/schemas/EvaluationLevel",
- "description": "The level at which evaluation is performed. Defaults to 'turn' if not specified.",
- "default": "turn"
+ "description": "The ID of the entity that created this tool call output."
}
},
- "description": "A schema representing an evaluation run.",
- "title": "EvalRun",
- "x-oaiMeta": {
- "name": "The eval run object",
- "group": "evals",
- "example": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67e57965b480819094274e3a32235e4c\",\n \"eval_id\": \"eval_67e579652b548190aaa83ada4b125f47\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "The output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
},
- "EvalRunDataSource": {
+ "OpenAI.ConversationItemCodeInterpreterToolCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "status",
+ "container_id",
+ "code",
+ "outputs"
],
"properties": {
"type": {
"type": "string",
- "description": "The data source type discriminator."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "azure_ai_traces_preview": "#/components/schemas/TracesPreviewEvalRunDataSource",
- "azure_ai_synthetic_data_gen_preview": "#/components/schemas/SyntheticDataGenerationPreviewEvalRunDataSource",
- "azure_ai_responses": "#/components/schemas/AzureAIResponsesEvalRunDataSource",
- "azure_ai_target_completions": "#/components/schemas/TargetCompletionEvalRunDataSource",
- "csv": "#/components/schemas/EvalCsvRunDataSource",
- "azure_ai_red_team": "#/components/schemas/RedTeamEvalRunDataSource",
- "azure_ai_trace_data_source_preview": "#/components/schemas/AzureAITraceDataSourcePreviewEvalRunDataSource",
- "azure_ai_benchmark_preview": "#/components/schemas/AzureAIBenchmarkPreviewEvalRunDataSource"
+ "enum": [
+ "code_interpreter_call"
+ ],
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "x-stainless-const": true,
+ "default": "code_interpreter_call"
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the code interpreter tool call."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete",
+ "interpreting",
+ "failed"
+ ],
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
+ },
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the container used to run the code."
+ },
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "outputs": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "Base class for run data sources with discriminator support."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
},
- "EvalRunOutputItem": {
+ "OpenAI.ConversationItemCompactionBody": {
"type": "object",
"required": [
- "object",
+ "type",
"id",
- "run_id",
- "eval_id",
- "created_at",
- "status",
- "datasource_item_id",
- "datasource_item",
- "results",
- "sample"
+ "encrypted_content"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "eval.run.output_item"
+ "compaction"
],
- "description": "The type of the object. Always \"eval.run.output_item\".",
+ "description": "The type of the item. Always `compaction`.",
"x-stainless-const": true,
- "default": "eval.run.output_item"
+ "default": "compaction"
},
"id": {
"type": "string",
- "description": "Unique identifier for the evaluation run output item."
- },
- "run_id": {
- "type": "string",
- "description": "The identifier of the evaluation run associated with this output item."
+ "description": "The unique ID of the compaction item."
},
- "eval_id": {
+ "encrypted_content": {
"type": "string",
- "description": "The identifier of the evaluation group."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) when the evaluation run was created."
+ "description": "The encrypted content that was produced by compaction."
},
- "status": {
+ "created_by": {
"type": "string",
- "description": "The status of the evaluation run."
- },
- "datasource_item_id": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The identifier for the data source item."
- },
- "datasource_item": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Details of the input data source item."
- },
- "results": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunOutputItemResult"
- },
- "description": "A list of grader results for this output item."
- },
- "sample": {
- "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSample",
- "description": "A sample containing the input and output of the evaluation run."
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "A schema representing an evaluation run output item.",
- "title": "EvalRunOutputItem",
- "x-oaiMeta": {
- "name": "The eval run output item object",
- "group": "evals",
- "example": "{\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"created_at\": 1739314509,\n \"status\": \"pass\",\n \"datasource_item_id\": 137,\n \"datasource_item\": {\n \"teacher\": \"To grade essays, I only check for style, content, and grammar.\",\n \"student\": \"I am a student who is trying to write the best essay.\"\n },\n \"results\": [\n {\n \"name\": \"String Check Grader\",\n \"type\": \"string-check-grader\",\n \"score\": 1.0,\n \"passed\": true,\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"You are an evaluator bot...\"\n },\n {\n \"role\": \"user\",\n \"content\": \"You are assessing...\"\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"The rubric is not clear nor concise.\"\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"total_tokens\": 521,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 519,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "EvalRunOutputItemResult": {
+ "OpenAI.ConversationItemComputerToolCall": {
"type": "object",
"required": [
- "name",
- "score",
- "passed"
+ "type",
+ "id",
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
- "name": {
- "type": "string",
- "description": "The name of the grader."
- },
"type": {
"type": "string",
- "description": "The grader type (for example, \"string-check-grader\")."
- },
- "score": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The numeric score produced by the grader."
- },
- "passed": {
- "type": "boolean",
- "description": "Whether the grader considered the output a pass."
- },
- "sample": {
- "anyOf": [
- {
- "type": "object",
- "unevaluatedProperties": {}
- },
- {
- "type": "null"
- }
+ "enum": [
+ "computer_call"
],
- "description": "Optional sample or intermediate data produced by the grader."
- },
- "status": {
- "$ref": "#/components/schemas/EvalRunOutputItemResultStatus",
- "description": "The evaluation status for this result item. Values: \"completed\", \"errored\", \"skipped\". Null if not provided by evaluator. When status is skipped, passed/score can be ignored."
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
- "metric": {
+ "id": {
"type": "string",
- "description": "The name of the metric (e.g., \"fluency\", \"f1_score\")."
+ "description": "The unique ID of the computer call."
},
- "label": {
+ "call_id": {
"type": "string",
- "description": "The label associated with the test criteria metric (e.g., \"pass\", \"fail\", \"good\", \"bad\")."
+ "description": "An identifier used when responding to the tool call with output."
},
- "threshold": {
- "type": "number",
- "format": "float",
- "description": "The threshold used to determine pass/fail for this test criteria, if it is numerical."
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
},
- "reason": {
- "type": "string",
- "description": "The reason for the test criteria metric."
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "pending_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
},
- "description": "Additional details about the test criteria metric."
- }
- },
- "unevaluatedProperties": {},
- "description": "A single grader result for an evaluation run output item.",
- "title": "EvalRunOutputItemResult"
- },
- "EvalRunOutputItemResultStatus": {
- "anyOf": [
- {
- "type": "string"
+ "description": "The pending safety checks for the computer call."
},
- {
+ "status": {
"type": "string",
"enum": [
+ "in_progress",
"completed",
- "errored",
- "skipped"
- ]
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "The evaluation status for an evaluation run output item result."
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "EvalRunOutputItemSampleInput": {
+ "OpenAI.ConversationItemComputerToolCallOutput": {
"type": "object",
"required": [
- "role",
- "content",
- "tool_calls"
+ "type",
+ "id",
+ "call_id",
+ "output"
],
"properties": {
- "role": {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "computer_call_output"
+ ],
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "x-stainless-const": true,
+ "default": "computer_call_output"
},
- "content": {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The ID of the computer tool call output.",
+ "readOnly": true
},
- "tool_calls": {
+ "call_id": {
+ "type": "string",
+ "description": "The ID of the computer tool call that produced the output."
+ },
+ "acknowledged_safety_checks": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/CompletionMessageToolCallChunk"
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
},
- "description": "Tool calls made within the message, if any."
+ "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
- "description": "A message in the evaluation run."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "EvalRunOutputItemSampleOutput": {
+ "OpenAI.ConversationItemCustomToolCallOutputResource": {
"type": "object",
"required": [
- "tool_calls"
+ "type",
+ "call_id",
+ "output",
+ "status"
],
"properties": {
- "role": {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "custom_tool_call_output"
+ ],
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "x-stainless-const": true
},
- "content": {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
},
- "tool_calls": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/CompletionMessageToolCallChunk"
- },
- "description": "Tool calls made within the message, if any."
+ "call_id": {
+ "type": "string",
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "A message in the evaluation run."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "title": "ResponseCustomToolCallOutputItem"
},
- "EvalRunResultCompareItem": {
+ "OpenAI.ConversationItemCustomToolCallResource": {
"type": "object",
"required": [
- "treatmentRunId",
- "treatmentRunSummary",
- "deltaEstimate",
- "pValue",
- "treatmentEffect"
+ "type",
+ "call_id",
+ "name",
+ "input",
+ "status"
],
"properties": {
- "treatmentRunId": {
+ "type": {
"type": "string",
- "description": "The treatment run ID."
+ "enum": [
+ "custom_tool_call"
+ ],
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "x-stainless-const": true
},
- "treatmentRunSummary": {
- "$ref": "#/components/schemas/EvalRunResultSummary",
- "description": "Summary statistics of the treatment run."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
},
- "deltaEstimate": {
- "type": "number",
- "format": "float",
- "description": "Estimated difference between treatment and baseline."
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used to map this custom tool call to a tool call output."
},
- "pValue": {
- "type": "number",
- "format": "float",
- "description": "P-value for the treatment effect."
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the custom tool being called."
},
- "treatmentEffect": {
- "$ref": "#/components/schemas/TreatmentEffectType",
- "description": "Type of treatment effect."
+ "name": {
+ "type": "string",
+ "description": "The name of the custom tool being called."
+ },
+ "input": {
+ "type": "string",
+ "description": "The input for the custom tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "Metric comparison for a treatment against the baseline.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "title": "ResponseCustomToolCallItem"
},
- "EvalRunResultComparison": {
+ "OpenAI.ConversationItemFileSearchToolCall": {
"type": "object",
"required": [
- "testingCriteria",
- "metric",
- "evaluator",
- "baselineRunSummary",
- "compareItems"
+ "id",
+ "type",
+ "status",
+ "queries"
],
"properties": {
- "testingCriteria": {
+ "id": {
"type": "string",
- "description": "Name of the testing criteria."
+ "description": "The unique ID of the file search tool call."
},
- "metric": {
+ "type": {
"type": "string",
- "description": "Metric being evaluated."
+ "enum": [
+ "file_search_call"
+ ],
+ "description": "The type of the file search tool call. Always `file_search_call`.",
+ "x-stainless-const": true
},
- "evaluator": {
+ "status": {
"type": "string",
- "description": "Name of the evaluator for this testing criteria."
- },
- "baselineRunSummary": {
- "$ref": "#/components/schemas/EvalRunResultSummary",
- "description": "Summary statistics of the baseline run."
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "incomplete",
+ "failed"
+ ],
+ "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
},
- "compareItems": {
+ "queries": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/EvalRunResultCompareItem"
+ "type": "string"
},
- "description": "List of comparison results for each treatment run."
+ "description": "The queries used to search for files."
+ },
+ "results": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "Comparison results for treatment runs against the baseline.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
+ "title": "File search tool call"
},
- "EvalRunResultSummary": {
+ "OpenAI.ConversationItemFunctionShellCall": {
"type": "object",
"required": [
- "runId",
- "sampleCount",
- "average",
- "standardDeviation"
+ "type",
+ "id",
+ "call_id",
+ "action",
+ "status",
+ "environment"
],
"properties": {
- "runId": {
+ "type": {
"type": "string",
- "description": "The evaluation run ID."
+ "enum": [
+ "shell_call"
+ ],
+ "description": "The type of the item. Always `shell_call`.",
+ "x-stainless-const": true,
+ "default": "shell_call"
},
- "sampleCount": {
- "type": "integer",
- "format": "int32",
- "description": "Number of samples in the evaluation run."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
},
- "average": {
- "type": "number",
- "format": "float",
- "description": "Average value of the metric in the evaluation run."
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the shell tool call generated by the model."
},
- "standardDeviation": {
- "type": "number",
- "format": "float",
- "description": "Standard deviation of the metric in the evaluation run."
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
+ "description": "The shell commands and limits that describe how to run the tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
+ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
+ },
+ "environment": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
- "description": "Summary statistics of a metric in an evaluation run.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "A tool call that executes one or more shell commands in a managed environment.",
+ "title": "Shell tool call"
},
- "Evaluation": {
+ "OpenAI.ConversationItemFunctionShellCallOutput": {
"type": "object",
"required": [
+ "type",
"id",
- "data",
- "evaluators"
+ "call_id",
+ "status",
+ "output",
+ "max_output_length"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "Identifier of the evaluation.",
- "readOnly": true
- },
- "data": {
- "$ref": "#/components/schemas/InputData",
- "description": "Data for evaluation."
+ "enum": [
+ "shell_call_output"
+ ],
+ "description": "The type of the shell call output. Always `shell_call_output`.",
+ "x-stainless-const": true,
+ "default": "shell_call_output"
},
- "displayName": {
+ "id": {
"type": "string",
- "description": "Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique."
+ "description": "The unique ID of the shell call output. Populated when this item is returned via API."
},
- "description": {
+ "call_id": {
"type": "string",
- "description": "Description of the evaluation. It can be used to store additional information about the evaluation and is mutable."
+ "description": "The unique ID of the shell tool call generated by the model."
},
"status": {
- "type": "string",
- "description": "Status of the evaluation. It is set by service and is read-only.",
- "readOnly": true
- },
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Evaluation's tags. Unlike properties, tags are fully mutable."
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
+ "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "output": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
},
- "description": "Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed."
+ "description": "An array of shell call output contents"
},
- "evaluators": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/EvaluatorConfiguration"
- },
- "description": "Evaluators to be used for the evaluation."
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "target": {
- "$ref": "#/components/schemas/EvaluationTarget",
- "description": "Specifies the type and configuration of the entity used for this evaluation."
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "Evaluation Definition"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "The output of a shell tool call that was emitted.",
+ "title": "Shell call output"
},
- "EvaluationComparisonInsightRequest": {
+ "OpenAI.ConversationItemFunctionToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "evalId",
- "baselineRunId",
- "treatmentRunIds"
+ "call_id",
+ "name",
+ "arguments"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call.",
+ "readOnly": true
+ },
"type": {
"type": "string",
"enum": [
- "EvaluationComparison"
+ "function_call"
],
- "description": "The type of request."
+ "description": "The type of the function tool call. Always `function_call`.",
+ "x-stainless-const": true
},
- "evalId": {
+ "call_id": {
"type": "string",
- "description": "Identifier for the evaluation."
+ "description": "The unique ID of the function tool call generated by the model."
},
- "baselineRunId": {
+ "namespace": {
"type": "string",
- "description": "The baseline run ID for comparison."
+ "description": "The namespace of the function to run."
},
- "treatmentRunIds": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "List of treatment run IDs for comparison."
+ "name": {
+ "type": "string",
+ "description": "The name of the function to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the function."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/InsightRequest"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "Evaluation Comparison Request",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
+ "title": "Function tool call"
},
- "EvaluationComparisonInsightResult": {
+ "OpenAI.ConversationItemFunctionToolCallOutput": {
"type": "object",
"required": [
+ "id",
"type",
- "comparisons",
- "method"
+ "call_id",
+ "output"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
+ "readOnly": true
+ },
"type": {
"type": "string",
"enum": [
- "EvaluationComparison"
+ "function_call_output"
],
- "description": "The type of insights result."
+ "description": "The type of the function tool call output. Always `function_call_output`.",
+ "x-stainless-const": true
},
- "comparisons": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunResultComparison"
- },
- "description": "Comparison results for each treatment run against the baseline."
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
},
- "method": {
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
+ },
+ "status": {
"type": "string",
- "description": "The statistical method used for comparison."
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/InsightResult"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "Insights from the evaluation comparison.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
},
- "EvaluationDataGenerationType": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.ConversationItemImageGenToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "status",
+ "result"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "image_generation_call"
+ ],
+ "description": "The type of the image generation call. Always `image_generation_call`.",
+ "x-stainless-const": true
},
- {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the image generation call."
+ },
+ "status": {
"type": "string",
"enum": [
- "simple_qna",
- "traces",
- "tool_use",
- "task"
+ "in_progress",
+ "completed",
+ "generating",
+ "failed"
+ ],
+ "description": "The status of the image generation call."
+ },
+ "result": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
}
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
],
- "description": "The data generation type.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
},
- "EvaluationDatasetReference": {
+ "OpenAI.ConversationItemList": {
"type": "object",
"required": [
- "name"
+ "object",
+ "data",
+ "has_more",
+ "first_id",
+ "last_id"
],
"properties": {
- "name": {
+ "object": {
"type": "string",
- "description": "Dataset name."
+ "enum": [
+ "list"
+ ],
+ "description": "The type of object returned, must be `list`.",
+ "x-stainless-const": true
},
- "version": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ },
+ "description": "A list of conversation items.",
+ "x-ms-list-page-items": true
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Whether there are more items available."
+ },
+ "first_id": {
"type": "string",
- "description": "Dataset version. If not provided, resolves to the latest version."
+ "description": "The ID of the first item in the list."
},
- "schema_file_name": {
+ "last_id": {
"type": "string",
- "description": "Name of the schema file within the dataset's blob folder (e.g., \"a3f2b1c4_schema.json\").\nOptional — if not provided, schema is inferred at runtime from the data.\nOnly applicable for uri_folder datasets."
+ "description": "The ID of the last item in the list.",
+ "x-ms-list-continuation-token": true
}
},
- "description": "Reference to a dataset by name and version.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
+ "description": "A list of Conversation items.",
+ "title": "The conversation item list",
+ "x-oaiMeta": {
+ "name": "The item list",
+ "group": "conversations"
}
},
- "EvaluationLevel": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "turn",
- "conversation"
- ]
- },
- {
- "type": "string"
- }
- ],
- "description": "The level at which evaluation is performed."
- },
- "EvaluationResultSample": {
+ "OpenAI.ConversationItemLocalShellToolCall": {
"type": "object",
"required": [
"type",
- "evaluationResult"
+ "id",
+ "call_id",
+ "action",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "EvaluationResultSample"
+ "local_shell_call"
],
- "description": "Evaluation Result Sample Type"
+ "description": "The type of the local shell call. Always `local_shell_call`.",
+ "x-stainless-const": true
},
- "evaluationResult": {
- "$ref": "#/components/schemas/EvalResult",
- "description": "Evaluation result for the analysis sample."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell call."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the local shell call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/InsightSample"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "A sample from the evaluation result.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "A tool call to run a command on the local shell.",
+ "title": "Local shell call"
},
- "EvaluationRule": {
+ "OpenAI.ConversationItemLocalShellToolCallOutput": {
"type": "object",
"required": [
+ "type",
"id",
- "action",
- "eventType",
- "enabled",
- "systemData"
+ "output"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "Unique identifier for the evaluation rule.",
- "readOnly": true
+ "enum": [
+ "local_shell_call_output"
+ ],
+ "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "x-stainless-const": true
},
- "displayName": {
+ "id": {
"type": "string",
- "description": "Display Name for the evaluation rule."
+ "description": "The unique ID of the local shell tool call generated by the model."
},
- "description": {
+ "output": {
"type": "string",
- "description": "Description for the evaluation rule."
- },
- "action": {
- "$ref": "#/components/schemas/EvaluationRuleAction",
- "description": "Definition of the evaluation rule action.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "filter": {
- "$ref": "#/components/schemas/EvaluationRuleFilter",
- "description": "Filter condition of the evaluation rule."
- },
- "eventType": {
- "$ref": "#/components/schemas/EvaluationRuleEventType",
- "description": "Event type that the evaluation rule applies to."
- },
- "enabled": {
- "type": "boolean",
- "description": "Indicates whether the evaluation rule is enabled. Default is true."
+ "description": "A JSON string of the output of the local shell tool call."
},
- "systemData": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "System metadata for the evaluation rule.",
- "readOnly": true
+ "status": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "Evaluation rule model."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "The output of a local shell tool call.",
+ "title": "Local shell call output"
},
- "EvaluationRuleAction": {
+ "OpenAI.ConversationItemMcpApprovalRequest": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/EvaluationRuleActionType",
- "description": "Type of the evaluation action."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "continuousEvaluation": "#/components/schemas/ContinuousEvaluationRuleAction",
- "humanEvaluation": "#/components/schemas/HumanEvaluationRuleAction",
- "humanEvaluationPreview": "#/components/schemas/HumanEvaluationPreviewRuleAction"
- }
- },
- "description": "Evaluation action model."
- },
- "EvaluationRuleActionType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
"type": "string",
"enum": [
- "continuousEvaluation",
- "humanEvaluation",
- "humanEvaluationPreview"
- ]
- }
- ],
- "description": "Type of the evaluation action."
- },
- "EvaluationRuleEventType": {
- "anyOf": [
- {
- "type": "string"
+ "mcp_approval_request"
+ ],
+ "description": "The type of the item. Always `mcp_approval_request`.",
+ "x-stainless-const": true
},
- {
+ "id": {
"type": "string",
- "enum": [
- "responseCompleted",
- "manual"
- ]
+ "description": "The unique ID of the approval request."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server making the request."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tool to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of arguments for the tool."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "Type of the evaluation rule event."
+ "description": "A request for human approval of a tool invocation.",
+ "title": "MCP approval request"
},
- "EvaluationRuleFilter": {
+ "OpenAI.ConversationItemMcpApprovalResponseResource": {
"type": "object",
"required": [
- "agentName"
+ "type",
+ "id",
+ "approval_request_id",
+ "approve"
],
"properties": {
- "agentName": {
+ "type": {
"type": "string",
- "description": "Filter by agent name."
+ "enum": [
+ "mcp_approval_response"
+ ],
+ "description": "The type of the item. Always `mcp_approval_response`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the approval response"
+ },
+ "approval_request_id": {
+ "type": "string",
+ "description": "The ID of the approval request being answered."
+ },
+ "approve": {
+ "type": "boolean",
+ "description": "Whether the request was approved."
+ },
+ "reason": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "Evaluation filter model."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ],
+ "description": "A response to an MCP approval request.",
+ "title": "MCP approval response"
},
- "EvaluationRunClusterInsightRequest": {
+ "OpenAI.ConversationItemMcpListTools": {
"type": "object",
"required": [
"type",
- "evalId",
- "runIds"
+ "id",
+ "server_label",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "EvaluationRunClusterInsight"
+ "mcp_list_tools"
],
- "description": "The type of insights request."
+ "description": "The type of the item. Always `mcp_list_tools`.",
+ "x-stainless-const": true
},
- "evalId": {
+ "id": {
"type": "string",
- "description": "Evaluation Id for the insights."
+ "description": "The unique ID of the list."
},
- "runIds": {
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server."
+ },
+ "tools": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
},
- "description": "List of evaluation run IDs for the insights."
+ "description": "The tools available on the server."
},
- "modelConfiguration": {
- "$ref": "#/components/schemas/InsightModelConfiguration",
- "description": "Configuration of the model used in the insight generation."
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/InsightRequest"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "Insights on set of Evaluation Results",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "A list of tools available on an MCP server.",
+ "title": "MCP list tools"
},
- "EvaluationRunClusterInsightResult": {
+ "OpenAI.ConversationItemMcpToolCall": {
"type": "object",
"required": [
"type",
- "clusterInsight"
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "EvaluationRunClusterInsight"
+ "mcp_call"
],
- "description": "The type of insights result."
+ "description": "The type of the item. Always `mcp_call`.",
+ "x-stainless-const": true
},
- "clusterInsight": {
- "$ref": "#/components/schemas/ClusterInsightResult"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool call."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server running the tool."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tool that was run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments passed to the tool."
+ },
+ "output": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "error": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
+ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ },
+ "approval_request_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/InsightResult"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "Insights from the evaluation run cluster analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
+ "description": "An invocation of a tool on an MCP server.",
+ "title": "MCP tool call"
},
- "EvaluationScheduleTask": {
+ "OpenAI.ConversationItemMessage": {
"type": "object",
"required": [
"type",
- "evalId",
- "evalRun"
+ "id",
+ "status",
+ "role",
+ "content"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "Evaluation"
- ]
+ "message"
+ ],
+ "description": "The type of the message. Always set to `message`.",
+ "x-stainless-const": true,
+ "default": "message"
},
- "evalId": {
+ "id": {
"type": "string",
- "description": "Identifier of the evaluation group."
+ "description": "The unique ID of the message."
},
- "evalRun": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The evaluation run payload."
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MessageStatus",
+ "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API."
+ },
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
+ },
+ "description": "The content of the message"
+ },
+ "phase": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/ScheduleTask"
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "Evaluation task for the schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
- }
+ "description": "A message to or from the model.",
+ "title": "Message"
},
- "EvaluationSuiteDataGenerationOptions": {
+ "OpenAI.ConversationItemReasoningItem": {
"type": "object",
+ "required": [
+ "type",
+ "id",
+ "summary"
+ ],
"properties": {
"type": {
- "$ref": "#/components/schemas/EvaluationDataGenerationType",
- "description": "The data generation type. Defaults to 'simple_qna' if not specified."
+ "type": "string",
+ "enum": [
+ "reasoning"
+ ],
+ "description": "The type of the object. Always `reasoning`.",
+ "x-stainless-const": true
},
- "max_samples": {
- "type": "integer",
- "format": "int32",
- "minimum": 15,
- "maximum": 1000,
- "description": "Maximum number of samples to generate. Valid range: 15-1000."
- }
- },
- "description": "Options for dataset generation within an evaluation suite generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluationSuiteGenerationCategory": {
- "anyOf": [
- {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the reasoning content."
},
- {
+ "encrypted_content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
+ },
+ "description": "Reasoning summary content."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ },
+ "description": "Reasoning text content."
+ },
+ "status": {
"type": "string",
"enum": [
- "quality",
- "safety"
- ]
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
],
- "description": "The category of evaluator generation.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
},
- "EvaluationSuiteGenerationJob": {
+ "OpenAI.ConversationItemToolSearchCall": {
"type": "object",
"required": [
+ "type",
"id",
- "status",
- "created_at"
+ "call_id",
+ "execution",
+ "arguments",
+ "status"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "Server-assigned unique identifier.",
- "readOnly": true
- },
- "inputs": {
- "$ref": "#/components/schemas/EvaluationSuiteGenerationJobInputs",
- "description": "Caller-supplied inputs."
+ "enum": [
+ "tool_search_call"
+ ],
+ "description": "The type of the item. Always `tool_search_call`.",
+ "x-stainless-const": true,
+ "default": "tool_search_call"
},
- "result": {
- "$ref": "#/components/schemas/EvaluationSuiteVersion",
- "description": "Result produced on success.",
- "readOnly": true
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool search call item."
},
- "status": {
- "$ref": "#/components/schemas/JobStatus",
- "description": "Current lifecycle status.",
- "readOnly": true
+ "call_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error",
- "description": "Error details — populated only on failure.",
- "readOnly": true
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
},
- "created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job was created, represented in Unix time.",
- "readOnly": true
+ "arguments": {
+ "description": "Arguments used for the tool search call."
},
- "finished_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job finished, represented in Unix time.",
- "readOnly": true
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the tool search call item that was recorded."
},
- "usage": {
- "$ref": "#/components/schemas/EvaluationSuiteGenerationTokenUsage",
- "description": "Token consumption summary. Populated on terminal states.",
- "readOnly": true
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "Evaluation suite generation job resource — a long-running job that generates testing criteria and optionally a dataset from source materials. On success, the result is the persisted EvaluationSuiteVersion.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluationSuiteGenerationJobCreate": {
- "type": "object",
- "properties": {
- "inputs": {
- "$ref": "#/components/schemas/EvaluationSuiteGenerationJobInputs",
- "description": "Caller-supplied inputs."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
- },
- "description": "Evaluation suite generation job resource — a long-running job that generates testing criteria and optionally a dataset from source materials. On success, the result is the persisted EvaluationSuiteVersion.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ ]
},
- "EvaluationSuiteGenerationJobInputs": {
+ "OpenAI.ConversationItemToolSearchOutput": {
"type": "object",
"required": [
- "evaluation_suite_name",
- "sources",
- "generation_model"
+ "type",
+ "id",
+ "call_id",
+ "execution",
+ "tools",
+ "status"
],
"properties": {
- "evaluation_suite_name": {
+ "type": {
"type": "string",
- "description": "The evaluation suite name to create."
- },
- "sources": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvaluationSuiteJobSource"
- },
- "description": "Source materials for generation — agent context, prompts, traces, or datasets."
+ "enum": [
+ "tool_search_output"
+ ],
+ "description": "The type of the item. Always `tool_search_output`.",
+ "x-stainless-const": true,
+ "default": "tool_search_output"
},
- "generation_model": {
+ "id": {
"type": "string",
- "description": "The LLM model to use for rubric and data generation (e.g., 'gpt-4o')."
- },
- "category": {
- "$ref": "#/components/schemas/EvaluationSuiteGenerationCategory",
- "description": "Category determines the generation focus. Default: quality.",
- "default": "quality"
- },
- "initialization_parameters": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Optional initialization parameters applied to all generated evaluators.\nFor example, deployment_name for LLM judge model, default threshold."
- },
- "data_generation_options": {
- "$ref": "#/components/schemas/EvaluationSuiteDataGenerationOptions",
- "description": "Data generation options. Controls how the evaluation dataset is generated.\nIf omitted, defaults are used (simple_qna, 100 max_samples)."
- },
- "target": {
- "$ref": "#/components/schemas/Target",
- "description": "Target for the generated suite. Stored on the suite so it can be run\nimmediately after generation completes.\nSupports azure_ai_agent, azure_ai_model, azure_ai_assistant."
+ "description": "The unique ID of the tool search output item."
},
- "input_messages": {
+ "call_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
+ "type": "null"
}
- ],
- "description": "How to send dataset rows to the target.\nIf omitted and target is provided, defaults to a template using item.query."
+ ]
},
- "evaluation_level": {
- "$ref": "#/components/schemas/EvaluationLevel",
- "description": "Evaluation level for the generated suite.\nDefault: turn (single-turn evaluation).\nUse conversation for multi-turn evaluation."
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The loaded tool definitions returned by tool search."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the tool search output item that was recorded."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "Caller-supplied inputs for an evaluation suite generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ }
+ ]
},
- "EvaluationSuiteGenerationTokenUsage": {
- "type": "object",
- "properties": {
- "input_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Number of input tokens consumed."
- },
- "output_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Number of output tokens consumed."
+ "OpenAI.ConversationItemType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "total_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Total tokens consumed."
+ {
+ "type": "string",
+ "enum": [
+ "message",
+ "function_call",
+ "function_call_output",
+ "file_search_call",
+ "web_search_call",
+ "image_generation_call",
+ "computer_call",
+ "computer_call_output",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "reasoning",
+ "compaction",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "mcp_call",
+ "custom_tool_call",
+ "custom_tool_call_output"
+ ]
}
- },
- "description": "Token usage summary for an evaluation suite generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ ]
},
- "EvaluationSuiteJobSource": {
+ "OpenAI.ConversationItemWebSearchToolCall": {
"type": "object",
"required": [
- "type"
+ "id",
+ "type",
+ "status",
+ "action"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
"type": {
- "$ref": "#/components/schemas/EvaluationSuiteJobSourceType",
- "description": "The type of source."
+ "type": "string",
+ "enum": [
+ "web_search_call"
+ ],
+ "description": "The type of the web search tool call. Always `web_search_call`.",
+ "x-stainless-const": true
},
- "description": {
+ "status": {
"type": "string",
- "description": "Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities')."
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
+ ],
+ "description": "The status of the web search tool call."
+ },
+ "action": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ }
+ ],
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "prompt": "#/components/schemas/PromptEvaluationSuiteJobSource",
- "agent": "#/components/schemas/AgentEvaluationSuiteJobSource",
- "traces": "#/components/schemas/TracesEvaluationSuiteJobSource",
- "dataset": "#/components/schemas/DatasetEvaluationSuiteJobSource"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationItem"
}
- },
- "description": "The base source model for evaluation suite generation jobs. Polymorphic over `type`.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ ],
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
},
- "EvaluationSuiteJobSourceType": {
- "anyOf": [
+ "OpenAI.ConversationParam": {
+ "oneOf": [
{
"type": "string"
},
{
- "type": "string",
- "enum": [
- "prompt",
- "agent",
- "traces",
- "dataset"
- ]
+ "$ref": "#/components/schemas/OpenAI.ConversationParam-2"
}
],
- "description": "The supported source types for evaluation suite generation jobs.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.\nInput items and output items from this response are automatically added to this conversation after this response completes."
},
- "EvaluationSuiteRunRequest": {
+ "OpenAI.ConversationParam-2": {
"type": "object",
+ "required": [
+ "id"
+ ],
"properties": {
- "evaluation_name": {
- "type": "string",
- "description": "Name for the evaluation. Default: '{suiteName}-runs'."
- },
- "evaluation_suite_version": {
+ "id": {
"type": "string",
- "description": "Evaluation suite version to run. Default: latest."
- },
- "evaluation_level": {
- "$ref": "#/components/schemas/EvaluationLevel",
- "description": "Overrides the suite's default evaluation level. If omitted, uses the level from the suite."
+ "description": "The unique ID of the conversation."
}
},
- "description": "Request body for running an evaluation from a suite.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "The conversation that this response belongs to.",
+ "title": "Conversation object"
},
- "EvaluationSuiteRunResponse": {
+ "OpenAI.ConversationReference": {
"type": "object",
"required": [
- "evaluation_suite_name",
- "evaluation_suite_version",
- "results"
+ "id"
],
"properties": {
- "evaluation_suite_name": {
- "type": "string",
- "description": "The evaluation suite name used."
- },
- "evaluation_suite_version": {
+ "id": {
"type": "string",
- "description": "The evaluation suite version resolved."
- },
- "results": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvaluationSuiteRunResult"
- },
- "description": "The run results. Currently a single-element array; will support multiple runs in the future."
+ "description": "The unique ID of the conversation that this response was associated with."
}
},
- "description": "Response from running an evaluation suite.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "description": "The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.",
+ "title": "Conversation"
},
- "EvaluationSuiteRunResult": {
+ "OpenAI.ConversationResource": {
"type": "object",
"required": [
- "eval_id",
- "run_id",
- "status",
+ "id",
+ "object",
+ "metadata",
"created_at"
],
"properties": {
- "eval_id": {
+ "id": {
"type": "string",
- "description": "The evaluation ID created."
+ "description": "The unique ID of the conversation."
},
- "run_id": {
+ "object": {
"type": "string",
- "description": "The eval run ID created."
+ "enum": [
+ "conversation"
+ ],
+ "description": "The object type, which is always `conversation`.",
+ "x-stainless-const": true,
+ "default": "conversation"
},
- "status": {
- "$ref": "#/components/schemas/JobStatus",
- "description": "Status of the run."
+ "metadata": {
+ "$ref": "#/components/schemas/OpenAI.Metadata",
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
},
"created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "Timestamp when the run was created."
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The time at which the conversation was created, measured in seconds since the Unix epoch."
}
- },
- "description": "Result of a single evaluation run within a suite execution.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationSuiteSubtype": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.CoordParam": {
+ "type": "object",
+ "required": [
+ "x",
+ "y"
+ ],
+ "properties": {
+ "x": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The x-coordinate."
},
- {
- "type": "string",
- "enum": [
- "default",
- "benchmark"
- ]
+ "y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The y-coordinate."
}
- ],
- "description": "The subtype of an evaluation suite.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ },
+ "description": "An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.",
+ "title": "Coordinate"
},
- "EvaluationSuiteVersion": {
+ "OpenAI.CreateAssistantRequest": {
"type": "object",
"required": [
- "testing_criteria",
- "name",
- "version"
+ "model"
],
"properties": {
- "display_name": {
- "type": "string",
- "description": "Human-readable display name.\nDoes not need to be unique. Shown in Foundry portal list views and eval reports."
- },
- "subtype": {
- "$ref": "#/components/schemas/EvaluationSuiteSubtype",
- "description": "Subtype of the evaluation suite."
- },
- "dataset": {
- "$ref": "#/components/schemas/EvaluationDatasetReference",
- "description": "Dataset reference for evaluation.\nOptional — omit for evaluator-only suites where data comes from\nlive production traces or is provided at run time.\nThe referenced dataset must exist in the project's dataset registry."
- },
- "testing_criteria": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
- },
- {
- "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
- }
- ]
- },
- "minItems": 1,
- "description": "Testing criteria — the evaluator configurations for this suite.\nSupports all grader types: azure_ai_evaluator, string_check, label_model,\nscore_model, text_similarity, python, etc.\nAt least one entry is required."
- },
- "target": {
- "$ref": "#/components/schemas/Target",
- "description": "Target for this evaluation suite. Uses the existing Target discriminated type\nfrom eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.\nOptional — allows suites to exist without a target."
- },
- "input_messages": {
+ "model": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
+ "$ref": "#/components/schemas/OpenAI.AssistantSupportedModels"
}
],
- "description": "How to send dataset rows to the target (agent or model).\nSupports template type (prompt with column placeholders) and\nitem_reference type (column containing pre-built messages)."
- },
- "evaluation_level": {
- "$ref": "#/components/schemas/EvaluationLevel",
- "description": "Default evaluation level for this suite. Can be overridden at run time."
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.",
+ "x-oaiTypeLabel": "string"
},
"name": {
- "type": "string",
- "description": "The name of the resource.",
- "readOnly": true
- },
- "version": {
- "type": "string",
- "description": "The version of the resource.",
- "readOnly": true
- }
- },
- "description": "An evaluation suite bundles testing criteria — an optional dataset, one or more\nevaluator configs with thresholds and init params — into a reusable, named artifact that\ncan gate agent changes across batch, scheduled, continuous, and CI/CD evals.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluationSuiteVersionCreate": {
- "type": "object",
- "required": [
- "testing_criteria"
- ],
- "properties": {
- "display_name": {
- "type": "string",
- "description": "Human-readable display name.\nDoes not need to be unique. Shown in Foundry portal list views and eval reports."
- },
- "subtype": {
- "$ref": "#/components/schemas/EvaluationSuiteSubtype",
- "description": "Subtype of the evaluation suite."
- },
- "dataset": {
- "$ref": "#/components/schemas/EvaluationDatasetReference",
- "description": "Dataset reference for evaluation.\nOptional — omit for evaluator-only suites where data comes from\nlive production traces or is provided at run time.\nThe referenced dataset must exist in the project's dataset registry."
- },
- "testing_criteria": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
- },
- {
- "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
- }
- ]
- },
- "minItems": 1,
- "description": "Testing criteria — the evaluator configurations for this suite.\nSupports all grader types: azure_ai_evaluator, string_check, label_model,\nscore_model, text_similarity, python, etc.\nAt least one entry is required."
- },
- "target": {
- "$ref": "#/components/schemas/Target",
- "description": "Target for this evaluation suite. Uses the existing Target discriminated type\nfrom eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.\nOptional — allows suites to exist without a target."
- },
- "input_messages": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
+ "type": "null"
}
- ],
- "description": "How to send dataset rows to the target (agent or model).\nSupports template type (prompt with column placeholders) and\nitem_reference type (column containing pre-built messages)."
- },
- "evaluation_level": {
- "$ref": "#/components/schemas/EvaluationLevel",
- "description": "Default evaluation level for this suite. Can be overridden at run time."
+ ]
},
"description": {
- "type": "string",
- "description": "The asset description text."
- },
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
- }
- },
- "description": "An evaluation suite bundles testing criteria — an optional dataset, one or more\nevaluator configs with thresholds and init params — into a reusable, named artifact that\ncan gate agent changes across batch, scheduled, continuous, and CI/CD evals.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluationSuiteVersionUpdate": {
- "type": "object",
- "required": [
- "testing_criteria"
- ],
- "properties": {
- "display_name": {
- "type": "string",
- "description": "Human-readable display name.\nDoes not need to be unique. Shown in Foundry portal list views and eval reports."
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "subtype": {
- "$ref": "#/components/schemas/EvaluationSuiteSubtype",
- "description": "Subtype of the evaluation suite."
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "dataset": {
- "$ref": "#/components/schemas/EvaluationDatasetReference",
- "description": "Dataset reference for evaluation.\nOptional — omit for evaluator-only suites where data comes from\nlive production traces or is provided at run time.\nThe referenced dataset must exist in the project's dataset registry."
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "testing_criteria": {
+ "tools": {
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderLabelModel"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderPython"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel"
- },
- {
- "$ref": "#/components/schemas/TestingCriterionAzureAIEvaluator"
- }
- ]
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
},
- "minItems": 1,
- "description": "Testing criteria — the evaluator configurations for this suite.\nSupports all grader types: azure_ai_evaluator, string_check, label_model,\nscore_model, text_similarity, python, etc.\nAt least one entry is required."
+ "maxItems": 128,
+ "description": "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`.",
+ "default": []
},
- "target": {
- "$ref": "#/components/schemas/Target",
- "description": "Target for this evaluation suite. Uses the existing Target discriminated type\nfrom eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.\nOptional — allows suites to exist without a target."
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "input_messages": {
+ "metadata": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ "$ref": "#/components/schemas/OpenAI.Metadata"
},
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
+ "type": "null"
}
- ],
- "description": "How to send dataset rows to the target (agent or model).\nSupports template type (prompt with column placeholders) and\nitem_reference type (column containing pre-built messages)."
+ ]
},
- "evaluation_level": {
- "$ref": "#/components/schemas/EvaluationLevel",
- "description": "Default evaluation level for this suite. Can be overridden at run time."
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
},
- "description": {
- "type": "string",
- "description": "The asset description text."
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
+ "response_format": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "An evaluation suite bundles testing criteria — an optional dataset, one or more\nevaluator configs with thresholds and init params — into a reusable, named artifact that\ncan gate agent changes across batch, scheduled, continuous, and CI/CD evals.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationTarget": {
+ "OpenAI.CreateAssistantRequestToolResources": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "$ref": "#/components/schemas/EvaluationTargetType",
- "description": "Discriminator that defines the type of the evaluation target."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "modelResponseGeneration": "#/components/schemas/modelResponseGenerationTarget"
- }
- },
- "description": "Abstract base model for defining evaluation targets."
- },
- "EvaluationTargetType": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "modelResponseGeneration"
- ]
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesCodeInterpreter"
},
- {
- "type": "string"
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearch"
}
- ],
- "description": "Allowed types of evaluation targets."
+ }
},
- "EvaluationTaxonomy": {
+ "OpenAI.CreateAssistantRequestToolResourcesCodeInterpreter": {
"type": "object",
- "required": [
- "name",
- "version",
- "taxonomyInput"
- ],
"properties": {
- "id": {
- "type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
- },
- "name": {
- "type": "string",
- "description": "The name of the resource",
- "readOnly": true
- },
- "version": {
- "type": "string",
- "description": "The version of the resource",
- "readOnly": true
- },
- "taxonomyInput": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInput",
- "description": "Input configuration for the evaluation taxonomy."
- },
- "taxonomyCategories": {
+ "file_ids": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/TaxonomyCategory"
- },
- "description": "List of taxonomy categories."
- },
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
"type": "string"
},
- "description": "Additional properties for the evaluation taxonomy."
+ "maxItems": 20
}
- },
- "description": "Evaluation Taxonomy Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationTaxonomyCreateOrUpdate": {
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearch": {
"type": "object",
- "required": [
- "taxonomyInput"
- ],
"properties": {
- "description": {
- "type": "string",
- "description": "The asset description text."
- },
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
"type": "string"
},
- "description": "Tag dictionary. Tags can be added, removed, and updated."
- },
- "taxonomyInput": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInput",
- "description": "Input configuration for the evaluation taxonomy."
+ "maxItems": 1
},
- "taxonomyCategories": {
+ "vector_stores": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/TaxonomyCategory"
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStores"
},
- "description": "List of taxonomy categories."
- },
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
+ "maxItems": 1
+ }
+ }
+ },
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStores": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
"type": "string"
},
- "description": "Additional properties for the evaluation taxonomy."
+ "maxItems": 100000000
+ },
+ "chunking_strategy": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "Evaluation Taxonomy Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationTaxonomyInput": {
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInputType",
- "description": "Input type of the evaluation taxonomy."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "agent": "#/components/schemas/AgentTaxonomyInput"
+ "type": "string",
+ "enum": [
+ "auto"
+ ],
+ "x-stainless-const": true
}
- },
- "description": "Input configuration for the evaluation taxonomy.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationTaxonomyInputType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic": {
+ "type": "object",
+ "required": [
+ "type",
+ "static"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "agent",
- "policy"
- ]
+ "static"
+ ],
+ "x-stainless-const": true
+ },
+ "static": {
+ "$ref": "#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic"
}
- ],
- "description": "Type of the evaluation taxonomy input.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationTaxonomyInputUpdate": {
+ "OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic": {
"type": "object",
"required": [
- "type"
+ "max_chunk_size_tokens",
+ "chunk_overlap_tokens"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInputType",
- "description": "Input type of the evaluation taxonomy."
+ "max_chunk_size_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 100,
+ "maximum": 4096
+ },
+ "chunk_overlap_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "agent": "#/components/schemas/AgentTaxonomyInputUpdate"
+ }
+ },
+ "OpenAI.CreateBatchParametersBody": {
+ "type": "object",
+ "required": [
+ "input_file_id",
+ "endpoint",
+ "completion_window"
+ ],
+ "properties": {
+ "input_file_id": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string",
+ "enum": [
+ "/v1/responses",
+ "/v1/chat/completions",
+ "/v1/embeddings",
+ "/v1/completions",
+ "/v1/moderations",
+ "/v1/images/generations",
+ "/v1/images/edits",
+ "/v1/videos"
+ ]
+ },
+ "completion_window": {
+ "type": "string",
+ "enum": [
+ "24h"
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "output_expires_after": {
+ "$ref": "#/components/schemas/OpenAI.BatchFileExpirationAfter"
}
- },
- "description": "Input configuration for the evaluation taxonomy.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluationTaxonomyUpdate": {
+ "OpenAI.CreateChatCompletionRequest": {
"type": "object",
+ "required": [
+ "messages",
+ "model"
+ ],
"properties": {
- "description": {
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "top_logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "user": {
"type": "string",
- "description": "The asset description text."
+ "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
+ "deprecated": true
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "safety_identifier": {
+ "type": "string",
+ "maxLength": 64,
+ "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
+ },
+ "prompt_cache_key": {
+ "type": "string",
+ "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
+ },
+ "service_tier": {
+ "$ref": "#/components/schemas/OpenAI.ServiceTier"
+ },
+ "prompt_cache_retention": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "in_memory",
+ "24h"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage"
},
- "description": "Tag dictionary. Tags can be added, removed, and updated."
+ "minItems": 1,
+ "description": "A list of messages comprising the conversation so far. Depending on the\n [model](/docs/models) you use, different message types (modalities) are\n supported, like [text](/docs/guides/text-generation),\n [images](/docs/guides/vision), and [audio](/docs/guides/audio)."
},
- "taxonomyInput": {
- "$ref": "#/components/schemas/EvaluationTaxonomyInputUpdate",
- "description": "Input configuration for the evaluation taxonomy."
+ "model": {
+ "type": "string",
+ "description": "The model deployment to use for this chat completion."
},
- "taxonomyCategories": {
+ "modalities": {
+ "$ref": "#/components/schemas/OpenAI.ResponseModalities"
+ },
+ "verbosity": {
+ "$ref": "#/components/schemas/OpenAI.Verbosity"
+ },
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "max_completion_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning)."
+ },
+ "frequency_penalty": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": -2,
+ "maximum": 2,
+ "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\n their existing frequency in the text so far, decreasing the model's\n likelihood to repeat the same line verbatim."
+ },
+ "presence_penalty": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": -2,
+ "maximum": 2,
+ "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\n whether they appear in the text so far, increasing the model's likelihood\n to talk about new topics."
+ },
+ "web_search_options": {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestWebSearchOptions",
+ "description": "This tool searches the web for relevant results to use in a response.\n Learn more about the [web search tool](/docs/guides/tools-web-search?api-mode=chat).",
+ "title": "Web search"
+ },
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat",
+ "description": "An object specifying the format that the model must output.\n Setting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\n Structured Outputs which ensures the model will match your supplied JSON\n schema. Learn more in the [Structured Outputs\n guide](/docs/guides/structured-outputs).\n Setting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\n ensures the message the model generates is valid JSON. Using `json_schema`\n is preferred for models that support it."
+ },
+ "audio": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestAudio"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Parameters for audio output. Required when audio output is requested with\n `modalities: [\"audio\"]`. [Learn more](/docs/guides/audio)."
+ },
+ "store": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Whether or not to store the output of this chat completion request for\n use in our [model distillation](/docs/guides/distillation) or\n [evals](/docs/guides/evals) products.\n Supports text and image inputs. Note: image inputs over 8MB will be dropped."
+ },
+ "moderation": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ModerationParam"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "If set to true, the model response data will be streamed to the client\n 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).\n See the [Streaming section below](/docs/api-reference/chat/streaming)\n for more information, along with the [streaming responses](/docs/guides/streaming-responses)\n guide for more information on how to handle the streaming events."
+ },
+ "stop": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.StopConfiguration"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "logit_bias": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Modify the likelihood of specified tokens appearing in the completion.\n Accepts a JSON object that maps tokens (specified by their token ID in the\n tokenizer) to an associated bias value from -100 to 100. Mathematically,\n the bias is added to the logits generated by the model prior to sampling.\n The exact effect will vary per model, but values between -1 and 1 should\n decrease or increase likelihood of selection; values like -100 or 100\n should result in a ban or exclusive selection of the relevant token.",
+ "x-oaiTypeLabel": "map"
+ },
+ "logprobs": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Whether to return log probabilities of the output tokens or not. If true,\n returns the log probabilities of each output token returned in the\n `content` of `message`."
+ },
+ "max_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The maximum number of [tokens](/tokenizer) that can be generated in the\n chat completion. This value can be used to control\n [costs](https://openai.com/api/pricing/) for text generated via API.\n This value is now deprecated in favor of `max_completion_tokens`, and is\n not compatible with [o-series models](/docs/guides/reasoning).",
+ "deprecated": true
+ },
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 1,
+ "maximum": 128,
+ "description": "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.",
+ "default": 1
+ },
+ "prediction": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.PredictionContent"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Configuration for a [Predicted Output](/docs/guides/predicted-outputs),\n which can greatly improve response times when large parts of the model\n response are known ahead of time. This is most common when you are\n regenerating a file with only minor changes to most of the content."
+ },
+ "seed": {
+ "anyOf": [
+ {
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "This feature is in Beta.\n 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.\n Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.",
+ "deprecated": true,
+ "x-oaiMeta": {
+ "beta": true
+ }
+ },
+ "stream_options": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamOptions"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/TaxonomyCategory"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTool"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletions"
+ }
+ ]
},
- "description": "List of taxonomy categories."
+ "description": "A list of tools the model may call. You can provide either\n [custom tools](/docs/guides/function-calling#custom-tools) or\n [function tools](/docs/guides/function-calling)."
},
- "properties": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "tool_choice": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionToolChoiceOption"
+ },
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
+ "default": true
+ },
+ "function_call": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "none",
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionFunctionCallOption"
+ }
+ ],
+ "description": "Deprecated in favor of `tool_choice`.\n Controls which (if any) function is called by the model.\n `none` means the model will not call a function and instead generates a\n message.\n `auto` means the model can pick between generating a message or calling a\n function.\n Specifying a particular function via `{\"name\": \"my_function\"}` forces the\n model to call that function.\n `none` is the default when no functions are present. `auto` is the default\n if functions are present.",
+ "deprecated": true
+ },
+ "functions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionFunctions"
},
- "description": "Additional properties for the evaluation taxonomy."
+ "minItems": 1,
+ "maxItems": 128,
+ "description": "Deprecated in favor of `tools`.\n A list of functions the model may generate JSON inputs for.",
+ "deprecated": true
+ },
+ "user_security_context": {
+ "$ref": "#/components/schemas/AzureUserSecurityContext",
+ "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud."
}
- },
- "description": "Evaluation Taxonomy Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorCategory": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.CreateChatCompletionRequestAudio": {
+ "type": "object",
+ "required": [
+ "voice",
+ "format"
+ ],
+ "properties": {
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsOrCustomVoice"
},
- {
+ "format": {
"type": "string",
"enum": [
- "quality",
- "safety",
- "agents"
+ "wav",
+ "aac",
+ "mp3",
+ "flac",
+ "opus",
+ "pcm16"
]
}
- ],
- "description": "The category of the evaluator",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorConfiguration": {
+ "OpenAI.CreateChatCompletionRequestResponseFormat": {
"type": "object",
"required": [
- "id"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "Identifier of the evaluator."
- },
- "initParams": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Initialization parameters of the evaluator."
- },
- "dataMapping": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Data parameters of the evaluator."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType"
}
},
- "description": "Evaluator Configuration"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "text": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText",
+ "json_object": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject",
+ "json_schema": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
+ }
+ },
+ "description": "An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it."
},
- "EvaluatorCredentialRequest": {
+ "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject": {
"type": "object",
"required": [
- "blob_uri"
+ "type"
],
"properties": {
- "blob_uri": {
+ "type": {
"type": "string",
- "format": "uri",
- "description": "The blob URI for the evaluator storage. Example: `https://account.blob.core.windows.net:443/container`"
+ "enum": [
+ "json_object"
+ ],
+ "description": "The type of response format being defined. Always `json_object`.",
+ "x-stainless-const": true
}
},
- "description": "Request body for getting evaluator credentials",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
+ }
+ ],
+ "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
+ "title": "JSON object"
},
- "EvaluatorDefinition": {
+ "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/EvaluatorDefinitionType",
- "description": "The type of evaluator definition"
- },
- "init_parameters": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters like type, properties, required."
- },
- "data_schema": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like type, properties, required."
- },
- "metrics": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/EvaluatorMetric"
- },
- "description": "List of output metrics produced by this evaluator"
+ "type": "string",
+ "enum": [
+ "text"
+ ],
+ "description": "The type of response format being defined. Always `text`.",
+ "x-stainless-const": true
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "code": "#/components/schemas/CodeBasedEvaluatorDefinition",
- "prompt": "#/components/schemas/PromptBasedEvaluatorDefinition",
- "rubric": "#/components/schemas/RubricBasedEvaluatorDefinition",
- "endpoint": "#/components/schemas/EndpointBasedEvaluatorDefinition"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
}
- },
- "description": "Base evaluator configuration with discriminator",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
+ ],
+ "description": "Default response format. Used to generate text responses.",
+ "title": "Text"
},
- "EvaluatorDefinitionType": {
+ "OpenAI.CreateChatCompletionRequestResponseFormatType": {
"anyOf": [
{
"type": "string"
@@ -27670,848 +47138,1196 @@
{
"type": "string",
"enum": [
- "prompt",
- "code",
- "prompt_and_code",
- "service",
- "openai_graders",
- "rubric",
- "endpoint"
+ "text",
+ "json_schema",
+ "json_object"
]
}
- ],
- "description": "The type of evaluator definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ ]
+ },
+ "OpenAI.CreateChatCompletionRequestWebSearchOptions": {
+ "type": "object",
+ "properties": {
+ "user_location": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestWebSearchOptionsUserLocation"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "search_context_size": {
+ "$ref": "#/components/schemas/OpenAI.WebSearchContextSize"
+ }
}
},
- "EvaluatorGenerationArtifacts": {
+ "OpenAI.CreateChatCompletionRequestWebSearchOptionsUserLocation": {
"type": "object",
"required": [
- "dataset",
- "kinds"
+ "type",
+ "approximate"
],
"properties": {
- "dataset": {
- "$ref": "#/components/schemas/DatasetReference",
- "description": "Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to `EvaluatorVersion.version`) holding all artifacts produced by the generation pipeline. Each row in the JSONL carries a `kind` field discriminating its content (e.g. `spec`, `tools`, `context`)."
+ "type": {
+ "type": "string",
+ "enum": [
+ "approximate"
+ ],
+ "x-stainless-const": true
},
- "kinds": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The kinds of rows present in `dataset`. Always contains `\"spec\"` (the generated evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain `\"tools\"` (when the generation pipeline produced or inferred OpenAI tool schemas) and/or `\"context\"` (when supplementary materials such as file uploads or trace samples were used during generation)."
+ "approximate": {
+ "$ref": "#/components/schemas/OpenAI.WebSearchLocation"
}
- },
- "description": "Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorGenerationInputs": {
+ "OpenAI.CreateChatCompletionResponse": {
"type": "object",
"required": [
- "sources",
+ "id",
+ "choices",
+ "created",
"model",
- "evaluator_name"
+ "object"
],
"properties": {
- "sources": {
+ "id": {
+ "type": "string",
+ "description": "A unique identifier for the chat completion."
+ },
+ "choices": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/EvaluatorGenerationJobSource"
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponseChoices"
},
- "description": "Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry is an `EvaluatorGenerationJobSource` variant discriminated by `type`."
+ "description": "A list of chat completion choices. Can be more than one if `n` is greater than 1."
+ },
+ "created": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) of when the chat completion was created."
},
"model": {
"type": "string",
- "description": "The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide their own model rather than relying on service-owned capacity."
+ "description": "The model deployment used for the creation of this chat completion."
},
- "evaluator_name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 256,
- "pattern": "^[A-Za-z0-9_.~-]+$",
- "description": "The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII letters, digits, underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` is reserved for system-managed evaluators and is rejected by the service. If an evaluator with this name already exists in the project (and is rubric-subtype), the service creates a new version under the same name and uses the prior version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive loop). Old versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`."
+ "service_tier": {
+ "$ref": "#/components/schemas/OpenAI.ServiceTier"
},
- "evaluator_display_name": {
+ "system_fingerprint": {
"type": "string",
- "description": "Optional human-friendly display name for the resulting evaluator. Surfaced as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier."
+ "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.",
+ "deprecated": true
},
- "evaluator_description": {
+ "object": {
"type": "string",
- "description": "Optional human-friendly description for the resulting evaluator. Surfaced as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related models."
+ "enum": [
+ "chat.completion"
+ ],
+ "description": "The object type, which is always `chat.completion`.",
+ "x-stainless-const": true
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.CompletionUsage"
+ },
+ "moderation": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionModeration"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "Caller-supplied inputs for an evaluator generation job.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ "description": "Represents a chat completion response returned by model, based on the provided input.",
+ "x-oaiMeta": {
+ "name": "The chat completion object",
+ "group": "chat",
+ "example": "{\n \"id\": \"chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG\",\n \"object\": \"chat.completion\",\n \"created\": 1741570283,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1117,\n \"completion_tokens\": 46,\n \"total_tokens\": 1163,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_fc9f1d7035\"\n}\n"
}
},
- "EvaluatorGenerationJob": {
+ "OpenAI.CreateChatCompletionResponseChoices": {
+ "type": "object",
+ "required": [
+ "finish_reason",
+ "index",
+ "message",
+ "logprobs"
+ ],
+ "properties": {
+ "finish_reason": {
+ "type": "string",
+ "enum": [
+ "stop",
+ "length",
+ "tool_calls",
+ "content_filter",
+ "function_call"
+ ]
+ },
+ "index": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "message": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessage"
+ },
+ "logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponseChoicesLogprobs"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.CreateChatCompletionResponseChoicesLogprobs": {
+ "type": "object",
+ "required": [
+ "content",
+ "refusal"
+ ],
+ "properties": {
+ "content": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "refusal": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.CreateCompletionRequest": {
+ "type": "object",
+ "required": [
+ "model",
+ "prompt"
+ ],
+ "properties": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "gpt-3.5-turbo-instruct",
+ "davinci-002",
+ "babbage-002"
+ ]
+ }
+ ],
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.",
+ "x-oaiTypeLabel": "string"
+ },
+ "prompt": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n 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.",
+ "default": "<|endoftext|>"
+ },
+ "best_of": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 20,
+ "description": "Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed.\n 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`.\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`.",
+ "default": 1
+ },
+ "echo": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Echo back the prompt in addition to the completion"
+ },
+ "frequency_penalty": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": -2,
+ "maximum": 2,
+ "description": "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.\n [See more information about frequency and presence penalties.](/docs/guides/text-generation)"
+ },
+ "logit_bias": {
+ "anyOf": [
+ {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Modify the likelihood of specified tokens appearing in the completion.\n 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.\n As an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated.",
+ "x-oaiTypeLabel": "map"
+ },
+ "logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 5,
+ "description": "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.\n The maximum value for `logprobs` is 5."
+ },
+ "max_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "description": "The maximum number of [tokens](/tokenizer) that can be generated in the completion.\n 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.",
+ "default": 16
+ },
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 1,
+ "maximum": 128,
+ "description": "How many completions to generate for each prompt.\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`.",
+ "default": 1
+ },
+ "presence_penalty": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": -2,
+ "maximum": 2,
+ "description": "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.\n [See more information about frequency and presence penalties.](/docs/guides/text-generation)"
+ },
+ "seed": {
+ "anyOf": [
+ {
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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.\n Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend."
+ },
+ "stop": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.StopConfiguration"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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_options": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamOptions"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "suffix": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The suffix that comes after a completion of inserted text.\n This parameter is only supported for `gpt-3.5-turbo-instruct`."
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 2,
+ "description": "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.\n We generally recommend altering this or `top_p` but not both.",
+ "default": 1
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 1,
+ "description": "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.\n We generally recommend altering this or `temperature` but not both.",
+ "default": 1
+ },
+ "user": {
+ "type": "string",
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
+ }
+ }
+ },
+ "OpenAI.CreateCompletionResponse": {
"type": "object",
"required": [
"id",
- "status",
- "created_at"
+ "choices",
+ "created",
+ "model",
+ "object"
],
"properties": {
"id": {
"type": "string",
- "description": "Server-assigned unique identifier.",
- "readOnly": true
- },
- "inputs": {
- "$ref": "#/components/schemas/EvaluatorGenerationInputs",
- "description": "Caller-supplied inputs."
+ "description": "A unique identifier for the completion."
},
- "result": {
- "$ref": "#/components/schemas/EvaluatorVersion",
- "description": "Result produced on success.",
- "readOnly": true
+ "choices": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateCompletionResponseChoices"
+ },
+ "description": "The list of completion choices the model generated for the input prompt."
},
- "status": {
- "$ref": "#/components/schemas/JobStatus",
- "description": "Current lifecycle status.",
- "readOnly": true
+ "created": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) of when the completion was created."
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error",
- "description": "Error details — populated only on failure.",
- "readOnly": true
+ "model": {
+ "type": "string",
+ "description": "The model used for completion."
},
- "created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).",
- "readOnly": true
+ "system_fingerprint": {
+ "type": "string",
+ "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism."
},
- "finished_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).",
- "readOnly": true
+ "object": {
+ "type": "string",
+ "enum": [
+ "text_completion"
+ ],
+ "description": "The object type, which is always \"text_completion\"",
+ "x-stainless-const": true
},
"usage": {
- "$ref": "#/components/schemas/EvaluatorGenerationTokenUsage",
- "description": "Token consumption summary. Populated when the job reaches a terminal state.",
- "readOnly": true
- }
- },
- "description": "Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluatorGenerationJobCreate": {
- "type": "object",
- "properties": {
- "inputs": {
- "$ref": "#/components/schemas/EvaluatorGenerationInputs",
- "description": "Caller-supplied inputs."
+ "$ref": "#/components/schemas/OpenAI.CompletionUsage"
}
},
- "description": "Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
+ "description": "Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).",
+ "x-oaiMeta": {
+ "name": "The completion object",
+ "legacy": true,
+ "example": "{\n \"id\": \"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7\",\n \"object\": \"text_completion\",\n \"created\": 1589478378,\n \"model\": \"gpt-4-turbo\",\n \"choices\": [\n {\n \"text\": \"\n\nThis is indeed a test\",\n \"index\": 0,\n \"logprobs\": null,\n \"finish_reason\": \"length\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 5,\n \"completion_tokens\": 7,\n \"total_tokens\": 12\n }\n}\n"
}
},
- "EvaluatorGenerationJobSource": {
+ "OpenAI.CreateCompletionResponseChoices": {
"type": "object",
"required": [
- "type"
+ "finish_reason",
+ "index",
+ "logprobs",
+ "text"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/EvaluatorGenerationJobSourceType",
- "description": "The type of source."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "prompt": "#/components/schemas/PromptEvaluatorGenerationJobSource",
- "agent": "#/components/schemas/AgentEvaluatorGenerationJobSource",
- "traces": "#/components/schemas/TracesEvaluatorGenerationJobSource",
- "dataset": "#/components/schemas/DatasetEvaluatorGenerationJobSource"
- }
- },
- "description": "The base source model for evaluator generation jobs. Polymorphic over `type`.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluatorGenerationJobSourceType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "finish_reason": {
"type": "string",
"enum": [
- "prompt",
- "agent",
- "traces",
- "dataset"
+ "stop",
+ "length",
+ "content_filter"
+ ]
+ },
+ "index": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateCompletionResponseChoicesLogprobs"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "text": {
+ "type": "string"
}
- ],
- "description": "The supported source types for evaluator generation jobs.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorGenerationTokenUsage": {
+ "OpenAI.CreateCompletionResponseChoicesLogprobs": {
"type": "object",
- "required": [
- "input_tokens",
- "output_tokens",
- "total_tokens"
- ],
"properties": {
- "input_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Number of input (prompt) tokens consumed."
+ "text_offset": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
},
- "output_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Number of output (completion) tokens generated."
+ "token_logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
},
- "total_tokens": {
- "type": "integer",
- "format": "int64",
- "description": "Total tokens consumed (input + output)."
+ "tokens": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "top_logprobs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ }
}
- },
- "description": "Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorMetric": {
+ "OpenAI.CreateContainerBody": {
"type": "object",
+ "required": [
+ "name"
+ ],
"properties": {
- "type": {
- "$ref": "#/components/schemas/EvaluatorMetricType",
- "description": "Type of the metric."
- },
- "desirable_direction": {
- "$ref": "#/components/schemas/EvaluatorMetricDirection",
- "description": "It indicates whether a higher value is better or a lower value is better for this metric."
- },
- "min_value": {
- "type": "number",
- "format": "float",
- "description": "Minimum value for the metric"
+ "name": {
+ "type": "string",
+ "description": "Name of the container to create."
},
- "max_value": {
- "type": "number",
- "format": "float",
- "description": "Maximum value for the metric. If not specified, it is assumed to be unbounded."
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "IDs of files to copy to the container."
},
- "threshold": {
- "type": "number",
- "format": "float",
- "description": "Default pass/fail threshold for this metric."
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.CreateContainerBodyExpiresAfter",
+ "description": "Container expiration time in seconds relative to the 'anchor' time."
},
- "is_primary": {
- "type": "boolean",
- "description": "Indicates if this metric is primary when there are multiple metrics."
- }
- },
- "description": "Evaluator Metric",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
- }
- },
- "EvaluatorMetricDirection": {
- "anyOf": [
- {
- "type": "string"
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ContainerSkill"
+ },
+ "description": "An optional list of skills referenced by id or inline data."
},
- {
+ "memory_limit": {
"type": "string",
"enum": [
- "increase",
- "decrease",
- "neutral"
- ]
+ "1g",
+ "4g",
+ "16g",
+ "64g"
+ ],
+ "description": "Optional memory limit for the container. Defaults to \"1g\"."
+ },
+ "network_policy": {
+ "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
}
- ],
- "description": "The direction of the metric indicating whether a higher value is better, a lower value is better, or neutral",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorMetricType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "OpenAI.CreateContainerBodyExpiresAfter": {
+ "type": "object",
+ "required": [
+ "anchor",
+ "minutes"
+ ],
+ "properties": {
+ "anchor": {
"type": "string",
"enum": [
- "ordinal",
- "continuous",
- "boolean"
+ "last_active_at"
]
+ },
+ "minutes": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "The type of the evaluator",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorType": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.CreateContainerFileBody": {
+ "type": "object",
+ "properties": {
+ "file_id": {
+ "type": "object",
+ "description": "Name of the file to create."
},
- {
- "type": "string",
- "enum": [
- "builtin",
- "custom"
- ]
+ "file": {
+ "type": "object",
+ "description": "The File object (not file name) to be uploaded."
}
- ],
- "description": "The type of the evaluator",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorVersion": {
+ "OpenAI.CreateConversationBody": {
"type": "object",
- "required": [
- "evaluator_type",
- "categories",
- "definition",
- "created_by",
- "created_at",
- "modified_at",
- "name",
- "version"
- ],
"properties": {
- "display_name": {
- "type": "string",
- "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
- },
"metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Metadata about the evaluator"
- },
- "evaluator_type": {
- "$ref": "#/components/schemas/EvaluatorType",
- "description": "The type of the evaluator"
- },
- "categories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvaluatorCategory"
- },
- "description": "The categories of the evaluator"
- },
- "supported_evaluation_levels": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvaluationLevel"
- },
- "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
- "default": [
- "turn"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
]
},
- "definition": {
- "$ref": "#/components/schemas/EvaluatorDefinition",
- "description": "Definition of the evaluator"
- },
- "generation_artifacts": {
- "$ref": "#/components/schemas/EvaluatorGenerationArtifacts",
- "description": "Provenance artifacts from the generation pipeline. Read-only; present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry Dataset.",
- "readOnly": true
- },
- "created_by": {
- "type": "string",
- "description": "Creator of the evaluator",
- "readOnly": true
- },
- "created_at": {
- "type": "string",
- "description": "Creation date/time of the evaluator",
- "readOnly": true
- },
- "modified_at": {
- "type": "string",
- "description": "Last modified date/time of the evaluator",
- "readOnly": true
- },
- "id": {
- "type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
- },
- "name": {
- "type": "string",
- "description": "The name of the resource",
- "readOnly": true
- },
- "version": {
- "type": "string",
- "description": "The version of the resource",
- "readOnly": true
+ "items": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "Evaluator Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorVersionCreate": {
+ "OpenAI.CreateEmbeddingRequest": {
"type": "object",
"required": [
- "evaluator_type",
- "categories",
- "definition"
+ "input",
+ "model"
],
"properties": {
- "display_name": {
- "type": "string",
- "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
- },
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Metadata about the evaluator"
- },
- "evaluator_type": {
- "$ref": "#/components/schemas/EvaluatorType",
- "description": "The type of the evaluator"
+ "input": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ }
+ ],
+ "description": "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."
},
- "categories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvaluatorCategory"
- },
- "description": "The categories of the evaluator"
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "text-embedding-ada-002",
+ "text-embedding-3-small",
+ "text-embedding-3-large"
+ ]
+ }
+ ],
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.",
+ "x-oaiTypeLabel": "string"
},
- "supported_evaluation_levels": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvaluationLevel"
- },
- "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
- "default": [
- "turn"
- ]
+ "encoding_format": {
+ "type": "string",
+ "enum": [
+ "float",
+ "base64"
+ ],
+ "description": "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).",
+ "default": "float"
},
- "definition": {
- "$ref": "#/components/schemas/EvaluatorDefinition",
- "description": "Definition of the evaluator"
+ "dimensions": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 1,
+ "description": "The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models."
},
- "description": {
+ "user": {
"type": "string",
- "description": "The asset description text."
- },
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
}
- },
- "description": "Evaluator Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "EvaluatorVersionUpdate": {
+ "OpenAI.CreateEmbeddingResponse": {
"type": "object",
+ "required": [
+ "data",
+ "model",
+ "object",
+ "usage"
+ ],
"properties": {
- "display_name": {
- "type": "string",
- "description": "Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique."
- },
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Metadata about the evaluator"
- },
- "categories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvaluatorCategory"
- },
- "description": "The categories of the evaluator"
- },
- "supported_evaluation_levels": {
+ "data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/EvaluationLevel"
+ "$ref": "#/components/schemas/OpenAI.Embedding"
},
- "description": "Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `[\"turn\"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).",
- "default": [
- "turn"
- ]
+ "description": "The list of embeddings generated by the model."
},
- "description": {
+ "model": {
"type": "string",
- "description": "The asset description text."
+ "description": "The name of the model used to generate the embedding."
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "description": "The object type, which is always \"list\".",
+ "x-stainless-const": true
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.CreateEmbeddingResponseUsage",
+ "description": "The usage information for the request."
}
- },
- "description": "Evaluator Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Evaluations=V1Preview"
- ]
}
},
- "ExternalAgentDefinition": {
+ "OpenAI.CreateEmbeddingResponseUsage": {
"type": "object",
"required": [
- "kind"
+ "prompt_tokens",
+ "total_tokens"
],
"properties": {
- "kind": {
- "type": "string",
- "enum": [
- "external"
- ]
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "otel_agent_id": {
- "type": "string",
- "description": "The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry agent.\nSpans must include the attribute `gen_ai.agent.id = ` to appear under this registration.\nDefaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios\nwhere the running external agent already emits a stable id that differs from the Foundry agent name.\nThe resolved value is always echoed on read."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentDefinition"
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS).\nRegistration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations)\nover customer-emitted OpenTelemetry data.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "ExternalAgents=V1Preview"
- ]
}
},
- "FabricDataAgentToolCall": {
+ "OpenAI.CreateEvalCompletionsRunDataSource": {
"type": "object",
"required": [
"type",
- "call_id",
- "arguments",
- "status"
+ "source"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "fabric_dataagent_preview_call"
- ]
+ "completions"
+ ],
+ "description": "The type of run data source. Always `completions`.",
+ "default": "completions"
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "input_messages": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
+ }
+ ],
+ "description": "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."
},
- "arguments": {
+ "sampling_params": {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams"
+ },
+ "model": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool."
+ "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "source": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalStoredCompletionsSource"
+ }
+ ],
+ "description": "Determines what populates the `item` namespace in this run's data source."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "A Fabric data agent tool call."
+ "description": "A CompletionsRunDataSource object describing a model sampling configuration.",
+ "title": "CompletionsRunDataSource",
+ "x-oaiMeta": {
+ "name": "The completions data source object used to configure an individual run",
+ "group": "eval runs",
+ "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"completions\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n"
+ }
},
- "FabricDataAgentToolCallOutput": {
+ "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference": {
"type": "object",
"required": [
"type",
- "call_id",
- "status"
+ "item_reference"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "fabric_dataagent_preview_call_output"
+ "item_reference"
]
},
- "call_id": {
+ "item_reference": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate": {
+ "type": "object",
+ "required": [
+ "type",
+ "template"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
- },
- "output": {
- "$ref": "#/components/schemas/ToolCallOutputContent",
- "description": "The output from the Fabric data agent tool call."
+ "enum": [
+ "template"
+ ]
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "template": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EasyInputMessage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ }
+ ]
+ }
}
- ],
- "description": "The output of a Fabric data agent tool call."
+ }
},
- "FabricDataAgentToolParameters": {
+ "OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams": {
"type": "object",
"properties": {
- "project_connections": {
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "default": 1
+ },
+ "max_completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "top_p": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "default": 1
+ },
+ "seed": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "default": 42
+ },
+ "response_format": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatText"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject"
+ }
+ ]
+ },
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/ToolProjectConnection"
- },
- "maxItems": 1,
- "description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionTool"
+ }
}
- },
- "description": "The fabric data agent tool parameters."
+ }
},
- "FabricIQPreviewTool": {
+ "OpenAI.CreateEvalCustomDataSourceConfig": {
"type": "object",
"required": [
"type",
- "project_connection_id"
+ "item_schema"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "fabric_iq_preview"
+ "custom"
],
- "description": "The object type, which is always 'fabric_iq_preview'."
- },
- "project_connection_id": {
- "type": "string",
- "description": "The ID of the FabricIQ project connection."
+ "description": "The type of data source. Always `custom`.",
+ "x-stainless-const": true,
+ "default": "custom"
},
- "server_label": {
- "type": "string",
- "description": "(Optional) The label of the FabricIQ MCP server to connect to."
+ "item_schema": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The json schema for each row in the data source."
},
- "server_url": {
+ "include_sample_schema": {
+ "type": "boolean",
+ "description": "Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)"
+ }
+ },
+ "description": "A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.\nThis schema is used to define the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run",
+ "title": "CustomDataSourceConfig",
+ "x-oaiMeta": {
+ "name": "The eval file data source config object",
+ "group": "evals",
+ "example": "{\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"}\n },\n \"required\": [\"name\", \"age\"]\n },\n \"include_sample_schema\": true\n}\n"
+ }
+ },
+ "OpenAI.CreateEvalJsonlRunDataSource": {
+ "type": "object",
+ "required": [
+ "type",
+ "source"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "format": "uri",
- "description": "(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used."
+ "enum": [
+ "jsonl"
+ ],
+ "description": "The type of data source. Always `jsonl`.",
+ "x-stainless-const": true,
+ "default": "jsonl"
},
- "require_approval": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
- },
+ "source": {
+ "oneOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
},
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
}
],
- "description": "(Optional) Whether the agent requires approval before executing actions. Default is always.",
- "default": "always"
+ "description": "Determines what populates the `item` namespace in the data source."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
+ "description": "A JsonlRunDataSource object with that specifies a JSONL file that matches the eval",
+ "title": "JsonlRunDataSource",
+ "x-oaiMeta": {
+ "name": "The file data source object for the eval run configuration",
+ "group": "evals",
+ "example": "{\n \"type\": \"jsonl\",\n \"source\": {\n \"type\": \"file_id\",\n \"id\": \"file-9GYS6xbkWgWhmE7VoLUWFg\"\n }\n}\n"
+ }
+ },
+ "OpenAI.CreateEvalLogsDataSourceConfig": {
+ "type": "object",
+ "required": [
+ "type"
],
- "description": "A FabricIQ server-side tool."
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "logs"
+ ],
+ "description": "The type of data source. Always `logs`.",
+ "x-stainless-const": true,
+ "default": "logs"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Metadata filters for the logs data source."
+ }
+ },
+ "description": "A data source config which specifies the metadata property of your logs query.\nThis is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.",
+ "title": "LogsDataSourceConfig",
+ "x-oaiMeta": {
+ "name": "The logs data source object for evals",
+ "group": "evals",
+ "example": "{\n \"type\": \"logs\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n"
+ }
},
- "FabricIQPreviewToolboxTool": {
+ "OpenAI.CreateEvalResponsesRunDataSource": {
"type": "object",
"required": [
"type",
- "project_connection_id"
+ "source"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "fabric_iq_preview"
- ]
+ "responses"
+ ],
+ "description": "The type of run data source. Always `responses`.",
+ "default": "responses"
},
- "project_connection_id": {
- "type": "string",
- "description": "The ID of the FabricIQ project connection."
+ "input_messages": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference"
+ }
+ ],
+ "description": "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."
},
- "server_label": {
- "type": "string",
- "description": "(Optional) The label of the FabricIQ MCP server to connect to."
+ "sampling_params": {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams"
},
- "server_url": {
+ "model": {
"type": "string",
- "format": "uri",
- "description": "(Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used."
+ "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")."
},
- "require_approval": {
- "anyOf": [
+ "source": {
+ "oneOf": [
{
- "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
},
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
},
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.EvalResponsesSource"
}
],
- "description": "(Optional) Whether the agent requires approval before executing actions. Default is always.",
- "default": "always"
+ "description": "Determines what populates the `item` namespace in this run's data source."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/ToolboxTool"
- }
- ],
- "description": "A FabricIQ tool stored in a toolbox."
+ "description": "A ResponsesRunDataSource object describing a model sampling configuration.",
+ "title": "ResponsesRunDataSource",
+ "x-oaiMeta": {
+ "name": "The completions data source object used to configure an individual run",
+ "group": "eval runs",
+ "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"responses\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n"
+ }
},
- "FileDataGenerationJobOutput": {
+ "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference": {
"type": "object",
"required": [
"type",
- "id",
- "filename"
+ "item_reference"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "file"
- ],
- "description": "Azure OpenAI file output."
- },
- "id": {
- "type": "string",
- "description": "The id of the output Azure OpenAI file.",
- "readOnly": true
+ "item_reference"
+ ]
},
- "filename": {
- "type": "string",
- "description": "The filename of the output Azure OpenAI file.",
- "readOnly": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/DataGenerationJobOutput"
+ "item_reference": {
+ "type": "string"
}
- ],
- "description": "Azure OpenAI file output for a data generation job.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "FileDataGenerationJobSource": {
+ "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate": {
"type": "object",
"required": [
"type",
- "id"
+ "template"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "file"
- ],
- "description": "The source type for this job, which is File."
+ "template"
+ ]
},
- "id": {
- "type": "string",
- "description": "Input Azure Open AI file id used for data generation."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/DataGenerationJobSource"
+ "template": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "role": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "role",
+ "content"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ }
+ ]
+ }
}
- ],
- "description": "File source for data generation jobs — Azure OpenAI file input.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "DataGenerationJobs=V1Preview"
- ]
}
},
- "FileDatasetVersion": {
+ "OpenAI.CreateEvalResponsesRunDataSourceSamplingParams": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "uri_file"
- ],
- "description": "Dataset type"
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "default": 1
+ },
+ "max_completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "top_p": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "default": 1
+ },
+ "seed": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "default": 42
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ },
+ "text": {
+ "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText"
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/DatasetVersion"
+ }
+ },
+ "OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
}
- ],
- "description": "FileDatasetVersion Definition"
+ }
},
- "FileDatasetVersionUpdate": {
+ "OpenAI.CreateEvalStoredCompletionsDataSourceConfig": {
"type": "object",
"required": [
"type"
@@ -28520,601 +48336,887 @@
"type": {
"type": "string",
"enum": [
- "uri_file"
+ "stored_completions"
],
- "description": "Dataset type"
+ "description": "The type of data source. Always `stored_completions`.",
+ "x-stainless-const": true,
+ "default": "stored_completions"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "Metadata filters for the stored completions data source."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/DatasetVersionUpdate"
+ "description": "Deprecated in favor of LogsDataSourceConfig.",
+ "title": "StoredCompletionsDataSourceConfig",
+ "deprecated": true,
+ "x-oaiMeta": {
+ "name": "The stored completions data source object for evals",
+ "group": "evals",
+ "example": "{\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n"
+ }
+ },
+ "OpenAI.CreateFileRequest": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "description": "The File object (not file name) to be uploaded."
+ },
+ "purpose": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FilePurpose"
+ }
+ ],
+ "description": "The intended purpose of the uploaded file. One of:\n - `assistants`: Used in the Assistants API\n - `batch`: Used in the Batch API\n - `fine-tune`: Used for fine-tuning\n - `vision`: Images used for vision fine-tuning\n - `user_data`: Flexible file type for any purpose\n - `evals`: Used for eval data sets"
+ },
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.FileExpirationAfter"
}
+ },
+ "required": [
+ "file",
+ "purpose"
+ ]
+ },
+ "OpenAI.CreateFineTuningCheckpointPermissionRequest": {
+ "type": "object",
+ "required": [
+ "project_ids"
],
- "description": "FileDatasetVersion Definition"
+ "properties": {
+ "project_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The project identifiers to grant access to."
+ }
+ }
},
- "FileSearchToolboxTool": {
+ "OpenAI.CreateFineTuningJobRequest": {
"type": "object",
"required": [
- "type"
+ "model",
+ "training_file"
],
"properties": {
- "type": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "babbage-002",
+ "davinci-002",
+ "gpt-3.5-turbo",
+ "gpt-4o-mini"
+ ]
+ }
+ ],
+ "description": "The name of the model to fine-tune. You can select one of the\n [supported models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned).",
+ "x-oaiTypeLabel": "string"
+ },
+ "training_file": {
"type": "string",
- "enum": [
- "file_search"
- ]
+ "description": "The ID of an uploaded file that contains training data.\n See [upload file](/docs/api-reference/files/create) for how to upload a file.\n Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.\n The contents of the file should differ depending on if the model uses the [chat](/docs/api-reference/fine-tuning/chat-input), [completions](/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](/docs/api-reference/fine-tuning/preference-input) format.\n See the [fine-tuning guide](/docs/guides/model-optimization) for more details."
},
- "max_num_results": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive."
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters",
+ "description": "The hyperparameters used for the fine-tuning job.\n This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter.",
+ "deprecated": true
},
- "ranking_options": {
- "$ref": "#/components/schemas/OpenAI.RankingOptions",
- "description": "Ranking options for search."
+ "suffix": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "A string of up to 64 characters that will be added to your fine-tuned model name.\n For example, a `suffix` of \"custom-model-name\" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`."
},
- "filters": {
+ "validation_file": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Filters"
+ "type": "string"
},
{
"type": "null"
}
- ]
+ ],
+ "description": "The ID of an uploaded file that contains validation data.\n If you provide this file, the data is used to generate validation\n metrics periodically during fine-tuning. These metrics can be viewed in\n the fine-tuning results file.\n The same data should not be present in both train and validation files.\n Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.\n See the [fine-tuning guide](/docs/guides/model-optimization) for more details."
},
- "vector_store_ids": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The IDs of the vector stores to search."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/ToolboxTool"
- }
- ],
- "description": "A file search tool stored in a toolbox."
- },
- "FilterStrategyType": {
- "anyOf": [
- {
- "type": "string"
+ "integrations": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "A list of integrations to enable for your fine-tuning job."
},
- {
- "type": "string",
- "enum": [
- "random_sampling",
- "smart_filtering"
+ "seed": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 2147483647,
+ "description": "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.\n If a seed is not specified, one will be generated for you."
+ },
+ "method": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneMethod"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
]
}
- ],
- "description": "Specifies the type of filter strategy used to select traces for evaluation."
+ }
},
- "FixedRatioVersionSelectionRule": {
+ "OpenAI.CreateFineTuningJobRequestHyperparameters": {
"type": "object",
- "required": [
- "type",
- "traffic_percentage"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "FixedRatio"
- ]
+ "batch_size": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "default": "auto"
},
- "traffic_percentage": {
- "type": "integer",
- "format": "int32",
- "minimum": 0,
- "maximum": 100,
- "description": "The percentage of traffic to route to the version. Must be between 0 and 100."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/VersionSelectionRule"
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "default": "auto"
+ },
+ "n_epochs": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "default": "auto"
}
- ]
+ }
},
- "FolderDatasetVersion": {
+ "OpenAI.CreateFineTuningJobRequestIntegrations": {
"type": "object",
"required": [
- "type"
+ "type",
+ "wandb"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "uri_folder"
+ "wandb"
],
- "description": "Dataset type"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/DatasetVersion"
+ "x-stainless-const": true
+ },
+ "wandb": {
+ "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb"
}
- ],
- "description": "FileDatasetVersion Definition"
+ }
},
- "FolderDatasetVersionUpdate": {
+ "OpenAI.CreateFineTuningJobRequestIntegrationsWandb": {
"type": "object",
"required": [
- "type"
+ "project"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "uri_folder"
- ],
- "description": "Dataset type"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/DatasetVersionUpdate"
- }
- ],
- "description": "FileDatasetVersion Definition"
- },
- "FoundryModelArtifactProfileCategory": {
- "anyOf": [
- {
+ "project": {
"type": "string"
},
- {
- "type": "string",
- "enum": [
- "DataOnly",
- "RuntimeDependent",
- "Unknown"
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
- }
- ],
- "description": "The artifact profile category.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
- }
- },
- "FoundryModelArtifactProfileSignal": {
- "anyOf": [
- {
- "type": "string"
},
- {
- "type": "string",
- "enum": [
- "PickleDeserialization",
- "CustomPythonCode",
- "DynamicOps",
- "NativeBinary",
- "UnknownFormat"
+ "entity": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
- }
- ],
- "description": "Signals detected in the model artifact.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
- }
- },
- "FoundryModelSourceType": {
- "anyOf": [
- {
- "type": "string"
},
- {
- "type": "string",
- "enum": [
- "LocalUpload",
- "TrainingJob"
- ]
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
- ],
- "description": "The source type of the model.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "FoundryModelWarning": {
+ "OpenAI.CreateImageEditRequest": {
"type": "object",
"properties": {
- "code": {
- "$ref": "#/components/schemas/FoundryModelWarningCode",
- "description": "The warning code."
+ "image": {
+ "anyOf": [
+ {},
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "contentEncoding": "base64"
+ }
+ }
+ ],
+ "description": "The image(s) to edit. Must be a supported image file or an array of images.\n For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`\n file less than 50MB. You can provide up to 16 images.\n `chatgpt-image-latest` follows the same input constraints as GPT image models.\n For `dall-e-2`, you can only provide one image, and it should be a square\n `png` file less than 4MB."
},
- "message": {
+ "prompt": {
"type": "string",
- "description": "The warning message."
- }
- },
- "description": "A warning associated with a model.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
- }
- },
- "FoundryModelWarningCode": {
- "anyOf": [
- {
- "type": "string"
+ "description": "A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models."
},
- {
- "type": "string",
- "enum": [
- "RuntimeDependentArtifact",
- "UnclassifiedArtifact"
- ]
- }
- ],
- "description": "Warning code for model artifacts.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
- }
- },
- "FoundryModelWeightType": {
- "anyOf": [
- {
- "type": "string"
+ "mask": {
+ "description": "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`."
},
- {
- "type": "string",
- "enum": [
- "FullWeight",
- "LoRA",
- "DraftModel"
- ]
- }
- ],
- "description": "The weight type of the model.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
- }
- },
- "FoundryTimestamp": {
- "type": "integer",
- "format": "unixtime"
- },
- "FunctionToolCall": {
- "type": "object",
- "required": [
- "name",
- "arguments"
- ],
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the function to call."
+ "background": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "transparent",
+ "opaque",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Allows to set transparency for the background of the generated image(s).\n This parameter is only supported for the GPT image models. Must be one of\n `transparent`, `opaque` or `auto` (default value). When `auto` is used, the\n model will automatically determine the best background for the image.\n If `transparent`, the output format needs to support transparency, so it\n should be set to either `png` (default value) or `webp`."
+ },
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "gpt-image-1.5",
+ "dall-e-2",
+ "gpt-image-1",
+ "gpt-image-1-mini",
+ "chatgpt-image-latest"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The model to use for image generation. Defaults to `gpt-image-1.5`.",
+ "x-oaiTypeLabel": "string"
+ },
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The number of images to generate. Must be between 1 and 10."
+ },
+ "size": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "256x256",
+ "512x512",
+ "1024x1024",
+ "1536x1024",
+ "1024x1536",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`."
+ },
+ "response_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "url",
+ "b64_json"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images."
+ },
+ "output_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "png",
+ "jpeg",
+ "webp"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The format in which the generated images are returned. This parameter is\n only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.\n The default value is `png`."
+ },
+ "output_compression": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The compression level (0-100%) for the generated images. This parameter\n is only supported for the GPT image models with the `webp` or `jpeg` output\n formats, and defaults to 100."
},
- "arguments": {
+ "user": {
"type": "string",
- "description": "The arguments to call the function with, as generated by the model in JSON format."
- }
- },
- "description": "Details of a function tool call."
- },
- "GitHubIssueEvent": {
- "anyOf": [
- {
- "type": "string"
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
},
- {
- "type": "string",
- "enum": [
- "opened",
- "closed"
+ "input_fidelity": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFidelity"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Edit the image in streaming mode. Defaults to `false`. See the\n [Image generation guide](/docs/guides/image-generation) for more information."
+ },
+ "partial_images": {
+ "$ref": "#/components/schemas/OpenAI.PartialImages"
+ },
+ "quality": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "standard",
+ "low",
+ "medium",
+ "high",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The quality of the image that will be generated for GPT image models. Defaults to `auto`."
}
- ],
- "description": "Known GitHub issue events that can fire a routine.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
+ },
+ "required": [
+ "image",
+ "prompt"
+ ]
},
- "GitHubIssueRoutineTrigger": {
+ "OpenAI.CreateImageRequest": {
"type": "object",
"required": [
- "type",
- "connection_id",
- "owner",
- "repository",
- "issue_event"
+ "prompt"
],
"properties": {
- "type": {
+ "prompt": {
"type": "string",
- "enum": [
- "github_issue"
+ "description": "A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`."
+ },
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "gpt-image-1.5",
+ "dall-e-2",
+ "dall-e-3",
+ "gpt-image-1",
+ "gpt-image-1-mini"
+ ]
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The trigger type."
+ "description": "The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.",
+ "x-oaiTypeLabel": "string",
+ "default": "dall-e-2"
},
- "connection_id": {
- "type": "string",
- "maxLength": 256,
- "description": "The workspace connection identifier that resolves the GitHub configuration for the trigger."
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 1,
+ "maximum": 10,
+ "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.",
+ "default": 1
},
- "owner": {
- "type": "string",
- "maxLength": 128,
- "description": "The GitHub owner or organization that scopes which issues can fire the trigger."
+ "quality": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "standard",
+ "hd",
+ "low",
+ "medium",
+ "high",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The quality of the image that will be generated.\n - `auto` (default value) will automatically select the best quality for the given model.\n - `high`, `medium` and `low` are supported for the GPT image models.\n - `hd` and `standard` are supported for `dall-e-3`.\n - `standard` is the only option for `dall-e-2`.",
+ "default": "auto"
},
- "repository": {
- "type": "string",
- "maxLength": 128,
- "description": "The GitHub repository filter that scopes which issues can fire the trigger."
+ "response_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "url",
+ "b64_json"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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 the GPT image models, which always return base64-encoded images.",
+ "default": "url"
},
- "issue_event": {
- "$ref": "#/components/schemas/GitHubIssueEvent",
- "description": "The GitHub issue event that fires the routine."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/RoutineTrigger"
+ "output_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "png",
+ "jpeg",
+ "webp"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.",
+ "default": "png"
+ },
+ "output_compression": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100.",
+ "default": 100
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Generate the image in streaming mode. Defaults to `false`. See the\n [Image generation guide](/docs/guides/image-generation) for more information.\n This parameter is only supported for the GPT image models."
+ },
+ "partial_images": {
+ "$ref": "#/components/schemas/OpenAI.PartialImages"
+ },
+ "size": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "1024x1024",
+ "1536x1024",
+ "1024x1536",
+ "256x256",
+ "512x512",
+ "1792x1024",
+ "1024x1792"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.",
+ "default": "auto"
+ },
+ "moderation": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "low",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value).",
+ "default": "auto"
+ },
+ "background": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "transparent",
+ "opaque",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Allows to set transparency for the background of the generated image(s).\n This parameter is only supported for the GPT image models. Must be one of\n `transparent`, `opaque` or `auto` (default value). When `auto` is used, the\n model will automatically determine the best background for the image.\n If `transparent`, the output format needs to support transparency, so it\n should be set to either `png` (default value) or `webp`.",
+ "default": "auto"
+ },
+ "style": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "vivid",
+ "natural"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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.",
+ "default": "vivid"
+ },
+ "user": {
+ "type": "string",
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
}
- ],
- "description": "A GitHub issue routine trigger.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
}
},
- "HeaderTelemetryEndpointAuth": {
+ "OpenAI.CreateImageVariationRequest": {
"type": "object",
- "required": [
- "type",
- "header_name",
- "secret_id",
- "secret_key"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "header"
+ "image": {
+ "description": "The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square."
+ },
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "dall-e-2"
+ ]
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The authentication type, always 'header' for header-based secret authentication."
+ "description": "The model to use for image generation. Only `dall-e-2` is supported at this time.",
+ "x-oaiTypeLabel": "string"
},
- "header_name": {
- "type": "string",
- "description": "The name of the HTTP header to inject the secret value into.",
- "examples": [
- "X-Otlp-Api-Key"
- ]
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The number of images to generate. Must be between 1 and 10."
},
- "secret_id": {
- "type": "string",
- "description": "The identifier of the secret store or connection.",
- "examples": [
- "my-secret-store"
- ]
+ "response_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "url",
+ "b64_json"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
},
- "secret_key": {
+ "size": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "256x256",
+ "512x512",
+ "1024x1024"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`."
+ },
+ "user": {
"type": "string",
- "description": "The key within the secret to retrieve the authentication value.",
- "examples": [
- "OTLP_KEY"
- ]
+ "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids)."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/TelemetryEndpointAuth"
- }
- ],
- "description": "Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header."
+ "required": [
+ "image"
+ ]
},
- "HostedAgentDefinition": {
+ "OpenAI.CreateMessageRequest": {
"type": "object",
"required": [
- "kind",
- "cpu",
- "memory"
+ "role",
+ "content"
],
"properties": {
- "kind": {
+ "role": {
"type": "string",
"enum": [
- "hosted"
- ]
+ "user",
+ "assistant"
+ ],
+ "description": "The role of the entity that is creating the message. Allowed values include:\n - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.\n - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation."
},
- "cpu": {
- "type": "string",
- "description": "The CPU configuration for the hosted agent.",
- "examples": [
- "0.25"
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessageContentImageFileObject"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MessageContentImageUrlObject"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MessageRequestContentTextObject"
+ }
+ ]
+ }
+ }
]
},
- "memory": {
- "type": "string",
- "description": "The memory configuration for the hosted agent.",
- "examples": [
- "0.5Gi"
+ "attachments": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateMessageRequestAttachments"
+ }
+ },
+ {
+ "type": "null"
+ }
]
},
- "environment_variables": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Environment variables to set in the hosted agent container.",
- "examples": [
+ "metadata": {
+ "anyOf": [
{
- "name": "LOG_LEVEL",
- "value": "debug"
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
}
]
+ }
+ }
+ },
+ "OpenAI.CreateMessageRequestAttachments": {
+ "type": "object",
+ "properties": {
+ "file_id": {
+ "type": "string"
},
- "container_configuration": {
- "$ref": "#/components/schemas/ContainerConfiguration",
- "description": "Container-based deployment configuration. Provide this for image-based deployments. Mutually exclusive with code_configuration — the service validates that exactly one is set."
- },
- "protocol_versions": {
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/ProtocolVersionRecord"
- },
- "description": "The protocols that the agent supports for ingress communication.",
- "examples": [
- [
+ "anyOf": [
{
- "protocol": "responses",
- "version": "v0.1.1"
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsCode"
},
{
- "protocol": "a2a",
- "version": "v0.3.0"
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly"
}
]
- ]
- },
- "code_configuration": {
- "$ref": "#/components/schemas/CodeConfiguration",
- "description": "Code-based deployment configuration. Provide this for code-based deployments. Mutually exclusive with container_configuration — the service validates that exactly one is set."
- },
- "telemetry_config": {
- "$ref": "#/components/schemas/TelemetryConfig",
- "description": "Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentDefinition"
- }
- ],
- "description": "The hosted agent definition."
- },
- "HourlyRecurrenceSchedule": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "Hourly"
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/RecurrenceSchedule"
+ }
}
- ],
- "description": "Hourly recurrence schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
}
},
- "HumanEvaluationPreviewRuleAction": {
- "type": "object",
- "required": [
- "type",
- "templateId"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "humanEvaluationPreview"
- ]
- },
- "templateId": {
- "$ref": "#/components/schemas/AssetId",
- "description": "Human evaluation template Id."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluationRuleAction"
- }
- ],
- "description": "Evaluation rule action for human evaluation."
- },
- "HumanEvaluationRuleAction": {
+ "OpenAI.CreateModerationRequest": {
"type": "object",
"required": [
- "type",
- "templateId"
+ "input"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "humanEvaluation"
- ]
+ "input": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequestInput"
+ }
+ }
+ ],
+ "description": "Input (or inputs) to classify. Can be a single string, an array of strings, or\n an array of multi-modal input objects similar to other models."
},
- "templateId": {
- "$ref": "#/components/schemas/AssetId",
- "description": "Human evaluation template Id."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/EvaluationRuleAction"
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "omni-moderation-latest",
+ "omni-moderation-2024-09-26",
+ "text-moderation-latest",
+ "text-moderation-stable"
+ ]
+ }
+ ],
+ "description": "The content moderation model you would like to use. Learn more in\n [the moderation guide](/docs/guides/moderation), and learn about\n available models [here](/docs/models#moderation).",
+ "x-oaiTypeLabel": "string",
+ "default": "omni-moderation-latest"
}
- ],
- "description": "Evaluation rule action for human evaluation."
+ }
},
- "Index": {
+ "OpenAI.CreateModerationRequestInput": {
"type": "object",
"required": [
- "type",
- "name",
- "version"
+ "type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/IndexType",
- "description": "Type of index"
- },
- "id": {
- "type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
- },
- "name": {
- "type": "string",
- "description": "The name of the resource",
- "readOnly": true
- },
- "version": {
- "type": "string",
- "description": "The version of the resource",
- "readOnly": true
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequestInputType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "AzureSearch": "#/components/schemas/AzureAISearchIndex",
- "ManagedAzureSearch": "#/components/schemas/ManagedAzureAISearchIndex",
- "CosmosDBNoSqlVectorStore": "#/components/schemas/CosmosDBIndex"
+ "image_url": "#/components/schemas/OpenAI.ModerationImageURLInput",
+ "text": "#/components/schemas/OpenAI.ModerationTextInput"
}
- },
- "description": "Index resource Definition"
+ }
},
- "IndexType": {
+ "OpenAI.CreateModerationRequestInputType": {
"anyOf": [
{
"type": "string"
@@ -29122,819 +49224,1049 @@
{
"type": "string",
"enum": [
- "AzureSearch",
- "CosmosDBNoSqlVectorStore",
- "ManagedAzureSearch"
+ "image_url",
+ "text"
]
}
]
},
- "IndexUpdate": {
+ "OpenAI.CreateModerationResponse": {
"type": "object",
"required": [
- "type"
+ "id",
+ "model",
+ "results"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/IndexType",
- "description": "Type of index"
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the moderation request."
},
- "description": {
+ "model": {
"type": "string",
- "description": "The asset description text."
+ "description": "The model used to generate the moderation results."
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponseResults"
},
- "description": "Tag dictionary. Tags can be added, removed, and updated."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "AzureSearch": "#/components/schemas/AzureAISearchIndexUpdate",
- "ManagedAzureSearch": "#/components/schemas/ManagedAzureAISearchIndexUpdate",
- "CosmosDBNoSqlVectorStore": "#/components/schemas/CosmosDBIndexUpdate"
- }
- },
- "description": "Index resource Definition"
- },
- "InputData": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "description": "Type of the data"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "dataset": "#/components/schemas/InputDataset"
+ "description": "A list of moderation objects."
}
},
- "description": "Abstract data class."
+ "description": "Represents if a given text input is potentially harmful.",
+ "x-oaiMeta": {
+ "name": "The moderation object",
+ "example": "{\n \"id\": \"modr-0d9740456c391e43c445bf0f010940c7\",\n \"model\": \"omni-moderation-latest\",\n \"results\": [\n {\n \"flagged\": true,\n \"categories\": {\n \"harassment\": true,\n \"harassment/threatening\": true,\n \"sexual\": false,\n \"hate\": false,\n \"hate/threatening\": false,\n \"illicit\": false,\n \"illicit/violent\": false,\n \"self-harm/intent\": false,\n \"self-harm/instructions\": false,\n \"self-harm\": false,\n \"sexual/minors\": false,\n \"violence\": true,\n \"violence/graphic\": true\n },\n \"category_scores\": {\n \"harassment\": 0.8189693396524255,\n \"harassment/threatening\": 0.804985420696006,\n \"sexual\": 1.573112165348997e-6,\n \"hate\": 0.007562942636942845,\n \"hate/threatening\": 0.004208854591835476,\n \"illicit\": 0.030535955153511665,\n \"illicit/violent\": 0.008925306722380033,\n \"self-harm/intent\": 0.00023023930975076432,\n \"self-harm/instructions\": 0.0002293869201073356,\n \"self-harm\": 0.012598046106750154,\n \"sexual/minors\": 2.212566909570261e-8,\n \"violence\": 0.9999992735124786,\n \"violence/graphic\": 0.843064871157054\n },\n \"category_applied_input_types\": {\n \"harassment\": [\n \"text\"\n ],\n \"harassment/threatening\": [\n \"text\"\n ],\n \"sexual\": [\n \"text\",\n \"image\"\n ],\n \"hate\": [\n \"text\"\n ],\n \"hate/threatening\": [\n \"text\"\n ],\n \"illicit\": [\n \"text\"\n ],\n \"illicit/violent\": [\n \"text\"\n ],\n \"self-harm/intent\": [\n \"text\",\n \"image\"\n ],\n \"self-harm/instructions\": [\n \"text\",\n \"image\"\n ],\n \"self-harm\": [\n \"text\",\n \"image\"\n ],\n \"sexual/minors\": [\n \"text\"\n ],\n \"violence\": [\n \"text\",\n \"image\"\n ],\n \"violence/graphic\": [\n \"text\",\n \"image\"\n ]\n }\n }\n ]\n}\n"
+ }
},
- "InputDataset": {
+ "OpenAI.CreateModerationResponseResults": {
"type": "object",
"required": [
- "type",
- "id"
+ "flagged",
+ "categories",
+ "category_scores",
+ "category_applied_input_types"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "dataset"
- ]
+ "flagged": {
+ "type": "boolean"
},
- "id": {
- "type": "string",
- "description": "Evaluation input data"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/InputData"
+ "categories": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponseResultsCategories"
+ },
+ "category_scores": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponseResultsCategoryScores"
+ },
+ "category_applied_input_types": {
+ "$ref": "#/components/schemas/OpenAI.CreateModerationResponseResultsCategoryAppliedInputTypes"
}
- ],
- "description": "Dataset as source for evaluation."
+ }
},
- "Insight": {
+ "OpenAI.CreateModerationResponseResultsCategories": {
"type": "object",
"required": [
- "id",
- "metadata",
- "state",
- "displayName",
- "request"
+ "hate",
+ "hate/threatening",
+ "harassment",
+ "harassment/threatening",
+ "illicit",
+ "illicit/violent",
+ "self-harm",
+ "self-harm/intent",
+ "self-harm/instructions",
+ "sexual",
+ "sexual/minors",
+ "violence",
+ "violence/graphic"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique identifier for the insights report.",
- "readOnly": true
+ "hate": {
+ "type": "boolean"
},
- "metadata": {
- "$ref": "#/components/schemas/InsightsMetadata",
- "description": "Metadata about the insights report.",
- "readOnly": true
+ "hate/threatening": {
+ "type": "boolean"
},
- "state": {
- "$ref": "#/components/schemas/Azure.Core.Foundations.OperationState",
- "description": "The current state of the insights.",
- "readOnly": true
+ "harassment": {
+ "type": "boolean"
},
- "displayName": {
- "type": "string",
- "description": "User friendly display name for the insight."
+ "harassment/threatening": {
+ "type": "boolean"
},
- "request": {
- "$ref": "#/components/schemas/InsightRequest",
- "description": "Request for the insights analysis."
+ "illicit": {
+ "type": "boolean"
},
- "result": {
- "$ref": "#/components/schemas/InsightResult",
- "description": "The result of the insights report.",
- "readOnly": true
+ "illicit/violent": {
+ "type": "boolean"
+ },
+ "self-harm": {
+ "type": "boolean"
+ },
+ "self-harm/intent": {
+ "type": "boolean"
+ },
+ "self-harm/instructions": {
+ "type": "boolean"
+ },
+ "sexual": {
+ "type": "boolean"
+ },
+ "sexual/minors": {
+ "type": "boolean"
+ },
+ "violence": {
+ "type": "boolean"
+ },
+ "violence/graphic": {
+ "type": "boolean"
}
- },
- "description": "The response body for cluster insights.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "InsightCluster": {
+ "OpenAI.CreateModerationResponseResultsCategoryAppliedInputTypes": {
"type": "object",
"required": [
- "id",
- "label",
- "suggestion",
- "suggestionTitle",
- "description",
- "weight"
+ "hate",
+ "hate/threatening",
+ "harassment",
+ "harassment/threatening",
+ "illicit",
+ "illicit/violent",
+ "self-harm",
+ "self-harm/intent",
+ "self-harm/instructions",
+ "sexual",
+ "sexual/minors",
+ "violence",
+ "violence/graphic"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The id of the analysis cluster."
+ "hate": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "label": {
- "type": "string",
- "description": "Label for the cluster"
+ "hate/threatening": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "suggestion": {
- "type": "string",
- "description": "Suggestion for the cluster"
+ "harassment": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "suggestionTitle": {
- "type": "string",
- "description": "The title of the suggestion for the cluster"
+ "harassment/threatening": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "description": {
- "type": "string",
- "description": "Description of the analysis cluster."
+ "illicit": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "weight": {
- "type": "integer",
- "format": "int32",
- "description": "The weight of the analysis cluster. This indicate number of samples in the cluster."
+ "illicit/violent": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
},
- "subClusters": {
- "description": "List of subclusters within this cluster. Empty if no subclusters exist.",
+ "self-harm": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/InsightCluster"
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
}
},
- "samples": {
+ "self-harm/intent": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/InsightSample"
- },
- "description": "List of samples that belong to this cluster. Empty if samples are part of subclusters."
- }
- },
- "description": "A cluster of analysis samples.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "InsightModelConfiguration": {
- "type": "object",
- "required": [
- "modelDeploymentName"
- ],
- "properties": {
- "modelDeploymentName": {
- "type": "string",
- "description": "The model deployment to be evaluated. Accepts either the deployment name alone or with the connection name as '{connectionName}/'."
- }
- },
- "description": "Configuration of the model used in the insight generation.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "InsightRequest": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/InsightType",
- "description": "The type of request."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "EvaluationRunClusterInsight": "#/components/schemas/EvaluationRunClusterInsightRequest",
- "AgentClusterInsight": "#/components/schemas/AgentClusterInsightRequest",
- "EvaluationComparison": "#/components/schemas/EvaluationComparisonInsightRequest"
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
+ },
+ "self-harm/instructions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
+ },
+ "sexual": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
+ },
+ "sexual/minors": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text"
+ ]
+ }
+ },
+ "violence": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
+ },
+ "violence/graphic": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationCategoryInputType"
+ }
}
- },
- "description": "The request of the insights report.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "InsightResult": {
+ "OpenAI.CreateModerationResponseResultsCategoryScores": {
"type": "object",
"required": [
- "type"
+ "hate",
+ "hate/threatening",
+ "harassment",
+ "harassment/threatening",
+ "illicit",
+ "illicit/violent",
+ "self-harm",
+ "self-harm/intent",
+ "self-harm/instructions",
+ "sexual",
+ "sexual/minors",
+ "violence",
+ "violence/graphic"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/InsightType",
- "description": "The type of insights result."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "EvaluationComparison": "#/components/schemas/EvaluationComparisonInsightResult",
- "EvaluationRunClusterInsight": "#/components/schemas/EvaluationRunClusterInsightResult",
- "AgentClusterInsight": "#/components/schemas/AgentClusterInsightResult"
+ "hate": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "hate/threatening": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "harassment": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "harassment/threatening": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "illicit": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "illicit/violent": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "self-harm": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "self-harm/intent": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "self-harm/instructions": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "sexual": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "sexual/minors": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "violence": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "violence/graphic": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
}
- },
- "description": "The result of the insights.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
}
},
- "InsightSample": {
- "type": "object",
- "required": [
- "id",
- "type",
- "features",
- "correlationInfo"
- ],
- "properties": {
- "id": {
- "type": "string",
- "description": "The unique identifier for the analysis sample."
+ "OpenAI.CreateResponseStreamingResponse": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCreatedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseErrorEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFailedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseIncompleteEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseTextDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseQueuedEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseAudioDoneEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent"
},
- "type": {
- "$ref": "#/components/schemas/SampleType",
- "description": "Sample type"
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseCompletedEvent"
},
- "features": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Features to help with additional filtering of data in UX."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseContentPartDoneEvent"
},
- "correlationInfo": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Info about the correlation for the analysis sample."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "EvaluationResultSample": "#/components/schemas/EvaluationResultSample"
- }
- },
- "description": "A sample from the analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "InsightScheduleTask": {
- "type": "object",
- "required": [
- "type",
- "insight"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "Insight"
- ]
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent"
},
- "insight": {
- "$ref": "#/components/schemas/Insight",
- "description": "The insight payload."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/ScheduleTask"
- }
- ],
- "description": "Insight task for the schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
- }
- },
- "InsightSummary": {
- "type": "object",
- "required": [
- "sampleCount",
- "uniqueSubclusterCount",
- "uniqueClusterCount",
- "method",
- "usage"
- ],
- "properties": {
- "sampleCount": {
- "type": "integer",
- "format": "int32",
- "description": "Total number of samples analyzed."
+ "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent"
},
- "uniqueSubclusterCount": {
- "type": "integer",
- "format": "int32",
- "description": "Total number of unique subcluster labels."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseOutputItemDoneEvent"
},
- "uniqueClusterCount": {
- "type": "integer",
- "format": "int32",
- "description": "Total number of unique clusters."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent"
},
- "method": {
- "type": "string",
- "description": "Method used for clustering."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent"
},
- "usage": {
- "$ref": "#/components/schemas/ClusterTokenUsage",
- "description": "Token usage while performing clustering analysis"
- }
- },
- "description": "Summary of the error cluster analysis.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "InsightType": {
- "anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent"
},
{
- "type": "string",
- "enum": [
- "EvaluationRunClusterInsight",
- "AgentClusterInsight",
- "EvaluationComparison"
- ]
- }
- ],
- "description": "The request of the insights.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "InsightsMetadata": {
- "type": "object",
- "required": [
- "createdAt"
- ],
- "properties": {
- "createdAt": {
- "type": "string",
- "format": "date-time",
- "description": "The timestamp when the insights were created."
+ "$ref": "#/components/schemas/OpenAI.ResponseRefusalDoneEvent"
},
- "completedAt": {
- "type": "string",
- "format": "date-time",
- "description": "The timestamp when the insights were completed."
- }
- },
- "description": "Metadata about the insights.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Insights=V1Preview"
- ]
- }
- },
- "InvocationsProtocolConfiguration": {
- "type": "object",
- "description": "Configuration specific to the invocations protocol."
- },
- "InvocationsWsProtocolConfiguration": {
- "type": "object",
- "description": "Configuration specific to the WebSocket-based invocations protocol."
- },
- "InvokeAgentInvocationsApiDispatchPayload": {
- "type": "object",
- "required": [
- "type",
- "input"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "invoke_agent_invocations_api"
- ],
- "description": "The manual dispatch payload type."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseTextDoneEvent"
},
- "input": {
- "description": "The JSON value sent as the complete downstream invocations input. The value is passed through as-is and can be an object, string, number, boolean, array, or null."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/RoutineDispatchPayload"
- }
- ],
- "description": "A manual payload used to test an invocations API routine dispatch.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
- },
- "InvokeAgentInvocationsApiRoutineAction": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "invoke_agent_invocations_api"
- ],
- "description": "The action type."
+ "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent"
},
- "agent_name": {
- "type": "string",
- "maxLength": 256,
- "description": "The project-scoped agent name for routine dispatch."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent"
},
- "agent_endpoint_id": {
- "type": "string",
- "maxLength": 256,
- "description": "Legacy endpoint-scoped agent identifier for routine dispatch."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent"
},
- "input": {
- "description": "Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied."
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent"
},
- "session_id": {
- "type": "string",
- "maxLength": 256,
- "description": "An optional existing hosted-agent session identifier to continue during the downstream dispatch."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/RoutineAction"
- }
- ],
- "description": "Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
- },
- "InvokeAgentResponsesApiDispatchPayload": {
- "type": "object",
- "required": [
- "type",
- "input"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "invoke_agent_responses_api"
- ],
- "description": "The manual dispatch payload type."
+ "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent"
},
- "input": {
- "description": "The JSON value sent as the complete downstream responses input. The value is passed through as-is and can be an object, string, number, boolean, array, or null."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/RoutineDispatchPayload"
+ "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent"
}
- ],
- "description": "A manual payload used to test a responses API routine dispatch.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
+ ]
},
- "InvokeAgentResponsesApiRoutineAction": {
+ "OpenAI.CreateRunRequest": {
"type": "object",
"required": [
- "type"
+ "assistant_id"
],
"properties": {
- "type": {
+ "assistant_id": {
"type": "string",
- "enum": [
- "invoke_agent_responses_api"
+ "description": "The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run."
+ },
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantSupportedModels"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The action type."
+ "description": "The ID of the [Model](/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.",
+ "x-oaiTypeLabel": "string"
},
- "agent_name": {
- "type": "string",
- "maxLength": 256,
- "description": "The project-scoped agent name for routine dispatch."
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "agent_endpoint_id": {
- "type": "string",
- "maxLength": 256,
- "description": "Legacy endpoint-scoped agent identifier for routine dispatch."
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis."
},
- "input": {
- "description": "Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied."
+ "additional_instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
},
- "conversation": {
- "type": "string",
- "maxLength": 256,
- "description": "An optional existing conversation identifier to continue during the downstream dispatch."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/RoutineAction"
- }
- ],
- "description": "Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.",
- "x-ms-foundry-meta": {
- "conditional_previews": [
- "Routines=V1Preview"
- ]
- }
- },
- "ItemGenerationParams": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/ItemGenerationParamsType",
- "description": "The type of item generation parameters to use."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "red_team": "#/components/schemas/RedTeamItemGenerationParams",
- "red_team_seed_prompts": "#/components/schemas/RedTeamSeedPromptsItemGenerationParams",
- "red_team_taxonomy": "#/components/schemas/RedTeamTaxonomyItemGenerationParams",
- "response_retrieval": "#/components/schemas/ResponseRetrievalItemGenerationParams",
- "conversation_gen_preview": "#/components/schemas/ConversationGenPreviewItemGenerationParams",
- "synthetic_data_gen_preview": "#/components/schemas/SyntheticDataGenerationPreviewItemGenerationParams"
- }
- },
- "description": "Represents the set of parameters used to control item generation operations."
- },
- "ItemGenerationParamsType": {
- "anyOf": [
- {
- "type": "string"
+ "additional_messages": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateMessageRequest"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Adds additional messages to the thread before creating the run."
},
- {
- "type": "string",
- "enum": [
- "red_team",
- "response_retrieval",
- "red_team_seed_prompts",
- "red_team_taxonomy",
- "synthetic_data_gen_preview",
- "conversation_gen_preview"
- ]
- }
- ],
- "description": "The types of parameters for red team item generation."
- },
- "JobStatus": {
- "anyOf": [
- {
- "type": "string"
+ "tools": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "maxItems": 20,
+ "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis."
},
- {
- "type": "string",
- "enum": [
- "queued",
- "in_progress",
- "succeeded",
- "failed",
- "cancelled"
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
]
- }
- ],
- "description": "Extensible status values shared by Foundry jobs."
- },
- "LoraConfig": {
- "type": "object",
- "properties": {
- "rank": {
- "type": "integer",
- "format": "int32",
- "description": "LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64."
},
- "alpha": {
- "type": "integer",
- "format": "int32",
- "description": "LoRA scaling factor (α). Positive integer; typically 2× the rank."
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 2,
+ "description": "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.",
+ "default": 1
},
- "targetModules": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from adapter_config.json if omitted."
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 1,
+ "description": "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.\n We generally recommend altering this or temperature but not both.",
+ "default": 1
},
- "dropout": {
- "type": "number",
- "format": "float",
- "description": "Dropout rate used during training. Informational — not used at serving time."
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
+ },
+ "max_prompt_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "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_completion_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "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."
+ },
+ "truncation_strategy": {
+ "$ref": "#/components/schemas/OpenAI.TruncationObject"
+ },
+ "tool_choice": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption"
+ },
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
+ "default": true
+ },
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
}
- },
- "description": "Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "MCPToolboxTool": {
+ "OpenAI.CreateSpeechRequest": {
"type": "object",
"required": [
- "type",
- "server_label"
+ "model",
+ "input",
+ "voice"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp"
- ]
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "tts-1",
+ "tts-1-hd",
+ "gpt-4o-mini-tts",
+ "gpt-4o-mini-tts-2025-12-15"
+ ]
+ }
+ ],
+ "description": "One of the available [TTS models](/docs/models#tts): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.",
+ "x-oaiTypeLabel": "string"
},
- "server_label": {
+ "input": {
"type": "string",
- "description": "A label for this MCP server, used to identify it in tool calls."
+ "maxLength": 4096,
+ "description": "The text to generate audio for. The maximum length is 4096 characters."
},
- "server_url": {
+ "instructions": {
"type": "string",
- "format": "uri",
- "description": "The URL for the MCP server. One of `server_url`, `connector_id`, or\n `tunnel_id` must be provided."
+ "maxLength": 4096,
+ "description": "Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`."
},
- "connector_id": {
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsOrCustomVoice",
+ "description": "The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ \"id\": \"voice_1234\" }`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech#voice-options)."
+ },
+ "response_format": {
"type": "string",
"enum": [
- "connector_dropbox",
- "connector_gmail",
- "connector_googlecalendar",
- "connector_googledrive",
- "connector_microsoftteams",
- "connector_outlookcalendar",
- "connector_outlookemail",
- "connector_sharepoint"
+ "mp3",
+ "opus",
+ "aac",
+ "flac",
+ "wav",
+ "pcm"
],
- "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more\n about service connectors [here](/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`"
+ "description": "The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.",
+ "default": "mp3"
},
- "tunnel_id": {
- "type": "string",
- "pattern": "^tunnel_[a-z0-9]{32}$",
- "description": "The Secure MCP Tunnel ID to use instead of a direct server URL. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided."
+ "speed": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0.25,
+ "maximum": 4,
+ "description": "The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.",
+ "default": 1
},
- "authorization": {
+ "stream_format": {
"type": "string",
- "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here."
- },
- "server_description": {
+ "enum": [
+ "sse",
+ "audio"
+ ],
+ "description": "The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.",
+ "default": "audio"
+ }
+ }
+ },
+ "OpenAI.CreateThreadAndRunRequest": {
+ "type": "object",
+ "required": [
+ "assistant_id"
+ ],
+ "properties": {
+ "assistant_id": {
"type": "string",
- "description": "Optional description of the MCP server, used to provide more context."
+ "description": "The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run."
},
- "headers": {
+ "thread": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequest"
+ },
+ "model": {
"anyOf": [
{
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- }
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "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"
+ ]
},
{
"type": "null"
}
- ]
+ ],
+ "description": "The ID of the [Model](/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.",
+ "x-oaiTypeLabel": "string"
},
- "allowed_tools": {
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis."
+ },
+ "tools": {
"anyOf": [
{
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
}
},
{
- "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ "type": "null"
+ }
+ ],
+ "maxItems": 20,
+ "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis."
+ },
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
},
{
"type": "null"
}
]
},
- "require_approval": {
+ "temperature": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
{
- "type": "string",
- "enum": [
- "always",
- "never"
- ]
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 2,
+ "description": "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.",
+ "default": 1
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
{
"type": "null"
}
],
- "default": "always"
+ "minimum": 0,
+ "maximum": 1,
+ "description": "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.\n We generally recommend altering this or temperature but not both.",
+ "default": 1
},
- "defer_loading": {
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "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."
+ },
+ "max_prompt_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "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_completion_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "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."
+ },
+ "truncation_strategy": {
+ "$ref": "#/components/schemas/OpenAI.TruncationObject"
+ },
+ "tool_choice": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption"
+ },
+ "parallel_tool_calls": {
"type": "boolean",
- "description": "Whether this MCP tool is deferred and discovered via tool search."
+ "description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
+ "default": true
},
- "project_connection_id": {
- "type": "string",
- "description": "The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server."
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/ToolboxTool"
+ }
+ },
+ "OpenAI.CreateThreadAndRunRequestToolResources": {
+ "type": "object",
+ "properties": {
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter"
+ },
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch"
}
- ],
- "description": "An MCP tool stored in a toolbox."
+ }
},
- "ManagedAgentIdentityBlueprint": {
+ "OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter": {
"type": "object",
- "required": [
- "name"
- ],
"properties": {
- "name": {
- "type": "string",
- "readOnly": true
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 20,
+ "default": []
}
}
},
- "ManagedAgentIdentityBlueprintReference": {
+ "OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch": {
"type": "object",
- "required": [
- "type",
- "blueprint_id"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "ManagedAgentIdentityBlueprint"
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 1
+ }
+ }
+ },
+ "OpenAI.CreateThreadRequest": {
+ "type": "object",
+ "properties": {
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateMessageRequest"
+ },
+ "description": "A list of [messages](/docs/api-reference/messages) to start the thread with."
+ },
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResources"
+ },
+ {
+ "type": "null"
+ }
]
},
- "blueprint_id": {
- "type": "string",
- "description": "The ID of the managed blueprint"
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/AgentBlueprintReference"
+ "description": "Options to create a new thread. If no thread is provided when running a\nrequest, an empty thread will be created."
+ },
+ "OpenAI.CreateThreadRequestToolResources": {
+ "type": "object",
+ "properties": {
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesCodeInterpreter"
+ },
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearch"
}
- ]
+ }
},
- "ManagedAzureAISearchIndex": {
+ "OpenAI.CreateThreadRequestToolResourcesCodeInterpreter": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 20
+ }
+ }
+ },
+ "OpenAI.CreateThreadRequestToolResourcesFileSearch": {
+ "type": "object",
+ "properties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 1
+ },
+ "vector_stores": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores"
+ },
+ "maxItems": 1
+ }
+ }
+ },
+ "OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 100000000
+ },
+ "chunking_strategy": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto": {
"type": "object",
"required": [
"type"
@@ -29943,199 +50275,259 @@
"type": {
"type": "string",
"enum": [
- "ManagedAzureSearch"
+ "auto"
],
- "description": "Type of index"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/Index"
+ "x-stainless-const": true
}
- ],
- "description": "Managed Azure AI Search Index Definition"
+ }
},
- "ManagedAzureAISearchIndexUpdate": {
+ "OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic": {
"type": "object",
"required": [
- "type"
+ "type",
+ "static"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "ManagedAzureSearch"
+ "static"
],
- "description": "Type of index"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/IndexUpdate"
+ "x-stainless-const": true
+ },
+ "static": {
+ "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic"
}
- ],
- "description": "Managed Azure AI Search Index Definition"
- },
- "McpProtocolConfiguration": {
- "type": "object",
- "description": "Configuration specific to the MCP protocol."
+ }
},
- "MemoryCommandToolCall": {
+ "OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic": {
"type": "object",
"required": [
- "type",
- "call_id",
- "arguments",
- "status"
+ "max_chunk_size_tokens",
+ "chunk_overlap_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "memory_command_preview_call"
- ]
+ "max_chunk_size_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 100,
+ "maximum": 4096
},
- "call_id": {
+ "chunk_overlap_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.CreateTranscriptionRequest": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "description": "The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.",
+ "x-oaiTypeLabel": "file"
+ },
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "whisper-1",
+ "gpt-4o-transcribe",
+ "gpt-4o-mini-transcribe",
+ "gpt-4o-mini-transcribe-2025-12-15",
+ "gpt-4o-transcribe-diarize"
+ ]
+ }
+ ],
+ "description": "ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`.",
+ "x-oaiTypeLabel": "string"
+ },
+ "language": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "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."
},
- "arguments": {
+ "prompt": {
"type": "string",
- "description": "A JSON string of the arguments to pass to the tool, including `action` (`remember` or `forget`) and `content`."
+ "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.AudioResponseFormat"
+ },
+ "temperature": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "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."
+ },
+ "include": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptionInclude"
+ },
+ "description": "Additional information to include in the transcription response.\n `logprobs` will return the log probabilities of the tokens in the\n response to understand the model's confidence in the transcription.\n `logprobs` only works with response_format set to `json` and only with\n the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`."
+ },
+ "timestamp_granularities": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "word",
+ "segment"
+ ]
+ },
+ "description": "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.\n This option is not available for `gpt-4o-transcribe-diarize`."
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "chunking_strategy": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.VadConfig"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "known_speaker_names": {
+ "$ref": "#/components/schemas/OpenAI.KnownSpeakerNames"
+ },
+ "known_speaker_references": {
+ "$ref": "#/components/schemas/OpenAI.KnownSpeakerReferences"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "A memory command tool call."
+ "required": [
+ "file",
+ "model"
+ ]
},
- "MemoryCommandToolCallOutput": {
+ "OpenAI.CreateTranscriptionResponseDiarizedJson": {
"type": "object",
"required": [
- "type",
- "call_id",
- "status"
+ "task",
+ "duration",
+ "text",
+ "segments"
],
"properties": {
- "type": {
+ "task": {
"type": "string",
"enum": [
- "memory_command_preview_call_output"
- ]
+ "transcribe"
+ ],
+ "description": "The type of task that was run. Always `transcribe`.",
+ "x-stainless-const": true
},
- "call_id": {
+ "duration": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Duration of the input audio in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "text": {
"type": "string",
- "description": "The unique ID of the tool call generated by the model."
+ "description": "The concatenated transcript text for the entire audio input."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "segments": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptionDiarizedSegment"
+ },
+ "description": "Segments of the transcript annotated with timestamps and speaker labels."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "The output of a memory command tool call."
+ "description": "Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.",
+ "x-oaiMeta": {
+ "name": "The transcription object (Diarized JSON)",
+ "group": "audio",
+ "example": "{\n \"task\": \"transcribe\",\n \"duration\": 42.7,\n \"text\": \"Agent: Thanks for calling OpenAI support.\nCustomer: Hi, I need help with diarization.\",\n \"segments\": [\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_001\",\n \"start\": 0.0,\n \"end\": 5.2,\n \"text\": \"Thanks for calling OpenAI support.\",\n \"speaker\": \"agent\"\n },\n {\n \"type\": \"transcript.text.segment\",\n \"id\": \"seg_002\",\n \"start\": 5.2,\n \"end\": 12.8,\n \"text\": \"Hi, I need help with diarization.\",\n \"speaker\": \"A\"\n }\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 43\n }\n}\n"
+ }
},
- "MemoryItem": {
+ "OpenAI.CreateTranscriptionResponseJson": {
"type": "object",
"required": [
- "memory_id",
- "updated_at",
- "scope",
- "content",
- "kind"
+ "text"
],
"properties": {
- "memory_id": {
- "type": "string",
- "description": "The unique ID of the memory item."
- },
- "updated_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The last update time of the memory item."
- },
- "scope": {
+ "text": {
"type": "string",
- "description": "The namespace that logically groups and isolates memories, such as a user ID."
+ "description": "The transcribed text."
},
- "content": {
- "type": "string",
- "description": "The content of the memory."
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonLogprobs"
+ },
+ "description": "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."
},
- "kind": {
- "$ref": "#/components/schemas/MemoryItemKind",
- "description": "The kind of the memory item."
- }
- },
- "discriminator": {
- "propertyName": "kind",
- "mapping": {
- "user_profile": "#/components/schemas/UserProfileMemoryItem",
- "chat_summary": "#/components/schemas/ChatSummaryMemoryItem",
- "procedural": "#/components/schemas/ProceduralMemoryItem"
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage"
}
},
- "description": "A single memory item stored in the memory store, containing content and metadata.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
+ "description": "Represents a transcription response returned by model, based on the provided input.",
+ "x-oaiMeta": {
+ "name": "The transcription object (JSON)",
+ "group": "audio",
+ "example": "{\n \"text\": \"Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.\",\n \"usage\": {\n \"type\": \"tokens\",\n \"input_tokens\": 14,\n \"input_token_details\": {\n \"text_tokens\": 10,\n \"audio_tokens\": 4\n },\n \"output_tokens\": 101,\n \"total_tokens\": 115\n }\n}\n"
}
},
- "MemoryItemKind": {
- "anyOf": [
- {
+ "OpenAI.CreateTranscriptionResponseJsonLogprobs": {
+ "type": "object",
+ "properties": {
+ "token": {
"type": "string"
},
- {
- "type": "string",
- "enum": [
- "user_profile",
- "chat_summary",
- "procedural"
- ]
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "bytes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
}
- ],
- "description": "Memory item kind.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
}
},
- "MemoryOperation": {
+ "OpenAI.CreateTranscriptionResponseJsonUsage": {
"type": "object",
"required": [
- "kind",
- "memory_item"
+ "type"
],
"properties": {
- "kind": {
- "$ref": "#/components/schemas/MemoryOperationKind",
- "description": "The type of memory operation being performed."
- },
- "memory_item": {
- "$ref": "#/components/schemas/MemoryItem",
- "description": "The memory item to create, update, or delete."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsageType"
}
},
- "description": "Represents a single memory operation (create, update, or delete) performed on a memory item.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "duration": "#/components/schemas/OpenAI.TranscriptTextUsageDuration",
+ "tokens": "#/components/schemas/OpenAI.TranscriptTextUsageTokens"
+ }
+ },
+ "description": "Token usage statistics for the request."
},
- "MemoryOperationKind": {
+ "OpenAI.CreateTranscriptionResponseJsonUsageType": {
"anyOf": [
{
"type": "string"
@@ -30143,1410 +50535,1607 @@
{
"type": "string",
"enum": [
- "create",
- "update",
- "delete"
+ "tokens",
+ "duration"
]
}
- ],
- "description": "Memory operation kind.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ ]
},
- "MemorySearchItem": {
+ "OpenAI.CreateTranscriptionResponseVerboseJson": {
"type": "object",
"required": [
- "memory_item"
+ "language",
+ "duration",
+ "text"
],
"properties": {
- "memory_item": {
- "$ref": "#/components/schemas/MemoryItem",
- "description": "Retrieved memory item."
+ "language": {
+ "type": "string",
+ "description": "The language of the input audio."
+ },
+ "duration": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The duration of the input audio.",
+ "x-ms-duration": "seconds"
+ },
+ "text": {
+ "type": "string",
+ "description": "The transcribed text."
+ },
+ "words": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptionWord"
+ },
+ "description": "Extracted words and their corresponding timestamps."
+ },
+ "segments": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptionSegment"
+ },
+ "description": "Segments of the transcribed text and their corresponding details."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptTextUsageDuration"
}
},
- "description": "A retrieved memory item from memory search.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
+ "description": "Represents a verbose json transcription response returned by model, based on the provided input.",
+ "x-oaiMeta": {
+ "name": "The transcription object (Verbose JSON)",
+ "group": "audio",
+ "example": "{\n \"task\": \"transcribe\",\n \"language\": \"english\",\n \"duration\": 8.470000267028809,\n \"text\": \"The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.\",\n \"segments\": [\n {\n \"id\": 0,\n \"seek\": 0,\n \"start\": 0.0,\n \"end\": 3.319999933242798,\n \"text\": \" The beach was a popular spot on a hot summer day.\",\n \"tokens\": [\n 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530\n ],\n \"temperature\": 0.0,\n \"avg_logprob\": -0.2860786020755768,\n \"compression_ratio\": 1.2363636493682861,\n \"no_speech_prob\": 0.00985979475080967\n },\n ...\n ],\n \"usage\": {\n \"type\": \"duration\",\n \"seconds\": 9\n }\n}\n"
}
},
- "MemorySearchOptions": {
+ "OpenAI.CreateTranslationRequest": {
"type": "object",
"properties": {
- "max_memories": {
- "type": "integer",
- "format": "int32",
- "description": "Maximum number of memory items to return."
+ "file": {
+ "description": "The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.",
+ "x-oaiTypeLabel": "file"
+ },
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "whisper-1"
+ ]
+ }
+ ],
+ "description": "ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available.",
+ "x-oaiTypeLabel": "string"
+ },
+ "prompt": {
+ "type": "string",
+ "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should be in English."
+ },
+ "response_format": {
+ "type": "string",
+ "enum": [
+ "json",
+ "text",
+ "srt",
+ "verbose_json",
+ "vtt"
+ ],
+ "description": "The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`."
+ },
+ "temperature": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "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."
}
},
- "description": "Memory search options.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
+ "required": [
+ "file",
+ "model"
+ ]
+ },
+ "OpenAI.CreateTranslationResponseJson": {
+ "type": "object",
+ "required": [
+ "text"
+ ],
+ "properties": {
+ "text": {
+ "type": "string"
+ }
}
},
- "MemorySearchPreviewTool": {
+ "OpenAI.CreateTranslationResponseVerboseJson": {
"type": "object",
"required": [
- "type",
- "memory_store_name",
- "scope"
+ "language",
+ "duration",
+ "text"
],
"properties": {
- "type": {
+ "language": {
"type": "string",
- "enum": [
- "memory_search_preview"
- ],
- "description": "The type of the tool. Always `memory_search_preview`."
+ "description": "The language of the output translation (always `english`)."
},
- "memory_store_name": {
- "type": "string",
- "description": "The name of the memory store to use."
+ "duration": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The duration of the input audio.",
+ "x-ms-duration": "seconds"
},
- "scope": {
+ "text": {
"type": "string",
- "description": "The namespace used to group and isolate memories, such as a user ID.\nLimits which memories can be retrieved or updated.\nUse special variable `{{$userId}}` to scope memories to the current signed-in user."
- },
- "search_options": {
- "$ref": "#/components/schemas/MemorySearchOptions",
- "description": "Options for searching the memory store."
+ "description": "The translated text."
},
- "update_delay": {
- "type": "integer",
- "format": "int32",
- "description": "Time to wait before updating memories after inactivity (seconds). Default 300.",
- "default": 300
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "segments": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptionSegment"
+ },
+ "description": "Segments of the translated text and their corresponding details."
}
- ],
- "description": "A tool for integrating memories into the agent."
+ }
},
- "MemorySearchTool": {
+ "OpenAI.CreateUploadRequest": {
"type": "object",
"required": [
- "type",
- "memory_store_name",
- "scope"
+ "filename",
+ "purpose",
+ "bytes",
+ "mime_type"
],
"properties": {
- "type": {
+ "filename": {
+ "type": "string",
+ "description": "The name of the file to upload."
+ },
+ "purpose": {
"type": "string",
"enum": [
- "memory_search"
+ "assistants",
+ "batch",
+ "fine-tune",
+ "vision"
],
- "description": "The type of the tool. Always `memory_search_preview`."
+ "description": "The intended purpose of the uploaded file.\n See the [documentation on File\n purposes](/docs/api-reference/files/create#files-create-purpose)."
},
- "memory_store_name": {
- "type": "string",
- "description": "The name of the memory store to use."
+ "bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of bytes in the file you are uploading."
},
- "scope": {
+ "mime_type": {
"type": "string",
- "description": "The namespace used to group and isolate memories, such as a user ID.\nLimits which memories can be retrieved or updated.\nUse special variable `{{$userId}}` to scope memories to the current signed-in user."
- },
- "search_options": {
- "$ref": "#/components/schemas/MemorySearchOptions",
- "description": "Options for searching the memory store."
+ "description": "The MIME type of the file.\n This must fall within the supported MIME types for your file purpose. See\n the supported MIME types for assistants and vision."
},
- "update_delay": {
- "type": "integer",
- "format": "int32",
- "description": "Time to wait before updating memories after inactivity (seconds). Default 300.",
- "default": 300
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.FileExpirationAfter"
}
- ],
- "description": "A tool for integrating memories into the agent."
+ }
},
- "MemorySearchToolCall": {
+ "OpenAI.CreateVectorStoreFileBatchRequest": {
"type": "object",
- "required": [
- "type",
- "status"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "memory_search_call"
- ]
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1,
+ "maxItems": 2000,
+ "description": "A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied to all files in the batch. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `files`."
},
- "status": {
- "$ref": "#/components/schemas/ToolCallStatus",
- "description": "The status of the tool call."
+ "files": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileRequest"
+ },
+ "minItems": 1,
+ "maxItems": 2000,
+ "description": "A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must be specified for each file. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `file_ids`."
},
- "memories": {
+ "chunking_strategy": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam"
+ },
+ "attributes": {
"anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MemoryItem"
- }
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
},
{
"type": "null"
}
- ],
- "description": "The results returned from the memory search."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ ]
}
- ],
- "description": "A memory search tool call."
+ }
},
- "MemoryStoreDefaultDefinition": {
+ "OpenAI.CreateVectorStoreFileRequest": {
"type": "object",
"required": [
- "kind",
- "chat_model",
- "embedding_model"
+ "file_id"
],
"properties": {
- "kind": {
- "type": "string",
- "enum": [
- "default"
- ],
- "description": "The kind of the memory store."
- },
- "chat_model": {
+ "file_id": {
"type": "string",
- "description": "The name or identifier of the chat completion model deployment used for memory processing."
+ "description": "A [File](/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. For multi-file ingestion, we recommend [`file_batches`](/docs/api-reference/vector-stores-file-batches/createBatch) to minimize per-vector-store write requests."
},
- "embedding_model": {
- "type": "string",
- "description": "The name or identifier of the embedding model deployment used for memory processing."
+ "chunking_strategy": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam"
},
- "options": {
- "$ref": "#/components/schemas/MemoryStoreDefaultOptions",
- "description": "Default memory store options."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/MemoryStoreDefinition"
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- ],
- "description": "Default memory store implementation.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
}
},
- "MemoryStoreDefaultOptions": {
+ "OpenAI.CreateVectorStoreRequest": {
"type": "object",
- "required": [
- "user_profile_enabled",
- "chat_summary_enabled"
- ],
"properties": {
- "user_profile_enabled": {
- "type": "boolean",
- "description": "Whether to enable user profile extraction and storage. Default is true.",
- "default": true
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 500,
+ "description": "A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files."
},
- "user_profile_details": {
+ "name": {
"type": "string",
- "description": "Specific categories or types of user profile information to extract and store."
+ "description": "The name of the vector store."
},
- "chat_summary_enabled": {
- "type": "boolean",
- "description": "Whether to enable chat summary extraction and storage. Defaults to `true`.",
- "default": true
+ "description": {
+ "type": "string",
+ "description": "A description for the vector store. Can be used to describe the vector store's purpose."
},
- "procedural_memory_enabled": {
- "type": "boolean",
- "description": "Whether to enable procedural memory extraction and storage. The service defaults to `true` if a value is not specified by the caller.",
- "default": true
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter"
},
- "default_ttl_seconds": {
- "type": "integer",
- "format": "int32",
- "description": "The default time-to-live for memories in seconds. A value of `0` indicates that memories do not expire. Defaults to `0`.",
- "default": 0
+ "chunking_strategy": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam",
+ "description": "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."
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "Default memory store configurations.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
}
},
- "MemoryStoreDefinition": {
+ "OpenAI.CreateVideoCharacterBody": {
"type": "object",
- "required": [
- "kind"
- ],
"properties": {
- "kind": {
- "$ref": "#/components/schemas/MemoryStoreKind",
- "description": "The kind of the memory store."
- }
- },
- "discriminator": {
- "propertyName": "kind",
- "mapping": {
- "default": "#/components/schemas/MemoryStoreDefaultDefinition"
+ "video": {
+ "description": "Video file used to create a character."
+ },
+ "name": {
+ "type": "string",
+ "description": "Display name for this API character."
}
},
- "description": "Base definition for memory store configurations.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "required": [
+ "video",
+ "name"
+ ]
},
- "MemoryStoreDeleteScopeResponse": {
+ "OpenAI.CreateVideoEditJsonBody": {
"type": "object",
"required": [
- "object",
- "name",
- "scope",
- "deleted"
+ "video",
+ "prompt"
],
"properties": {
- "object": {
- "type": "string",
- "enum": [
- "memory_store.scope.deleted"
- ],
- "description": "The object type. Always 'memory_store.scope.deleted'."
+ "video": {
+ "$ref": "#/components/schemas/OpenAI.VideoReferenceInputParam",
+ "description": "Reference to the completed video to edit."
},
- "name": {
+ "prompt": {
"type": "string",
- "description": "The name of the memory store."
+ "minLength": 1,
+ "maxLength": 32000,
+ "description": "Text prompt that describes how to edit the source video."
+ }
+ },
+ "description": "JSON parameters for editing an existing generated video.",
+ "title": "Create video edit JSON request"
+ },
+ "OpenAI.CreateVideoEditMultipartBody": {
+ "type": "object",
+ "properties": {
+ "video": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoEditMultipartBodyVideo"
},
- "scope": {
+ "prompt": {
"type": "string",
- "description": "The scope from which memories were deleted."
- },
- "deleted": {
- "type": "boolean",
- "description": "Whether the deletion operation was successful."
+ "description": "Text prompt that describes how to edit the source video."
}
},
- "description": "Response for deleting memories from a scope.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "required": [
+ "video",
+ "prompt"
+ ]
},
- "MemoryStoreKind": {
- "anyOf": [
- {
- "type": "string"
- },
+ "OpenAI.CreateVideoEditMultipartBodyVideo": {
+ "oneOf": [
+ {},
{
- "type": "string",
- "enum": [
- "default"
- ]
+ "$ref": "#/components/schemas/OpenAI.VideoReferenceInputParam"
}
- ],
- "description": "The type of memory store implementation to use.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ ]
},
- "MemoryStoreObject": {
+ "OpenAI.CreateVideoExtendJsonBody": {
"type": "object",
"required": [
- "object",
- "id",
- "created_at",
- "updated_at",
- "name",
- "definition"
+ "video",
+ "prompt",
+ "seconds"
],
"properties": {
- "object": {
- "type": "string",
- "enum": [
- "memory_store"
- ],
- "description": "The object type, which is always 'memory_store'."
+ "video": {
+ "$ref": "#/components/schemas/OpenAI.VideoReferenceInputParam",
+ "description": "Reference to the completed video to extend."
},
- "id": {
+ "prompt": {
"type": "string",
- "description": "The unique identifier of the memory store."
- },
- "created_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The Unix timestamp (seconds) when the memory store was created."
- },
- "updated_at": {
- "$ref": "#/components/schemas/FoundryTimestamp",
- "description": "The Unix timestamp (seconds) when the memory store was last updated."
+ "minLength": 1,
+ "maxLength": 32000,
+ "description": "Updated text prompt that directs the extension generation."
},
- "name": {
- "type": "string",
- "maxLength": 256,
- "description": "The name of the memory store."
+ "seconds": {
+ "$ref": "#/components/schemas/OpenAI.VideoSeconds",
+ "description": "Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20)."
+ }
+ },
+ "description": "JSON parameters for extending an existing generated video.",
+ "title": "Create video extension JSON request"
+ },
+ "OpenAI.CreateVideoExtendMultipartBody": {
+ "type": "object",
+ "properties": {
+ "video": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoExtendMultipartBodyVideo"
},
- "description": {
+ "prompt": {
"type": "string",
- "maxLength": 512,
- "description": "A human-readable description of the memory store."
- },
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Arbitrary key-value metadata to associate with the memory store."
+ "description": "Updated text prompt that directs the extension generation."
},
- "definition": {
- "$ref": "#/components/schemas/MemoryStoreDefinition",
- "description": "The definition of the memory store."
+ "seconds": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoSeconds"
+ }
+ ],
+ "description": "Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20)."
}
},
- "description": "A memory store that can store and retrieve user memories.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "required": [
+ "video",
+ "prompt",
+ "seconds"
+ ]
},
- "MemoryStoreOperationUsage": {
+ "OpenAI.CreateVideoExtendMultipartBodyVideo": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoReferenceInputParam"
+ },
+ {}
+ ]
+ },
+ "OpenAI.CreateVideoMultipartBody": {
"type": "object",
- "required": [
- "embedding_tokens",
- "input_tokens",
- "input_tokens_details",
- "output_tokens",
- "output_tokens_details",
- "total_tokens"
- ],
"properties": {
- "embedding_tokens": {
- "type": "integer",
- "format": "int32",
- "description": "The number of embedding tokens."
- },
- "input_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The number of input tokens."
+ "model": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoModel"
+ }
+ ],
+ "description": "The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to `sora-2`."
},
- "input_tokens_details": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails",
- "description": "A detailed breakdown of the input tokens."
+ "prompt": {
+ "type": "string",
+ "description": "Text prompt that describes the video to generate."
},
- "output_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The number of output tokens."
+ "input_reference": {
+ "$ref": "#/components/schemas/OpenAI.CreateVideoMultipartBodyInputReference"
},
- "output_tokens_details": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails",
- "description": "A detailed breakdown of the output tokens."
+ "seconds": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoSeconds"
+ }
+ ],
+ "description": "Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds."
},
- "total_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The total number of tokens used."
+ "size": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoSize"
+ }
+ ],
+ "description": "Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280."
}
},
- "description": "Usage statistics of a memory store operation.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "required": [
+ "prompt"
+ ]
},
- "MemoryStoreSearchResponse": {
+ "OpenAI.CreateVideoMultipartBodyInputReference": {
+ "oneOf": [
+ {},
+ {
+ "$ref": "#/components/schemas/OpenAI.ImageRefParam"
+ }
+ ]
+ },
+ "OpenAI.CreateVideoRemixBody": {
"type": "object",
+ "properties": {
+ "prompt": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VideoPrompt"
+ }
+ ],
+ "description": "Updated text prompt that directs the remix generation."
+ }
+ },
"required": [
- "search_id",
- "memories",
- "usage"
+ "prompt"
+ ]
+ },
+ "OpenAI.CustomGrammarFormatParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "syntax",
+ "definition"
],
"properties": {
- "search_id": {
+ "type": {
"type": "string",
- "description": "The unique ID of this search request. Use this value as previous_search_id in subsequent requests to perform incremental searches."
+ "enum": [
+ "grammar"
+ ],
+ "description": "Grammar format. Always `grammar`.",
+ "x-stainless-const": true
},
- "memories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MemorySearchItem"
- },
- "description": "Related memory items found during the search operation."
+ "syntax": {
+ "$ref": "#/components/schemas/OpenAI.GrammarSyntax1",
+ "description": "The syntax of the grammar definition. One of `lark` or `regex`."
},
- "usage": {
- "$ref": "#/components/schemas/MemoryStoreOperationUsage",
- "description": "Usage statistics associated with the memory search operation."
+ "definition": {
+ "type": "string",
+ "description": "The grammar definition."
}
},
- "description": "Memory search response.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat"
+ }
+ ],
+ "description": "A grammar defined by the user.",
+ "title": "Grammar format"
},
- "MemoryStoreUpdateCompletedResult": {
+ "OpenAI.CustomTextFormatParam": {
"type": "object",
"required": [
- "memory_operations",
- "usage"
+ "type"
],
"properties": {
- "memory_operations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MemoryOperation"
- },
- "description": "A list of individual memory operations that were performed during the update."
- },
- "usage": {
- "$ref": "#/components/schemas/MemoryStoreOperationUsage",
- "description": "Usage statistics associated with the memory update operation."
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ],
+ "description": "Unconstrained text format. Always `text`.",
+ "x-stainless-const": true
}
},
- "description": "Memory update result.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat"
+ }
+ ],
+ "description": "Unconstrained free-form text.",
+ "title": "Text format"
},
- "MemoryStoreUpdateResponse": {
+ "OpenAI.CustomToolChatCompletions": {
"type": "object",
"required": [
- "update_id",
- "status"
+ "type",
+ "custom"
],
"properties": {
- "update_id": {
- "type": "string",
- "description": "The unique ID of this update request. Use this value as previous_update_id in subsequent requests to perform incremental updates."
- },
- "status": {
- "$ref": "#/components/schemas/MemoryStoreUpdateStatus",
- "description": "The status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", \"failed\", or \"superseded\"."
- },
- "superseded_by": {
+ "type": {
"type": "string",
- "description": "The update_id the operation was superseded by when status is \"superseded\"."
- },
- "result": {
- "$ref": "#/components/schemas/MemoryStoreUpdateCompletedResult",
- "description": "The result of memory store update operation when status is \"completed\"."
+ "enum": [
+ "custom"
+ ],
+ "description": "The type of the custom tool. Always `custom`.",
+ "x-stainless-const": true
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.Error",
- "description": "Error object that describes the error when status is \"failed\"."
+ "custom": {
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustom",
+ "description": "Properties of the custom tool.",
+ "title": "Custom tool properties"
}
},
- "description": "Provides the status of a memory store update operation.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
- },
- "MemoryStoreUpdateStatus": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "queued",
- "in_progress",
- "completed",
- "failed",
- "superseded"
- ]
- }
- ],
- "description": "Status of a memory store update operation.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "MemoryStores=V1Preview"
- ]
- }
+ "description": "A custom tool that processes input using a specified format.",
+ "title": "Custom tool"
},
- "Message": {
+ "OpenAI.CustomToolChatCompletionsCustom": {
"type": "object",
"required": [
- "role"
+ "name"
],
"properties": {
- "role": {
- "anyOf": [
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "format": {
+ "oneOf": [
{
- "type": "string",
- "enum": [
- "system",
- "assistant",
- "developer",
- "user"
- ]
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatText"
},
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammar"
}
- ],
- "description": "The role of the message author. Known values: 'system', 'assistant', 'developer', 'user'."
- }
- },
- "discriminator": {
- "propertyName": "role",
- "mapping": {
- "system": "#/components/schemas/SystemMessage",
- "developer": "#/components/schemas/DeveloperMessage",
- "user": "#/components/schemas/UserMessage",
- "assistant": "#/components/schemas/AssistantMessage"
+ ]
}
- },
- "description": "Abstract base model representing a single message in a conversation."
+ }
},
- "MicrosoftFabricPreviewTool": {
+ "OpenAI.CustomToolChatCompletionsCustomFormatGrammar": {
"type": "object",
"required": [
"type",
- "fabric_dataagent_preview"
+ "grammar"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "fabric_dataagent_preview"
+ "grammar"
],
- "description": "The object type, which is always 'fabric_dataagent_preview'."
+ "x-stainless-const": true
},
- "fabric_dataagent_preview": {
- "$ref": "#/components/schemas/FabricDataAgentToolParameters",
- "description": "The fabric data agent tool parameters."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "grammar": {
+ "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar",
+ "title": "Grammar format"
}
+ }
+ },
+ "OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar": {
+ "type": "object",
+ "required": [
+ "definition",
+ "syntax"
],
- "description": "The input definition information for a Microsoft Fabric tool as used to configure an agent."
+ "properties": {
+ "definition": {
+ "type": "string"
+ },
+ "syntax": {
+ "type": "string",
+ "enum": [
+ "lark",
+ "regex"
+ ]
+ }
+ }
},
- "ModelCredentialRequest": {
+ "OpenAI.CustomToolChatCompletionsCustomFormatText": {
"type": "object",
"required": [
- "blobUri"
+ "type"
],
"properties": {
- "blobUri": {
+ "type": {
"type": "string",
- "format": "uri",
- "description": "Blob URI of the model asset to fetch credentials for."
+ "enum": [
+ "text"
+ ],
+ "x-stainless-const": true
}
- },
- "description": "Request to fetch credentials for a model asset.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "ModelDeployment": {
+ "OpenAI.CustomToolParam": {
"type": "object",
"required": [
"type",
- "modelName",
- "modelVersion",
- "modelPublisher",
- "capabilities",
- "sku"
+ "name"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "ModelDeployment"
+ "custom"
],
- "description": "The type of the deployment"
- },
- "modelName": {
- "type": "string",
- "description": "Publisher-specific name of the deployed model",
- "readOnly": true
+ "description": "The type of the custom tool. Always `custom`.",
+ "x-stainless-const": true
},
- "modelVersion": {
+ "name": {
"type": "string",
- "description": "Publisher-specific version of the deployed model",
- "readOnly": true
+ "description": "The name of the custom tool, used to identify it in tool calls."
},
- "modelPublisher": {
+ "description": {
"type": "string",
- "description": "Name of the deployed model's publisher",
- "readOnly": true
- },
- "capabilities": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Capabilities of deployed model",
- "readOnly": true
+ "description": "Optional description of the custom tool, used to provide more context."
},
- "sku": {
- "$ref": "#/components/schemas/Sku",
- "description": "Sku of the model deployment",
- "readOnly": true
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat",
+ "description": "The input format for the custom tool. Default is unconstrained text."
},
- "connectionName": {
- "type": "string",
- "description": "Name of the connection the deployment comes from",
- "readOnly": true
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this tool should be deferred and discovered via tool search."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/Deployment"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "Model Deployment Definition"
+ "description": "A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)",
+ "title": "Custom tool"
},
- "ModelPendingUploadRequest": {
+ "OpenAI.CustomToolParamFormat": {
"type": "object",
"required": [
- "pendingUploadType"
+ "type"
],
"properties": {
- "pendingUploadId": {
- "type": "string",
- "description": "If PendingUploadId is not provided, a random GUID will be used."
- },
- "connectionName": {
- "type": "string",
- "description": "Azure Storage Account connection name to use for generating temporary SAS token"
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.CustomToolParamFormatType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "text": "#/components/schemas/OpenAI.CustomTextFormatParam",
+ "grammar": "#/components/schemas/OpenAI.CustomGrammarFormatParam"
+ }
+ },
+ "description": "The input format for the custom tool. Default is unconstrained text."
+ },
+ "OpenAI.CustomToolParamFormatType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "pendingUploadType": {
+ {
"type": "string",
"enum": [
- "TemporaryBlobReference"
- ],
- "description": "The type of pending upload. Only TemporaryBlobReference is supported for models."
+ "text",
+ "grammar"
+ ]
}
- },
- "description": "Represents a request for a pending upload of a model version.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
- }
+ ]
},
- "ModelPendingUploadResponse": {
+ "OpenAI.DeleteAssistantResponse": {
"type": "object",
"required": [
- "blobReference",
- "pendingUploadId",
- "pendingUploadType"
+ "id",
+ "deleted",
+ "object"
],
"properties": {
- "blobReference": {
- "$ref": "#/components/schemas/BlobReference",
- "description": "Container-level read, write, list SAS."
- },
- "pendingUploadId": {
- "type": "string",
- "description": "ID for this upload request."
+ "id": {
+ "type": "string"
},
- "version": {
- "type": "string",
- "description": "Version of asset to be created if user did not specify version when initially creating upload"
+ "deleted": {
+ "type": "boolean"
},
- "pendingUploadType": {
+ "object": {
"type": "string",
"enum": [
- "TemporaryBlobReference"
+ "assistant.deleted"
],
- "description": "The type of pending upload. Only TemporaryBlobReference is supported for models."
+ "x-stainless-const": true
}
- },
- "description": "Represents the response for a model pending upload request.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "ModelSamplingParams": {
+ "OpenAI.DeleteFileResponse": {
"type": "object",
+ "required": [
+ "id",
+ "object",
+ "deleted"
+ ],
"properties": {
- "temperature": {
- "type": "number",
- "format": "float",
- "description": "The temperature parameter for sampling. Defaults to 1.0.",
- "default": 1
- },
- "top_p": {
- "type": "number",
- "format": "float",
- "description": "The top-p parameter for nucleus sampling. Defaults to 1.0.",
- "default": 1
+ "id": {
+ "type": "string"
},
- "seed": {
- "type": "integer",
- "format": "int32",
- "description": "The random seed for reproducibility. Defaults to 42.",
- "default": 42
+ "object": {
+ "type": "string",
+ "enum": [
+ "file"
+ ],
+ "x-stainless-const": true
},
- "max_completion_tokens": {
- "type": "integer",
- "format": "int32",
- "description": "The maximum number of tokens allowed in the completion."
+ "deleted": {
+ "type": "boolean"
}
- },
- "description": "Represents a set of parameters used to control the sampling behavior of a language model during text generation."
+ }
},
- "ModelSourceData": {
+ "OpenAI.DeleteFineTuningCheckpointPermissionResponse": {
"type": "object",
+ "required": [
+ "id",
+ "object",
+ "deleted"
+ ],
"properties": {
- "sourceType": {
- "$ref": "#/components/schemas/FoundryModelSourceType",
- "description": "The source type of the model"
+ "id": {
+ "type": "string",
+ "description": "The ID of the fine-tuned model checkpoint permission that was deleted."
},
- "jobId": {
+ "object": {
"type": "string",
- "description": "The job ID that produced this model"
+ "enum": [
+ "checkpoint.permission"
+ ],
+ "description": "The object type, which is always \"checkpoint.permission\".",
+ "x-stainless-const": true
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Whether the fine-tuned model checkpoint permission was successfully deleted."
}
- },
- "description": "Source information for the model",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "ModelVersion": {
+ "OpenAI.DeleteMessageResponse": {
"type": "object",
"required": [
- "blobUri",
- "name",
- "version"
+ "id",
+ "deleted",
+ "object"
],
"properties": {
- "blobUri": {
- "type": "string",
- "format": "uri",
- "description": "URI of the model artifact in blob storage"
- },
- "weightType": {
- "$ref": "#/components/schemas/FoundryModelWeightType",
- "description": "The weight type of the model"
- },
- "baseModel": {
- "type": "string",
- "description": "Base model asset ID"
- },
- "source": {
- "$ref": "#/components/schemas/ModelSourceData",
- "description": "The source of the model"
- },
- "loraConfig": {
- "$ref": "#/components/schemas/LoraConfig",
- "description": "Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided values take precedence over auto-detected values."
- },
- "artifactProfile": {
- "$ref": "#/components/schemas/ArtifactProfile",
- "description": "The artifact profile of the model",
- "readOnly": true
- },
- "warnings": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/FoundryModelWarning"
- },
- "description": "Service-computed advisory warnings derived from the artifact profile.",
- "readOnly": true
- },
"id": {
- "type": "string",
- "description": "Asset ID, a unique identifier for the asset",
- "readOnly": true
+ "type": "string"
},
- "name": {
- "type": "string",
- "description": "The name of the resource",
- "readOnly": true
+ "deleted": {
+ "type": "boolean"
},
- "version": {
+ "object": {
"type": "string",
- "description": "The version of the resource",
- "readOnly": true
+ "enum": [
+ "thread.message.deleted"
+ ],
+ "x-stainless-const": true
+ }
+ }
+ },
+ "OpenAI.DeleteModelResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "deleted",
+ "object"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
},
- "description": {
- "type": "string",
- "description": "The asset description text."
+ "deleted": {
+ "type": "boolean"
},
- "tags": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Tag dictionary. Tags can be added, removed, and updated."
+ "object": {
+ "type": "string"
}
- },
- "description": "Model Version Definition",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Models=V1Preview"
- ]
}
},
- "MonthlyRecurrenceSchedule": {
+ "OpenAI.DeleteThreadResponse": {
"type": "object",
"required": [
- "type",
- "daysOfMonth"
+ "id",
+ "deleted",
+ "object"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string"
+ },
+ "deleted": {
+ "type": "boolean"
+ },
+ "object": {
"type": "string",
"enum": [
- "Monthly"
+ "thread.deleted"
],
- "description": "Monthly recurrence type."
- },
- "daysOfMonth": {
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int32"
- },
- "description": "Days of the month for the recurrence schedule."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/RecurrenceSchedule"
+ "x-stainless-const": true
}
- ],
- "description": "Monthly recurrence schedule.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
}
},
- "NoAuthenticationCredentials": {
+ "OpenAI.DeleteVectorStoreFileResponse": {
"type": "object",
"required": [
- "type"
+ "id",
+ "deleted",
+ "object"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string"
+ },
+ "deleted": {
+ "type": "boolean"
+ },
+ "object": {
"type": "string",
"enum": [
- "None"
+ "vector_store.file.deleted"
],
- "description": "The credential type ",
- "readOnly": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/BaseCredentials"
+ "x-stainless-const": true
}
- ],
- "description": "Credentials that do not require authentication"
+ }
},
- "OAuthConsentRequestOutputItem": {
+ "OpenAI.DeleteVectorStoreResponse": {
"type": "object",
"required": [
"id",
- "type",
- "consent_link",
- "server_label"
+ "deleted",
+ "object"
],
"properties": {
"id": {
"type": "string"
},
- "type": {
- "type": "string",
- "enum": [
- "oauth_consent_request"
- ]
- },
- "consent_link": {
- "type": "string",
- "description": "The link the user can use to perform OAuth consent."
+ "deleted": {
+ "type": "boolean"
},
- "server_label": {
+ "object": {
"type": "string",
- "description": "The server label for the OAuth consent request."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "enum": [
+ "vector_store.deleted"
+ ],
+ "x-stainless-const": true
}
- ],
- "description": "Request from the service for the user to perform OAuth consent."
+ }
},
- "OneTimeTrigger": {
+ "OpenAI.DeletedConversationResource": {
"type": "object",
"required": [
- "type",
- "triggerAt"
+ "object",
+ "deleted",
+ "id"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "OneTime"
- ]
+ "conversation.deleted"
+ ],
+ "x-stainless-const": true,
+ "default": "conversation.deleted"
},
- "triggerAt": {
- "type": "string",
- "description": "Date and time for the one-time trigger in ISO 8601 format."
+ "deleted": {
+ "type": "boolean"
},
- "timeZone": {
- "type": "string",
- "description": "Time zone for the one-time trigger. Defaults to `UTC`.",
- "default": "UTC"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/Trigger"
+ "id": {
+ "type": "string"
}
- ],
- "description": "One-time trigger.",
- "x-ms-foundry-meta": {
- "required_previews": [
- "Schedules=V1Preview"
- ]
}
},
- "OpenAI.Annotation": {
+ "OpenAI.DeletedVideoResource": {
"type": "object",
"required": [
- "type"
+ "object",
+ "deleted",
+ "id"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.AnnotationType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "file_citation": "#/components/schemas/OpenAI.FileCitationBody",
- "url_citation": "#/components/schemas/OpenAI.UrlCitationBody",
- "container_file_citation": "#/components/schemas/OpenAI.ContainerFileCitationBody",
- "file_path": "#/components/schemas/OpenAI.FilePath"
- }
- },
- "description": "An annotation that applies to a span of output text."
- },
- "OpenAI.AnnotationType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "object": {
"type": "string",
"enum": [
- "file_citation",
- "url_citation",
- "container_file_citation",
- "file_path"
- ]
+ "video.deleted"
+ ],
+ "description": "The object type that signals the deletion response.",
+ "x-stainless-const": true,
+ "default": "video.deleted"
+ },
+ "deleted": {
+ "type": "boolean",
+ "description": "Indicates that the video resource was deleted."
+ },
+ "id": {
+ "type": "string",
+ "description": "Identifier of the deleted video."
}
- ]
- },
- "OpenAI.ApplyPatchCallOutputStatus": {
- "type": "string",
- "enum": [
- "completed",
- "failed"
- ]
- },
- "OpenAI.ApplyPatchCallOutputStatusParam": {
- "type": "string",
- "enum": [
- "completed",
- "failed"
- ],
- "description": "Outcome values reported for apply_patch tool call outputs.",
- "title": "Apply patch call output status"
+ },
+ "description": "Confirmation payload returned after deleting a video.",
+ "title": "Deleted video response"
},
- "OpenAI.ApplyPatchCallStatus": {
+ "OpenAI.DetailEnum": {
"type": "string",
"enum": [
- "in_progress",
- "completed"
+ "low",
+ "high",
+ "auto",
+ "original"
]
},
- "OpenAI.ApplyPatchCallStatusParam": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed"
- ],
- "description": "Status values reported for apply_patch tool calls.",
- "title": "Apply patch call status"
- },
- "OpenAI.ApplyPatchCreateFileOperation": {
+ "OpenAI.DoubleClickAction": {
"type": "object",
"required": [
"type",
- "path",
- "diff"
+ "x",
+ "y",
+ "keys"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "create_file"
+ "double_click"
],
- "description": "Create a new file with the provided diff.",
+ "description": "Specifies the event type. For a double click action, this property is always set to `double_click`.",
"x-stainless-const": true
},
- "path": {
- "type": "string",
- "description": "Path of the file to create."
+ "x": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The x-coordinate where the double click occurred."
},
- "diff": {
- "type": "string",
- "description": "Diff to apply."
+ "y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The y-coordinate where the double click occurred."
+ },
+ "keys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "Instruction describing how to create a file via the apply_patch tool.",
- "title": "Apply patch create file operation"
+ "description": "A double click action.",
+ "title": "DoubleClick"
},
- "OpenAI.ApplyPatchCreateFileOperationParam": {
+ "OpenAI.DragParam": {
"type": "object",
"required": [
"type",
- "path",
- "diff"
+ "path"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "create_file"
+ "drag"
],
- "description": "The operation type. Always `create_file`.",
+ "description": "Specifies the event type. For a drag action, this property is always set to `drag`.",
"x-stainless-const": true
},
"path": {
- "type": "string",
- "minLength": 1,
- "description": "Path of the file to create relative to the workspace root."
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.CoordParam"
+ },
+ "description": "An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg\n ```\n [\n { x: 100, y: 200 },\n { x: 200, y: 300 }\n ]\n ```"
},
- "diff": {
- "type": "string",
- "maxLength": 10485760,
- "description": "Unified diff content to apply when creating the file."
+ "keys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "Instruction for creating a new file via the apply_patch tool.",
- "title": "Apply patch create file operation"
+ "description": "A drag action.",
+ "title": "Drag"
},
- "OpenAI.ApplyPatchDeleteFileOperation": {
+ "OpenAI.EasyInputMessage": {
"type": "object",
"required": [
- "type",
- "path"
+ "role",
+ "content",
+ "type"
],
"properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "user",
+ "assistant",
+ "system",
+ "developer"
+ ],
+ "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`."
+ },
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
+ }
+ ],
+ "description": "Text, image, or audio input to the model, used to generate a response.\n Can also contain previous assistant responses."
+ },
+ "phase": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
"type": {
"type": "string",
"enum": [
- "delete_file"
+ "message"
],
- "description": "Delete the specified file.",
+ "description": "The type of the message input. Always `message`.",
"x-stainless-const": true
},
- "path": {
+ "status": {
"type": "string",
- "description": "Path of the file to delete."
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "Instruction describing how to delete a file via the apply_patch tool.",
- "title": "Apply patch delete file operation"
+ "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.",
+ "title": "Input message"
+ },
+ "OpenAI.EditImageBodyJsonParam": {
+ "type": "object",
+ "required": [
+ "images",
+ "prompt"
+ ],
+ "properties": {
+ "model": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "gpt-image-1.5",
+ "gpt-image-1",
+ "gpt-image-1-mini",
+ "chatgpt-image-latest"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The model to use for image editing.",
+ "x-oaiTypeLabel": "string",
+ "default": "gpt-image-1.5"
+ },
+ "images": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ImageRefParam"
+ },
+ "minItems": 1,
+ "maxItems": 16,
+ "description": "Input image references to edit.\n For GPT image models, you can provide up to 16 images."
+ },
+ "mask": {
+ "$ref": "#/components/schemas/OpenAI.ImageRefParam"
+ },
+ "prompt": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32000,
+ "description": "A text description of the desired image edit."
+ },
+ "n": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The number of edited images to generate.",
+ "default": 1
+ },
+ "quality": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Output quality for GPT image models.",
+ "default": "auto"
+ },
+ "input_fidelity": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "high",
+ "low"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Controls fidelity to the original input image(s)."
+ },
+ "size": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "1024x1024",
+ "1536x1024",
+ "1024x1536"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Requested output image size.",
+ "default": "auto"
+ },
+ "user": {
+ "type": "string",
+ "description": "A unique identifier representing your end-user, which can help OpenAI\n monitor and detect abuse."
+ },
+ "output_format": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "png",
+ "jpeg",
+ "webp"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Output image format. Supported for GPT image models.",
+ "default": "png"
+ },
+ "output_compression": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Compression level for `jpeg` or `webp` output."
+ },
+ "moderation": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "low",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Moderation level for GPT image models.",
+ "default": "auto"
+ },
+ "background": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "transparent",
+ "opaque",
+ "auto"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Background behavior for generated image output.",
+ "default": "auto"
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Stream partial image results as events."
+ },
+ "partial_images": {
+ "$ref": "#/components/schemas/OpenAI.PartialImages"
+ }
+ },
+ "description": "JSON request body for image edits.\nUse `images` (array of `ImageRefParam`) instead of multipart `image` uploads.\nYou can reference images via external URLs, data URLs, or uploaded file IDs.\nJSON edits support GPT image models only; DALL-E edits require multipart (`dall-e-2` only)."
},
- "OpenAI.ApplyPatchDeleteFileOperationParam": {
+ "OpenAI.Embedding": {
"type": "object",
"required": [
- "type",
- "path"
+ "index",
+ "embedding",
+ "object"
],
"properties": {
- "type": {
+ "index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the embedding in the list of embeddings."
+ },
+ "embedding": {
+ "type": "array",
+ "items": {
+ "type": "number",
+ "format": "float"
+ },
+ "description": "The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings)."
+ },
+ "object": {
"type": "string",
"enum": [
- "delete_file"
+ "embedding"
],
- "description": "The operation type. Always `delete_file`.",
+ "description": "The object type, which is always \"embedding\".",
"x-stainless-const": true
- },
- "path": {
- "type": "string",
- "minLength": 1,
- "description": "Path of the file to delete relative to the workspace root."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
- }
- ],
- "description": "Instruction for deleting an existing file via the apply_patch tool.",
- "title": "Apply patch delete file operation"
+ "description": "Represents an embedding vector returned by embedding endpoint.",
+ "x-oaiMeta": {
+ "name": "The embedding object",
+ "example": "{\n \"object\": \"embedding\",\n \"embedding\": [\n 0.0023064255,\n -0.009327292,\n .... (1536 floats total for ada-002)\n -0.0028842222,\n ],\n \"index\": 0\n}\n"
+ }
},
- "OpenAI.ApplyPatchFileOperation": {
+ "OpenAI.EmptyModelParam": {
+ "type": "object"
+ },
+ "OpenAI.Error": {
"type": "object",
"required": [
- "type"
+ "code",
+ "message"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperationType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperation",
- "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation",
- "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation"
- }
- },
- "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
- "title": "Apply patch operation"
- },
- "OpenAI.ApplyPatchFileOperationType": {
- "anyOf": [
- {
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "message": {
"type": "string"
},
- {
- "type": "string",
- "enum": [
- "create_file",
- "delete_file",
- "update_file"
+ "param": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "type": {
+ "type": "string"
+ },
+ "details": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Error"
+ }
+ },
+ "additionalInfo": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "debugInfo": {
+ "type": "object",
+ "unevaluatedProperties": {}
}
- ]
+ }
},
- "OpenAI.ApplyPatchOperationParam": {
+ "OpenAI.Error-2": {
"type": "object",
"required": [
- "type"
+ "code",
+ "message"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParamType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperationParam",
- "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperationParam",
- "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperationParam"
- }
- },
- "description": "One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.",
- "title": "Apply patch operation"
- },
- "OpenAI.ApplyPatchOperationParamType": {
- "anyOf": [
- {
- "type": "string"
+ "code": {
+ "type": "string",
+ "description": "A machine-readable error code that was returned."
},
- {
+ "message": {
"type": "string",
- "enum": [
- "create_file",
- "delete_file",
- "update_file"
- ]
+ "description": "A human-readable description of the error that was returned."
}
- ]
+ },
+ "description": "An error that occurred while generating the response.",
+ "title": "Error"
},
- "OpenAI.ApplyPatchToolParam": {
+ "OpenAI.EvalApiError": {
"type": "object",
"required": [
- "type"
+ "code",
+ "message"
],
"properties": {
- "type": {
+ "code": {
"type": "string",
- "enum": [
- "apply_patch"
- ],
- "description": "The type of the tool. Always `apply_patch`.",
- "x-stainless-const": true
+ "description": "The error code."
+ },
+ "message": {
+ "type": "string",
+ "description": "The error message."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "Allows the assistant to create, delete, or update files using unified diffs.",
- "title": "Apply patch tool"
+ "description": "An object representing an error response from the Eval API.",
+ "title": "EvalApiError",
+ "x-oaiMeta": {
+ "name": "The API error object",
+ "group": "evals",
+ "example": "{\n \"code\": \"internal_error\",\n \"message\": \"The eval run failed due to an internal error.\"\n}\n"
+ }
},
- "OpenAI.ApplyPatchUpdateFileOperation": {
+ "OpenAI.EvalGraderLabelModel": {
"type": "object",
"required": [
"type",
- "path",
- "diff"
+ "name",
+ "model",
+ "input",
+ "labels",
+ "passing_labels"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "update_file"
+ "label_model"
],
- "description": "Update an existing file with the provided diff.",
+ "description": "The object type, which is always `label_model`.",
"x-stainless-const": true
},
- "path": {
+ "name": {
"type": "string",
- "description": "Path of the file to update."
+ "description": "The name of the grader."
},
- "diff": {
+ "model": {
"type": "string",
- "description": "Diff to apply."
+ "description": "The model to use for the evaluation. Must support structured outputs."
+ },
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ }
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels to assign to each item in the evaluation."
+ },
+ "passing_labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels that indicate a passing result. Must be a subset of labels."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation"
- }
- ],
- "description": "Instruction describing how to update a file via the apply_patch tool.",
- "title": "Apply patch update file operation"
+ "title": "LabelModelGrader"
},
- "OpenAI.ApplyPatchUpdateFileOperationParam": {
+ "OpenAI.EvalGraderPython": {
"type": "object",
"required": [
"type",
- "path",
- "diff"
+ "name",
+ "source"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "update_file"
+ "python"
],
- "description": "The operation type. Always `update_file`.",
+ "description": "The object type, which is always `python`.",
"x-stainless-const": true
},
- "path": {
+ "name": {
"type": "string",
- "minLength": 1,
- "description": "Path of the file to update relative to the workspace root."
+ "description": "The name of the grader."
},
- "diff": {
+ "source": {
"type": "string",
- "maxLength": 10485760,
- "description": "Unified diff content to apply to the existing file."
+ "description": "The source code of the python script."
+ },
+ "image_tag": {
+ "type": "string",
+ "description": "The image tag to use for the python script."
+ },
+ "pass_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The threshold for the score."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam"
- }
- ],
- "description": "Instruction for updating an existing file via the apply_patch tool.",
- "title": "Apply patch update file operation"
+ "title": "PythonGrader"
},
- "OpenAI.ApproximateLocation": {
+ "OpenAI.EvalGraderScoreModel": {
"type": "object",
"required": [
- "type"
+ "type",
+ "name",
+ "model",
+ "input"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "approximate"
+ "score_model"
],
- "description": "The type of location approximation. Always `approximate`.",
- "x-stainless-const": true,
- "default": "approximate"
+ "description": "The object type, which is always `score_model`.",
+ "x-stainless-const": true
},
- "country": {
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "model": {
+ "type": "string",
+ "description": "The model to use for the evaluation."
+ },
+ "sampling_params": {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams",
+ "description": "The sampling parameters for the model."
+ },
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ },
+ "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings."
+ },
+ "range": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "description": "The range of the score. Defaults to `[0, 1]`."
+ },
+ "pass_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The threshold for the score."
+ }
+ },
+ "title": "ScoreModelGrader"
+ },
+ "OpenAI.EvalGraderScoreModelSamplingParams": {
+ "type": "object",
+ "properties": {
+ "seed": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
]
},
- "region": {
+ "top_p": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
{
"type": "null"
}
]
},
- "city": {
+ "max_completions_tokens": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
]
},
- "timezone": {
+ "reasoning_effort": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
},
{
"type": "null"
@@ -31555,381 +52144,392 @@
}
}
},
- "OpenAI.AutoCodeInterpreterToolParam": {
+ "OpenAI.EvalGraderStringCheck": {
"type": "object",
"required": [
- "type"
+ "type",
+ "name",
+ "input",
+ "reference",
+ "operation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "auto"
+ "string_check"
],
- "description": "Always `auto`.",
+ "description": "The object type, which is always `string_check`.",
+ "x-stainless-const": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "input": {
+ "type": "string",
+ "description": "The input text. This may include template strings."
+ },
+ "reference": {
+ "type": "string",
+ "description": "The reference text. This may include template strings."
+ },
+ "operation": {
+ "type": "string",
+ "enum": [
+ "eq",
+ "ne",
+ "like",
+ "ilike"
+ ],
+ "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
+ }
+ },
+ "title": "StringCheckGrader"
+ },
+ "OpenAI.EvalGraderTextSimilarity": {
+ "type": "object",
+ "required": [
+ "type",
+ "name",
+ "input",
+ "reference",
+ "evaluation_metric",
+ "pass_threshold"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "text_similarity"
+ ],
+ "description": "The type of grader.",
"x-stainless-const": true,
- "default": "auto"
+ "default": "text_similarity"
},
- "file_ids": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "maxItems": 50,
- "description": "An optional list of uploaded files to make available to your code."
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
},
- "memory_limit": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit"
- },
- {
- "type": "null"
- }
- ]
+ "input": {
+ "type": "string",
+ "description": "The text being graded."
},
- "network_policy": {
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
+ "reference": {
+ "type": "string",
+ "description": "The text being graded against."
+ },
+ "evaluation_metric": {
+ "type": "string",
+ "enum": [
+ "cosine",
+ "fuzzy_match",
+ "bleu",
+ "gleu",
+ "meteor",
+ "rouge_1",
+ "rouge_2",
+ "rouge_3",
+ "rouge_4",
+ "rouge_5",
+ "rouge_l"
+ ],
+ "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`."
+ },
+ "pass_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The threshold for the score."
+ }
+ },
+ "title": "TextSimilarityGrader"
+ },
+ "OpenAI.EvalItem": {
+ "type": "object",
+ "required": [
+ "role",
+ "content"
+ ],
+ "properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "user",
+ "assistant",
+ "system",
+ "developer"
+ ],
+ "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`."
+ },
+ "content": {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContent"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "message"
+ ],
+ "description": "The type of the message input. Always `message`.",
+ "x-stainless-const": true
+ }
+ },
+ "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.",
+ "title": "Eval message object"
+ },
+ "OpenAI.EvalItemContent": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItem"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentArray"
+ }
+ ],
+ "description": "Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.",
+ "title": "Eval content"
+ },
+ "OpenAI.EvalItemContentArray": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItem"
+ },
+ "description": "A list of inputs, each of which may be either an input text, output text, input\nimage, or input audio object.",
+ "title": "An array of Input text, Output text, Input image, and Input audio"
+ },
+ "OpenAI.EvalItemContentItem": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentText"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ }
+ ],
+ "description": "A single content item: input text, output text, input image, or input audio.",
+ "title": "Eval content item"
+ },
+ "OpenAI.EvalItemContentItemObject": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObjectType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "output_text": "#/components/schemas/OpenAI.EvalItemContentOutputText",
+ "input_image": "#/components/schemas/OpenAI.EvalItemInputImage",
+ "input_audio": "#/components/schemas/OpenAI.InputAudio",
+ "input_text": "#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent"
}
},
- "description": "Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.",
- "title": "Automatic Code Interpreter Tool Parameters"
+ "description": "A single content item: input text, output text, input image, or input audio.",
+ "title": "Eval content item"
},
- "OpenAI.ChatCompletionTool": {
+ "OpenAI.EvalItemContentItemObjectInputTextContent": {
"type": "object",
"required": [
"type",
- "function"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "function"
+ "input_text"
],
- "description": "The type of the tool. Currently, only `function` is supported.",
- "x-stainless-const": true
+ "description": "The type of the input item. Always `input_text`.",
+ "x-stainless-const": true,
+ "default": "input_text"
},
- "function": {
- "$ref": "#/components/schemas/OpenAI.FunctionObject"
+ "text": {
+ "type": "string",
+ "description": "The text input to the model."
}
},
- "description": "A function tool that can be used to generate a response.",
- "title": "Function tool"
- },
- "OpenAI.ChatModel": {
- "type": "string",
- "enum": [
- "gpt-5.4",
- "gpt-5.4-mini",
- "gpt-5.4-nano",
- "gpt-5.4-mini-2026-03-17",
- "gpt-5.4-nano-2026-03-17",
- "gpt-5.3-chat-latest",
- "gpt-5.2",
- "gpt-5.2-2025-12-11",
- "gpt-5.2-chat-latest",
- "gpt-5.2-pro",
- "gpt-5.2-pro-2025-12-11",
- "gpt-5.1",
- "gpt-5.1-2025-11-13",
- "gpt-5.1-codex",
- "gpt-5.1-mini",
- "gpt-5.1-chat-latest",
- "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-5-chat-latest",
- "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",
- "o4-mini",
- "o4-mini-2025-04-16",
- "o3",
- "o3-2025-04-16",
- "o3-mini",
- "o3-mini-2025-01-31",
- "o1",
- "o1-2024-12-17",
- "o1-preview",
- "o1-preview-2024-09-12",
- "o1-mini",
- "o1-mini-2024-09-12",
- "gpt-4o",
- "gpt-4o-2024-11-20",
- "gpt-4o-2024-08-06",
- "gpt-4o-2024-05-13",
- "gpt-4o-audio-preview",
- "gpt-4o-audio-preview-2024-10-01",
- "gpt-4o-audio-preview-2024-12-17",
- "gpt-4o-audio-preview-2025-06-03",
- "gpt-4o-mini-audio-preview",
- "gpt-4o-mini-audio-preview-2024-12-17",
- "gpt-4o-search-preview",
- "gpt-4o-mini-search-preview",
- "gpt-4o-search-preview-2025-03-11",
- "gpt-4o-mini-search-preview-2025-03-11",
- "chatgpt-4o-latest",
- "codex-mini-latest",
- "gpt-4o-mini",
- "gpt-4o-mini-2024-07-18",
- "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-0301",
- "gpt-3.5-turbo-0613",
- "gpt-3.5-turbo-1106",
- "gpt-3.5-turbo-0125",
- "gpt-3.5-turbo-16k-0613"
- ]
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ }
+ ],
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.ClickButtonType": {
- "type": "string",
- "enum": [
- "left",
- "right",
- "wheel",
- "back",
- "forward"
+ "OpenAI.EvalItemContentItemObjectType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "input_text",
+ "output_text",
+ "input_image",
+ "input_audio"
+ ]
+ }
]
},
- "OpenAI.ClickParam": {
+ "OpenAI.EvalItemContentOutputText": {
"type": "object",
"required": [
"type",
- "button",
- "x",
- "y"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "click"
+ "output_text"
],
- "description": "Specifies the event type. For a click action, this property is always `click`.",
+ "description": "The type of the output text. Always `output_text`.",
"x-stainless-const": true
},
- "button": {
- "$ref": "#/components/schemas/OpenAI.ClickButtonType",
- "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`."
- },
- "x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate where the click occurred."
- },
- "y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate where the click occurred."
- },
- "keys": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "text": {
+ "type": "string",
+ "description": "The text output from the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
}
],
- "description": "A click action.",
- "title": "Click"
+ "description": "A text output from the model.",
+ "title": "Output text"
},
- "OpenAI.CodeInterpreterOutputImage": {
+ "OpenAI.EvalItemContentText": {
+ "type": "string",
+ "description": "A text input to the model.",
+ "title": "Text input"
+ },
+ "OpenAI.EvalItemInputImage": {
"type": "object",
"required": [
"type",
- "url"
+ "image_url"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "image"
+ "input_image"
],
- "description": "The type of the output. Always `image`.",
- "x-stainless-const": true,
- "default": "image"
+ "description": "The type of the image input. Always `input_image`.",
+ "x-stainless-const": true
},
- "url": {
+ "image_url": {
"type": "string",
"format": "uri",
- "description": "The URL of the image output from the code interpreter."
+ "description": "The URL of the image input."
+ },
+ "detail": {
+ "type": "string",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`."
}
},
- "description": "The image output from the code interpreter.",
- "title": "Code interpreter output image"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ }
+ ],
+ "description": "An image input block used within EvalItem content arrays.",
+ "title": "Input image"
},
- "OpenAI.CodeInterpreterOutputLogs": {
+ "OpenAI.EvalJsonlFileContentSource": {
"type": "object",
"required": [
"type",
- "logs"
+ "content"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "logs"
+ "file_content"
],
- "description": "The type of the output. Always `logs`.",
+ "description": "The type of jsonl source. Always `file_content`.",
"x-stainless-const": true,
- "default": "logs"
+ "default": "file_content"
},
- "logs": {
- "type": "string",
- "description": "The logs output from the code interpreter."
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent"
+ },
+ "description": "The content of the jsonl file."
}
},
- "description": "The logs output from the code interpreter.",
- "title": "Code interpreter output logs"
+ "title": "EvalJsonlFileContentSource"
},
- "OpenAI.CodeInterpreterTool": {
+ "OpenAI.EvalJsonlFileContentSourceContent": {
"type": "object",
"required": [
- "type"
+ "item"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "code_interpreter"
- ],
- "description": "The type of the code interpreter tool. Always `code_interpreter`.",
- "x-stainless-const": true
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "tool_configs": {
+ "item": {
"type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "unevaluatedProperties": {}
},
- "container": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.AutoCodeInterpreterToolParam"
- }
- ],
- "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code, along with an\noptional `memory_limit` setting.\nIf not provided, the service assumes auto."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "sample": {
+ "type": "object",
+ "unevaluatedProperties": {}
}
- ],
- "description": "A tool that runs Python code to help generate a response to a prompt.",
- "title": "Code interpreter"
+ }
},
- "OpenAI.CompactResource": {
+ "OpenAI.EvalJsonlFileIdSource": {
"type": "object",
"required": [
- "id",
- "object",
- "output",
- "created_at",
- "usage"
+ "type",
+ "id"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique identifier for the compacted response."
- },
- "object": {
+ "type": {
"type": "string",
"enum": [
- "response.compaction"
+ "file_id"
],
- "description": "The object type. Always `response.compaction`.",
+ "description": "The type of jsonl source. Always `file_id`.",
"x-stainless-const": true,
- "default": "response.compaction"
- },
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ItemField"
- },
- "description": "The compacted list of output items."
- },
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) when the compacted conversation was created."
+ "default": "file_id"
},
- "usage": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsage",
- "description": "Token accounting for the compaction pass, including cached, reasoning, and total tokens."
+ "id": {
+ "type": "string",
+ "description": "The identifier of the file."
}
},
- "title": "The compacted response object"
+ "title": "EvalJsonlFileIdSource"
},
- "OpenAI.CompactResponseMethodPublicBody": {
+ "OpenAI.EvalResponsesSource": {
"type": "object",
"required": [
- "model"
+ "type"
],
"properties": {
- "model": {
- "$ref": "#/components/schemas/OpenAI.ModelIdsCompaction"
+ "type": {
+ "type": "string",
+ "enum": [
+ "responses"
+ ],
+ "description": "The type of run data source. Always `responses`."
},
- "input": {
+ "metadata": {
"anyOf": [
{
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
+ "type": "object",
+ "unevaluatedProperties": {}
},
{
"type": "null"
}
]
},
- "previous_response_id": {
+ "model": {
"anyOf": [
{
"type": "string"
@@ -31939,7 +52539,7 @@
}
]
},
- "instructions": {
+ "instructions_search": {
"anyOf": [
{
"type": "string"
@@ -31949,208 +52549,279 @@
}
]
},
- "prompt_cache_key": {
+ "created_after": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
]
},
- "prompt_cache_retention": {
+ "created_before": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.PromptCacheRetentionEnum"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
]
},
- "service_tier": {
+ "reasoning_effort": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ServiceTierEnum"
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
},
{
"type": "null"
}
- ]
- }
- }
- },
- "OpenAI.ComparisonFilter": {
- "type": "object",
- "required": [
- "type",
- "key",
- "value"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "eq",
- "ne",
- "gt",
- "gte",
- "lt",
- "lte",
- "in",
- "nin"
],
- "description": "Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.\n - `eq`: equals\n - `ne`: not equal\n - `gt`: greater than\n - `gte`: greater than or equal\n - `lt`: less than\n - `lte`: less than or equal\n - `in`: in\n - `nin`: not in",
- "default": "eq"
- },
- "key": {
- "type": "string",
- "description": "The key to compare against the value."
+ "description": "Optional reasoning effort parameter. This is a query parameter used to select responses."
},
- "value": {
- "oneOf": [
+ "temperature": {
+ "anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "top_p": {
+ "anyOf": [
{
"$ref": "#/components/schemas/OpenAI.numeric"
},
{
- "type": "boolean"
+ "type": "null"
+ }
+ ]
+ },
+ "users": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "tools": {
+ "anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ]
+ "type": "string"
}
+ },
+ {
+ "type": "null"
}
- ],
- "description": "The value to compare against the attribute key; supports string, number, or boolean types."
+ ]
+ }
+ },
+ "description": "A EvalResponsesSource object describing a run data source configuration.",
+ "title": "EvalResponsesSource",
+ "x-oaiMeta": {
+ "name": "The run data source object used to configure an individual run",
+ "group": "eval runs",
+ "example": "{\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"temperature\": 0.7,\n \"top_p\": 1.0,\n \"users\": [\"user1\", \"user2\"],\n \"tools\": [\"tool1\", \"tool2\"],\n \"instructions_search\": \"You are a coding assistant\"\n}\n"
+ }
+ },
+ "OpenAI.EvalRunOutputItemSample": {
+ "type": "object",
+ "required": [
+ "input",
+ "output",
+ "finish_reason",
+ "model",
+ "usage",
+ "error",
+ "temperature",
+ "max_completion_tokens",
+ "top_p",
+ "seed"
+ ],
+ "properties": {
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunOutputItemSampleInput"
+ }
+ },
+ "output": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/EvalRunOutputItemSampleOutput"
+ }
+ },
+ "finish_reason": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage"
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.EvalApiError"
+ },
+ "temperature": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "max_completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "top_p": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "seed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.EvalRunOutputItemSampleUsage": {
+ "type": "object",
+ "required": [
+ "total_tokens",
+ "completion_tokens",
+ "prompt_tokens",
+ "cached_tokens"
+ ],
+ "properties": {
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.EvalRunPerModelUsage": {
+ "type": "object",
+ "required": [
+ "model_name",
+ "invocation_count",
+ "prompt_tokens",
+ "completion_tokens",
+ "total_tokens",
+ "cached_tokens"
+ ],
+ "properties": {
+ "model_name": {
+ "type": "string"
+ },
+ "invocation_count": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- },
- "description": "A filter used to compare a specified attribute key to a given value using a defined comparison operation.",
- "title": "Comparison Filter",
- "x-oaiMeta": {
- "name": "ComparisonFilter"
}
},
- "OpenAI.CompoundFilter": {
+ "OpenAI.EvalRunPerTestingCriteriaResults": {
"type": "object",
"required": [
- "type",
- "filters"
+ "testing_criteria",
+ "passed",
+ "failed"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "and",
- "or"
- ],
- "description": "Type of operation: `and` or `or`."
+ "testing_criteria": {
+ "type": "string"
},
- "filters": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
- },
- {}
- ]
- },
- "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`."
+ "passed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "errored": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Number of tests that errored for this criteria."
+ },
+ "skipped": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Number of tests that were skipped for this criteria."
}
- },
- "description": "Combine multiple filters using `and` or `or`.",
- "title": "Compound Filter",
- "x-oaiMeta": {
- "name": "CompoundFilter"
}
},
- "OpenAI.ComputerAction": {
+ "OpenAI.EvalRunResultCounts": {
"type": "object",
"required": [
- "type"
+ "total",
+ "errored",
+ "failed",
+ "passed"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "click": "#/components/schemas/OpenAI.ClickParam",
- "double_click": "#/components/schemas/OpenAI.DoubleClickAction",
- "drag": "#/components/schemas/OpenAI.DragParam",
- "keypress": "#/components/schemas/OpenAI.KeyPressAction",
- "move": "#/components/schemas/OpenAI.MoveParam",
- "screenshot": "#/components/schemas/OpenAI.ScreenshotParam",
- "scroll": "#/components/schemas/OpenAI.ScrollParam",
- "type": "#/components/schemas/OpenAI.TypeParam",
- "wait": "#/components/schemas/OpenAI.WaitParam"
- }
- }
- },
- "OpenAI.ComputerActionList": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- },
- "description": "Flattened batched actions for `computer_use`. Each action includes an\n`type` discriminator and action-specific fields.",
- "title": "Computer Action List"
- },
- "OpenAI.ComputerActionType": {
- "anyOf": [
- {
- "type": "string"
+ "total": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- {
- "type": "string",
- "enum": [
- "click",
- "double_click",
- "drag",
- "keypress",
- "move",
- "screenshot",
- "scroll",
- "type",
- "wait"
- ]
+ "errored": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "passed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "skipped": {
+ "$ref": "#/components/schemas/integer",
+ "description": "Number of output items that were skipped during the evaluation."
}
- ]
+ }
},
- "OpenAI.ComputerCallSafetyCheckParam": {
+ "OpenAI.EvalStoredCompletionsSource": {
"type": "object",
"required": [
- "id"
+ "type"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The ID of the pending safety check."
+ "enum": [
+ "stored_completions"
+ ],
+ "description": "The type of source. Always `stored_completions`.",
+ "x-stainless-const": true,
+ "default": "stored_completions"
},
- "code": {
+ "metadata": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.Metadata"
},
{
"type": "null"
}
]
},
- "message": {
+ "model": {
"anyOf": [
{
"type": "string"
@@ -32159,595 +52830,732 @@
"type": "null"
}
]
- }
- },
- "description": "A pending safety check for the computer call."
- },
- "OpenAI.ComputerEnvironment": {
- "type": "string",
- "enum": [
- "windows",
- "mac",
- "linux",
- "ubuntu",
- "browser"
- ]
- },
- "OpenAI.ComputerScreenshotContent": {
- "type": "object",
- "required": [
- "type",
- "image_url",
- "file_id",
- "detail"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_screenshot"
- ],
- "description": "Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.",
- "x-stainless-const": true
},
- "image_url": {
+ "created_after": {
"anyOf": [
{
- "type": "string",
- "format": "uri"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
]
},
- "file_id": {
+ "created_before": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
]
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
+ "limit": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- }
- ],
- "description": "A screenshot of a computer.",
- "title": "Computer screenshot"
+ "description": "A StoredCompletionsRunDataSource configuration describing a set of filters",
+ "title": "StoredCompletionsRunDataSource",
+ "x-oaiMeta": {
+ "name": "The stored completions data source object used to configure an individual run",
+ "group": "eval runs",
+ "example": "{\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o\",\n \"created_after\": 1668124800,\n \"created_before\": 1668124900,\n \"limit\": 100,\n \"metadata\": {}\n}\n"
+ }
},
- "OpenAI.ComputerScreenshotImage": {
+ "OpenAI.FileCitationBody": {
"type": "object",
"required": [
- "type"
+ "type",
+ "file_id",
+ "index",
+ "filename"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_screenshot"
+ "file_citation"
],
- "description": "Specifies the event type. For a computer screenshot, this property is\n always set to `computer_screenshot`.",
- "x-stainless-const": true,
- "default": "computer_screenshot"
+ "description": "The type of the file citation. Always `file_citation`.",
+ "x-stainless-const": true
},
- "image_url": {
+ "file_id": {
"type": "string",
- "format": "uri",
- "description": "The URL of the screenshot image."
+ "description": "The ID of the file."
},
- "file_id": {
+ "index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the file in the list of files."
+ },
+ "filename": {
"type": "string",
- "description": "The identifier of an uploaded file that contains the screenshot."
+ "description": "The filename of the file cited."
}
},
- "description": "A computer screenshot image used with the computer use tool."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Annotation"
+ }
+ ],
+ "description": "A citation to a file.",
+ "title": "File citation"
},
- "OpenAI.ComputerTool": {
+ "OpenAI.FileExpirationAfter": {
"type": "object",
"required": [
- "type"
+ "anchor",
+ "seconds"
],
"properties": {
- "type": {
+ "anchor": {
"type": "string",
"enum": [
- "computer"
+ "created_at"
],
- "description": "The type of the computer tool. Always `computer`.",
+ "description": "Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`.",
"x-stainless-const": true
+ },
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "minimum": 3600,
+ "maximum": 2592000,
+ "description": "The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days)."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).",
- "title": "Computer"
+ "description": "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.",
+ "title": "File expiration policy"
},
- "OpenAI.ComputerUsePreviewTool": {
+ "OpenAI.FileInputDetail": {
+ "type": "string",
+ "enum": [
+ "low",
+ "high"
+ ]
+ },
+ "OpenAI.FilePath": {
"type": "object",
"required": [
"type",
- "environment",
- "display_width",
- "display_height"
+ "file_id",
+ "index"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_use_preview"
+ "file_path"
],
- "description": "The type of the computer use tool. Always `computer_use_preview`.",
+ "description": "The type of the file path. Always `file_path`.",
"x-stainless-const": true
},
- "environment": {
- "$ref": "#/components/schemas/OpenAI.ComputerEnvironment",
- "description": "The type of computer environment to control."
- },
- "display_width": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The width of the computer display."
+ "file_id": {
+ "type": "string",
+ "description": "The ID of the file."
},
- "display_height": {
+ "index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The height of the computer display."
+ "description": "The index of the file in the list of files."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.Annotation"
}
],
- "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).",
- "title": "Computer use preview"
+ "description": "A path to a file.",
+ "title": "File path"
},
- "OpenAI.ContainerAutoParam": {
+ "OpenAI.FilePurpose": {
+ "type": "string",
+ "enum": [
+ "assistants",
+ "batch",
+ "fine-tune",
+ "vision",
+ "user_data",
+ "evals"
+ ],
+ "description": "The intended purpose of the uploaded file. One of:\n- `assistants`: Used in the Assistants API\n- `batch`: Used in the Batch API\n- `fine-tune`: Used for fine-tuning\n- `vision`: Images used for vision fine-tuning\n- `user_data`: Flexible file type for any purpose\n- `evals`: Used for eval data sets"
+ },
+ "OpenAI.FileSearchRanker": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "default_2024_08_21"
+ ],
+ "description": "The ranker to use for the file search. If not specified will use the `auto` ranker."
+ },
+ "OpenAI.FileSearchRankingOptions": {
"type": "object",
"required": [
- "type"
+ "score_threshold"
+ ],
+ "properties": {
+ "ranker": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchRanker"
+ },
+ "score_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1."
+ }
+ },
+ "description": "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.\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.",
+ "title": "File search tool call ranking options"
+ },
+ "OpenAI.FileSearchTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "vector_store_ids"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "container_auto"
+ "file_search"
],
- "description": "Automatically creates a container for this request",
+ "description": "The type of the file search tool. Always `file_search`.",
"x-stainless-const": true
},
- "file_ids": {
+ "vector_store_ids": {
"type": "array",
"items": {
"type": "string"
},
- "maxItems": 50,
- "description": "An optional list of uploaded files to make available to your code."
+ "description": "The IDs of the vector stores to search."
},
- "memory_limit": {
+ "max_num_results": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive."
+ },
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.RankingOptions",
+ "description": "Ranking options for search."
+ },
+ "filters": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit"
+ "$ref": "#/components/schemas/OpenAI.Filters"
},
{
"type": "null"
}
]
},
- "skills": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ContainerSkill"
- },
- "maxItems": 200,
- "description": "An optional list of skills referenced by id or inline data."
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- "network_policy": {
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
- ]
+ ],
+ "description": "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).",
+ "title": "File search"
},
- "OpenAI.ContainerFileCitationBody": {
+ "OpenAI.FileSearchToolCallResults": {
"type": "object",
- "required": [
- "type",
- "container_id",
- "file_id",
- "start_index",
- "end_index",
- "filename"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "container_file_citation"
- ],
- "description": "The type of the container file citation. Always `container_file_citation`.",
- "x-stainless-const": true
- },
- "container_id": {
- "type": "string",
- "description": "The ID of the container file."
- },
"file_id": {
- "type": "string",
- "description": "The ID of the file."
- },
- "start_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the first character of the container file citation in the message."
+ "type": "string"
},
- "end_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the last character of the container file citation in the message."
+ "text": {
+ "type": "string"
},
"filename": {
- "type": "string",
- "description": "The filename of the container file cited."
+ "type": "string"
+ },
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "score": {
+ "type": "number",
+ "format": "float"
}
- },
- "allOf": [
+ }
+ },
+ "OpenAI.Filters": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Annotation"
+ "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CompoundFilter"
}
- ],
- "description": "A citation for a container file used to generate a model response.",
- "title": "Container file citation"
- },
- "OpenAI.ContainerMemoryLimit": {
- "type": "string",
- "enum": [
- "1g",
- "4g",
- "16g",
- "64g"
]
},
- "OpenAI.ContainerNetworkPolicyAllowlistParam": {
+ "OpenAI.FineTuneDPOHyperparameters": {
"type": "object",
- "required": [
- "type",
- "allowed_domains"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "allowlist"
+ "beta": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.",
+ "default": "auto"
+ },
+ "batch_size": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
+ "default": "auto"
+ },
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
+ "default": "auto"
+ },
+ "n_epochs": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
],
- "description": "Allow outbound network access only to specified domains. Always `allowlist`.",
- "x-stainless-const": true
- },
- "allowed_domains": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "minItems": 1,
- "description": "A list of allowed domains when type is `allowlist`."
+ "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
+ "default": "auto"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
- }
- ]
+ "description": "The hyperparameters used for the DPO fine-tuning job."
},
- "OpenAI.ContainerNetworkPolicyDisabledParam": {
+ "OpenAI.FineTuneDPOMethod": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "disabled"
- ],
- "description": "Disable outbound network access. Always `disabled`.",
- "x-stainless-const": true
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneDPOHyperparameters"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParam"
- }
- ]
+ "description": "Configuration for the DPO fine-tuning method."
},
- "OpenAI.ContainerNetworkPolicyParam": {
+ "OpenAI.FineTuneMethod": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ContainerNetworkPolicyParamType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "disabled": "#/components/schemas/OpenAI.ContainerNetworkPolicyDisabledParam",
- "allowlist": "#/components/schemas/OpenAI.ContainerNetworkPolicyAllowlistParam"
- }
- },
- "description": "Network access policy for the container."
- },
- "OpenAI.ContainerNetworkPolicyParamType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
"type": "string",
"enum": [
- "disabled",
- "allowlist"
- ]
+ "supervised",
+ "dpo",
+ "reinforcement"
+ ],
+ "description": "The type of method. Is either `supervised`, `dpo`, or `reinforcement`."
+ },
+ "supervised": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedMethod"
+ },
+ "dpo": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneDPOMethod"
+ },
+ "reinforcement": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementMethod"
}
- ]
+ },
+ "description": "The method used for fine-tuning."
},
- "OpenAI.ContainerReferenceResource": {
+ "OpenAI.FineTuneReinforcementHyperparameters": {
"type": "object",
- "required": [
- "type",
- "container_id"
- ],
"properties": {
- "type": {
+ "batch_size": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
+ "default": "auto"
+ },
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
+ "default": "auto"
+ },
+ "n_epochs": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
+ "default": "auto"
+ },
+ "reasoning_effort": {
"type": "string",
"enum": [
- "container_reference"
+ "default",
+ "low",
+ "medium",
+ "high"
],
- "description": "The environment type. Always `container_reference`.",
- "x-stainless-const": true
+ "description": "Level of reasoning effort.",
+ "default": "default"
},
- "container_id": {
- "type": "string"
+ "compute_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
+ ],
+ "description": "Multiplier on amount of compute used for exploring search space during training.",
+ "default": "auto"
+ },
+ "eval_interval": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "The number of training steps between evaluation runs.",
+ "default": "auto"
+ },
+ "eval_samples": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "Number of evaluation samples to generate per training step.",
+ "default": "auto"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
- }
- ],
- "description": "Represents a container created with /v1/containers.",
- "title": "Container Reference"
+ "description": "The hyperparameters used for the reinforcement fine-tuning job."
},
- "OpenAI.ContainerSkill": {
+ "OpenAI.FineTuneReinforcementMethod": {
"type": "object",
"required": [
- "type"
+ "grader"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ContainerSkillType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "skill_reference": "#/components/schemas/OpenAI.SkillReferenceParam",
- "inline": "#/components/schemas/OpenAI.InlineSkillParam"
- }
- }
- },
- "OpenAI.ContainerSkillType": {
- "anyOf": [
- {
- "type": "string"
+ "grader": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderMulti"
+ }
+ ],
+ "description": "The grader used for the fine-tuning job."
},
- {
- "type": "string",
- "enum": [
- "skill_reference",
- "inline"
- ]
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters"
}
- ]
+ },
+ "description": "Configuration for the reinforcement fine-tuning method."
},
- "OpenAI.ContextManagementParam": {
+ "OpenAI.FineTuneSupervisedHyperparameters": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "type": "string",
- "description": "The context management entry type. Currently only 'compaction' is supported."
- },
- "compact_threshold": {
- "anyOf": [
+ "batch_size": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
{
"$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
+ "default": "auto"
+ },
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
},
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.numeric"
}
- ]
+ ],
+ "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
+ "default": "auto"
+ },
+ "n_epochs": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ ],
+ "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
+ "default": "auto"
}
- }
+ },
+ "description": "The hyperparameters used for the fine-tuning job."
},
- "OpenAI.ConversationItem": {
+ "OpenAI.FineTuneSupervisedMethod": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ConversationItemType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "message": "#/components/schemas/OpenAI.ConversationItemMessage",
- "function_call": "#/components/schemas/OpenAI.ConversationItemFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutput",
- "file_search_call": "#/components/schemas/OpenAI.ConversationItemFileSearchToolCall",
- "web_search_call": "#/components/schemas/OpenAI.ConversationItemWebSearchToolCall",
- "image_generation_call": "#/components/schemas/OpenAI.ConversationItemImageGenToolCall",
- "computer_call": "#/components/schemas/OpenAI.ConversationItemComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.ConversationItemComputerToolCallOutput",
- "tool_search_call": "#/components/schemas/OpenAI.ConversationItemToolSearchCall",
- "tool_search_output": "#/components/schemas/OpenAI.ConversationItemToolSearchOutput",
- "additional_tools": "#/components/schemas/OpenAI.ConversationItemAdditionalTools",
- "reasoning": "#/components/schemas/OpenAI.ConversationItemReasoningItem",
- "compaction": "#/components/schemas/OpenAI.ConversationItemCompactionBody",
- "code_interpreter_call": "#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.ConversationItemFunctionShellCall",
- "shell_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput",
- "apply_patch_call": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall",
- "apply_patch_call_output": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput",
- "mcp_list_tools": "#/components/schemas/OpenAI.ConversationItemMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource",
- "mcp_call": "#/components/schemas/OpenAI.ConversationItemMcpToolCall",
- "custom_tool_call": "#/components/schemas/OpenAI.ConversationItemCustomToolCallResource",
- "custom_tool_call_output": "#/components/schemas/OpenAI.ConversationItemCustomToolCallOutputResource"
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters"
}
},
- "description": "A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](/docs/api-reference/responses/object#responses/object-output).",
- "title": "Conversation item"
+ "description": "Configuration for the supervised fine-tuning method."
},
- "OpenAI.ConversationItemAdditionalTools": {
+ "OpenAI.FineTuningCheckpointPermission": {
"type": "object",
"required": [
- "type",
"id",
- "role",
- "tools"
+ "created_at",
+ "project_id",
+ "object"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "additional_tools"
- ],
- "description": "The type of the item. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
- },
"id": {
"type": "string",
- "description": "The unique ID of the additional tools item."
+ "description": "The permission identifier, which can be referenced in the API endpoints."
},
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role that provided the additional tools."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the permission was created."
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The additional tool definitions made available at this item."
+ "project_id": {
+ "type": "string",
+ "description": "The project identifier that the permission is for."
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "checkpoint.permission"
+ ],
+ "description": "The object type, which is always \"checkpoint.permission\".",
+ "x-stainless-const": true
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ]
+ "description": "The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.",
+ "title": "FineTuningCheckpointPermission",
+ "x-oaiMeta": {
+ "name": "The fine-tuned model checkpoint permission object",
+ "example": "{\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1712211699,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n}\n"
+ }
},
- "OpenAI.ConversationItemApplyPatchToolCall": {
+ "OpenAI.FineTuningIntegration": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "operation"
+ "wandb"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call"
+ "wandb"
],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
+ "description": "The type of the integration being enabled for the fine-tuning job",
+ "x-stainless-const": true
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "wandb": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningIntegrationWandb",
+ "description": "The settings for your integration with Weights and Biases. This payload specifies the project that\n metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags\n to your run, and set a default entity (team, username, etc) to be associated with your run."
+ }
+ },
+ "title": "Fine-Tuning Job Integration"
+ },
+ "OpenAI.FineTuningIntegrationWandb": {
+ "type": "object",
+ "required": [
+ "project"
+ ],
+ "properties": {
+ "project": {
+ "type": "string"
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
- "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
- "title": "Apply patch operation"
+ "entity": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
- ],
- "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
- "title": "Apply patch tool call"
+ }
},
- "OpenAI.ConversationItemApplyPatchToolCallOutput": {
+ "OpenAI.FineTuningJob": {
"type": "object",
"required": [
- "type",
"id",
- "call_id",
- "status"
+ "created_at",
+ "error",
+ "fine_tuned_model",
+ "finished_at",
+ "hyperparameters",
+ "model",
+ "object",
+ "organization_id",
+ "result_files",
+ "status",
+ "trained_tokens",
+ "training_file",
+ "validation_file",
+ "seed"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "apply_patch_call_output"
- ],
- "description": "The type of the item. Always `apply_patch_call_output`.",
- "x-stainless-const": true,
- "default": "apply_patch_call_output"
- },
"id": {
"type": "string",
- "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
+ "description": "The object identifier, which can be referenced in the API endpoints."
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ "error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobError"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "output": {
+ "fine_tuned_model": {
"anyOf": [
{
"type": "string"
@@ -32757,59 +53565,73 @@
}
]
},
- "created_by": {
+ "finished_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "hyperparameters": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobHyperparameters",
+ "description": "The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs."
+ },
+ "model": {
"type": "string",
- "description": "The ID of the entity that created this tool call output."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "The output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
- },
- "OpenAI.ConversationItemCodeInterpreterToolCall": {
- "type": "object",
- "required": [
- "type",
- "id",
- "status",
- "container_id",
- "code",
- "outputs"
- ],
- "properties": {
- "type": {
+ "description": "The base model that is being fine-tuned."
+ },
+ "object": {
"type": "string",
"enum": [
- "code_interpreter_call"
+ "fine_tuning.job"
],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
- "x-stainless-const": true,
- "default": "code_interpreter_call"
+ "description": "The object type, which is always \"fine_tuning.job\".",
+ "x-stainless-const": true
},
- "id": {
+ "organization_id": {
"type": "string",
- "description": "The unique ID of the code interpreter tool call."
+ "description": "The organization that owns the fine-tuning job."
+ },
+ "result_files": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents)."
},
"status": {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
+ "validating_files",
+ "queued",
+ "running",
+ "succeeded",
+ "failed",
+ "cancelled"
],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
+ "description": "The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`."
},
- "container_id": {
+ "trained_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "training_file": {
"type": "string",
- "description": "The ID of the container used to run the code."
+ "description": "The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents)."
},
- "code": {
+ "validation_file": {
"anyOf": [
{
"type": "string"
@@ -32819,626 +53641,524 @@
}
]
},
- "outputs": {
+ "integrations": {
"anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
+ "$ref": "#/components/schemas/OpenAI.FineTuningIntegration"
}
},
{
"type": "null"
}
]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
- },
- "OpenAI.ConversationItemCompactionBody": {
- "type": "object",
- "required": [
- "type",
- "id",
- "encrypted_content"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "compaction"
- ],
- "description": "The type of the item. Always `compaction`.",
- "x-stainless-const": true,
- "default": "compaction"
},
- "id": {
- "type": "string",
- "description": "The unique ID of the compaction item."
+ "seed": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The seed used for the fine-tuning job."
},
- "encrypted_content": {
- "type": "string",
- "description": "The encrypted content that was produced by compaction."
+ "estimated_finish": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "method": {
+ "$ref": "#/components/schemas/OpenAI.FineTuneMethod"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
+ "description": "The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.",
+ "title": "FineTuningJob",
+ "x-oaiMeta": {
+ "name": "The fine-tuning job object",
+ "example": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n },\n \"metadata\": {\n \"key\": \"value\"\n }\n}\n"
+ }
},
- "OpenAI.ConversationItemComputerToolCall": {
+ "OpenAI.FineTuningJobCheckpoint": {
"type": "object",
"required": [
- "type",
"id",
- "call_id",
- "pending_safety_checks",
- "status"
+ "created_at",
+ "fine_tuned_model_checkpoint",
+ "step_number",
+ "metrics",
+ "fine_tuning_job_id",
+ "object"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_call"
- ],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
- },
"id": {
"type": "string",
- "description": "The unique ID of the computer call."
+ "description": "The checkpoint identifier, which can be referenced in the API endpoints."
},
- "call_id": {
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the checkpoint was created."
+ },
+ "fine_tuned_model_checkpoint": {
"type": "string",
- "description": "An identifier used when responding to the tool call with output."
+ "description": "The name of the fine-tuned checkpoint model that is created."
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "step_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The step number that the checkpoint was created at."
},
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ "metrics": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics",
+ "description": "Metrics at the step number during the fine-tuning job."
},
- "pending_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The pending safety checks for the computer call."
+ "fine_tuning_job_id": {
+ "type": "string",
+ "description": "The name of the fine-tuning job that this checkpoint was created from."
},
- "status": {
+ "object": {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete"
+ "fine_tuning.job.checkpoint"
],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The object type, which is always \"fine_tuning.job.checkpoint\".",
+ "x-stainless-const": true
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
+ "description": "The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.",
+ "title": "FineTuningJobCheckpoint",
+ "x-oaiMeta": {
+ "name": "The fine-tuning job checkpoint object",
+ "example": "{\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P\",\n \"created_at\": 1712211699,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88\",\n \"fine_tuning_job_id\": \"ftjob-fpbNQ3H1GrMehXRf8cO97xTN\",\n \"metrics\": {\n \"step\": 88,\n \"train_loss\": 0.478,\n \"train_mean_token_accuracy\": 0.924,\n \"valid_loss\": 10.112,\n \"valid_mean_token_accuracy\": 0.145,\n \"full_valid_loss\": 0.567,\n \"full_valid_mean_token_accuracy\": 0.944\n },\n \"step_number\": 88\n}\n"
+ }
},
- "OpenAI.ConversationItemComputerToolCallOutput": {
+ "OpenAI.FineTuningJobCheckpointMetrics": {
"type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "output"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_call_output"
- ],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
- "x-stainless-const": true,
- "default": "computer_call_output"
+ "step": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "id": {
- "type": "string",
- "description": "The ID of the computer tool call output.",
- "readOnly": true
+ "train_loss": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "call_id": {
- "type": "string",
- "description": "The ID of the computer tool call that produced the output."
+ "train_mean_token_accuracy": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "acknowledged_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
+ "valid_loss": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "valid_mean_token_accuracy": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "full_valid_loss": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "full_valid_mean_token_accuracy": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
}
- ],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ }
},
- "OpenAI.ConversationItemCustomToolCallOutputResource": {
+ "OpenAI.FineTuningJobError": {
"type": "object",
"required": [
- "type",
- "call_id",
- "output",
- "status"
+ "code",
+ "message",
+ "param"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "custom_tool_call_output"
- ],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
+ "code": {
+ "type": "string"
},
- "call_id": {
- "type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ "message": {
+ "type": "string"
},
- "output": {
- "oneOf": [
+ "param": {
+ "anyOf": [
{
"type": "string"
},
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
+ "type": "null"
}
- ],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- },
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ ]
}
- ],
- "title": "ResponseCustomToolCallOutputItem"
+ }
},
- "OpenAI.ConversationItemCustomToolCallResource": {
+ "OpenAI.FineTuningJobEvent": {
"type": "object",
"required": [
- "type",
- "call_id",
- "name",
- "input",
- "status"
+ "object",
+ "id",
+ "created_at",
+ "level",
+ "message"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "custom_tool_call"
+ "fine_tuning.job.event"
],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "description": "The object type, which is always \"fine_tuning.job.event\".",
"x-stainless-const": true
},
"id": {
"type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
+ "description": "The object identifier."
},
- "call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created."
},
- "namespace": {
+ "level": {
"type": "string",
- "description": "The namespace of the custom tool being called."
+ "enum": [
+ "info",
+ "warn",
+ "error"
+ ],
+ "description": "The log level of the event."
},
- "name": {
+ "message": {
"type": "string",
- "description": "The name of the custom tool being called."
+ "description": "The message of the event."
},
- "input": {
+ "type": {
"type": "string",
- "description": "The input for the custom tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "enum": [
+ "message",
+ "metrics"
+ ],
+ "description": "The type of event."
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "data": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobEventData",
+ "description": "The data associated with the event."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "title": "ResponseCustomToolCallItem"
+ "description": "Fine-tuning job event object",
+ "x-oaiMeta": {
+ "name": "The fine-tuning job event object",
+ "example": "{\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ftevent-abc123\"\n \"created_at\": 1677610602,\n \"level\": \"info\",\n \"message\": \"Created fine-tuning job\",\n \"data\": {},\n \"type\": \"message\"\n}\n"
+ }
},
- "OpenAI.ConversationItemFileSearchToolCall": {
+ "OpenAI.FineTuningJobEventData": {
+ "type": "object"
+ },
+ "OpenAI.FineTuningJobHyperparameters": {
"type": "object",
- "required": [
- "id",
- "type",
- "status",
- "queries"
- ],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the file search tool call."
- },
- "type": {
- "type": "string",
- "enum": [
- "file_search_call"
+ "batch_size": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of the file search tool call. Always `file_search_call`.",
- "x-stainless-const": true
+ "default": "auto"
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "incomplete",
- "failed"
+ "learning_rate_multiplier": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ }
],
- "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
- },
- "queries": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The queries used to search for files."
+ "default": "auto"
},
- "results": {
- "anyOf": [
+ "n_epochs": {
+ "oneOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
- }
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
},
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ]
+ ],
+ "default": "auto"
+ }
+ }
+ },
+ "OpenAI.FunctionAndCustomToolCallOutput": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "input_text": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent",
+ "input_image": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent",
+ "input_file": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent"
}
- ],
- "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
- "title": "File search tool call"
+ }
},
- "OpenAI.ConversationItemFunctionShellCall": {
+ "OpenAI.FunctionAndCustomToolCallOutputInputFileContent": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "action",
- "status",
- "environment"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call"
+ "input_file"
],
- "description": "The type of the item. Always `shell_call`.",
+ "description": "The type of the input item. Always `input_file`.",
"x-stainless-const": true,
- "default": "shell_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
- "description": "The shell commands and limits that describe how to run the tool call."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
- "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
+ "default": "input_file"
},
- "environment": {
+ "file_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "created_by": {
+ "filename": {
"type": "string",
- "description": "The ID of the entity that created this tool call."
+ "description": "The name of the file to be sent to the model."
+ },
+ "file_data": {
+ "type": "string",
+ "description": "The content of the file to be sent to the model."
+ },
+ "file_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the file to be sent to the model."
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
}
],
- "description": "A tool call that executes one or more shell commands in a managed environment.",
- "title": "Shell tool call"
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OpenAI.ConversationItemFunctionShellCallOutput": {
+ "OpenAI.FunctionAndCustomToolCallOutputInputImageContent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "output",
- "max_output_length"
+ "detail"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call_output"
+ "input_image"
],
- "description": "The type of the shell call output. Always `shell_call_output`.",
+ "description": "The type of the input item. Always `input_image`.",
"x-stainless-const": true,
- "default": "shell_call_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell call output. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
- "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ "default": "input_image"
},
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
- },
- "description": "An array of shell call output contents"
+ "image_url": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "max_output_length": {
+ "file_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
}
],
- "description": "The output of a shell tool call that was emitted.",
- "title": "Shell call output"
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
+ "title": "Input image"
},
- "OpenAI.ConversationItemFunctionToolCall": {
+ "OpenAI.FunctionAndCustomToolCallOutputInputTextContent": {
"type": "object",
"required": [
- "id",
"type",
- "call_id",
- "name",
- "arguments"
+ "text"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call"
+ "input_text"
],
- "description": "The type of the function tool call. Always `function_call`.",
- "x-stainless-const": true
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the function to run."
- },
- "name": {
- "type": "string",
- "description": "The name of the function to run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the function."
+ "description": "The type of the input item. Always `input_text`.",
+ "x-stainless-const": true,
+ "default": "input_text"
},
- "status": {
+ "text": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The text input to the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
}
],
- "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
- "title": "Function tool call"
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.ConversationItemFunctionToolCallOutput": {
+ "OpenAI.FunctionAndCustomToolCallOutputType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "input_text",
+ "input_image",
+ "input_file"
+ ]
+ }
+ ]
+ },
+ "OpenAI.FunctionCallItemStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ "OpenAI.FunctionCallOutputStatusEnum": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ "OpenAI.FunctionCallStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ "OpenAI.FunctionObject": {
"type": "object",
"required": [
- "id",
- "type",
- "call_id",
- "output"
+ "name"
],
"properties": {
- "id": {
+ "description": {
"type": "string",
- "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
- "readOnly": true
+ "description": "A description of what the function does, used by the model to choose when and how to call the function."
},
- "type": {
+ "name": {
"type": "string",
- "enum": [
- "function_call_output"
- ],
- "description": "The type of the function tool call output. Always `function_call_output`.",
- "x-stainless-const": true
+ "description": "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."
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
+ "parameters": {
+ "$ref": "#/components/schemas/OpenAI.FunctionParameters"
},
- "output": {
- "oneOf": [
+ "strict": {
+ "anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
+ "type": "null"
}
- ],
- "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ ]
}
- ],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
+ }
},
- "OpenAI.ConversationItemImageGenToolCall": {
+ "OpenAI.FunctionParameters": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\nOmitting `parameters` defines a function with an empty parameter list."
+ },
+ "OpenAI.FunctionShellAction": {
"type": "object",
"required": [
- "type",
- "id",
- "status",
- "result"
+ "commands",
+ "timeout_ms",
+ "max_output_length"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "image_generation_call"
- ],
- "description": "The type of the image generation call. Always `image_generation_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the image generation call."
+ "commands": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "generating",
- "failed"
- ],
- "description": "The status of the image generation call."
+ "timeout_ms": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "result": {
+ "max_output_length": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
@@ -33446,598 +54166,330 @@
]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
+ "description": "Execute a shell command.",
+ "title": "Shell exec action"
},
- "OpenAI.ConversationItemList": {
+ "OpenAI.FunctionShellActionParam": {
"type": "object",
"required": [
- "object",
- "data",
- "has_more",
- "first_id",
- "last_id"
+ "commands"
],
"properties": {
- "object": {
- "type": "string",
- "enum": [
- "list"
- ],
- "description": "The type of object returned, must be `list`.",
- "x-stainless-const": true
- },
- "data": {
+ "commands": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "type": "string"
},
- "description": "A list of conversation items.",
- "x-ms-list-page-items": true
- },
- "has_more": {
- "type": "boolean",
- "description": "Whether there are more items available."
+ "description": "Ordered shell commands for the execution environment to run."
},
- "first_id": {
- "type": "string",
- "description": "The ID of the first item in the list."
+ "timeout_ms": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "last_id": {
- "type": "string",
- "description": "The ID of the last item in the list.",
- "x-ms-list-continuation-token": true
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "A list of Conversation items.",
- "title": "The conversation item list",
- "x-oaiMeta": {
- "name": "The item list",
- "group": "conversations"
- }
+ "description": "Commands and limits describing how to run the shell tool call.",
+ "title": "Shell action"
},
- "OpenAI.ConversationItemLocalShellToolCall": {
+ "OpenAI.FunctionShellCallEnvironment": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "action",
- "status"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "local_shell_call"
- ],
- "description": "The type of the local shell call. Always `local_shell_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell call."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the local shell call."
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironmentType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "local": "#/components/schemas/OpenAI.LocalEnvironmentResource",
+ "container_reference": "#/components/schemas/OpenAI.ContainerReferenceResource"
}
- ],
- "description": "A tool call to run a command on the local shell.",
- "title": "Local shell call"
+ }
},
- "OpenAI.ConversationItemLocalShellToolCallOutput": {
- "type": "object",
- "required": [
- "type",
- "id",
- "output"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "local_shell_call_output"
- ],
- "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
- },
- "output": {
- "type": "string",
- "description": "A JSON string of the output of the local shell tool call."
- },
- "status": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
+ "OpenAI.FunctionShellCallEnvironmentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "type": "string",
+ "enum": [
+ "local",
+ "container_reference"
+ ]
}
- ],
- "description": "The output of a local shell tool call.",
- "title": "Local shell call output"
+ ]
},
- "OpenAI.ConversationItemMcpApprovalRequest": {
+ "OpenAI.FunctionShellCallItemParamEnvironment": {
"type": "object",
"required": [
- "type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "mcp_approval_request"
- ],
- "description": "The type of the item. Always `mcp_approval_request`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the approval request."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server making the request."
- },
- "name": {
- "type": "string",
- "description": "The name of the tool to run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of arguments for the tool."
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "local": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam",
+ "container_reference": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam"
}
- ],
- "description": "A request for human approval of a tool invocation.",
- "title": "MCP approval request"
+ },
+ "description": "The environment to execute the shell commands in."
},
- "OpenAI.ConversationItemMcpApprovalResponseResource": {
+ "OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam": {
"type": "object",
"required": [
"type",
- "id",
- "approval_request_id",
- "approve"
+ "container_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_response"
+ "container_reference"
],
- "description": "The type of the item. Always `mcp_approval_response`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the approval response"
+ "description": "References a container created with the /v1/containers endpoint",
+ "x-stainless-const": true,
+ "default": "container_reference"
},
- "approval_request_id": {
+ "container_id": {
"type": "string",
- "description": "The ID of the approval request being answered."
- },
- "approve": {
- "type": "boolean",
- "description": "Whether the request was approved."
- },
- "reason": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The ID of the referenced container."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
}
- ],
- "description": "A response to an MCP approval request.",
- "title": "MCP approval response"
+ ]
},
- "OpenAI.ConversationItemMcpListTools": {
+ "OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam": {
"type": "object",
"required": [
- "type",
- "id",
- "server_label",
- "tools"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_list_tools"
+ "local"
],
- "description": "The type of the item. Always `mcp_list_tools`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the list."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server."
+ "description": "Use a local computer environment.",
+ "x-stainless-const": true,
+ "default": "local"
},
- "tools": {
+ "skills": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
+ "$ref": "#/components/schemas/OpenAI.LocalSkillParam"
},
- "description": "The tools available on the server."
- },
- "error": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "maxItems": 200,
+ "description": "An optional list of skills."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
+ }
+ ]
+ },
+ "OpenAI.FunctionShellCallItemParamEnvironmentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "local",
+ "container_reference"
+ ]
}
+ ]
+ },
+ "OpenAI.FunctionShellCallItemStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
],
- "description": "A list of tools available on an MCP server.",
- "title": "MCP list tools"
+ "description": "Status values reported for shell tool calls.",
+ "title": "Shell call status"
},
- "OpenAI.ConversationItemMcpToolCall": {
+ "OpenAI.FunctionShellCallOutputContent": {
"type": "object",
"required": [
- "type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "stdout",
+ "stderr",
+ "outcome"
],
"properties": {
- "type": {
+ "stdout": {
"type": "string",
- "enum": [
- "mcp_call"
- ],
- "description": "The type of the item. Always `mcp_call`.",
- "x-stainless-const": true
+ "description": "The standard output that was captured."
},
- "id": {
+ "stderr": {
"type": "string",
- "description": "The unique ID of the tool call."
+ "description": "The standard error output that was captured."
},
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server running the tool."
+ "outcome": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome",
+ "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.",
+ "title": "Shell call outcome"
},
- "name": {
+ "created_by": {
"type": "string",
- "description": "The name of the tool that was run."
- },
- "arguments": {
+ "description": "The identifier of the actor that created the item."
+ }
+ },
+ "description": "The content of a shell tool call output that was emitted.",
+ "title": "Shell call output content"
+ },
+ "OpenAI.FunctionShellCallOutputContentParam": {
+ "type": "object",
+ "required": [
+ "stdout",
+ "stderr",
+ "outcome"
+ ],
+ "properties": {
+ "stdout": {
"type": "string",
- "description": "A JSON string of the arguments passed to the tool."
- },
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "error": {
- "type": "object",
- "unevaluatedProperties": {}
+ "maxLength": 10485760,
+ "description": "Captured stdout output for the shell call."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
- "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ "stderr": {
+ "type": "string",
+ "maxLength": 10485760,
+ "description": "Captured stderr output for the shell call."
},
- "approval_request_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "outcome": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam",
+ "description": "The exit or timeout outcome associated with this shell call."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "An invocation of a tool on an MCP server.",
- "title": "MCP tool call"
+ "description": "Captured stdout and stderr for a portion of a shell tool call output.",
+ "title": "Shell output content"
},
- "OpenAI.ConversationItemMessage": {
+ "OpenAI.FunctionShellCallOutputExitOutcome": {
"type": "object",
"required": [
"type",
- "id",
- "status",
- "role",
- "content"
+ "exit_code"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "message"
+ "exit"
],
- "description": "The type of the message. Always set to `message`.",
- "x-stainless-const": true,
- "default": "message"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the message."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MessageStatus",
- "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API."
- },
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`."
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- },
- "description": "The content of the message"
+ "description": "The outcome type. Always `exit`.",
+ "x-stainless-const": true
},
- "phase": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
- },
- {
- "type": "null"
- }
- ]
+ "exit_code": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Exit code from the shell process."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome"
}
],
- "description": "A message to or from the model.",
- "title": "Message"
+ "description": "Indicates that the shell commands finished and returned an exit code.",
+ "title": "Shell call exit outcome"
},
- "OpenAI.ConversationItemReasoningItem": {
+ "OpenAI.FunctionShellCallOutputExitOutcomeParam": {
"type": "object",
"required": [
"type",
- "id",
- "summary"
+ "exit_code"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "reasoning"
+ "exit"
],
- "description": "The type of the object. Always `reasoning`.",
+ "description": "The outcome type. Always `exit`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique identifier of the reasoning content."
- },
- "encrypted_content": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "summary": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
- },
- "description": "Reasoning summary content."
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
- },
- "description": "Reasoning text content."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "exit_code": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The exit code returned by the shell process."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam"
}
],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
+ "description": "Indicates that the shell commands finished and returned an exit code.",
+ "title": "Shell call exit outcome"
},
- "OpenAI.ConversationItemToolSearchCall": {
+ "OpenAI.FunctionShellCallOutputOutcome": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "execution",
- "arguments",
- "status"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "tool_search_call"
- ],
- "description": "The type of the item. Always `tool_search_call`.",
- "x-stainless-const": true,
- "default": "tool_search_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the tool search call item."
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "arguments": {
- "description": "Arguments used for the tool search call."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the tool search call item that was recorded."
- },
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome",
+ "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome"
}
- ]
+ },
+ "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.",
+ "title": "Shell call outcome"
},
- "OpenAI.ConversationItemToolSearchOutput": {
+ "OpenAI.FunctionShellCallOutputOutcomeParam": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "execution",
- "tools",
- "status"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "tool_search_output"
- ],
- "description": "The type of the item. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the tool search output item."
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The loaded tool definitions returned by tool search."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the tool search output item that was recorded."
- },
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParamType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcomeParam",
+ "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcomeParam"
}
- ]
+ },
+ "description": "The exit or timeout outcome associated with this shell call.",
+ "title": "Shell call outcome"
},
- "OpenAI.ConversationItemType": {
+ "OpenAI.FunctionShellCallOutputOutcomeParamType": {
"anyOf": [
{
"type": "string"
@@ -34045,226 +54497,186 @@
{
"type": "string",
"enum": [
- "message",
- "function_call",
- "function_call_output",
- "file_search_call",
- "web_search_call",
- "image_generation_call",
- "computer_call",
- "computer_call_output",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "reasoning",
- "compaction",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "mcp_call",
- "custom_tool_call",
- "custom_tool_call_output"
+ "timeout",
+ "exit"
+ ]
+ }
+ ]
+ },
+ "OpenAI.FunctionShellCallOutputOutcomeType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "timeout",
+ "exit"
]
}
]
},
- "OpenAI.ConversationItemWebSearchToolCall": {
+ "OpenAI.FunctionShellCallOutputStatusEnum": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ "OpenAI.FunctionShellCallOutputTimeoutOutcome": {
"type": "object",
"required": [
- "id",
- "type",
- "status",
- "action"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the web search tool call."
- },
"type": {
"type": "string",
"enum": [
- "web_search_call"
+ "timeout"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
+ "description": "The outcome type. Always `timeout`.",
"x-stainless-const": true
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
- ],
- "description": "The status of the web search tool call."
- },
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
- }
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ConversationItem"
- }
- ],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
- },
- "OpenAI.ConversationParam": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ConversationParam-2"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome"
}
],
- "description": "The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.\nInput items and output items from this response are automatically added to this conversation after this response completes."
+ "description": "Indicates that the shell call exceeded its configured time limit.",
+ "title": "Shell call timeout outcome"
},
- "OpenAI.ConversationParam-2": {
+ "OpenAI.FunctionShellCallOutputTimeoutOutcomeParam": {
"type": "object",
"required": [
- "id"
+ "type"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The unique ID of the conversation."
+ "enum": [
+ "timeout"
+ ],
+ "description": "The outcome type. Always `timeout`.",
+ "x-stainless-const": true
}
},
- "description": "The conversation that this response belongs to.",
- "title": "Conversation object"
- },
- "OpenAI.ConversationReference": {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the conversation that this response was associated with."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam"
}
- },
- "description": "The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.",
- "title": "Conversation"
+ ],
+ "description": "Indicates that the shell call exceeded its configured time limit.",
+ "title": "Shell call timeout outcome"
},
- "OpenAI.ConversationResource": {
+ "OpenAI.FunctionShellCallStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ "OpenAI.FunctionShellToolParam": {
"type": "object",
"required": [
- "id",
- "object",
- "metadata",
- "created_at"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the conversation."
- },
- "object": {
+ "type": {
"type": "string",
"enum": [
- "conversation"
+ "shell"
],
- "description": "The object type, which is always `conversation`.",
- "x-stainless-const": true,
- "default": "conversation"
+ "description": "The type of the shell tool. Always `shell`.",
+ "x-stainless-const": true
},
- "metadata": {
- "$ref": "#/components/schemas/OpenAI.Metadata",
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ "environment": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The time at which the conversation was created, measured in seconds since the Unix epoch."
- }
- }
- },
- "OpenAI.CoordParam": {
- "type": "object",
- "required": [
- "x",
- "y"
- ],
- "properties": {
- "x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate."
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- "y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate."
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
}
},
- "description": "An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.",
- "title": "Coordinate"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A tool that allows the model to execute shell commands.",
+ "title": "Shell tool"
},
- "OpenAI.CreateChatCompletionRequestResponseFormat": {
+ "OpenAI.FunctionShellToolParamEnvironment": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "text": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText",
- "json_object": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject",
- "json_schema": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
+ "local": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam",
+ "container_reference": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam",
+ "container_auto": "#/components/schemas/OpenAI.ContainerAutoParam"
}
- },
- "description": "An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it."
+ }
},
- "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject": {
+ "OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam": {
"type": "object",
"required": [
- "type"
+ "type",
+ "container_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "json_object"
+ "container_reference"
],
- "description": "The type of response format being defined. Always `json_object`.",
- "x-stainless-const": true
+ "description": "References a container created with the /v1/containers endpoint",
+ "x-stainless-const": true,
+ "default": "container_reference"
+ },
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the referenced container."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
}
- ],
- "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
- "title": "JSON object"
+ ]
},
- "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText": {
+ "OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam": {
"type": "object",
"required": [
"type"
@@ -34273,21 +54685,28 @@
"type": {
"type": "string",
"enum": [
- "text"
+ "local"
],
- "description": "The type of response format being defined. Always `text`.",
- "x-stainless-const": true
+ "description": "Use a local computer environment.",
+ "x-stainless-const": true,
+ "default": "local"
+ },
+ "skills": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.LocalSkillParam"
+ },
+ "maxItems": 200,
+ "description": "An optional list of skills."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
}
- ],
- "description": "Default response format. Used to generate text responses.",
- "title": "Text"
+ ]
},
- "OpenAI.CreateChatCompletionRequestResponseFormatType": {
+ "OpenAI.FunctionShellToolParamEnvironmentType": {
"anyOf": [
{
"type": "string"
@@ -34295,1190 +54714,1059 @@
{
"type": "string",
"enum": [
- "text",
- "json_schema",
- "json_object"
+ "container_auto",
+ "local",
+ "container_reference"
]
}
]
},
- "OpenAI.CreateConversationBody": {
+ "OpenAI.FunctionTool": {
"type": "object",
+ "required": [
+ "type",
+ "name",
+ "parameters",
+ "strict"
+ ],
"properties": {
- "metadata": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "function"
+ ],
+ "description": "The type of the function tool. Always `function`.",
+ "x-stainless-const": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the function to call."
+ },
+ "description": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "items": {
+ "parameters": {
"anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
+ "type": "object",
+ "unevaluatedProperties": {}
},
{
"type": "null"
}
]
- }
- }
- },
- "OpenAI.CreateEvalCompletionsRunDataSource": {
- "type": "object",
- "required": [
- "type",
- "source"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "completions"
- ],
- "description": "The type of run data source. Always `completions`.",
- "default": "completions"
},
- "input_messages": {
- "oneOf": [
+ "strict": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate"
+ "type": "boolean"
},
{
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference"
+ "type": "null"
}
- ],
- "description": "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."
- },
- "sampling_params": {
- "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams"
- },
- "model": {
- "type": "string",
- "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")."
+ ]
},
- "source": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalStoredCompletionsSource"
- }
- ],
- "description": "Determines what populates the `item` namespace in this run's data source."
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this function is deferred and loaded via tool search."
}
},
- "description": "A CompletionsRunDataSource object describing a model sampling configuration.",
- "title": "CompletionsRunDataSource",
- "x-oaiMeta": {
- "name": "The completions data source object used to configure an individual run",
- "group": "eval runs",
- "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"completions\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n"
- }
- },
- "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference": {
- "type": "object",
- "required": [
- "type",
- "item_reference"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "item_reference"
- ]
- },
- "item_reference": {
- "type": "string"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
- }
+ ],
+ "description": "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).",
+ "title": "Function"
},
- "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate": {
+ "OpenAI.FunctionToolParam": {
"type": "object",
"required": [
- "type",
- "template"
+ "name",
+ "type"
],
"properties": {
- "type": {
+ "name": {
"type": "string",
- "enum": [
- "template"
- ]
+ "minLength": 1,
+ "maxLength": 128,
+ "pattern": "^[a-zA-Z0-9_-]+$"
},
- "template": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EasyInputMessage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- }
- ]
- }
- }
- }
- },
- "OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams": {
- "type": "object",
- "properties": {
- "reasoning_effort": {
+ "description": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "temperature": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "default": 1
- },
- "max_completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- "top_p": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "default": 1
- },
- "seed": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "default": 42
- },
- "response_format": {
- "oneOf": [
+ "parameters": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseFormatText"
+ "$ref": "#/components/schemas/OpenAI.EmptyModelParam"
},
{
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema"
+ "type": "null"
+ }
+ ]
+ },
+ "strict": {
+ "anyOf": [
+ {
+ "type": "boolean"
},
{
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject"
+ "type": "null"
}
]
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ChatCompletionTool"
- }
+ "type": {
+ "type": "string",
+ "enum": [
+ "function"
+ ],
+ "x-stainless-const": true,
+ "default": "function"
+ },
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this function should be deferred and discovered via tool search."
}
}
},
- "OpenAI.CreateEvalCustomDataSourceConfig": {
+ "OpenAI.GraderLabelModel": {
"type": "object",
"required": [
"type",
- "item_schema"
+ "name",
+ "model",
+ "input",
+ "labels",
+ "passing_labels"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom"
+ "label_model"
],
- "description": "The type of data source. Always `custom`.",
- "x-stainless-const": true,
- "default": "custom"
+ "description": "The object type, which is always `label_model`.",
+ "x-stainless-const": true
},
- "item_schema": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The json schema for each row in the data source."
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
},
- "include_sample_schema": {
- "type": "boolean",
- "description": "Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)"
+ "model": {
+ "type": "string",
+ "description": "The model to use for the evaluation. Must support structured outputs."
+ },
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ }
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels to assign to each item in the evaluation."
+ },
+ "passing_labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels that indicate a passing result. Must be a subset of labels."
}
},
- "description": "A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.\nThis schema is used to define the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run",
- "title": "CustomDataSourceConfig",
+ "description": "A LabelModelGrader object which uses a model to assign labels to each item\nin the evaluation.",
+ "title": "LabelModelGrader",
"x-oaiMeta": {
- "name": "The eval file data source config object",
- "group": "evals",
- "example": "{\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"}\n },\n \"required\": [\"name\", \"age\"]\n },\n \"include_sample_schema\": true\n}\n"
+ "name": "Label Model Grader",
+ "group": "graders",
+ "example": "{\n \"name\": \"First label grader\",\n \"type\": \"label_model\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"input\": [\n {\n \"type\": \"message\",\n \"role\": \"system\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Classify the sentiment of the following statement as one of positive, neutral, or negative\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Statement: {{item.response}}\"\n }\n }\n ],\n \"passing_labels\": [\n \"positive\"\n ],\n \"labels\": [\n \"positive\",\n \"neutral\",\n \"negative\"\n ]\n}\n"
}
},
- "OpenAI.CreateEvalJsonlRunDataSource": {
+ "OpenAI.GraderMulti": {
"type": "object",
"required": [
"type",
- "source"
+ "name",
+ "graders",
+ "calculate_output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "jsonl"
+ "multi"
],
- "description": "The type of data source. Always `jsonl`.",
+ "description": "The object type, which is always `multi`.",
"x-stainless-const": true,
- "default": "jsonl"
+ "default": "multi"
},
- "source": {
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "graders": {
"oneOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
},
{
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderLabelModel"
}
- ],
- "description": "Determines what populates the `item` namespace in the data source."
+ ]
+ },
+ "calculate_output": {
+ "type": "string",
+ "description": "A formula to calculate the output based on grader results."
}
},
- "description": "A JsonlRunDataSource object with that specifies a JSONL file that matches the eval",
- "title": "JsonlRunDataSource",
+ "description": "A MultiGrader object combines the output of multiple graders to produce a single score.",
+ "title": "MultiGrader",
"x-oaiMeta": {
- "name": "The file data source object for the eval run configuration",
- "group": "evals",
- "example": "{\n \"type\": \"jsonl\",\n \"source\": {\n \"type\": \"file_id\",\n \"id\": \"file-9GYS6xbkWgWhmE7VoLUWFg\"\n }\n}\n"
+ "name": "Multi Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"multi\",\n \"name\": \"example multi grader\",\n \"graders\": [\n {\n \"type\": \"text_similarity\",\n \"name\": \"example text similarity grader\",\n \"input\": \"The graded text\",\n \"reference\": \"The reference text\",\n \"evaluation_metric\": \"fuzzy_match\"\n },\n {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n ],\n \"calculate_output\": \"0.5 * text_similarity_score + 0.5 * string_check_score)\"\n}\n"
}
},
- "OpenAI.CreateEvalLogsDataSourceConfig": {
+ "OpenAI.GraderPython": {
"type": "object",
"required": [
- "type"
+ "type",
+ "name",
+ "source"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "logs"
+ "python"
],
- "description": "The type of data source. Always `logs`.",
- "x-stainless-const": true,
- "default": "logs"
+ "description": "The object type, which is always `python`.",
+ "x-stainless-const": true
},
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Metadata filters for the logs data source."
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "source": {
+ "type": "string",
+ "description": "The source code of the python script."
+ },
+ "image_tag": {
+ "type": "string",
+ "description": "The image tag to use for the python script."
}
},
- "description": "A data source config which specifies the metadata property of your logs query.\nThis is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.",
- "title": "LogsDataSourceConfig",
+ "description": "A PythonGrader object that runs a python script on the input.",
+ "title": "PythonGrader",
"x-oaiMeta": {
- "name": "The logs data source object for evals",
- "group": "evals",
- "example": "{\n \"type\": \"logs\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n"
+ "name": "Python Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"python\",\n \"name\": \"Example python grader\",\n \"image_tag\": \"2025-05-08\",\n \"source\": \"\"\"\ndef grade(sample: dict, item: dict) -> float:\n \"\"\"\n Returns 1.0 if `output_text` equals `label`, otherwise 0.0.\n \"\"\"\n output = sample.get(\"output_text\")\n label = item.get(\"label\")\n return 1.0 if output == label else 0.0\n\"\"\",\n}\n"
}
},
- "OpenAI.CreateEvalResponsesRunDataSource": {
+ "OpenAI.GraderScoreModel": {
"type": "object",
"required": [
"type",
- "source"
+ "name",
+ "model",
+ "input"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "responses"
- ],
- "description": "The type of run data source. Always `responses`.",
- "default": "responses"
- },
- "input_messages": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference"
- }
+ "score_model"
],
- "description": "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."
+ "description": "The object type, which is always `score_model`.",
+ "x-stainless-const": true
},
- "sampling_params": {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams"
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
},
"model": {
"type": "string",
- "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")."
+ "description": "The model to use for the evaluation."
},
- "source": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource"
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalResponsesSource"
- }
- ],
- "description": "Determines what populates the `item` namespace in this run's data source."
+ "sampling_params": {
+ "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams",
+ "description": "The sampling parameters for the model."
+ },
+ "input": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.EvalItem"
+ },
+ "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings."
+ },
+ "range": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "description": "The range of the score. Defaults to `[0, 1]`."
}
},
- "description": "A ResponsesRunDataSource object describing a model sampling configuration.",
- "title": "ResponsesRunDataSource",
+ "description": "A ScoreModelGrader object that uses a model to assign a score to the input.",
+ "title": "ScoreModelGrader",
"x-oaiMeta": {
- "name": "The completions data source object used to configure an individual run",
- "group": "eval runs",
- "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"responses\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n"
+ "name": "Score Model Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": (\n \"Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different.\"\n \" Return just a floating point score\n\n\"\n \" Reference answer: {{item.label}}\n\n\"\n \" Model answer: {{sample.output_text}}\"\n )\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/reference.png\",\n \"file_id\": null,\n \"detail\": \"auto\"\n }\n ],\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42,\n \"max_completions_tokens\": 32768,\n \"reasoning_effort\": \"medium\"\n },\n}\n"
}
},
- "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference": {
+ "OpenAI.GraderStringCheck": {
"type": "object",
"required": [
"type",
- "item_reference"
+ "name",
+ "input",
+ "reference",
+ "operation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "item_reference"
- ]
+ "string_check"
+ ],
+ "description": "The object type, which is always `string_check`.",
+ "x-stainless-const": true
},
- "item_reference": {
- "type": "string"
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
+ },
+ "input": {
+ "type": "string",
+ "description": "The input text. This may include template strings."
+ },
+ "reference": {
+ "type": "string",
+ "description": "The reference text. This may include template strings."
+ },
+ "operation": {
+ "type": "string",
+ "enum": [
+ "eq",
+ "ne",
+ "like",
+ "ilike"
+ ],
+ "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
}
+ },
+ "description": "A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.",
+ "title": "StringCheckGrader",
+ "x-oaiMeta": {
+ "name": "String Check Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n}\n"
}
},
- "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate": {
+ "OpenAI.GraderTextSimilarity": {
"type": "object",
"required": [
"type",
- "template"
+ "name",
+ "input",
+ "reference",
+ "evaluation_metric"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "template"
- ]
- },
- "template": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "role": {
- "type": "string"
- },
- "content": {
- "type": "string"
- }
- },
- "required": [
- "role",
- "content"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- }
- ]
- }
- }
- }
- },
- "OpenAI.CreateEvalResponsesRunDataSourceSamplingParams": {
- "type": "object",
- "properties": {
- "reasoning_effort": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
- },
- {
- "type": "null"
- }
- ]
- },
- "temperature": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "default": 1
- },
- "max_completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "text_similarity"
+ ],
+ "description": "The type of grader.",
+ "x-stainless-const": true,
+ "default": "text_similarity"
},
- "top_p": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "default": 1
+ "name": {
+ "type": "string",
+ "description": "The name of the grader."
},
- "seed": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "default": 42
+ "input": {
+ "type": "string",
+ "description": "The text being graded."
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
+ "reference": {
+ "type": "string",
+ "description": "The text being graded against."
},
- "text": {
- "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText"
+ "evaluation_metric": {
+ "type": "string",
+ "enum": [
+ "cosine",
+ "fuzzy_match",
+ "bleu",
+ "gleu",
+ "meteor",
+ "rouge_1",
+ "rouge_2",
+ "rouge_3",
+ "rouge_4",
+ "rouge_5",
+ "rouge_l"
+ ],
+ "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`."
}
+ },
+ "description": "A TextSimilarityGrader object which grades text based on similarity metrics.",
+ "title": "TextSimilarityGrader",
+ "x-oaiMeta": {
+ "name": "Text Similarity Grader",
+ "group": "graders",
+ "example": "{\n \"type\": \"text_similarity\",\n \"name\": \"Example text similarity grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"evaluation_metric\": \"fuzzy_match\"\n}\n"
}
},
- "OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText": {
- "type": "object",
- "properties": {
- "format": {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
- }
- }
+ "OpenAI.GrammarSyntax1": {
+ "type": "string",
+ "enum": [
+ "lark",
+ "regex"
+ ]
},
- "OpenAI.CreateEvalStoredCompletionsDataSourceConfig": {
+ "OpenAI.HybridSearchOptions": {
"type": "object",
"required": [
- "type"
+ "embedding_weight",
+ "text_weight"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "stored_completions"
- ],
- "description": "The type of data source. Always `stored_completions`.",
- "x-stainless-const": true,
- "default": "stored_completions"
+ "embedding_weight": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The weight of the embedding in the reciprocal ranking fusion."
},
- "metadata": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "Metadata filters for the stored completions data source."
+ "text_weight": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The weight of the text in the reciprocal ranking fusion."
}
- },
- "description": "Deprecated in favor of LogsDataSourceConfig.",
- "title": "StoredCompletionsDataSourceConfig",
- "deprecated": true,
- "x-oaiMeta": {
- "name": "The stored completions data source object for evals",
- "group": "evals",
- "example": "{\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n"
}
},
- "OpenAI.CreateFineTuningJobRequest": {
+ "OpenAI.Image": {
"type": "object",
- "required": [
- "model",
- "training_file"
- ],
"properties": {
- "model": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "babbage-002",
- "davinci-002",
- "gpt-3.5-turbo",
- "gpt-4o-mini"
- ]
- }
- ],
- "description": "The name of the model to fine-tune. You can select one of the\n [supported models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned).",
- "x-oaiTypeLabel": "string"
- },
- "training_file": {
+ "b64_json": {
"type": "string",
- "description": "The ID of an uploaded file that contains training data.\n See [upload file](/docs/api-reference/files/create) for how to upload a file.\n Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.\n The contents of the file should differ depending on if the model uses the [chat](/docs/api-reference/fine-tuning/chat-input), [completions](/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](/docs/api-reference/fine-tuning/preference-input) format.\n See the [fine-tuning guide](/docs/guides/model-optimization) for more details."
- },
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters",
- "description": "The hyperparameters used for the fine-tuning job.\n This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter.",
- "deprecated": true
- },
- "suffix": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "minLength": 1,
- "maxLength": 64,
- "description": "A string of up to 64 characters that will be added to your fine-tuned model name.\n For example, a `suffix` of \"custom-model-name\" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`."
- },
- "validation_file": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "description": "The ID of an uploaded file that contains validation data.\n If you provide this file, the data is used to generate validation\n metrics periodically during fine-tuning. These metrics can be viewed in\n the fine-tuning results file.\n The same data should not be present in both train and validation files.\n Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.\n See the [fine-tuning guide](/docs/guides/model-optimization) for more details."
- },
- "integrations": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations"
- }
- },
- {
- "type": "null"
- }
- ],
- "description": "A list of integrations to enable for your fine-tuning job."
- },
- "seed": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ],
- "minimum": 0,
- "maximum": 2147483647,
- "description": "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.\n If a seed is not specified, one will be generated for you."
+ "contentEncoding": "base64",
+ "description": "The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`."
},
- "method": {
- "$ref": "#/components/schemas/OpenAI.FineTuneMethod"
+ "url": {
+ "type": "string",
+ "format": "uri",
+ "description": "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 the GPT image models."
},
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
+ "revised_prompt": {
+ "type": "string",
+ "description": "For `dall-e-3` only, the revised prompt that was used to generate the image."
}
- }
+ },
+ "description": "Represents the content or the URL of an image generated by the OpenAI API."
},
- "OpenAI.CreateFineTuningJobRequestHyperparameters": {
+ "OpenAI.ImageDetail": {
+ "type": "string",
+ "enum": [
+ "low",
+ "high",
+ "auto",
+ "original"
+ ]
+ },
+ "OpenAI.ImageGenActionEnum": {
+ "type": "string",
+ "enum": [
+ "generate",
+ "edit",
+ "auto"
+ ]
+ },
+ "OpenAI.ImageGenInputUsageDetails": {
"type": "object",
+ "required": [
+ "text_tokens",
+ "image_tokens"
+ ],
"properties": {
- "batch_size": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "default": "auto"
- },
- "learning_rate_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "default": "auto"
+ "text_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of text tokens in the input prompt."
},
- "n_epochs": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "default": "auto"
+ "image_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of image tokens in the input prompt."
}
- }
+ },
+ "description": "The input tokens detailed information for the image generation.",
+ "title": "Input usage details"
},
- "OpenAI.CreateFineTuningJobRequestIntegrations": {
+ "OpenAI.ImageGenOutputTokensDetails": {
"type": "object",
"required": [
- "type",
- "wandb"
+ "image_tokens",
+ "text_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "wandb"
- ],
- "x-stainless-const": true
+ "image_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of image output tokens generated by the model."
},
- "wandb": {
- "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb"
+ "text_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of text output tokens generated by the model."
}
- }
+ },
+ "description": "The output token details for the image generation.",
+ "title": "Image generation output token details"
},
- "OpenAI.CreateFineTuningJobRequestIntegrationsWandb": {
+ "OpenAI.ImageGenTool": {
"type": "object",
"required": [
- "project"
+ "type"
],
"properties": {
- "project": {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "image_generation"
+ ],
+ "description": "The type of the image generation tool. Always `image_generation`.",
+ "x-stainless-const": true
},
- "name": {
+ "model": {
"anyOf": [
{
"type": "string"
},
{
- "type": "null"
+ "type": "string",
+ "enum": [
+ "gpt-image-1",
+ "gpt-image-1-mini",
+ "gpt-image-1.5"
+ ]
}
- ]
+ ],
+ "default": "gpt-image-1"
},
- "entity": {
+ "quality": {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high",
+ "auto"
+ ],
+ "description": "The quality of the generated image. One of `low`, `medium`, `high`,\n or `auto`. Default: `auto`.",
+ "default": "auto"
+ },
+ "size": {
"anyOf": [
{
"type": "string"
},
{
- "type": "null"
+ "type": "string",
+ "enum": [
+ "1024x1024",
+ "1024x1536",
+ "1536x1024",
+ "auto"
+ ]
}
- ]
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "OpenAI.CreateResponseStreamingResponse": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCreatedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseErrorEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFailedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseIncompleteEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseTextDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseQueuedEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseAudioDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent"
+ ],
+ "description": "The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.",
+ "default": "auto"
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent"
+ "output_format": {
+ "type": "string",
+ "enum": [
+ "png",
+ "webp",
+ "jpeg"
+ ],
+ "description": "The output format of the generated image. One of `png`, `webp`, or\n `jpeg`. Default: `png`.",
+ "default": "png"
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseCompletedEvent"
+ "output_compression": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0,
+ "maximum": 100,
+ "description": "Compression level for the output image. Default: 100.",
+ "default": 100
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseContentPartDoneEvent"
+ "moderation": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "low"
+ ],
+ "description": "Moderation level for the generated image. Default: `auto`.",
+ "default": "auto"
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent"
+ "background": {
+ "type": "string",
+ "enum": [
+ "transparent",
+ "opaque",
+ "auto"
+ ],
+ "description": "Background type for the generated image. One of `transparent`,\n `opaque`, or `auto`. Default: `auto`.",
+ "default": "auto"
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent"
+ "input_fidelity": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFidelity"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseOutputItemDoneEvent"
+ "input_image_mask": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenToolInputImageMask",
+ "description": "Optional mask for inpainting. Contains `image_url`\n (string, optional) and `file_id` (string, optional)."
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent"
+ "partial_images": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0,
+ "maximum": 3,
+ "description": "Number of partial images to generate in streaming mode, from 0 (default value) to 3."
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent"
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenActionEnum",
+ "description": "Whether to generate a new image or edit an existing image. Default: `auto`."
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent"
+ "name": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseRefusalDoneEvent"
+ "description": {
+ "type": "string",
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
+ }
+ },
+ "allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseTextDoneEvent"
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A tool that generates images using the GPT image models.",
+ "title": "Image generation tool"
+ },
+ "OpenAI.ImageGenToolInputImageMask": {
+ "type": "object",
+ "properties": {
+ "image_url": {
+ "type": "string",
+ "format": "uri"
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent"
+ "file_id": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.ImageGenUsage": {
+ "type": "object",
+ "required": [
+ "input_tokens",
+ "total_tokens",
+ "output_tokens",
+ "input_tokens_details"
+ ],
+ "properties": {
+ "input_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of tokens (images and text) in the input prompt."
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent"
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The total number of tokens (images and text) used for the image generation."
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent"
+ "output_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of output tokens generated by the model."
},
- {
- "$ref": "#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent"
+ "output_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenOutputTokensDetails"
},
+ "input_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenInputUsageDetails"
+ }
+ },
+ "description": "For `gpt-image-1` only, the token usage information for the image generation.",
+ "title": "Image generation usage"
+ },
+ "OpenAI.ImageRefParam": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent"
+ "type": "object",
+ "properties": {
+ "image_url": {
+ "type": "string",
+ "format": "uri",
+ "maxLength": 20971520
+ }
+ },
+ "required": [
+ "image_url"
+ ]
},
{
- "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent"
+ "type": "object",
+ "properties": {
+ "file_id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "file_id"
+ ]
}
- ]
+ ],
+ "description": "Reference an input image by either URL or uploaded file ID.\nProvide exactly one of `image_url` or `file_id`."
},
- "OpenAI.CustomGrammarFormatParam": {
+ "OpenAI.ImagesResponse": {
"type": "object",
"required": [
- "type",
- "syntax",
- "definition"
+ "created"
],
"properties": {
- "type": {
+ "created": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) of when the image was created."
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Image"
+ },
+ "description": "The list of generated images."
+ },
+ "background": {
"type": "string",
"enum": [
- "grammar"
+ "transparent",
+ "opaque"
],
- "description": "Grammar format. Always `grammar`.",
- "x-stainless-const": true
+ "description": "The background parameter used for the image generation. Either `transparent` or `opaque`."
},
- "syntax": {
- "$ref": "#/components/schemas/OpenAI.GrammarSyntax1",
- "description": "The syntax of the grammar definition. One of `lark` or `regex`."
+ "output_format": {
+ "type": "string",
+ "enum": [
+ "png",
+ "webp",
+ "jpeg"
+ ],
+ "description": "The output format of the image generation. Either `png`, `webp`, or `jpeg`."
},
- "definition": {
+ "size": {
"type": "string",
- "description": "The grammar definition."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat"
- }
- ],
- "description": "A grammar defined by the user.",
- "title": "Grammar format"
- },
- "OpenAI.CustomTextFormatParam": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "enum": [
+ "1024x1024",
+ "1024x1536",
+ "1536x1024"
+ ],
+ "description": "The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`."
+ },
+ "quality": {
"type": "string",
"enum": [
- "text"
+ "low",
+ "medium",
+ "high"
],
- "description": "Unconstrained text format. Always `text`.",
- "x-stainless-const": true
+ "description": "The quality of the image generated. Either `low`, `medium`, or `high`."
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.ImageGenUsage"
}
},
- "allOf": [
+ "description": "The response from the image generation endpoint.",
+ "title": "Image generation response",
+ "x-oaiMeta": {
+ "name": "The image generation response",
+ "group": "images",
+ "example": "{\n \"created\": 1713833628,\n \"data\": [\n {\n \"b64_json\": \"...\"\n }\n ],\n \"background\": \"transparent\",\n \"output_format\": \"png\",\n \"size\": \"1024x1024\",\n \"quality\": \"high\",\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \"image_tokens\": 40\n }\n }\n}\n"
+ }
+ },
+ "OpenAI.IncludeEnum": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "file_search_call.results",
+ "web_search_call.results",
+ "web_search_call.action.sources",
+ "message.input_image.image_url",
+ "computer_call_output.output.image_url",
+ "code_interpreter_call.outputs",
+ "reasoning.encrypted_content",
+ "message.output_text.logprobs",
+ "memory_search_call.results"
+ ]
}
],
- "description": "Unconstrained free-form text.",
- "title": "Text format"
+ "description": "Specify additional output data to include in the model response. Currently supported values are:\n- `web_search_call.results`: Include the search results of the web search tool call.\n- `web_search_call.action.sources`: Include the sources of the web search tool call.\n- `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.\n- `computer_call_output.output.image_url`: Include image urls from the computer call output.\n- `file_search_call.results`: Include the search results of the file search tool call.\n- `message.input_image.image_url`: Include image urls from the input message.\n- `message.output_text.logprobs`: Include logprobs with assistant messages.\n- `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)."
},
- "OpenAI.CustomToolParam": {
+ "OpenAI.InlineSkillParam": {
"type": "object",
"required": [
"type",
- "name"
+ "name",
+ "description",
+ "source"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom"
+ "inline"
],
- "description": "The type of the custom tool. Always `custom`.",
+ "description": "Defines an inline skill for this request.",
"x-stainless-const": true
},
"name": {
"type": "string",
- "description": "The name of the custom tool, used to identify it in tool calls."
+ "description": "The name of the skill."
},
"description": {
"type": "string",
- "description": "Optional description of the custom tool, used to provide more context."
- },
- "format": {
- "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat",
- "description": "The input format for the custom tool. Default is unconstrained text."
+ "description": "The description of the skill."
},
- "defer_loading": {
- "type": "boolean",
- "description": "Whether this tool should be deferred and discovered via tool search."
+ "source": {
+ "$ref": "#/components/schemas/OpenAI.InlineSkillSourceParam",
+ "description": "Inline skill payload"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ContainerSkill"
}
- ],
- "description": "A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)",
- "title": "Custom tool"
+ ]
},
- "OpenAI.CustomToolParamFormat": {
+ "OpenAI.InlineSkillSourceParam": {
"type": "object",
"required": [
- "type"
+ "type",
+ "media_type",
+ "data"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.CustomToolParamFormatType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "text": "#/components/schemas/OpenAI.CustomTextFormatParam",
- "grammar": "#/components/schemas/OpenAI.CustomGrammarFormatParam"
- }
- },
- "description": "The input format for the custom tool. Default is unconstrained text."
- },
- "OpenAI.CustomToolParamFormatType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
"type": "string",
"enum": [
- "text",
- "grammar"
- ]
- }
- ]
- },
- "OpenAI.DeletedConversationResource": {
- "type": "object",
- "required": [
- "object",
- "deleted",
- "id"
- ],
- "properties": {
- "object": {
+ "base64"
+ ],
+ "description": "The type of the inline skill source. Must be `base64`.",
+ "x-stainless-const": true,
+ "default": "base64"
+ },
+ "media_type": {
"type": "string",
"enum": [
- "conversation.deleted"
+ "application/zip"
],
+ "description": "The media type of the inline skill payload. Must be `application/zip`.",
"x-stainless-const": true,
- "default": "conversation.deleted"
- },
- "deleted": {
- "type": "boolean"
+ "default": "application/zip"
},
- "id": {
- "type": "string"
+ "data": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 70254592,
+ "description": "Base64-encoded skill zip bundle."
}
- }
- },
- "OpenAI.DetailEnum": {
- "type": "string",
- "enum": [
- "low",
- "high",
- "auto",
- "original"
- ]
+ },
+ "description": "Inline skill payload"
},
- "OpenAI.DoubleClickAction": {
+ "OpenAI.InputAudio": {
"type": "object",
"required": [
"type",
- "x",
- "y",
- "keys"
+ "input_audio"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "double_click"
+ "input_audio"
],
- "description": "Specifies the event type. For a double click action, this property is always set to `double_click`.",
+ "description": "The type of the input item. Always `input_audio`.",
"x-stainless-const": true
},
- "x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate where the double click occurred."
- },
- "y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate where the double click occurred."
- },
- "keys": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "input_audio": {
+ "$ref": "#/components/schemas/OpenAI.InputAudioInputAudio"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
}
],
- "description": "A double click action.",
- "title": "DoubleClick"
+ "description": "An audio input to the model.",
+ "title": "Input audio"
},
- "OpenAI.DragParam": {
+ "OpenAI.InputAudioInputAudio": {
"type": "object",
"required": [
- "type",
- "path"
+ "data",
+ "format"
],
"properties": {
- "type": {
+ "data": {
+ "type": "string"
+ },
+ "format": {
"type": "string",
"enum": [
- "drag"
- ],
- "description": "Specifies the event type. For a drag action, this property is always set to `drag`.",
- "x-stainless-const": true
- },
- "path": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.CoordParam"
- },
- "description": "An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg\n ```\n [\n { x: 100, y: 200 },\n { x: 200, y: 300 }\n ]\n ```"
- },
- "keys": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
+ "mp3",
+ "wav"
]
}
+ }
+ },
+ "OpenAI.InputContent": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.InputContentType"
+ }
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "input_text": "#/components/schemas/OpenAI.InputContentInputTextContent",
+ "input_image": "#/components/schemas/OpenAI.InputContentInputImageContent",
+ "input_file": "#/components/schemas/OpenAI.InputContentInputFileContent"
}
- ],
- "description": "A drag action.",
- "title": "Drag"
+ }
},
- "OpenAI.EasyInputMessage": {
+ "OpenAI.InputContentInputFileContent": {
"type": "object",
"required": [
- "role",
- "content",
"type"
],
"properties": {
- "role": {
+ "type": {
"type": "string",
"enum": [
- "user",
- "assistant",
- "system",
- "developer"
- ],
- "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`."
- },
- "content": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
- }
+ "input_file"
],
- "description": "Text, image, or audio input to the model, used to generate a response.\n Can also contain previous assistant responses."
+ "description": "The type of the input item. Always `input_file`.",
+ "x-stainless-const": true,
+ "default": "input_file"
},
- "phase": {
+ "file_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "type": {
+ "filename": {
"type": "string",
- "enum": [
- "message"
- ],
- "description": "The type of the message input. Always `message`.",
- "x-stainless-const": true
+ "description": "The name of the file to be sent to the model."
},
- "status": {
+ "file_data": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The content of the file to be sent to the model."
+ },
+ "file_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the file to be sent to the model."
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.InputContent"
}
],
- "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.",
- "title": "Input message"
- },
- "OpenAI.EmptyModelParam": {
- "type": "object"
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OpenAI.Error": {
+ "OpenAI.InputContentInputImageContent": {
"type": "object",
"required": [
- "code",
- "message"
+ "type",
+ "detail"
],
"properties": {
- "code": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "input_image"
+ ],
+ "description": "The type of the input item. Always `input_image`.",
+ "x-stainless-const": true,
+ "default": "input_image"
+ },
+ "image_url": {
"anyOf": [
{
- "type": "string"
+ "type": "string",
+ "format": "uri"
},
{
"type": "null"
}
]
},
- "message": {
- "type": "string"
- },
- "param": {
+ "file_id": {
"anyOf": [
{
"type": "string"
@@ -35488,626 +55776,884 @@
}
]
},
- "type": {
- "type": "string"
- },
- "details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Error"
- }
- },
- "additionalInfo": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "debugInfo": {
- "type": "object",
- "unevaluatedProperties": {}
- }
- }
- },
- "OpenAI.EvalApiError": {
- "type": "object",
- "required": [
- "code",
- "message"
- ],
- "properties": {
- "code": {
- "type": "string",
- "description": "The error code."
- },
- "message": {
- "type": "string",
- "description": "The error message."
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
- "description": "An object representing an error response from the Eval API.",
- "title": "EvalApiError",
- "x-oaiMeta": {
- "name": "The API error object",
- "group": "evals",
- "example": "{\n \"code\": \"internal_error\",\n \"message\": \"The eval run failed due to an internal error.\"\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputContent"
+ }
+ ],
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
+ "title": "Input image"
},
- "OpenAI.EvalGraderLabelModel": {
+ "OpenAI.InputContentInputTextContent": {
"type": "object",
"required": [
"type",
- "name",
- "model",
- "input",
- "labels",
- "passing_labels"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "label_model"
+ "input_text"
],
- "description": "The object type, which is always `label_model`.",
- "x-stainless-const": true
+ "description": "The type of the input item. Always `input_text`.",
+ "x-stainless-const": true,
+ "default": "input_text"
},
- "name": {
+ "text": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The text input to the model."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputContent"
+ }
+ ],
+ "description": "A text input to the model.",
+ "title": "Input text"
+ },
+ "OpenAI.InputContentType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "model": {
+ {
"type": "string",
- "description": "The model to use for the evaluation. Must support structured outputs."
- },
- "input": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- }
- },
- "labels": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The labels to assign to each item in the evaluation."
- },
- "passing_labels": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The labels that indicate a passing result. Must be a subset of labels."
+ "enum": [
+ "input_text",
+ "input_image",
+ "input_file"
+ ]
}
- },
- "title": "LabelModelGrader"
+ ]
},
- "OpenAI.EvalGraderPython": {
+ "OpenAI.InputFidelity": {
+ "type": "string",
+ "enum": [
+ "high",
+ "low"
+ ],
+ "description": "Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`."
+ },
+ "OpenAI.InputFileContent": {
"type": "object",
"required": [
- "type",
- "name",
- "source"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "python"
+ "input_file"
],
- "description": "The object type, which is always `python`.",
- "x-stainless-const": true
+ "description": "The type of the input item. Always `input_file`.",
+ "x-stainless-const": true,
+ "default": "input_file"
},
- "name": {
+ "file_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "filename": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The name of the file to be sent to the model."
},
- "source": {
+ "file_data": {
"type": "string",
- "description": "The source code of the python script."
+ "description": "The content of the file to be sent to the model."
},
- "image_tag": {
+ "file_url": {
"type": "string",
- "description": "The image tag to use for the python script."
+ "format": "uri",
+ "description": "The URL of the file to be sent to the model."
},
- "pass_threshold": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The threshold for the score."
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
- "title": "PythonGrader"
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OpenAI.EvalGraderScoreModel": {
+ "OpenAI.InputFileContentParam": {
"type": "object",
"required": [
- "type",
- "name",
- "model",
- "input"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "score_model"
+ "input_file"
],
- "description": "The object type, which is always `score_model`.",
- "x-stainless-const": true
- },
- "name": {
- "type": "string",
- "description": "The name of the grader."
+ "description": "The type of the input item. Always `input_file`.",
+ "x-stainless-const": true,
+ "default": "input_file"
},
- "model": {
- "type": "string",
- "description": "The model to use for the evaluation."
+ "file_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "sampling_params": {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams",
- "description": "The sampling parameters for the model."
+ "filename": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "input": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- },
- "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings."
+ "file_data": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "range": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "description": "The range of the score. Defaults to `[0, 1]`."
+ "file_url": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "pass_threshold": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The threshold for the score."
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
- "title": "ScoreModelGrader"
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OpenAI.EvalGraderScoreModelSamplingParams": {
+ "OpenAI.InputImageContent": {
"type": "object",
+ "required": [
+ "type",
+ "detail"
+ ],
"properties": {
- "seed": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "input_image"
+ ],
+ "description": "The type of the input item. Always `input_image`.",
+ "x-stainless-const": true,
+ "default": "input_image"
+ },
+ "image_url": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string",
+ "format": "uri"
},
{
"type": "null"
}
]
},
- "top_p": {
+ "file_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "type": "string"
},
{
"type": "null"
}
+ ]
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
+ }
+ },
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
+ "title": "Input image"
+ },
+ "OpenAI.InputImageContentParamAutoParam": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "input_image"
],
- "default": 1
+ "description": "The type of the input item. Always `input_image`.",
+ "x-stainless-const": true,
+ "default": "input_image"
},
- "temperature": {
+ "image_url": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "file_id": {
+ "anyOf": [
+ {
+ "type": "string"
},
{
"type": "null"
}
]
},
- "max_completions_tokens": {
+ "detail": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "$ref": "#/components/schemas/OpenAI.DetailEnum"
},
{
"type": "null"
}
]
- },
- "reasoning_effort": {
+ }
+ },
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision)",
+ "title": "Input image"
+ },
+ "OpenAI.InputItem": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.InputItemType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "message": "#/components/schemas/OpenAI.EasyInputMessage",
+ "item_reference": "#/components/schemas/OpenAI.ItemReferenceParam",
+ "output_message": "#/components/schemas/OpenAI.InputItemOutputMessage",
+ "file_search_call": "#/components/schemas/OpenAI.InputItemFileSearchToolCall",
+ "computer_call": "#/components/schemas/OpenAI.InputItemComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.InputItemComputerCallOutputItemParam",
+ "web_search_call": "#/components/schemas/OpenAI.InputItemWebSearchToolCall",
+ "function_call": "#/components/schemas/OpenAI.InputItemFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.InputItemFunctionCallOutputItemParam",
+ "tool_search_call": "#/components/schemas/OpenAI.InputItemToolSearchCallItemParam",
+ "tool_search_output": "#/components/schemas/OpenAI.InputItemToolSearchOutputItemParam",
+ "additional_tools": "#/components/schemas/OpenAI.InputItemAdditionalToolsItemParam",
+ "reasoning": "#/components/schemas/OpenAI.InputItemReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.InputItemCompactionSummaryItemParam",
+ "image_generation_call": "#/components/schemas/OpenAI.InputItemImageGenToolCall",
+ "code_interpreter_call": "#/components/schemas/OpenAI.InputItemCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.InputItemLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.InputItemLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.InputItemFunctionShellCallItemParam",
+ "shell_call_output": "#/components/schemas/OpenAI.InputItemFunctionShellCallOutputItemParam",
+ "apply_patch_call": "#/components/schemas/OpenAI.InputItemApplyPatchToolCallItemParam",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.InputItemApplyPatchToolCallOutputItemParam",
+ "mcp_list_tools": "#/components/schemas/OpenAI.InputItemMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.InputItemMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.InputItemMcpApprovalResponse",
+ "mcp_call": "#/components/schemas/OpenAI.InputItemMcpToolCall",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.InputItemCustomToolCallOutput",
+ "custom_tool_call": "#/components/schemas/OpenAI.InputItemCustomToolCall"
+ }
+ },
+ "description": "An item representing part of the context for the response to be\ngenerated by the model. Can contain text, images, and audio inputs,\nas well as previous assistant responses and tool call outputs."
+ },
+ "OpenAI.InputItemAdditionalToolsItemParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "role",
+ "tools"
+ ],
+ "properties": {
+ "id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ "type": "string"
},
{
"type": "null"
}
]
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "additional_tools"
+ ],
+ "description": "The item type. Always `additional_tools`.",
+ "x-stainless-const": true,
+ "default": "additional_tools"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "developer"
+ ],
+ "description": "The role that provided the additional tools. Only `developer` is supported.",
+ "x-stainless-const": true,
+ "default": "developer"
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "A list of additional tools made available at this item."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ]
},
- "OpenAI.EvalGraderStringCheck": {
+ "OpenAI.InputItemApplyPatchToolCallItemParam": {
"type": "object",
"required": [
"type",
- "name",
- "input",
- "reference",
+ "call_id",
+ "status",
"operation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "string_check"
+ "apply_patch_call"
],
- "description": "The object type, which is always `string_check`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `apply_patch_call`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call"
},
- "name": {
- "type": "string",
- "description": "The name of the grader."
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "input": {
+ "call_id": {
"type": "string",
- "description": "The input text. This may include template strings."
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
- "reference": {
- "type": "string",
- "description": "The reference text. This may include template strings."
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatusParam",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
},
"operation": {
- "type": "string",
- "enum": [
- "eq",
- "ne",
- "like",
- "ilike"
- ],
- "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam",
+ "description": "The specific create, delete, or update instruction for the apply_patch tool call."
}
},
- "title": "StringCheckGrader"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A tool call representing a request to create, delete, or update files using diff patches.",
+ "title": "Apply patch tool call"
},
- "OpenAI.EvalGraderTextSimilarity": {
+ "OpenAI.InputItemApplyPatchToolCallOutputItemParam": {
"type": "object",
"required": [
"type",
- "name",
- "input",
- "reference",
- "evaluation_metric",
- "pass_threshold"
+ "call_id",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "text_similarity"
+ "apply_patch_call_output"
],
- "description": "The type of grader.",
+ "description": "The type of the item. Always `apply_patch_call_output`.",
"x-stainless-const": true,
- "default": "text_similarity"
- },
- "name": {
- "type": "string",
- "description": "The name of the grader."
+ "default": "apply_patch_call_output"
},
- "input": {
- "type": "string",
- "description": "The text being graded."
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "reference": {
+ "call_id": {
"type": "string",
- "description": "The text being graded against."
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
- "evaluation_metric": {
- "type": "string",
- "enum": [
- "cosine",
- "fuzzy_match",
- "bleu",
- "gleu",
- "meteor",
- "rouge_1",
- "rouge_2",
- "rouge_3",
- "rouge_4",
- "rouge_5",
- "rouge_l"
- ],
- "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`."
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
},
- "pass_threshold": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The threshold for the score."
+ "output": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "title": "TextSimilarityGrader"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "The streamed output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
},
- "OpenAI.EvalItem": {
+ "OpenAI.InputItemCodeInterpreterToolCall": {
"type": "object",
"required": [
- "role",
- "content"
+ "type",
+ "id",
+ "status",
+ "container_id",
+ "code",
+ "outputs"
],
"properties": {
- "role": {
+ "type": {
"type": "string",
"enum": [
- "user",
- "assistant",
- "system",
- "developer"
+ "code_interpreter_call"
],
- "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`."
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "x-stainless-const": true,
+ "default": "code_interpreter_call"
},
- "content": {
- "$ref": "#/components/schemas/OpenAI.EvalItemContent"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the code interpreter tool call."
},
- "type": {
+ "status": {
"type": "string",
"enum": [
- "message"
+ "in_progress",
+ "completed",
+ "incomplete",
+ "interpreting",
+ "failed"
],
- "description": "The type of the message input. Always `message`.",
- "x-stainless-const": true
- }
- },
- "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.",
- "title": "Eval message object"
- },
- "OpenAI.EvalItemContent": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItem"
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
},
- {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentArray"
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the container used to run the code."
+ },
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "outputs": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- ],
- "description": "Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.",
- "title": "Eval content"
- },
- "OpenAI.EvalItemContentArray": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItem"
},
- "description": "A list of inputs, each of which may be either an input text, output text, input\nimage, or input audio object.",
- "title": "An array of Input text, Output text, Input image, and Input audio"
- },
- "OpenAI.EvalItemContentItem": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentText"
- },
+ "allOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A single content item: input text, output text, input image, or input audio.",
- "title": "Eval content item"
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
},
- "OpenAI.EvalItemContentItemObject": {
+ "OpenAI.InputItemCompactionSummaryItemParam": {
"type": "object",
"required": [
- "type"
+ "type",
+ "encrypted_content"
],
"properties": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
"type": {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObjectType"
+ "type": "string",
+ "enum": [
+ "compaction"
+ ],
+ "description": "The type of the item. Always `compaction`.",
+ "x-stainless-const": true,
+ "default": "compaction"
+ },
+ "encrypted_content": {
+ "type": "string",
+ "maxLength": 10485760,
+ "description": "The encrypted content of the compaction summary."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "output_text": "#/components/schemas/OpenAI.EvalItemContentOutputText",
- "input_image": "#/components/schemas/OpenAI.EvalItemInputImage",
- "input_audio": "#/components/schemas/OpenAI.InputAudio",
- "input_text": "#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
- },
- "description": "A single content item: input text, output text, input image, or input audio.",
- "title": "Eval content item"
+ ],
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "OpenAI.EvalItemContentItemObjectInputTextContent": {
+ "OpenAI.InputItemComputerCallOutputItemParam": {
"type": "object",
"required": [
+ "call_id",
"type",
- "text"
+ "output"
],
"properties": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The ID of the computer tool call that produced the output."
+ },
"type": {
"type": "string",
"enum": [
- "input_text"
+ "computer_call_output"
],
- "description": "The type of the input item. Always `input_text`.",
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
"x-stainless-const": true,
- "default": "input_text"
+ "default": "computer_call_output"
},
- "text": {
- "type": "string",
- "description": "The text input to the model."
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ },
+ "acknowledged_safety_checks": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "status": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A text input to the model.",
- "title": "Input text"
- },
- "OpenAI.EvalItemContentItemObjectType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "input_text",
- "output_text",
- "input_image",
- "input_audio"
- ]
- }
- ]
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "OpenAI.EvalItemContentOutputText": {
+ "OpenAI.InputItemComputerToolCall": {
"type": "object",
"required": [
"type",
- "text"
+ "id",
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "output_text"
+ "computer_call"
],
- "description": "The type of the output text. Always `output_text`.",
- "x-stainless-const": true
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
- "text": {
+ "id": {
"type": "string",
- "description": "The text output from the model."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ "description": "The unique ID of the computer call."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used when responding to the tool call with output."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ },
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ },
+ "pending_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The pending safety checks for the computer call."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
- ],
- "description": "A text output from the model.",
- "title": "Output text"
- },
- "OpenAI.EvalItemContentText": {
- "type": "string",
- "description": "A text input to the model.",
- "title": "Text input"
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "OpenAI.EvalItemInputImage": {
+ "OpenAI.InputItemCustomToolCall": {
"type": "object",
"required": [
"type",
- "image_url"
+ "call_id",
+ "name",
+ "input"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_image"
+ "custom_tool_call"
],
- "description": "The type of the image input. Always `input_image`.",
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
"x-stainless-const": true
},
- "image_url": {
+ "id": {
"type": "string",
- "format": "uri",
- "description": "The URL of the image input."
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
},
- "detail": {
+ "call_id": {
"type": "string",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`."
+ "description": "An identifier used to map this custom tool call to a tool call output."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the custom tool being called."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom tool being called."
+ },
+ "input": {
+ "type": "string",
+ "description": "The input for the custom tool call generated by the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "An image input block used within EvalItem content arrays.",
- "title": "Input image"
+ "description": "A call to a custom tool created by the model.",
+ "title": "Custom tool call"
},
- "OpenAI.EvalJsonlFileContentSource": {
+ "OpenAI.InputItemCustomToolCallOutput": {
"type": "object",
"required": [
"type",
- "content"
+ "call_id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "file_content"
+ "custom_tool_call_output"
],
- "description": "The type of jsonl source. Always `file_content`.",
- "x-stainless-const": true,
- "default": "file_content"
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "x-stainless-const": true
},
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent"
- },
- "description": "The content of the jsonl file."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
}
},
- "title": "EvalJsonlFileContentSource"
- },
- "OpenAI.EvalJsonlFileContentSourceContent": {
- "type": "object",
- "required": [
- "item"
- ],
- "properties": {
- "item": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "sample": {
- "type": "object",
- "unevaluatedProperties": {}
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
- }
+ ],
+ "description": "The output of a custom tool call from your code, being sent back to the model.",
+ "title": "Custom tool call output"
},
- "OpenAI.EvalJsonlFileIdSource": {
+ "OpenAI.InputItemFileSearchToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "id"
+ "status",
+ "queries"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the file search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "file_id"
+ "file_search_call"
],
- "description": "The type of jsonl source. Always `file_id`.",
- "x-stainless-const": true,
- "default": "file_id"
+ "description": "The type of the file search tool call. Always `file_search_call`.",
+ "x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The identifier of the file."
- }
- },
- "title": "EvalJsonlFileIdSource"
- },
- "OpenAI.EvalResponsesSource": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "status": {
"type": "string",
"enum": [
- "responses"
+ "in_progress",
+ "searching",
+ "completed",
+ "incomplete",
+ "failed"
],
- "description": "The type of run data source. Always `responses`."
+ "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
},
- "metadata": {
+ "queries": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The queries used to search for files."
+ },
+ "results": {
"anyOf": [
{
- "type": "object",
- "unevaluatedProperties": {}
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
+ }
},
{
"type": "null"
}
]
- },
- "model": {
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
+ "title": "File search tool call"
+ },
+ "OpenAI.InputItemFunctionCallOutputItemParam": {
+ "type": "object",
+ "required": [
+ "call_id",
+ "type",
+ "output"
+ ],
+ "properties": {
+ "id": {
"anyOf": [
{
"type": "string"
@@ -36117,87 +56663,184 @@
}
]
},
- "instructions_search": {
- "anyOf": [
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "function_call_output"
+ ],
+ "description": "The type of the function tool call output. Always `function_call_output`.",
+ "x-stainless-const": true,
+ "default": "function_call_output"
+ },
+ "output": {
+ "oneOf": [
{
"type": "string"
},
{
- "type": "null"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputTextContentParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputImageContentParamAutoParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFileContentParam"
+ }
+ ]
+ }
}
- ]
+ ],
+ "description": "Text, image, or file output of the function tool call."
},
- "created_after": {
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
},
{
"type": "null"
}
]
- },
- "created_before": {
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
+ },
+ "OpenAI.InputItemFunctionShellCallItemParam": {
+ "type": "object",
+ "required": [
+ "call_id",
+ "type",
+ "action"
+ ],
+ "properties": {
+ "id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "reasoning_effort": {
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "shell_call"
+ ],
+ "description": "The type of the item. Always `shell_call`.",
+ "x-stainless-const": true,
+ "default": "shell_call"
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellActionParam",
+ "description": "The shell commands and limits that describe how to run the tool call."
+ },
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
},
{
"type": "null"
}
- ],
- "description": "Optional reasoning effort parameter. This is a query parameter used to select responses."
+ ]
},
- "temperature": {
+ "environment": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
},
{
"type": "null"
}
]
- },
- "top_p": {
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A tool representing a request to execute one or more shell commands.",
+ "title": "Shell tool call"
+ },
+ "OpenAI.InputItemFunctionShellCallOutputItemParam": {
+ "type": "object",
+ "required": [
+ "call_id",
+ "type",
+ "output"
+ ],
+ "properties": {
+ "id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "users": {
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "shell_call_output"
+ ],
+ "description": "The type of the item. Always `shell_call_output`.",
+ "x-stainless-const": true,
+ "default": "shell_call_output"
+ },
+ "output": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContentParam"
+ },
+ "description": "Captured chunks of stdout and stderr output, along with their associated outcomes."
+ },
+ "status": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
},
{
"type": "null"
}
]
},
- "tools": {
+ "max_output_length": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
@@ -36205,201 +56848,294 @@
]
}
},
- "description": "A EvalResponsesSource object describing a run data source configuration.",
- "title": "EvalResponsesSource",
- "x-oaiMeta": {
- "name": "The run data source object used to configure an individual run",
- "group": "eval runs",
- "example": "{\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"temperature\": 0.7,\n \"top_p\": 1.0,\n \"users\": [\"user1\", \"user2\"],\n \"tools\": [\"tool1\", \"tool2\"],\n \"instructions_search\": \"You are a coding assistant\"\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "The streamed output items emitted by a shell tool call.",
+ "title": "Shell tool call output"
},
- "OpenAI.EvalRunOutputItemSample": {
+ "OpenAI.InputItemFunctionToolCall": {
"type": "object",
"required": [
- "input",
- "output",
- "finish_reason",
- "model",
- "usage",
- "error",
- "temperature",
- "max_completion_tokens",
- "top_p",
- "seed"
+ "id",
+ "type",
+ "call_id",
+ "name",
+ "arguments"
],
"properties": {
- "input": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunOutputItemSampleInput"
- }
- },
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EvalRunOutputItemSampleOutput"
- }
- },
- "finish_reason": {
- "type": "string"
- },
- "model": {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call.",
+ "readOnly": true
},
- "usage": {
- "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage"
+ "type": {
+ "type": "string",
+ "enum": [
+ "function_call"
+ ],
+ "description": "The type of the function tool call. Always `function_call`.",
+ "x-stainless-const": true
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.EvalApiError"
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
},
- "temperature": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the function to run."
},
- "max_completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "name": {
+ "type": "string",
+ "description": "The name of the function to run."
},
- "top_p": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the function."
},
- "seed": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
+ "title": "Function tool call"
},
- "OpenAI.EvalRunOutputItemSampleUsage": {
+ "OpenAI.InputItemImageGenToolCall": {
"type": "object",
"required": [
- "total_tokens",
- "completion_tokens",
- "prompt_tokens",
- "cached_tokens"
+ "type",
+ "id",
+ "status",
+ "result"
],
"properties": {
- "total_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": {
+ "type": "string",
+ "enum": [
+ "image_generation_call"
+ ],
+ "description": "The type of the image generation call. Always `image_generation_call`.",
+ "x-stainless-const": true
},
- "completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the image generation call."
},
- "prompt_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "generating",
+ "failed"
+ ],
+ "description": "The status of the image generation call."
},
- "cached_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "result": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
},
- "OpenAI.EvalRunPerModelUsage": {
+ "OpenAI.InputItemLocalShellToolCall": {
"type": "object",
"required": [
- "model_name",
- "invocation_count",
- "prompt_tokens",
- "completion_tokens",
- "total_tokens",
- "cached_tokens"
+ "type",
+ "id",
+ "call_id",
+ "action",
+ "status"
],
"properties": {
- "model_name": {
- "type": "string"
- },
- "invocation_count": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": {
+ "type": "string",
+ "enum": [
+ "local_shell_call"
+ ],
+ "description": "The type of the local shell call. Always `local_shell_call`.",
+ "x-stainless-const": true
},
- "prompt_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell call."
},
- "completion_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
},
- "total_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
},
- "cached_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the local shell call."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A tool call to run a command on the local shell.",
+ "title": "Local shell call"
},
- "OpenAI.EvalRunPerTestingCriteriaResults": {
+ "OpenAI.InputItemLocalShellToolCallOutput": {
"type": "object",
"required": [
- "testing_criteria",
- "passed",
- "failed"
+ "type",
+ "id",
+ "output"
],
"properties": {
- "testing_criteria": {
- "type": "string"
- },
- "passed": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": {
+ "type": "string",
+ "enum": [
+ "local_shell_call_output"
+ ],
+ "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "x-stainless-const": true
},
- "failed": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
},
- "errored": {
- "$ref": "#/components/schemas/integer",
- "description": "Number of tests that errored for this criteria."
+ "output": {
+ "type": "string",
+ "description": "A JSON string of the output of the local shell tool call."
},
- "skipped": {
- "$ref": "#/components/schemas/integer",
- "description": "Number of tests that were skipped for this criteria."
+ "status": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "The output of a local shell tool call.",
+ "title": "Local shell call output"
},
- "OpenAI.EvalRunResultCounts": {
+ "OpenAI.InputItemMcpApprovalRequest": {
"type": "object",
"required": [
- "total",
- "errored",
- "failed",
- "passed"
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
- "total": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp_approval_request"
+ ],
+ "description": "The type of the item. Always `mcp_approval_request`.",
+ "x-stainless-const": true
},
- "errored": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the approval request."
},
- "failed": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server making the request."
},
- "passed": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "name": {
+ "type": "string",
+ "description": "The name of the tool to run."
},
- "skipped": {
- "$ref": "#/components/schemas/integer",
- "description": "Number of output items that were skipped during the evaluation."
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of arguments for the tool."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A request for human approval of a tool invocation.",
+ "title": "MCP approval request"
},
- "OpenAI.EvalStoredCompletionsSource": {
+ "OpenAI.InputItemMcpApprovalResponse": {
"type": "object",
"required": [
- "type"
+ "type",
+ "approval_request_id",
+ "approve"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "stored_completions"
+ "mcp_approval_response"
],
- "description": "The type of source. Always `stored_completions`.",
- "x-stainless-const": true,
- "default": "stored_completions"
+ "description": "The type of the item. Always `mcp_approval_response`.",
+ "x-stainless-const": true
},
- "metadata": {
+ "id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "model": {
+ "approval_request_id": {
+ "type": "string",
+ "description": "The ID of the approval request being answered."
+ },
+ "approve": {
+ "type": "boolean",
+ "description": "Whether the request was approved."
+ },
+ "reason": {
"anyOf": [
{
"type": "string"
@@ -36408,31 +57144,116 @@
"type": "null"
}
]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A response to an MCP approval request.",
+ "title": "MCP approval response"
+ },
+ "OpenAI.InputItemMcpListTools": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "server_label",
+ "tools"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp_list_tools"
+ ],
+ "description": "The type of the item. Always `mcp_list_tools`.",
+ "x-stainless-const": true
},
- "created_after": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the list."
},
- "created_before": {
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
+ },
+ "description": "The tools available on the server."
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "A list of tools available on an MCP server.",
+ "title": "MCP list tools"
+ },
+ "OpenAI.InputItemMcpToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp_call"
+ ],
+ "description": "The type of the item. Always `mcp_call`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool call."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server running the tool."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tool that was run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments passed to the tool."
+ },
+ "output": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "limit": {
+ "error": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
+ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ },
+ "approval_request_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
"type": "null"
@@ -36440,530 +57261,595 @@
]
}
},
- "description": "A StoredCompletionsRunDataSource configuration describing a set of filters",
- "title": "StoredCompletionsRunDataSource",
- "x-oaiMeta": {
- "name": "The stored completions data source object used to configure an individual run",
- "group": "eval runs",
- "example": "{\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o\",\n \"created_after\": 1668124800,\n \"created_before\": 1668124900,\n \"limit\": 100,\n \"metadata\": {}\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "An invocation of a tool on an MCP server.",
+ "title": "MCP tool call"
},
- "OpenAI.FileCitationBody": {
+ "OpenAI.InputItemOutputMessage": {
"type": "object",
"required": [
+ "id",
"type",
- "file_id",
- "index",
- "filename"
+ "role",
+ "content",
+ "status"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the output message."
+ },
"type": {
"type": "string",
"enum": [
- "file_citation"
+ "output_message"
],
- "description": "The type of the file citation. Always `file_citation`.",
+ "description": "The type of the output message. Always `message`.",
"x-stainless-const": true
},
- "file_id": {
+ "role": {
"type": "string",
- "description": "The ID of the file."
+ "enum": [
+ "assistant"
+ ],
+ "description": "The role of the output message. Always `assistant`.",
+ "x-stainless-const": true
},
- "index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the file in the list of files."
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ },
+ "description": "The content of the output message."
},
- "filename": {
+ "phase": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "status": {
"type": "string",
- "description": "The filename of the file cited."
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Annotation"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A citation to a file.",
- "title": "File citation"
- },
- "OpenAI.FileInputDetail": {
- "type": "string",
- "enum": [
- "low",
- "high"
- ]
+ "description": "An output message from the model.",
+ "title": "Output message"
},
- "OpenAI.FilePath": {
+ "OpenAI.InputItemReasoningItem": {
"type": "object",
"required": [
"type",
- "file_id",
- "index"
+ "id",
+ "summary"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "file_path"
+ "reasoning"
],
- "description": "The type of the file path. Always `file_path`.",
+ "description": "The type of the object. Always `reasoning`.",
"x-stainless-const": true
},
- "file_id": {
+ "id": {
"type": "string",
- "description": "The ID of the file."
+ "description": "The unique identifier of the reasoning content."
},
- "index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the file in the list of files."
+ "encrypted_content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
+ },
+ "description": "Reasoning summary content."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ },
+ "description": "Reasoning text content."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Annotation"
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
],
- "description": "A path to a file.",
- "title": "File path"
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
},
- "OpenAI.FileSearchTool": {
+ "OpenAI.InputItemToolSearchCallItemParam": {
"type": "object",
"required": [
"type",
- "vector_store_ids"
+ "arguments"
],
"properties": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "call_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
"type": {
"type": "string",
"enum": [
- "file_search"
+ "tool_search_call"
],
- "description": "The type of the file search tool. Always `file_search`.",
- "x-stainless-const": true
+ "description": "The item type. Always `tool_search_call`.",
+ "x-stainless-const": true,
+ "default": "tool_search_call"
},
- "vector_store_ids": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The IDs of the vector stores to search."
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
},
- "max_num_results": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive."
+ "arguments": {
+ "$ref": "#/components/schemas/OpenAI.EmptyModelParam",
+ "description": "The arguments supplied to the tool search call."
},
- "ranking_options": {
- "$ref": "#/components/schemas/OpenAI.RankingOptions",
- "description": "Ranking options for search."
+ "status": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ]
+ },
+ "OpenAI.InputItemToolSearchOutputItemParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "tools"
+ ],
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "filters": {
+ "call_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Filters"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "name": {
+ "type": {
"type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "enum": [
+ "tool_search_output"
+ ],
+ "description": "The item type. Always `tool_search_output`.",
+ "x-stainless-const": true,
+ "default": "tool_search_output"
},
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
},
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
},
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "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).",
- "title": "File search"
- },
- "OpenAI.FileSearchToolCallResults": {
- "type": "object",
- "properties": {
- "file_id": {
- "type": "string"
- },
- "text": {
- "type": "string"
- },
- "filename": {
- "type": "string"
+ "description": "The loaded tool definitions returned by the tool search output."
},
- "attributes": {
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
},
{
"type": "null"
}
]
- },
- "score": {
- "type": "number",
- "format": "float"
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ]
},
- "OpenAI.Filters": {
+ "OpenAI.InputItemType": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.CompoundFilter"
+ "type": "string",
+ "enum": [
+ "message",
+ "output_message",
+ "file_search_call",
+ "computer_call",
+ "computer_call_output",
+ "web_search_call",
+ "function_call",
+ "function_call_output",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "reasoning",
+ "compaction",
+ "image_generation_call",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "mcp_call",
+ "custom_tool_call_output",
+ "custom_tool_call",
+ "item_reference"
+ ]
}
]
},
- "OpenAI.FineTuneDPOHyperparameters": {
+ "OpenAI.InputItemWebSearchToolCall": {
"type": "object",
+ "required": [
+ "id",
+ "type",
+ "status",
+ "action"
+ ],
"properties": {
- "beta": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_search_call"
],
- "description": "The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.",
- "default": "auto"
+ "description": "The type of the web search tool call. Always `web_search_call`.",
+ "x-stainless-const": true
},
- "batch_size": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
],
- "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
- "default": "auto"
+ "description": "The status of the web search tool call."
},
- "learning_rate_multiplier": {
+ "action": {
"oneOf": [
{
- "type": "string",
- "enum": [
- "auto"
- ]
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
},
{
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
- "default": "auto"
- },
- "n_epochs": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
},
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
}
],
- "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
- "default": "auto"
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
}
},
- "description": "The hyperparameters used for the DPO fine-tuning job."
- },
- "OpenAI.FineTuneDPOMethod": {
- "type": "object",
- "properties": {
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.FineTuneDPOHyperparameters"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
}
+ ],
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
+ },
+ "OpenAI.InputMessageContentList": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputContent"
},
- "description": "Configuration for the DPO fine-tuning method."
+ "description": "A list of one or many input items to the model, containing different content\ntypes.",
+ "title": "Input item content list"
},
- "OpenAI.FineTuneMethod": {
+ "OpenAI.InputParam": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ }
+ ],
+ "description": "Text, image, or file inputs to the model, used to generate a response.\nLearn more:\n- [Text inputs and outputs](/docs/guides/text)\n- [Image inputs](/docs/guides/images)\n- [File inputs](/docs/guides/pdf-files)\n- [Conversation state](/docs/guides/conversation-state)\n- [Function calling](/docs/guides/function-calling)"
+ },
+ "OpenAI.InputTextContent": {
"type": "object",
"required": [
- "type"
+ "type",
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "supervised",
- "dpo",
- "reinforcement"
+ "input_text"
],
- "description": "The type of method. Is either `supervised`, `dpo`, or `reinforcement`."
- },
- "supervised": {
- "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedMethod"
- },
- "dpo": {
- "$ref": "#/components/schemas/OpenAI.FineTuneDPOMethod"
+ "description": "The type of the input item. Always `input_text`.",
+ "x-stainless-const": true,
+ "default": "input_text"
},
- "reinforcement": {
- "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementMethod"
+ "text": {
+ "type": "string",
+ "description": "The text input to the model."
}
},
- "description": "The method used for fine-tuning."
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.FineTuneReinforcementHyperparameters": {
+ "OpenAI.InputTextContentParam": {
"type": "object",
+ "required": [
+ "type",
+ "text"
+ ],
"properties": {
- "batch_size": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
- "default": "auto"
- },
- "learning_rate_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
- "default": "auto"
- },
- "n_epochs": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
- "default": "auto"
- },
- "reasoning_effort": {
+ "type": {
"type": "string",
"enum": [
- "default",
- "low",
- "medium",
- "high"
- ],
- "description": "Level of reasoning effort.",
- "default": "default"
- },
- "compute_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "description": "Multiplier on amount of compute used for exploring search space during training.",
- "default": "auto"
- },
- "eval_interval": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
+ "input_text"
],
- "description": "The number of training steps between evaluation runs.",
- "default": "auto"
+ "description": "The type of the input item. Always `input_text`.",
+ "x-stainless-const": true,
+ "default": "input_text"
},
- "eval_samples": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "Number of evaluation samples to generate per training step.",
- "default": "auto"
+ "text": {
+ "type": "string",
+ "maxLength": 10485760,
+ "description": "The text input to the model."
}
},
- "description": "The hyperparameters used for the reinforcement fine-tuning job."
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.FineTuneReinforcementMethod": {
+ "OpenAI.Item": {
"type": "object",
"required": [
- "grader"
+ "type"
],
"properties": {
- "grader": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderPython"
- },
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ItemType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "message": "#/components/schemas/OpenAI.ItemInputMessage",
+ "output_message": "#/components/schemas/OpenAI.ItemOutputMessage",
+ "file_search_call": "#/components/schemas/OpenAI.ItemFileSearchToolCall",
+ "computer_call": "#/components/schemas/OpenAI.ItemComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.ItemComputerCallOutputItemParam",
+ "web_search_call": "#/components/schemas/OpenAI.ItemWebSearchToolCall",
+ "function_call": "#/components/schemas/OpenAI.ItemFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.ItemFunctionCallOutputItemParam",
+ "tool_search_call": "#/components/schemas/OpenAI.ItemToolSearchCallItemParam",
+ "tool_search_output": "#/components/schemas/OpenAI.ItemToolSearchOutputItemParam",
+ "additional_tools": "#/components/schemas/OpenAI.ItemAdditionalToolsItemParam",
+ "reasoning": "#/components/schemas/OpenAI.ItemReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.ItemCompactionSummaryItemParam",
+ "image_generation_call": "#/components/schemas/OpenAI.ItemImageGenToolCall",
+ "code_interpreter_call": "#/components/schemas/OpenAI.ItemCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.ItemLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.ItemLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.ItemFunctionShellCallItemParam",
+ "shell_call_output": "#/components/schemas/OpenAI.ItemFunctionShellCallOutputItemParam",
+ "apply_patch_call": "#/components/schemas/OpenAI.ItemApplyPatchToolCallItemParam",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.ItemApplyPatchToolCallOutputItemParam",
+ "mcp_list_tools": "#/components/schemas/OpenAI.ItemMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.ItemMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.ItemMcpApprovalResponse",
+ "mcp_call": "#/components/schemas/OpenAI.ItemMcpToolCall",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.ItemCustomToolCallOutput",
+ "custom_tool_call": "#/components/schemas/OpenAI.ItemCustomToolCall"
+ }
+ },
+ "description": "Content item used to generate a response."
+ },
+ "OpenAI.ItemAdditionalToolsItemParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "role",
+ "tools"
+ ],
+ "properties": {
+ "id": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.GraderMulti"
+ "type": "null"
}
+ ]
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "additional_tools"
],
- "description": "The grader used for the fine-tuning job."
+ "description": "The item type. Always `additional_tools`.",
+ "x-stainless-const": true,
+ "default": "additional_tools"
},
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters"
+ "role": {
+ "type": "string",
+ "enum": [
+ "developer"
+ ],
+ "description": "The role that provided the additional tools. Only `developer` is supported.",
+ "x-stainless-const": true,
+ "default": "developer"
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "A list of additional tools made available at this item."
}
},
- "description": "Configuration for the reinforcement fine-tuning method."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ]
},
- "OpenAI.FineTuneSupervisedHyperparameters": {
+ "OpenAI.ItemApplyPatchToolCallItemParam": {
"type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "status",
+ "operation"
+ ],
"properties": {
- "batch_size": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
+ "type": {
+ "type": "string",
+ "enum": [
+ "apply_patch_call"
],
- "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.",
- "default": "auto"
+ "description": "The type of the item. Always `apply_patch_call`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call"
},
- "learning_rate_multiplier": {
- "oneOf": [
+ "id": {
+ "anyOf": [
{
- "type": "string",
- "enum": [
- "auto"
- ]
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "type": "null"
}
- ],
- "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.",
- "default": "auto"
+ ]
},
- "n_epochs": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.",
- "default": "auto"
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the apply patch tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatusParam",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ },
+ "operation": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam",
+ "description": "The specific create, delete, or update instruction for the apply_patch tool call."
}
},
- "description": "The hyperparameters used for the fine-tuning job."
- },
- "OpenAI.FineTuneSupervisedMethod": {
- "type": "object",
- "properties": {
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- },
- "description": "Configuration for the supervised fine-tuning method."
+ ],
+ "description": "A tool call representing a request to create, delete, or update files using diff patches.",
+ "title": "Apply patch tool call"
},
- "OpenAI.FineTuningIntegration": {
+ "OpenAI.ItemApplyPatchToolCallOutputItemParam": {
"type": "object",
"required": [
"type",
- "wandb"
+ "call_id",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "wandb"
+ "apply_patch_call_output"
],
- "description": "The type of the integration being enabled for the fine-tuning job",
- "x-stainless-const": true
- },
- "wandb": {
- "$ref": "#/components/schemas/OpenAI.FineTuningIntegrationWandb",
- "description": "The settings for your integration with Weights and Biases. This payload specifies the project that\n metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags\n to your run, and set a default entity (team, username, etc) to be associated with your run."
- }
- },
- "title": "Fine-Tuning Job Integration"
- },
- "OpenAI.FineTuningIntegrationWandb": {
- "type": "object",
- "required": [
- "project"
- ],
- "properties": {
- "project": {
- "type": "string"
+ "description": "The type of the item. Always `apply_patch_call_output`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call_output"
},
- "name": {
+ "id": {
"anyOf": [
{
"type": "string"
@@ -36973,7 +57859,17 @@
}
]
},
- "entity": {
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the apply patch tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ },
+ "output": {
"anyOf": [
{
"type": "string"
@@ -36982,146 +57878,176 @@
"type": "null"
}
]
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "The streamed output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
},
- "OpenAI.FineTuningJob": {
+ "OpenAI.ItemCodeInterpreterToolCall": {
"type": "object",
"required": [
+ "type",
"id",
- "created_at",
- "error",
- "fine_tuned_model",
- "finished_at",
- "hyperparameters",
- "model",
- "object",
- "organization_id",
- "result_files",
"status",
- "trained_tokens",
- "training_file",
- "validation_file",
- "seed"
+ "container_id",
+ "code",
+ "outputs"
],
"properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "code_interpreter_call"
+ ],
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
+ "x-stainless-const": true,
+ "default": "code_interpreter_call"
+ },
"id": {
"type": "string",
- "description": "The object identifier, which can be referenced in the API endpoints."
+ "description": "The unique ID of the code interpreter tool call."
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created."
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete",
+ "interpreting",
+ "failed"
+ ],
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
},
- "error": {
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the container used to run the code."
+ },
+ "code": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FineTuningJobError"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "fine_tuned_model": {
+ "outputs": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
- },
- "finished_at": {
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
+ },
+ "OpenAI.ItemCompactionSummaryItemParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "encrypted_content"
+ ],
+ "properties": {
+ "id": {
"anyOf": [
{
- "type": "string",
- "format": "date-time"
+ "type": "string"
},
{
"type": "null"
}
- ],
- "type": "integer",
- "format": "unixTimestamp"
- },
- "hyperparameters": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobHyperparameters",
- "description": "The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs."
- },
- "model": {
- "type": "string",
- "description": "The base model that is being fine-tuned."
+ ]
},
- "object": {
+ "type": {
"type": "string",
"enum": [
- "fine_tuning.job"
+ "compaction"
],
- "description": "The object type, which is always \"fine_tuning.job\".",
- "x-stainless-const": true
- },
- "organization_id": {
- "type": "string",
- "description": "The organization that owns the fine-tuning job."
- },
- "result_files": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents)."
+ "description": "The type of the item. Always `compaction`.",
+ "x-stainless-const": true,
+ "default": "compaction"
},
- "status": {
+ "encrypted_content": {
"type": "string",
- "enum": [
- "validating_files",
- "queued",
- "running",
- "succeeded",
- "failed",
- "cancelled"
- ],
- "description": "The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`."
- },
- "trained_tokens": {
+ "maxLength": 10485760,
+ "description": "The encrypted content of the compaction summary."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
+ },
+ "OpenAI.ItemComputerCallOutputItemParam": {
+ "type": "object",
+ "required": [
+ "call_id",
+ "type",
+ "output"
+ ],
+ "properties": {
+ "id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "training_file": {
+ "call_id": {
"type": "string",
- "description": "The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents)."
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The ID of the computer tool call that produced the output."
},
- "validation_file": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": {
+ "type": "string",
+ "enum": [
+ "computer_call_output"
+ ],
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "x-stainless-const": true,
+ "default": "computer_call_output"
},
- "integrations": {
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ },
+ "acknowledged_safety_checks": {
"anyOf": [
{
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FineTuningIntegration"
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
}
},
{
@@ -37129,30 +58055,10 @@
}
]
},
- "seed": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The seed used for the fine-tuning job."
- },
- "estimated_finish": {
- "anyOf": [
- {
- "type": "string",
- "format": "date-time"
- },
- {
- "type": "null"
- }
- ],
- "type": "integer",
- "format": "unixTimestamp"
- },
- "method": {
- "$ref": "#/components/schemas/OpenAI.FineTuneMethod"
- },
- "metadata": {
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
},
{
"type": "null"
@@ -37160,265 +58066,327 @@
]
}
},
- "description": "The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.",
- "title": "FineTuningJob",
- "x-oaiMeta": {
- "name": "The fine-tuning job object",
- "example": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n },\n \"metadata\": {\n \"key\": \"value\"\n }\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "OpenAI.FineTuningJobCheckpoint": {
+ "OpenAI.ItemComputerToolCall": {
"type": "object",
"required": [
+ "type",
"id",
- "created_at",
- "fine_tuned_model_checkpoint",
- "step_number",
- "metrics",
- "fine_tuning_job_id",
- "object"
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The checkpoint identifier, which can be referenced in the API endpoints."
+ "enum": [
+ "computer_call"
+ ],
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) for when the checkpoint was created."
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the computer call."
},
- "fine_tuned_model_checkpoint": {
+ "call_id": {
"type": "string",
- "description": "The name of the fine-tuned checkpoint model that is created."
+ "description": "An identifier used when responding to the tool call with output."
},
- "step_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The step number that the checkpoint was created at."
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
},
- "metrics": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics",
- "description": "Metrics at the step number during the fine-tuning job."
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
},
- "fine_tuning_job_id": {
- "type": "string",
- "description": "The name of the fine-tuning job that this checkpoint was created from."
+ "pending_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The pending safety checks for the computer call."
},
- "object": {
+ "status": {
"type": "string",
"enum": [
- "fine_tuning.job.checkpoint"
+ "in_progress",
+ "completed",
+ "incomplete"
],
- "description": "The object type, which is always \"fine_tuning.job.checkpoint\".",
- "x-stainless-const": true
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
- "description": "The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.",
- "title": "FineTuningJobCheckpoint",
- "x-oaiMeta": {
- "name": "The fine-tuning job checkpoint object",
- "example": "{\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P\",\n \"created_at\": 1712211699,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88\",\n \"fine_tuning_job_id\": \"ftjob-fpbNQ3H1GrMehXRf8cO97xTN\",\n \"metrics\": {\n \"step\": 88,\n \"train_loss\": 0.478,\n \"train_mean_token_accuracy\": 0.924,\n \"valid_loss\": 10.112,\n \"valid_mean_token_accuracy\": 0.145,\n \"full_valid_loss\": 0.567,\n \"full_valid_mean_token_accuracy\": 0.944\n },\n \"step_number\": 88\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "OpenAI.FineTuningJobCheckpointMetrics": {
+ "OpenAI.ItemCustomToolCall": {
"type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "input"
+ ],
"properties": {
- "step": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "train_loss": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "type": {
+ "type": "string",
+ "enum": [
+ "custom_tool_call"
+ ],
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "x-stainless-const": true
},
- "train_mean_token_accuracy": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
},
- "valid_loss": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used to map this custom tool call to a tool call output."
},
- "valid_mean_token_accuracy": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the custom tool being called."
},
- "full_valid_loss": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "name": {
+ "type": "string",
+ "description": "The name of the custom tool being called."
},
- "full_valid_mean_token_accuracy": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "input": {
+ "type": "string",
+ "description": "The input for the custom tool call generated by the model."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A call to a custom tool created by the model.",
+ "title": "Custom tool call"
},
- "OpenAI.FineTuningJobError": {
+ "OpenAI.ItemCustomToolCallOutput": {
"type": "object",
"required": [
- "code",
- "message",
- "param"
+ "type",
+ "call_id",
+ "output"
],
"properties": {
- "code": {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "custom_tool_call_output"
+ ],
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "x-stainless-const": true
},
- "message": {
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
},
- "param": {
- "anyOf": [
+ "call_id": {
+ "type": "string",
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ },
+ "output": {
+ "oneOf": [
{
"type": "string"
},
{
- "type": "null"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
}
- ]
+ ],
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "The output of a custom tool call from your code, being sent back to the model.",
+ "title": "Custom tool call output"
+ },
+ "OpenAI.ItemField": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ItemFieldType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "message": "#/components/schemas/OpenAI.ItemFieldMessage",
+ "function_call": "#/components/schemas/OpenAI.ItemFieldFunctionToolCall",
+ "tool_search_call": "#/components/schemas/OpenAI.ItemFieldToolSearchCall",
+ "tool_search_output": "#/components/schemas/OpenAI.ItemFieldToolSearchOutput",
+ "additional_tools": "#/components/schemas/OpenAI.ItemFieldAdditionalTools",
+ "function_call_output": "#/components/schemas/OpenAI.ItemFieldFunctionToolCallOutput",
+ "file_search_call": "#/components/schemas/OpenAI.ItemFieldFileSearchToolCall",
+ "web_search_call": "#/components/schemas/OpenAI.ItemFieldWebSearchToolCall",
+ "image_generation_call": "#/components/schemas/OpenAI.ItemFieldImageGenToolCall",
+ "computer_call": "#/components/schemas/OpenAI.ItemFieldComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.ItemFieldComputerToolCallOutput",
+ "reasoning": "#/components/schemas/OpenAI.ItemFieldReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.ItemFieldCompactionBody",
+ "code_interpreter_call": "#/components/schemas/OpenAI.ItemFieldCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.ItemFieldLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.ItemFieldLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.ItemFieldFunctionShellCall",
+ "shell_call_output": "#/components/schemas/OpenAI.ItemFieldFunctionShellCallOutput",
+ "apply_patch_call": "#/components/schemas/OpenAI.ItemFieldApplyPatchToolCall",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.ItemFieldApplyPatchToolCallOutput",
+ "mcp_list_tools": "#/components/schemas/OpenAI.ItemFieldMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.ItemFieldMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.ItemFieldMcpApprovalResponseResource",
+ "mcp_call": "#/components/schemas/OpenAI.ItemFieldMcpToolCall",
+ "custom_tool_call": "#/components/schemas/OpenAI.ItemFieldCustomToolCall",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.ItemFieldCustomToolCallOutput"
}
- }
+ },
+ "description": "An item representing a message, tool call, tool output, reasoning, or other response element."
},
- "OpenAI.FineTuningJobEvent": {
+ "OpenAI.ItemFieldAdditionalTools": {
"type": "object",
"required": [
- "object",
+ "type",
"id",
- "created_at",
- "level",
- "message"
+ "role",
+ "tools"
],
"properties": {
- "object": {
+ "type": {
"type": "string",
"enum": [
- "fine_tuning.job.event"
+ "additional_tools"
],
- "description": "The object type, which is always \"fine_tuning.job.event\".",
- "x-stainless-const": true
+ "description": "The type of the item. Always `additional_tools`.",
+ "x-stainless-const": true,
+ "default": "additional_tools"
},
"id": {
"type": "string",
- "description": "The object identifier."
+ "description": "The unique ID of the additional tools item."
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created."
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role that provided the additional tools."
},
- "level": {
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The additional tool definitions made available at this item."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ]
+ },
+ "OpenAI.ItemFieldApplyPatchToolCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "call_id",
+ "status",
+ "operation"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "info",
- "warn",
- "error"
+ "apply_patch_call"
],
- "description": "The log level of the event."
+ "description": "The type of the item. Always `apply_patch_call`.",
+ "x-stainless-const": true,
+ "default": "apply_patch_call"
},
- "message": {
+ "id": {
"type": "string",
- "description": "The message of the event."
+ "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
},
- "type": {
+ "call_id": {
"type": "string",
- "enum": [
- "message",
- "metrics"
- ],
- "description": "The type of event."
+ "description": "The unique ID of the apply patch tool call generated by the model."
},
- "data": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobEventData",
- "description": "The data associated with the event."
- }
- },
- "description": "Fine-tuning job event object",
- "x-oaiMeta": {
- "name": "The fine-tuning job event object",
- "example": "{\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ftevent-abc123\"\n \"created_at\": 1677610602,\n \"level\": \"info\",\n \"message\": \"Created fine-tuning job\",\n \"data\": {},\n \"type\": \"message\"\n}\n"
- }
- },
- "OpenAI.FineTuningJobEventData": {
- "type": "object"
- },
- "OpenAI.FineTuningJobHyperparameters": {
- "type": "object",
- "properties": {
- "batch_size": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ],
- "default": "auto"
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
+ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
},
- "learning_rate_multiplier": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- }
- ],
- "default": "auto"
+ "operation": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
+ "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
+ "title": "Apply patch operation"
},
- "n_epochs": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "auto"
- ]
- },
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- ],
- "default": "auto"
- }
- }
- },
- "OpenAI.FunctionAndCustomToolCallOutput": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType"
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "input_text": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent",
- "input_image": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent",
- "input_file": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- }
+ ],
+ "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
+ "title": "Apply patch tool call"
},
- "OpenAI.FunctionAndCustomToolCallOutputInputFileContent": {
+ "OpenAI.ItemFieldApplyPatchToolCallOutput": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "call_id",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_file"
+ "apply_patch_call_output"
],
- "description": "The type of the input item. Always `input_file`.",
+ "description": "The type of the item. Always `apply_patch_call_output`.",
"x-stainless-const": true,
- "default": "input_file"
+ "default": "apply_patch_call_output"
},
- "file_id": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the apply patch tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
+ "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ },
+ "output": {
"anyOf": [
{
"type": "string"
@@ -37428,796 +58396,952 @@
}
]
},
- "filename": {
- "type": "string",
- "description": "The name of the file to be sent to the model."
- },
- "file_data": {
- "type": "string",
- "description": "The content of the file to be sent to the model."
- },
- "file_url": {
+ "created_by": {
"type": "string",
- "format": "uri",
- "description": "The URL of the file to be sent to the model."
- },
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
+ "description": "The ID of the entity that created this tool call output."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "A file input to the model.",
- "title": "Input file"
+ "description": "The output emitted by an apply patch tool call.",
+ "title": "Apply patch tool call output"
},
- "OpenAI.FunctionAndCustomToolCallOutputInputImageContent": {
+ "OpenAI.ItemFieldCodeInterpreterToolCall": {
"type": "object",
"required": [
"type",
- "detail"
+ "id",
+ "status",
+ "container_id",
+ "code",
+ "outputs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_image"
+ "code_interpreter_call"
],
- "description": "The type of the input item. Always `input_image`.",
+ "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
"x-stainless-const": true,
- "default": "input_image"
+ "default": "code_interpreter_call"
},
- "image_url": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the code interpreter tool call."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete",
+ "interpreting",
+ "failed"
+ ],
+ "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
+ },
+ "container_id": {
+ "type": "string",
+ "description": "The ID of the container used to run the code."
+ },
+ "code": {
"anyOf": [
{
- "type": "string",
- "format": "uri"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "file_id": {
+ "outputs": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
- },
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
- "title": "Input image"
+ "description": "A tool call to run code.",
+ "title": "Code interpreter tool call"
},
- "OpenAI.FunctionAndCustomToolCallOutputInputTextContent": {
+ "OpenAI.ItemFieldCompactionBody": {
"type": "object",
"required": [
"type",
- "text"
+ "id",
+ "encrypted_content"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_text"
+ "compaction"
],
- "description": "The type of the input item. Always `input_text`.",
+ "description": "The type of the item. Always `compaction`.",
"x-stainless-const": true,
- "default": "input_text"
+ "default": "compaction"
},
- "text": {
+ "id": {
"type": "string",
- "description": "The text input to the model."
+ "description": "The unique ID of the compaction item."
+ },
+ "encrypted_content": {
+ "type": "string",
+ "description": "The encrypted content that was produced by compaction."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "A text input to the model.",
- "title": "Input text"
- },
- "OpenAI.FunctionAndCustomToolCallOutputType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "input_text",
- "input_image",
- "input_file"
- ]
- }
- ]
- },
- "OpenAI.FunctionCallItemStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- "OpenAI.FunctionCallOutputStatusEnum": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- "OpenAI.FunctionCallStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "OpenAI.FunctionObject": {
+ "OpenAI.ItemFieldComputerToolCall": {
"type": "object",
"required": [
- "name"
+ "type",
+ "id",
+ "call_id",
+ "pending_safety_checks",
+ "status"
],
"properties": {
- "description": {
+ "type": {
"type": "string",
- "description": "A description of what the function does, used by the model to choose when and how to call the function."
+ "enum": [
+ "computer_call"
+ ],
+ "description": "The type of the computer call. Always `computer_call`.",
+ "default": "computer_call"
},
- "name": {
+ "id": {
"type": "string",
- "description": "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."
+ "description": "The unique ID of the computer call."
},
- "parameters": {
- "$ref": "#/components/schemas/OpenAI.FunctionParameters"
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used when responding to the tool call with output."
},
- "strict": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- }
- }
- },
- "OpenAI.FunctionParameters": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\nOmitting `parameters` defines a function with an empty parameter list."
- },
- "OpenAI.FunctionShellAction": {
- "type": "object",
- "required": [
- "commands",
- "timeout_ms",
- "max_output_length"
- ],
- "properties": {
- "commands": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
},
- "timeout_ms": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "actions": {
+ "$ref": "#/components/schemas/OpenAI.ComputerActionList"
},
- "max_output_length": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "description": "Execute a shell command.",
- "title": "Shell exec action"
- },
- "OpenAI.FunctionShellActionParam": {
- "type": "object",
- "required": [
- "commands"
- ],
- "properties": {
- "commands": {
+ "pending_safety_checks": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
},
- "description": "Ordered shell commands for the execution environment to run."
- },
- "timeout_ms": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The pending safety checks for the computer call."
},
- "max_output_length": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
- "description": "Commands and limits describing how to run the shell tool call.",
- "title": "Shell action"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
+ "title": "Computer tool call"
},
- "OpenAI.FunctionShellCallEnvironment": {
+ "OpenAI.ItemFieldComputerToolCallOutput": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "call_id",
+ "output"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironmentType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "local": "#/components/schemas/OpenAI.LocalEnvironmentResource",
- "container_reference": "#/components/schemas/OpenAI.ContainerReferenceResource"
- }
- }
- },
- "OpenAI.FunctionShellCallEnvironmentType": {
- "anyOf": [
- {
- "type": "string"
+ "type": "string",
+ "enum": [
+ "computer_call_output"
+ ],
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "x-stainless-const": true,
+ "default": "computer_call_output"
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the computer tool call output.",
+ "readOnly": true
},
- {
+ "call_id": {
+ "type": "string",
+ "description": "The ID of the computer tool call that produced the output."
+ },
+ "acknowledged_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ },
+ "status": {
"type": "string",
"enum": [
- "local",
- "container_reference"
- ]
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
- ]
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "OpenAI.FunctionShellCallItemParamEnvironment": {
+ "OpenAI.ItemFieldCustomToolCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "call_id",
+ "name",
+ "input"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentType"
+ "type": "string",
+ "enum": [
+ "custom_tool_call"
+ ],
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used to map this custom tool call to a tool call output."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the custom tool being called."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom tool being called."
+ },
+ "input": {
+ "type": "string",
+ "description": "The input for the custom tool call generated by the model."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "local": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam",
- "container_reference": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- },
- "description": "The environment to execute the shell commands in."
+ ],
+ "description": "A call to a custom tool created by the model.",
+ "title": "Custom tool call"
},
- "OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam": {
+ "OpenAI.ItemFieldCustomToolCallOutput": {
"type": "object",
"required": [
"type",
- "container_id"
+ "call_id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "container_reference"
+ "custom_tool_call_output"
],
- "description": "References a container created with the /v1/containers endpoint",
- "x-stainless-const": true,
- "default": "container_reference"
+ "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "x-stainless-const": true
},
- "container_id": {
+ "id": {
"type": "string",
- "description": "The ID of the referenced container."
+ "description": "The unique ID of the custom tool call output in the OpenAI platform."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- ]
+ ],
+ "description": "The output of a custom tool call from your code, being sent back to the model.",
+ "title": "Custom tool call output"
},
- "OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam": {
+ "OpenAI.ItemFieldFileSearchToolCall": {
"type": "object",
"required": [
- "type"
+ "id",
+ "type",
+ "status",
+ "queries"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the file search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "local"
+ "file_search_call"
],
- "description": "Use a local computer environment.",
- "x-stainless-const": true,
- "default": "local"
+ "description": "The type of the file search tool call. Always `file_search_call`.",
+ "x-stainless-const": true
},
- "skills": {
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "incomplete",
+ "failed"
+ ],
+ "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
+ },
+ "queries": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.LocalSkillParam"
+ "type": "string"
},
- "maxItems": 200,
- "description": "An optional list of skills."
+ "description": "The queries used to search for files."
+ },
+ "results": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
- }
- ]
- },
- "OpenAI.FunctionShellCallItemParamEnvironmentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "local",
- "container_reference"
- ]
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- ]
- },
- "OpenAI.FunctionShellCallItemStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
],
- "description": "Status values reported for shell tool calls.",
- "title": "Shell call status"
+ "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
+ "title": "File search tool call"
},
- "OpenAI.FunctionShellCallOutputContent": {
+ "OpenAI.ItemFieldFunctionShellCall": {
"type": "object",
"required": [
- "stdout",
- "stderr",
- "outcome"
+ "type",
+ "id",
+ "call_id",
+ "action",
+ "status",
+ "environment"
],
"properties": {
- "stdout": {
+ "type": {
"type": "string",
- "description": "The standard output that was captured."
+ "enum": [
+ "shell_call"
+ ],
+ "description": "The type of the item. Always `shell_call`.",
+ "x-stainless-const": true,
+ "default": "shell_call"
},
- "stderr": {
+ "id": {
"type": "string",
- "description": "The standard error output that was captured."
+ "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
},
- "outcome": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome",
- "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.",
- "title": "Shell call outcome"
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
+ "description": "The shell commands and limits that describe how to run the tool call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
+ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
+ },
+ "environment": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"created_by": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "The ID of the entity that created this tool call."
}
},
- "description": "The content of a shell tool call output that was emitted.",
- "title": "Shell call output content"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A tool call that executes one or more shell commands in a managed environment.",
+ "title": "Shell tool call"
},
- "OpenAI.FunctionShellCallOutputContentParam": {
+ "OpenAI.ItemFieldFunctionShellCallOutput": {
"type": "object",
"required": [
- "stdout",
- "stderr",
- "outcome"
+ "type",
+ "id",
+ "call_id",
+ "status",
+ "output",
+ "max_output_length"
],
"properties": {
- "stdout": {
+ "type": {
"type": "string",
- "maxLength": 10485760,
- "description": "Captured stdout output for the shell call."
+ "enum": [
+ "shell_call_output"
+ ],
+ "description": "The type of the shell call output. Always `shell_call_output`.",
+ "x-stainless-const": true,
+ "default": "shell_call_output"
},
- "stderr": {
+ "id": {
"type": "string",
- "maxLength": 10485760,
- "description": "Captured stderr output for the shell call."
+ "description": "The unique ID of the shell call output. Populated when this item is returned via API."
},
- "outcome": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam",
- "description": "The exit or timeout outcome associated with this shell call."
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
+ "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ },
+ "output": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
+ },
+ "description": "An array of shell call output contents"
+ },
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "Captured stdout and stderr for a portion of a shell tool call output.",
- "title": "Shell output content"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "The output of a shell tool call that was emitted.",
+ "title": "Shell call output"
},
- "OpenAI.FunctionShellCallOutputExitOutcome": {
+ "OpenAI.ItemFieldFunctionToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "exit_code"
+ "call_id",
+ "name",
+ "arguments"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call.",
+ "readOnly": true
+ },
"type": {
"type": "string",
"enum": [
- "exit"
+ "function_call"
],
- "description": "The outcome type. Always `exit`.",
+ "description": "The type of the function tool call. Always `function_call`.",
"x-stainless-const": true
},
- "exit_code": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "Exit code from the shell process."
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the function to run."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the function to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the function."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "Indicates that the shell commands finished and returned an exit code.",
- "title": "Shell call exit outcome"
+ "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
+ "title": "Function tool call"
},
- "OpenAI.FunctionShellCallOutputExitOutcomeParam": {
+ "OpenAI.ItemFieldFunctionToolCallOutput": {
"type": "object",
"required": [
+ "id",
"type",
- "exit_code"
+ "call_id",
+ "output"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
+ "readOnly": true
+ },
"type": {
"type": "string",
"enum": [
- "exit"
+ "function_call_output"
],
- "description": "The outcome type. Always `exit`.",
+ "description": "The type of the function tool call output. Always `function_call_output`.",
"x-stainless-const": true
},
- "exit_code": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The exit code returned by the shell process."
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "Indicates that the shell commands finished and returned an exit code.",
- "title": "Shell call exit outcome"
- },
- "OpenAI.FunctionShellCallOutputOutcome": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome",
- "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome"
- }
- },
- "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.",
- "title": "Shell call outcome"
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
},
- "OpenAI.FunctionShellCallOutputOutcomeParam": {
+ "OpenAI.ItemFieldImageGenToolCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "status",
+ "result"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParamType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcomeParam",
- "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcomeParam"
- }
- },
- "description": "The exit or timeout outcome associated with this shell call.",
- "title": "Shell call outcome"
- },
- "OpenAI.FunctionShellCallOutputOutcomeParamType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
"type": "string",
"enum": [
- "timeout",
- "exit"
- ]
- }
- ]
- },
- "OpenAI.FunctionShellCallOutputOutcomeType": {
- "anyOf": [
- {
- "type": "string"
+ "image_generation_call"
+ ],
+ "description": "The type of the image generation call. Always `image_generation_call`.",
+ "x-stainless-const": true
},
- {
+ "id": {
"type": "string",
- "enum": [
- "timeout",
- "exit"
- ]
- }
- ]
- },
- "OpenAI.FunctionShellCallOutputStatusEnum": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- "OpenAI.FunctionShellCallOutputTimeoutOutcome": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
+ "description": "The unique ID of the image generation call."
+ },
+ "status": {
"type": "string",
"enum": [
- "timeout"
+ "in_progress",
+ "completed",
+ "generating",
+ "failed"
],
- "description": "The outcome type. Always `timeout`.",
- "x-stainless-const": true
+ "description": "The status of the image generation call."
+ },
+ "result": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "Indicates that the shell call exceeded its configured time limit.",
- "title": "Shell call timeout outcome"
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
},
- "OpenAI.FunctionShellCallOutputTimeoutOutcomeParam": {
+ "OpenAI.ItemFieldLocalShellToolCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "call_id",
+ "action",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "timeout"
+ "local_shell_call"
],
- "description": "The outcome type. Always `timeout`.",
+ "description": "The type of the local shell call. Always `local_shell_call`.",
"x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell call."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the local shell call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "Indicates that the shell call exceeded its configured time limit.",
- "title": "Shell call timeout outcome"
- },
- "OpenAI.FunctionShellCallStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
+ "description": "A tool call to run a command on the local shell.",
+ "title": "Local shell call"
},
- "OpenAI.FunctionShellToolParam": {
+ "OpenAI.ItemFieldLocalShellToolCallOutput": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell"
+ "local_shell_call_output"
],
- "description": "The type of the shell tool. Always `shell`.",
+ "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
"x-stainless-const": true
},
- "environment": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "output": {
+ "type": "string",
+ "description": "A JSON string of the output of the local shell tool call."
+ },
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
},
{
"type": "null"
}
]
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "A tool that allows the model to execute shell commands.",
- "title": "Shell tool"
+ "description": "The output of a local shell tool call.",
+ "title": "Local shell call output"
},
- "OpenAI.FunctionShellToolParamEnvironment": {
+ "OpenAI.ItemFieldMcpApprovalRequest": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentType"
+ "type": "string",
+ "enum": [
+ "mcp_approval_request"
+ ],
+ "description": "The type of the item. Always `mcp_approval_request`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the approval request."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server making the request."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the tool to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of arguments for the tool."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "local": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam",
- "container_reference": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam",
- "container_auto": "#/components/schemas/OpenAI.ContainerAutoParam"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- }
+ ],
+ "description": "A request for human approval of a tool invocation.",
+ "title": "MCP approval request"
},
- "OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam": {
+ "OpenAI.ItemFieldMcpApprovalResponseResource": {
"type": "object",
"required": [
"type",
- "container_id"
+ "id",
+ "approval_request_id",
+ "approve"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "container_reference"
+ "mcp_approval_response"
],
- "description": "References a container created with the /v1/containers endpoint",
- "x-stainless-const": true,
- "default": "container_reference"
+ "description": "The type of the item. Always `mcp_approval_response`.",
+ "x-stainless-const": true
},
- "container_id": {
+ "id": {
"type": "string",
- "description": "The ID of the referenced container."
+ "description": "The unique ID of the approval response"
+ },
+ "approval_request_id": {
+ "type": "string",
+ "description": "The ID of the approval request being answered."
+ },
+ "approve": {
+ "type": "boolean",
+ "description": "Whether the request was approved."
+ },
+ "reason": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- ]
+ ],
+ "description": "A response to an MCP approval request.",
+ "title": "MCP approval response"
},
- "OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam": {
+ "OpenAI.ItemFieldMcpListTools": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "server_label",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local"
+ "mcp_list_tools"
],
- "description": "Use a local computer environment.",
- "x-stainless-const": true,
- "default": "local"
+ "description": "The type of the item. Always `mcp_list_tools`.",
+ "x-stainless-const": true
},
- "skills": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the list."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server."
+ },
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.LocalSkillParam"
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
},
- "maxItems": 200,
- "description": "An optional list of skills."
+ "description": "The tools available on the server."
+ },
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellToolParamEnvironment"
- }
- ]
- },
- "OpenAI.FunctionShellToolParamEnvironmentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "container_auto",
- "local",
- "container_reference"
- ]
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
- ]
+ ],
+ "description": "A list of tools available on an MCP server.",
+ "title": "MCP list tools"
},
- "OpenAI.FunctionTool": {
+ "OpenAI.ItemFieldMcpToolCall": {
"type": "object",
"required": [
"type",
+ "id",
+ "server_label",
"name",
- "parameters",
- "strict"
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "function"
+ "mcp_call"
],
- "description": "The type of the function tool. Always `function`.",
+ "description": "The type of the item. Always `mcp_call`.",
"x-stainless-const": true
},
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool call."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server running the tool."
+ },
"name": {
"type": "string",
- "description": "The name of the function to call."
+ "description": "The name of the tool that was run."
},
- "description": {
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments passed to the tool."
+ },
+ "output": {
"anyOf": [
{
"type": "string"
@@ -38227,838 +59351,966 @@
}
]
},
- "parameters": {
- "anyOf": [
- {
- "type": "object",
- "unevaluatedProperties": {}
- },
- {
- "type": "null"
- }
- ]
+ "error": {
+ "type": "object",
+ "unevaluatedProperties": {}
},
- "strict": {
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
+ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ },
+ "approval_request_id": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
- },
- "defer_loading": {
- "type": "boolean",
- "description": "Whether this function is deferred and loaded via tool search."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.ItemField"
}
],
- "description": "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).",
- "title": "Function"
+ "description": "An invocation of a tool on an MCP server.",
+ "title": "MCP tool call"
},
- "OpenAI.FunctionToolParam": {
+ "OpenAI.ItemFieldMessage": {
"type": "object",
"required": [
- "name",
- "type"
+ "type",
+ "id",
+ "status",
+ "role",
+ "content"
],
"properties": {
- "name": {
+ "type": {
"type": "string",
- "minLength": 1,
- "maxLength": 128,
- "pattern": "^[a-zA-Z0-9_-]+$"
+ "enum": [
+ "message"
+ ],
+ "description": "The type of the message. Always set to `message`.",
+ "x-stainless-const": true,
+ "default": "message"
},
- "description": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the message."
},
- "parameters": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.EmptyModelParam"
- },
- {
- "type": "null"
- }
- ]
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MessageStatus",
+ "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API."
},
- "strict": {
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
+ },
+ "description": "The content of the message"
+ },
+ "phase": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
},
{
"type": "null"
}
]
- },
- "type": {
- "type": "string",
- "enum": [
- "function"
- ],
- "x-stainless-const": true,
- "default": "function"
- },
- "defer_loading": {
- "type": "boolean",
- "description": "Whether this function should be deferred and discovered via tool search."
}
- }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A message to or from the model.",
+ "title": "Message"
},
- "OpenAI.GraderLabelModel": {
+ "OpenAI.ItemFieldReasoningItem": {
"type": "object",
"required": [
"type",
- "name",
- "model",
- "input",
- "labels",
- "passing_labels"
+ "id",
+ "summary"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "label_model"
+ "reasoning"
],
- "description": "The object type, which is always `label_model`.",
+ "description": "The type of the object. Always `reasoning`.",
"x-stainless-const": true
},
- "name": {
- "type": "string",
- "description": "The name of the grader."
- },
- "model": {
+ "id": {
"type": "string",
- "description": "The model to use for the evaluation. Must support structured outputs."
+ "description": "The unique identifier of the reasoning content."
},
- "input": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
- }
+ "encrypted_content": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "labels": {
+ "summary": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
},
- "description": "The labels to assign to each item in the evaluation."
+ "description": "Reasoning summary content."
},
- "passing_labels": {
+ "content": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
},
- "description": "The labels that indicate a passing result. Must be a subset of labels."
- }
- },
- "description": "A LabelModelGrader object which uses a model to assign labels to each item\nin the evaluation.",
- "title": "LabelModelGrader",
- "x-oaiMeta": {
- "name": "Label Model Grader",
- "group": "graders",
- "example": "{\n \"name\": \"First label grader\",\n \"type\": \"label_model\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"input\": [\n {\n \"type\": \"message\",\n \"role\": \"system\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Classify the sentiment of the following statement as one of positive, neutral, or negative\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Statement: {{item.response}}\"\n }\n }\n ],\n \"passing_labels\": [\n \"positive\"\n ],\n \"labels\": [\n \"positive\",\n \"neutral\",\n \"negative\"\n ]\n}\n"
- }
- },
- "OpenAI.GraderMulti": {
- "type": "object",
- "required": [
- "type",
- "name",
- "graders",
- "calculate_output"
- ],
- "properties": {
- "type": {
+ "description": "Reasoning text content."
+ },
+ "status": {
"type": "string",
"enum": [
- "multi"
+ "in_progress",
+ "completed",
+ "incomplete"
],
- "description": "The object type, which is always `multi`.",
- "x-stainless-const": true,
- "default": "multi"
- },
- "name": {
- "type": "string",
- "description": "The name of the grader."
- },
- "graders": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderPython"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
- },
- {
- "$ref": "#/components/schemas/OpenAI.GraderLabelModel"
- }
- ]
- },
- "calculate_output": {
- "type": "string",
- "description": "A formula to calculate the output based on grader results."
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
- "description": "A MultiGrader object combines the output of multiple graders to produce a single score.",
- "title": "MultiGrader",
- "x-oaiMeta": {
- "name": "Multi Grader",
- "group": "graders",
- "example": "{\n \"type\": \"multi\",\n \"name\": \"example multi grader\",\n \"graders\": [\n {\n \"type\": \"text_similarity\",\n \"name\": \"example text similarity grader\",\n \"input\": \"The graded text\",\n \"reference\": \"The reference text\",\n \"evaluation_metric\": \"fuzzy_match\"\n },\n {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n ],\n \"calculate_output\": \"0.5 * text_similarity_score + 0.5 * string_check_score)\"\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
},
- "OpenAI.GraderPython": {
+ "OpenAI.ItemFieldToolSearchCall": {
"type": "object",
"required": [
"type",
- "name",
- "source"
+ "id",
+ "call_id",
+ "execution",
+ "arguments",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "python"
+ "tool_search_call"
],
- "description": "The object type, which is always `python`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `tool_search_call`.",
+ "x-stainless-const": true,
+ "default": "tool_search_call"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The unique ID of the tool search call item."
},
- "source": {
- "type": "string",
- "description": "The source code of the python script."
+ "call_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "image_tag": {
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "arguments": {
+ "description": "Arguments used for the tool search call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the tool search call item that was recorded."
+ },
+ "created_by": {
"type": "string",
- "description": "The image tag to use for the python script."
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "A PythonGrader object that runs a python script on the input.",
- "title": "PythonGrader",
- "x-oaiMeta": {
- "name": "Python Grader",
- "group": "graders",
- "example": "{\n \"type\": \"python\",\n \"name\": \"Example python grader\",\n \"image_tag\": \"2025-05-08\",\n \"source\": \"\"\"\ndef grade(sample: dict, item: dict) -> float:\n \"\"\"\n Returns 1.0 if `output_text` equals `label`, otherwise 0.0.\n \"\"\"\n output = sample.get(\"output_text\")\n label = item.get(\"label\")\n return 1.0 if output == label else 0.0\n\"\"\",\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ]
},
- "OpenAI.GraderScoreModel": {
+ "OpenAI.ItemFieldToolSearchOutput": {
"type": "object",
"required": [
"type",
- "name",
- "model",
- "input"
+ "id",
+ "call_id",
+ "execution",
+ "tools",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "score_model"
+ "tool_search_output"
],
- "description": "The object type, which is always `score_model`.",
- "x-stainless-const": true
+ "description": "The type of the item. Always `tool_search_output`.",
+ "x-stainless-const": true,
+ "default": "tool_search_output"
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the grader."
+ "description": "The unique ID of the tool search output item."
},
- "model": {
- "type": "string",
- "description": "The model to use for the evaluation."
+ "call_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "sampling_params": {
- "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams",
- "description": "The sampling parameters for the model."
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
},
- "input": {
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.EvalItem"
+ "$ref": "#/components/schemas/OpenAI.Tool"
},
- "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings."
+ "description": "The loaded tool definitions returned by tool search."
},
- "range": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "description": "The range of the score. Defaults to `[0, 1]`."
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the tool search output item that was recorded."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
- "description": "A ScoreModelGrader object that uses a model to assign a score to the input.",
- "title": "ScoreModelGrader",
- "x-oaiMeta": {
- "name": "Score Model Grader",
- "group": "graders",
- "example": "{\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": (\n \"Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different.\"\n \" Return just a floating point score\n\n\"\n \" Reference answer: {{item.label}}\n\n\"\n \" Model answer: {{sample.output_text}}\"\n )\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/reference.png\",\n \"file_id\": null,\n \"detail\": \"auto\"\n }\n ],\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42,\n \"max_completions_tokens\": 32768,\n \"reasoning_effort\": \"medium\"\n },\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ]
},
- "OpenAI.GraderStringCheck": {
+ "OpenAI.ItemFieldType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "message",
+ "function_call",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "function_call_output",
+ "file_search_call",
+ "web_search_call",
+ "image_generation_call",
+ "computer_call",
+ "computer_call_output",
+ "reasoning",
+ "compaction",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "mcp_call",
+ "custom_tool_call",
+ "custom_tool_call_output"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ItemFieldWebSearchToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "name",
- "input",
- "reference",
- "operation"
+ "status",
+ "action"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "string_check"
+ "web_search_call"
],
- "description": "The object type, which is always `string_check`.",
+ "description": "The type of the web search tool call. Always `web_search_call`.",
"x-stainless-const": true
},
- "name": {
- "type": "string",
- "description": "The name of the grader."
- },
- "input": {
- "type": "string",
- "description": "The input text. This may include template strings."
- },
- "reference": {
- "type": "string",
- "description": "The reference text. This may include template strings."
- },
- "operation": {
+ "status": {
"type": "string",
"enum": [
- "eq",
- "ne",
- "like",
- "ilike"
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
],
- "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
+ "description": "The status of the web search tool call."
+ },
+ "action": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ }
+ ],
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
}
},
- "description": "A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.",
- "title": "StringCheckGrader",
- "x-oaiMeta": {
- "name": "String Check Grader",
- "group": "graders",
- "example": "{\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n}\n"
- }
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemField"
+ }
+ ],
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
},
- "OpenAI.GraderTextSimilarity": {
+ "OpenAI.ItemFileSearchToolCall": {
"type": "object",
"required": [
+ "id",
"type",
- "name",
- "input",
- "reference",
- "evaluation_metric"
+ "status",
+ "queries"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the file search tool call."
+ },
"type": {
"type": "string",
"enum": [
- "text_similarity"
+ "file_search_call"
],
- "description": "The type of grader.",
- "x-stainless-const": true,
- "default": "text_similarity"
- },
- "name": {
- "type": "string",
- "description": "The name of the grader."
- },
- "input": {
- "type": "string",
- "description": "The text being graded."
- },
- "reference": {
- "type": "string",
- "description": "The text being graded against."
+ "description": "The type of the file search tool call. Always `file_search_call`.",
+ "x-stainless-const": true
},
- "evaluation_metric": {
+ "status": {
"type": "string",
"enum": [
- "cosine",
- "fuzzy_match",
- "bleu",
- "gleu",
- "meteor",
- "rouge_1",
- "rouge_2",
- "rouge_3",
- "rouge_4",
- "rouge_5",
- "rouge_l"
+ "in_progress",
+ "searching",
+ "completed",
+ "incomplete",
+ "failed"
],
- "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`."
+ "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
+ },
+ "queries": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The queries used to search for files."
+ },
+ "results": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "A TextSimilarityGrader object which grades text based on similarity metrics.",
- "title": "TextSimilarityGrader",
- "x-oaiMeta": {
- "name": "Text Similarity Grader",
- "group": "graders",
- "example": "{\n \"type\": \"text_similarity\",\n \"name\": \"Example text similarity grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"evaluation_metric\": \"fuzzy_match\"\n}\n"
- }
- },
- "OpenAI.GrammarSyntax1": {
- "type": "string",
- "enum": [
- "lark",
- "regex"
- ]
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
+ "title": "File search tool call"
},
- "OpenAI.HybridSearchOptions": {
+ "OpenAI.ItemFunctionCallOutputItemParam": {
"type": "object",
"required": [
- "embedding_weight",
- "text_weight"
+ "call_id",
+ "type",
+ "output"
],
"properties": {
- "embedding_weight": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The weight of the embedding in the reciprocal ranking fusion."
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "text_weight": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The weight of the text in the reciprocal ranking fusion."
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "function_call_output"
+ ],
+ "description": "The type of the function tool call output. Always `function_call_output`.",
+ "x-stainless-const": true,
+ "default": "function_call_output"
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputTextContentParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputImageContentParamAutoParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFileContentParam"
+ }
+ ]
+ }
+ }
+ ],
+ "description": "Text, image, or file output of the function tool call."
+ },
+ "status": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- }
- },
- "OpenAI.ImageDetail": {
- "type": "string",
- "enum": [
- "low",
- "high",
- "auto",
- "original"
- ]
- },
- "OpenAI.ImageGenActionEnum": {
- "type": "string",
- "enum": [
- "generate",
- "edit",
- "auto"
- ]
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
},
- "OpenAI.ImageGenTool": {
+ "OpenAI.ItemFunctionShellCallItemParam": {
"type": "object",
"required": [
- "type"
+ "call_id",
+ "type",
+ "action"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "image_generation"
- ],
- "description": "The type of the image generation tool. Always `image_generation`.",
- "x-stainless-const": true
- },
- "model": {
+ "id": {
"anyOf": [
{
"type": "string"
},
{
- "type": "string",
- "enum": [
- "gpt-image-1",
- "gpt-image-1-mini",
- "gpt-image-1.5"
- ]
+ "type": "null"
}
- ],
- "default": "gpt-image-1"
+ ]
},
- "quality": {
+ "call_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "type": {
"type": "string",
"enum": [
- "low",
- "medium",
- "high",
- "auto"
+ "shell_call"
],
- "description": "The quality of the generated image. One of `low`, `medium`, `high`,\n or `auto`. Default: `auto`.",
- "default": "auto"
+ "description": "The type of the item. Always `shell_call`.",
+ "x-stainless-const": true,
+ "default": "shell_call"
},
- "size": {
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellActionParam",
+ "description": "The shell commands and limits that describe how to run the tool call."
+ },
+ "status": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "environment": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A tool representing a request to execute one or more shell commands.",
+ "title": "Shell tool call"
+ },
+ "OpenAI.ItemFunctionShellCallOutputItemParam": {
+ "type": "object",
+ "required": [
+ "call_id",
+ "type",
+ "output"
+ ],
+ "properties": {
+ "id": {
"anyOf": [
{
"type": "string"
},
{
- "type": "string",
- "enum": [
- "1024x1024",
- "1024x1536",
- "1536x1024",
- "auto"
- ]
+ "type": "null"
}
- ],
- "description": "The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.",
- "default": "auto"
+ ]
},
- "output_format": {
+ "call_id": {
"type": "string",
- "enum": [
- "png",
- "webp",
- "jpeg"
- ],
- "description": "The output format of the generated image. One of `png`, `webp`, or\n `jpeg`. Default: `png`.",
- "default": "png"
- },
- "output_compression": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "minimum": 0,
- "maximum": 100,
- "description": "Compression level for the output image. Default: 100.",
- "default": 100
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The unique ID of the shell tool call generated by the model."
},
- "moderation": {
+ "type": {
"type": "string",
"enum": [
- "auto",
- "low"
+ "shell_call_output"
],
- "description": "Moderation level for the generated image. Default: `auto`.",
- "default": "auto"
+ "description": "The type of the item. Always `shell_call_output`.",
+ "x-stainless-const": true,
+ "default": "shell_call_output"
},
- "background": {
- "type": "string",
- "enum": [
- "transparent",
- "opaque",
- "auto"
- ],
- "description": "Background type for the generated image. One of `transparent`,\n `opaque`, or `auto`. Default: `auto`.",
- "default": "auto"
+ "output": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContentParam"
+ },
+ "description": "Captured chunks of stdout and stderr output, along with their associated outcomes."
},
- "input_fidelity": {
+ "status": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputFidelity"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
},
{
"type": "null"
}
]
},
- "input_image_mask": {
- "$ref": "#/components/schemas/OpenAI.ImageGenToolInputImageMask",
- "description": "Optional mask for inpainting. Contains `image_url`\n (string, optional) and `file_id` (string, optional)."
- },
- "partial_images": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "minimum": 0,
- "maximum": 3,
- "description": "Number of partial images to generate in streaming mode, from 0 (default value) to 3."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.ImageGenActionEnum",
- "description": "Whether to generate a new image or edit an existing image. Default: `auto`."
- },
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
- },
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "max_output_length": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "A tool that generates images using the GPT image models.",
- "title": "Image generation tool"
+ "description": "The streamed output items emitted by a shell tool call.",
+ "title": "Shell tool call output"
},
- "OpenAI.ImageGenToolInputImageMask": {
+ "OpenAI.ItemFunctionToolCall": {
"type": "object",
+ "required": [
+ "id",
+ "type",
+ "call_id",
+ "name",
+ "arguments"
+ ],
"properties": {
- "image_url": {
+ "id": {
"type": "string",
- "format": "uri"
+ "description": "The unique ID of the function tool call.",
+ "readOnly": true
},
- "file_id": {
- "type": "string"
- }
- }
- },
- "OpenAI.IncludeEnum": {
- "anyOf": [
- {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "function_call"
+ ],
+ "description": "The type of the function tool call. Always `function_call`.",
+ "x-stainless-const": true
},
- {
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the function to run."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the function to run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments to pass to the function."
+ },
+ "status": {
"type": "string",
"enum": [
- "file_search_call.results",
- "web_search_call.results",
- "web_search_call.action.sources",
- "message.input_image.image_url",
- "computer_call_output.output.image_url",
- "code_interpreter_call.outputs",
- "reasoning.encrypted_content",
- "message.output_text.logprobs",
- "memory_search_call.results"
- ]
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "Specify additional output data to include in the model response. Currently supported values are:\n- `web_search_call.results`: Include the search results of the web search tool call.\n- `web_search_call.action.sources`: Include the sources of the web search tool call.\n- `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.\n- `computer_call_output.output.image_url`: Include image urls from the computer call output.\n- `file_search_call.results`: Include the search results of the file search tool call.\n- `message.input_image.image_url`: Include image urls from the input message.\n- `message.output_text.logprobs`: Include logprobs with assistant messages.\n- `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)."
+ "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
+ "title": "Function tool call"
},
- "OpenAI.InlineSkillParam": {
+ "OpenAI.ItemImageGenToolCall": {
"type": "object",
"required": [
"type",
- "name",
- "description",
- "source"
+ "id",
+ "status",
+ "result"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "inline"
+ "image_generation_call"
],
- "description": "Defines an inline skill for this request.",
+ "description": "The type of the image generation call. Always `image_generation_call`.",
"x-stainless-const": true
},
- "name": {
+ "id": {
"type": "string",
- "description": "The name of the skill."
+ "description": "The unique ID of the image generation call."
},
- "description": {
+ "status": {
"type": "string",
- "description": "The description of the skill."
+ "enum": [
+ "in_progress",
+ "completed",
+ "generating",
+ "failed"
+ ],
+ "description": "The status of the image generation call."
},
- "source": {
- "$ref": "#/components/schemas/OpenAI.InlineSkillSourceParam",
- "description": "Inline skill payload"
+ "result": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ContainerSkill"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- ]
+ ],
+ "description": "An image generation request made by the model.",
+ "title": "Image generation call"
},
- "OpenAI.InlineSkillSourceParam": {
+ "OpenAI.ItemInputMessage": {
"type": "object",
"required": [
"type",
- "media_type",
- "data"
+ "role",
+ "content",
+ "id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "base64"
+ "message"
],
- "description": "The type of the inline skill source. Must be `base64`.",
+ "description": "The type of the message input. Always set to `message`.",
"x-stainless-const": true,
- "default": "base64"
+ "default": "message"
},
- "media_type": {
+ "role": {
"type": "string",
"enum": [
- "application/zip"
+ "user",
+ "system",
+ "developer"
],
- "description": "The media type of the inline skill payload. Must be `application/zip`.",
- "x-stainless-const": true,
- "default": "application/zip"
+ "description": "The role of the message input. One of `user`, `system`, or `developer`."
},
- "data": {
+ "status": {
"type": "string",
- "minLength": 1,
- "maxLength": 70254592,
- "description": "Base64-encoded skill zip bundle."
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "content": {
+ "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the message input.",
+ "readOnly": true
}
},
- "description": "Inline skill payload"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role.",
+ "title": "Input message"
},
- "OpenAI.InputAudio": {
+ "OpenAI.ItemLocalShellToolCall": {
"type": "object",
"required": [
"type",
- "input_audio"
+ "id",
+ "call_id",
+ "action",
+ "status"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_audio"
+ "local_shell_call"
],
- "description": "The type of the input item. Always `input_audio`.",
+ "description": "The type of the local shell call. Always `local_shell_call`.",
"x-stainless-const": true
},
- "input_audio": {
- "$ref": "#/components/schemas/OpenAI.InputAudioInputAudio"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell call."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "action": {
+ "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the local shell call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "An audio input to the model.",
- "title": "Input audio"
+ "description": "A tool call to run a command on the local shell.",
+ "title": "Local shell call"
},
- "OpenAI.InputAudioInputAudio": {
+ "OpenAI.ItemLocalShellToolCallOutput": {
"type": "object",
"required": [
- "data",
- "format"
+ "type",
+ "id",
+ "output"
],
"properties": {
- "data": {
- "type": "string"
- },
- "format": {
+ "type": {
"type": "string",
"enum": [
- "mp3",
- "wav"
+ "local_shell_call_output"
+ ],
+ "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the local shell tool call generated by the model."
+ },
+ "output": {
+ "type": "string",
+ "description": "A JSON string of the output of the local shell tool call."
+ },
+ "status": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ {
+ "type": "null"
+ }
]
}
- }
- },
- "OpenAI.InputContent": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.InputContentType"
- }
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "input_text": "#/components/schemas/OpenAI.InputContentInputTextContent",
- "input_image": "#/components/schemas/OpenAI.InputContentInputImageContent",
- "input_file": "#/components/schemas/OpenAI.InputContentInputFileContent"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
}
- }
+ ],
+ "description": "The output of a local shell tool call.",
+ "title": "Local shell call output"
},
- "OpenAI.InputContentInputFileContent": {
+ "OpenAI.ItemMcpApprovalRequest": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_file"
+ "mcp_approval_request"
],
- "description": "The type of the input item. Always `input_file`.",
- "x-stainless-const": true,
- "default": "input_file"
- },
- "file_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The type of the item. Always `mcp_approval_request`.",
+ "x-stainless-const": true
},
- "filename": {
+ "id": {
"type": "string",
- "description": "The name of the file to be sent to the model."
+ "description": "The unique ID of the approval request."
},
- "file_data": {
+ "server_label": {
"type": "string",
- "description": "The content of the file to be sent to the model."
+ "description": "The label of the MCP server making the request."
},
- "file_url": {
+ "name": {
"type": "string",
- "format": "uri",
- "description": "The URL of the file to be sent to the model."
+ "description": "The name of the tool to run."
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of arguments for the tool."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputContent"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
],
- "description": "A file input to the model.",
- "title": "Input file"
+ "description": "A request for human approval of a tool invocation.",
+ "title": "MCP approval request"
},
- "OpenAI.InputContentInputImageContent": {
+ "OpenAI.ItemMcpApprovalResponse": {
"type": "object",
"required": [
"type",
- "detail"
+ "approval_request_id",
+ "approve"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_image"
+ "mcp_approval_response"
],
- "description": "The type of the input item. Always `input_image`.",
- "x-stainless-const": true,
- "default": "input_image"
+ "description": "The type of the item. Always `mcp_approval_response`.",
+ "x-stainless-const": true
},
- "image_url": {
+ "id": {
"anyOf": [
{
- "type": "string",
- "format": "uri"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "file_id": {
+ "approval_request_id": {
+ "type": "string",
+ "description": "The ID of the approval request being answered."
+ },
+ "approve": {
+ "type": "boolean",
+ "description": "Whether the request was approved."
+ },
+ "reason": {
"anyOf": [
{
"type": "string"
@@ -39067,154 +60319,95 @@
"type": "null"
}
]
- },
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputContent"
- }
- ],
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
- "title": "Input image"
- },
- "OpenAI.InputContentInputTextContent": {
- "type": "object",
- "required": [
- "type",
- "text"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "input_text"
- ],
- "description": "The type of the input item. Always `input_text`.",
- "x-stainless-const": true,
- "default": "input_text"
- },
- "text": {
- "type": "string",
- "description": "The text input to the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputContent"
- }
- ],
- "description": "A text input to the model.",
- "title": "Input text"
- },
- "OpenAI.InputContentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "input_text",
- "input_image",
- "input_file"
- ]
- }
- ]
- },
- "OpenAI.InputFidelity": {
- "type": "string",
- "enum": [
- "high",
- "low"
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
],
- "description": "Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`."
+ "description": "A response to an MCP approval request.",
+ "title": "MCP approval response"
},
- "OpenAI.InputFileContent": {
+ "OpenAI.ItemMcpListTools": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "server_label",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_file"
+ "mcp_list_tools"
],
- "description": "The type of the input item. Always `input_file`.",
- "x-stainless-const": true,
- "default": "input_file"
- },
- "file_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The type of the item. Always `mcp_list_tools`.",
+ "x-stainless-const": true
},
- "filename": {
+ "id": {
"type": "string",
- "description": "The name of the file to be sent to the model."
+ "description": "The unique ID of the list."
},
- "file_data": {
+ "server_label": {
"type": "string",
- "description": "The content of the file to be sent to the model."
+ "description": "The label of the MCP server."
},
- "file_url": {
- "type": "string",
- "format": "uri",
- "description": "The URL of the file to be sent to the model."
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
+ },
+ "description": "The tools available on the server."
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
+ "error": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
},
- "description": "A file input to the model.",
- "title": "Input file"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A list of tools available on an MCP server.",
+ "title": "MCP list tools"
},
- "OpenAI.InputFileContentParam": {
+ "OpenAI.ItemMcpToolCall": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "server_label",
+ "name",
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_file"
+ "mcp_call"
],
- "description": "The type of the input item. Always `input_file`.",
- "x-stainless-const": true,
- "default": "input_file"
+ "description": "The type of the item. Always `mcp_call`.",
+ "x-stainless-const": true
},
- "file_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool call."
},
- "filename": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server running the tool."
},
- "file_data": {
+ "name": {
+ "type": "string",
+ "description": "The name of the tool that was run."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string of the arguments passed to the tool."
+ },
+ "output": {
"anyOf": [
{
"type": "string"
@@ -39224,97 +60417,119 @@
}
]
},
- "file_url": {
+ "error": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
+ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ },
+ "approval_request_id": {
"anyOf": [
{
- "type": "string",
- "format": "uri"
+ "type": "string"
},
{
"type": "null"
}
]
- },
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
- "description": "A file input to the model.",
- "title": "Input file"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "An invocation of a tool on an MCP server.",
+ "title": "MCP tool call"
},
- "OpenAI.InputImageContent": {
+ "OpenAI.ItemOutputMessage": {
"type": "object",
"required": [
+ "id",
"type",
- "detail"
+ "role",
+ "content",
+ "status"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the output message."
+ },
"type": {
"type": "string",
"enum": [
- "input_image"
+ "output_message"
],
- "description": "The type of the input item. Always `input_image`.",
- "x-stainless-const": true,
- "default": "input_image"
+ "description": "The type of the output message. Always `message`.",
+ "x-stainless-const": true
},
- "image_url": {
- "anyOf": [
- {
- "type": "string",
- "format": "uri"
- },
- {
- "type": "null"
- }
- ]
+ "role": {
+ "type": "string",
+ "enum": [
+ "assistant"
+ ],
+ "description": "The role of the output message. Always `assistant`.",
+ "x-stainless-const": true
},
- "file_id": {
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ },
+ "description": "The content of the output message."
+ },
+ "phase": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.MessagePhase"
},
{
"type": "null"
}
]
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
- "title": "Input image"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "An output message from the model.",
+ "title": "Output message"
},
- "OpenAI.InputImageContentParamAutoParam": {
+ "OpenAI.ItemReasoningItem": {
"type": "object",
"required": [
- "type"
+ "type",
+ "id",
+ "summary"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_image"
+ "reasoning"
],
- "description": "The type of the input item. Always `input_image`.",
- "x-stainless-const": true,
- "default": "input_image"
+ "description": "The type of the object. Always `reasoning`.",
+ "x-stainless-const": true
},
- "image_url": {
- "anyOf": [
- {
- "type": "string",
- "format": "uri"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the reasoning content."
},
- "file_id": {
+ "encrypted_content": {
"anyOf": [
{
"type": "string"
@@ -39324,119 +60539,155 @@
}
]
},
- "detail": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.DetailEnum"
- },
- {
- "type": "null"
- }
- ]
+ "summary": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
+ },
+ "description": "Reasoning summary content."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
+ },
+ "description": "Reasoning text content."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
}
},
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision)",
- "title": "Input image"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
+ "title": "Reasoning"
},
- "OpenAI.InputItem": {
+ "OpenAI.ItemReferenceParam": {
+ "type": "object",
+ "required": [
+ "type",
+ "id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "item_reference"
+ ],
+ "description": "The type of item to reference. Always `item_reference`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the item to reference."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ ],
+ "description": "An internal identifier for an item to reference.",
+ "title": "Item reference"
+ },
+ "OpenAI.ItemResource": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.InputItemType"
+ "$ref": "#/components/schemas/OpenAI.ItemResourceType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "message": "#/components/schemas/OpenAI.EasyInputMessage",
- "item_reference": "#/components/schemas/OpenAI.ItemReferenceParam",
- "output_message": "#/components/schemas/OpenAI.InputItemOutputMessage",
- "file_search_call": "#/components/schemas/OpenAI.InputItemFileSearchToolCall",
- "computer_call": "#/components/schemas/OpenAI.InputItemComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.InputItemComputerCallOutputItemParam",
- "web_search_call": "#/components/schemas/OpenAI.InputItemWebSearchToolCall",
- "function_call": "#/components/schemas/OpenAI.InputItemFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.InputItemFunctionCallOutputItemParam",
- "tool_search_call": "#/components/schemas/OpenAI.InputItemToolSearchCallItemParam",
- "tool_search_output": "#/components/schemas/OpenAI.InputItemToolSearchOutputItemParam",
- "additional_tools": "#/components/schemas/OpenAI.InputItemAdditionalToolsItemParam",
- "reasoning": "#/components/schemas/OpenAI.InputItemReasoningItem",
- "compaction": "#/components/schemas/OpenAI.InputItemCompactionSummaryItemParam",
- "image_generation_call": "#/components/schemas/OpenAI.InputItemImageGenToolCall",
- "code_interpreter_call": "#/components/schemas/OpenAI.InputItemCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.InputItemLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.InputItemLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.InputItemFunctionShellCallItemParam",
- "shell_call_output": "#/components/schemas/OpenAI.InputItemFunctionShellCallOutputItemParam",
- "apply_patch_call": "#/components/schemas/OpenAI.InputItemApplyPatchToolCallItemParam",
- "apply_patch_call_output": "#/components/schemas/OpenAI.InputItemApplyPatchToolCallOutputItemParam",
- "mcp_list_tools": "#/components/schemas/OpenAI.InputItemMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.InputItemMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.InputItemMcpApprovalResponse",
- "mcp_call": "#/components/schemas/OpenAI.InputItemMcpToolCall",
- "custom_tool_call_output": "#/components/schemas/OpenAI.InputItemCustomToolCallOutput",
- "custom_tool_call": "#/components/schemas/OpenAI.InputItemCustomToolCall"
+ "message": "#/components/schemas/OpenAI.ItemResourceInputMessage",
+ "output_message": "#/components/schemas/OpenAI.ItemResourceOutputMessage",
+ "file_search_call": "#/components/schemas/OpenAI.ItemResourceFileSearchToolCall",
+ "computer_call": "#/components/schemas/OpenAI.ItemResourceComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.ItemResourceComputerToolCallOutput",
+ "web_search_call": "#/components/schemas/OpenAI.ItemResourceWebSearchToolCall",
+ "function_call": "#/components/schemas/OpenAI.ItemResourceFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutput",
+ "tool_search_call": "#/components/schemas/OpenAI.ItemResourceToolSearchCall",
+ "tool_search_output": "#/components/schemas/OpenAI.ItemResourceToolSearchOutput",
+ "additional_tools": "#/components/schemas/OpenAI.ItemResourceAdditionalTools",
+ "reasoning": "#/components/schemas/OpenAI.ItemResourceReasoningItem",
+ "compaction": "#/components/schemas/OpenAI.ItemResourceCompactionBody",
+ "image_generation_call": "#/components/schemas/OpenAI.ItemResourceImageGenToolCall",
+ "code_interpreter_call": "#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.ItemResourceFunctionShellCall",
+ "shell_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput",
+ "apply_patch_call": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput",
+ "mcp_list_tools": "#/components/schemas/OpenAI.ItemResourceMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource",
+ "mcp_call": "#/components/schemas/OpenAI.ItemResourceMcpToolCall",
+ "custom_tool_call": "#/components/schemas/OpenAI.ItemResourceCustomToolCallResource",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.ItemResourceCustomToolCallOutputResource"
}
},
- "description": "An item representing part of the context for the response to be\ngenerated by the model. Can contain text, images, and audio inputs,\nas well as previous assistant responses and tool call outputs."
+ "description": "Content item used to generate a response."
},
- "OpenAI.InputItemAdditionalToolsItemParam": {
+ "OpenAI.ItemResourceAdditionalTools": {
"type": "object",
"required": [
"type",
+ "id",
"role",
"tools"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
"type": {
"type": "string",
"enum": [
"additional_tools"
],
- "description": "The item type. Always `additional_tools`.",
+ "description": "The type of the item. Always `additional_tools`.",
"x-stainless-const": true,
"default": "additional_tools"
},
- "role": {
+ "id": {
"type": "string",
- "enum": [
- "developer"
- ],
- "description": "The role that provided the additional tools. Only `developer` is supported.",
- "x-stainless-const": true,
- "default": "developer"
+ "description": "The unique ID of the additional tools item."
+ },
+ "role": {
+ "$ref": "#/components/schemas/OpenAI.MessageRole",
+ "description": "The role that provided the additional tools."
},
"tools": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OpenAI.Tool"
},
- "description": "A list of additional tools made available at this item."
+ "description": "The additional tool definitions made available at this item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
]
},
- "OpenAI.InputItemApplyPatchToolCallItemParam": {
+ "OpenAI.ItemResourceApplyPatchToolCall": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
"status",
"operation"
@@ -39452,42 +60703,40 @@
"default": "apply_patch_call"
},
"id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
},
"call_id": {
"type": "string",
- "minLength": 1,
- "maxLength": 64,
"description": "The unique ID of the apply patch tool call generated by the model."
},
"status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatusParam",
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
"description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
},
"operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam",
- "description": "The specific create, delete, or update instruction for the apply_patch tool call."
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
+ "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
+ "title": "Apply patch operation"
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "A tool call representing a request to create, delete, or update files using diff patches.",
+ "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
"title": "Apply patch tool call"
},
- "OpenAI.InputItemApplyPatchToolCallOutputItemParam": {
+ "OpenAI.ItemResourceApplyPatchToolCallOutput": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
"status"
],
@@ -39502,23 +60751,15 @@
"default": "apply_patch_call_output"
},
"id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
},
"call_id": {
"type": "string",
- "minLength": 1,
- "maxLength": 64,
"description": "The unique ID of the apply patch tool call generated by the model."
},
"status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam",
+ "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
"description": "The status of the apply patch tool call output. One of `completed` or `failed`."
},
"output": {
@@ -39530,17 +60771,21 @@
"type": "null"
}
]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call output."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "The streamed output emitted by an apply patch tool call.",
+ "description": "The output emitted by an apply patch tool call.",
"title": "Apply patch tool call output"
},
- "OpenAI.InputItemCodeInterpreterToolCall": {
+ "OpenAI.ItemResourceCodeInterpreterToolCall": {
"type": "object",
"required": [
"type",
@@ -39612,121 +60857,51 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "A tool call to run code.",
"title": "Code interpreter tool call"
},
- "OpenAI.InputItemCompactionSummaryItemParam": {
- "type": "object",
- "required": [
- "type",
- "encrypted_content"
- ],
- "properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "type": {
- "type": "string",
- "enum": [
- "compaction"
- ],
- "description": "The type of the item. Always `compaction`.",
- "x-stainless-const": true,
- "default": "compaction"
- },
- "encrypted_content": {
- "type": "string",
- "maxLength": 10485760,
- "description": "The encrypted content of the compaction summary."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
- },
- "OpenAI.InputItemComputerCallOutputItemParam": {
+ "OpenAI.ItemResourceCompactionBody": {
"type": "object",
"required": [
- "call_id",
- "type",
- "output"
- ],
- "properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The ID of the computer tool call that produced the output."
- },
+ "type",
+ "id",
+ "encrypted_content"
+ ],
+ "properties": {
"type": {
"type": "string",
"enum": [
- "computer_call_output"
+ "compaction"
],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "description": "The type of the item. Always `compaction`.",
"x-stainless-const": true,
- "default": "computer_call_output"
+ "default": "compaction"
},
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the compaction item."
},
- "acknowledged_safety_checks": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- }
- },
- {
- "type": "null"
- }
- ]
+ "encrypted_content": {
+ "type": "string",
+ "description": "The encrypted content that was produced by compaction."
},
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
+ "title": "Compaction item"
},
- "OpenAI.InputItemComputerToolCall": {
+ "OpenAI.ItemResourceComputerToolCall": {
"type": "object",
"required": [
"type",
@@ -39777,64 +60952,74 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
"title": "Computer tool call"
},
- "OpenAI.InputItemCustomToolCall": {
+ "OpenAI.ItemResourceComputerToolCallOutput": {
"type": "object",
"required": [
"type",
+ "id",
"call_id",
- "name",
- "input"
+ "output"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call"
+ "computer_call_output"
],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
- "x-stainless-const": true
+ "description": "The type of the computer tool call output. Always `computer_call_output`.",
+ "x-stainless-const": true,
+ "default": "computer_call_output"
},
"id": {
"type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
+ "description": "The ID of the computer tool call output.",
+ "readOnly": true
},
"call_id": {
"type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
+ "description": "The ID of the computer tool call that produced the output."
},
- "namespace": {
- "type": "string",
- "description": "The namespace of the custom tool being called."
+ "acknowledged_safety_checks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ },
+ "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
},
- "name": {
- "type": "string",
- "description": "The name of the custom tool being called."
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
},
- "input": {
+ "status": {
"type": "string",
- "description": "The input for the custom tool call generated by the model."
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "A call to a custom tool created by the model.",
- "title": "Custom tool call"
+ "description": "The output of a computer tool call.",
+ "title": "Computer tool call output"
},
- "OpenAI.InputItemCustomToolCallOutput": {
+ "OpenAI.ItemResourceCustomToolCallOutputResource": {
"type": "object",
"required": [
"type",
"call_id",
- "output"
+ "output",
+ "status"
],
"properties": {
"type": {
@@ -39866,17 +61051,78 @@
}
],
"description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "The output of a custom tool call from your code, being sent back to the model.",
- "title": "Custom tool call output"
+ "title": "ResponseCustomToolCallOutputItem"
},
- "OpenAI.InputItemFileSearchToolCall": {
+ "OpenAI.ItemResourceCustomToolCallResource": {
+ "type": "object",
+ "required": [
+ "type",
+ "call_id",
+ "name",
+ "input",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "custom_tool_call"
+ ],
+ "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "x-stainless-const": true
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the custom tool call in the OpenAI platform."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "An identifier used to map this custom tool call to a tool call output."
+ },
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the custom tool being called."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom tool being called."
+ },
+ "input": {
+ "type": "string",
+ "description": "The input for the custom tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "title": "ResponseCustomToolCallItem"
+ },
+ "OpenAI.ItemResourceFileSearchToolCall": {
"type": "object",
"required": [
"id",
@@ -39931,203 +61177,109 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
"title": "File search tool call"
},
- "OpenAI.InputItemFunctionCallOutputItemParam": {
+ "OpenAI.ItemResourceFunctionShellCall": {
"type": "object",
"required": [
- "call_id",
"type",
- "output"
+ "id",
+ "call_id",
+ "action",
+ "status",
+ "environment"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the function tool call generated by the model."
- },
"type": {
"type": "string",
"enum": [
- "function_call_output"
+ "shell_call"
],
- "description": "The type of the function tool call output. Always `function_call_output`.",
+ "description": "The type of the item. Always `shell_call`.",
"x-stainless-const": true,
- "default": "function_call_output"
- },
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputTextContentParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputImageContentParamAutoParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputFileContentParam"
- }
- ]
- }
- }
- ],
- "description": "Text, image, or file output of the function tool call."
+ "default": "shell_call"
},
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
- },
- "OpenAI.InputItemFunctionShellCallItemParam": {
- "type": "object",
- "required": [
- "call_id",
- "type",
- "action"
- ],
- "properties": {
"id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
},
"call_id": {
"type": "string",
- "minLength": 1,
- "maxLength": 64,
"description": "The unique ID of the shell tool call generated by the model."
},
- "type": {
- "type": "string",
- "enum": [
- "shell_call"
- ],
- "description": "The type of the item. Always `shell_call`.",
- "x-stainless-const": true,
- "default": "shell_call"
- },
"action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellActionParam",
+ "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
"description": "The shell commands and limits that describe how to run the tool call."
},
"status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
+ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
},
"environment": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
},
{
"type": "null"
}
]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The ID of the entity that created this tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "A tool representing a request to execute one or more shell commands.",
+ "description": "A tool call that executes one or more shell commands in a managed environment.",
"title": "Shell tool call"
},
- "OpenAI.InputItemFunctionShellCallOutputItemParam": {
+ "OpenAI.ItemResourceFunctionShellCallOutput": {
"type": "object",
"required": [
- "call_id",
"type",
- "output"
+ "id",
+ "call_id",
+ "status",
+ "output",
+ "max_output_length"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the shell tool call generated by the model."
- },
"type": {
"type": "string",
"enum": [
"shell_call_output"
],
- "description": "The type of the item. Always `shell_call_output`.",
+ "description": "The type of the shell call output. Always `shell_call_output`.",
"x-stainless-const": true,
"default": "shell_call_output"
},
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the shell call output. Populated when this item is returned via API."
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the shell tool call generated by the model."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
+ "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ },
"output": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContentParam"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
},
- "description": "Captured chunks of stdout and stderr output, along with their associated outcomes."
- },
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
- },
- {
- "type": "null"
- }
- ]
+ "description": "An array of shell call output contents"
},
"max_output_length": {
"anyOf": [
@@ -40138,17 +61290,21 @@
"type": "null"
}
]
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
- "description": "The streamed output items emitted by a shell tool call.",
- "title": "Shell tool call output"
+ "description": "The output of a shell tool call that was emitted.",
+ "title": "Shell call output"
},
- "OpenAI.InputItemFunctionToolCall": {
+ "OpenAI.ItemResourceFunctionToolCall": {
"type": "object",
"required": [
"id",
@@ -40199,13 +61355,71 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
"title": "Function tool call"
},
- "OpenAI.InputItemImageGenToolCall": {
+ "OpenAI.ItemResourceFunctionToolCallOutput": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "call_id",
+ "output"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
+ "readOnly": true
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "function_call_output"
+ ],
+ "description": "The type of the function tool call output. Always `function_call_output`.",
+ "x-stainless-const": true
+ },
+ "call_id": {
+ "type": "string",
+ "description": "The unique ID of the function tool call generated by the model."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
+ }
+ }
+ ],
+ "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "The output of a function tool call.",
+ "title": "Function tool call output"
+ },
+ "OpenAI.ItemResourceImageGenToolCall": {
"type": "object",
"required": [
"type",
@@ -40249,13 +61463,66 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "An image generation request made by the model.",
"title": "Image generation call"
},
- "OpenAI.InputItemLocalShellToolCall": {
+ "OpenAI.ItemResourceInputMessage": {
+ "type": "object",
+ "required": [
+ "type",
+ "role",
+ "content",
+ "id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "message"
+ ],
+ "description": "The type of the message input. Always set to `message`.",
+ "x-stainless-const": true,
+ "default": "message"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "user",
+ "system",
+ "developer"
+ ],
+ "description": "The role of the message input. One of `user`, `system`, or `developer`."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ],
+ "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ },
+ "content": {
+ "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the message input.",
+ "readOnly": true
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role.",
+ "title": "Input message"
+ },
+ "OpenAI.ItemResourceLocalShellToolCall": {
"type": "object",
"required": [
"type",
@@ -40296,13 +61563,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "A tool call to run a command on the local shell.",
"title": "Local shell call"
},
- "OpenAI.InputItemLocalShellToolCallOutput": {
+ "OpenAI.ItemResourceLocalShellToolCallOutput": {
"type": "object",
"required": [
"type",
@@ -40344,13 +61611,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "The output of a local shell tool call.",
"title": "Local shell call output"
},
- "OpenAI.InputItemMcpApprovalRequest": {
+ "OpenAI.ItemResourceMcpApprovalRequest": {
"type": "object",
"required": [
"type",
@@ -40387,16 +61654,17 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "A request for human approval of a tool invocation.",
"title": "MCP approval request"
},
- "OpenAI.InputItemMcpApprovalResponse": {
+ "OpenAI.ItemResourceMcpApprovalResponseResource": {
"type": "object",
"required": [
"type",
+ "id",
"approval_request_id",
"approve"
],
@@ -40410,14 +61678,8 @@
"x-stainless-const": true
},
"id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string",
+ "description": "The unique ID of the approval response"
},
"approval_request_id": {
"type": "string",
@@ -40440,13 +61702,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "A response to an MCP approval request.",
"title": "MCP approval response"
},
- "OpenAI.InputItemMcpListTools": {
+ "OpenAI.ItemResourceMcpListTools": {
"type": "object",
"required": [
"type",
@@ -40484,13 +61746,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "A list of tools available on an MCP server.",
"title": "MCP list tools"
},
- "OpenAI.InputItemMcpToolCall": {
+ "OpenAI.ItemResourceMcpToolCall": {
"type": "object",
"required": [
"type",
@@ -40555,13 +61817,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "An invocation of a tool on an MCP server.",
"title": "MCP tool call"
},
- "OpenAI.InputItemOutputMessage": {
+ "OpenAI.ItemResourceOutputMessage": {
"type": "object",
"required": [
"id",
@@ -40620,13 +61882,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "An output message from the model.",
"title": "Output message"
},
- "OpenAI.InputItemReasoningItem": {
+ "OpenAI.ItemResourceReasoningItem": {
"type": "object",
"required": [
"type",
@@ -40682,13 +61944,247 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
}
],
"description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
"title": "Reasoning"
},
- "OpenAI.InputItemToolSearchCallItemParam": {
+ "OpenAI.ItemResourceToolSearchCall": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "call_id",
+ "execution",
+ "arguments",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "tool_search_call"
+ ],
+ "description": "The type of the item. Always `tool_search_call`.",
+ "x-stainless-const": true,
+ "default": "tool_search_call"
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool search call item."
+ },
+ "call_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "arguments": {
+ "description": "Arguments used for the tool search call."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
+ "description": "The status of the tool search call item that was recorded."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ]
+ },
+ "OpenAI.ItemResourceToolSearchOutput": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "call_id",
+ "execution",
+ "tools",
+ "status"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "tool_search_output"
+ ],
+ "description": "The type of the item. Always `tool_search_output`.",
+ "x-stainless-const": true,
+ "default": "tool_search_output"
+ },
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the tool search output item."
+ },
+ "call_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search was executed by the server or by the client."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "The loaded tool definitions returned by tool search."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
+ "description": "The status of the tool search output item that was recorded."
+ },
+ "created_by": {
+ "type": "string",
+ "description": "The identifier of the actor that created the item."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ]
+ },
+ "OpenAI.ItemResourceType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "message",
+ "output_message",
+ "file_search_call",
+ "computer_call",
+ "computer_call_output",
+ "web_search_call",
+ "function_call",
+ "function_call_output",
+ "tool_search_call",
+ "tool_search_output",
+ "additional_tools",
+ "reasoning",
+ "compaction",
+ "image_generation_call",
+ "code_interpreter_call",
+ "local_shell_call",
+ "local_shell_call_output",
+ "shell_call",
+ "shell_call_output",
+ "apply_patch_call",
+ "apply_patch_call_output",
+ "mcp_list_tools",
+ "mcp_approval_request",
+ "mcp_approval_response",
+ "mcp_call",
+ "custom_tool_call",
+ "custom_tool_call_output",
+ "structured_outputs",
+ "oauth_consent_request",
+ "memory_search_call",
+ "memory_command_preview_call",
+ "memory_command_preview_call_output",
+ "workflow_action",
+ "a2a_preview_call",
+ "a2a_preview_call_output",
+ "bing_grounding_call",
+ "bing_grounding_call_output",
+ "sharepoint_grounding_preview_call",
+ "sharepoint_grounding_preview_call_output",
+ "azure_ai_search_call",
+ "azure_ai_search_call_output",
+ "bing_custom_search_preview_call",
+ "bing_custom_search_preview_call_output",
+ "openapi_call",
+ "openapi_call_output",
+ "browser_automation_preview_call",
+ "browser_automation_preview_call_output",
+ "fabric_dataagent_preview_call",
+ "fabric_dataagent_preview_call_output",
+ "azure_function_call",
+ "azure_function_call_output"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ItemResourceWebSearchToolCall": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "status",
+ "action"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_search_call"
+ ],
+ "description": "The type of the web search tool call. Always `web_search_call`.",
+ "x-stainless-const": true
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
+ ],
+ "description": "The status of the web search tool call."
+ },
+ "action": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ }
+ ],
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ItemResource"
+ }
+ ],
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
+ },
+ "OpenAI.ItemToolSearchCallItemParam": {
"type": "object",
"required": [
"type",
@@ -40745,11 +62241,11 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
]
},
- "OpenAI.InputItemToolSearchOutputItemParam": {
+ "OpenAI.ItemToolSearchOutputItemParam": {
"type": "object",
"required": [
"type",
@@ -40809,11 +62305,11 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.Item"
}
]
},
- "OpenAI.InputItemType": {
+ "OpenAI.ItemType": {
"anyOf": [
{
"type": "string"
@@ -40848,509 +62344,660 @@
"mcp_call",
"custom_tool_call_output",
"custom_tool_call",
- "item_reference"
+ "structured_outputs",
+ "oauth_consent_request",
+ "memory_search_call",
+ "memory_command_preview_call",
+ "memory_command_preview_call_output",
+ "workflow_action",
+ "a2a_preview_call",
+ "a2a_preview_call_output",
+ "bing_grounding_call",
+ "bing_grounding_call_output",
+ "sharepoint_grounding_preview_call",
+ "sharepoint_grounding_preview_call_output",
+ "azure_ai_search_call",
+ "azure_ai_search_call_output",
+ "bing_custom_search_preview_call",
+ "bing_custom_search_preview_call_output",
+ "openapi_call",
+ "openapi_call_output",
+ "browser_automation_preview_call",
+ "browser_automation_preview_call_output",
+ "fabric_dataagent_preview_call",
+ "fabric_dataagent_preview_call_output",
+ "azure_function_call",
+ "azure_function_call_output"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ItemWebSearchToolCall": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "status",
+ "action"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_search_call"
+ ],
+ "description": "The type of the web search tool call. Always `web_search_call`.",
+ "x-stainless-const": true
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
+ ],
+ "description": "The status of the web search tool call."
+ },
+ "action": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ }
+ ],
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ ],
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
+ },
+ "OpenAI.KeyPressAction": {
+ "type": "object",
+ "required": [
+ "type",
+ "keys"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "keypress"
+ ],
+ "description": "Specifies the event type. For a keypress action, this property is always set to `keypress`.",
+ "x-stainless-const": true
+ },
+ "keys": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ }
+ ],
+ "description": "A collection of keypresses the model would like to perform.",
+ "title": "KeyPress"
+ },
+ "OpenAI.KnownSpeakerNames": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 4,
+ "description": "Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported."
+ },
+ "OpenAI.KnownSpeakerReferences": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 4,
+ "description": "Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)) that contain known speaker references matching `known_speaker_names[]`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by `file`."
+ },
+ "OpenAI.ListAssistantsResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
+ ],
+ "properties": {
+ "object": {
+ "type": "string"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantObject"
+ },
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
+ "type": "string"
+ },
+ "last_id": {
+ "type": "string",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
+ }
+ },
+ "x-oaiMeta": {
+ "name": "List assistants response object",
+ "group": "chat",
+ "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"asst_abc123\",\n \"object\": \"assistant\",\n \"created_at\": 1698982736,\n \"name\": \"Coding Tutor\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n },\n {\n \"id\": \"asst_abc456\",\n \"object\": \"assistant\",\n \"created_at\": 1698982718,\n \"name\": \"My Assistant\",\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": \"You are a helpful assistant designed to make me better at coding!\",\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n },\n {\n \"id\": \"asst_abc789\",\n \"object\": \"assistant\",\n \"created_at\": 1698982643,\n \"name\": null,\n \"description\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [],\n \"tool_resources\": {},\n \"metadata\": {},\n \"top_p\": 1.0,\n \"temperature\": 1.0,\n \"response_format\": \"auto\"\n }\n ],\n \"first_id\": \"asst_abc123\",\n \"last_id\": \"asst_abc789\",\n \"has_more\": false\n}\n"
+ }
+ },
+ "OpenAI.ListBatchesResponse": {
+ "type": "object",
+ "required": [
+ "data",
+ "has_more",
+ "object"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Batch"
+ },
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
+ "type": "string"
+ },
+ "last_id": {
+ "type": "string",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "x-stainless-const": true
+ }
+ }
+ },
+ "OpenAI.ListFilesResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
+ ],
+ "properties": {
+ "object": {
+ "type": "string"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.OpenAIFile"
+ },
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
+ "type": "string"
+ },
+ "last_id": {
+ "type": "string",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
+ }
+ }
+ },
+ "OpenAI.ListFineTuningCheckpointPermissionResponse": {
+ "type": "object",
+ "required": [
+ "data",
+ "object",
+ "has_more"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningCheckpointPermission"
+ },
+ "x-ms-list-page-items": true
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "x-stainless-const": true
+ },
+ "first_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "last_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
}
- ]
+ }
},
- "OpenAI.InputItemWebSearchToolCall": {
+ "OpenAI.ListFineTuningJobCheckpointsResponse": {
"type": "object",
"required": [
- "id",
- "type",
- "status",
- "action"
+ "data",
+ "object",
+ "has_more"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the web search tool call."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpoint"
+ },
+ "x-ms-list-page-items": true
},
- "type": {
+ "object": {
"type": "string",
"enum": [
- "web_search_call"
+ "list"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
"x-stainless-const": true
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
- ],
- "description": "The status of the web search tool call."
- },
- "action": {
- "oneOf": [
+ "first_id": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ "type": "null"
+ }
+ ]
+ },
+ "last_id": {
+ "anyOf": [
+ {
+ "type": "string"
},
{
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ "type": "null"
}
],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- ],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
- },
- "OpenAI.InputMessageContentList": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputContent"
- },
- "description": "A list of one or many input items to the model, containing different content\ntypes.",
- "title": "Input item content list"
- },
- "OpenAI.InputParam": {
- "oneOf": [
- {
- "type": "string"
+ "x-ms-list-continuation-token": true
},
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "Text, image, or file inputs to the model, used to generate a response.\nLearn more:\n- [Text inputs and outputs](/docs/guides/text)\n- [Image inputs](/docs/guides/images)\n- [File inputs](/docs/guides/pdf-files)\n- [Conversation state](/docs/guides/conversation-state)\n- [Function calling](/docs/guides/function-calling)"
+ }
},
- "OpenAI.InputTextContent": {
+ "OpenAI.ListFineTuningJobEventsResponse": {
"type": "object",
"required": [
- "type",
- "text"
+ "data",
+ "object",
+ "has_more"
],
"properties": {
- "type": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJobEvent"
+ },
+ "x-ms-list-page-items": true
+ },
+ "object": {
"type": "string",
"enum": [
- "input_text"
+ "list"
],
- "description": "The type of the input item. Always `input_text`.",
- "x-stainless-const": true,
- "default": "input_text"
+ "x-stainless-const": true
},
- "text": {
- "type": "string",
- "description": "The text input to the model."
+ "has_more": {
+ "type": "boolean"
}
- },
- "description": "A text input to the model.",
- "title": "Input text"
+ }
},
- "OpenAI.InputTextContentParam": {
+ "OpenAI.ListMessagesResponse": {
"type": "object",
"required": [
- "type",
- "text"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "input_text"
- ],
- "description": "The type of the input item. Always `input_text`.",
- "x-stainless-const": true,
- "default": "input_text"
+ "object": {
+ "type": "string"
},
- "text": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MessageObject"
+ },
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
+ "type": "string"
+ },
+ "last_id": {
"type": "string",
- "maxLength": 10485760,
- "description": "The text input to the model."
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
}
- },
- "description": "A text input to the model.",
- "title": "Input text"
+ }
},
- "OpenAI.Item": {
+ "OpenAI.ListModelsResponse": {
"type": "object",
"required": [
- "type"
+ "object",
+ "data"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ItemType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "message": "#/components/schemas/OpenAI.ItemInputMessage",
- "output_message": "#/components/schemas/OpenAI.ItemOutputMessage",
- "file_search_call": "#/components/schemas/OpenAI.ItemFileSearchToolCall",
- "computer_call": "#/components/schemas/OpenAI.ItemComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.ItemComputerCallOutputItemParam",
- "web_search_call": "#/components/schemas/OpenAI.ItemWebSearchToolCall",
- "function_call": "#/components/schemas/OpenAI.ItemFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.ItemFunctionCallOutputItemParam",
- "tool_search_call": "#/components/schemas/OpenAI.ItemToolSearchCallItemParam",
- "tool_search_output": "#/components/schemas/OpenAI.ItemToolSearchOutputItemParam",
- "additional_tools": "#/components/schemas/OpenAI.ItemAdditionalToolsItemParam",
- "reasoning": "#/components/schemas/OpenAI.ItemReasoningItem",
- "compaction": "#/components/schemas/OpenAI.ItemCompactionSummaryItemParam",
- "image_generation_call": "#/components/schemas/OpenAI.ItemImageGenToolCall",
- "code_interpreter_call": "#/components/schemas/OpenAI.ItemCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.ItemLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.ItemLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.ItemFunctionShellCallItemParam",
- "shell_call_output": "#/components/schemas/OpenAI.ItemFunctionShellCallOutputItemParam",
- "apply_patch_call": "#/components/schemas/OpenAI.ItemApplyPatchToolCallItemParam",
- "apply_patch_call_output": "#/components/schemas/OpenAI.ItemApplyPatchToolCallOutputItemParam",
- "mcp_list_tools": "#/components/schemas/OpenAI.ItemMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.ItemMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.ItemMcpApprovalResponse",
- "mcp_call": "#/components/schemas/OpenAI.ItemMcpToolCall",
- "custom_tool_call_output": "#/components/schemas/OpenAI.ItemCustomToolCallOutput",
- "custom_tool_call": "#/components/schemas/OpenAI.ItemCustomToolCall"
+ "object": {
+ "type": "string",
+ "enum": [
+ "list"
+ ],
+ "x-stainless-const": true
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Model"
+ },
+ "x-ms-list-page-items": true
}
- },
- "description": "Content item used to generate a response."
+ }
},
- "OpenAI.ItemAdditionalToolsItemParam": {
+ "OpenAI.ListPaginatedFineTuningJobsResponse": {
"type": "object",
"required": [
- "type",
- "role",
- "tools"
+ "data",
+ "has_more",
+ "object"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.FineTuningJob"
+ },
+ "x-ms-list-page-items": true
},
- "type": {
- "type": "string",
- "enum": [
- "additional_tools"
- ],
- "description": "The item type. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
+ "has_more": {
+ "type": "boolean"
},
- "role": {
+ "object": {
"type": "string",
"enum": [
- "developer"
+ "list"
],
- "description": "The role that provided the additional tools. Only `developer` is supported.",
- "x-stainless-const": true,
- "default": "developer"
+ "x-stainless-const": true
+ }
+ }
+ },
+ "OpenAI.ListRunStepsResponse": {
+ "type": "object",
+ "required": [
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
+ ],
+ "properties": {
+ "object": {
+ "type": "string"
},
- "tools": {
+ "data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.RunStepObject"
},
- "description": "A list of additional tools made available at this item."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
+ "x-ms-list-page-items": true
+ },
+ "first_id": {
+ "type": "string"
+ },
+ "last_id": {
+ "type": "string",
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean"
}
- ]
+ }
},
- "OpenAI.ItemApplyPatchToolCallItemParam": {
+ "OpenAI.ListRunsResponse": {
"type": "object",
"required": [
- "type",
- "call_id",
- "status",
- "operation"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "apply_patch_call"
- ],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
+ "object": {
+ "type": "string"
},
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunObject"
+ },
+ "x-ms-list-page-items": true
},
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "first_id": {
+ "type": "string"
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatusParam",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ "last_id": {
+ "type": "string",
+ "x-ms-list-continuation-token": true
},
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchOperationParam",
- "description": "The specific create, delete, or update instruction for the apply_patch tool call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "A tool call representing a request to create, delete, or update files using diff patches.",
- "title": "Apply patch tool call"
+ }
},
- "OpenAI.ItemApplyPatchToolCallOutputItemParam": {
+ "OpenAI.ListVectorStoreFilesFilter": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "failed",
+ "cancelled"
+ ]
+ },
+ "OpenAI.ListVectorStoreFilesResponse": {
"type": "object",
"required": [
- "type",
- "call_id",
- "status"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "apply_patch_call_output"
- ],
- "description": "The type of the item. Always `apply_patch_call_output`.",
- "x-stainless-const": true,
- "default": "apply_patch_call_output"
+ "object": {
+ "type": "string"
},
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject"
+ },
+ "x-ms-list-page-items": true
},
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "first_id": {
+ "type": "string"
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ "last_id": {
+ "type": "string",
+ "x-ms-list-continuation-token": true
},
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "The streamed output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
+ }
},
- "OpenAI.ItemCodeInterpreterToolCall": {
+ "OpenAI.ListVectorStoresResponse": {
"type": "object",
"required": [
- "type",
- "id",
- "status",
- "container_id",
- "code",
- "outputs"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "code_interpreter_call"
- ],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
- "x-stainless-const": true,
- "default": "code_interpreter_call"
+ "object": {
+ "type": "string"
},
- "id": {
- "type": "string",
- "description": "The unique ID of the code interpreter tool call."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObject"
+ },
+ "x-ms-list-page-items": true
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
- ],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
+ "first_id": {
+ "type": "string"
},
- "container_id": {
+ "last_id": {
"type": "string",
- "description": "The ID of the container used to run the code."
- },
- "code": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "x-ms-list-continuation-token": true
},
- "outputs": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
+ "has_more": {
+ "type": "boolean"
}
- ],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
+ }
},
- "OpenAI.ItemCompactionSummaryItemParam": {
+ "OpenAI.LocalEnvironmentResource": {
"type": "object",
"required": [
- "type",
- "encrypted_content"
+ "type"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
"type": {
"type": "string",
"enum": [
- "compaction"
+ "local"
],
- "description": "The type of the item. Always `compaction`.",
- "x-stainless-const": true,
- "default": "compaction"
- },
- "encrypted_content": {
- "type": "string",
- "maxLength": 10485760,
- "description": "The encrypted content of the compaction summary."
+ "description": "The environment type. Always `local`.",
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
}
],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
+ "description": "Represents the use of a local environment to perform shell actions.",
+ "title": "Local Environment"
},
- "OpenAI.ItemComputerCallOutputItemParam": {
+ "OpenAI.LocalShellExecAction": {
"type": "object",
"required": [
- "call_id",
"type",
- "output"
+ "command",
+ "env"
],
"properties": {
- "id": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "exec"
+ ],
+ "description": "The type of the local shell action. Always `exec`.",
+ "x-stainless-const": true,
+ "default": "exec"
+ },
+ "command": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The command to run."
+ },
+ "timeout_ms": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
}
]
},
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The ID of the computer tool call that produced the output."
- },
- "type": {
- "type": "string",
- "enum": [
- "computer_call_output"
- ],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
- "x-stainless-const": true,
- "default": "computer_call_output"
- },
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
- },
- "acknowledged_safety_checks": {
+ "working_directory": {
"anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "status": {
+ "env": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Environment variables to set for the command.",
+ "x-oaiTypeLabel": "map"
+ },
+ "user": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ "type": "string"
},
{
"type": "null"
@@ -41358,1185 +63005,974 @@
]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ "description": "Execute a shell command on the server.",
+ "title": "Local shell exec action"
},
- "OpenAI.ItemComputerToolCall": {
+ "OpenAI.LocalShellToolParam": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "pending_safety_checks",
- "status"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_call"
+ "local_shell"
],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
+ "description": "The type of the local shell tool. Always `local_shell`.",
+ "x-stainless-const": true
},
- "id": {
+ "name": {
"type": "string",
- "description": "The unique ID of the computer call."
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- "call_id": {
+ "description": {
"type": "string",
- "description": "An identifier used when responding to the tool call with output."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- },
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
},
- "pending_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
},
- "description": "The pending safety checks for the computer call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
+ "description": "A tool that allows the model to execute shell commands in a local environment.",
+ "title": "Local shell tool"
},
- "OpenAI.ItemCustomToolCall": {
+ "OpenAI.LocalSkillParam": {
"type": "object",
"required": [
- "type",
- "call_id",
"name",
- "input"
+ "description",
+ "path"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "custom_tool_call"
- ],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
- },
- "namespace": {
+ "name": {
"type": "string",
- "description": "The namespace of the custom tool being called."
+ "description": "The name of the skill."
},
- "name": {
+ "description": {
"type": "string",
- "description": "The name of the custom tool being called."
+ "description": "The description of the skill."
},
- "input": {
+ "path": {
"type": "string",
- "description": "The input for the custom tool call generated by the model."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
+ "description": "The path to the directory containing the skill."
}
- ],
- "description": "A call to a custom tool created by the model.",
- "title": "Custom tool call"
+ }
},
- "OpenAI.ItemCustomToolCallOutput": {
+ "OpenAI.LogProb": {
"type": "object",
"required": [
- "type",
- "call_id",
- "output"
+ "token",
+ "logprob",
+ "bytes",
+ "top_logprobs"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "custom_tool_call_output"
- ],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
- "x-stainless-const": true
+ "token": {
+ "type": "string"
},
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "call_id": {
- "type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ "bytes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
},
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
- }
- ],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "The output of a custom tool call from your code, being sent back to the model.",
- "title": "Custom tool call output"
- },
- "OpenAI.ItemField": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ItemFieldType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "message": "#/components/schemas/OpenAI.ItemFieldMessage",
- "function_call": "#/components/schemas/OpenAI.ItemFieldFunctionToolCall",
- "tool_search_call": "#/components/schemas/OpenAI.ItemFieldToolSearchCall",
- "tool_search_output": "#/components/schemas/OpenAI.ItemFieldToolSearchOutput",
- "additional_tools": "#/components/schemas/OpenAI.ItemFieldAdditionalTools",
- "function_call_output": "#/components/schemas/OpenAI.ItemFieldFunctionToolCallOutput",
- "file_search_call": "#/components/schemas/OpenAI.ItemFieldFileSearchToolCall",
- "web_search_call": "#/components/schemas/OpenAI.ItemFieldWebSearchToolCall",
- "image_generation_call": "#/components/schemas/OpenAI.ItemFieldImageGenToolCall",
- "computer_call": "#/components/schemas/OpenAI.ItemFieldComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.ItemFieldComputerToolCallOutput",
- "reasoning": "#/components/schemas/OpenAI.ItemFieldReasoningItem",
- "compaction": "#/components/schemas/OpenAI.ItemFieldCompactionBody",
- "code_interpreter_call": "#/components/schemas/OpenAI.ItemFieldCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.ItemFieldLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.ItemFieldLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.ItemFieldFunctionShellCall",
- "shell_call_output": "#/components/schemas/OpenAI.ItemFieldFunctionShellCallOutput",
- "apply_patch_call": "#/components/schemas/OpenAI.ItemFieldApplyPatchToolCall",
- "apply_patch_call_output": "#/components/schemas/OpenAI.ItemFieldApplyPatchToolCallOutput",
- "mcp_list_tools": "#/components/schemas/OpenAI.ItemFieldMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.ItemFieldMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.ItemFieldMcpApprovalResponseResource",
- "mcp_call": "#/components/schemas/OpenAI.ItemFieldMcpToolCall",
- "custom_tool_call": "#/components/schemas/OpenAI.ItemFieldCustomToolCall",
- "custom_tool_call_output": "#/components/schemas/OpenAI.ItemFieldCustomToolCallOutput"
+ "top_logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TopLogProb"
+ }
}
},
- "description": "An item representing a message, tool call, tool output, reasoning, or other response element."
+ "description": "The log probability of a token.",
+ "title": "Log probability"
},
- "OpenAI.ItemFieldAdditionalTools": {
+ "OpenAI.MCPListToolsTool": {
"type": "object",
"required": [
- "type",
- "id",
- "role",
- "tools"
+ "name",
+ "input_schema"
],
"properties": {
- "type": {
+ "name": {
"type": "string",
- "enum": [
- "additional_tools"
- ],
- "description": "The type of the item. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
+ "description": "The name of the tool."
},
- "id": {
- "type": "string",
- "description": "The unique ID of the additional tools item."
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role that provided the additional tools."
+ "input_schema": {
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsToolInputSchema",
+ "description": "The JSON schema describing the tool's input."
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The additional tool definitions made available at this item."
+ "annotations": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPListToolsToolAnnotations"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
- }
- ]
+ "description": "A tool available on an MCP server.",
+ "title": "MCP list tools tool"
},
- "OpenAI.ItemFieldApplyPatchToolCall": {
+ "OpenAI.MCPListToolsToolAnnotations": {
+ "type": "object"
+ },
+ "OpenAI.MCPListToolsToolInputSchema": {
+ "type": "object"
+ },
+ "OpenAI.MCPTool": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "operation"
+ "server_label"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call"
+ "mcp"
],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
+ "description": "The type of the MCP tool. Always `mcp`.",
+ "x-stainless-const": true
},
- "id": {
+ "server_label": {
"type": "string",
- "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
+ "description": "A label for this MCP server, used to identify it in tool calls."
},
- "call_id": {
+ "server_url": {
"type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
- },
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
- "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
- "title": "Apply patch operation"
+ "format": "uri",
+ "description": "The URL for the MCP server. One of `server_url`, `connector_id`, or\n `tunnel_id` must be provided."
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
- }
- ],
- "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
- "title": "Apply patch tool call"
- },
- "OpenAI.ItemFieldApplyPatchToolCallOutput": {
- "type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "status"
- ],
- "properties": {
- "type": {
+ "connector_id": {
"type": "string",
"enum": [
- "apply_patch_call_output"
+ "connector_dropbox",
+ "connector_gmail",
+ "connector_googlecalendar",
+ "connector_googledrive",
+ "connector_microsoftteams",
+ "connector_outlookcalendar",
+ "connector_outlookemail",
+ "connector_sharepoint"
],
- "description": "The type of the item. Always `apply_patch_call_output`.",
- "x-stainless-const": true,
- "default": "apply_patch_call_output"
+ "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more\n about service connectors [here](/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`"
},
- "id": {
+ "tunnel_id": {
"type": "string",
- "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
+ "pattern": "^tunnel_[a-z0-9]{32}$",
+ "description": "The Secure MCP Tunnel ID to use instead of a direct server URL. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided."
},
- "call_id": {
+ "authorization": {
"type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
+ "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
+ "server_description": {
+ "type": "string",
+ "description": "Optional description of the MCP server, used to provide more context."
},
- "output": {
+ "headers": {
"anyOf": [
{
- "type": "string"
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call output."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
- }
- ],
- "description": "The output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
- },
- "OpenAI.ItemFieldCodeInterpreterToolCall": {
- "type": "object",
- "required": [
- "type",
- "id",
- "status",
- "container_id",
- "code",
- "outputs"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "code_interpreter_call"
- ],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
- "x-stainless-const": true,
- "default": "code_interpreter_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the code interpreter tool call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
- ],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
- },
- "container_id": {
- "type": "string",
- "description": "The ID of the container used to run the code."
- },
- "code": {
+ "allowed_tools": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
},
{
"type": "null"
}
]
},
- "outputs": {
+ "require_approval": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
- }
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "always",
+ "never"
+ ]
},
{
"type": "null"
}
- ]
+ ],
+ "default": "always"
+ },
+ "defer_loading": {
+ "type": "boolean",
+ "description": "Whether this MCP tool is deferred and discovered via tool search."
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server."
+ },
+ "tool_configs": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/ToolConfig"
+ },
+ "description": "Deprecated. This property is deprecated and will be removed in a future version.",
+ "deprecated": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
+ "description": "Give the model access to additional tools via remote Model Context Protocol\n(MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).",
+ "title": "MCP tool"
},
- "OpenAI.ItemFieldCompactionBody": {
+ "OpenAI.MCPToolCallStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete",
+ "calling",
+ "failed"
+ ]
+ },
+ "OpenAI.MCPToolFilter": {
+ "type": "object",
+ "properties": {
+ "tool_names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "List of allowed tool names.",
+ "title": "MCP allowed tools"
+ },
+ "read_only": {
+ "type": "boolean",
+ "description": "Indicates whether or not a tool modifies data or is read-only. If an\n MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),\n it will match this filter."
+ }
+ },
+ "description": "A filter object to specify which tools are allowed.",
+ "title": "MCP tool filter"
+ },
+ "OpenAI.MCPToolRequireApproval": {
+ "type": "object",
+ "properties": {
+ "always": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ },
+ "never": {
+ "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ }
+ }
+ },
+ "OpenAI.MessageContent": {
"type": "object",
"required": [
- "type",
- "id",
- "encrypted_content"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "compaction"
- ],
- "description": "The type of the item. Always `compaction`.",
- "x-stainless-const": true,
- "default": "compaction"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the compaction item."
- },
- "encrypted_content": {
- "type": "string",
- "description": "The encrypted content that was produced by compaction."
- },
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "$ref": "#/components/schemas/OpenAI.MessageContentType"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "text": "#/components/schemas/OpenAI.TextContent",
+ "computer_screenshot": "#/components/schemas/OpenAI.ComputerScreenshotContent",
+ "input_text": "#/components/schemas/OpenAI.MessageContentInputTextContent",
+ "output_text": "#/components/schemas/OpenAI.MessageContentOutputTextContent",
+ "reasoning_text": "#/components/schemas/OpenAI.MessageContentReasoningTextContent",
+ "refusal": "#/components/schemas/OpenAI.MessageContentRefusalContent",
+ "input_image": "#/components/schemas/OpenAI.MessageContentInputImageContent",
+ "input_file": "#/components/schemas/OpenAI.MessageContentInputFileContent",
+ "summary_text": "#/components/schemas/OpenAI.SummaryTextContent"
}
- ],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
+ },
+ "description": "A content part that makes up an input or output item."
},
- "OpenAI.ItemFieldComputerToolCall": {
+ "OpenAI.MessageContentImageFileObject": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "pending_safety_checks",
- "status"
+ "image_file"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_call"
+ "image_file"
],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the computer call."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used when responding to the tool call with output."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- },
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
- },
- "pending_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The pending safety checks for the computer call."
+ "description": "Always `image_file`.",
+ "x-stainless-const": true
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "image_file": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentImageFileObjectImageFile"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
}
],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
+ "description": "References an image [File](/docs/api-reference/files) in the content of a message.",
+ "title": "Image file"
},
- "OpenAI.ItemFieldComputerToolCallOutput": {
+ "OpenAI.MessageContentImageFileObjectImageFile": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "output"
+ "file_id"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "computer_call_output"
- ],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
- "x-stainless-const": true,
- "default": "computer_call_output"
- },
- "id": {
- "type": "string",
- "description": "The ID of the computer tool call output.",
- "readOnly": true
- },
- "call_id": {
- "type": "string",
- "description": "The ID of the computer tool call that produced the output."
- },
- "acknowledged_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
- },
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "file_id": {
+ "type": "string"
},
- "status": {
+ "detail": {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete"
+ "auto",
+ "low",
+ "high"
],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "default": "auto"
}
- ],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ }
},
- "OpenAI.ItemFieldCustomToolCall": {
+ "OpenAI.MessageContentImageUrlObject": {
"type": "object",
"required": [
"type",
- "call_id",
- "name",
- "input"
+ "image_url"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call"
+ "image_url"
],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "description": "The type of the content part.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the custom tool being called."
- },
- "name": {
- "type": "string",
- "description": "The name of the custom tool being called."
- },
- "input": {
- "type": "string",
- "description": "The input for the custom tool call generated by the model."
+ "image_url": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentImageUrlObjectImageUrl"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
}
],
- "description": "A call to a custom tool created by the model.",
- "title": "Custom tool call"
+ "description": "References an image URL in the content of a message.",
+ "title": "Image URL"
},
- "OpenAI.ItemFieldCustomToolCallOutput": {
+ "OpenAI.MessageContentImageUrlObjectImageUrl": {
"type": "object",
"required": [
- "type",
- "call_id",
- "output"
+ "url"
],
"properties": {
- "type": {
+ "url": {
"type": "string",
- "enum": [
- "custom_tool_call_output"
- ],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
- "x-stainless-const": true
+ "format": "uri"
},
- "id": {
+ "detail": {
"type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
- },
- "call_id": {
+ "enum": [
+ "auto",
+ "low",
+ "high"
+ ],
+ "default": "auto"
+ }
+ }
+ },
+ "OpenAI.MessageContentInputFileContent": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
+ "enum": [
+ "input_file"
+ ],
+ "description": "The type of the input item. Always `input_file`.",
+ "x-stainless-const": true,
+ "default": "input_file"
},
- "output": {
- "oneOf": [
+ "file_id": {
+ "anyOf": [
{
"type": "string"
},
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
+ "type": "null"
}
- ],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
+ ]
+ },
+ "filename": {
+ "type": "string",
+ "description": "The name of the file to be sent to the model."
+ },
+ "file_data": {
+ "type": "string",
+ "description": "The content of the file to be sent to the model."
+ },
+ "file_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the file to be sent to the model."
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.FileInputDetail",
+ "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "The output of a custom tool call from your code, being sent back to the model.",
- "title": "Custom tool call output"
+ "description": "A file input to the model.",
+ "title": "Input file"
},
- "OpenAI.ItemFieldFileSearchToolCall": {
+ "OpenAI.MessageContentInputImageContent": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "queries"
+ "detail"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the file search tool call."
- },
"type": {
"type": "string",
"enum": [
- "file_search_call"
- ],
- "description": "The type of the file search tool call. Always `file_search_call`.",
- "x-stainless-const": true
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "incomplete",
- "failed"
+ "input_image"
],
- "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
+ "description": "The type of the input item. Always `input_image`.",
+ "x-stainless-const": true,
+ "default": "input_image"
},
- "queries": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The queries used to search for files."
+ "image_url": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "results": {
+ "file_id": {
"anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
- }
+ "type": "string"
},
{
"type": "null"
}
]
+ },
+ "detail": {
+ "$ref": "#/components/schemas/OpenAI.ImageDetail",
+ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
- "title": "File search tool call"
+ "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
+ "title": "Input image"
},
- "OpenAI.ItemFieldFunctionShellCall": {
+ "OpenAI.MessageContentInputTextContent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "action",
- "status",
- "environment"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call"
+ "input_text"
],
- "description": "The type of the item. Always `shell_call`.",
+ "description": "The type of the input item. Always `input_text`.",
"x-stainless-const": true,
- "default": "shell_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
- "description": "The shell commands and limits that describe how to run the tool call."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
- "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
- },
- "environment": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
- },
- {
- "type": "null"
- }
- ]
+ "default": "input_text"
},
- "created_by": {
+ "text": {
"type": "string",
- "description": "The ID of the entity that created this tool call."
+ "description": "The text input to the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "A tool call that executes one or more shell commands in a managed environment.",
- "title": "Shell tool call"
+ "description": "A text input to the model.",
+ "title": "Input text"
},
- "OpenAI.ItemFieldFunctionShellCallOutput": {
+ "OpenAI.MessageContentOutputTextContent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "output",
- "max_output_length"
+ "text",
+ "annotations",
+ "logprobs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call_output"
+ "output_text"
],
- "description": "The type of the shell call output. Always `shell_call_output`.",
+ "description": "The type of the output text. Always `output_text`.",
"x-stainless-const": true,
- "default": "shell_call_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell call output. Populated when this item is returned via API."
+ "default": "output_text"
},
- "call_id": {
+ "text": {
"type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
- "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ "description": "The text output from the model."
},
- "output": {
+ "annotations": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
+ "$ref": "#/components/schemas/OpenAI.Annotation"
},
- "description": "An array of shell call output contents"
- },
- "max_output_length": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The annotations of the text output."
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.LogProb"
+ }
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "The output of a shell tool call that was emitted.",
- "title": "Shell call output"
+ "description": "A text output from the model.",
+ "title": "Output text"
},
- "OpenAI.ItemFieldFunctionToolCall": {
+ "OpenAI.MessageContentReasoningTextContent": {
"type": "object",
"required": [
- "id",
"type",
- "call_id",
- "name",
- "arguments"
+ "text"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call"
+ "reasoning_text"
],
- "description": "The type of the function tool call. Always `function_call`.",
- "x-stainless-const": true
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the function to run."
- },
- "name": {
- "type": "string",
- "description": "The name of the function to run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the function."
+ "description": "The type of the reasoning text. Always `reasoning_text`.",
+ "x-stainless-const": true,
+ "default": "reasoning_text"
},
- "status": {
+ "text": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The reasoning text from the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
- "title": "Function tool call"
+ "description": "Reasoning text from the model.",
+ "title": "Reasoning text"
},
- "OpenAI.ItemFieldFunctionToolCallOutput": {
+ "OpenAI.MessageContentRefusalContent": {
"type": "object",
"required": [
- "id",
"type",
- "call_id",
- "output"
+ "refusal"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call_output"
- ],
- "description": "The type of the function tool call output. Always `function_call_output`.",
- "x-stainless-const": true
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
- }
+ "refusal"
],
- "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
+ "description": "The type of the refusal. Always `refusal`.",
+ "x-stainless-const": true,
+ "default": "refusal"
},
- "status": {
+ "refusal": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The refusal explanation from the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
+ "description": "A refusal from the model.",
+ "title": "Refusal"
},
- "OpenAI.ItemFieldImageGenToolCall": {
+ "OpenAI.MessageContentRefusalObject": {
"type": "object",
"required": [
"type",
- "id",
- "status",
- "result"
+ "refusal"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "image_generation_call"
+ "refusal"
],
- "description": "The type of the image generation call. Always `image_generation_call`.",
+ "description": "Always `refusal`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the image generation call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "generating",
- "failed"
- ],
- "description": "The status of the image generation call."
- },
- "result": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "refusal": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
}
],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
+ "description": "The refusal content generated by the assistant.",
+ "title": "Refusal"
},
- "OpenAI.ItemFieldLocalShellToolCall": {
+ "OpenAI.MessageContentTextAnnotationsFileCitationObject": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "action",
- "status"
+ "text",
+ "file_citation",
+ "start_index",
+ "end_index"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call"
+ "file_citation"
],
- "description": "The type of the local shell call. Always `local_shell_call`.",
+ "description": "Always `file_citation`.",
"x-stainless-const": true
},
- "id": {
+ "text": {
"type": "string",
- "description": "The unique ID of the local shell call."
+ "description": "The text in the message content that needs to be replaced."
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "file_citation": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation"
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the local shell call."
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.TextAnnotation"
}
],
- "description": "A tool call to run a command on the local shell.",
- "title": "Local shell call"
+ "description": "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.",
+ "title": "File citation"
},
- "OpenAI.ItemFieldLocalShellToolCallOutput": {
+ "OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation": {
+ "type": "object",
+ "required": [
+ "file_id"
+ ],
+ "properties": {
+ "file_id": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.MessageContentTextAnnotationsFilePathObject": {
"type": "object",
"required": [
"type",
- "id",
- "output"
+ "text",
+ "file_path",
+ "start_index",
+ "end_index"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call_output"
+ "file_path"
],
- "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "description": "Always `file_path`.",
"x-stainless-const": true
},
- "id": {
+ "text": {
"type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "description": "The text in the message content that needs to be replaced."
},
- "output": {
- "type": "string",
- "description": "A JSON string of the output of the local shell tool call."
+ "file_path": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath"
},
- "status": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
+ },
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.TextAnnotation"
}
],
- "description": "The output of a local shell tool call.",
- "title": "Local shell call output"
+ "description": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.",
+ "title": "File path"
},
- "OpenAI.ItemFieldMcpApprovalRequest": {
+ "OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath": {
+ "type": "object",
+ "required": [
+ "file_id"
+ ],
+ "properties": {
+ "file_id": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.MessageContentTextObject": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_request"
+ "text"
],
- "description": "The type of the item. Always `mcp_approval_request`.",
+ "description": "Always `text`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the approval request."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server making the request."
- },
- "name": {
- "type": "string",
- "description": "The name of the tool to run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of arguments for the tool."
+ "text": {
+ "$ref": "#/components/schemas/OpenAI.MessageContentTextObjectText"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
}
],
- "description": "A request for human approval of a tool invocation.",
- "title": "MCP approval request"
+ "description": "The text content that is part of a message.",
+ "title": "Text"
},
- "OpenAI.ItemFieldMcpApprovalResponseResource": {
+ "OpenAI.MessageContentTextObjectText": {
+ "type": "object",
+ "required": [
+ "value",
+ "annotations"
+ ],
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "annotations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.TextAnnotation"
+ }
+ }
+ }
+ },
+ "OpenAI.MessageContentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "input_text",
+ "output_text",
+ "text",
+ "summary_text",
+ "reasoning_text",
+ "refusal",
+ "input_image",
+ "computer_screenshot",
+ "input_file"
+ ]
+ }
+ ]
+ },
+ "OpenAI.MessageObject": {
"type": "object",
"required": [
- "type",
"id",
- "approval_request_id",
- "approve"
+ "object",
+ "created_at",
+ "thread_id",
+ "status",
+ "incomplete_details",
+ "completed_at",
+ "incomplete_at",
+ "role",
+ "content",
+ "assistant_id",
+ "run_id",
+ "attachments",
+ "metadata"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "mcp_approval_response"
+ "thread.message"
],
- "description": "The type of the item. Always `mcp_approval_response`.",
+ "description": "The object type, which is always `thread.message`.",
"x-stainless-const": true
},
- "id": {
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the message was created."
+ },
+ "thread_id": {
"type": "string",
- "description": "The unique ID of the approval response"
+ "description": "The [thread](/docs/api-reference/threads) ID that this message belongs to."
},
- "approval_request_id": {
+ "status": {
"type": "string",
- "description": "The ID of the approval request being answered."
+ "enum": [
+ "in_progress",
+ "incomplete",
+ "completed"
+ ],
+ "description": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`."
},
- "approve": {
- "type": "boolean",
- "description": "Whether the request was approved."
+ "incomplete_details": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MessageObjectIncompleteDetails"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "reason": {
+ "completed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "incomplete_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "user",
+ "assistant"
+ ],
+ "description": "The entity that produced the message. One of `user` or `assistant`."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContent"
+ },
+ "description": "The content of the message in array of text and/or images."
+ },
+ "assistant_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "run_id": {
"anyOf": [
{
"type": "string"
@@ -42545,605 +63981,499 @@
"type": "null"
}
]
+ },
+ "attachments": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.MessageObjectAttachments"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
+ "description": "Represents a message within a [thread](/docs/api-reference/threads).",
+ "title": "The message object",
+ "x-oaiMeta": {
+ "name": "The message object",
+ "beta": true,
+ "example": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1698983503,\n \"thread_id\": \"thread_abc123\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"Hi! How can I help you today?\",\n \"annotations\": []\n }\n }\n ],\n \"assistant_id\": \"asst_abc123\",\n \"run_id\": \"run_abc123\",\n \"attachments\": [],\n \"metadata\": {}\n}\n"
+ }
+ },
+ "OpenAI.MessageObjectAttachments": {
+ "type": "object",
+ "properties": {
+ "file_id": {
+ "type": "string"
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsCode"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "OpenAI.MessageObjectContent": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.MessageObjectContentType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "image_url": "#/components/schemas/OpenAI.MessageContentImageUrlObject",
+ "text": "#/components/schemas/OpenAI.MessageContentTextObject",
+ "refusal": "#/components/schemas/OpenAI.MessageContentRefusalObject",
+ "image_file": "#/components/schemas/OpenAI.MessageContentImageFileObject"
+ }
+ }
+ },
+ "OpenAI.MessageObjectContentType": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "image_file",
+ "image_url",
+ "text",
+ "refusal"
+ ]
}
+ ]
+ },
+ "OpenAI.MessageObjectIncompleteDetails": {
+ "type": "object",
+ "required": [
+ "reason"
],
- "description": "A response to an MCP approval request.",
- "title": "MCP approval response"
+ "properties": {
+ "reason": {
+ "type": "string",
+ "enum": [
+ "content_filter",
+ "max_tokens",
+ "run_cancelled",
+ "run_expired",
+ "run_failed"
+ ]
+ }
+ }
+ },
+ "OpenAI.MessagePhase": {
+ "type": "string",
+ "enum": [
+ "commentary",
+ "final_answer"
+ ],
+ "description": "Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).\nFor models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend\nphase on all assistant messages — dropping it can degrade performance. Not used for user messages."
+ },
+ "OpenAI.MessageRequestContentTextObject": {
+ "type": "object",
+ "required": [
+ "type",
+ "text"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ],
+ "description": "Always `text`.",
+ "x-stainless-const": true
+ },
+ "text": {
+ "type": "string",
+ "description": "Text content to be sent to the model"
+ }
+ },
+ "description": "The text content that is part of a message.",
+ "title": "Text"
+ },
+ "OpenAI.MessageRole": {
+ "type": "string",
+ "enum": [
+ "unknown",
+ "user",
+ "assistant",
+ "system",
+ "critic",
+ "discriminator",
+ "developer",
+ "tool"
+ ]
+ },
+ "OpenAI.MessageStatus": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "incomplete"
+ ]
+ },
+ "OpenAI.Metadata": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "string"
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
+ "x-oaiTypeLabel": "map"
},
- "OpenAI.ItemFieldMcpListTools": {
+ "OpenAI.Model": {
"type": "object",
"required": [
- "type",
"id",
- "server_label",
- "tools"
+ "created",
+ "object",
+ "owned_by"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The model identifier, which can be referenced in the API endpoints."
+ },
+ "created": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) when the model was created."
+ },
+ "object": {
"type": "string",
"enum": [
- "mcp_list_tools"
+ "model"
],
- "description": "The type of the item. Always `mcp_list_tools`.",
+ "description": "The object type, which is always \"model\".",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the list."
- },
- "server_label": {
+ "owned_by": {
"type": "string",
- "description": "The label of the MCP server."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
- },
- "description": "The tools available on the server."
- },
- "error": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "description": "The organization that owns the model."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
- }
- ],
- "description": "A list of tools available on an MCP server.",
- "title": "MCP list tools"
+ "description": "Describes an OpenAI model offering that can be used with the API.",
+ "title": "Model",
+ "x-oaiMeta": {
+ "name": "The model object",
+ "example": "{\n \"id\": \"VAR_chat_model_id\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"openai\"\n}\n"
+ }
},
- "OpenAI.ItemFieldMcpToolCall": {
+ "OpenAI.Moderation": {
"type": "object",
"required": [
- "type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "input",
+ "output"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp_call"
- ],
- "description": "The type of the item. Always `mcp_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the tool call."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server running the tool."
- },
- "name": {
- "type": "string",
- "description": "The name of the tool that was run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments passed to the tool."
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.ModerationEntry",
+ "description": "Moderation for the response input."
},
"output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "error": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
- "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
- },
- "approval_request_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/components/schemas/OpenAI.ModerationEntry",
+ "description": "Moderation for the response output."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
- }
+ "description": "Moderation results or errors for the response input and output.",
+ "title": "Moderation"
+ },
+ "OpenAI.ModerationCategoryInputType": {
+ "type": "string",
+ "enum": [
+ "text",
+ "image"
],
- "description": "An invocation of a tool on an MCP server.",
- "title": "MCP tool call"
+ "description": "The applied input type(s) for the category."
},
- "OpenAI.ItemFieldMessage": {
+ "OpenAI.ModerationEntry": {
"type": "object",
"required": [
- "type",
- "id",
- "status",
- "role",
- "content"
+ "type"
],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "message"
- ],
- "description": "The type of the message. Always set to `message`.",
- "x-stainless-const": true,
- "default": "message"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the message."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MessageStatus",
- "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API."
- },
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`."
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- },
- "description": "The content of the message"
- },
- "phase": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/components/schemas/OpenAI.ModerationEntryType"
}
},
- "allOf": [
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "error": "#/components/schemas/OpenAI.ModerationErrorBody",
+ "moderation_result": "#/components/schemas/OpenAI.ModerationResultBody"
+ }
+ },
+ "description": "Moderation results or an error for a response moderation check."
+ },
+ "OpenAI.ModerationEntryType": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "moderation_result",
+ "error"
+ ]
}
- ],
- "description": "A message to or from the model.",
- "title": "Message"
+ ]
},
- "OpenAI.ItemFieldReasoningItem": {
+ "OpenAI.ModerationErrorBody": {
"type": "object",
"required": [
"type",
- "id",
- "summary"
+ "code",
+ "message"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "reasoning"
+ "error"
],
- "description": "The type of the object. Always `reasoning`.",
+ "description": "The object type, which was always `error` for moderation failures.",
"x-stainless-const": true
},
- "id": {
+ "code": {
"type": "string",
- "description": "The unique identifier of the reasoning content."
- },
- "encrypted_content": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "summary": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
- },
- "description": "Reasoning summary content."
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
- },
- "description": "Reasoning text content."
+ "description": "The error code."
},
- "status": {
+ "message": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The error message."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.ModerationEntry"
}
],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
+ "description": "An error produced while attempting moderation for the response input or output.",
+ "title": "Moderation error"
},
- "OpenAI.ItemFieldToolSearchCall": {
+ "OpenAI.ModerationImageURLInput": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "execution",
- "arguments",
- "status"
+ "image_url"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_search_call"
+ "image_url"
],
- "description": "The type of the item. Always `tool_search_call`.",
- "x-stainless-const": true,
- "default": "tool_search_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the tool search call item."
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "arguments": {
- "description": "Arguments used for the tool search call."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the tool search call item that was recorded."
+ "description": "Always `image_url`.",
+ "x-stainless-const": true
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "image_url": {
+ "$ref": "#/components/schemas/OpenAI.ModerationImageURLInputImageUrl",
+ "description": "Contains either an image URL or a data URL for a base64 encoded image."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequestInput"
}
- ]
+ ],
+ "description": "An object describing an image to classify."
},
- "OpenAI.ItemFieldToolSearchOutput": {
+ "OpenAI.ModerationImageURLInputImageUrl": {
"type": "object",
"required": [
- "type",
- "id",
- "call_id",
- "execution",
- "tools",
- "status"
+ "url"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "tool_search_output"
- ],
- "description": "The type of the item. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the tool search output item."
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The loaded tool definitions returned by tool search."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the tool search output item that was recorded."
- },
- "created_by": {
+ "url": {
"type": "string",
- "description": "The identifier of the actor that created the item."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "format": "uri"
}
+ }
+ },
+ "OpenAI.ModerationInputType": {
+ "type": "string",
+ "enum": [
+ "text",
+ "image"
]
},
- "OpenAI.ItemFieldType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "OpenAI.ModerationParam": {
+ "type": "object",
+ "required": [
+ "model"
+ ],
+ "properties": {
+ "model": {
"type": "string",
- "enum": [
- "message",
- "function_call",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "function_call_output",
- "file_search_call",
- "web_search_call",
- "image_generation_call",
- "computer_call",
- "computer_call_output",
- "reasoning",
- "compaction",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "mcp_call",
- "custom_tool_call",
- "custom_tool_call_output"
- ]
+ "description": "The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'."
}
- ]
+ },
+ "description": "Configuration for running moderation on the input and output of this response."
},
- "OpenAI.ItemFieldWebSearchToolCall": {
+ "OpenAI.ModerationResultBody": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "action"
+ "model",
+ "flagged",
+ "categories",
+ "category_scores",
+ "category_applied_input_types"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the web search tool call."
- },
"type": {
"type": "string",
"enum": [
- "web_search_call"
+ "moderation_result"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
+ "description": "The object type, which was always `moderation_result` for successful moderation results.",
"x-stainless-const": true
},
- "status": {
+ "model": {
"type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
- ],
- "description": "The status of the web search tool call."
+ "description": "The moderation model that produced this result."
},
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ "flagged": {
+ "type": "boolean",
+ "description": "A boolean indicating whether the content was flagged by any category."
+ },
+ "categories": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "boolean"
+ },
+ "description": "A dictionary of moderation categories to booleans, True if the input is flagged under this category.",
+ "x-oaiTypeLabel": "map"
+ },
+ "category_scores": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "description": "A dictionary of moderation categories to scores.",
+ "x-oaiTypeLabel": "map"
+ },
+ "category_applied_input_types": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ModerationInputType"
}
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ },
+ "description": "Which modalities of input are reflected by the score for each category.",
+ "x-oaiTypeLabel": "map"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemField"
+ "$ref": "#/components/schemas/OpenAI.ModerationEntry"
}
],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
+ "description": "A moderation result produced for the response input or output.",
+ "title": "Moderation result"
},
- "OpenAI.ItemFileSearchToolCall": {
+ "OpenAI.ModerationTextInput": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "queries"
+ "text"
],
- "properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the file search tool call."
- },
- "type": {
- "type": "string",
- "enum": [
- "file_search_call"
- ],
- "description": "The type of the file search tool call. Always `file_search_call`.",
- "x-stainless-const": true
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "incomplete",
- "failed"
- ],
- "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
- },
- "queries": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The queries used to search for files."
- },
- "results": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
- }
- },
- {
- "type": "null"
- }
- ]
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "text"
+ ],
+ "description": "Always `text`.",
+ "x-stainless-const": true
+ },
+ "text": {
+ "type": "string",
+ "description": "A string of text to classify."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.CreateModerationRequestInput"
}
],
- "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
- "title": "File search tool call"
+ "description": "An object describing text to classify."
},
- "OpenAI.ItemFunctionCallOutputItemParam": {
+ "OpenAI.ModifyAssistantRequest": {
"type": "object",
- "required": [
- "call_id",
- "type",
- "output"
- ],
"properties": {
- "id": {
+ "model": {
"anyOf": [
{
"type": "string"
},
+ {
+ "$ref": "#/components/schemas/OpenAI.AssistantSupportedModels"
+ }
+ ],
+ "description": "ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them."
+ },
+ "reasoning_effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
{
"type": "null"
}
]
},
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the function tool call generated by the model."
- },
- "type": {
- "type": "string",
- "enum": [
- "function_call_output"
- ],
- "description": "The type of the function tool call output. Always `function_call_output`.",
- "x-stainless-const": true,
- "default": "function_call_output"
- },
- "output": {
- "oneOf": [
+ "name": {
+ "anyOf": [
{
"type": "string"
},
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.InputTextContentParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputImageContentParamAutoParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputFileContentParam"
- }
- ]
- }
+ "type": "null"
}
- ],
- "description": "Text, image, or file output of the function tool call."
+ ]
},
- "status": {
+ "description": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
+ "type": "string"
},
{
"type": "null"
}
]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
- },
- "OpenAI.ItemFunctionShellCallItemParam": {
- "type": "object",
- "required": [
- "call_id",
- "type",
- "action"
- ],
- "properties": {
- "id": {
+ },
+ "instructions": {
"anyOf": [
{
"type": "string"
@@ -43153,459 +64483,225 @@
}
]
},
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "type": {
- "type": "string",
- "enum": [
- "shell_call"
- ],
- "description": "The type of the item. Always `shell_call`.",
- "x-stainless-const": true,
- "default": "shell_call"
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellActionParam",
- "description": "The shell commands and limits that describe how to run the tool call."
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ },
+ "maxItems": 128,
+ "description": "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`.",
+ "default": []
},
- "status": {
+ "tool_resources": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
+ "$ref": "#/components/schemas/OpenAI.ModifyAssistantRequestToolResources"
},
{
"type": "null"
}
]
},
- "environment": {
+ "metadata": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment"
+ "$ref": "#/components/schemas/OpenAI.Metadata"
},
{
"type": "null"
}
]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "A tool representing a request to execute one or more shell commands.",
- "title": "Shell tool call"
- },
- "OpenAI.ItemFunctionShellCallOutputItemParam": {
- "type": "object",
- "required": [
- "call_id",
- "type",
- "output"
- ],
- "properties": {
- "id": {
+ },
+ "temperature": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
{
"type": "null"
}
- ]
- },
- "call_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "type": {
- "type": "string",
- "enum": [
- "shell_call_output"
],
- "description": "The type of the item. Always `shell_call_output`.",
- "x-stainless-const": true,
- "default": "shell_call_output"
- },
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContentParam"
- },
- "description": "Captured chunks of stdout and stderr output, along with their associated outcomes."
+ "default": 1
},
- "status": {
+ "top_p": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallItemStatus"
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
{
"type": "null"
}
- ]
+ ],
+ "default": 1
},
- "max_output_length": {
+ "response_format": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
},
{
"type": "null"
}
]
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "The streamed output items emitted by a shell tool call.",
- "title": "Shell tool call output"
+ }
},
- "OpenAI.ItemFunctionToolCall": {
+ "OpenAI.ModifyAssistantRequestToolResources": {
"type": "object",
- "required": [
- "id",
- "type",
- "call_id",
- "name",
- "arguments"
- ],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call.",
- "readOnly": true
- },
- "type": {
- "type": "string",
- "enum": [
- "function_call"
- ],
- "description": "The type of the function tool call. Always `function_call`.",
- "x-stainless-const": true
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the function to run."
- },
- "name": {
- "type": "string",
- "description": "The name of the function to run."
- },
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the function."
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.ModifyAssistantRequestToolResourcesCodeInterpreter"
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.ModifyAssistantRequestToolResourcesFileSearch"
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ },
+ "OpenAI.ModifyAssistantRequestToolResourcesCodeInterpreter": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 20
}
- ],
- "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
- "title": "Function tool call"
+ }
},
- "OpenAI.ItemImageGenToolCall": {
+ "OpenAI.ModifyAssistantRequestToolResourcesFileSearch": {
"type": "object",
- "required": [
- "type",
- "id",
- "status",
- "result"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "image_generation_call"
- ],
- "description": "The type of the image generation call. Always `image_generation_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the image generation call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "generating",
- "failed"
- ],
- "description": "The status of the image generation call."
- },
- "result": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 1
+ }
+ }
+ },
+ "OpenAI.ModifyMessageRequest": {
+ "type": "object",
+ "properties": {
+ "metadata": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.Metadata"
},
{
"type": "null"
}
]
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
- },
- "OpenAI.ItemInputMessage": {
- "type": "object",
- "required": [
- "type",
- "role",
- "content",
- "id"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "message"
- ],
- "description": "The type of the message input. Always set to `message`.",
- "x-stainless-const": true,
- "default": "message"
- },
- "role": {
- "type": "string",
- "enum": [
- "user",
- "system",
- "developer"
- ],
- "description": "The role of the message input. One of `user`, `system`, or `developer`."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- },
- "content": {
- "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the message input.",
- "readOnly": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role.",
- "title": "Input message"
+ }
},
- "OpenAI.ItemLocalShellToolCall": {
+ "OpenAI.ModifyRunRequest": {
"type": "object",
- "required": [
- "type",
- "id",
- "call_id",
- "action",
- "status"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "local_shell_call"
- ],
- "description": "The type of the local shell call. Always `local_shell_call`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell call."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the local shell call."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- ],
- "description": "A tool call to run a command on the local shell.",
- "title": "Local shell call"
+ }
},
- "OpenAI.ItemLocalShellToolCallOutput": {
+ "OpenAI.ModifyThreadRequest": {
"type": "object",
- "required": [
- "type",
- "id",
- "output"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "local_shell_call_output"
- ],
- "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
- },
- "output": {
- "type": "string",
- "description": "A JSON string of the output of the local shell tool call."
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "status": {
+ "metadata": {
"anyOf": [
{
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
+ "$ref": "#/components/schemas/OpenAI.Metadata"
},
{
"type": "null"
}
]
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
- }
- ],
- "description": "The output of a local shell tool call.",
- "title": "Local shell call output"
+ }
},
- "OpenAI.ItemMcpApprovalRequest": {
+ "OpenAI.ModifyThreadRequestToolResources": {
"type": "object",
- "required": [
- "type",
- "id",
- "server_label",
- "name",
- "arguments"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp_approval_request"
- ],
- "description": "The type of the item. Always `mcp_approval_request`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the approval request."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server making the request."
- },
- "name": {
- "type": "string",
- "description": "The name of the tool to run."
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter"
},
- "arguments": {
- "type": "string",
- "description": "A JSON string of arguments for the tool."
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesFileSearch"
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Item"
+ }
+ },
+ "OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 20
}
- ],
- "description": "A request for human approval of a tool invocation.",
- "title": "MCP approval request"
+ }
},
- "OpenAI.ItemMcpApprovalResponse": {
+ "OpenAI.ModifyThreadRequestToolResourcesFileSearch": {
+ "type": "object",
+ "properties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 1
+ }
+ }
+ },
+ "OpenAI.MoveParam": {
"type": "object",
"required": [
- "type",
- "approval_request_id",
- "approve"
+ "type",
+ "x",
+ "y"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_response"
+ "move"
],
- "description": "The type of the item. Always `mcp_approval_response`.",
+ "description": "Specifies the event type. For a move action, this property is always set to `move`.",
"x-stainless-const": true
},
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "approval_request_id": {
- "type": "string",
- "description": "The ID of the approval request being answered."
+ "x": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The x-coordinate to move to."
},
- "approve": {
- "type": "boolean",
- "description": "Whether the request was approved."
+ "y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The y-coordinate to move to."
},
- "reason": {
+ "keys": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
@@ -43615,327 +64711,402 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "A response to an MCP approval request.",
- "title": "MCP approval response"
+ "description": "A mouse move action.",
+ "title": "Move"
},
- "OpenAI.ItemMcpListTools": {
+ "OpenAI.NamespaceToolParam": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
+ "name",
+ "description",
"tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_list_tools"
+ "namespace"
],
- "description": "The type of the item. Always `mcp_list_tools`.",
+ "description": "The type of the tool. Always `namespace`.",
"x-stainless-const": true
},
- "id": {
+ "name": {
"type": "string",
- "description": "The unique ID of the list."
+ "minLength": 1,
+ "description": "The namespace name used in tool calls (for example, `crm`)."
},
- "server_label": {
+ "description": {
"type": "string",
- "description": "The label of the MCP server."
+ "minLength": 1,
+ "description": "A description of the namespace shown to the model."
},
"tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.FunctionToolParam"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CustomToolParam"
+ }
+ ]
},
- "description": "The tools available on the server."
- },
- "error": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "minItems": 1,
+ "description": "The function/custom tools available inside this namespace."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "A list of tools available on an MCP server.",
- "title": "MCP list tools"
+ "description": "Groups function/custom tools under a shared namespace.",
+ "title": "Namespace"
},
- "OpenAI.ItemMcpToolCall": {
+ "OpenAI.NoiseReductionType": {
+ "type": "string",
+ "enum": [
+ "near_field",
+ "far_field"
+ ],
+ "description": "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."
+ },
+ "OpenAI.OpenAIFile": {
"type": "object",
"required": [
- "type",
"id",
- "server_label",
- "name",
- "arguments"
+ "bytes",
+ "created_at",
+ "filename",
+ "object",
+ "purpose",
+ "status"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "mcp_call"
- ],
- "description": "The type of the item. Always `mcp_call`.",
- "x-stainless-const": true
- },
"id": {
"type": "string",
- "description": "The unique ID of the tool call."
+ "description": "The file identifier, which can be referenced in the API endpoints."
},
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server running the tool."
+ "bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The size of the file, in bytes."
},
- "name": {
- "type": "string",
- "description": "The name of the tool that was run."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the file was created."
},
- "arguments": {
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the file will expire."
+ },
+ "filename": {
"type": "string",
- "description": "A JSON string of the arguments passed to the tool."
+ "description": "The name of the file."
},
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "object": {
+ "type": "string",
+ "enum": [
+ "file"
+ ],
+ "description": "The object type, which is always `file`.",
+ "x-stainless-const": true
},
- "error": {
- "type": "object",
- "unevaluatedProperties": {}
+ "purpose": {
+ "type": "string",
+ "enum": [
+ "assistants",
+ "assistants_output",
+ "batch",
+ "batch_output",
+ "fine-tune",
+ "fine-tune-results",
+ "vision",
+ "user_data"
+ ],
+ "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`."
},
"status": {
- "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
- "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ "type": "string",
+ "enum": [
+ "uploaded",
+ "processed",
+ "error"
+ ],
+ "description": "Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.",
+ "deprecated": true
},
- "approval_request_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "status_details": {
+ "type": "string",
+ "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.",
+ "deprecated": true
+ }
+ },
+ "description": "The `File` object represents a document that has been uploaded to OpenAI.",
+ "title": "OpenAIFile",
+ "x-oaiMeta": {
+ "name": "The file object",
+ "example": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1680202602,\n \"filename\": \"salesOverview.pdf\",\n \"purpose\": \"assistants\",\n}\n"
+ }
+ },
+ "OpenAI.OrderEnum": {
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ]
+ },
+ "OpenAI.OtherChunkingStrategyResponseParam": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "other"
+ ],
+ "description": "Always `other`.",
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse"
}
],
- "description": "An invocation of a tool on an MCP server.",
- "title": "MCP tool call"
+ "description": "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.",
+ "title": "Other Chunking Strategy"
},
- "OpenAI.ItemOutputMessage": {
+ "OpenAI.OutputContent": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.OutputContentType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "output_text": "#/components/schemas/OpenAI.OutputContentOutputTextContent",
+ "refusal": "#/components/schemas/OpenAI.OutputContentRefusalContent",
+ "reasoning_text": "#/components/schemas/OpenAI.OutputContentReasoningTextContent"
+ }
+ }
+ },
+ "OpenAI.OutputContentOutputTextContent": {
"type": "object",
"required": [
- "id",
"type",
- "role",
- "content",
- "status"
+ "text",
+ "annotations",
+ "logprobs"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the output message."
- },
"type": {
"type": "string",
"enum": [
- "output_message"
+ "output_text"
],
- "description": "The type of the output message. Always `message`.",
- "x-stainless-const": true
+ "description": "The type of the output text. Always `output_text`.",
+ "x-stainless-const": true,
+ "default": "output_text"
},
- "role": {
+ "text": {
"type": "string",
- "enum": [
- "assistant"
- ],
- "description": "The role of the output message. Always `assistant`.",
- "x-stainless-const": true
+ "description": "The text output from the model."
},
- "content": {
+ "annotations": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ "$ref": "#/components/schemas/OpenAI.Annotation"
},
- "description": "The content of the output message."
- },
- "phase": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The annotations of the text output."
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.LogProb"
+ }
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputContent"
}
],
- "description": "An output message from the model.",
- "title": "Output message"
+ "description": "A text output from the model.",
+ "title": "Output text"
},
- "OpenAI.ItemReasoningItem": {
+ "OpenAI.OutputContentReasoningTextContent": {
"type": "object",
"required": [
"type",
- "id",
- "summary"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "reasoning"
+ "reasoning_text"
],
- "description": "The type of the object. Always `reasoning`.",
- "x-stainless-const": true
- },
- "id": {
- "type": "string",
- "description": "The unique identifier of the reasoning content."
- },
- "encrypted_content": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "summary": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
- },
- "description": "Reasoning summary content."
- },
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
- },
- "description": "Reasoning text content."
+ "description": "The type of the reasoning text. Always `reasoning_text`.",
+ "x-stainless-const": true,
+ "default": "reasoning_text"
},
- "status": {
+ "text": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The reasoning text from the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.OutputContent"
}
],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
+ "description": "Reasoning text from the model.",
+ "title": "Reasoning text"
},
- "OpenAI.ItemReferenceParam": {
+ "OpenAI.OutputContentRefusalContent": {
"type": "object",
"required": [
"type",
- "id"
+ "refusal"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "item_reference"
+ "refusal"
],
- "description": "The type of item to reference. Always `item_reference`.",
- "x-stainless-const": true
+ "description": "The type of the refusal. Always `refusal`.",
+ "x-stainless-const": true,
+ "default": "refusal"
},
- "id": {
+ "refusal": {
"type": "string",
- "description": "The ID of the item to reference."
+ "description": "The refusal explanation from the model."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.InputItem"
+ "$ref": "#/components/schemas/OpenAI.OutputContent"
}
],
- "description": "An internal identifier for an item to reference.",
- "title": "Item reference"
+ "description": "A refusal from the model.",
+ "title": "Refusal"
},
- "OpenAI.ItemResource": {
+ "OpenAI.OutputContentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "output_text",
+ "refusal",
+ "reasoning_text"
+ ]
+ }
+ ]
+ },
+ "OpenAI.OutputItem": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ItemResourceType"
+ "$ref": "#/components/schemas/OpenAI.OutputItemType"
+ },
+ "created_by": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/CreatedBy"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "description": "The information about the creator of the item"
+ },
+ "agent_reference": {
+ "$ref": "#/components/schemas/AgentReference",
+ "description": "The agent that created the item."
+ },
+ "response_id": {
+ "type": "string",
+ "description": "The response on which the item is created."
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "message": "#/components/schemas/OpenAI.ItemResourceInputMessage",
- "output_message": "#/components/schemas/OpenAI.ItemResourceOutputMessage",
- "file_search_call": "#/components/schemas/OpenAI.ItemResourceFileSearchToolCall",
- "computer_call": "#/components/schemas/OpenAI.ItemResourceComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.ItemResourceComputerToolCallOutput",
- "web_search_call": "#/components/schemas/OpenAI.ItemResourceWebSearchToolCall",
- "function_call": "#/components/schemas/OpenAI.ItemResourceFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutput",
- "tool_search_call": "#/components/schemas/OpenAI.ItemResourceToolSearchCall",
- "tool_search_output": "#/components/schemas/OpenAI.ItemResourceToolSearchOutput",
- "additional_tools": "#/components/schemas/OpenAI.ItemResourceAdditionalTools",
- "reasoning": "#/components/schemas/OpenAI.ItemResourceReasoningItem",
- "compaction": "#/components/schemas/OpenAI.ItemResourceCompactionBody",
- "image_generation_call": "#/components/schemas/OpenAI.ItemResourceImageGenToolCall",
- "code_interpreter_call": "#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.ItemResourceFunctionShellCall",
- "shell_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput",
- "apply_patch_call": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall",
- "apply_patch_call_output": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput",
- "mcp_list_tools": "#/components/schemas/OpenAI.ItemResourceMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource",
- "mcp_call": "#/components/schemas/OpenAI.ItemResourceMcpToolCall",
- "custom_tool_call": "#/components/schemas/OpenAI.ItemResourceCustomToolCallResource",
- "custom_tool_call_output": "#/components/schemas/OpenAI.ItemResourceCustomToolCallOutputResource"
+ "structured_outputs": "#/components/schemas/StructuredOutputsOutputItem",
+ "workflow_action": "#/components/schemas/WorkflowActionOutputItem",
+ "oauth_consent_request": "#/components/schemas/OAuthConsentRequestOutputItem",
+ "bing_grounding_call": "#/components/schemas/BingGroundingToolCall",
+ "bing_grounding_call_output": "#/components/schemas/BingGroundingToolCallOutput",
+ "sharepoint_grounding_preview_call": "#/components/schemas/SharepointGroundingToolCall",
+ "sharepoint_grounding_preview_call_output": "#/components/schemas/SharepointGroundingToolCallOutput",
+ "azure_ai_search_call": "#/components/schemas/AzureAISearchToolCall",
+ "azure_ai_search_call_output": "#/components/schemas/AzureAISearchToolCallOutput",
+ "bing_custom_search_preview_call": "#/components/schemas/BingCustomSearchToolCall",
+ "bing_custom_search_preview_call_output": "#/components/schemas/BingCustomSearchToolCallOutput",
+ "openapi_call": "#/components/schemas/OpenApiToolCall",
+ "openapi_call_output": "#/components/schemas/OpenApiToolCallOutput",
+ "browser_automation_preview_call": "#/components/schemas/BrowserAutomationToolCall",
+ "browser_automation_preview_call_output": "#/components/schemas/BrowserAutomationToolCallOutput",
+ "fabric_dataagent_preview_call": "#/components/schemas/FabricDataAgentToolCall",
+ "fabric_dataagent_preview_call_output": "#/components/schemas/FabricDataAgentToolCallOutput",
+ "azure_function_call": "#/components/schemas/AzureFunctionToolCall",
+ "azure_function_call_output": "#/components/schemas/AzureFunctionToolCallOutput",
+ "a2a_preview_call": "#/components/schemas/A2AToolCall",
+ "a2a_preview_call_output": "#/components/schemas/A2AToolCallOutput",
+ "memory_search_call": "#/components/schemas/MemorySearchToolCall",
+ "memory_command_preview_call": "#/components/schemas/MemoryCommandToolCall",
+ "memory_command_preview_call_output": "#/components/schemas/MemoryCommandToolCallOutput",
+ "output_message": "#/components/schemas/OpenAI.OutputItemOutputMessage",
+ "file_search_call": "#/components/schemas/OpenAI.OutputItemFileSearchToolCall",
+ "function_call": "#/components/schemas/OpenAI.OutputItemFunctionToolCall",
+ "function_call_output": "#/components/schemas/OpenAI.OutputItemFunctionToolCallOutput",
+ "web_search_call": "#/components/schemas/OpenAI.OutputItemWebSearchToolCall",
+ "computer_call": "#/components/schemas/OpenAI.OutputItemComputerToolCall",
+ "computer_call_output": "#/components/schemas/OpenAI.OutputItemComputerToolCallOutput",
+ "reasoning": "#/components/schemas/OpenAI.OutputItemReasoningItem",
+ "tool_search_call": "#/components/schemas/OpenAI.OutputItemToolSearchCall",
+ "tool_search_output": "#/components/schemas/OpenAI.OutputItemToolSearchOutput",
+ "additional_tools": "#/components/schemas/OpenAI.OutputItemAdditionalTools",
+ "compaction": "#/components/schemas/OpenAI.OutputItemCompactionBody",
+ "image_generation_call": "#/components/schemas/OpenAI.OutputItemImageGenToolCall",
+ "code_interpreter_call": "#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall",
+ "local_shell_call": "#/components/schemas/OpenAI.OutputItemLocalShellToolCall",
+ "local_shell_call_output": "#/components/schemas/OpenAI.OutputItemLocalShellToolCallOutput",
+ "shell_call": "#/components/schemas/OpenAI.OutputItemFunctionShellCall",
+ "shell_call_output": "#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput",
+ "apply_patch_call": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCall",
+ "apply_patch_call_output": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput",
+ "mcp_call": "#/components/schemas/OpenAI.OutputItemMcpToolCall",
+ "mcp_list_tools": "#/components/schemas/OpenAI.OutputItemMcpListTools",
+ "mcp_approval_request": "#/components/schemas/OpenAI.OutputItemMcpApprovalRequest",
+ "mcp_approval_response": "#/components/schemas/OpenAI.OutputItemMcpApprovalResponseResource",
+ "custom_tool_call": "#/components/schemas/OpenAI.OutputItemCustomToolCallResource",
+ "custom_tool_call_output": "#/components/schemas/OpenAI.OutputItemCustomToolCallOutputResource"
}
- },
- "description": "Content item used to generate a response."
+ }
},
- "OpenAI.ItemResourceAdditionalTools": {
+ "OpenAI.OutputItemAdditionalTools": {
"type": "object",
"required": [
"type",
@@ -43971,11 +65142,11 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
]
},
- "OpenAI.ItemResourceApplyPatchToolCall": {
+ "OpenAI.OutputItemApplyPatchToolCall": {
"type": "object",
"required": [
"type",
@@ -44018,13 +65189,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A tool call that applies file diffs by creating, deleting, or updating files.",
"title": "Apply patch tool call"
},
- "OpenAI.ItemResourceApplyPatchToolCallOutput": {
+ "OpenAI.OutputItemApplyPatchToolCallOutput": {
"type": "object",
"required": [
"type",
@@ -44071,13 +65242,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "The output emitted by an apply patch tool call.",
"title": "Apply patch tool call output"
},
- "OpenAI.ItemResourceCodeInterpreterToolCall": {
+ "OpenAI.OutputItemCodeInterpreterToolCall": {
"type": "object",
"required": [
"type",
@@ -44149,13 +65320,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A tool call to run code.",
"title": "Code interpreter tool call"
},
- "OpenAI.ItemResourceCompactionBody": {
+ "OpenAI.OutputItemCompactionBody": {
"type": "object",
"required": [
"type",
@@ -44187,13 +65358,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
"title": "Compaction item"
},
- "OpenAI.ItemResourceComputerToolCall": {
+ "OpenAI.OutputItemComputerToolCall": {
"type": "object",
"required": [
"type",
@@ -44244,13 +65415,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
"title": "Computer tool call"
},
- "OpenAI.ItemResourceComputerToolCallOutput": {
+ "OpenAI.OutputItemComputerToolCallOutput": {
"type": "object",
"required": [
"type",
@@ -44299,13 +65470,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "The output of a computer tool call.",
"title": "Computer tool call output"
},
- "OpenAI.ItemResourceCustomToolCallOutputResource": {
+ "OpenAI.OutputItemCustomToolCallOutputResource": {
"type": "object",
"required": [
"type",
@@ -44355,12 +65526,12 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"title": "ResponseCustomToolCallOutputItem"
},
- "OpenAI.ItemResourceCustomToolCallResource": {
+ "OpenAI.OutputItemCustomToolCallResource": {
"type": "object",
"required": [
"type",
@@ -44409,12 +65580,12 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"title": "ResponseCustomToolCallItem"
},
- "OpenAI.ItemResourceFileSearchToolCall": {
+ "OpenAI.OutputItemFileSearchToolCall": {
"type": "object",
"required": [
"id",
@@ -44469,13 +65640,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
"title": "File search tool call"
},
- "OpenAI.ItemResourceFunctionShellCall": {
+ "OpenAI.OutputItemFunctionShellCall": {
"type": "object",
"required": [
"type",
@@ -44528,13 +65699,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A tool call that executes one or more shell commands in a managed environment.",
"title": "Shell tool call"
},
- "OpenAI.ItemResourceFunctionShellCallOutput": {
+ "OpenAI.OutputItemFunctionShellCallOutput": {
"type": "object",
"required": [
"type",
@@ -44590,13 +65761,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "The output of a shell tool call that was emitted.",
"title": "Shell call output"
},
- "OpenAI.ItemResourceFunctionToolCall": {
+ "OpenAI.OutputItemFunctionToolCall": {
"type": "object",
"required": [
"id",
@@ -44647,13 +65818,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
"title": "Function tool call"
},
- "OpenAI.ItemResourceFunctionToolCallOutput": {
+ "OpenAI.OutputItemFunctionToolCallOutput": {
"type": "object",
"required": [
"id",
@@ -44705,13 +65876,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "The output of a function tool call.",
"title": "Function tool call output"
},
- "OpenAI.ItemResourceImageGenToolCall": {
+ "OpenAI.OutputItemImageGenToolCall": {
"type": "object",
"required": [
"type",
@@ -44755,66 +65926,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "An image generation request made by the model.",
"title": "Image generation call"
},
- "OpenAI.ItemResourceInputMessage": {
- "type": "object",
- "required": [
- "type",
- "role",
- "content",
- "id"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "message"
- ],
- "description": "The type of the message input. Always set to `message`.",
- "x-stainless-const": true,
- "default": "message"
- },
- "role": {
- "type": "string",
- "enum": [
- "user",
- "system",
- "developer"
- ],
- "description": "The role of the message input. One of `user`, `system`, or `developer`."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
- },
- "content": {
- "$ref": "#/components/schemas/OpenAI.InputMessageContentList"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the message input.",
- "readOnly": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ItemResource"
- }
- ],
- "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role.",
- "title": "Input message"
- },
- "OpenAI.ItemResourceLocalShellToolCall": {
+ "OpenAI.OutputItemLocalShellToolCall": {
"type": "object",
"required": [
"type",
@@ -44855,13 +65973,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A tool call to run a command on the local shell.",
"title": "Local shell call"
},
- "OpenAI.ItemResourceLocalShellToolCallOutput": {
+ "OpenAI.OutputItemLocalShellToolCallOutput": {
"type": "object",
"required": [
"type",
@@ -44903,13 +66021,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "The output of a local shell tool call.",
"title": "Local shell call output"
},
- "OpenAI.ItemResourceMcpApprovalRequest": {
+ "OpenAI.OutputItemMcpApprovalRequest": {
"type": "object",
"required": [
"type",
@@ -44946,13 +66064,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A request for human approval of a tool invocation.",
"title": "MCP approval request"
},
- "OpenAI.ItemResourceMcpApprovalResponseResource": {
+ "OpenAI.OutputItemMcpApprovalResponseResource": {
"type": "object",
"required": [
"type",
@@ -44994,13 +66112,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A response to an MCP approval request.",
"title": "MCP approval response"
},
- "OpenAI.ItemResourceMcpListTools": {
+ "OpenAI.OutputItemMcpListTools": {
"type": "object",
"required": [
"type",
@@ -45038,13 +66156,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A list of tools available on an MCP server.",
"title": "MCP list tools"
},
- "OpenAI.ItemResourceMcpToolCall": {
+ "OpenAI.OutputItemMcpToolCall": {
"type": "object",
"required": [
"type",
@@ -45109,13 +66227,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "An invocation of a tool on an MCP server.",
"title": "MCP tool call"
},
- "OpenAI.ItemResourceOutputMessage": {
+ "OpenAI.OutputItemOutputMessage": {
"type": "object",
"required": [
"id",
@@ -45174,13 +66292,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "An output message from the model.",
"title": "Output message"
},
- "OpenAI.ItemResourceReasoningItem": {
+ "OpenAI.OutputItemReasoningItem": {
"type": "object",
"required": [
"type",
@@ -45236,13 +66354,13 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
"description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
"title": "Reasoning"
},
- "OpenAI.ItemResourceToolSearchCall": {
+ "OpenAI.OutputItemToolSearchCall": {
"type": "object",
"required": [
"type",
@@ -45294,11 +66412,11 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
]
},
- "OpenAI.ItemResourceToolSearchOutput": {
+ "OpenAI.OutputItemToolSearchOutput": {
"type": "object",
"required": [
"type",
@@ -45354,11 +66472,11 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
}
]
},
- "OpenAI.ItemResourceType": {
+ "OpenAI.OutputItemType": {
"anyOf": [
{
"type": "string"
@@ -45366,18 +66484,17 @@
{
"type": "string",
"enum": [
- "message",
"output_message",
"file_search_call",
- "computer_call",
- "computer_call_output",
- "web_search_call",
"function_call",
"function_call_output",
+ "web_search_call",
+ "computer_call",
+ "computer_call_output",
+ "reasoning",
"tool_search_call",
"tool_search_output",
"additional_tools",
- "reasoning",
"compaction",
"image_generation_call",
"code_interpreter_call",
@@ -45387,10 +66504,10 @@
"shell_call_output",
"apply_patch_call",
"apply_patch_call_output",
+ "mcp_call",
"mcp_list_tools",
"mcp_approval_request",
"mcp_approval_response",
- "mcp_call",
"custom_tool_call",
"custom_tool_call_output",
"structured_outputs",
@@ -45419,189 +66536,361 @@
"azure_function_call_output"
]
}
- ]
+ ]
+ },
+ "OpenAI.OutputItemWebSearchToolCall": {
+ "type": "object",
+ "required": [
+ "id",
+ "type",
+ "status",
+ "action"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique ID of the web search tool call."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_search_call"
+ ],
+ "description": "The type of the web search tool call. Always `web_search_call`.",
+ "x-stainless-const": true
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "searching",
+ "completed",
+ "failed",
+ "incomplete"
+ ],
+ "description": "The status of the web search tool call."
+ },
+ "action": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
+ }
+ ],
+ "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ }
+ ],
+ "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
+ "title": "Web search tool call"
+ },
+ "OpenAI.OutputMessageContent": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContentType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "output_text": "#/components/schemas/OpenAI.OutputMessageContentOutputTextContent",
+ "refusal": "#/components/schemas/OpenAI.OutputMessageContentRefusalContent"
+ }
+ }
+ },
+ "OpenAI.OutputMessageContentOutputTextContent": {
+ "type": "object",
+ "required": [
+ "type",
+ "text",
+ "annotations",
+ "logprobs"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "output_text"
+ ],
+ "description": "The type of the output text. Always `output_text`.",
+ "x-stainless-const": true,
+ "default": "output_text"
+ },
+ "text": {
+ "type": "string",
+ "description": "The text output from the model."
+ },
+ "annotations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Annotation"
+ },
+ "description": "The annotations of the text output."
+ },
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.LogProb"
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ }
+ ],
+ "description": "A text output from the model.",
+ "title": "Output text"
+ },
+ "OpenAI.OutputMessageContentRefusalContent": {
+ "type": "object",
+ "required": [
+ "type",
+ "refusal"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "refusal"
+ ],
+ "description": "The type of the refusal. Always `refusal`.",
+ "x-stainless-const": true,
+ "default": "refusal"
+ },
+ "refusal": {
+ "type": "string",
+ "description": "The refusal explanation from the model."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ }
+ ],
+ "description": "A refusal from the model.",
+ "title": "Refusal"
+ },
+ "OpenAI.OutputMessageContentType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "output_text",
+ "refusal"
+ ]
+ }
+ ]
+ },
+ "OpenAI.PartialImages": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 0,
+ "maximum": 3,
+ "description": "The number of partial images to generate. This parameter is used for\nstreaming responses that return partial images. Value must be between 0 and 3.\nWhen set to 0, the response will be a single image sent in one streaming event.\nNote that the final image may be sent before the full number of partial images\nare generated if the full image is generated more quickly."
+ },
+ "OpenAI.PredictionContent": {
+ "type": "object",
+ "required": [
+ "type",
+ "content"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "content"
+ ],
+ "description": "The type of the predicted content you want to provide. This type is\n currently always `content`.",
+ "x-stainless-const": true
+ },
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText"
+ }
+ }
+ ],
+ "description": "The content that should be matched when generating a model response.\n If generated tokens would match this content, the entire model response\n can be returned much more quickly."
+ }
+ },
+ "description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.",
+ "title": "Static Content"
+ },
+ "OpenAI.Prompt": {
+ "type": "object",
+ "required": [
+ "id"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier of the prompt template to use."
+ },
+ "version": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "variables": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponsePromptVariables"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "description": "Reference to a prompt template and its variables.\n[Learn more](/docs/guides/text?api-mode=responses#reusable-prompts)."
+ },
+ "OpenAI.PromptCacheRetentionEnum": {
+ "type": "string",
+ "enum": [
+ "in_memory",
+ "24h"
+ ]
+ },
+ "OpenAI.RankerVersionType": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "default-2024-11-15"
+ ]
+ },
+ "OpenAI.RankingOptions": {
+ "type": "object",
+ "properties": {
+ "ranker": {
+ "$ref": "#/components/schemas/OpenAI.RankerVersionType",
+ "description": "The ranker to use for the file search."
+ },
+ "score_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "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."
+ },
+ "hybrid_search": {
+ "$ref": "#/components/schemas/OpenAI.HybridSearchOptions",
+ "description": "Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled."
+ }
+ }
+ },
+ "OpenAI.RealtimeAudioFormats": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormatsType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "audio/pcm": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcm",
+ "audio/pcmu": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcmu",
+ "audio/pcma": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcma"
+ }
+ }
},
- "OpenAI.ItemResourceWebSearchToolCall": {
+ "OpenAI.RealtimeAudioFormatsAudioPcm": {
"type": "object",
"required": [
- "id",
- "type",
- "status",
- "action"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the web search tool call."
- },
"type": {
"type": "string",
"enum": [
- "web_search_call"
- ],
- "description": "The type of the web search tool call. Always `web_search_call`.",
- "x-stainless-const": true
+ "audio/pcm"
+ ]
},
- "status": {
- "type": "string",
+ "rate": {
+ "type": "number",
"enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
- ],
- "description": "The status of the web search tool call."
- },
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
- }
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ 24000
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ItemResource"
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
}
- ],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
+ ]
},
- "OpenAI.ItemToolSearchCallItemParam": {
+ "OpenAI.RealtimeAudioFormatsAudioPcma": {
"type": "object",
"required": [
- "type",
- "arguments"
+ "type"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
"type": {
"type": "string",
"enum": [
- "tool_search_call"
- ],
- "description": "The item type. Always `tool_search_call`.",
- "x-stainless-const": true,
- "default": "tool_search_call"
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "arguments": {
- "$ref": "#/components/schemas/OpenAI.EmptyModelParam",
- "description": "The arguments supplied to the tool search call."
- },
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
- },
- {
- "type": "null"
- }
+ "audio/pcma"
]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
}
]
},
- "OpenAI.ItemToolSearchOutputItemParam": {
+ "OpenAI.RealtimeAudioFormatsAudioPcmu": {
"type": "object",
"required": [
- "type",
- "tools"
+ "type"
],
"properties": {
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
"type": {
"type": "string",
"enum": [
- "tool_search_output"
- ],
- "description": "The item type. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The loaded tool definitions returned by the tool search output."
- },
- "status": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionCallItemStatus"
- },
- {
- "type": "null"
- }
+ "audio/pcmu"
]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
}
]
},
- "OpenAI.ItemType": {
+ "OpenAI.RealtimeAudioFormatsType": {
"anyOf": [
{
"type": "string"
@@ -45609,250 +66898,437 @@
{
"type": "string",
"enum": [
- "message",
- "output_message",
- "file_search_call",
- "computer_call",
- "computer_call_output",
- "web_search_call",
- "function_call",
- "function_call_output",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "reasoning",
- "compaction",
- "image_generation_call",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "mcp_call",
- "custom_tool_call_output",
- "custom_tool_call",
- "structured_outputs",
- "oauth_consent_request",
- "memory_search_call",
- "memory_command_preview_call",
- "memory_command_preview_call_output",
- "workflow_action",
- "a2a_preview_call",
- "a2a_preview_call_output",
- "bing_grounding_call",
- "bing_grounding_call_output",
- "sharepoint_grounding_preview_call",
- "sharepoint_grounding_preview_call_output",
- "azure_ai_search_call",
- "azure_ai_search_call_output",
- "bing_custom_search_preview_call",
- "bing_custom_search_preview_call_output",
- "openapi_call",
- "openapi_call_output",
- "browser_automation_preview_call",
- "browser_automation_preview_call_output",
- "fabric_dataagent_preview_call",
- "fabric_dataagent_preview_call_output",
- "azure_function_call",
- "azure_function_call_output"
+ "audio/pcm",
+ "audio/pcmu",
+ "audio/pcma"
]
}
]
},
- "OpenAI.ItemWebSearchToolCall": {
+ "OpenAI.RealtimeCallCreateRequest": {
"type": "object",
+ "properties": {
+ "sdp": {
+ "type": "string",
+ "description": "WebRTC Session Description Protocol (SDP) offer generated by the caller."
+ },
+ "session": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA"
+ }
+ ],
+ "description": "Optional session configuration to apply before the realtime session is\n created. Use the same parameters you would send in a [`create client secret`](/docs/api-reference/realtime-sessions/create-realtime-client-secret)\n request."
+ }
+ },
"required": [
- "id",
- "type",
- "status",
- "action"
+ "sdp"
+ ]
+ },
+ "OpenAI.RealtimeCallReferRequest": {
+ "type": "object",
+ "required": [
+ "target_uri"
],
"properties": {
- "id": {
+ "target_uri": {
"type": "string",
- "description": "The unique ID of the web search tool call."
+ "description": "URI that should appear in the SIP Refer-To header. Supports values like\n `tel:+14155550123` or `sip:agent\\@example.com`."
+ }
+ },
+ "description": "Parameters required to transfer a SIP call to a new destination using the\nRealtime API.",
+ "title": "Realtime call refer request"
+ },
+ "OpenAI.RealtimeCallRejectRequest": {
+ "type": "object",
+ "properties": {
+ "status_code": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "SIP response code to send back to the caller. Defaults to `603` (Decline)\n when omitted."
+ }
+ },
+ "description": "Parameters used to decline an incoming SIP call handled by the Realtime API.",
+ "title": "Realtime call reject request"
+ },
+ "OpenAI.RealtimeCreateClientSecretRequest": {
+ "type": "object",
+ "properties": {
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeCreateClientSecretRequestExpiresAfter",
+ "description": "Configuration for the client secret expiration. Expiration refers to the time after which\n a client secret will no longer be valid for creating sessions. The session itself may\n continue after that time once started. A secret can be used to create multiple sessions\n until it expires.",
+ "title": "Client secret expiration"
+ },
+ "session": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion",
+ "description": "Session configuration to use for the client secret. Choose either a realtime\n session or a transcription session.",
+ "title": "Session configuration"
+ }
+ },
+ "description": "Create a session and client secret for the Realtime API. The request can specify\neither a realtime or a transcription session configuration.\n[Learn more about the Realtime API](/docs/guides/realtime).",
+ "title": "Realtime client secret creation request"
+ },
+ "OpenAI.RealtimeCreateClientSecretRequestExpiresAfter": {
+ "type": "object",
+ "properties": {
+ "anchor": {
+ "type": "string",
+ "enum": [
+ "created_at"
+ ],
+ "x-stainless-const": true,
+ "default": "created_at"
+ },
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "minimum": 10,
+ "maximum": 7200,
+ "default": 600
+ }
+ }
+ },
+ "OpenAI.RealtimeCreateClientSecretResponse": {
+ "type": "object",
+ "required": [
+ "value",
+ "expires_at",
+ "session"
+ ],
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "The generated client secret value."
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Expiration timestamp for the client secret, in seconds since epoch."
},
+ "session": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion",
+ "description": "The session configuration for either a realtime or transcription session.",
+ "title": "Session configuration"
+ }
+ },
+ "description": "Response from creating a session and client secret for the Realtime API.",
+ "title": "Realtime session and client secret",
+ "x-oaiMeta": {
+ "name": "Session response object",
+ "group": "realtime",
+ "example": "{\n \"value\": \"ek_68af296e8e408191a1120ab6383263c2\",\n \"expires_at\": 1756310470,\n \"session\": {\n \"type\": \"realtime\",\n \"object\": \"realtime.session\",\n \"id\": \"sess_C9CiUVUzUzYIssh3ELY1d\",\n \"model\": \"gpt-realtime-2025-08-25\",\n \"output_modalities\": [\n \"audio\"\n ],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"auto\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": null,\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"expires_at\": 0,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": null,\n \"noise_reduction\": null,\n \"turn_detection\": {\n \"type\": \"server_vad\",\n \"threshold\": 0.5,\n \"prefix_padding_ms\": 300,\n \"silence_duration_ms\": 200,\n \"idle_timeout_ms\": null,\n \"create_response\": true,\n \"interrupt_response\": true\n }\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n },\n \"include\": null\n }\n}\n"
+ }
+ },
+ "OpenAI.RealtimeFunctionTool": {
+ "type": "object",
+ "properties": {
"type": {
"type": "string",
"enum": [
- "web_search_call"
+ "function"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
+ "description": "The type of the tool, i.e. `function`.",
"x-stainless-const": true
},
- "status": {
+ "name": {
+ "type": "string",
+ "description": "The name of the function."
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the function, including guidance on when and how\n to call it, and guidance about what to tell the user when calling\n (if anything)."
+ },
+ "parameters": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeFunctionToolParameters",
+ "description": "Parameters of the function in JSON Schema."
+ }
+ },
+ "title": "Function tool"
+ },
+ "OpenAI.RealtimeFunctionToolParameters": {
+ "type": "object"
+ },
+ "OpenAI.RealtimeMCPError": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMcpErrorType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "protocol_error": "#/components/schemas/OpenAI.RealtimeMCPProtocolError",
+ "tool_execution_error": "#/components/schemas/OpenAI.RealtimeMCPToolExecutionError",
+ "http_error": "#/components/schemas/OpenAI.RealtimeMCPHTTPError"
+ }
+ }
+ },
+ "OpenAI.RealtimeMCPHTTPError": {
+ "type": "object",
+ "required": [
+ "type",
+ "code",
+ "message"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
+ "http_error"
],
- "description": "The status of the web search tool call."
+ "x-stainless-const": true
},
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
- }
+ "code": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "message": {
+ "type": "string"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ }
+ ],
+ "title": "Realtime MCP HTTP error"
+ },
+ "OpenAI.RealtimeMCPProtocolError": {
+ "type": "object",
+ "required": [
+ "type",
+ "code",
+ "message"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "protocol_error"
],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ "x-stainless-const": true
+ },
+ "code": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "message": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Item"
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
+ "title": "Realtime MCP protocol error"
},
- "OpenAI.KeyPressAction": {
+ "OpenAI.RealtimeMCPToolExecutionError": {
"type": "object",
"required": [
"type",
- "keys"
+ "message"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "keypress"
+ "tool_execution_error"
],
- "description": "Specifies the event type. For a keypress action, this property is always set to `keypress`.",
"x-stainless-const": true
},
- "keys": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key."
+ "message": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
}
],
- "description": "A collection of keypresses the model would like to perform.",
- "title": "KeyPress"
+ "title": "Realtime MCP tool execution error"
},
- "OpenAI.ListFineTuningJobCheckpointsResponse": {
+ "OpenAI.RealtimeMcpErrorType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "protocol_error",
+ "tool_execution_error",
+ "http_error"
+ ]
+ }
+ ]
+ },
+ "OpenAI.RealtimeReasoning": {
+ "type": "object",
+ "properties": {
+ "effort": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeReasoningEffort"
+ }
+ },
+ "description": "Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.",
+ "title": "Realtime reasoning configuration"
+ },
+ "OpenAI.RealtimeReasoningEffort": {
+ "type": "string",
+ "enum": [
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
+ "description": "Constrains effort on reasoning for reasoning-capable Realtime models such as\n`gpt-realtime-2`."
+ },
+ "OpenAI.RealtimeSessionCreateRequest": {
"type": "object",
"required": [
- "data",
- "object",
- "has_more"
+ "client_secret"
],
"properties": {
- "data": {
+ "client_secret": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestClientSecret",
+ "description": "Ephemeral key returned by the API."
+ },
+ "modalities": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpoint"
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
},
- "x-ms-list-page-items": true
+ "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"].",
+ "default": [
+ "text",
+ "audio"
+ ]
},
- "object": {
+ "instructions": {
"type": "string",
- "enum": [
- "list"
- ],
- "x-stainless-const": true
+ "description": "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.\n 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."
},
- "first_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsOrCustomVoice",
+ "description": "The voice the model uses to respond. Supported built-in voices are\n `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`,\n `marin`, and `cedar`. You may also provide a custom voice object with an\n `id`, for example `{ \"id\": \"voice_1234\" }`. Voice cannot be changed during\n the session once the model has responded with audio at least once."
},
- "last_id": {
- "anyOf": [
+ "input_audio_format": {
+ "type": "string",
+ "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`."
+ },
+ "output_audio_format": {
+ "type": "string",
+ "description": "The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`."
+ },
+ "input_audio_transcription": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestInputAudioTranscription",
+ "description": "Configuration for input audio transcription, defaults to off and can be\n set to `null` to turn off once on. Input audio transcription is not native\n to the model, since the model consumes audio directly. Transcription runs\n asynchronously and should be treated as rough guidance\n rather than the representation understood by the model."
+ },
+ "speed": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0.25,
+ "maximum": 1.5,
+ "description": "The speed of the model's spoken response. 1.0 is the default speed. 0.25 is\n the minimum speed. 1.5 is the maximum speed. This value can only be changed\n in between model turns, not while a response is in progress.",
+ "default": 1
+ },
+ "tracing": {
+ "oneOf": [
{
- "type": "string"
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
},
{
- "type": "null"
+ "type": "object",
+ "properties": {
+ "workflow_name": {
+ "type": "string"
+ },
+ "group_id": {
+ "type": "string"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
+ }
}
],
- "x-ms-list-continuation-token": true
+ "description": "Configuration options for tracing. Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.",
+ "title": "Tracing Configuration",
+ "default": "auto"
},
- "has_more": {
- "type": "boolean"
- }
- }
- },
- "OpenAI.ListFineTuningJobEventsResponse": {
- "type": "object",
- "required": [
- "data",
- "object",
- "has_more"
- ],
- "properties": {
- "data": {
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestTurnDetection",
+ "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech."
+ },
+ "tools": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJobEvent"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestTools"
},
- "x-ms-list-page-items": true
+ "description": "Tools (functions) available to the model."
},
- "object": {
+ "tool_choice": {
"type": "string",
- "enum": [
- "list"
+ "description": "How the model chooses tools. Options are `auto`, `none`, `required`, or\n specify a function."
+ },
+ "temperature": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8."
+ },
+ "max_response_output_tokens": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "inf"
+ ]
+ }
],
- "x-stainless-const": true
+ "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`."
},
- "has_more": {
- "type": "boolean"
+ "truncation": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTruncation"
+ },
+ "prompt": {
+ "$ref": "#/components/schemas/OpenAI.Prompt"
}
+ },
+ "description": "A new Realtime session configuration, with an ephemeral key. Default TTL\nfor keys is one minute.",
+ "x-oaiMeta": {
+ "name": "The session object",
+ "group": "realtime",
+ "example": "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"model\": \"gpt-realtime-2025-08-25\",\n \"modalities\": [\"audio\", \"text\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"voice\": \"alloy\",\n \"input_audio_format\": \"pcm16\",\n \"output_audio_format\": \"pcm16\",\n \"input_audio_transcription\": {\n \"model\": \"whisper-1\"\n },\n \"turn_detection\": null,\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"temperature\": 0.7,\n \"speed\": 1.1,\n \"tracing\": \"auto\",\n \"max_response_output_tokens\": 200,\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"client_secret\": {\n \"value\": \"ek_abc123\",\n \"expires_at\": 1234567890\n }\n}\n"
}
},
- "OpenAI.ListPaginatedFineTuningJobsResponse": {
+ "OpenAI.RealtimeSessionCreateRequestClientSecret": {
"type": "object",
"required": [
- "data",
- "has_more",
- "object"
+ "value",
+ "expires_at"
],
"properties": {
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FineTuningJob"
- },
- "x-ms-list-page-items": true
- },
- "has_more": {
- "type": "boolean"
+ "value": {
+ "type": "string"
},
- "object": {
- "type": "string",
- "enum": [
- "list"
- ],
- "x-stainless-const": true
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime"
}
}
},
- "OpenAI.LocalEnvironmentResource": {
+ "OpenAI.RealtimeSessionCreateRequestGA": {
"type": "object",
"required": [
"type"
@@ -45861,415 +67337,592 @@
"type": {
"type": "string",
"enum": [
- "local"
+ "realtime"
],
- "description": "The environment type. Always `local`.",
+ "description": "The type of session to create. Always `realtime` for the Realtime API.",
"x-stainless-const": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
- }
- ],
- "description": "Represents the use of a local environment to perform shell actions.",
- "title": "Local Environment"
- },
- "OpenAI.LocalShellExecAction": {
- "type": "object",
- "required": [
- "type",
- "command",
- "env"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "exec"
- ],
- "description": "The type of the local shell action. Always `exec`.",
- "x-stainless-const": true,
- "default": "exec"
},
- "command": {
+ "output_modalities": {
"type": "array",
"items": {
- "type": "string"
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
},
- "description": "The command to run."
+ "description": "The set of modalities the model can respond with. It defaults to `[\"audio\"]`, indicating\n that the model will respond with audio plus a transcript. `[\"text\"]` can be used to make\n the model respond with text only. It is not possible to request both `text` and `audio` at the same time.",
+ "default": [
+ "audio"
+ ]
},
- "timeout_ms": {
+ "model": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": "string"
},
{
- "type": "null"
+ "type": "string",
+ "enum": [
+ "gpt-realtime",
+ "gpt-realtime-1.5",
+ "gpt-realtime-2",
+ "gpt-realtime-2025-08-28",
+ "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",
+ "gpt-realtime-mini",
+ "gpt-realtime-mini-2025-10-06",
+ "gpt-realtime-mini-2025-12-15",
+ "gpt-audio-1.5",
+ "gpt-audio-mini",
+ "gpt-audio-mini-2025-10-06",
+ "gpt-audio-mini-2025-12-15"
+ ]
}
- ]
+ ],
+ "description": "The Realtime model used for this session."
},
- "working_directory": {
- "anyOf": [
+ "instructions": {
+ "type": "string",
+ "description": "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.\n 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."
+ },
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudio",
+ "description": "Configuration for input and output audio."
+ },
+ "include": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "item.input_audio_transcription.logprobs"
+ ]
+ },
+ "description": "Additional fields to include in server outputs.\n `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription."
+ },
+ "tracing": {
+ "oneOf": [
{
- "type": "string"
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGATracing"
},
{
"type": "null"
}
- ]
+ ],
+ "description": "Realtime API can write session traces to the [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.",
+ "title": "Tracing Configuration",
+ "default": "auto"
},
- "env": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
+ "tools": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeFunctionTool"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPTool"
+ }
+ ]
},
- "description": "Environment variables to set for the command.",
- "x-oaiTypeLabel": "map"
+ "description": "Tools available to the model."
},
- "user": {
- "anyOf": [
+ "tool_choice": {
+ "oneOf": [
{
- "type": "string"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
},
{
- "type": "null"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceFunction"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceMCP"
}
- ]
+ ],
+ "description": "How the model chooses tools. Provide one of the string modes or force a specific\n function/MCP tool.",
+ "default": "auto"
+ },
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether the model may call multiple tools in parallel. Only supported by\n reasoning Realtime models such as `gpt-realtime-2`."
+ },
+ "reasoning": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeReasoning"
+ },
+ "max_output_tokens": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "inf"
+ ]
+ }
+ ],
+ "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`."
+ },
+ "truncation": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTruncation"
+ },
+ "prompt": {
+ "$ref": "#/components/schemas/OpenAI.Prompt"
}
},
- "description": "Execute a shell command on the server.",
- "title": "Local shell exec action"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion"
+ }
+ ],
+ "description": "Realtime session object configuration.",
+ "title": "Realtime session configuration"
},
- "OpenAI.LocalShellToolParam": {
+ "OpenAI.RealtimeSessionCreateRequestGAAudio": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInput"
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioOutput"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestGAAudioInput": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
+ },
+ "transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscription"
+ },
+ "noise_reduction": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction"
+ },
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction": {
"type": "object",
- "required": [
- "type"
- ],
"properties": {
"type": {
- "type": "string",
- "enum": [
- "local_shell"
- ],
- "description": "The type of the local shell tool. Always `local_shell`.",
- "x-stainless-const": true
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestGAAudioOutput": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
},
- "name": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsOrCustomVoice",
+ "default": "alloy"
},
- "description": {
- "type": "string",
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "speed": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0.25,
+ "maximum": 1.5,
+ "default": 1
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestGATracing": {
+ "type": "object",
+ "properties": {
+ "workflow_name": {
+ "type": "string"
},
- "tool_configs": {
+ "group_id": {
+ "type": "string"
+ },
+ "metadata": {
"type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "unevaluatedProperties": {}
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ },
+ "OpenAI.RealtimeSessionCreateRequestInputAudioTranscription": {
+ "type": "object",
+ "properties": {
+ "model": {
+ "type": "string"
}
- ],
- "description": "A tool that allows the model to execute shell commands in a local environment.",
- "title": "Local shell tool"
+ }
},
- "OpenAI.LocalSkillParam": {
+ "OpenAI.RealtimeSessionCreateRequestTools": {
"type": "object",
- "required": [
- "name",
- "description",
- "path"
- ],
"properties": {
- "name": {
+ "type": {
"type": "string",
- "description": "The name of the skill."
+ "enum": [
+ "function"
+ ],
+ "x-stainless-const": true
+ },
+ "name": {
+ "type": "string"
},
"description": {
- "type": "string",
- "description": "The description of the skill."
+ "type": "string"
},
- "path": {
- "type": "string",
- "description": "The path to the directory containing the skill."
+ "parameters": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestToolsParameters"
}
}
},
- "OpenAI.LogProb": {
+ "OpenAI.RealtimeSessionCreateRequestToolsParameters": {
+ "type": "object"
+ },
+ "OpenAI.RealtimeSessionCreateRequestTurnDetection": {
"type": "object",
- "required": [
- "token",
- "logprob",
- "bytes",
- "top_logprobs"
- ],
"properties": {
- "token": {
+ "type": {
"type": "string"
},
- "logprob": {
+ "threshold": {
"$ref": "#/components/schemas/OpenAI.numeric"
},
- "bytes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "top_logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.TopLogProb"
- }
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- },
- "description": "The log probability of a token.",
- "title": "Log probability"
+ }
},
- "OpenAI.MCPListToolsTool": {
+ "OpenAI.RealtimeSessionCreateRequestUnion": {
"type": "object",
"required": [
- "name",
- "input_schema"
+ "type"
],
"properties": {
- "name": {
- "type": "string",
- "description": "The name of the tool."
- },
- "description": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "input_schema": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsToolInputSchema",
- "description": "The JSON schema describing the tool's input."
- },
- "annotations": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsToolAnnotations"
- },
- {
- "type": "null"
- }
- ]
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnionType"
}
},
- "description": "A tool available on an MCP server.",
- "title": "MCP list tools tool"
- },
- "OpenAI.MCPListToolsToolAnnotations": {
- "type": "object"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "transcription": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGA",
+ "realtime": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA"
+ }
+ }
},
- "OpenAI.MCPListToolsToolInputSchema": {
- "type": "object"
+ "OpenAI.RealtimeSessionCreateRequestUnionType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "realtime",
+ "transcription"
+ ]
+ }
+ ]
},
- "OpenAI.MCPTool": {
+ "OpenAI.RealtimeSessionCreateResponse": {
"type": "object",
"required": [
- "type",
- "server_label"
+ "type"
],
"properties": {
- "type": {
+ "id": {
"type": "string",
- "enum": [
- "mcp"
- ],
- "description": "The type of the MCP tool. Always `mcp`.",
- "x-stainless-const": true
+ "description": "Unique identifier for the session that looks like `sess_1234567890abcdef`."
},
- "server_label": {
+ "object": {
"type": "string",
- "description": "A label for this MCP server, used to identify it in tool calls."
+ "description": "The object type. Always `realtime.session`."
},
- "server_url": {
- "type": "string",
- "format": "uri",
- "description": "The URL for the MCP server. One of `server_url`, `connector_id`, or\n `tunnel_id` must be provided."
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Expiration timestamp for the session, in seconds since epoch."
},
- "connector_id": {
- "type": "string",
- "enum": [
- "connector_dropbox",
- "connector_gmail",
- "connector_googlecalendar",
- "connector_googledrive",
- "connector_microsoftteams",
- "connector_outlookcalendar",
- "connector_outlookemail",
- "connector_sharepoint"
- ],
- "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more\n about service connectors [here](/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`"
+ "include": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "item.input_audio_transcription.logprobs"
+ ]
+ },
+ "description": "Additional fields to include in server outputs.\n - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription."
},
- "tunnel_id": {
+ "model": {
"type": "string",
- "pattern": "^tunnel_[a-z0-9]{32}$",
- "description": "The Secure MCP Tunnel ID to use instead of a direct server URL. One of\n `server_url`, `connector_id`, or `tunnel_id` must be provided."
+ "description": "The Realtime model used for this session."
},
- "authorization": {
- "type": "string",
- "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here."
+ "output_modalities": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
+ },
+ "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"]."
},
- "server_description": {
+ "instructions": {
"type": "string",
- "description": "Optional description of the MCP server, used to provide more context."
+ "description": "The default system instructions (i.e. system message) prepended to model\n calls. This field allows the client to guide the model on desired\n responses. The model can be instructed on response content and format,\n (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good\n responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion\n into your voice\", \"laugh frequently\"). The instructions are not guaranteed\n to be followed by the model, but they provide guidance to the model on the\n desired behavior.\n Note that the server sets default instructions which will be used if this\n field is not set and are visible in the `session.created` event at the\n start of the session."
},
- "headers": {
- "anyOf": [
- {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudio",
+ "description": "Configuration for input and output audio for the session."
},
- "allowed_tools": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
+ "tracing": {
+ "oneOf": [
{
- "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ "type": "string",
+ "enum": [
+ "auto"
+ ]
},
{
- "type": "null"
+ "type": "object",
+ "properties": {
+ "workflow_name": {
+ "type": "string"
+ },
+ "group_id": {
+ "type": "string"
+ },
+ "metadata": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
+ }
}
- ]
+ ],
+ "description": "Configuration options for tracing. Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.",
+ "title": "Tracing Configuration",
+ "default": "auto"
},
- "require_approval": {
- "anyOf": [
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseTurnDetection",
+ "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeFunctionTool"
+ },
+ "description": "Tools (functions) available to the model."
+ },
+ "tool_choice": {
+ "type": "string",
+ "description": "How the model chooses tools. Options are `auto`, `none`, `required`, or\n specify a function."
+ },
+ "max_output_tokens": {
+ "oneOf": [
{
- "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "string",
"enum": [
- "always",
- "never"
+ "inf"
]
- },
- {
- "type": "null"
}
],
- "default": "always"
- },
- "defer_loading": {
- "type": "boolean",
- "description": "Whether this MCP tool is deferred and discovered via tool search."
+ "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`."
},
- "project_connection_id": {
+ "type": {
"type": "string",
- "description": "The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server."
- },
- "tool_configs": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/ToolConfig"
- },
- "description": "Deprecated. This property is deprecated and will be removed in a future version.",
- "deprecated": true
+ "enum": [
+ "realtime"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion"
}
],
- "description": "Give the model access to additional tools via remote Model Context Protocol\n(MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).",
- "title": "MCP tool"
+ "description": "A Realtime session configuration object.",
+ "title": "Realtime session configuration object",
+ "x-oaiMeta": {
+ "name": "The session object",
+ "group": "realtime",
+ "example": "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"expires_at\": 1742188264,\n \"model\": \"gpt-realtime\",\n \"output_modalities\": [\"audio\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": \"auto\",\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": { \"model\": \"whisper-1\" },\n \"noise_reduction\": null,\n \"turn_detection\": null\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n }\n}\n"
+ }
},
- "OpenAI.MCPToolCallStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "calling",
- "failed"
- ]
+ "OpenAI.RealtimeSessionCreateResponseAudio": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInput"
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioOutput"
+ }
+ }
},
- "OpenAI.MCPToolFilter": {
+ "OpenAI.RealtimeSessionCreateResponseAudioInput": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
+ },
+ "transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscriptionResponse"
+ },
+ "noise_reduction": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction"
+ },
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseAudioOutput": {
"type": "object",
"properties": {
- "tool_names": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "List of allowed tool names.",
- "title": "MCP allowed tools"
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
},
- "read_only": {
- "type": "boolean",
- "description": "Indicates whether or not a tool modifies data or is read-only. If an\n MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),\n it will match this filter."
+ "voice": {
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsShared"
+ },
+ "speed": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
}
- },
- "description": "A filter object to specify which tools are allowed.",
- "title": "MCP tool filter"
+ }
},
- "OpenAI.MCPToolRequireApproval": {
+ "OpenAI.RealtimeSessionCreateResponseTurnDetection": {
"type": "object",
"properties": {
- "always": {
- "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ "type": {
+ "type": "string"
},
- "never": {
- "$ref": "#/components/schemas/OpenAI.MCPToolFilter"
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
}
},
- "OpenAI.MessageContent": {
+ "OpenAI.RealtimeSessionCreateResponseUnion": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.MessageContentType"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnionType"
}
},
"discriminator": {
"propertyName": "type",
"mapping": {
- "text": "#/components/schemas/OpenAI.TextContent",
- "computer_screenshot": "#/components/schemas/OpenAI.ComputerScreenshotContent",
- "input_text": "#/components/schemas/OpenAI.MessageContentInputTextContent",
- "output_text": "#/components/schemas/OpenAI.MessageContentOutputTextContent",
- "reasoning_text": "#/components/schemas/OpenAI.MessageContentReasoningTextContent",
- "refusal": "#/components/schemas/OpenAI.MessageContentRefusalContent",
- "input_image": "#/components/schemas/OpenAI.MessageContentInputImageContent",
- "input_file": "#/components/schemas/OpenAI.MessageContentInputFileContent",
- "summary_text": "#/components/schemas/OpenAI.SummaryTextContent"
+ "transcription": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse",
+ "realtime": "#/components/schemas/OpenAI.RealtimeSessionCreateResponse"
+ }
+ }
+ },
+ "OpenAI.RealtimeSessionCreateResponseUnionType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "realtime",
+ "transcription"
+ ]
+ }
+ ]
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequest": {
+ "type": "object",
+ "properties": {
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection",
+ "description": "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."
+ },
+ "input_audio_noise_reduction": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction",
+ "description": "Configuration for input audio noise reduction. This can be set to `null` to turn off.\n Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\n 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_format": {
+ "type": "string",
+ "enum": [
+ "pcm16",
+ "g711_ulaw",
+ "g711_alaw"
+ ],
+ "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.\n For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate,\n single channel (mono), and little-endian byte order.",
+ "default": "pcm16"
+ },
+ "input_audio_transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscription",
+ "description": "Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service."
+ },
+ "include": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "item.input_audio_transcription.logprobs"
+ ]
+ },
+ "description": "The set of items to include in the transcription. Current available items are:\n `item.input_audio_transcription.logprobs`"
}
},
- "description": "A content part that makes up an input or output item."
+ "description": "Realtime transcription session object configuration.",
+ "title": "Realtime transcription session configuration"
},
- "OpenAI.MessageContentInputFileContent": {
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestGA": {
"type": "object",
"required": [
"type"
@@ -46278,536 +67931,570 @@
"type": {
"type": "string",
"enum": [
- "input_file"
+ "transcription"
],
- "description": "The type of the input item. Always `input_file`.",
- "x-stainless-const": true,
- "default": "input_file"
- },
- "file_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "filename": {
- "type": "string",
- "description": "The name of the file to be sent to the model."
- },
- "file_data": {
- "type": "string",
- "description": "The content of the file to be sent to the model."
+ "description": "The type of session to create. Always `transcription` for transcription sessions.",
+ "x-stainless-const": true
},
- "file_url": {
- "type": "string",
- "format": "uri",
- "description": "The URL of the file to be sent to the model."
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudio",
+ "description": "Configuration for input and output audio."
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.FileInputDetail",
- "description": "The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`."
+ "include": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "item.input_audio_transcription.logprobs"
+ ]
+ },
+ "description": "Additional fields to include in server outputs.\n `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.MessageContent"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion"
}
],
- "description": "A file input to the model.",
- "title": "Input file"
+ "description": "Realtime transcription session object configuration.",
+ "title": "Realtime transcription session configuration"
},
- "OpenAI.MessageContentInputImageContent": {
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudio": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInput"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInput": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats"
+ },
+ "transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscription"
+ },
+ "noise_reduction": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInputNoiseReduction"
+ },
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInputNoiseReduction": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection": {
"type": "object",
- "required": [
- "type",
- "detail"
- ],
"properties": {
"type": {
"type": "string",
"enum": [
- "input_image"
- ],
- "description": "The type of the input item. Always `input_image`.",
- "x-stainless-const": true,
- "default": "input_image"
- },
- "image_url": {
- "anyOf": [
- {
- "type": "string",
- "format": "uri"
- },
- {
- "type": "null"
- }
+ "server_vad"
]
},
- "file_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "detail": {
- "$ref": "#/components/schemas/OpenAI.ImageDetail",
- "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "An image input to the model. Learn about [image inputs](/docs/guides/vision).",
- "title": "Input image"
+ }
},
- "OpenAI.MessageContentInputTextContent": {
+ "OpenAI.RealtimeTranscriptionSessionCreateResponse": {
"type": "object",
"required": [
- "type",
- "text"
+ "client_secret",
+ "type"
],
"properties": {
+ "client_secret": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret",
+ "description": "Ephemeral key returned by the API. Only present when the session is\n created on the server via REST API."
+ },
+ "modalities": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
+ },
+ "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"]."
+ },
+ "input_audio_format": {
+ "type": "string",
+ "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`."
+ },
+ "input_audio_transcription": {
+ "$ref": "#/components/schemas/OpenAI.AudioTranscriptionResponse",
+ "description": "Configuration of the transcription model."
+ },
+ "turn_detection": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection",
+ "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech."
+ },
"type": {
"type": "string",
"enum": [
- "input_text"
+ "transcription"
],
- "description": "The type of the input item. Always `input_text`.",
- "x-stainless-const": true,
- "default": "input_text"
- },
- "text": {
- "type": "string",
- "description": "The text input to the model."
+ "x-stainless-const": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.MessageContent"
+ "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion"
}
],
- "description": "A text input to the model.",
- "title": "Input text"
+ "description": "A new Realtime transcription session configuration.\nWhen a session is created on the server via REST API, the session object\nalso contains an ephemeral key. Default TTL for keys is 10 minutes. This\nproperty is not present when a session is updated via the WebSocket API.",
+ "x-oaiMeta": {
+ "name": "The transcription session object",
+ "group": "realtime",
+ "example": "{\n \"id\": \"sess_BBwZc7cFV3XizEyKGDCGL\",\n \"object\": \"realtime.transcription_session\",\n \"expires_at\": 1742188264,\n \"modalities\": [\"audio\", \"text\"],\n \"turn_detection\": {\n \"type\": \"server_vad\",\n \"threshold\": 0.5,\n \"prefix_padding_ms\": 300,\n \"silence_duration_ms\": 200\n },\n \"input_audio_format\": \"pcm16\",\n \"input_audio_transcription\": {\n \"model\": \"gpt-4o-transcribe\",\n \"language\": null,\n \"prompt\": \"\"\n },\n \"client_secret\": null\n}\n"
+ }
},
- "OpenAI.MessageContentOutputTextContent": {
+ "OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret": {
"type": "object",
"required": [
- "type",
- "text",
- "annotations",
- "logprobs"
+ "value",
+ "expires_at"
],
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime"
+ }
+ }
+ },
+ "OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection": {
+ "type": "object",
"properties": {
"type": {
- "type": "string",
- "enum": [
- "output_text"
- ],
- "description": "The type of the output text. Always `output_text`.",
- "x-stainless-const": true,
- "default": "output_text"
+ "type": "string"
},
- "text": {
- "type": "string",
- "description": "The text output from the model."
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "annotations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Annotation"
- },
- "description": "The annotations of the text output."
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.LogProb"
- }
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
- ],
- "description": "A text output from the model.",
- "title": "Output text"
+ }
},
- "OpenAI.MessageContentReasoningTextContent": {
+ "OpenAI.RealtimeTranslationClientSecretCreateRequest": {
"type": "object",
"required": [
- "type",
- "text"
+ "session"
],
"properties": {
- "type": {
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationClientSecretCreateRequestExpiresAfter",
+ "description": "Configuration for the client secret expiration. Expiration refers to the time after which\n a client secret will no longer be valid for creating sessions. The session itself may\n continue after that time once started. A secret can be used to create multiple sessions\n until it expires.",
+ "title": "Client secret expiration"
+ },
+ "session": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequest"
+ }
+ },
+ "description": "Create a translation session and client secret for the Realtime API.",
+ "title": "Realtime translation client secret creation request"
+ },
+ "OpenAI.RealtimeTranslationClientSecretCreateRequestExpiresAfter": {
+ "type": "object",
+ "properties": {
+ "anchor": {
"type": "string",
"enum": [
- "reasoning_text"
+ "created_at"
],
- "description": "The type of the reasoning text. Always `reasoning_text`.",
"x-stainless-const": true,
- "default": "reasoning_text"
+ "default": "created_at"
},
- "text": {
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "minimum": 10,
+ "maximum": 7200,
+ "default": 600
+ }
+ }
+ },
+ "OpenAI.RealtimeTranslationClientSecretCreateResponse": {
+ "type": "object",
+ "required": [
+ "value",
+ "expires_at",
+ "session"
+ ],
+ "properties": {
+ "value": {
"type": "string",
- "description": "The reasoning text from the model."
+ "description": "The generated client secret value."
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Expiration timestamp for the client secret, in seconds since epoch."
+ },
+ "session": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSession"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
- }
- ],
- "description": "Reasoning text from the model.",
- "title": "Reasoning text"
+ "description": "Response from creating a translation session and client secret for the Realtime API.",
+ "title": "Realtime translation session and client secret",
+ "x-oaiMeta": {
+ "name": "Translation session response object",
+ "group": "realtime",
+ "example": "{\n \"value\": \"ek_68af296e8e408191a1120ab6383263c2\",\n \"expires_at\": 1756310470,\n \"session\": {\n \"id\": \"sess_C9CiUVUzUzYIssh3ELY1d\",\n \"type\": \"translation\",\n \"expires_at\": 1756310470,\n \"model\": \"gpt-realtime-translate\",\n \"audio\": {\n \"input\": {\n \"transcription\": null,\n \"noise_reduction\": null\n },\n \"output\": {\n \"language\": \"es\"\n }\n }\n }\n}\n"
+ }
},
- "OpenAI.MessageContentRefusalContent": {
+ "OpenAI.RealtimeTranslationSession": {
"type": "object",
"required": [
+ "id",
"type",
- "refusal"
+ "expires_at",
+ "model",
+ "audio"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the session that looks like `sess_1234567890abcdef`."
+ },
"type": {
"type": "string",
"enum": [
- "refusal"
+ "translation"
],
- "description": "The type of the refusal. Always `refusal`.",
- "x-stainless-const": true,
- "default": "refusal"
+ "description": "The session type. Always `translation` for Realtime translation sessions.",
+ "x-stainless-const": true
},
- "refusal": {
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Expiration timestamp for the session, in seconds since epoch."
+ },
+ "model": {
"type": "string",
- "description": "The refusal explanation from the model."
+ "description": "The Realtime translation model used for this session. This field is set at\n session creation and cannot be changed with `session.update`."
+ },
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudio",
+ "description": "Configuration for translation input and output audio."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
+ "description": "A Realtime translation session. Translation sessions continuously translate input\naudio into the configured output language.",
+ "title": "Realtime translation session",
+ "x-oaiMeta": {
+ "name": "The translation session object",
+ "group": "realtime",
+ "example": "{\n \"id\": \"sess_C9G5QPteg4UIbotdKLoYQ\",\n \"type\": \"translation\",\n \"expires_at\": 1756324625,\n \"model\": \"gpt-realtime-translate\",\n \"audio\": {\n \"input\": {\n \"transcription\": {\n \"model\": \"gpt-realtime-whisper\"\n },\n \"noise_reduction\": null\n },\n \"output\": {\n \"language\": \"es\"\n }\n }\n}\n"
+ }
+ },
+ "OpenAI.RealtimeTranslationSessionAudio": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInput"
+ },
+ "output": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudioOutput"
}
- ],
- "description": "A refusal from the model.",
- "title": "Refusal"
+ }
},
- "OpenAI.MessageContentType": {
- "anyOf": [
- {
- "type": "string"
+ "OpenAI.RealtimeTranslationSessionAudioInput": {
+ "type": "object",
+ "properties": {
+ "transcription": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInputTranscription"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- {
- "type": "string",
- "enum": [
- "input_text",
- "output_text",
- "text",
- "summary_text",
- "reasoning_text",
- "refusal",
- "input_image",
- "computer_screenshot",
- "input_file"
+ "noise_reduction": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInputNoiseReduction"
+ },
+ {
+ "type": "null"
+ }
]
}
- ]
+ }
},
- "OpenAI.MessagePhase": {
- "type": "string",
- "enum": [
- "commentary",
- "final_answer"
+ "OpenAI.RealtimeTranslationSessionAudioInputNoiseReduction": {
+ "type": "object",
+ "required": [
+ "type"
],
- "description": "Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).\nFor models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend\nphase on all assistant messages — dropping it can degrade performance. Not used for user messages."
- },
- "OpenAI.MessageRole": {
- "type": "string",
- "enum": [
- "unknown",
- "user",
- "assistant",
- "system",
- "critic",
- "discriminator",
- "developer",
- "tool"
- ]
- },
- "OpenAI.MessageStatus": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
+ }
+ }
},
- "OpenAI.Metadata": {
+ "OpenAI.RealtimeTranslationSessionAudioInputTranscription": {
"type": "object",
- "unevaluatedProperties": {
- "type": "string"
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.",
- "x-oaiTypeLabel": "map"
- },
- "OpenAI.ModelIdsCompaction": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ModelIdsResponses"
- },
- {
- "type": "string"
- },
- {
- "type": "null"
- }
+ "required": [
+ "model"
],
- "description": "Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/docs/models) to browse and compare available models."
- },
- "OpenAI.ModelIdsResponses": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ModelIdsShared"
- },
- {
- "type": "string",
- "enum": [
- "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",
- "gpt-5-codex",
- "gpt-5-pro",
- "gpt-5-pro-2025-10-06",
- "gpt-5.1-codex-max"
- ]
+ "properties": {
+ "model": {
+ "type": "string"
}
- ]
+ }
},
- "OpenAI.ModelIdsShared": {
- "anyOf": [
- {
+ "OpenAI.RealtimeTranslationSessionAudioOutput": {
+ "type": "object",
+ "properties": {
+ "language": {
"type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ChatModel"
}
- ]
+ }
},
- "OpenAI.Moderation": {
+ "OpenAI.RealtimeTranslationSessionCreateRequest": {
"type": "object",
"required": [
- "input",
- "output"
+ "model"
],
+ "properties": {
+ "model": {
+ "type": "string",
+ "description": "The Realtime translation model used for this session."
+ },
+ "audio": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudio",
+ "description": "Configuration for translation input and output audio."
+ }
+ },
+ "description": "Realtime translation session configuration. Translation sessions stream source\naudio in and translated audio plus transcript deltas out continuously.",
+ "title": "Realtime translation session configuration"
+ },
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudio": {
+ "type": "object",
"properties": {
"input": {
- "$ref": "#/components/schemas/OpenAI.ModerationEntry",
- "description": "Moderation for the response input."
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInput"
},
"output": {
- "$ref": "#/components/schemas/OpenAI.ModerationEntry",
- "description": "Moderation for the response output."
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioOutput"
}
- },
- "description": "Moderation results or errors for the response input and output.",
- "title": "Moderation"
+ }
},
- "OpenAI.ModerationEntry": {
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudioInput": {
+ "type": "object",
+ "properties": {
+ "transcription": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInputTranscription"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "noise_reduction": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInputNoiseReduction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudioInputNoiseReduction": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ModerationEntryType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "moderation_result": "#/components/schemas/OpenAI.ModerationResultBody",
- "error": "#/components/schemas/OpenAI.ModerationErrorBody"
+ "$ref": "#/components/schemas/OpenAI.NoiseReductionType"
}
- },
- "description": "Moderation results or an error for a response moderation check."
+ }
},
- "OpenAI.ModerationEntryType": {
- "anyOf": [
- {
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudioInputTranscription": {
+ "type": "object",
+ "required": [
+ "model"
+ ],
+ "properties": {
+ "model": {
"type": "string"
- },
- {
- "type": "string",
- "enum": [
- "moderation_result",
- "error"
- ]
}
- ]
+ }
},
- "OpenAI.ModerationErrorBody": {
+ "OpenAI.RealtimeTranslationSessionCreateRequestAudioOutput": {
"type": "object",
- "required": [
- "type",
- "code",
- "message"
- ],
"properties": {
- "type": {
+ "language": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.RealtimeTruncation": {
+ "oneOf": [
+ {
"type": "string",
"enum": [
- "error"
- ],
- "description": "The object type, which was always `error` for moderation failures.",
- "x-stainless-const": true
- },
- "code": {
- "type": "string",
- "description": "The error code."
+ "auto",
+ "disabled"
+ ]
},
- "message": {
- "type": "string",
- "description": "The error message."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ModerationEntry"
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "retention_ratio"
+ ],
+ "x-stainless-const": true
+ },
+ "retention_ratio": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1
+ },
+ "token_limits": {
+ "$ref": "#/components/schemas/OpenAI.TokenLimits"
+ }
+ },
+ "required": [
+ "type",
+ "retention_ratio"
+ ]
}
],
- "description": "An error produced while attempting moderation for the response input or output.",
- "title": "Moderation error"
- },
- "OpenAI.ModerationInputType": {
- "type": "string",
- "enum": [
- "text",
- "image"
- ]
+ "description": "When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs.\nClients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost.\nTruncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate.\nTruncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit.",
+ "title": "Realtime Truncation Controls"
},
- "OpenAI.ModerationParam": {
+ "OpenAI.RealtimeTurnDetection": {
"type": "object",
"required": [
- "model"
+ "type"
],
"properties": {
- "model": {
- "type": "string",
- "description": "The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'."
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetectionType"
}
},
- "description": "Configuration for running moderation on the input and output of this response."
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "server_vad": "#/components/schemas/OpenAI.RealtimeTurnDetectionServerVad",
+ "semantic_vad": "#/components/schemas/OpenAI.RealtimeTurnDetectionSemanticVad"
+ }
+ },
+ "description": "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.\nServer 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.\nSemantic 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.\nFor `gpt-realtime-whisper` transcription sessions, turn detection must be\nset to `null`; VAD is not supported.",
+ "title": "Realtime Turn Detection"
},
- "OpenAI.ModerationResultBody": {
+ "OpenAI.RealtimeTurnDetectionSemanticVad": {
"type": "object",
"required": [
- "type",
- "model",
- "flagged",
- "categories",
- "category_scores",
- "category_applied_input_types"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "moderation_result"
- ],
- "description": "The object type, which was always `moderation_result` for successful moderation results.",
- "x-stainless-const": true
+ "semantic_vad"
+ ]
},
- "model": {
+ "eagerness": {
"type": "string",
- "description": "The moderation model that produced this result."
+ "enum": [
+ "low",
+ "medium",
+ "high",
+ "auto"
+ ],
+ "default": "auto"
},
- "flagged": {
+ "create_response": {
"type": "boolean",
- "description": "A boolean indicating whether the content was flagged by any category."
- },
- "categories": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "boolean"
- },
- "description": "A dictionary of moderation categories to booleans, True if the input is flagged under this category.",
- "x-oaiTypeLabel": "map"
- },
- "category_scores": {
- "type": "object",
- "unevaluatedProperties": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "description": "A dictionary of moderation categories to scores.",
- "x-oaiTypeLabel": "map"
+ "default": true
},
- "category_applied_input_types": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ModerationInputType"
- }
- },
- "description": "Which modalities of input are reflected by the score for each category.",
- "x-oaiTypeLabel": "map"
+ "interrupt_response": {
+ "type": "boolean",
+ "default": true
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ModerationEntry"
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection"
}
- ],
- "description": "A moderation result produced for the response input or output.",
- "title": "Moderation result"
+ ]
},
- "OpenAI.MoveParam": {
+ "OpenAI.RealtimeTurnDetectionServerVad": {
"type": "object",
"required": [
- "type",
- "x",
- "y"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "move"
- ],
- "description": "Specifies the event type. For a move action, this property is always set to `move`.",
- "x-stainless-const": true
+ "server_vad"
+ ]
},
- "x": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate to move to."
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
},
- "y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate to move to."
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
},
- "keys": {
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "create_response": {
+ "type": "boolean",
+ "default": true
+ },
+ "interrupt_response": {
+ "type": "boolean",
+ "default": true
+ },
+ "idle_timeout_ms": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "$ref": "#/components/schemas/OpenAI.integer"
},
{
"type": "null"
@@ -46817,127 +68504,106 @@
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection"
}
- ],
- "description": "A mouse move action.",
- "title": "Move"
+ ]
},
- "OpenAI.NamespaceToolParam": {
- "type": "object",
- "required": [
- "type",
- "name",
- "description",
- "tools"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "namespace"
- ],
- "description": "The type of the tool. Always `namespace`.",
- "x-stainless-const": true
- },
- "name": {
- "type": "string",
- "minLength": 1,
- "description": "The namespace name used in tool calls (for example, `crm`)."
- },
- "description": {
- "type": "string",
- "minLength": 1,
- "description": "A description of the namespace shown to the model."
+ "OpenAI.RealtimeTurnDetectionType": {
+ "anyOf": [
+ {
+ "type": "string"
},
- "tools": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionToolParam"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CustomToolParam"
- }
- ]
- },
- "minItems": 1,
- "description": "The function/custom tools available inside this namespace."
- }
- },
- "allOf": [
{
- "$ref": "#/components/schemas/OpenAI.Tool"
- }
- ],
- "description": "Groups function/custom tools under a shared namespace.",
- "title": "Namespace"
- },
- "OpenAI.OutputContent": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.OutputContentType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "output_text": "#/components/schemas/OpenAI.OutputContentOutputTextContent",
- "refusal": "#/components/schemas/OpenAI.OutputContentRefusalContent",
- "reasoning_text": "#/components/schemas/OpenAI.OutputContentReasoningTextContent"
+ "type": "string",
+ "enum": [
+ "server_vad",
+ "semantic_vad"
+ ]
}
- }
+ ]
},
- "OpenAI.OutputContentOutputTextContent": {
+ "OpenAI.Reasoning": {
"type": "object",
- "required": [
- "type",
- "text",
- "annotations",
- "logprobs"
- ],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "output_text"
- ],
- "description": "The type of the output text. Always `output_text`.",
- "x-stainless-const": true,
- "default": "output_text"
+ "effort": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "text": {
- "type": "string",
- "description": "The text output from the model."
+ "summary": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "concise",
+ "detailed"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "annotations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Annotation"
- },
- "description": "The annotations of the text output."
+ "context": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "current_turn",
+ "all_turns"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.LogProb"
- }
+ "generate_summary": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "concise",
+ "detailed"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
+ "description": "**gpt-5 and o-series models only**\nConfiguration options for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).",
+ "title": "Reasoning"
+ },
+ "OpenAI.ReasoningEffort": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputContent"
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "none",
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ]
}
],
- "description": "A text output from the model.",
- "title": "Output text"
+ "description": "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\n- `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.\n- All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.\n- The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.\n- `xhigh` is supported for all models after `gpt-5.1-codex-max`."
},
- "OpenAI.OutputContentReasoningTextContent": {
+ "OpenAI.ReasoningTextContent": {
"type": "object",
"required": [
"type",
@@ -46958,2372 +68624,2345 @@
"description": "The reasoning text from the model."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputContent"
- }
- ],
"description": "Reasoning text from the model.",
"title": "Reasoning text"
},
- "OpenAI.OutputContentRefusalContent": {
+ "OpenAI.Response": {
"type": "object",
"required": [
- "type",
- "refusal"
+ "id",
+ "object",
+ "created_at",
+ "error",
+ "incomplete_details",
+ "output",
+ "instructions",
+ "parallel_tool_calls",
+ "agent_reference"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "refusal"
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "top_logprobs": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
],
- "description": "The type of the refusal. Always `refusal`.",
- "x-stainless-const": true,
- "default": "refusal"
+ "default": 1
},
- "refusal": {
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": 1
+ },
+ "user": {
"type": "string",
- "description": "The refusal explanation from the model."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputContent"
- }
- ],
- "description": "A refusal from the model.",
- "title": "Refusal"
- },
- "OpenAI.OutputContentType": {
- "anyOf": [
- {
- "type": "string"
+ "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
+ "deprecated": true
},
- {
+ "safety_identifier": {
"type": "string",
- "enum": [
- "output_text",
- "refusal",
- "reasoning_text"
+ "maxLength": 64,
+ "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
+ },
+ "prompt_cache_key": {
+ "type": "string",
+ "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
+ },
+ "service_tier": {
+ "$ref": "#/components/schemas/OpenAI.ServiceTier"
+ },
+ "prompt_cache_retention": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "in_memory",
+ "24h"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "previous_response_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "model": {
+ "type": "string",
+ "description": "The model deployment to use for the creation of this response."
+ },
+ "background": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "max_tool_calls": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "text": {
+ "$ref": "#/components/schemas/OpenAI.ResponseTextParam"
+ },
+ "tools": {
+ "$ref": "#/components/schemas/OpenAI.ToolsArray"
+ },
+ "tool_choice": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ }
]
- }
- ]
- },
- "OpenAI.OutputItem": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.OutputItemType"
},
- "created_by": {
+ "prompt": {
+ "$ref": "#/components/schemas/OpenAI.Prompt"
+ },
+ "truncation": {
"anyOf": [
{
- "$ref": "#/components/schemas/CreatedBy"
+ "type": "string",
+ "enum": [
+ "auto",
+ "disabled"
+ ]
},
{
- "type": "string"
+ "type": "null"
}
],
- "description": "The information about the creator of the item"
+ "default": "disabled"
},
- "agent_reference": {
- "$ref": "#/components/schemas/AgentReference",
- "description": "The agent that created the item."
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for this Response."
},
- "response_id": {
+ "object": {
"type": "string",
- "description": "The response on which the item is created."
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "structured_outputs": "#/components/schemas/StructuredOutputsOutputItem",
- "workflow_action": "#/components/schemas/WorkflowActionOutputItem",
- "oauth_consent_request": "#/components/schemas/OAuthConsentRequestOutputItem",
- "bing_grounding_call": "#/components/schemas/BingGroundingToolCall",
- "bing_grounding_call_output": "#/components/schemas/BingGroundingToolCallOutput",
- "sharepoint_grounding_preview_call": "#/components/schemas/SharepointGroundingToolCall",
- "sharepoint_grounding_preview_call_output": "#/components/schemas/SharepointGroundingToolCallOutput",
- "azure_ai_search_call": "#/components/schemas/AzureAISearchToolCall",
- "azure_ai_search_call_output": "#/components/schemas/AzureAISearchToolCallOutput",
- "bing_custom_search_preview_call": "#/components/schemas/BingCustomSearchToolCall",
- "bing_custom_search_preview_call_output": "#/components/schemas/BingCustomSearchToolCallOutput",
- "openapi_call": "#/components/schemas/OpenApiToolCall",
- "openapi_call_output": "#/components/schemas/OpenApiToolCallOutput",
- "browser_automation_preview_call": "#/components/schemas/BrowserAutomationToolCall",
- "browser_automation_preview_call_output": "#/components/schemas/BrowserAutomationToolCallOutput",
- "fabric_dataagent_preview_call": "#/components/schemas/FabricDataAgentToolCall",
- "fabric_dataagent_preview_call_output": "#/components/schemas/FabricDataAgentToolCallOutput",
- "azure_function_call": "#/components/schemas/AzureFunctionToolCall",
- "azure_function_call_output": "#/components/schemas/AzureFunctionToolCallOutput",
- "a2a_preview_call": "#/components/schemas/A2AToolCall",
- "a2a_preview_call_output": "#/components/schemas/A2AToolCallOutput",
- "memory_search_call": "#/components/schemas/MemorySearchToolCall",
- "memory_command_preview_call": "#/components/schemas/MemoryCommandToolCall",
- "memory_command_preview_call_output": "#/components/schemas/MemoryCommandToolCallOutput",
- "output_message": "#/components/schemas/OpenAI.OutputItemOutputMessage",
- "file_search_call": "#/components/schemas/OpenAI.OutputItemFileSearchToolCall",
- "function_call": "#/components/schemas/OpenAI.OutputItemFunctionToolCall",
- "function_call_output": "#/components/schemas/OpenAI.OutputItemFunctionToolCallOutput",
- "web_search_call": "#/components/schemas/OpenAI.OutputItemWebSearchToolCall",
- "computer_call": "#/components/schemas/OpenAI.OutputItemComputerToolCall",
- "computer_call_output": "#/components/schemas/OpenAI.OutputItemComputerToolCallOutput",
- "reasoning": "#/components/schemas/OpenAI.OutputItemReasoningItem",
- "tool_search_call": "#/components/schemas/OpenAI.OutputItemToolSearchCall",
- "tool_search_output": "#/components/schemas/OpenAI.OutputItemToolSearchOutput",
- "additional_tools": "#/components/schemas/OpenAI.OutputItemAdditionalTools",
- "compaction": "#/components/schemas/OpenAI.OutputItemCompactionBody",
- "image_generation_call": "#/components/schemas/OpenAI.OutputItemImageGenToolCall",
- "code_interpreter_call": "#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall",
- "local_shell_call": "#/components/schemas/OpenAI.OutputItemLocalShellToolCall",
- "local_shell_call_output": "#/components/schemas/OpenAI.OutputItemLocalShellToolCallOutput",
- "shell_call": "#/components/schemas/OpenAI.OutputItemFunctionShellCall",
- "shell_call_output": "#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput",
- "apply_patch_call": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCall",
- "apply_patch_call_output": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput",
- "mcp_call": "#/components/schemas/OpenAI.OutputItemMcpToolCall",
- "mcp_list_tools": "#/components/schemas/OpenAI.OutputItemMcpListTools",
- "mcp_approval_request": "#/components/schemas/OpenAI.OutputItemMcpApprovalRequest",
- "mcp_approval_response": "#/components/schemas/OpenAI.OutputItemMcpApprovalResponseResource",
- "custom_tool_call": "#/components/schemas/OpenAI.OutputItemCustomToolCallResource",
- "custom_tool_call_output": "#/components/schemas/OpenAI.OutputItemCustomToolCallOutputResource"
- }
- }
- },
- "OpenAI.OutputItemAdditionalTools": {
- "type": "object",
- "required": [
- "type",
- "id",
- "role",
- "tools"
- ],
- "properties": {
- "type": {
+ "enum": [
+ "response"
+ ],
+ "description": "The object type of this resource - always set to `response`.",
+ "x-stainless-const": true
+ },
+ "status": {
"type": "string",
"enum": [
- "additional_tools"
+ "completed",
+ "failed",
+ "in_progress",
+ "cancelled",
+ "queued",
+ "incomplete"
],
- "description": "The type of the item. Always `additional_tools`.",
- "x-stainless-const": true,
- "default": "additional_tools"
+ "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`."
},
- "id": {
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) of when this Response was created."
+ },
+ "completed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseError"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "incomplete_details": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "output": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.OutputItem"
+ },
+ "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs."
+ },
+ "reasoning": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Reasoning"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "instructions": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.InputItem"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "output_text": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsage"
+ },
+ "moderation": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Moderation"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether to allow the model to run tool calls in parallel.",
+ "default": true
+ },
+ "conversation": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ConversationReference"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "max_output_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "agent": {
+ "$ref": "#/components/schemas/AgentId",
+ "description": "(Deprecated) Use agent_reference instead.\nThe agent used for this response"
+ },
+ "agent_session_id": {
"type": "string",
- "description": "The unique ID of the additional tools item."
+ "description": "The session identifier for this response. Currently only relevant for hosted agents.\nAlways returned for hosted agents — either the caller-provided value, the auto-derived value,\nor an auto-generated UUID. Use for session-scoped operations and to maintain sandbox\naffinity in follow-up calls."
},
- "role": {
- "$ref": "#/components/schemas/OpenAI.MessageRole",
- "description": "The role that provided the additional tools."
+ "agent_reference": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/AgentReference"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The agent used for this response"
},
- "tools": {
+ "content_filters": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ "$ref": "#/components/schemas/ContentFilterResult"
},
- "description": "The additional tool definitions made available at this item."
+ "description": "The content filter evaluation results."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ]
+ "title": "The response object"
},
- "OpenAI.OutputItemApplyPatchToolCall": {
+ "OpenAI.ResponseAudioDeltaEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "operation"
+ "sequence_number",
+ "delta"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call"
+ "response.audio.delta"
],
- "description": "The type of the item. Always `apply_patch_call`.",
- "x-stainless-const": true,
- "default": "apply_patch_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus",
- "description": "The status of the apply patch tool call. One of `in_progress` or `completed`."
+ "description": "The type of the event. Always `response.audio.delta`.",
+ "x-stainless-const": true
},
- "operation": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation",
- "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.",
- "title": "Apply patch operation"
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "A sequence number for this chunk of the stream response."
},
- "created_by": {
+ "delta": {
"type": "string",
- "description": "The ID of the entity that created this tool call."
+ "contentEncoding": "base64",
+ "description": "A chunk of Base64 encoded response audio bytes."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call that applies file diffs by creating, deleting, or updating files.",
- "title": "Apply patch tool call"
+ "description": "Emitted when there is a partial audio response.",
+ "x-oaiMeta": {
+ "name": "response.audio.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.audio.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \"base64encoded...\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemApplyPatchToolCallOutput": {
+ "OpenAI.ResponseAudioDoneEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status"
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "apply_patch_call_output"
+ "response.audio.done"
],
- "description": "The type of the item. Always `apply_patch_call_output`.",
- "x-stainless-const": true,
- "default": "apply_patch_call_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the apply patch tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus",
- "description": "The status of the apply patch tool call output. One of `completed` or `failed`."
- },
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The type of the event. Always `response.audio.done`.",
+ "x-stainless-const": true
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call output."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the delta."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The output emitted by an apply patch tool call.",
- "title": "Apply patch tool call output"
+ "description": "Emitted when the audio response is complete.",
+ "x-oaiMeta": {
+ "name": "response.audio.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.audio.done\",\n \"response_id\": \"resp-123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemCodeInterpreterToolCall": {
+ "OpenAI.ResponseAudioTranscriptDeltaEvent": {
"type": "object",
"required": [
"type",
- "id",
- "status",
- "container_id",
- "code",
- "outputs"
+ "delta",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "code_interpreter_call"
- ],
- "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.",
- "x-stainless-const": true,
- "default": "code_interpreter_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the code interpreter tool call."
- },
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete",
- "interpreting",
- "failed"
+ "response.audio.transcript.delta"
],
- "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`."
+ "description": "The type of the event. Always `response.audio.transcript.delta`.",
+ "x-stainless-const": true
},
- "container_id": {
+ "delta": {
"type": "string",
- "description": "The ID of the container used to run the code."
- },
- "code": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The partial transcript of the audio response."
},
- "outputs": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs"
- },
- {
- "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call to run code.",
- "title": "Code interpreter tool call"
+ "description": "Emitted when there is a partial transcript of audio.",
+ "x-oaiMeta": {
+ "name": "response.audio.transcript.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.audio.transcript.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \" ... partial transcript ... \",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemCompactionBody": {
+ "OpenAI.ResponseAudioTranscriptDoneEvent": {
"type": "object",
"required": [
"type",
- "id",
- "encrypted_content"
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "compaction"
+ "response.audio.transcript.done"
],
- "description": "The type of the item. Always `compaction`.",
- "x-stainless-const": true,
- "default": "compaction"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the compaction item."
- },
- "encrypted_content": {
- "type": "string",
- "description": "The encrypted content that was produced by compaction."
+ "description": "The type of the event. Always `response.audio.transcript.done`.",
+ "x-stainless-const": true
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).",
- "title": "Compaction item"
+ "description": "Emitted when the full audio transcript is completed.",
+ "x-oaiMeta": {
+ "name": "response.audio.transcript.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.audio.transcript.done\",\n \"response_id\": \"resp_123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemComputerToolCall": {
+ "OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "pending_safety_checks",
- "status"
+ "output_index",
+ "item_id",
+ "delta",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_call"
+ "response.code_interpreter_call_code.delta"
],
- "description": "The type of the computer call. Always `computer_call`.",
- "default": "computer_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the computer call."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used when responding to the tool call with output."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- },
- "actions": {
- "$ref": "#/components/schemas/OpenAI.ComputerActionList"
- },
- "pending_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The pending safety checks for the computer call."
+ "description": "The type of the event. Always `response.code_interpreter_call_code.delta`.",
+ "x-stainless-const": true
},
- "status": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code is being streamed."
+ },
+ "item_id": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The unique identifier of the code interpreter tool call item."
+ },
+ "delta": {
+ "type": "string",
+ "description": "The partial code snippet being streamed by the code interpreter."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.",
- "title": "Computer tool call"
+ "description": "Emitted when a partial code snippet is streamed by the code interpreter.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call_code.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call_code.delta\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"delta\": \"print('Hello, world')\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemComputerToolCallOutput": {
+ "OpenAI.ResponseCodeInterpreterCallCodeDoneEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "output"
+ "output_index",
+ "item_id",
+ "code",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "computer_call_output"
+ "response.code_interpreter_call_code.done"
],
- "description": "The type of the computer tool call output. Always `computer_call_output`.",
- "x-stainless-const": true,
- "default": "computer_call_output"
+ "description": "The type of the event. Always `response.code_interpreter_call_code.done`.",
+ "x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The ID of the computer tool call output.",
- "readOnly": true
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code is finalized."
},
- "call_id": {
+ "item_id": {
"type": "string",
- "description": "The ID of the computer tool call that produced the output."
- },
- "acknowledged_safety_checks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam"
- },
- "description": "The safety checks reported by the API that have been acknowledged by the\n developer."
- },
- "output": {
- "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage"
+ "description": "The unique identifier of the code interpreter tool call item."
},
- "status": {
+ "code": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ "description": "The final code snippet output by the code interpreter."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The output of a computer tool call.",
- "title": "Computer tool call output"
+ "description": "Emitted when the code snippet is finalized by the code interpreter.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call_code.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call_code.done\",\n \"output_index\": 3,\n \"item_id\": \"ci_12345\",\n \"code\": \"print('done')\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemCustomToolCallOutputResource": {
+ "OpenAI.ResponseCodeInterpreterCallCompletedEvent": {
"type": "object",
"required": [
"type",
- "call_id",
- "output",
- "status"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call_output"
+ "response.code_interpreter_call.completed"
],
- "description": "The type of the custom tool call output. Always `custom_tool_call_output`.",
+ "description": "The type of the event. Always `response.code_interpreter_call.completed`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call output in the OpenAI platform."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code interpreter call is completed."
},
- "call_id": {
+ "item_id": {
"type": "string",
- "description": "The call ID, used to map this custom tool call output to a custom tool call."
- },
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
- }
- ],
- "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The unique identifier of the code interpreter tool call item."
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "ResponseCustomToolCallOutputItem"
+ "description": "Emitted when the code interpreter call is completed.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call.completed\",\n \"output_index\": 5,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemCustomToolCallResource": {
+ "OpenAI.ResponseCodeInterpreterCallInProgressEvent": {
"type": "object",
"required": [
"type",
- "call_id",
- "name",
- "input",
- "status"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "custom_tool_call"
+ "response.code_interpreter_call.in_progress"
],
- "description": "The type of the custom tool call. Always `custom_tool_call`.",
+ "description": "The type of the event. Always `response.code_interpreter_call.in_progress`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the custom tool call in the OpenAI platform."
- },
- "call_id": {
- "type": "string",
- "description": "An identifier used to map this custom tool call to a tool call output."
- },
- "namespace": {
- "type": "string",
- "description": "The namespace of the custom tool being called."
- },
- "name": {
- "type": "string",
- "description": "The name of the custom tool being called."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code interpreter call is in progress."
},
- "input": {
+ "item_id": {
"type": "string",
- "description": "The input for the custom tool call generated by the model."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The unique identifier of the code interpreter tool call item."
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "ResponseCustomToolCallItem"
+ "description": "Emitted when a code interpreter call is in progress.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemFileSearchToolCall": {
+ "OpenAI.ResponseCodeInterpreterCallInterpretingEvent": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "queries"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the file search tool call."
- },
"type": {
"type": "string",
"enum": [
- "file_search_call"
+ "response.code_interpreter_call.interpreting"
],
- "description": "The type of the file search tool call. Always `file_search_call`.",
+ "description": "The type of the event. Always `response.code_interpreter_call.interpreting`.",
"x-stainless-const": true
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "incomplete",
- "failed"
- ],
- "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`,"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response for which the code interpreter is interpreting code."
},
- "queries": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "The queries used to search for files."
+ "item_id": {
+ "type": "string",
+ "description": "The unique identifier of the code interpreter tool call item."
},
- "results": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults"
- }
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event, used to order streaming events."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.",
- "title": "File search tool call"
+ "description": "Emitted when the code interpreter is actively interpreting the code snippet.",
+ "x-oaiMeta": {
+ "name": "response.code_interpreter_call.interpreting",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.code_interpreter_call.interpreting\",\n \"output_index\": 4,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemFunctionShellCall": {
+ "OpenAI.ResponseCompletedEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "action",
- "status",
- "environment"
+ "response",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call"
+ "response.completed"
],
- "description": "The type of the item. Always `shell_call`.",
- "x-stainless-const": true,
- "default": "shell_call"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell tool call. Populated when this item is returned via API."
- },
- "call_id": {
- "type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
- },
- "action": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellAction",
- "description": "The shell commands and limits that describe how to run the tool call."
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallStatus",
- "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`."
+ "description": "The type of the event. Always `response.completed`.",
+ "x-stainless-const": true
},
- "environment": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallEnvironment"
- },
- {
- "type": "null"
- }
- ]
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "Properties of the completed response."
},
- "created_by": {
- "type": "string",
- "description": "The ID of the entity that created this tool call."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number for this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call that executes one or more shell commands in a managed environment.",
- "title": "Shell tool call"
+ "description": "Emitted when the model response is complete.",
+ "x-oaiMeta": {
+ "name": "response.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.completed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"completed\",\n \"completed_at\": 1740855870,\n \"error\": null,\n \"incomplete_details\": null,\n \"input\": [],\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [\n {\n \"id\": \"msg_123\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 0,\n \"output_tokens\": 0,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 0\n },\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemFunctionShellCallOutput": {
+ "OpenAI.ResponseContentPartAddedEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "status",
- "output",
- "max_output_length"
+ "item_id",
+ "output_index",
+ "content_index",
+ "part",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "shell_call_output"
+ "response.content_part.added"
],
- "description": "The type of the shell call output. Always `shell_call_output`.",
- "x-stainless-const": true,
- "default": "shell_call_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the shell call output. Populated when this item is returned via API."
+ "description": "The type of the event. Always `response.content_part.added`.",
+ "x-stainless-const": true
},
- "call_id": {
+ "item_id": {
"type": "string",
- "description": "The unique ID of the shell tool call generated by the model."
+ "description": "The ID of the output item that the content part was added to."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum",
- "description": "The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the content part was added to."
},
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent"
- },
- "description": "An array of shell call output contents"
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that was added."
},
- "max_output_length": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "part": {
+ "$ref": "#/components/schemas/OpenAI.OutputContent",
+ "description": "The content part that was added."
},
- "created_by": {
- "type": "string",
- "description": "The identifier of the actor that created the item."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The output of a shell tool call that was emitted.",
- "title": "Shell call output"
+ "description": "Emitted when a new content part is added.",
+ "x-oaiMeta": {
+ "name": "response.content_part.added",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.content_part.added\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"\",\n \"annotations\": []\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemFunctionToolCall": {
+ "OpenAI.ResponseContentPartDoneEvent": {
"type": "object",
"required": [
- "id",
"type",
- "call_id",
- "name",
- "arguments"
+ "item_id",
+ "output_index",
+ "content_index",
+ "sequence_number",
+ "part"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call"
+ "response.content_part.done"
],
- "description": "The type of the function tool call. Always `function_call`.",
+ "description": "The type of the event. Always `response.content_part.done`.",
"x-stainless-const": true
},
- "call_id": {
+ "item_id": {
"type": "string",
- "description": "The unique ID of the function tool call generated by the model."
+ "description": "The ID of the output item that the content part was added to."
},
- "namespace": {
- "type": "string",
- "description": "The namespace of the function to run."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the content part was added to."
},
- "name": {
- "type": "string",
- "description": "The name of the function to run."
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that is done."
},
- "arguments": {
- "type": "string",
- "description": "A JSON string of the arguments to pass to the function."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "part": {
+ "$ref": "#/components/schemas/OpenAI.OutputContent",
+ "description": "The content part that is done."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.",
- "title": "Function tool call"
+ "description": "Emitted when a content part is done.",
+ "x-oaiMeta": {
+ "name": "response.content_part.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.content_part.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"sequence_number\": 1,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n}\n"
+ }
},
- "OpenAI.OutputItemFunctionToolCallOutput": {
+ "OpenAI.ResponseCreatedEvent": {
"type": "object",
"required": [
- "id",
"type",
- "call_id",
- "output"
+ "response",
+ "sequence_number"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API.",
- "readOnly": true
- },
"type": {
"type": "string",
"enum": [
- "function_call_output"
+ "response.created"
],
- "description": "The type of the function tool call output. Always `function_call_output`.",
+ "description": "The type of the event. Always `response.created`.",
"x-stainless-const": true
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the function tool call generated by the model."
- },
- "output": {
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput"
- }
- }
- ],
- "description": "The output from the function call generated by your code.\n Can be a string or an list of output content."
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The response that was created."
},
- "status": {
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number for this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The output of a function tool call.",
- "title": "Function tool call output"
+ "description": "An event that is emitted when a response is created.",
+ "x-oaiMeta": {
+ "name": "response.created",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.created\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemImageGenToolCall": {
+ "OpenAI.ResponseCustomToolCallInputDeltaEvent": {
"type": "object",
"required": [
"type",
- "id",
- "status",
- "result"
+ "sequence_number",
+ "output_index",
+ "item_id",
+ "delta"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "image_generation_call"
+ "response.custom_tool_call_input.delta"
],
- "description": "The type of the image generation call. Always `image_generation_call`.",
+ "description": "The event type identifier.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the image generation call."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "status": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output this delta applies to."
+ },
+ "item_id": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "generating",
- "failed"
- ],
- "description": "The status of the image generation call."
+ "description": "Unique identifier for the API item associated with this event."
},
- "result": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "delta": {
+ "type": "string",
+ "description": "The incremental input data (delta) for the custom tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "An image generation request made by the model.",
- "title": "Image generation call"
+ "description": "Event representing a delta (partial update) to the input of a custom tool call.",
+ "title": "ResponseCustomToolCallInputDelta",
+ "x-oaiMeta": {
+ "name": "response.custom_tool_call_input.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.custom_tool_call_input.delta\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"delta\": \"partial input text\"\n}\n"
+ }
},
- "OpenAI.OutputItemLocalShellToolCall": {
+ "OpenAI.ResponseCustomToolCallInputDoneEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "action",
- "status"
+ "sequence_number",
+ "output_index",
+ "item_id",
+ "input"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call"
+ "response.custom_tool_call_input.done"
],
- "description": "The type of the local shell call. Always `local_shell_call`.",
+ "description": "The event type identifier.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell call."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "call_id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output this event applies to."
},
- "action": {
- "$ref": "#/components/schemas/OpenAI.LocalShellExecAction"
+ "item_id": {
+ "type": "string",
+ "description": "Unique identifier for the API item associated with this event."
},
- "status": {
+ "input": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the local shell call."
+ "description": "The complete input data for the custom tool call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A tool call to run a command on the local shell.",
- "title": "Local shell call"
+ "description": "Event indicating that input for a custom tool call is complete.",
+ "title": "ResponseCustomToolCallInputDone",
+ "x-oaiMeta": {
+ "name": "response.custom_tool_call_input.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.custom_tool_call_input.done\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"input\": \"final complete input text\"\n}\n"
+ }
},
- "OpenAI.OutputItemLocalShellToolCallOutput": {
+ "OpenAI.ResponseError": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "$ref": "#/components/schemas/OpenAI.ResponseErrorCode"
+ },
+ "message": {
+ "type": "string",
+ "description": "A human-readable description of the error."
+ }
+ },
+ "description": "An error object returned when the model fails to generate a Response."
+ },
+ "OpenAI.ResponseErrorCode": {
+ "type": "string",
+ "enum": [
+ "server_error",
+ "rate_limit_exceeded",
+ "invalid_prompt",
+ "vector_store_timeout",
+ "invalid_image",
+ "invalid_image_format",
+ "invalid_base64_image",
+ "invalid_image_url",
+ "image_too_large",
+ "image_too_small",
+ "image_parse_error",
+ "image_content_policy_violation",
+ "invalid_image_mode",
+ "image_file_too_large",
+ "unsupported_image_media_type",
+ "empty_image_file",
+ "failed_to_download_image",
+ "image_file_not_found"
+ ],
+ "description": "The error code for the response."
+ },
+ "OpenAI.ResponseErrorEvent": {
"type": "object",
"required": [
"type",
- "id",
- "output"
+ "code",
+ "message",
+ "param",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "local_shell_call_output"
+ "error"
],
- "description": "The type of the local shell tool call output. Always `local_shell_call_output`.",
+ "description": "The type of the event. Always `error`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the local shell tool call generated by the model."
+ "code": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "output": {
+ "message": {
"type": "string",
- "description": "A JSON string of the output of the local shell tool call."
+ "description": "The error message."
},
- "status": {
+ "param": {
"anyOf": [
{
- "type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ]
+ "type": "string"
},
{
"type": "null"
}
]
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The output of a local shell tool call.",
- "title": "Local shell call output"
+ "description": "Emitted when an error occurs.",
+ "x-oaiMeta": {
+ "name": "error",
+ "group": "responses",
+ "example": "{\n \"type\": \"error\",\n \"code\": \"ERR_SOMETHING\",\n \"message\": \"Something went wrong\",\n \"param\": null,\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemMcpApprovalRequest": {
+ "OpenAI.ResponseFailedEvent": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "sequence_number",
+ "response"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_request"
+ "response.failed"
],
- "description": "The type of the item. Always `mcp_approval_request`.",
+ "description": "The type of the event. Always `response.failed`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the approval request."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server making the request."
- },
- "name": {
- "type": "string",
- "description": "The name of the tool to run."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "arguments": {
- "type": "string",
- "description": "A JSON string of arguments for the tool."
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The response that failed."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A request for human approval of a tool invocation.",
- "title": "MCP approval request"
+ "description": "An event that is emitted when a response fails.",
+ "x-oaiMeta": {
+ "name": "response.failed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.failed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"failed\",\n \"completed_at\": null,\n \"error\": {\n \"code\": \"server_error\",\n \"message\": \"The model failed to generate a response.\"\n },\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n }\n}\n"
+ }
},
- "OpenAI.OutputItemMcpApprovalResponseResource": {
+ "OpenAI.ResponseFileSearchCallCompletedEvent": {
"type": "object",
"required": [
"type",
- "id",
- "approval_request_id",
- "approve"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_approval_response"
+ "response.file_search_call.completed"
],
- "description": "The type of the item. Always `mcp_approval_response`.",
+ "description": "The type of the event. Always `response.file_search_call.completed`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the approval response"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the file search call is initiated."
},
- "approval_request_id": {
+ "item_id": {
"type": "string",
- "description": "The ID of the approval request being answered."
- },
- "approve": {
- "type": "boolean",
- "description": "Whether the request was approved."
+ "description": "The ID of the output item that the file search call is initiated."
},
- "reason": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A response to an MCP approval request.",
- "title": "MCP approval response"
+ "description": "Emitted when a file search call is completed (results found).",
+ "x-oaiMeta": {
+ "name": "response.file_search_call.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.file_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemMcpListTools": {
+ "OpenAI.ResponseFileSearchCallInProgressEvent": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "tools"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_list_tools"
+ "response.file_search_call.in_progress"
],
- "description": "The type of the item. Always `mcp_list_tools`.",
+ "description": "The type of the event. Always `response.file_search_call.in_progress`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the list."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the file search call is initiated."
},
- "server_label": {
+ "item_id": {
"type": "string",
- "description": "The label of the MCP server."
- },
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.MCPListToolsTool"
- },
- "description": "The tools available on the server."
+ "description": "The ID of the output item that the file search call is initiated."
},
- "error": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A list of tools available on an MCP server.",
- "title": "MCP list tools"
+ "description": "Emitted when a file search call is initiated.",
+ "x-oaiMeta": {
+ "name": "response.file_search_call.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.file_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemMcpToolCall": {
+ "OpenAI.ResponseFileSearchCallSearchingEvent": {
"type": "object",
"required": [
"type",
- "id",
- "server_label",
- "name",
- "arguments"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "mcp_call"
+ "response.file_search_call.searching"
],
- "description": "The type of the item. Always `mcp_call`.",
+ "description": "The type of the event. Always `response.file_search_call.searching`.",
"x-stainless-const": true
},
- "id": {
- "type": "string",
- "description": "The unique ID of the tool call."
- },
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server running the tool."
- },
- "name": {
- "type": "string",
- "description": "The name of the tool that was run."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the file search call is searching."
},
- "arguments": {
+ "item_id": {
"type": "string",
- "description": "A JSON string of the arguments passed to the tool."
- },
- "output": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "error": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "status": {
- "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus",
- "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`."
+ "description": "The ID of the output item that the file search call is initiated."
},
- "approval_request_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "An invocation of a tool on an MCP server.",
- "title": "MCP tool call"
+ "description": "Emitted when a file search is currently searching.",
+ "x-oaiMeta": {
+ "name": "response.file_search_call.searching",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.file_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemOutputMessage": {
+ "OpenAI.ResponseFormatJsonObject": {
"type": "object",
"required": [
- "id",
- "type",
- "role",
- "content",
- "status"
+ "type"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the output message."
- },
"type": {
"type": "string",
"enum": [
- "output_message"
+ "json_object"
],
- "description": "The type of the output message. Always `message`.",
+ "description": "The type of response format being defined. Always `json_object`.",
"x-stainless-const": true
- },
- "role": {
+ }
+ },
+ "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
+ "title": "JSON object"
+ },
+ "OpenAI.ResponseFormatJsonSchema": {
+ "type": "object",
+ "required": [
+ "type",
+ "json_schema"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "assistant"
+ "json_schema"
],
- "description": "The role of the output message. Always `assistant`.",
+ "description": "The type of response format being defined. Always `json_schema`.",
"x-stainless-const": true
},
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
- },
- "description": "The content of the output message."
+ "json_schema": {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema",
+ "description": "Structured Outputs configuration options, including a JSON Schema.",
+ "title": "JSON schema"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
+ }
+ ],
+ "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).",
+ "title": "JSON schema"
+ },
+ "OpenAI.ResponseFormatJsonSchemaJsonSchema": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
},
- "phase": {
+ "name": {
+ "type": "string"
+ },
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema"
+ },
+ "strict": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.MessagePhase"
+ "type": "boolean"
},
{
"type": "null"
}
]
- },
- "status": {
+ }
+ }
+ },
+ "OpenAI.ResponseFormatJsonSchemaSchema": {
+ "type": "object",
+ "unevaluatedProperties": {},
+ "description": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).",
+ "title": "JSON schema"
+ },
+ "OpenAI.ResponseFormatText": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "in_progress",
- "completed",
- "incomplete"
+ "text"
],
- "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API."
+ "description": "The type of response format being defined. Always `text`.",
+ "x-stainless-const": true
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ],
- "description": "An output message from the model.",
- "title": "Output message"
+ "description": "Default response format. Used to generate text responses.",
+ "title": "Text"
},
- "OpenAI.OutputItemReasoningItem": {
+ "OpenAI.ResponseFunctionCallArgumentsDeltaEvent": {
"type": "object",
"required": [
"type",
- "id",
- "summary"
+ "item_id",
+ "output_index",
+ "sequence_number",
+ "delta"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "reasoning"
+ "response.function_call_arguments.delta"
],
- "description": "The type of the object. Always `reasoning`.",
+ "description": "The type of the event. Always `response.function_call_arguments.delta`.",
"x-stainless-const": true
},
- "id": {
+ "item_id": {
"type": "string",
- "description": "The unique identifier of the reasoning content."
- },
- "encrypted_content": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The ID of the output item that the function-call arguments delta is added to."
},
- "summary": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.SummaryTextContent"
- },
- "description": "Reasoning summary content."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the function-call arguments delta is added to."
},
- "content": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ReasoningTextContent"
- },
- "description": "Reasoning text content."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "status": {
+ "delta": {
"type": "string",
- "enum": [
- "in_progress",
- "completed",
- "incomplete"
- ],
- "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API."
+ "description": "The function-call arguments delta that is added."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).",
- "title": "Reasoning"
+ "description": "Emitted when there is a partial function-call arguments delta.",
+ "x-oaiMeta": {
+ "name": "response.function_call_arguments.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.function_call_arguments.delta\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"delta\": \"{ \"arg\":\"\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemToolSearchCall": {
+ "OpenAI.ResponseFunctionCallArgumentsDoneEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "execution",
- "arguments",
- "status"
+ "item_id",
+ "name",
+ "output_index",
+ "sequence_number",
+ "arguments"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_search_call"
+ "response.function_call_arguments.done"
],
- "description": "The type of the item. Always `tool_search_call`.",
- "x-stainless-const": true,
- "default": "tool_search_call"
+ "x-stainless-const": true
},
- "id": {
+ "item_id": {
"type": "string",
- "description": "The unique ID of the tool search call item."
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "description": "The ID of the item."
},
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
+ "name": {
+ "type": "string",
+ "description": "The name of the function that was called."
},
- "arguments": {
- "description": "Arguments used for the tool search call."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallStatus",
- "description": "The status of the tool search call item that was recorded."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "created_by": {
+ "arguments": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "The function-call arguments."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
- ]
+ ],
+ "description": "Emitted when function-call arguments are finalized.",
+ "x-oaiMeta": {
+ "name": "response.function_call_arguments.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.function_call_arguments.done\",\n \"item_id\": \"item-abc\",\n \"name\": \"get_weather\",\n \"output_index\": 1,\n \"arguments\": \"{ \"arg\": 123 }\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemToolSearchOutput": {
+ "OpenAI.ResponseImageGenCallCompletedEvent": {
"type": "object",
"required": [
"type",
- "id",
- "call_id",
- "execution",
- "tools",
- "status"
+ "output_index",
+ "sequence_number",
+ "item_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_search_output"
+ "response.image_generation_call.completed"
],
- "description": "The type of the item. Always `tool_search_output`.",
- "x-stainless-const": true,
- "default": "tool_search_output"
- },
- "id": {
- "type": "string",
- "description": "The unique ID of the tool search output item."
- },
- "call_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search was executed by the server or by the client."
+ "description": "The type of the event. Always 'response.image_generation_call.completed'.",
+ "x-stainless-const": true
},
- "tools": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "The loaded tool definitions returned by tool search."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "status": {
- "$ref": "#/components/schemas/OpenAI.FunctionCallOutputStatusEnum",
- "description": "The status of the tool search output item that was recorded."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "created_by": {
+ "item_id": {
"type": "string",
- "description": "The identifier of the actor that created the item."
+ "description": "The unique identifier of the image generation item being processed."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- }
- ]
- },
- "OpenAI.OutputItemType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "output_message",
- "file_search_call",
- "function_call",
- "function_call_output",
- "web_search_call",
- "computer_call",
- "computer_call_output",
- "reasoning",
- "tool_search_call",
- "tool_search_output",
- "additional_tools",
- "compaction",
- "image_generation_call",
- "code_interpreter_call",
- "local_shell_call",
- "local_shell_call_output",
- "shell_call",
- "shell_call_output",
- "apply_patch_call",
- "apply_patch_call_output",
- "mcp_call",
- "mcp_list_tools",
- "mcp_approval_request",
- "mcp_approval_response",
- "custom_tool_call",
- "custom_tool_call_output",
- "structured_outputs",
- "oauth_consent_request",
- "memory_search_call",
- "memory_command_preview_call",
- "memory_command_preview_call_output",
- "workflow_action",
- "a2a_preview_call",
- "a2a_preview_call_output",
- "bing_grounding_call",
- "bing_grounding_call_output",
- "sharepoint_grounding_preview_call",
- "sharepoint_grounding_preview_call_output",
- "azure_ai_search_call",
- "azure_ai_search_call_output",
- "bing_custom_search_preview_call",
- "bing_custom_search_preview_call_output",
- "openapi_call",
- "openapi_call_output",
- "browser_automation_preview_call",
- "browser_automation_preview_call_output",
- "fabric_dataagent_preview_call",
- "fabric_dataagent_preview_call_output",
- "azure_function_call",
- "azure_function_call_output"
- ]
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
- ]
+ ],
+ "description": "Emitted when an image generation tool call has completed and the final image is available.",
+ "title": "ResponseImageGenCallCompletedEvent",
+ "x-oaiMeta": {
+ "name": "response.image_generation_call.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.image_generation_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputItemWebSearchToolCall": {
+ "OpenAI.ResponseImageGenCallGeneratingEvent": {
"type": "object",
"required": [
- "id",
"type",
- "status",
- "action"
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
- "id": {
- "type": "string",
- "description": "The unique ID of the web search tool call."
- },
"type": {
"type": "string",
"enum": [
- "web_search_call"
+ "response.image_generation_call.generating"
],
- "description": "The type of the web search tool call. Always `web_search_call`.",
+ "description": "The type of the event. Always 'response.image_generation_call.generating'.",
"x-stainless-const": true
},
- "status": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
+ },
+ "item_id": {
"type": "string",
- "enum": [
- "in_progress",
- "searching",
- "completed",
- "failed",
- "incomplete"
- ],
- "description": "The status of the web search tool call."
+ "description": "The unique identifier of the image generation item being processed."
},
- "action": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage"
- },
- {
- "$ref": "#/components/schemas/OpenAI.WebSearchActionFind"
- }
- ],
- "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find_in_page)."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the image generation item being processed."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputItem"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.",
- "title": "Web search tool call"
+ "description": "Emitted when an image generation tool call is actively generating an image (intermediate state).",
+ "title": "ResponseImageGenCallGeneratingEvent",
+ "x-oaiMeta": {
+ "name": "response.image_generation_call.generating",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.image_generation_call.generating\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n"
+ }
},
- "OpenAI.OutputMessageContent": {
+ "OpenAI.ResponseImageGenCallInProgressEvent": {
"type": "object",
"required": [
- "type"
+ "type",
+ "output_index",
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.OutputMessageContentType"
+ "type": "string",
+ "enum": [
+ "response.image_generation_call.in_progress"
+ ],
+ "description": "The type of the event. Always 'response.image_generation_call.in_progress'.",
+ "x-stainless-const": true
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
+ },
+ "item_id": {
+ "type": "string",
+ "description": "The unique identifier of the image generation item being processed."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the image generation item being processed."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "output_text": "#/components/schemas/OpenAI.OutputMessageContentOutputTextContent",
- "refusal": "#/components/schemas/OpenAI.OutputMessageContentRefusalContent"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
+ ],
+ "description": "Emitted when an image generation tool call is in progress.",
+ "title": "ResponseImageGenCallInProgressEvent",
+ "x-oaiMeta": {
+ "name": "response.image_generation_call.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.image_generation_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n"
}
},
- "OpenAI.OutputMessageContentOutputTextContent": {
+ "OpenAI.ResponseImageGenCallPartialImageEvent": {
"type": "object",
"required": [
"type",
- "text",
- "annotations",
- "logprobs"
+ "output_index",
+ "item_id",
+ "sequence_number",
+ "partial_image_index",
+ "partial_image_b64"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "output_text"
+ "response.image_generation_call.partial_image"
],
- "description": "The type of the output text. Always `output_text`.",
- "x-stainless-const": true,
- "default": "output_text"
+ "description": "The type of the event. Always 'response.image_generation_call.partial_image'.",
+ "x-stainless-const": true
},
- "text": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
+ },
+ "item_id": {
"type": "string",
- "description": "The text output from the model."
+ "description": "The unique identifier of the image generation item being processed."
},
- "annotations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Annotation"
- },
- "description": "The annotations of the text output."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the image generation item being processed."
},
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.LogProb"
- }
+ "partial_image_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "0-based index for the partial image (backend is 1-based, but this is 0-based for the user)."
+ },
+ "partial_image_b64": {
+ "type": "string",
+ "description": "Base64-encoded partial image data, suitable for rendering as an image."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A text output from the model.",
- "title": "Output text"
+ "description": "Emitted when a partial image is available during image generation streaming.",
+ "title": "ResponseImageGenCallPartialImageEvent",
+ "x-oaiMeta": {
+ "name": "response.image_generation_call.partial_image",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.image_generation_call.partial_image\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0,\n \"partial_image_index\": 0,\n \"partial_image_b64\": \"...\"\n}\n"
+ }
},
- "OpenAI.OutputMessageContentRefusalContent": {
+ "OpenAI.ResponseInProgressEvent": {
"type": "object",
"required": [
"type",
- "refusal"
+ "response",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "refusal"
+ "response.in_progress"
],
- "description": "The type of the refusal. Always `refusal`.",
- "x-stainless-const": true,
- "default": "refusal"
+ "description": "The type of the event. Always `response.in_progress`.",
+ "x-stainless-const": true
},
- "refusal": {
- "type": "string",
- "description": "The refusal explanation from the model."
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The response that is in progress."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.OutputMessageContent"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "A refusal from the model.",
- "title": "Refusal"
+ "description": "Emitted when the response is in progress.",
+ "x-oaiMeta": {
+ "name": "response.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.in_progress\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.OutputMessageContentType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
+ "OpenAI.ResponseIncompleteDetails": {
+ "type": "object",
+ "properties": {
+ "reason": {
"type": "string",
"enum": [
- "output_text",
- "refusal"
+ "max_output_tokens",
+ "content_filter"
]
}
- ]
+ }
},
- "OpenAI.Prompt": {
+ "OpenAI.ResponseIncompleteEvent": {
"type": "object",
"required": [
- "id"
+ "type",
+ "response",
+ "sequence_number"
],
"properties": {
- "id": {
+ "type": {
"type": "string",
- "description": "The unique identifier of the prompt template to use."
+ "enum": [
+ "response.incomplete"
+ ],
+ "description": "The type of the event. Always `response.incomplete`.",
+ "x-stainless-const": true
},
- "version": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The response that was incomplete."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "An event that is emitted when a response finishes as incomplete.",
+ "x-oaiMeta": {
+ "name": "response.incomplete",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.incomplete\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"incomplete\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": {\n \"reason\": \"max_tokens\"\n },\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ }
+ },
+ "OpenAI.ResponseLogProb": {
+ "type": "object",
+ "required": [
+ "token",
+ "logprob"
+ ],
+ "properties": {
+ "token": {
+ "type": "string",
+ "description": "A possible text token."
+ },
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "The log probability of this token."
},
- "variables": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponsePromptVariables"
- },
- {
- "type": "null"
- }
- ]
+ "top_logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ResponseLogProbTopLogprobs"
+ },
+ "description": "The log probabilities of up to 20 of the most likely tokens."
}
},
- "description": "Reference to a prompt template and its variables.\n[Learn more](/docs/guides/text?api-mode=responses#reusable-prompts)."
- },
- "OpenAI.PromptCacheRetentionEnum": {
- "type": "string",
- "enum": [
- "in_memory",
- "24h"
- ]
- },
- "OpenAI.RankerVersionType": {
- "type": "string",
- "enum": [
- "auto",
- "default-2024-11-15"
- ]
+ "description": "A logprob is the logarithmic probability that the model assigns to producing\na particular token at a given position in the sequence. Less-negative (higher)\nlogprob values indicate greater model confidence in that token choice."
},
- "OpenAI.RankingOptions": {
+ "OpenAI.ResponseLogProbTopLogprobs": {
"type": "object",
"properties": {
- "ranker": {
- "$ref": "#/components/schemas/OpenAI.RankerVersionType",
- "description": "The ranker to use for the file search."
- },
- "score_threshold": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "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."
+ "token": {
+ "type": "string"
},
- "hybrid_search": {
- "$ref": "#/components/schemas/OpenAI.HybridSearchOptions",
- "description": "Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled."
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
}
}
},
- "OpenAI.RealtimeMCPError": {
+ "OpenAI.ResponseMCPCallArgumentsDeltaEvent": {
"type": "object",
"required": [
- "type"
+ "type",
+ "output_index",
+ "item_id",
+ "delta",
+ "sequence_number"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.RealtimeMcpErrorType"
+ "type": "string",
+ "enum": [
+ "response.mcp_call_arguments.delta"
+ ],
+ "description": "The type of the event. Always 'response.mcp_call_arguments.delta'.",
+ "x-stainless-const": true
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
+ },
+ "item_id": {
+ "type": "string",
+ "description": "The unique identifier of the MCP tool call item being processed."
+ },
+ "delta": {
+ "type": "string",
+ "description": "A JSON string containing the partial update to the arguments for the MCP tool call."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "protocol_error": "#/components/schemas/OpenAI.RealtimeMCPProtocolError",
- "tool_execution_error": "#/components/schemas/OpenAI.RealtimeMCPToolExecutionError",
- "http_error": "#/components/schemas/OpenAI.RealtimeMCPHTTPError"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
+ ],
+ "description": "Emitted when there is a delta (partial update) to the arguments of an MCP tool call.",
+ "title": "ResponseMCPCallArgumentsDeltaEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call_arguments.delta",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call_arguments.delta\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"delta\": \"{\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.RealtimeMCPHTTPError": {
+ "OpenAI.ResponseMCPCallArgumentsDoneEvent": {
"type": "object",
"required": [
"type",
- "code",
- "message"
+ "output_index",
+ "item_id",
+ "arguments",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "http_error"
+ "response.mcp_call_arguments.done"
],
+ "description": "The type of the event. Always 'response.mcp_call_arguments.done'.",
"x-stainless-const": true
},
- "code": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "message": {
- "type": "string"
+ "item_id": {
+ "type": "string",
+ "description": "The unique identifier of the MCP tool call item being processed."
+ },
+ "arguments": {
+ "type": "string",
+ "description": "A JSON string containing the finalized arguments for the MCP tool call."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "Realtime MCP HTTP error"
+ "description": "Emitted when the arguments for an MCP tool call are finalized.",
+ "title": "ResponseMCPCallArgumentsDoneEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call_arguments.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call_arguments.done\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"arguments\": \"{\"arg1\": \"value1\", \"arg2\": \"value2\"}\",\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.RealtimeMCPProtocolError": {
+ "OpenAI.ResponseMCPCallCompletedEvent": {
"type": "object",
"required": [
"type",
- "code",
- "message"
+ "item_id",
+ "output_index",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "protocol_error"
+ "response.mcp_call.completed"
],
+ "description": "The type of the event. Always 'response.mcp_call.completed'.",
"x-stainless-const": true
},
- "code": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the MCP tool call item that completed."
},
- "message": {
- "type": "string"
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that completed."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "Realtime MCP protocol error"
+ "description": "Emitted when an MCP tool call has completed successfully.",
+ "title": "ResponseMCPCallCompletedEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call.completed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n"
+ }
},
- "OpenAI.RealtimeMCPToolExecutionError": {
+ "OpenAI.ResponseMCPCallFailedEvent": {
"type": "object",
"required": [
"type",
- "message"
+ "item_id",
+ "output_index",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "tool_execution_error"
+ "response.mcp_call.failed"
],
+ "description": "The type of the event. Always 'response.mcp_call.failed'.",
"x-stainless-const": true
},
- "message": {
- "type": "string"
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the MCP tool call item that failed."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that failed."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.RealtimeMCPError"
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "title": "Realtime MCP tool execution error"
- },
- "OpenAI.RealtimeMcpErrorType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "protocol_error",
- "tool_execution_error",
- "http_error"
- ]
- }
- ]
+ "description": "Emitted when an MCP tool call has failed.",
+ "title": "ResponseMCPCallFailedEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call.failed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call.failed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n"
+ }
},
- "OpenAI.Reasoning": {
+ "OpenAI.ResponseMCPCallInProgressEvent": {
"type": "object",
+ "required": [
+ "type",
+ "sequence_number",
+ "output_index",
+ "item_id"
+ ],
"properties": {
- "effort": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ReasoningEffort"
- },
- {
- "type": "null"
- }
- ]
+ "type": {
+ "type": "string",
+ "enum": [
+ "response.mcp_call.in_progress"
+ ],
+ "description": "The type of the event. Always 'response.mcp_call.in_progress'.",
+ "x-stainless-const": true
},
- "summary": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "concise",
- "detailed"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "context": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "current_turn",
- "all_turns"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "generate_summary": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "concise",
- "detailed"
- ]
- },
- {
- "type": "null"
- }
- ]
+ "item_id": {
+ "type": "string",
+ "description": "The unique identifier of the MCP tool call item being processed."
}
},
- "description": "**gpt-5 and o-series models only**\nConfiguration options for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).",
- "title": "Reasoning"
- },
- "OpenAI.ReasoningEffort": {
- "anyOf": [
- {
- "type": "string"
- },
+ "allOf": [
{
- "type": "string",
- "enum": [
- "none",
- "minimal",
- "low",
- "medium",
- "high",
- "xhigh"
- ]
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\n- `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.\n- All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.\n- The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.\n- `xhigh` is supported for all models after `gpt-5.1-codex-max`."
+ "description": "Emitted when an MCP tool call is in progress.",
+ "title": "ResponseMCPCallInProgressEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_call.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_call.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\"\n}\n"
+ }
},
- "OpenAI.ReasoningTextContent": {
+ "OpenAI.ResponseMCPListToolsCompletedEvent": {
"type": "object",
"required": [
"type",
- "text"
+ "item_id",
+ "output_index",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "reasoning_text"
+ "response.mcp_list_tools.completed"
],
- "description": "The type of the reasoning text. Always `reasoning_text`.",
- "x-stainless-const": true,
- "default": "reasoning_text"
+ "description": "The type of the event. Always 'response.mcp_list_tools.completed'.",
+ "x-stainless-const": true
},
- "text": {
+ "item_id": {
"type": "string",
- "description": "The reasoning text from the model."
+ "description": "The ID of the MCP tool call item that produced this output."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that was processed."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
}
},
- "description": "Reasoning text from the model.",
- "title": "Reasoning text"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when the list of available MCP tools has been successfully retrieved.",
+ "title": "ResponseMCPListToolsCompletedEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_list_tools.completed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_list_tools.completed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
+ }
},
- "OpenAI.Response": {
+ "OpenAI.ResponseMCPListToolsFailedEvent": {
"type": "object",
"required": [
- "id",
- "object",
- "created_at",
- "error",
- "incomplete_details",
- "output",
- "instructions",
- "parallel_tool_calls",
- "agent_reference"
+ "type",
+ "item_id",
+ "output_index",
+ "sequence_number"
],
"properties": {
- "metadata": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Metadata"
- },
- {
- "type": "null"
- }
- ]
- },
- "top_logprobs": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "temperature": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "top_p": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "null"
- }
- ],
- "default": 1
- },
- "user": {
- "type": "string",
- "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).",
- "deprecated": true
- },
- "safety_identifier": {
- "type": "string",
- "maxLength": 64,
- "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers)."
- },
- "prompt_cache_key": {
- "type": "string",
- "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching)."
- },
- "service_tier": {
- "$ref": "#/components/schemas/OpenAI.ServiceTier"
- },
- "prompt_cache_retention": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "in_memory",
- "24h"
- ]
- },
- {
- "type": "null"
- }
- ]
- },
- "previous_response_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "model": {
- "type": "string",
- "description": "The model deployment to use for the creation of this response."
- },
- "background": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "max_tool_calls": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "text": {
- "$ref": "#/components/schemas/OpenAI.ResponseTextParam"
- },
- "tools": {
- "$ref": "#/components/schemas/OpenAI.ToolsArray"
- },
- "tool_choice": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions"
- },
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ]
- },
- "prompt": {
- "$ref": "#/components/schemas/OpenAI.Prompt"
- },
- "truncation": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "auto",
- "disabled"
- ]
- },
- {
- "type": "null"
- }
+ "type": {
+ "type": "string",
+ "enum": [
+ "response.mcp_list_tools.failed"
],
- "default": "disabled"
+ "description": "The type of the event. Always 'response.mcp_list_tools.failed'.",
+ "x-stainless-const": true
},
- "id": {
+ "item_id": {
"type": "string",
- "description": "Unique identifier for this Response."
+ "description": "The ID of the MCP tool call item that failed."
},
- "object": {
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that failed."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when the attempt to list available MCP tools has failed.",
+ "title": "ResponseMCPListToolsFailedEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_list_tools.failed",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_list_tools.failed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
+ }
+ },
+ "OpenAI.ResponseMCPListToolsInProgressEvent": {
+ "type": "object",
+ "required": [
+ "type",
+ "item_id",
+ "output_index",
+ "sequence_number"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "response"
+ "response.mcp_list_tools.in_progress"
],
- "description": "The object type of this resource - always set to `response`.",
+ "description": "The type of the event. Always 'response.mcp_list_tools.in_progress'.",
"x-stainless-const": true
},
- "status": {
+ "item_id": {
"type": "string",
- "enum": [
- "completed",
- "failed",
- "in_progress",
- "cancelled",
- "queued",
- "incomplete"
- ],
- "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`."
+ "description": "The ID of the MCP tool call item that is being processed."
},
- "created_at": {
- "type": "integer",
- "format": "unixtime",
- "description": "Unix timestamp (in seconds) of when this Response was created."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that is being processed."
},
- "completed_at": {
- "anyOf": [
- {
- "type": "string",
- "format": "date-time"
- },
- {
- "type": "null"
- }
- ],
- "type": "integer",
- "format": "unixTimestamp"
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when the system is in the process of retrieving the list of available MCP tools.",
+ "title": "ResponseMCPListToolsInProgressEvent",
+ "x-oaiMeta": {
+ "name": "response.mcp_list_tools.in_progress",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.mcp_list_tools.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
+ }
+ },
+ "OpenAI.ResponseModalities": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "text",
+ "audio"
+ ]
+ }
},
- "error": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseError"
- },
- {
- "type": "null"
- }
- ]
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Output types that you would like the model to generate.\nMost models are capable of generating text, which is the default:\n`[\"text\"]`\nThe `gpt-4o-audio-preview` model can also be used to\n[generate audio](/docs/guides/audio). To request that this model generate\nboth text and audio responses, you can use:\n`[\"text\", \"audio\"]`"
+ },
+ "OpenAI.ResponseOutputItemAddedEvent": {
+ "type": "object",
+ "required": [
+ "type",
+ "output_index",
+ "sequence_number",
+ "item"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "response.output_item.added"
+ ],
+ "description": "The type of the event. Always `response.output_item.added`.",
+ "x-stainless-const": true
},
- "incomplete_details": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails"
- },
- {
- "type": "null"
- }
- ]
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that was added."
},
- "output": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.OutputItem"
- },
- "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "reasoning": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Reasoning"
- },
- {
- "type": "null"
- }
- ]
+ "item": {
+ "$ref": "#/components/schemas/OpenAI.OutputItem",
+ "description": "The output item that was added."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when a new output item is added.",
+ "x-oaiMeta": {
+ "name": "response.output_item.added",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.output_item.added\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"in_progress\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": []\n },\n \"sequence_number\": 1\n}\n"
+ }
+ },
+ "OpenAI.ResponseOutputItemDoneEvent": {
+ "type": "object",
+ "required": [
+ "type",
+ "output_index",
+ "sequence_number",
+ "item"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "response.output_item.done"
+ ],
+ "description": "The type of the event. Always `response.output_item.done`.",
+ "x-stainless-const": true
},
- "instructions": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.InputItem"
- }
- },
- {
- "type": "null"
- }
- ]
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that was marked done."
},
- "output_text": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "usage": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsage"
+ "item": {
+ "$ref": "#/components/schemas/OpenAI.OutputItem",
+ "description": "The output item that was marked done."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when an output item is marked done.",
+ "x-oaiMeta": {
+ "name": "response.output_item.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.output_item.done\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"completed\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n ]\n },\n \"sequence_number\": 1\n}\n"
+ }
+ },
+ "OpenAI.ResponseOutputTextAnnotationAddedEvent": {
+ "type": "object",
+ "required": [
+ "type",
+ "item_id",
+ "output_index",
+ "content_index",
+ "annotation_index",
+ "sequence_number",
+ "annotation"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "response.output_text.annotation.added"
+ ],
+ "description": "The type of the event. Always 'response.output_text.annotation.added'.",
+ "x-stainless-const": true
},
- "moderation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Moderation"
- },
- {
- "type": "null"
- }
- ]
+ "item_id": {
+ "type": "string",
+ "description": "The unique identifier of the item to which the annotation is being added."
},
- "parallel_tool_calls": {
- "type": "boolean",
- "description": "Whether to allow the model to run tool calls in parallel.",
- "default": true
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item in the response's output array."
},
- "conversation": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ConversationReference"
- },
- {
- "type": "null"
- }
- ]
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part within the output item."
},
- "max_output_tokens": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OpenAI.integer"
- },
- {
- "type": "null"
- }
- ]
+ "annotation_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the annotation within the content part."
},
- "agent": {
- "$ref": "#/components/schemas/AgentId",
- "description": "(Deprecated) Use agent_reference instead.\nThe agent used for this response"
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of this event."
},
- "agent_session_id": {
+ "annotation": {
+ "$ref": "#/components/schemas/OpenAI.Annotation",
+ "description": "The annotation object being added. (See annotation schema for details.)"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when an annotation is added to output text content.",
+ "title": "ResponseOutputTextAnnotationAddedEvent",
+ "x-oaiMeta": {
+ "name": "response.output_text.annotation.added",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.output_text.annotation.added\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"annotation_index\": 0,\n \"annotation\": {\n \"type\": \"text_annotation\",\n \"text\": \"This is a test annotation\",\n \"start\": 0,\n \"end\": 10\n },\n \"sequence_number\": 1\n}\n"
+ }
+ },
+ "OpenAI.ResponsePromptVariables": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputTextContent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputImageContent"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.InputFileContent"
+ }
+ ]
+ },
+ "description": "Optional map of values to substitute in for variables in your\nprompt. The substitution values can either be strings, or other\nResponse input types like images or files.",
+ "title": "Prompt Variables",
+ "x-oaiExpandable": true,
+ "x-oaiTypeLabel": "map"
+ },
+ "OpenAI.ResponseQueuedEvent": {
+ "type": "object",
+ "required": [
+ "type",
+ "response",
+ "sequence_number"
+ ],
+ "properties": {
+ "type": {
"type": "string",
- "description": "The session identifier for this response. Currently only relevant for hosted agents.\nAlways returned for hosted agents — either the caller-provided value, the auto-derived value,\nor an auto-generated UUID. Use for session-scoped operations and to maintain sandbox\naffinity in follow-up calls."
- },
- "agent_reference": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/AgentReference"
- },
- {
- "type": "null"
- }
+ "enum": [
+ "response.queued"
],
- "description": "The agent used for this response"
+ "description": "The type of the event. Always 'response.queued'.",
+ "x-stainless-const": true
},
- "content_filters": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ContentFilterResult"
- },
- "description": "The content filter evaluation results."
+ "response": {
+ "$ref": "#/components/schemas/OpenAI.Response",
+ "description": "The full response object that is queued."
+ },
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number for this event."
}
},
- "title": "The response object"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ }
+ ],
+ "description": "Emitted when a response is queued and waiting to be processed.",
+ "title": "ResponseQueuedEvent",
+ "x-oaiMeta": {
+ "name": "response.queued",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.queued\",\n \"response\": {\n \"id\": \"res_123\",\n \"status\": \"queued\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n },\n \"sequence_number\": 1\n}\n"
+ }
},
- "OpenAI.ResponseAudioDeltaEvent": {
+ "OpenAI.ResponseReasoningSummaryPartAddedEvent": {
"type": "object",
"required": [
"type",
+ "item_id",
+ "output_index",
+ "summary_index",
"sequence_number",
- "delta"
+ "part"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.audio.delta"
+ "response.reasoning_summary_part.added"
],
- "description": "The type of the event. Always `response.audio.delta`.",
+ "description": "The type of the event. Always `response.reasoning_summary_part.added`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this summary part is associated with."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item this summary part is associated with."
+ },
+ "summary_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the summary part within the reasoning summary."
+ },
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "A sequence number for this chunk of the stream response."
+ "description": "The sequence number of this event."
},
- "delta": {
- "type": "string",
- "contentEncoding": "base64",
- "description": "A chunk of Base64 encoded response audio bytes."
+ "part": {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart",
+ "description": "The summary part that was added."
}
},
"allOf": [
@@ -49331,49 +70970,110 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when there is a partial audio response.",
+ "description": "Emitted when a new reasoning summary part is added.",
"x-oaiMeta": {
- "name": "response.audio.delta",
+ "name": "response.reasoning_summary_part.added",
"group": "responses",
- "example": "{\n \"type\": \"response.audio.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \"base64encoded...\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_summary_part.added\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"\"\n },\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseAudioDoneEvent": {
+ "OpenAI.ResponseReasoningSummaryPartAddedEventPart": {
"type": "object",
"required": [
"type",
- "sequence_number"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.audio.done"
+ "summary_text"
],
- "description": "The type of the event. Always `response.audio.done`.",
"x-stainless-const": true
},
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.ResponseReasoningSummaryPartDoneEvent": {
+ "type": "object",
+ "required": [
+ "type",
+ "item_id",
+ "output_index",
+ "summary_index",
+ "sequence_number",
+ "part"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "response.reasoning_summary_part.done"
+ ],
+ "description": "The type of the event. Always `response.reasoning_summary_part.done`.",
+ "x-stainless-const": true
+ },
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this summary part is associated with."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item this summary part is associated with."
+ },
+ "summary_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the summary part within the reasoning summary."
+ },
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the delta."
+ "description": "The sequence number of this event."
+ },
+ "part": {
+ "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEventPart",
+ "description": "The completed summary part."
}
},
"allOf": [
{
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
- ],
- "description": "Emitted when the audio response is complete.",
- "x-oaiMeta": {
- "name": "response.audio.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.audio.done\",\n \"response_id\": \"resp-123\",\n \"sequence_number\": 1\n}\n"
+ ],
+ "description": "Emitted when a reasoning summary part is completed.",
+ "x-oaiMeta": {
+ "name": "response.reasoning_summary_part.done",
+ "group": "responses",
+ "example": "{\n \"type\": \"response.reasoning_summary_part.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\"\n },\n \"sequence_number\": 1\n}\n"
+ }
+ },
+ "OpenAI.ResponseReasoningSummaryPartDoneEventPart": {
+ "type": "object",
+ "required": [
+ "type",
+ "text"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "summary_text"
+ ],
+ "x-stainless-const": true
+ },
+ "text": {
+ "type": "string"
+ }
}
},
- "OpenAI.ResponseAudioTranscriptDeltaEvent": {
+ "OpenAI.ResponseReasoningSummaryTextDeltaEvent": {
"type": "object",
"required": [
"type",
+ "item_id",
+ "output_index",
+ "summary_index",
"delta",
"sequence_number"
],
@@ -49381,14 +71081,26 @@
"type": {
"type": "string",
"enum": [
- "response.audio.transcript.delta"
+ "response.reasoning_summary_text.delta"
],
- "description": "The type of the event. Always `response.audio.transcript.delta`.",
+ "description": "The type of the event. Always `response.reasoning_summary_text.delta`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this summary text delta is associated with."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item this summary text delta is associated with."
+ },
+ "summary_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the summary part within the reasoning summary."
+ },
"delta": {
"type": "string",
- "description": "The partial transcript of the audio response."
+ "description": "The text delta that was added to the summary."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
@@ -49400,28 +71112,48 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when there is a partial transcript of audio.",
+ "description": "Emitted when a delta is added to a reasoning summary text.",
"x-oaiMeta": {
- "name": "response.audio.transcript.delta",
+ "name": "response.reasoning_summary_text.delta",
"group": "responses",
- "example": "{\n \"type\": \"response.audio.transcript.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \" ... partial transcript ... \",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_summary_text.delta\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"delta\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseAudioTranscriptDoneEvent": {
+ "OpenAI.ResponseReasoningSummaryTextDoneEvent": {
"type": "object",
"required": [
"type",
+ "item_id",
+ "output_index",
+ "summary_index",
+ "text",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.audio.transcript.done"
+ "response.reasoning_summary_text.done"
],
- "description": "The type of the event. Always `response.audio.transcript.done`.",
+ "description": "The type of the event. Always `response.reasoning_summary_text.done`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this summary text is associated with."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item this summary text is associated with."
+ },
+ "summary_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the summary part within the reasoning summary."
+ },
+ "text": {
+ "type": "string",
+ "description": "The full text of the completed reasoning summary."
+ },
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
"description": "The sequence number of this event."
@@ -49432,19 +71164,20 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when the full audio transcript is completed.",
+ "description": "Emitted when a reasoning summary text is completed.",
"x-oaiMeta": {
- "name": "response.audio.transcript.done",
+ "name": "response.reasoning_summary_text.done",
"group": "responses",
- "example": "{\n \"type\": \"response.audio.transcript.done\",\n \"response_id\": \"resp_123\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_summary_text.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"text\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent": {
+ "OpenAI.ResponseReasoningTextDeltaEvent": {
"type": "object",
"required": [
"type",
- "output_index",
"item_id",
+ "output_index",
+ "content_index",
"delta",
"sequence_number"
],
@@ -49452,26 +71185,30 @@
"type": {
"type": "string",
"enum": [
- "response.code_interpreter_call_code.delta"
+ "response.reasoning_text.delta"
],
- "description": "The type of the event. Always `response.code_interpreter_call_code.delta`.",
+ "description": "The type of the event. Always `response.reasoning_text.delta`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this reasoning text delta is associated with."
+ },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code is being streamed."
+ "description": "The index of the output item this reasoning text delta is associated with."
},
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the reasoning content part this delta is associated with."
},
"delta": {
"type": "string",
- "description": "The partial code snippet being streamed by the code interpreter."
+ "description": "The text delta that was added to the reasoning content."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "description": "The sequence number of this event."
}
},
"allOf": [
@@ -49479,46 +71216,51 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when a partial code snippet is streamed by the code interpreter.",
+ "description": "Emitted when a delta is added to a reasoning text.",
"x-oaiMeta": {
- "name": "response.code_interpreter_call_code.delta",
+ "name": "response.reasoning_text.delta",
"group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call_code.delta\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"delta\": \"print('Hello, world')\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_text.delta\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"The\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallCodeDoneEvent": {
+ "OpenAI.ResponseReasoningTextDoneEvent": {
"type": "object",
"required": [
"type",
- "output_index",
"item_id",
- "code",
+ "output_index",
+ "content_index",
+ "text",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.code_interpreter_call_code.done"
+ "response.reasoning_text.done"
],
- "description": "The type of the event. Always `response.code_interpreter_call_code.done`.",
+ "description": "The type of the event. Always `response.reasoning_text.done`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the item this reasoning text is associated with."
+ },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code is finalized."
+ "description": "The index of the output item this reasoning text is associated with."
},
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the reasoning content part."
},
- "code": {
+ "text": {
"type": "string",
- "description": "The final code snippet output by the code interpreter."
+ "description": "The full text of the completed reasoning content."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "description": "The sequence number of this event."
}
},
"allOf": [
@@ -49526,41 +71268,51 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when the code snippet is finalized by the code interpreter.",
+ "description": "Emitted when a reasoning text is completed.",
"x-oaiMeta": {
- "name": "response.code_interpreter_call_code.done",
+ "name": "response.reasoning_text.done",
"group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call_code.done\",\n \"output_index\": 3,\n \"item_id\": \"ci_12345\",\n \"code\": \"print('done')\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.reasoning_text.done\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"The user is asking...\",\n \"sequence_number\": 4\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallCompletedEvent": {
+ "OpenAI.ResponseRefusalDeltaEvent": {
"type": "object",
"required": [
"type",
- "output_index",
"item_id",
+ "output_index",
+ "content_index",
+ "delta",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.code_interpreter_call.completed"
+ "response.refusal.delta"
],
- "description": "The type of the event. Always `response.code_interpreter_call.completed`.",
+ "description": "The type of the event. Always `response.refusal.delta`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the output item that the refusal text is added to."
+ },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code interpreter call is completed."
+ "description": "The index of the output item that the refusal text is added to."
},
- "item_id": {
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that the refusal text is added to."
+ },
+ "delta": {
"type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
+ "description": "The refusal text that is added."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "description": "The sequence number of this event."
}
},
"allOf": [
@@ -49568,41 +71320,51 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when the code interpreter call is completed.",
+ "description": "Emitted when there is a partial refusal text.",
"x-oaiMeta": {
- "name": "response.code_interpreter_call.completed",
+ "name": "response.refusal.delta",
"group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call.completed\",\n \"output_index\": 5,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.refusal.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"refusal text so far\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallInProgressEvent": {
+ "OpenAI.ResponseRefusalDoneEvent": {
"type": "object",
"required": [
"type",
- "output_index",
"item_id",
+ "output_index",
+ "content_index",
+ "refusal",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.code_interpreter_call.in_progress"
+ "response.refusal.done"
],
- "description": "The type of the event. Always `response.code_interpreter_call.in_progress`.",
+ "description": "The type of the event. Always `response.refusal.done`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the output item that the refusal text is finalized."
+ },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code interpreter call is in progress."
+ "description": "The index of the output item that the refusal text is finalized."
},
- "item_id": {
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that the refusal text is finalized."
+ },
+ "refusal": {
"type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
+ "description": "The refusal text that is finalized."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "description": "The sequence number of this event."
}
},
"allOf": [
@@ -49610,41 +71372,203 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when a code interpreter call is in progress.",
+ "description": "Emitted when refusal text is finalized.",
"x-oaiMeta": {
- "name": "response.code_interpreter_call.in_progress",
+ "name": "response.refusal.done",
"group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.refusal.done\",\n \"item_id\": \"item-abc\",\n \"output_index\": 1,\n \"content_index\": 2,\n \"refusal\": \"final refusal text\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCodeInterpreterCallInterpretingEvent": {
+ "OpenAI.ResponseStreamEvent": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ResponseStreamEventType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "response.audio.done": "#/components/schemas/OpenAI.ResponseAudioDoneEvent",
+ "response.audio.transcript.delta": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent",
+ "response.audio.transcript.done": "#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent",
+ "response.code_interpreter_call_code.delta": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent",
+ "response.code_interpreter_call_code.done": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent",
+ "response.code_interpreter_call.completed": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent",
+ "response.code_interpreter_call.in_progress": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent",
+ "response.code_interpreter_call.interpreting": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent",
+ "response.completed": "#/components/schemas/OpenAI.ResponseCompletedEvent",
+ "response.content_part.added": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent",
+ "response.content_part.done": "#/components/schemas/OpenAI.ResponseContentPartDoneEvent",
+ "response.created": "#/components/schemas/OpenAI.ResponseCreatedEvent",
+ "response.custom_tool_call_input.delta": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent",
+ "response.custom_tool_call_input.done": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent",
+ "error": "#/components/schemas/OpenAI.ResponseErrorEvent",
+ "response.failed": "#/components/schemas/OpenAI.ResponseFailedEvent",
+ "response.file_search_call.completed": "#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent",
+ "response.file_search_call.in_progress": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent",
+ "response.file_search_call.searching": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent",
+ "response.function_call_arguments.delta": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent",
+ "response.function_call_arguments.done": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent",
+ "response.image_generation_call.completed": "#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent",
+ "response.image_generation_call.generating": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent",
+ "response.image_generation_call.in_progress": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent",
+ "response.image_generation_call.partial_image": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent",
+ "response.in_progress": "#/components/schemas/OpenAI.ResponseInProgressEvent",
+ "response.incomplete": "#/components/schemas/OpenAI.ResponseIncompleteEvent",
+ "response.mcp_call_arguments.delta": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent",
+ "response.mcp_call_arguments.done": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent",
+ "response.mcp_call.completed": "#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent",
+ "response.mcp_call.failed": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent",
+ "response.mcp_call.in_progress": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent",
+ "response.mcp_list_tools.completed": "#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent",
+ "response.mcp_list_tools.failed": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent",
+ "response.mcp_list_tools.in_progress": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent",
+ "response.output_item.added": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent",
+ "response.output_item.done": "#/components/schemas/OpenAI.ResponseOutputItemDoneEvent",
+ "response.output_text.annotation.added": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent",
+ "response.queued": "#/components/schemas/OpenAI.ResponseQueuedEvent",
+ "response.reasoning_summary_part.added": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent",
+ "response.reasoning_summary_part.done": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent",
+ "response.reasoning_summary_text.delta": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent",
+ "response.reasoning_summary_text.done": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent",
+ "response.reasoning_text.delta": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent",
+ "response.reasoning_text.done": "#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent",
+ "response.refusal.delta": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent",
+ "response.refusal.done": "#/components/schemas/OpenAI.ResponseRefusalDoneEvent",
+ "response.output_text.delta": "#/components/schemas/OpenAI.ResponseTextDeltaEvent",
+ "response.output_text.done": "#/components/schemas/OpenAI.ResponseTextDoneEvent",
+ "response.web_search_call.completed": "#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent",
+ "response.web_search_call.in_progress": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent",
+ "response.web_search_call.searching": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent",
+ "response.audio.delta": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent"
+ }
+ }
+ },
+ "OpenAI.ResponseStreamEventType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "response.audio.delta",
+ "response.audio.done",
+ "response.audio.transcript.delta",
+ "response.audio.transcript.done",
+ "response.code_interpreter_call_code.delta",
+ "response.code_interpreter_call_code.done",
+ "response.code_interpreter_call.completed",
+ "response.code_interpreter_call.in_progress",
+ "response.code_interpreter_call.interpreting",
+ "response.completed",
+ "response.content_part.added",
+ "response.content_part.done",
+ "response.created",
+ "error",
+ "response.file_search_call.completed",
+ "response.file_search_call.in_progress",
+ "response.file_search_call.searching",
+ "response.function_call_arguments.delta",
+ "response.function_call_arguments.done",
+ "response.in_progress",
+ "response.failed",
+ "response.incomplete",
+ "response.output_item.added",
+ "response.output_item.done",
+ "response.reasoning_summary_part.added",
+ "response.reasoning_summary_part.done",
+ "response.reasoning_summary_text.delta",
+ "response.reasoning_summary_text.done",
+ "response.reasoning_text.delta",
+ "response.reasoning_text.done",
+ "response.refusal.delta",
+ "response.refusal.done",
+ "response.output_text.delta",
+ "response.output_text.done",
+ "response.web_search_call.completed",
+ "response.web_search_call.in_progress",
+ "response.web_search_call.searching",
+ "response.image_generation_call.completed",
+ "response.image_generation_call.generating",
+ "response.image_generation_call.in_progress",
+ "response.image_generation_call.partial_image",
+ "response.mcp_call_arguments.delta",
+ "response.mcp_call_arguments.done",
+ "response.mcp_call.completed",
+ "response.mcp_call.failed",
+ "response.mcp_call.in_progress",
+ "response.mcp_list_tools.completed",
+ "response.mcp_list_tools.failed",
+ "response.mcp_list_tools.in_progress",
+ "response.output_text.annotation.added",
+ "response.queued",
+ "response.custom_tool_call_input.delta",
+ "response.custom_tool_call_input.done"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ResponseStreamOptions": {
+ "type": "object",
+ "properties": {
+ "include_obfuscation": {
+ "type": "boolean",
+ "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API."
+ }
+ },
+ "description": "Options for streaming responses. Only set this when you set `stream: true`."
+ },
+ "OpenAI.ResponseTextDeltaEvent": {
"type": "object",
"required": [
"type",
- "output_index",
"item_id",
- "sequence_number"
+ "output_index",
+ "content_index",
+ "delta",
+ "sequence_number",
+ "logprobs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.code_interpreter_call.interpreting"
+ "response.output_text.delta"
],
- "description": "The type of the event. Always `response.code_interpreter_call.interpreting`.",
+ "description": "The type of the event. Always `response.output_text.delta`.",
"x-stainless-const": true
},
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the output item that the text delta was added to."
+ },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response for which the code interpreter is interpreting code."
+ "description": "The index of the output item that the text delta was added to."
},
- "item_id": {
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that the text delta was added to."
+ },
+ "delta": {
"type": "string",
- "description": "The unique identifier of the code interpreter tool call item."
+ "description": "The text delta that was added."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event, used to order streaming events."
+ "description": "The sequence number for this event."
+ },
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ResponseLogProb"
+ },
+ "description": "The log probabilities of the tokens in the delta."
}
},
"allOf": [
@@ -49652,36 +71576,59 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when the code interpreter is actively interpreting the code snippet.",
+ "description": "Emitted when there is an additional text delta.",
"x-oaiMeta": {
- "name": "response.code_interpreter_call.interpreting",
+ "name": "response.output_text.delta",
"group": "responses",
- "example": "{\n \"type\": \"response.code_interpreter_call.interpreting\",\n \"output_index\": 4,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.output_text.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"In\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseCompletedEvent": {
+ "OpenAI.ResponseTextDoneEvent": {
"type": "object",
"required": [
"type",
- "response",
- "sequence_number"
+ "item_id",
+ "output_index",
+ "content_index",
+ "text",
+ "sequence_number",
+ "logprobs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.completed"
+ "response.output_text.done"
],
- "description": "The type of the event. Always `response.completed`.",
+ "description": "The type of the event. Always `response.output_text.done`.",
"x-stainless-const": true
},
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "Properties of the completed response."
+ "item_id": {
+ "type": "string",
+ "description": "The ID of the output item that the text content is finalized."
+ },
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the text content is finalized."
+ },
+ "content_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the content part that the text content is finalized."
+ },
+ "text": {
+ "type": "string",
+ "description": "The text content that is finalized."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
"description": "The sequence number for this event."
+ },
+ "logprobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.ResponseLogProb"
+ },
+ "description": "The log probabilities of the tokens in the delta."
}
},
"allOf": [
@@ -49689,103 +71636,108 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when the model response is complete.",
+ "description": "Emitted when text content is finalized.",
"x-oaiMeta": {
- "name": "response.completed",
+ "name": "response.output_text.done",
"group": "responses",
- "example": "{\n \"type\": \"response.completed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"completed\",\n \"completed_at\": 1740855870,\n \"error\": null,\n \"incomplete_details\": null,\n \"input\": [],\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [\n {\n \"id\": \"msg_123\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n ]\n }\n ],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 0,\n \"output_tokens\": 0,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 0\n },\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.output_text.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseContentPartAddedEvent": {
+ "OpenAI.ResponseTextParam": {
+ "type": "object",
+ "properties": {
+ "format": {
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
+ },
+ "verbosity": {
+ "$ref": "#/components/schemas/OpenAI.Verbosity"
+ }
+ },
+ "description": "Configuration options for a text response from the model. Can be plain\ntext or structured JSON data. Learn more:\n- [Text inputs and outputs](/docs/guides/text)\n- [Structured Outputs](/docs/guides/structured-outputs)"
+ },
+ "OpenAI.ResponseUsage": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "part",
- "sequence_number"
+ "input_tokens",
+ "input_tokens_details",
+ "output_tokens",
+ "output_tokens_details",
+ "total_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "response.content_part.added"
- ],
- "description": "The type of the event. Always `response.content_part.added`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the content part was added to."
- },
- "output_index": {
+ "input_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the content part was added to."
+ "description": "The number of input tokens."
},
- "content_index": {
+ "input_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails",
+ "description": "A detailed breakdown of the input tokens."
+ },
+ "output_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that was added."
+ "description": "The number of output tokens."
},
- "part": {
- "$ref": "#/components/schemas/OpenAI.OutputContent",
- "description": "The content part that was added."
+ "output_tokens_details": {
+ "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails",
+ "description": "A detailed breakdown of the output tokens."
},
- "sequence_number": {
+ "total_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "description": "The total number of tokens used."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "description": "Represents token usage details including input tokens, output tokens,\na breakdown of output tokens, and the total tokens used."
+ },
+ "OpenAI.ResponseUsageInputTokensDetails": {
+ "type": "object",
+ "required": [
+ "cached_tokens"
+ ],
+ "properties": {
+ "cached_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
}
+ }
+ },
+ "OpenAI.ResponseUsageOutputTokensDetails": {
+ "type": "object",
+ "required": [
+ "reasoning_tokens"
],
- "description": "Emitted when a new content part is added.",
- "x-oaiMeta": {
- "name": "response.content_part.added",
- "group": "responses",
- "example": "{\n \"type\": \"response.content_part.added\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"\",\n \"annotations\": []\n },\n \"sequence_number\": 1\n}\n"
+ "properties": {
+ "reasoning_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
}
},
- "OpenAI.ResponseContentPartDoneEvent": {
+ "OpenAI.ResponseWebSearchCallCompletedEvent": {
"type": "object",
"required": [
"type",
- "item_id",
"output_index",
- "content_index",
- "sequence_number",
- "part"
+ "item_id",
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.content_part.done"
+ "response.web_search_call.completed"
],
- "description": "The type of the event. Always `response.content_part.done`.",
+ "description": "The type of the event. Always `response.web_search_call.completed`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the content part was added to."
- },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the content part was added to."
+ "description": "The index of the output item that the web search call is associated with."
},
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that is done."
+ "item_id": {
+ "type": "string",
+ "description": "Unique ID for the output item associated with the web search call."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "part": {
- "$ref": "#/components/schemas/OpenAI.OutputContent",
- "description": "The content part that is done."
+ "description": "The sequence number of the web search call being processed."
}
},
"allOf": [
@@ -49793,36 +71745,41 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Emitted when a content part is done.",
+ "description": "Emitted when a web search call is completed.",
"x-oaiMeta": {
- "name": "response.content_part.done",
+ "name": "response.web_search_call.completed",
"group": "responses",
- "example": "{\n \"type\": \"response.content_part.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"sequence_number\": 1,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n}\n"
+ "example": "{\n \"type\": \"response.web_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
}
},
- "OpenAI.ResponseCreatedEvent": {
+ "OpenAI.ResponseWebSearchCallInProgressEvent": {
"type": "object",
"required": [
"type",
- "response",
+ "output_index",
+ "item_id",
"sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.created"
+ "response.web_search_call.in_progress"
],
- "description": "The type of the event. Always `response.created`.",
+ "description": "The type of the event. Always `response.web_search_call.in_progress`.",
"x-stainless-const": true
},
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The response that was created."
+ "output_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the output item that the web search call is associated with."
+ },
+ "item_id": {
+ "type": "string",
+ "description": "Unique ID for the output item associated with the web search call."
},
"sequence_number": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number for this event."
+ "description": "The sequence number of the web search call being processed."
}
},
"allOf": [
@@ -49830,46 +71787,41 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "An event that is emitted when a response is created.",
+ "description": "Emitted when a web search call is initiated.",
"x-oaiMeta": {
- "name": "response.created",
+ "name": "response.web_search_call.in_progress",
"group": "responses",
- "example": "{\n \"type\": \"response.created\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
+ "example": "{\n \"type\": \"response.web_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
}
},
- "OpenAI.ResponseCustomToolCallInputDeltaEvent": {
+ "OpenAI.ResponseWebSearchCallSearchingEvent": {
"type": "object",
"required": [
"type",
- "sequence_number",
"output_index",
"item_id",
- "delta"
+ "sequence_number"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.custom_tool_call_input.delta"
+ "response.web_search_call.searching"
],
- "description": "The event type identifier.",
+ "description": "The type of the event. Always `response.web_search_call.searching`.",
"x-stainless-const": true
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
"output_index": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output this delta applies to."
+ "description": "The index of the output item that the web search call is associated with."
},
"item_id": {
"type": "string",
- "description": "Unique identifier for the API item associated with this event."
+ "description": "Unique ID for the output item associated with the web search call."
},
- "delta": {
- "type": "string",
- "description": "The incremental input data (delta) for the custom tool call."
+ "sequence_number": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The sequence number of the web search call being processed."
}
},
"allOf": [
@@ -49877,122 +71829,141 @@
"$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
}
],
- "description": "Event representing a delta (partial update) to the input of a custom tool call.",
- "title": "ResponseCustomToolCallInputDelta",
+ "description": "Emitted when a web search call is executing.",
"x-oaiMeta": {
- "name": "response.custom_tool_call_input.delta",
+ "name": "response.web_search_call.searching",
"group": "responses",
- "example": "{\n \"type\": \"response.custom_tool_call_input.delta\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"delta\": \"partial input text\"\n}\n"
+ "example": "{\n \"type\": \"response.web_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
}
},
- "OpenAI.ResponseCustomToolCallInputDoneEvent": {
+ "OpenAI.RunCompletionUsage": {
"type": "object",
"required": [
- "type",
- "sequence_number",
- "output_index",
- "item_id",
- "input"
+ "completion_tokens",
+ "prompt_tokens",
+ "total_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "response.custom_tool_call_input.done"
- ],
- "description": "The event type identifier.",
- "x-stainless-const": true
- },
- "sequence_number": {
+ "completion_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "description": "Number of completion tokens used over the course of the run."
},
- "output_index": {
+ "prompt_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output this event applies to."
- },
- "item_id": {
- "type": "string",
- "description": "Unique identifier for the API item associated with this event."
+ "description": "Number of prompt tokens used over the course of the run."
},
- "input": {
- "type": "string",
- "description": "The complete input data for the custom tool call."
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Total number of tokens used (prompt + completion)."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Event indicating that input for a custom tool call is complete.",
- "title": "ResponseCustomToolCallInputDone",
- "x-oaiMeta": {
- "name": "response.custom_tool_call_input.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.custom_tool_call_input.done\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"input\": \"final complete input text\"\n}\n"
- }
+ "description": "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.)."
},
- "OpenAI.ResponseError": {
+ "OpenAI.RunGraderRequest": {
"type": "object",
"required": [
- "code",
- "message"
+ "grader",
+ "model_sample"
],
"properties": {
- "code": {
- "$ref": "#/components/schemas/OpenAI.ResponseErrorCode"
+ "grader": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderMulti"
+ }
+ ],
+ "description": "The grader used for the fine-tuning job."
},
- "message": {
+ "item": {
+ "$ref": "#/components/schemas/OpenAI.RunGraderRequestItem",
+ "description": "The dataset item provided to the grader. This will be used to populate\n the `item` namespace. See [the guide](/docs/guides/graders) for more details."
+ },
+ "model_sample": {
"type": "string",
- "description": "A human-readable description of the error."
+ "description": "The model sample to be evaluated. This value will be used to populate\n the `sample` namespace. See [the guide](/docs/guides/graders) for more details.\n The `output_json` variable will be populated if the model sample is a\n valid JSON string."
}
},
- "description": "An error object returned when the model fails to generate a Response."
+ "title": "RunGraderRequest"
},
- "OpenAI.ResponseErrorCode": {
- "type": "string",
- "enum": [
- "server_error",
- "rate_limit_exceeded",
- "invalid_prompt",
- "vector_store_timeout",
- "invalid_image",
- "invalid_image_format",
- "invalid_base64_image",
- "invalid_image_url",
- "image_too_large",
- "image_too_small",
- "image_parse_error",
- "image_content_policy_violation",
- "invalid_image_mode",
- "image_file_too_large",
- "unsupported_image_media_type",
- "empty_image_file",
- "failed_to_download_image",
- "image_file_not_found"
+ "OpenAI.RunGraderRequestItem": {
+ "type": "object"
+ },
+ "OpenAI.RunGraderResponse": {
+ "type": "object",
+ "required": [
+ "reward",
+ "metadata",
+ "sub_rewards",
+ "model_grader_token_usage_per_model"
],
- "description": "The error code for the response."
+ "properties": {
+ "reward": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "metadata": {
+ "$ref": "#/components/schemas/OpenAI.RunGraderResponseMetadata"
+ },
+ "sub_rewards": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "model_grader_token_usage_per_model": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ }
+ }
},
- "OpenAI.ResponseErrorEvent": {
+ "OpenAI.RunGraderResponseMetadata": {
"type": "object",
"required": [
+ "name",
"type",
- "code",
- "message",
- "param",
- "sequence_number"
+ "errors",
+ "execution_time",
+ "scores",
+ "token_usage",
+ "sampled_model_name"
],
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
- "type": "string",
- "enum": [
- "error"
- ],
- "description": "The type of the event. Always `error`.",
- "x-stainless-const": true
+ "type": "string"
},
- "code": {
+ "errors": {
+ "$ref": "#/components/schemas/OpenAI.RunGraderResponseMetadataErrors"
+ },
+ "execution_time": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "scores": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "token_usage": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "sampled_model_name": {
"anyOf": [
{
"type": "string"
@@ -50001,12 +71972,50 @@
"type": "null"
}
]
+ }
+ }
+ },
+ "OpenAI.RunGraderResponseMetadataErrors": {
+ "type": "object",
+ "required": [
+ "formula_parse_error",
+ "sample_parse_error",
+ "truncated_observation_error",
+ "unresponsive_reward_error",
+ "invalid_variable_error",
+ "other_error",
+ "python_grader_server_error",
+ "python_grader_server_error_type",
+ "python_grader_runtime_error",
+ "python_grader_runtime_error_details",
+ "model_grader_server_error",
+ "model_grader_refusal_error",
+ "model_grader_parse_error",
+ "model_grader_server_error_details"
+ ],
+ "properties": {
+ "formula_parse_error": {
+ "type": "boolean"
},
- "message": {
- "type": "string",
- "description": "The error message."
+ "sample_parse_error": {
+ "type": "boolean"
},
- "param": {
+ "truncated_observation_error": {
+ "type": "boolean"
+ },
+ "unresponsive_reward_error": {
+ "type": "boolean"
+ },
+ "invalid_variable_error": {
+ "type": "boolean"
+ },
+ "other_error": {
+ "type": "boolean"
+ },
+ "python_grader_server_error": {
+ "type": "boolean"
+ },
+ "python_grader_server_error_type": {
"anyOf": [
{
"type": "string"
@@ -50016,2331 +72025,2417 @@
}
]
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "python_grader_runtime_error": {
+ "type": "boolean"
+ },
+ "python_grader_runtime_error_details": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "model_grader_server_error": {
+ "type": "boolean"
+ },
+ "model_grader_refusal_error": {
+ "type": "boolean"
+ },
+ "model_grader_parse_error": {
+ "type": "boolean"
+ },
+ "model_grader_server_error_details": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- ],
- "description": "Emitted when an error occurs.",
- "x-oaiMeta": {
- "name": "error",
- "group": "responses",
- "example": "{\n \"type\": \"error\",\n \"code\": \"ERR_SOMETHING\",\n \"message\": \"Something went wrong\",\n \"param\": null,\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseFailedEvent": {
+ "OpenAI.RunObject": {
"type": "object",
"required": [
- "type",
- "sequence_number",
- "response"
+ "id",
+ "object",
+ "created_at",
+ "thread_id",
+ "assistant_id",
+ "status",
+ "required_action",
+ "last_error",
+ "expires_at",
+ "started_at",
+ "cancelled_at",
+ "failed_at",
+ "completed_at",
+ "incomplete_details",
+ "model",
+ "instructions",
+ "tools",
+ "metadata",
+ "usage",
+ "max_prompt_tokens",
+ "max_completion_tokens",
+ "truncation_strategy",
+ "tool_choice",
+ "parallel_tool_calls",
+ "response_format"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "response.failed"
+ "thread.run"
],
- "description": "The type of the event. Always `response.failed`.",
+ "description": "The object type, which is always `thread.run`.",
"x-stainless-const": true
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the run was created."
},
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The response that failed."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "thread_id": {
+ "type": "string",
+ "description": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run."
+ },
+ "assistant_id": {
+ "type": "string",
+ "description": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.RunStatus",
+ "description": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`."
+ },
+ "required_action": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunObjectRequiredAction"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Details on the action required to continue the run. Will be `null` if no action is required."
+ },
+ "last_error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunObjectLastError"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The last error associated with this run. Will be `null` if there are no errors."
+ },
+ "expires_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run will expire."
+ },
+ "started_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run was started."
+ },
+ "cancelled_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run was cancelled."
+ },
+ "failed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run failed."
+ },
+ "completed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "The Unix timestamp (in seconds) for when the run was completed."
+ },
+ "incomplete_details": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunObjectIncompleteDetails"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Details on why the run is incomplete. Will be `null` if the run is not incomplete."
+ },
+ "model": {
+ "type": "string",
+ "description": "The model that the [assistant](/docs/api-reference/assistants) used for this run."
+ },
+ "instructions": {
+ "type": "string",
+ "description": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run."
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.AssistantTool"
+ },
+ "maxItems": 20,
+ "description": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.",
+ "default": []
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "usage": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunCompletionUsage"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "temperature": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The sampling temperature used for this run. If not set, defaults to 1."
+ },
+ "top_p": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The nucleus sampling value used for this run. If not set, defaults to 1."
+ },
+ "max_prompt_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "The maximum number of prompt tokens specified to have been used over the course of the run."
+ },
+ "max_completion_tokens": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "minimum": 256,
+ "description": "The maximum number of completion tokens specified to have been used over the course of the run."
+ },
+ "truncation_strategy": {
+ "$ref": "#/components/schemas/OpenAI.TruncationObject"
+ },
+ "tool_choice": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption"
+ },
+ "parallel_tool_calls": {
+ "type": "boolean",
+ "description": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.",
+ "default": true
+ },
+ "response_format": {
+ "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption"
}
- ],
- "description": "An event that is emitted when a response fails.",
+ },
+ "description": "Represents an execution run on a [thread](/docs/api-reference/threads).",
+ "title": "A run on a thread",
"x-oaiMeta": {
- "name": "response.failed",
- "group": "responses",
- "example": "{\n \"type\": \"response.failed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"failed\",\n \"completed_at\": null,\n \"error\": {\n \"code\": \"server_error\",\n \"message\": \"The model failed to generate a response.\"\n },\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n }\n}\n"
+ "name": "The run object",
+ "beta": true,
+ "example": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1698107661,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699073476,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699073498,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [{\"type\": \"file_search\"}, {\"type\": \"code_interpreter\"}],\n \"metadata\": {},\n \"incomplete_details\": null,\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n"
}
},
- "OpenAI.ResponseFileSearchCallCompletedEvent": {
+ "OpenAI.RunObjectIncompleteDetails": {
"type": "object",
- "required": [
- "type",
- "output_index",
- "item_id",
- "sequence_number"
- ],
"properties": {
- "type": {
+ "reason": {
"type": "string",
"enum": [
- "response.file_search_call.completed"
- ],
- "description": "The type of the event. Always `response.file_search_call.completed`.",
- "x-stainless-const": true
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the file search call is initiated."
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the file search call is initiated."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "max_completion_tokens",
+ "max_prompt_tokens"
+ ]
}
- ],
- "description": "Emitted when a file search call is completed (results found).",
- "x-oaiMeta": {
- "name": "response.file_search_call.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.file_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseFileSearchCallInProgressEvent": {
+ "OpenAI.RunObjectLastError": {
"type": "object",
"required": [
- "type",
- "output_index",
- "item_id",
- "sequence_number"
+ "code",
+ "message"
],
"properties": {
- "type": {
+ "code": {
"type": "string",
"enum": [
- "response.file_search_call.in_progress"
- ],
- "description": "The type of the event. Always `response.file_search_call.in_progress`.",
- "x-stainless-const": true
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the file search call is initiated."
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the file search call is initiated."
+ "server_error",
+ "rate_limit_exceeded",
+ "invalid_prompt"
+ ]
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "message": {
+ "type": "string"
}
- ],
- "description": "Emitted when a file search call is initiated.",
- "x-oaiMeta": {
- "name": "response.file_search_call.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.file_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseFileSearchCallSearchingEvent": {
+ "OpenAI.RunObjectRequiredAction": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "submit_tool_outputs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.file_search_call.searching"
+ "submit_tool_outputs"
],
- "description": "The type of the event. Always `response.file_search_call.searching`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the file search call is searching."
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the file search call is initiated."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "submit_tool_outputs": {
+ "$ref": "#/components/schemas/OpenAI.RunObjectRequiredActionSubmitToolOutputs"
}
+ }
+ },
+ "OpenAI.RunObjectRequiredActionSubmitToolOutputs": {
+ "type": "object",
+ "required": [
+ "tool_calls"
],
- "description": "Emitted when a file search is currently searching.",
- "x-oaiMeta": {
- "name": "response.file_search_call.searching",
- "group": "responses",
- "example": "{\n \"type\": \"response.file_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n"
+ "properties": {
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunToolCallObject"
+ }
+ }
}
},
- "OpenAI.ResponseFormatJsonObject": {
+ "OpenAI.RunStatus": {
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "requires_action",
+ "cancelling",
+ "cancelled",
+ "failed",
+ "completed",
+ "incomplete",
+ "expired"
+ ],
+ "description": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`."
+ },
+ "OpenAI.RunStepCompletionUsage": {
"type": "object",
"required": [
- "type"
+ "completion_tokens",
+ "prompt_tokens",
+ "total_tokens"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "json_object"
- ],
- "description": "The type of response format being defined. Always `json_object`.",
- "x-stainless-const": true
+ "completion_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of completion tokens used over the course of the run step."
+ },
+ "prompt_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Number of prompt tokens used over the course of the run step."
+ },
+ "total_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Total number of tokens used (prompt + completion)."
}
},
- "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
- "title": "JSON object"
+ "description": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`."
},
- "OpenAI.ResponseFormatJsonSchema": {
+ "OpenAI.RunStepDetailsMessageCreationObject": {
"type": "object",
"required": [
"type",
- "json_schema"
+ "message_creation"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "json_schema"
+ "message_creation"
],
- "description": "The type of response format being defined. Always `json_schema`.",
+ "description": "Always `message_creation`.",
"x-stainless-const": true
},
- "json_schema": {
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema",
- "description": "Structured Outputs configuration options, including a JSON Schema.",
- "title": "JSON schema"
+ "message_creation": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsMessageCreationObjectMessageCreation"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat"
- }
- ],
- "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).",
- "title": "JSON schema"
+ "description": "Details of the message creation by the run step.",
+ "title": "Message creation"
},
- "OpenAI.ResponseFormatJsonSchemaJsonSchema": {
+ "OpenAI.RunStepDetailsMessageCreationObjectMessageCreation": {
"type": "object",
"required": [
- "name"
+ "message_id"
],
"properties": {
- "description": {
- "type": "string"
- },
- "name": {
+ "message_id": {
"type": "string"
- },
- "schema": {
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema"
- },
- "strict": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
}
}
},
- "OpenAI.ResponseFormatJsonSchemaSchema": {
- "type": "object",
- "unevaluatedProperties": {},
- "description": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).",
- "title": "JSON schema"
- },
- "OpenAI.ResponseFormatText": {
+ "OpenAI.RunStepDetailsToolCall": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "code_interpreter": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObject",
+ "file_search": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObject",
+ "function": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObject"
+ }
+ }
+ },
+ "OpenAI.RunStepDetailsToolCallType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
"type": "string",
"enum": [
- "text"
- ],
- "description": "The type of response format being defined. Always `text`.",
- "x-stainless-const": true
+ "code_interpreter",
+ "file_search",
+ "function"
+ ]
}
- },
- "description": "Default response format. Used to generate text responses.",
- "title": "Text"
+ ]
},
- "OpenAI.ResponseFunctionCallArgumentsDeltaEvent": {
+ "OpenAI.RunStepDetailsToolCallsCodeObject": {
"type": "object",
"required": [
+ "id",
"type",
- "item_id",
- "output_index",
- "sequence_number",
- "delta"
+ "code_interpreter"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call."
+ },
"type": {
"type": "string",
"enum": [
- "response.function_call_arguments.delta"
+ "code_interpreter"
],
- "description": "The type of the event. Always `response.function_call_arguments.delta`.",
+ "description": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the function-call arguments delta is added to."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the function-call arguments delta is added to."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "delta": {
- "type": "string",
- "description": "The function-call arguments delta that is added."
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter",
+ "description": "The Code Interpreter tool call definition."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall"
}
],
- "description": "Emitted when there is a partial function-call arguments delta.",
- "x-oaiMeta": {
- "name": "response.function_call_arguments.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.function_call_arguments.delta\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"delta\": \"{ \"arg\":\"\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Details of the Code Interpreter tool call the run step was involved in.",
+ "title": "Code Interpreter tool call"
},
- "OpenAI.ResponseFunctionCallArgumentsDoneEvent": {
+ "OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter": {
"type": "object",
"required": [
- "type",
- "item_id",
- "name",
- "output_index",
- "sequence_number",
- "arguments"
+ "input",
+ "outputs"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "response.function_call_arguments.done"
- ],
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the item."
- },
- "name": {
- "type": "string",
- "description": "The name of the function that was called."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "input": {
+ "type": "string"
},
- "arguments": {
- "type": "string",
- "description": "The function-call arguments."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "outputs": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObject"
+ }
+ ]
+ }
}
- ],
- "description": "Emitted when function-call arguments are finalized.",
- "x-oaiMeta": {
- "name": "response.function_call_arguments.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.function_call_arguments.done\",\n \"item_id\": \"item-abc\",\n \"name\": \"get_weather\",\n \"output_index\": 1,\n \"arguments\": \"{ \"arg\": 123 }\",\n \"sequence_number\": 1\n}\n"
}
},
- "OpenAI.ResponseImageGenCallCompletedEvent": {
+ "OpenAI.RunStepDetailsToolCallsCodeOutputImageObject": {
"type": "object",
"required": [
"type",
- "output_index",
- "sequence_number",
- "item_id"
+ "image"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.image_generation_call.completed"
+ "image"
],
- "description": "The type of the event. Always 'response.image_generation_call.completed'.",
+ "description": "Always `image`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the image generation item being processed."
+ "image": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
+ "title": "Code Interpreter image output"
+ },
+ "OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage": {
+ "type": "object",
+ "required": [
+ "file_id"
],
- "description": "Emitted when an image generation tool call has completed and the final image is available.",
- "title": "ResponseImageGenCallCompletedEvent",
- "x-oaiMeta": {
- "name": "response.image_generation_call.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.image_generation_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 1\n}\n"
+ "properties": {
+ "file_id": {
+ "type": "string"
+ }
}
},
- "OpenAI.ResponseImageGenCallGeneratingEvent": {
+ "OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "logs"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.image_generation_call.generating"
+ "logs"
],
- "description": "The type of the event. Always 'response.image_generation_call.generating'.",
+ "description": "Always `logs`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "item_id": {
+ "logs": {
"type": "string",
- "description": "The unique identifier of the image generation item being processed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the image generation item being processed."
+ "description": "The text output from the Code Interpreter tool call."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Emitted when an image generation tool call is actively generating an image (intermediate state).",
- "title": "ResponseImageGenCallGeneratingEvent",
- "x-oaiMeta": {
- "name": "response.image_generation_call.generating",
- "group": "responses",
- "example": "{\n \"type\": \"response.image_generation_call.generating\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n"
- }
+ "description": "Text output from the Code Interpreter tool call as part of a run step.",
+ "title": "Code Interpreter log output"
},
- "OpenAI.ResponseImageGenCallInProgressEvent": {
+ "OpenAI.RunStepDetailsToolCallsFileSearchObject": {
"type": "object",
"required": [
+ "id",
"type",
- "output_index",
- "item_id",
- "sequence_number"
+ "file_search"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call object."
+ },
"type": {
"type": "string",
"enum": [
- "response.image_generation_call.in_progress"
+ "file_search"
],
- "description": "The type of the event. Always 'response.image_generation_call.in_progress'.",
+ "description": "The type of tool call. This is always going to be `file_search` for this type of tool call.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the image generation item being processed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the image generation item being processed."
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch",
+ "description": "For now, this is always going to be an empty object.",
+ "x-oaiTypeLabel": "map"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall"
}
],
- "description": "Emitted when an image generation tool call is in progress.",
- "title": "ResponseImageGenCallInProgressEvent",
- "x-oaiMeta": {
- "name": "response.image_generation_call.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.image_generation_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n"
+ "title": "File search tool call"
+ },
+ "OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch": {
+ "type": "object",
+ "properties": {
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObject"
+ }
+ }
}
},
- "OpenAI.ResponseImageGenCallPartialImageEvent": {
+ "OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject": {
"type": "object",
"required": [
- "type",
- "output_index",
- "item_id",
- "sequence_number",
- "partial_image_index",
- "partial_image_b64"
+ "ranker",
+ "score_threshold"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "response.image_generation_call.partial_image"
- ],
- "description": "The type of the event. Always 'response.image_generation_call.partial_image'.",
- "x-stainless-const": true
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the image generation item being processed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the image generation item being processed."
- },
- "partial_image_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "0-based index for the partial image (backend is 1-based, but this is 0-based for the user)."
+ "ranker": {
+ "$ref": "#/components/schemas/OpenAI.FileSearchRanker"
},
- "partial_image_b64": {
- "type": "string",
- "description": "Base64-encoded partial image data, suitable for rendering as an image."
+ "score_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Emitted when a partial image is available during image generation streaming.",
- "title": "ResponseImageGenCallPartialImageEvent",
- "x-oaiMeta": {
- "name": "response.image_generation_call.partial_image",
- "group": "responses",
- "example": "{\n \"type\": \"response.image_generation_call.partial_image\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0,\n \"partial_image_index\": 0,\n \"partial_image_b64\": \"...\"\n}\n"
- }
+ "description": "The ranking options for the file search.",
+ "title": "File search tool call ranking options"
},
- "OpenAI.ResponseInProgressEvent": {
+ "OpenAI.RunStepDetailsToolCallsFileSearchResultObject": {
"type": "object",
"required": [
- "type",
- "response",
- "sequence_number"
+ "file_id",
+ "file_name",
+ "score"
],
"properties": {
- "type": {
+ "file_id": {
"type": "string",
- "enum": [
- "response.in_progress"
- ],
- "description": "The type of the event. Always `response.in_progress`.",
- "x-stainless-const": true
+ "description": "The ID of the file that result was found in."
},
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The response that is in progress."
+ "file_name": {
+ "type": "string",
+ "description": "The name of the file that result was found in."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "score": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The score of the result. All values must be a floating point number between 0 and 1."
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent"
+ },
+ "description": "The content of the result that was found. The content is only included if requested via the include query parameter."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Emitted when the response is in progress.",
- "x-oaiMeta": {
- "name": "response.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.in_progress\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "A result instance of the file search.",
+ "title": "File search tool call result",
+ "x-oaiTypeLabel": "map"
},
- "OpenAI.ResponseIncompleteDetails": {
+ "OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent": {
"type": "object",
"properties": {
- "reason": {
+ "type": {
"type": "string",
- "enum": [
- "max_output_tokens",
- "content_filter"
- ]
+ "enum": [
+ "text"
+ ],
+ "x-stainless-const": true
+ },
+ "text": {
+ "type": "string"
}
}
},
- "OpenAI.ResponseIncompleteEvent": {
+ "OpenAI.RunStepDetailsToolCallsFunctionObject": {
"type": "object",
"required": [
+ "id",
"type",
- "response",
- "sequence_number"
+ "function"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the tool call object."
+ },
"type": {
"type": "string",
"enum": [
- "response.incomplete"
+ "function"
],
- "description": "The type of the event. Always `response.incomplete`.",
+ "description": "The type of tool call. This is always going to be `function` for this type of tool call.",
"x-stainless-const": true
},
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The response that was incomplete."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObjectFunction",
+ "description": "The definition of the function that was called."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall"
}
],
- "description": "An event that is emitted when a response finishes as incomplete.",
- "x-oaiMeta": {
- "name": "response.incomplete",
- "group": "responses",
- "example": "{\n \"type\": \"response.incomplete\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"incomplete\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": {\n \"reason\": \"max_tokens\"\n },\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n"
- }
+ "title": "Function tool call"
},
- "OpenAI.ResponseLogProb": {
+ "OpenAI.RunStepDetailsToolCallsFunctionObjectFunction": {
"type": "object",
"required": [
- "token",
- "logprob"
+ "name",
+ "arguments",
+ "output"
],
"properties": {
- "token": {
- "type": "string",
- "description": "A possible text token."
- },
- "logprob": {
- "$ref": "#/components/schemas/OpenAI.numeric",
- "description": "The log probability of this token."
+ "name": {
+ "type": "string"
},
- "top_logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ResponseLogProbTopLogprobs"
- },
- "description": "The log probabilities of up to 20 of the most likely tokens."
- }
- },
- "description": "A logprob is the logarithmic probability that the model assigns to producing\na particular token at a given position in the sequence. Less-negative (higher)\nlogprob values indicate greater model confidence in that token choice."
- },
- "OpenAI.ResponseLogProbTopLogprobs": {
- "type": "object",
- "properties": {
- "token": {
+ "arguments": {
"type": "string"
},
- "logprob": {
- "$ref": "#/components/schemas/OpenAI.numeric"
+ "output": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
}
},
- "OpenAI.ResponseMCPCallArgumentsDeltaEvent": {
+ "OpenAI.RunStepDetailsToolCallsObject": {
"type": "object",
"required": [
"type",
- "output_index",
- "item_id",
- "delta",
- "sequence_number"
+ "tool_calls"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_call_arguments.delta"
+ "tool_calls"
],
- "description": "The type of the event. Always 'response.mcp_call_arguments.delta'.",
+ "description": "Always `tool_calls`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the MCP tool call item being processed."
- },
- "delta": {
- "type": "string",
- "description": "A JSON string containing the partial update to the arguments for the MCP tool call."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall"
+ },
+ "description": "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`."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Emitted when there is a delta (partial update) to the arguments of an MCP tool call.",
- "title": "ResponseMCPCallArgumentsDeltaEvent",
- "x-oaiMeta": {
- "name": "response.mcp_call_arguments.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call_arguments.delta\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"delta\": \"{\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Details of the tool call.",
+ "title": "Tool calls"
},
- "OpenAI.ResponseMCPCallArgumentsDoneEvent": {
+ "OpenAI.RunStepObject": {
"type": "object",
"required": [
+ "id",
+ "object",
+ "created_at",
+ "assistant_id",
+ "thread_id",
+ "run_id",
"type",
- "output_index",
- "item_id",
- "arguments",
- "sequence_number"
+ "status",
+ "step_details",
+ "last_error",
+ "expired_at",
+ "cancelled_at",
+ "failed_at",
+ "completed_at",
+ "metadata",
+ "usage"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier of the run step, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "response.mcp_call_arguments.done"
+ "thread.run.step"
],
- "description": "The type of the event. Always 'response.mcp_call_arguments.done'.",
+ "description": "The object type, which is always `thread.run.step`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the run step was created."
},
- "item_id": {
+ "assistant_id": {
"type": "string",
- "description": "The unique identifier of the MCP tool call item being processed."
+ "description": "The ID of the [assistant](/docs/api-reference/assistants) associated with the run step."
},
- "arguments": {
+ "thread_id": {
"type": "string",
- "description": "A JSON string containing the finalized arguments for the MCP tool call."
+ "description": "The ID of the [thread](/docs/api-reference/threads) that was run."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "run_id": {
+ "type": "string",
+ "description": "The ID of the [run](/docs/api-reference/runs) that this run step is a part of."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "message_creation",
+ "tool_calls"
+ ],
+ "description": "The type of run step, which can be either `message_creation` or `tool_calls`."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "cancelled",
+ "failed",
+ "completed",
+ "expired"
+ ],
+ "description": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`."
+ },
+ "step_details": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsMessageCreationObject"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsObject"
+ }
+ ],
+ "description": "The details of the run step."
+ },
+ "last_error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.RunStepObjectLastError"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "expired_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "cancelled_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "failed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "completed_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "usage": {
+ "$ref": "#/components/schemas/OpenAI.RunStepCompletionUsage"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
- ],
- "description": "Emitted when the arguments for an MCP tool call are finalized.",
- "title": "ResponseMCPCallArgumentsDoneEvent",
+ "description": "Represents a step in execution of a run.",
+ "title": "Run steps",
"x-oaiMeta": {
- "name": "response.mcp_call_arguments.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call_arguments.done\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"arguments\": \"{\"arg1\": \"value1\", \"arg2\": \"value2\"}\",\n \"sequence_number\": 1\n}\n"
+ "name": "The run step object",
+ "beta": true,
+ "example": "{\n \"id\": \"step_abc123\",\n \"object\": \"thread.run.step\",\n \"created_at\": 1699063291,\n \"run_id\": \"run_abc123\",\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"type\": \"message_creation\",\n \"status\": \"completed\",\n \"cancelled_at\": null,\n \"completed_at\": 1699063291,\n \"expired_at\": null,\n \"failed_at\": null,\n \"last_error\": null,\n \"step_details\": {\n \"type\": \"message_creation\",\n \"message_creation\": {\n \"message_id\": \"msg_abc123\"\n }\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n }\n}\n"
}
},
- "OpenAI.ResponseMCPCallCompletedEvent": {
+ "OpenAI.RunStepObjectLastError": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "string",
+ "enum": [
+ "server_error",
+ "rate_limit_exceeded"
+ ]
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.RunToolCallObject": {
"type": "object",
"required": [
+ "id",
"type",
- "item_id",
- "output_index",
- "sequence_number"
+ "function"
],
"properties": {
+ "id": {
+ "type": "string",
+ "description": "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](/docs/api-reference/runs/submitToolOutputs) endpoint."
+ },
"type": {
"type": "string",
"enum": [
- "response.mcp_call.completed"
+ "function"
],
- "description": "The type of the event. Always 'response.mcp_call.completed'.",
+ "description": "The type of tool call the output is required for. For now, this is always `function`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the MCP tool call item that completed."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that completed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "function": {
+ "$ref": "#/components/schemas/OpenAI.RunToolCallObjectFunction",
+ "description": "The function definition."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
- }
+ "description": "Tool call objects"
+ },
+ "OpenAI.RunToolCallObjectFunction": {
+ "type": "object",
+ "required": [
+ "name",
+ "arguments"
],
- "description": "Emitted when an MCP tool call has completed successfully.",
- "title": "ResponseMCPCallCompletedEvent",
- "x-oaiMeta": {
- "name": "response.mcp_call.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call.completed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n"
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "arguments": {
+ "type": "string"
+ }
}
},
- "OpenAI.ResponseMCPCallFailedEvent": {
+ "OpenAI.ScreenshotParam": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_call.failed"
+ "screenshot"
],
- "description": "The type of the event. Always 'response.mcp_call.failed'.",
+ "description": "Specifies the event type. For a screenshot action, this property is always set to `screenshot`.",
"x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the MCP tool call item that failed."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that failed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "Emitted when an MCP tool call has failed.",
- "title": "ResponseMCPCallFailedEvent",
- "x-oaiMeta": {
- "name": "response.mcp_call.failed",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call.failed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n"
- }
+ "description": "A screenshot action.",
+ "title": "Screenshot"
},
- "OpenAI.ResponseMCPCallInProgressEvent": {
+ "OpenAI.ScrollParam": {
"type": "object",
"required": [
"type",
- "sequence_number",
- "output_index",
- "item_id"
+ "x",
+ "y",
+ "scroll_x",
+ "scroll_y"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_call.in_progress"
+ "scroll"
],
- "description": "The type of the event. Always 'response.mcp_call.in_progress'.",
+ "description": "Specifies the event type. For a scroll action, this property is always set to `scroll`.",
"x-stainless-const": true
},
- "sequence_number": {
+ "x": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "description": "The x-coordinate where the scroll occurred."
},
- "output_index": {
+ "y": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
+ "description": "The y-coordinate where the scroll occurred."
},
- "item_id": {
- "type": "string",
- "description": "The unique identifier of the MCP tool call item being processed."
+ "scroll_x": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The horizontal scroll distance."
+ },
+ "scroll_y": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The vertical scroll distance."
+ },
+ "keys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "Emitted when an MCP tool call is in progress.",
- "title": "ResponseMCPCallInProgressEvent",
- "x-oaiMeta": {
- "name": "response.mcp_call.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_call.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\"\n}\n"
- }
+ "description": "A scroll action.",
+ "title": "Scroll"
},
- "OpenAI.ResponseMCPListToolsCompletedEvent": {
+ "OpenAI.SearchContentType": {
+ "type": "string",
+ "enum": [
+ "text",
+ "image"
+ ]
+ },
+ "OpenAI.SearchContextSize": {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high"
+ ]
+ },
+ "OpenAI.ServiceTier": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "auto",
+ "default",
+ "flex",
+ "scale",
+ "priority"
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Specifies the processing type used for serving the request.\n- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n- If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.\n- When not set, the default behavior is 'auto'.\nWhen 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."
+ },
+ "OpenAI.ServiceTierEnum": {
+ "type": "string",
+ "enum": [
+ "auto",
+ "default",
+ "flex",
+ "priority"
+ ]
+ },
+ "OpenAI.SkillReferenceParam": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "sequence_number"
+ "skill_id"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_list_tools.completed"
+ "skill_reference"
],
- "description": "The type of the event. Always 'response.mcp_list_tools.completed'.",
+ "description": "References a skill created with the /v1/skills endpoint.",
"x-stainless-const": true
},
- "item_id": {
+ "skill_id": {
"type": "string",
- "description": "The ID of the MCP tool call item that produced this output."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that was processed."
+ "minLength": 1,
+ "maxLength": 64,
+ "description": "The ID of the referenced skill."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "version": {
+ "type": "string",
+ "description": "Optional skill version. Use a positive integer or 'latest'. Omit for default."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ContainerSkill"
}
- ],
- "description": "Emitted when the list of available MCP tools has been successfully retrieved.",
- "title": "ResponseMCPListToolsCompletedEvent",
- "x-oaiMeta": {
- "name": "response.mcp_list_tools.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_list_tools.completed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
- }
+ ]
},
- "OpenAI.ResponseMCPListToolsFailedEvent": {
+ "OpenAI.SpecificApplyPatchParam": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_list_tools.failed"
+ "apply_patch"
],
- "description": "The type of the event. Always 'response.mcp_list_tools.failed'.",
+ "description": "The tool to call. Always `apply_patch`.",
"x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the MCP tool call item that failed."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that failed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
- ],
- "description": "Emitted when the attempt to list available MCP tools has failed.",
- "title": "ResponseMCPListToolsFailedEvent",
- "x-oaiMeta": {
- "name": "response.mcp_list_tools.failed",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_list_tools.failed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
- }
+ ],
+ "description": "Forces the model to call the apply_patch tool when executing a tool call.",
+ "title": "Specific apply patch tool choice"
},
- "OpenAI.ResponseMCPListToolsInProgressEvent": {
+ "OpenAI.SpecificFunctionShellParam": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.mcp_list_tools.in_progress"
+ "shell"
],
- "description": "The type of the event. Always 'response.mcp_list_tools.in_progress'.",
+ "description": "The tool to call. Always `shell`.",
"x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the MCP tool call item that is being processed."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that is being processed."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when the system is in the process of retrieving the list of available MCP tools.",
- "title": "ResponseMCPListToolsInProgressEvent",
- "x-oaiMeta": {
- "name": "response.mcp_list_tools.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.mcp_list_tools.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n"
+ "description": "Forces the model to call the shell tool when a tool call is required.",
+ "title": "Specific shell tool choice"
+ },
+ "OpenAI.StaticChunkingStrategy": {
+ "type": "object",
+ "required": [
+ "max_chunk_size_tokens",
+ "chunk_overlap_tokens"
+ ],
+ "properties": {
+ "max_chunk_size_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 100,
+ "maximum": 4096,
+ "description": "The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`."
+ },
+ "chunk_overlap_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The number of tokens that overlap between chunks. The default value is `400`.\n Note that the overlap must not exceed half of `max_chunk_size_tokens`."
+ }
}
},
- "OpenAI.ResponseOutputItemAddedEvent": {
+ "OpenAI.StaticChunkingStrategyRequestParam": {
"type": "object",
"required": [
"type",
- "output_index",
- "sequence_number",
- "item"
+ "static"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.output_item.added"
+ "static"
],
- "description": "The type of the event. Always `response.output_item.added`.",
+ "description": "Always `static`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that was added."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "item": {
- "$ref": "#/components/schemas/OpenAI.OutputItem",
- "description": "The output item that was added."
+ "static": {
+ "$ref": "#/components/schemas/OpenAI.StaticChunkingStrategy"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam"
}
],
- "description": "Emitted when a new output item is added.",
- "x-oaiMeta": {
- "name": "response.output_item.added",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_item.added\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"in_progress\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": []\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Customize your own chunking strategy by setting chunk size and chunk overlap.",
+ "title": "Static Chunking Strategy"
},
- "OpenAI.ResponseOutputItemDoneEvent": {
+ "OpenAI.StaticChunkingStrategyResponseParam": {
"type": "object",
"required": [
"type",
- "output_index",
- "sequence_number",
- "item"
+ "static"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.output_item.done"
+ "static"
],
- "description": "The type of the event. Always `response.output_item.done`.",
+ "description": "Always `static`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that was marked done."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "item": {
- "$ref": "#/components/schemas/OpenAI.OutputItem",
- "description": "The output item that was marked done."
+ "static": {
+ "$ref": "#/components/schemas/OpenAI.StaticChunkingStrategy"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse"
}
],
- "description": "Emitted when an output item is marked done.",
- "x-oaiMeta": {
- "name": "response.output_item.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_item.done\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"completed\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"output_text\",\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"annotations\": []\n }\n ]\n },\n \"sequence_number\": 1\n}\n"
+ "title": "Static Chunking Strategy"
+ },
+ "OpenAI.StopConfiguration": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ ],
+ "description": "Not supported with latest reasoning models `o3` and `o4-mini`.\nUp to 4 sequences where the API will stop generating further tokens. The\nreturned text will not contain the stop sequence."
+ },
+ "OpenAI.SubmitToolOutputsRunRequest": {
+ "type": "object",
+ "required": [
+ "tool_outputs"
+ ],
+ "properties": {
+ "tool_outputs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.SubmitToolOutputsRunRequestToolOutputs"
+ },
+ "description": "A list of tools for which the outputs are being submitted."
+ },
+ "stream": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
}
},
- "OpenAI.ResponseOutputTextAnnotationAddedEvent": {
+ "OpenAI.SubmitToolOutputsRunRequestToolOutputs": {
+ "type": "object",
+ "properties": {
+ "tool_call_id": {
+ "type": "string"
+ },
+ "output": {
+ "type": "string"
+ }
+ }
+ },
+ "OpenAI.SummaryTextContent": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "content_index",
- "annotation_index",
- "sequence_number",
- "annotation"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.output_text.annotation.added"
+ "summary_text"
],
- "description": "The type of the event. Always 'response.output_text.annotation.added'.",
+ "description": "The type of the object. Always `summary_text`.",
"x-stainless-const": true
},
- "item_id": {
+ "text": {
"type": "string",
- "description": "The unique identifier of the item to which the annotation is being added."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item in the response's output array."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part within the output item."
- },
- "annotation_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the annotation within the content part."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "annotation": {
- "$ref": "#/components/schemas/OpenAI.Annotation",
- "description": "The annotation object being added. (See annotation schema for details.)"
+ "description": "A summary of the reasoning output from the model so far."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "Emitted when an annotation is added to output text content.",
- "title": "ResponseOutputTextAnnotationAddedEvent",
- "x-oaiMeta": {
- "name": "response.output_text.annotation.added",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_text.annotation.added\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"annotation_index\": 0,\n \"annotation\": {\n \"type\": \"text_annotation\",\n \"text\": \"This is a test annotation\",\n \"start\": 0,\n \"end\": 10\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "A summary text from the model.",
+ "title": "Summary text"
},
- "OpenAI.ResponsePromptVariables": {
+ "OpenAI.TextAnnotation": {
"type": "object",
- "unevaluatedProperties": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputTextContent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputImageContent"
- },
- {
- "$ref": "#/components/schemas/OpenAI.InputFileContent"
- }
- ]
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.TextAnnotationType"
+ }
},
- "description": "Optional map of values to substitute in for variables in your\nprompt. The substitution values can either be strings, or other\nResponse input types like images or files.",
- "title": "Prompt Variables",
- "x-oaiExpandable": true,
- "x-oaiTypeLabel": "map"
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "file_citation": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObject",
+ "file_path": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObject"
+ }
+ }
},
- "OpenAI.ResponseQueuedEvent": {
+ "OpenAI.TextAnnotationType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "file_citation",
+ "file_path"
+ ]
+ }
+ ]
+ },
+ "OpenAI.TextContent": {
"type": "object",
"required": [
"type",
- "response",
- "sequence_number"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.queued"
+ "text"
],
- "description": "The type of the event. Always 'response.queued'.",
"x-stainless-const": true
},
- "response": {
- "$ref": "#/components/schemas/OpenAI.Response",
- "description": "The full response object that is queued."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number for this event."
+ "text": {
+ "type": "string"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.MessageContent"
}
],
- "description": "Emitted when a response is queued and waiting to be processed.",
- "title": "ResponseQueuedEvent",
- "x-oaiMeta": {
- "name": "response.queued",
- "group": "responses",
- "example": "{\n \"type\": \"response.queued\",\n \"response\": {\n \"id\": \"res_123\",\n \"status\": \"queued\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "A text content.",
+ "title": "Text Content"
},
- "OpenAI.ResponseReasoningSummaryPartAddedEvent": {
+ "OpenAI.TextResponseFormatConfiguration": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "summary_index",
- "sequence_number",
- "part"
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfigurationType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "json_schema": "#/components/schemas/OpenAI.TextResponseFormatJsonSchema",
+ "text": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText",
+ "json_object": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject"
+ }
+ },
+ "description": "An object specifying the format that the model must output.\nConfiguring `{ \"type\": \"json_schema\" }` enables Structured Outputs,\nwhich ensures the model will match your supplied JSON schema. Learn more in the\n[Structured Outputs guide](/docs/guides/structured-outputs).\nThe default format is `{ \"type\": \"text\" }` with no additional options.\n*Not recommended for gpt-4o and newer models:**\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it."
+ },
+ "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject": {
+ "type": "object",
+ "required": [
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_summary_part.added"
+ "json_object"
],
- "description": "The type of the event. Always `response.reasoning_summary_part.added`.",
+ "description": "The type of response format being defined. Always `json_object`.",
"x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the item this summary part is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this summary part is associated with."
- },
- "summary_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the summary part within the reasoning summary."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
- },
- "part": {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart",
- "description": "The summary part that was added."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
}
],
- "description": "Emitted when a new reasoning summary part is added.",
- "x-oaiMeta": {
- "name": "response.reasoning_summary_part.added",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_summary_part.added\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"\"\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
+ "title": "JSON object"
},
- "OpenAI.ResponseReasoningSummaryPartAddedEventPart": {
+ "OpenAI.TextResponseFormatConfigurationResponseFormatText": {
"type": "object",
"required": [
- "type",
- "text"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "summary_text"
+ "text"
],
+ "description": "The type of response format being defined. Always `text`.",
"x-stainless-const": true
- },
- "text": {
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
+ }
+ ],
+ "description": "Default response format. Used to generate text responses.",
+ "title": "Text"
+ },
+ "OpenAI.TextResponseFormatConfigurationType": {
+ "anyOf": [
+ {
"type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "text",
+ "json_schema",
+ "json_object"
+ ]
}
- }
+ ]
},
- "OpenAI.ResponseReasoningSummaryPartDoneEvent": {
+ "OpenAI.TextResponseFormatJsonSchema": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "summary_index",
- "sequence_number",
- "part"
+ "name",
+ "schema"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_summary_part.done"
+ "json_schema"
],
- "description": "The type of the event. Always `response.reasoning_summary_part.done`.",
+ "description": "The type of response format being defined. Always `json_schema`.",
"x-stainless-const": true
},
- "item_id": {
+ "description": {
"type": "string",
- "description": "The ID of the item this summary part is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this summary part is associated with."
+ "description": "A description of what the response format is for, used by the model to\n determine how to respond in the format."
},
- "summary_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the summary part within the reasoning summary."
+ "name": {
+ "type": "string",
+ "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\n underscores and dashes, with a maximum length of 64."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "schema": {
+ "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema"
},
- "part": {
- "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEventPart",
- "description": "The completed summary part."
+ "strict": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
}
],
- "description": "Emitted when a reasoning summary part is completed.",
- "x-oaiMeta": {
- "name": "response.reasoning_summary_part.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_summary_part.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\"\n },\n \"sequence_number\": 1\n}\n"
- }
+ "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).",
+ "title": "JSON schema"
},
- "OpenAI.ResponseReasoningSummaryPartDoneEventPart": {
+ "OpenAI.ThreadObject": {
"type": "object",
"required": [
- "type",
- "text"
+ "id",
+ "object",
+ "created_at",
+ "tool_resources",
+ "metadata"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "summary_text"
+ "thread"
],
+ "description": "The object type, which is always `thread`.",
"x-stainless-const": true
},
- "text": {
- "type": "string"
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the thread was created."
+ },
+ "tool_resources": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResources"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "description": "Represents a thread that contains [messages](/docs/api-reference/messages).",
+ "title": "Thread",
+ "x-oaiMeta": {
+ "name": "The thread object",
+ "beta": true,
+ "example": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1698107661,\n \"metadata\": {}\n}\n"
+ }
+ },
+ "OpenAI.ThreadObjectToolResources": {
+ "type": "object",
+ "properties": {
+ "code_interpreter": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResourcesCodeInterpreter"
+ },
+ "file_search": {
+ "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResourcesFileSearch"
+ }
+ }
+ },
+ "OpenAI.ThreadObjectToolResourcesCodeInterpreter": {
+ "type": "object",
+ "properties": {
+ "file_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 20
+ }
+ }
+ },
+ "OpenAI.ThreadObjectToolResourcesFileSearch": {
+ "type": "object",
+ "properties": {
+ "vector_store_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "maxItems": 1
+ }
+ }
+ },
+ "OpenAI.TokenLimits": {
+ "type": "object",
+ "properties": {
+ "post_instructions": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 0
+ }
+ }
+ },
+ "OpenAI.Tool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ToolType"
+ }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "bing_grounding": "#/components/schemas/BingGroundingTool",
+ "fabric_dataagent_preview": "#/components/schemas/MicrosoftFabricPreviewTool",
+ "sharepoint_grounding_preview": "#/components/schemas/SharepointPreviewTool",
+ "azure_ai_search": "#/components/schemas/AzureAISearchTool",
+ "openapi": "#/components/schemas/OpenApiTool",
+ "bing_custom_search_preview": "#/components/schemas/BingCustomSearchPreviewTool",
+ "browser_automation_preview": "#/components/schemas/BrowserAutomationPreviewTool",
+ "azure_function": "#/components/schemas/AzureFunctionTool",
+ "capture_structured_outputs": "#/components/schemas/CaptureStructuredOutputsTool",
+ "a2a_preview": "#/components/schemas/A2APreviewTool",
+ "work_iq_preview": "#/components/schemas/WorkIQPreviewTool",
+ "fabric_iq_preview": "#/components/schemas/FabricIQPreviewTool",
+ "web_iq_preview": "#/components/schemas/WebIQPreviewTool",
+ "memory_search_preview": "#/components/schemas/MemorySearchPreviewTool",
+ "memory_search": "#/components/schemas/MemorySearchTool",
+ "code_interpreter": "#/components/schemas/OpenAI.CodeInterpreterTool",
+ "function": "#/components/schemas/OpenAI.FunctionTool",
+ "file_search": "#/components/schemas/OpenAI.FileSearchTool",
+ "computer_use_preview": "#/components/schemas/OpenAI.ComputerUsePreviewTool",
+ "web_search": "#/components/schemas/OpenAI.WebSearchTool",
+ "mcp": "#/components/schemas/OpenAI.MCPTool",
+ "image_generation": "#/components/schemas/OpenAI.ImageGenTool",
+ "local_shell": "#/components/schemas/OpenAI.LocalShellToolParam",
+ "shell": "#/components/schemas/OpenAI.FunctionShellToolParam",
+ "custom": "#/components/schemas/OpenAI.CustomToolParam",
+ "web_search_preview": "#/components/schemas/OpenAI.WebSearchPreviewTool",
+ "apply_patch": "#/components/schemas/OpenAI.ApplyPatchToolParam",
+ "computer": "#/components/schemas/OpenAI.ComputerTool",
+ "namespace": "#/components/schemas/OpenAI.NamespaceToolParam",
+ "tool_search": "#/components/schemas/OpenAI.ToolSearchToolParam"
}
- }
+ },
+ "description": "A tool that can be used to generate a response."
},
- "OpenAI.ResponseReasoningSummaryTextDeltaEvent": {
+ "OpenAI.ToolChoiceAllowed": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "summary_index",
- "delta",
- "sequence_number"
+ "mode",
+ "tools"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_summary_text.delta"
+ "allowed_tools"
],
- "description": "The type of the event. Always `response.reasoning_summary_text.delta`.",
+ "description": "Allowed tool configuration type. Always `allowed_tools`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the item this summary text delta is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this summary text delta is associated with."
- },
- "summary_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the summary part within the reasoning summary."
- },
- "delta": {
+ "mode": {
"type": "string",
- "description": "The text delta that was added to the summary."
+ "enum": [
+ "auto",
+ "required"
+ ],
+ "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools."
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "tools": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "unevaluatedProperties": {}
+ },
+ "description": "A list of tool definitions that the model should be allowed to call.\n For the Responses API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"name\": \"get_weather\" },\n { \"type\": \"mcp\", \"server_label\": \"deepwiki\" },\n { \"type\": \"image_generation\" }\n ]\n ```"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a delta is added to a reasoning summary text.",
- "x-oaiMeta": {
- "name": "response.reasoning_summary_text.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_summary_text.delta\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"delta\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Constrains the tools available to the model to a pre-defined set.",
+ "title": "Allowed tools"
},
- "OpenAI.ResponseReasoningSummaryTextDoneEvent": {
+ "OpenAI.ToolChoiceCodeInterpreter": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "summary_index",
- "text",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_summary_text.done"
- ],
- "description": "The type of the event. Always `response.reasoning_summary_text.done`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the item this summary text is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this summary text is associated with."
- },
- "summary_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the summary part within the reasoning summary."
- },
- "text": {
- "type": "string",
- "description": "The full text of the completed reasoning summary."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "code_interpreter"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a reasoning summary text is completed.",
- "x-oaiMeta": {
- "name": "response.reasoning_summary_text.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_summary_text.done\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"text\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseReasoningTextDeltaEvent": {
+ "OpenAI.ToolChoiceComputer": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "delta",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_text.delta"
- ],
- "description": "The type of the event. Always `response.reasoning_text.delta`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the item this reasoning text delta is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this reasoning text delta is associated with."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the reasoning content part this delta is associated with."
- },
- "delta": {
- "type": "string",
- "description": "The text delta that was added to the reasoning content."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "computer"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a delta is added to a reasoning text.",
- "x-oaiMeta": {
- "name": "response.reasoning_text.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_text.delta\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"The\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseReasoningTextDoneEvent": {
+ "OpenAI.ToolChoiceComputerUse": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "text",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.reasoning_text.done"
- ],
- "description": "The type of the event. Always `response.reasoning_text.done`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the item this reasoning text is associated with."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item this reasoning text is associated with."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the reasoning content part."
- },
- "text": {
- "type": "string",
- "description": "The full text of the completed reasoning content."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "computer_use"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a reasoning text is completed.",
- "x-oaiMeta": {
- "name": "response.reasoning_text.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.reasoning_text.done\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"The user is asking...\",\n \"sequence_number\": 4\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseRefusalDeltaEvent": {
+ "OpenAI.ToolChoiceComputerUsePreview": {
"type": "object",
"required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "delta",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.refusal.delta"
- ],
- "description": "The type of the event. Always `response.refusal.delta`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the refusal text is added to."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the refusal text is added to."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that the refusal text is added to."
- },
- "delta": {
- "type": "string",
- "description": "The refusal text that is added."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "computer_use_preview"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when there is a partial refusal text.",
- "x-oaiMeta": {
- "name": "response.refusal.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.refusal.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"refusal text so far\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseRefusalDoneEvent": {
+ "OpenAI.ToolChoiceCustom": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "content_index",
- "refusal",
- "sequence_number"
+ "name"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.refusal.done"
+ "custom"
],
- "description": "The type of the event. Always `response.refusal.done`.",
+ "description": "For custom tool calling, the type is always `custom`.",
"x-stainless-const": true
},
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the refusal text is finalized."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the refusal text is finalized."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that the refusal text is finalized."
- },
- "refusal": {
+ "name": {
"type": "string",
- "description": "The refusal text that is finalized."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of this event."
+ "description": "The name of the custom tool to call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when refusal text is finalized.",
- "x-oaiMeta": {
- "name": "response.refusal.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.refusal.done\",\n \"item_id\": \"item-abc\",\n \"output_index\": 1,\n \"content_index\": 2,\n \"refusal\": \"final refusal text\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Use this option to force the model to call a specific custom tool.",
+ "title": "Custom tool"
},
- "OpenAI.ResponseStreamEvent": {
+ "OpenAI.ToolChoiceFileSearch": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEventType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "response.audio.transcript.delta": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent",
- "response.code_interpreter_call_code.delta": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent",
- "response.code_interpreter_call.in_progress": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent",
- "response.code_interpreter_call.interpreting": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent",
- "response.content_part.added": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent",
- "response.created": "#/components/schemas/OpenAI.ResponseCreatedEvent",
- "error": "#/components/schemas/OpenAI.ResponseErrorEvent",
- "response.file_search_call.in_progress": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent",
- "response.file_search_call.searching": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent",
- "response.function_call_arguments.delta": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent",
- "response.in_progress": "#/components/schemas/OpenAI.ResponseInProgressEvent",
- "response.failed": "#/components/schemas/OpenAI.ResponseFailedEvent",
- "response.incomplete": "#/components/schemas/OpenAI.ResponseIncompleteEvent",
- "response.output_item.added": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent",
- "response.reasoning_summary_part.added": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent",
- "response.reasoning_summary_text.delta": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent",
- "response.reasoning_text.delta": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent",
- "response.refusal.delta": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent",
- "response.output_text.delta": "#/components/schemas/OpenAI.ResponseTextDeltaEvent",
- "response.web_search_call.in_progress": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent",
- "response.web_search_call.searching": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent",
- "response.image_generation_call.generating": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent",
- "response.image_generation_call.in_progress": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent",
- "response.image_generation_call.partial_image": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent",
- "response.mcp_call_arguments.delta": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent",
- "response.mcp_call.failed": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent",
- "response.mcp_call.in_progress": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent",
- "response.mcp_list_tools.failed": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent",
- "response.mcp_list_tools.in_progress": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent",
- "response.output_text.annotation.added": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent",
- "response.queued": "#/components/schemas/OpenAI.ResponseQueuedEvent",
- "response.custom_tool_call_input.delta": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent",
- "response.audio.done": "#/components/schemas/OpenAI.ResponseAudioDoneEvent",
- "response.audio.transcript.done": "#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent",
- "response.code_interpreter_call_code.done": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent",
- "response.code_interpreter_call.completed": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent",
- "response.completed": "#/components/schemas/OpenAI.ResponseCompletedEvent",
- "response.content_part.done": "#/components/schemas/OpenAI.ResponseContentPartDoneEvent",
- "response.file_search_call.completed": "#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent",
- "response.function_call_arguments.done": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent",
- "response.output_item.done": "#/components/schemas/OpenAI.ResponseOutputItemDoneEvent",
- "response.reasoning_summary_part.done": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent",
- "response.reasoning_summary_text.done": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent",
- "response.reasoning_text.done": "#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent",
- "response.refusal.done": "#/components/schemas/OpenAI.ResponseRefusalDoneEvent",
- "response.output_text.done": "#/components/schemas/OpenAI.ResponseTextDoneEvent",
- "response.web_search_call.completed": "#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent",
- "response.image_generation_call.completed": "#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent",
- "response.mcp_call_arguments.done": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent",
- "response.mcp_call.completed": "#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent",
- "response.mcp_list_tools.completed": "#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent",
- "response.custom_tool_call_input.done": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent",
- "response.audio.delta": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent"
- }
- }
- },
- "OpenAI.ResponseStreamEventType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
"type": "string",
"enum": [
- "response.audio.delta",
- "response.audio.done",
- "response.audio.transcript.delta",
- "response.audio.transcript.done",
- "response.code_interpreter_call_code.delta",
- "response.code_interpreter_call_code.done",
- "response.code_interpreter_call.completed",
- "response.code_interpreter_call.in_progress",
- "response.code_interpreter_call.interpreting",
- "response.completed",
- "response.content_part.added",
- "response.content_part.done",
- "response.created",
- "error",
- "response.file_search_call.completed",
- "response.file_search_call.in_progress",
- "response.file_search_call.searching",
- "response.function_call_arguments.delta",
- "response.function_call_arguments.done",
- "response.in_progress",
- "response.failed",
- "response.incomplete",
- "response.output_item.added",
- "response.output_item.done",
- "response.reasoning_summary_part.added",
- "response.reasoning_summary_part.done",
- "response.reasoning_summary_text.delta",
- "response.reasoning_summary_text.done",
- "response.reasoning_text.delta",
- "response.reasoning_text.done",
- "response.refusal.delta",
- "response.refusal.done",
- "response.output_text.delta",
- "response.output_text.done",
- "response.web_search_call.completed",
- "response.web_search_call.in_progress",
- "response.web_search_call.searching",
- "response.image_generation_call.completed",
- "response.image_generation_call.generating",
- "response.image_generation_call.in_progress",
- "response.image_generation_call.partial_image",
- "response.mcp_call_arguments.delta",
- "response.mcp_call_arguments.done",
- "response.mcp_call.completed",
- "response.mcp_call.failed",
- "response.mcp_call.in_progress",
- "response.mcp_list_tools.completed",
- "response.mcp_list_tools.failed",
- "response.mcp_list_tools.in_progress",
- "response.output_text.annotation.added",
- "response.queued",
- "response.custom_tool_call_input.delta",
- "response.custom_tool_call_input.done"
+ "file_search"
]
}
- ]
- },
- "OpenAI.ResponseStreamOptions": {
- "type": "object",
- "properties": {
- "include_obfuscation": {
- "type": "boolean",
- "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API."
- }
- },
- "description": "Options for streaming responses. Only set this when you set `stream: true`."
- },
- "OpenAI.ResponseTextDeltaEvent": {
- "type": "object",
- "required": [
- "type",
- "item_id",
- "output_index",
- "content_index",
- "delta",
- "sequence_number",
- "logprobs"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "response.output_text.delta"
- ],
- "description": "The type of the event. Always `response.output_text.delta`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the text delta was added to."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the text delta was added to."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that the text delta was added to."
- },
- "delta": {
- "type": "string",
- "description": "The text delta that was added."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number for this event."
- },
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ResponseLogProb"
- },
- "description": "The log probabilities of the tokens in the delta."
- }
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when there is an additional text delta.",
- "x-oaiMeta": {
- "name": "response.output_text.delta",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_text.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"In\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseTextDoneEvent": {
+ "OpenAI.ToolChoiceFunction": {
"type": "object",
"required": [
"type",
- "item_id",
- "output_index",
- "content_index",
- "text",
- "sequence_number",
- "logprobs"
+ "name"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.output_text.done"
- ],
- "description": "The type of the event. Always `response.output_text.done`.",
- "x-stainless-const": true
- },
- "item_id": {
- "type": "string",
- "description": "The ID of the output item that the text content is finalized."
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the text content is finalized."
- },
- "content_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the content part that the text content is finalized."
- },
- "text": {
- "type": "string",
- "description": "The text content that is finalized."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number for this event."
- },
- "logprobs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.ResponseLogProb"
- },
- "description": "The log probabilities of the tokens in the delta."
+ "function"
+ ],
+ "description": "For function calling, the type is always `function`.",
+ "x-stainless-const": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the function to call."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when text content is finalized.",
- "x-oaiMeta": {
- "name": "response.output_text.done",
- "group": "responses",
- "example": "{\n \"type\": \"response.output_text.done\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"text\": \"In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.\",\n \"sequence_number\": 1\n}\n"
- }
+ "description": "Use this option to force the model to call a specific function.",
+ "title": "Function tool"
},
- "OpenAI.ResponseTextParam": {
+ "OpenAI.ToolChoiceImageGeneration": {
"type": "object",
+ "required": [
+ "type"
+ ],
"properties": {
- "format": {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
- },
- "verbosity": {
- "$ref": "#/components/schemas/OpenAI.Verbosity"
+ "type": {
+ "type": "string",
+ "enum": [
+ "image_generation"
+ ]
}
},
- "description": "Configuration options for a text response from the model. Can be plain\ntext or structured JSON data. Learn more:\n- [Text inputs and outputs](/docs/guides/text)\n- [Structured Outputs](/docs/guides/structured-outputs)"
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ }
+ ],
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseUsage": {
+ "OpenAI.ToolChoiceMCP": {
"type": "object",
"required": [
- "input_tokens",
- "input_tokens_details",
- "output_tokens",
- "output_tokens_details",
- "total_tokens"
+ "type",
+ "server_label"
],
"properties": {
- "input_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The number of input tokens."
- },
- "input_tokens_details": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails",
- "description": "A detailed breakdown of the input tokens."
- },
- "output_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The number of output tokens."
+ "type": {
+ "type": "string",
+ "enum": [
+ "mcp"
+ ],
+ "description": "For MCP tools, the type is always `mcp`.",
+ "x-stainless-const": true
},
- "output_tokens_details": {
- "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails",
- "description": "A detailed breakdown of the output tokens."
+ "server_label": {
+ "type": "string",
+ "description": "The label of the MCP server to use."
},
- "total_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The total number of tokens used."
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "description": "Represents token usage details including input tokens, output tokens,\na breakdown of output tokens, and the total tokens used."
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ }
+ ],
+ "description": "Use this option to force the model to call a specific tool on a remote MCP server.",
+ "title": "MCP tool"
},
- "OpenAI.ResponseUsageInputTokensDetails": {
- "type": "object",
- "required": [
- "cached_tokens"
+ "OpenAI.ToolChoiceOptions": {
+ "type": "string",
+ "enum": [
+ "none",
+ "auto",
+ "required"
],
- "properties": {
- "cached_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
- }
+ "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or\nmore tools.\n`required` means the model must call one or more tools.",
+ "title": "Tool choice mode"
},
- "OpenAI.ResponseUsageOutputTokensDetails": {
+ "OpenAI.ToolChoiceParam": {
"type": "object",
"required": [
- "reasoning_tokens"
+ "type"
],
"properties": {
- "reasoning_tokens": {
- "$ref": "#/components/schemas/OpenAI.integer"
+ "type": {
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParamType"
}
- }
+ },
+ "discriminator": {
+ "propertyName": "type",
+ "mapping": {
+ "allowed_tools": "#/components/schemas/OpenAI.ToolChoiceAllowed",
+ "function": "#/components/schemas/OpenAI.ToolChoiceFunction",
+ "mcp": "#/components/schemas/OpenAI.ToolChoiceMCP",
+ "custom": "#/components/schemas/OpenAI.ToolChoiceCustom",
+ "apply_patch": "#/components/schemas/OpenAI.SpecificApplyPatchParam",
+ "shell": "#/components/schemas/OpenAI.SpecificFunctionShellParam",
+ "file_search": "#/components/schemas/OpenAI.ToolChoiceFileSearch",
+ "web_search_preview": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview",
+ "computer_use_preview": "#/components/schemas/OpenAI.ToolChoiceComputerUsePreview",
+ "web_search_preview_2025_03_11": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311",
+ "image_generation": "#/components/schemas/OpenAI.ToolChoiceImageGeneration",
+ "code_interpreter": "#/components/schemas/OpenAI.ToolChoiceCodeInterpreter",
+ "computer": "#/components/schemas/OpenAI.ToolChoiceComputer",
+ "computer_use": "#/components/schemas/OpenAI.ToolChoiceComputerUse"
+ }
+ },
+ "description": "How the model should select which tool (or tools) to use when generating\na response. See the `tools` parameter to see how to specify which tools\nthe model can call."
},
- "OpenAI.ResponseWebSearchCallCompletedEvent": {
+ "OpenAI.ToolChoiceParamType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "allowed_tools",
+ "function",
+ "mcp",
+ "custom",
+ "apply_patch",
+ "shell",
+ "file_search",
+ "web_search_preview",
+ "computer_use_preview",
+ "web_search_preview_2025_03_11",
+ "image_generation",
+ "code_interpreter",
+ "computer",
+ "computer_use"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ToolChoiceWebSearchPreview": {
"type": "object",
"required": [
- "type",
- "output_index",
- "item_id",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.web_search_call.completed"
- ],
- "description": "The type of the event. Always `response.web_search_call.completed`.",
- "x-stainless-const": true
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the web search call is associated with."
- },
- "item_id": {
- "type": "string",
- "description": "Unique ID for the output item associated with the web search call."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the web search call being processed."
+ "web_search_preview"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a web search call is completed.",
- "x-oaiMeta": {
- "name": "response.web_search_call.completed",
- "group": "responses",
- "example": "{\n \"type\": \"response.web_search_call.completed\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseWebSearchCallInProgressEvent": {
+ "OpenAI.ToolChoiceWebSearchPreview20250311": {
"type": "object",
"required": [
- "type",
- "output_index",
- "item_id",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.web_search_call.in_progress"
- ],
- "description": "The type of the event. Always `response.web_search_call.in_progress`.",
- "x-stainless-const": true
- },
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the web search call is associated with."
- },
- "item_id": {
- "type": "string",
- "description": "Unique ID for the output item associated with the web search call."
- },
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the web search call being processed."
+ "web_search_preview_2025_03_11"
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
}
],
- "description": "Emitted when a web search call is initiated.",
- "x-oaiMeta": {
- "name": "response.web_search_call.in_progress",
- "group": "responses",
- "example": "{\n \"type\": \"response.web_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
- }
+ "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
},
- "OpenAI.ResponseWebSearchCallSearchingEvent": {
+ "OpenAI.ToolSearchExecutionType": {
+ "type": "string",
+ "enum": [
+ "server",
+ "client"
+ ]
+ },
+ "OpenAI.ToolSearchToolParam": {
"type": "object",
"required": [
- "type",
- "output_index",
- "item_id",
- "sequence_number"
+ "type"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "response.web_search_call.searching"
+ "tool_search"
],
- "description": "The type of the event. Always `response.web_search_call.searching`.",
+ "description": "The type of the tool. Always `tool_search`.",
"x-stainless-const": true
},
- "output_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the output item that the web search call is associated with."
+ "execution": {
+ "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
+ "description": "Whether tool search is executed by the server or by the client."
},
- "item_id": {
- "type": "string",
- "description": "Unique ID for the output item associated with the web search call."
+ "description": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "sequence_number": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The sequence number of the web search call being processed."
+ "parameters": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.EmptyModelParam"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ResponseStreamEvent"
+ "$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "Emitted when a web search call is executing.",
- "x-oaiMeta": {
- "name": "response.web_search_call.searching",
- "group": "responses",
- "example": "{\n \"type\": \"response.web_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n"
- }
+ "description": "Hosted or BYOT tool search configuration for deferred tools.",
+ "title": "Tool search tool"
},
- "OpenAI.ScreenshotParam": {
+ "OpenAI.ToolType": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "function",
+ "file_search",
+ "computer",
+ "computer_use_preview",
+ "web_search",
+ "mcp",
+ "code_interpreter",
+ "image_generation",
+ "local_shell",
+ "shell",
+ "custom",
+ "namespace",
+ "tool_search",
+ "web_search_preview",
+ "apply_patch",
+ "a2a_preview",
+ "bing_custom_search_preview",
+ "browser_automation_preview",
+ "fabric_dataagent_preview",
+ "sharepoint_grounding_preview",
+ "memory_search_preview",
+ "work_iq_preview",
+ "fabric_iq_preview",
+ "web_iq_preview",
+ "toolbox_search_preview",
+ "azure_ai_search",
+ "azure_function",
+ "bing_grounding",
+ "capture_structured_outputs",
+ "openapi",
+ "memory_search"
+ ]
+ }
+ ]
+ },
+ "OpenAI.ToolsArray": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ },
+ "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\nWe support the following categories of tools:\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\nmodel's capabilities, like [web search](/docs/guides/tools-web-search)\nor [file search](/docs/guides/tools-file-search). Learn more about\n[built-in tools](/docs/guides/tools).\n- **MCP Tools**: Integrations with third-party systems via custom MCP servers\nor predefined connectors such as Google Drive and SharePoint. Learn more about\n[MCP Tools](/docs/guides/tools-connectors-mcp).\n- **Function calls (custom tools)**: Functions that are defined by you,\nenabling the model to call your own code with strongly typed arguments\nand outputs. Learn more about\n[function calling](/docs/guides/function-calling). You can also use\ncustom tools to call your own code."
+ },
+ "OpenAI.TopLogProb": {
"type": "object",
"required": [
- "type"
+ "token",
+ "logprob",
+ "bytes"
+ ],
+ "properties": {
+ "token": {
+ "type": "string"
+ },
+ "logprob": {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ "bytes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
+ },
+ "description": "The top log probability of a token.",
+ "title": "Top log probability"
+ },
+ "OpenAI.TranscriptTextUsageDuration": {
+ "type": "object",
+ "required": [
+ "type",
+ "seconds"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "screenshot"
+ "duration"
],
- "description": "Specifies the event type. For a screenshot action, this property is always set to `screenshot`.",
+ "description": "The type of the usage object. Always `duration` for this variant.",
"x-stainless-const": true
+ },
+ "seconds": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Duration of the input audio in seconds.",
+ "x-ms-duration": "seconds"
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage"
}
],
- "description": "A screenshot action.",
- "title": "Screenshot"
+ "description": "Usage statistics for models billed by audio input duration.",
+ "title": "Duration Usage"
},
- "OpenAI.ScrollParam": {
+ "OpenAI.TranscriptTextUsageTokens": {
"type": "object",
"required": [
"type",
- "x",
- "y",
- "scroll_x",
- "scroll_y"
+ "input_tokens",
+ "output_tokens",
+ "total_tokens"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "scroll"
+ "tokens"
],
- "description": "Specifies the event type. For a scroll action, this property is always set to `scroll`.",
+ "description": "The type of the usage object. Always `tokens` for this variant.",
"x-stainless-const": true
},
- "x": {
+ "input_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The x-coordinate where the scroll occurred."
+ "description": "Number of input tokens billed for this request."
},
- "y": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The y-coordinate where the scroll occurred."
+ "input_token_details": {
+ "$ref": "#/components/schemas/OpenAI.TranscriptTextUsageTokensInputTokenDetails",
+ "description": "Details about the input tokens billed for this request."
},
- "scroll_x": {
+ "output_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The horizontal scroll distance."
+ "description": "Number of output tokens generated."
},
- "scroll_y": {
+ "total_tokens": {
"$ref": "#/components/schemas/OpenAI.integer",
- "description": "The vertical scroll distance."
- },
- "keys": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "description": "Total number of tokens used (input + output)."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
+ "$ref": "#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage"
}
],
- "description": "A scroll action.",
- "title": "Scroll"
- },
- "OpenAI.SearchContentType": {
- "type": "string",
- "enum": [
- "text",
- "image"
- ]
+ "description": "Usage statistics for models billed by token usage.",
+ "title": "Token Usage"
},
- "OpenAI.SearchContextSize": {
- "type": "string",
- "enum": [
- "low",
- "medium",
- "high"
- ]
+ "OpenAI.TranscriptTextUsageTokensInputTokenDetails": {
+ "type": "object",
+ "properties": {
+ "text_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "audio_tokens": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
},
- "OpenAI.ServiceTier": {
- "anyOf": [
- {
+ "OpenAI.TranscriptionDiarizedSegment": {
+ "type": "object",
+ "required": [
+ "type",
+ "id",
+ "start",
+ "end",
+ "text",
+ "speaker"
+ ],
+ "properties": {
+ "type": {
"type": "string",
"enum": [
- "auto",
- "default",
- "flex",
- "scale",
- "priority"
- ]
+ "transcript.text.segment"
+ ],
+ "description": "The type of the segment. Always `transcript.text.segment`.",
+ "x-stainless-const": true
},
- {
- "type": "null"
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the segment."
+ },
+ "start": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Start timestamp of the segment in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "end": {
+ "type": "integer",
+ "format": "int64",
+ "description": "End timestamp of the segment in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "text": {
+ "type": "string",
+ "description": "Transcript text for this segment."
+ },
+ "speaker": {
+ "type": "string",
+ "description": "Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...)."
}
- ],
- "description": "Specifies the processing type used for serving the request.\n- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n- If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.\n- When not set, the default behavior is 'auto'.\nWhen 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."
+ },
+ "description": "A segment of diarized transcript text with speaker metadata."
},
- "OpenAI.ServiceTierEnum": {
+ "OpenAI.TranscriptionInclude": {
"type": "string",
"enum": [
- "auto",
- "default",
- "flex",
- "priority"
+ "logprobs"
]
},
- "OpenAI.SkillReferenceParam": {
+ "OpenAI.TranscriptionSegment": {
"type": "object",
"required": [
- "type",
- "skill_id"
+ "id",
+ "seek",
+ "start",
+ "end",
+ "text",
+ "tokens",
+ "temperature",
+ "avg_logprob",
+ "compression_ratio",
+ "no_speech_prob"
],
"properties": {
- "type": {
+ "id": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Unique identifier of the segment."
+ },
+ "seek": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Seek offset of the segment."
+ },
+ "start": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Start time of the segment in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "end": {
+ "type": "integer",
+ "format": "int64",
+ "description": "End time of the segment in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "text": {
"type": "string",
- "enum": [
- "skill_reference"
- ],
- "description": "References a skill created with the /v1/skills endpoint.",
- "x-stainless-const": true
+ "description": "Text content of the segment."
+ },
+ "tokens": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "description": "Array of token IDs for the text content."
+ },
+ "temperature": {
+ "type": "number",
+ "format": "float",
+ "description": "Temperature parameter used for generating the segment."
+ },
+ "avg_logprob": {
+ "type": "number",
+ "format": "float",
+ "description": "Average logprob of the segment. If the value is lower than -1, consider the logprobs failed."
},
- "skill_id": {
- "type": "string",
- "minLength": 1,
- "maxLength": 64,
- "description": "The ID of the referenced skill."
+ "compression_ratio": {
+ "type": "number",
+ "format": "float",
+ "description": "Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed."
},
- "version": {
- "type": "string",
- "description": "Optional skill version. Use a positive integer or 'latest'. Omit for default."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ContainerSkill"
+ "no_speech_prob": {
+ "type": "number",
+ "format": "float",
+ "description": "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."
}
- ]
+ }
},
- "OpenAI.SpecificApplyPatchParam": {
+ "OpenAI.TranscriptionWord": {
"type": "object",
"required": [
- "type"
+ "word",
+ "start",
+ "end"
],
"properties": {
- "type": {
+ "word": {
"type": "string",
- "enum": [
- "apply_patch"
- ],
- "description": "The tool to call. Always `apply_patch`.",
- "x-stainless-const": true
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ "description": "The text content of the word."
+ },
+ "start": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Start time of the word in seconds.",
+ "x-ms-duration": "seconds"
+ },
+ "end": {
+ "type": "integer",
+ "format": "int64",
+ "description": "End time of the word in seconds.",
+ "x-ms-duration": "seconds"
}
- ],
- "description": "Forces the model to call the apply_patch tool when executing a tool call.",
- "title": "Specific apply patch tool choice"
+ }
},
- "OpenAI.SpecificFunctionShellParam": {
+ "OpenAI.TruncationObject": {
"type": "object",
"required": [
"type"
@@ -52349,21 +74444,26 @@
"type": {
"type": "string",
"enum": [
- "shell"
+ "auto",
+ "last_messages"
],
- "description": "The tool to call. Always `shell`.",
- "x-stainless-const": true
+ "description": "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`."
+ },
+ "last_messages": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Forces the model to call the shell tool when a tool call is required.",
- "title": "Specific shell tool choice"
+ "description": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.",
+ "title": "Thread Truncation Controls"
},
- "OpenAI.SummaryTextContent": {
+ "OpenAI.TypeParam": {
"type": "object",
"required": [
"type",
@@ -52373,460 +74473,920 @@
"type": {
"type": "string",
"enum": [
- "summary_text"
+ "type"
],
- "description": "The type of the object. Always `summary_text`.",
+ "description": "Specifies the event type. For a type action, this property is always set to `type`.",
"x-stainless-const": true
},
"text": {
"type": "string",
- "description": "A summary of the reasoning output from the model so far."
+ "description": "The text to type."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.MessageContent"
+ "$ref": "#/components/schemas/OpenAI.ComputerAction"
}
],
- "description": "A summary text from the model.",
- "title": "Summary text"
+ "description": "An action to type in text.",
+ "title": "Type"
},
- "OpenAI.TextContent": {
+ "OpenAI.UpdateChatCompletionParametersBody": {
"type": "object",
"required": [
- "type",
- "text"
+ "metadata"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "text"
- ],
- "x-stainless-const": true
- },
- "text": {
- "type": "string"
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.MessageContent"
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
+ }
+ },
+ "OpenAI.UpdateConversationBody": {
+ "type": "object",
+ "required": [
+ "metadata"
],
- "description": "A text content.",
- "title": "Text Content"
+ "properties": {
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
+ }
+ }
},
- "OpenAI.TextResponseFormatConfiguration": {
+ "OpenAI.UpdateVectorStoreFileAttributesRequest": {
"type": "object",
"required": [
- "type"
+ "attributes"
],
"properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfigurationType"
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "json_schema": "#/components/schemas/OpenAI.TextResponseFormatJsonSchema",
- "text": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText",
- "json_object": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject"
+ "x-oaiMeta": {
+ "name": "Update vector store file attributes request"
+ }
+ },
+ "OpenAI.UpdateVectorStoreRequest": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The name of the vector store."
+ },
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
- },
- "description": "An object specifying the format that the model must output.\nConfiguring `{ \"type\": \"json_schema\" }` enables Structured Outputs,\nwhich ensures the model will match your supplied JSON schema. Learn more in the\n[Structured Outputs guide](/docs/guides/structured-outputs).\nThe default format is `{ \"type\": \"text\" }` with no additional options.\n*Not recommended for gpt-4o and newer models:**\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it."
+ }
},
- "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject": {
+ "OpenAI.Upload": {
"type": "object",
"required": [
- "type"
+ "id",
+ "created_at",
+ "filename",
+ "bytes",
+ "purpose",
+ "status",
+ "expires_at"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The Upload unique identifier, which can be referenced in API endpoints."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the Upload was created."
+ },
+ "filename": {
+ "type": "string",
+ "description": "The name of the file to be uploaded."
+ },
+ "bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The intended number of bytes to be uploaded."
+ },
+ "purpose": {
+ "type": "string",
+ "description": "The intended purpose of the file. [Please refer here](/docs/api-reference/files/object#files/object-purpose) for acceptable values."
+ },
+ "status": {
"type": "string",
"enum": [
- "json_object"
+ "pending",
+ "completed",
+ "cancelled",
+ "expired"
],
- "description": "The type of response format being defined. Always `json_object`.",
+ "description": "The status of the Upload."
+ },
+ "expires_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the Upload will expire."
+ },
+ "object": {
+ "type": "string",
+ "enum": [
+ "upload"
+ ],
+ "description": "The object type, which is always \"upload\".",
"x-stainless-const": true
+ },
+ "file": {
+ "$ref": "#/components/schemas/OpenAI.OpenAIFile"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
- }
- ],
- "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.",
- "title": "JSON object"
+ "description": "The Upload object can accept byte chunks in the form of Parts.",
+ "title": "Upload",
+ "x-oaiMeta": {
+ "name": "The upload object",
+ "example": "{\n \"id\": \"upload_abc123\",\n \"object\": \"upload\",\n \"bytes\": 2147483648,\n \"created_at\": 1719184911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n \"status\": \"completed\",\n \"expires_at\": 1719127296,\n \"file\": {\n \"id\": \"file-xyz321\",\n \"object\": \"file\",\n \"bytes\": 2147483648,\n \"created_at\": 1719186911,\n \"filename\": \"training_examples.jsonl\",\n \"purpose\": \"fine-tune\",\n }\n}\n"
+ }
},
- "OpenAI.TextResponseFormatConfigurationResponseFormatText": {
+ "OpenAI.UploadPart": {
"type": "object",
"required": [
- "type"
+ "id",
+ "created_at",
+ "upload_id",
+ "object"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The upload Part unique identifier, which can be referenced in API endpoints."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the Part was created."
+ },
+ "upload_id": {
+ "type": "string",
+ "description": "The ID of the Upload object that this Part was added to."
+ },
+ "object": {
"type": "string",
"enum": [
- "text"
+ "upload.part"
],
- "description": "The type of response format being defined. Always `text`.",
+ "description": "The object type, which is always `upload.part`.",
"x-stainless-const": true
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
- }
- ],
- "description": "Default response format. Used to generate text responses.",
- "title": "Text"
- },
- "OpenAI.TextResponseFormatConfigurationType": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "text",
- "json_schema",
- "json_object"
- ]
- }
- ]
+ "description": "The upload Part represents a chunk of bytes we can add to an Upload object.",
+ "title": "UploadPart",
+ "x-oaiMeta": {
+ "name": "The upload part object",
+ "example": "{\n \"id\": \"part_def456\",\n \"object\": \"upload.part\",\n \"created_at\": 1719186911,\n \"upload_id\": \"upload_abc123\"\n}\n"
+ }
},
- "OpenAI.TextResponseFormatJsonSchema": {
+ "OpenAI.UrlCitationBody": {
"type": "object",
"required": [
"type",
- "name",
- "schema"
+ "url",
+ "start_index",
+ "end_index",
+ "title"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "json_schema"
+ "url_citation"
],
- "description": "The type of response format being defined. Always `json_schema`.",
+ "description": "The type of the URL citation. Always `url_citation`.",
"x-stainless-const": true
},
- "description": {
+ "url": {
"type": "string",
- "description": "A description of what the response format is for, used by the model to\n determine how to respond in the format."
+ "format": "uri",
+ "description": "The URL of the web resource."
},
- "name": {
- "type": "string",
- "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\n underscores and dashes, with a maximum length of 64."
+ "start_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the first character of the URL citation in the message."
},
- "schema": {
- "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema"
+ "end_index": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The index of the last character of the URL citation in the message."
},
- "strict": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "title": {
+ "type": "string",
+ "description": "The title of the web resource."
}
},
"allOf": [
{
- "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration"
+ "$ref": "#/components/schemas/OpenAI.Annotation"
}
],
- "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).",
- "title": "JSON schema"
+ "description": "A citation for a web resource used to generate a model response.",
+ "title": "URL citation"
},
- "OpenAI.Tool": {
+ "OpenAI.VadConfig": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
- "$ref": "#/components/schemas/OpenAI.ToolType"
+ "type": "string",
+ "enum": [
+ "server_vad"
+ ],
+ "description": "Must be set to `server_vad` to enable manual chunking using server side VAD."
+ },
+ "prefix_padding_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Amount of audio to include before the VAD detected speech (in\n milliseconds).",
+ "default": 300
+ },
+ "silence_duration_ms": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Duration of silence to detect speech stop (in milliseconds).\n With shorter values the model will respond more quickly,\n but may jump in on short pauses from the user.",
+ "default": 200
+ },
+ "threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "description": "Sensitivity threshold (0.0 to 1.0) for voice activity detection. A\n higher threshold will require louder audio to activate the model, and\n thus might perform better in noisy environments.",
+ "default": 0.5
+ }
+ }
+ },
+ "OpenAI.ValidateGraderRequest": {
+ "type": "object",
+ "required": [
+ "grader"
+ ],
+ "properties": {
+ "grader": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderMulti"
+ }
+ ],
+ "description": "The grader used for the fine-tuning job."
}
},
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "bing_grounding": "#/components/schemas/BingGroundingTool",
- "fabric_dataagent_preview": "#/components/schemas/MicrosoftFabricPreviewTool",
- "sharepoint_grounding_preview": "#/components/schemas/SharepointPreviewTool",
- "azure_ai_search": "#/components/schemas/AzureAISearchTool",
- "openapi": "#/components/schemas/OpenApiTool",
- "bing_custom_search_preview": "#/components/schemas/BingCustomSearchPreviewTool",
- "browser_automation_preview": "#/components/schemas/BrowserAutomationPreviewTool",
- "azure_function": "#/components/schemas/AzureFunctionTool",
- "capture_structured_outputs": "#/components/schemas/CaptureStructuredOutputsTool",
- "a2a_preview": "#/components/schemas/A2APreviewTool",
- "work_iq_preview": "#/components/schemas/WorkIQPreviewTool",
- "fabric_iq_preview": "#/components/schemas/FabricIQPreviewTool",
- "memory_search_preview": "#/components/schemas/MemorySearchPreviewTool",
- "memory_search": "#/components/schemas/MemorySearchTool",
- "code_interpreter": "#/components/schemas/OpenAI.CodeInterpreterTool",
- "file_search": "#/components/schemas/OpenAI.FileSearchTool",
- "web_search": "#/components/schemas/OpenAI.WebSearchTool",
- "mcp": "#/components/schemas/OpenAI.MCPTool",
- "function": "#/components/schemas/OpenAI.FunctionTool",
- "computer_use_preview": "#/components/schemas/OpenAI.ComputerUsePreviewTool",
- "image_generation": "#/components/schemas/OpenAI.ImageGenTool",
- "local_shell": "#/components/schemas/OpenAI.LocalShellToolParam",
- "shell": "#/components/schemas/OpenAI.FunctionShellToolParam",
- "custom": "#/components/schemas/OpenAI.CustomToolParam",
- "web_search_preview": "#/components/schemas/OpenAI.WebSearchPreviewTool",
- "apply_patch": "#/components/schemas/OpenAI.ApplyPatchToolParam",
- "computer": "#/components/schemas/OpenAI.ComputerTool",
- "namespace": "#/components/schemas/OpenAI.NamespaceToolParam",
- "tool_search": "#/components/schemas/OpenAI.ToolSearchToolParam"
+ "title": "ValidateGraderRequest"
+ },
+ "OpenAI.ValidateGraderResponse": {
+ "type": "object",
+ "properties": {
+ "grader": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderStringCheck"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderPython"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderScoreModel"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.GraderMulti"
+ }
+ ],
+ "description": "The grader used for the fine-tuning job."
}
},
- "description": "A tool that can be used to generate a response."
+ "title": "ValidateGraderResponse"
},
- "OpenAI.ToolChoiceAllowed": {
+ "OpenAI.VectorStoreExpirationAfter": {
"type": "object",
"required": [
- "type",
- "mode",
- "tools"
+ "anchor",
+ "days"
],
"properties": {
- "type": {
+ "anchor": {
"type": "string",
"enum": [
- "allowed_tools"
+ "last_active_at"
],
- "description": "Allowed tool configuration type. Always `allowed_tools`.",
+ "description": "Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.",
"x-stainless-const": true
},
- "mode": {
- "type": "string",
- "enum": [
- "auto",
- "required"
- ],
- "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools."
- },
- "tools": {
- "type": "array",
- "items": {
- "type": "object",
- "unevaluatedProperties": {}
- },
- "description": "A list of tool definitions that the model should be allowed to call.\n For the Responses API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"name\": \"get_weather\" },\n { \"type\": \"mcp\", \"server_label\": \"deepwiki\" },\n { \"type\": \"image_generation\" }\n ]\n ```"
+ "days": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 1,
+ "maximum": 365,
+ "description": "The number of days after the anchor time that the vector store will expire."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Constrains the tools available to the model to a pre-defined set.",
- "title": "Allowed tools"
+ "description": "The expiration policy for a vector store.",
+ "title": "Vector store expiration policy"
},
- "OpenAI.ToolChoiceCodeInterpreter": {
+ "OpenAI.VectorStoreFileAttributes": {
+ "type": "object",
+ "unevaluatedProperties": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.numeric"
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ },
+ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard. Keys are strings\nwith a maximum length of 64 characters. Values are strings with a maximum\nlength of 512 characters, booleans, or numbers.",
+ "x-oaiTypeLabel": "map"
+ },
+ "OpenAI.VectorStoreFileBatchObject": {
"type": "object",
"required": [
- "type"
+ "id",
+ "object",
+ "created_at",
+ "vector_store_id",
+ "status",
+ "file_counts"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "code_interpreter"
- ]
+ "vector_store.files_batch"
+ ],
+ "description": "The object type, which is always `vector_store.file_batch`.",
+ "x-stainless-const": true
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the vector store files batch was created."
+ },
+ "vector_store_id": {
+ "type": "string",
+ "description": "The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) is attached to."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "cancelled",
+ "failed"
+ ],
+ "description": "The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`."
+ },
+ "file_counts": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObjectFileCounts"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
+ "description": "A batch of files attached to a vector store.",
+ "title": "Vector store file batch",
+ "x-oaiMeta": {
+ "name": "The vector store files batch object",
+ "beta": true,
+ "example": "{\n \"id\": \"vsfb_123\",\n \"object\": \"vector_store.files_batch\",\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 100\n }\n}\n"
+ }
+ },
+ "OpenAI.VectorStoreFileBatchObjectFileCounts": {
+ "type": "object",
+ "required": [
+ "in_progress",
+ "completed",
+ "failed",
+ "cancelled",
+ "total"
],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ "properties": {
+ "in_progress": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "completed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "cancelled": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "total": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
},
- "OpenAI.ToolChoiceComputer": {
+ "OpenAI.VectorStoreFileContentResponse": {
"type": "object",
"required": [
- "type"
+ "object",
+ "data",
+ "has_more",
+ "next_page"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "computer"
+ "vector_store.file_content.page"
+ ],
+ "description": "The object type, which is always `vector_store.file_content.page`",
+ "x-stainless-const": true
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileContentResponseData"
+ },
+ "description": "Parsed content of the file."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Indicates if there are more content pages to fetch."
+ },
+ "next_page": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ "description": "Represents the parsed content of a vector store file."
+ },
+ "OpenAI.VectorStoreFileContentResponseData": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
}
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ }
},
- "OpenAI.ToolChoiceComputerUse": {
+ "OpenAI.VectorStoreFileObject": {
"type": "object",
"required": [
- "type"
+ "id",
+ "object",
+ "usage_bytes",
+ "created_at",
+ "vector_store_id",
+ "status",
+ "last_error"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "computer_use"
+ "vector_store.file"
+ ],
+ "description": "The object type, which is always `vector_store.file`.",
+ "x-stainless-const": true
+ },
+ "usage_bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The total vector store usage in bytes. Note that this may be different from the original file size."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the vector store file was created."
+ },
+ "vector_store_id": {
+ "type": "string",
+ "description": "The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) is attached to."
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "in_progress",
+ "completed",
+ "cancelled",
+ "failed"
+ ],
+ "description": "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."
+ },
+ "last_error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileObjectLastError"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "chunking_strategy": {
+ "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse"
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ "description": "A list of files attached to a vector store.",
+ "title": "Vector store files",
+ "x-oaiMeta": {
+ "name": "The vector store file object",
+ "beta": true,
+ "example": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"usage_bytes\": 1234,\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"last_error\": null,\n \"chunking_strategy\": {\n \"type\": \"static\",\n \"static\": {\n \"max_chunk_size_tokens\": 800,\n \"chunk_overlap_tokens\": 400\n }\n }\n}\n"
+ }
},
- "OpenAI.ToolChoiceComputerUsePreview": {
+ "OpenAI.VectorStoreFileObjectLastError": {
"type": "object",
"required": [
- "type"
+ "code",
+ "message"
],
"properties": {
- "type": {
+ "code": {
"type": "string",
"enum": [
- "computer_use_preview"
+ "server_error",
+ "unsupported_file",
+ "invalid_file"
]
+ },
+ "message": {
+ "type": "string"
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ }
},
- "OpenAI.ToolChoiceCustom": {
+ "OpenAI.VectorStoreObject": {
"type": "object",
"required": [
- "type",
- "name"
+ "id",
+ "object",
+ "created_at",
+ "name",
+ "usage_bytes",
+ "file_counts",
+ "status",
+ "last_active_at",
+ "metadata"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "The identifier, which can be referenced in API endpoints."
+ },
+ "object": {
"type": "string",
"enum": [
- "custom"
+ "vector_store"
],
- "description": "For custom tool calling, the type is always `custom`.",
+ "description": "The object type, which is always `vector_store`.",
"x-stainless-const": true
},
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "The Unix timestamp (in seconds) for when the vector store was created."
+ },
"name": {
"type": "string",
- "description": "The name of the custom tool to call."
+ "description": "The name of the vector store."
+ },
+ "usage_bytes": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "The total number of bytes used by the files in the vector store."
+ },
+ "file_counts": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreObjectFileCounts"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "expired",
+ "in_progress",
+ "completed"
+ ],
+ "description": "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."
+ },
+ "expires_after": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter"
+ },
+ "expires_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "last_active_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp"
+ },
+ "metadata": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Metadata"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
+ "description": "A vector store is a collection of processed files can be used by the `file_search` tool.",
+ "title": "Vector store",
+ "x-oaiMeta": {
+ "name": "The vector store object",
+ "example": "{\n \"id\": \"vs_123\",\n \"object\": \"vector_store\",\n \"created_at\": 1698107661,\n \"usage_bytes\": 123456,\n \"last_active_at\": 1698107661,\n \"name\": \"my_vector_store\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"cancelled\": 0,\n \"failed\": 0,\n \"total\": 100\n },\n \"last_used_at\": 1698107661\n}\n"
+ }
+ },
+ "OpenAI.VectorStoreObjectFileCounts": {
+ "type": "object",
+ "required": [
+ "in_progress",
+ "completed",
+ "failed",
+ "cancelled",
+ "total"
],
- "description": "Use this option to force the model to call a specific custom tool.",
- "title": "Custom tool"
+ "properties": {
+ "in_progress": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "completed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "failed": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "cancelled": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ },
+ "total": {
+ "$ref": "#/components/schemas/OpenAI.integer"
+ }
+ }
},
- "OpenAI.ToolChoiceFileSearch": {
+ "OpenAI.VectorStoreSearchRequest": {
"type": "object",
"required": [
- "type"
+ "query"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "file_search"
- ]
+ "query": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ ],
+ "description": "A query string for a search"
+ },
+ "rewrite_query": {
+ "type": "boolean",
+ "description": "Whether to rewrite the natural language query for vector search."
+ },
+ "max_num_results": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "minimum": 1,
+ "maximum": 50,
+ "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive.",
+ "default": 10
+ },
+ "filters": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.ComparisonFilter"
+ },
+ {
+ "$ref": "#/components/schemas/OpenAI.CompoundFilter"
+ }
+ ],
+ "description": "A filter to apply based on file attributes."
+ },
+ "ranking_options": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequestRankingOptions",
+ "description": "Ranking options for search."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ "x-oaiMeta": {
+ "name": "Vector store search request"
+ }
+ },
+ "OpenAI.VectorStoreSearchRequestRankingOptions": {
+ "type": "object",
+ "properties": {
+ "ranker": {
+ "type": "string",
+ "enum": [
+ "none",
+ "auto",
+ "default-2024-11-15"
+ ],
+ "default": "auto"
+ },
+ "score_threshold": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1
}
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ }
},
- "OpenAI.ToolChoiceFunction": {
+ "OpenAI.VectorStoreSearchResultContentObject": {
"type": "object",
"required": [
"type",
- "name"
+ "text"
],
"properties": {
"type": {
"type": "string",
"enum": [
- "function"
+ "text"
],
- "description": "For function calling, the type is always `function`.",
- "x-stainless-const": true
+ "description": "The type of content."
},
- "name": {
+ "text": {
"type": "string",
- "description": "The name of the function to call."
+ "description": "The text content returned from search."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Use this option to force the model to call a specific function.",
- "title": "Function tool"
+ "x-oaiMeta": {
+ "name": "Vector store search result content object"
+ }
},
- "OpenAI.ToolChoiceImageGeneration": {
+ "OpenAI.VectorStoreSearchResultItem": {
"type": "object",
"required": [
- "type"
+ "file_id",
+ "filename",
+ "score",
+ "attributes",
+ "content"
],
"properties": {
- "type": {
+ "file_id": {
"type": "string",
- "enum": [
- "image_generation"
+ "description": "The ID of the vector store file."
+ },
+ "filename": {
+ "type": "string",
+ "description": "The name of the vector store file."
+ },
+ "score": {
+ "$ref": "#/components/schemas/OpenAI.numeric",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "The similarity score for the result."
+ },
+ "attributes": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultContentObject"
+ },
+ "description": "Content chunks from the file."
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ "x-oaiMeta": {
+ "name": "Vector store search result item"
+ }
},
- "OpenAI.ToolChoiceMCP": {
+ "OpenAI.VectorStoreSearchResultsPage": {
"type": "object",
"required": [
- "type",
- "server_label"
+ "object",
+ "search_query",
+ "data",
+ "has_more",
+ "next_page"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "mcp"
+ "vector_store.search_results.page"
],
- "description": "For MCP tools, the type is always `mcp`.",
+ "description": "The object type, which is always `vector_store.search_results.page`",
"x-stainless-const": true
},
- "server_label": {
- "type": "string",
- "description": "The label of the MCP server to use."
+ "search_query": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "name": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultItem"
+ },
+ "description": "The list of search result items."
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Indicates if there are more results to fetch."
+ },
+ "next_page": {
"anyOf": [
{
"type": "string"
@@ -52837,147 +75397,97 @@
]
}
},
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Use this option to force the model to call a specific tool on a remote MCP server.",
- "title": "MCP tool"
- },
- "OpenAI.ToolChoiceOptions": {
- "type": "string",
- "enum": [
- "none",
- "auto",
- "required"
- ],
- "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or\nmore tools.\n`required` means the model must call one or more tools.",
- "title": "Tool choice mode"
- },
- "OpenAI.ToolChoiceParam": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParamType"
- }
- },
- "discriminator": {
- "propertyName": "type",
- "mapping": {
- "allowed_tools": "#/components/schemas/OpenAI.ToolChoiceAllowed",
- "function": "#/components/schemas/OpenAI.ToolChoiceFunction",
- "mcp": "#/components/schemas/OpenAI.ToolChoiceMCP",
- "custom": "#/components/schemas/OpenAI.ToolChoiceCustom",
- "apply_patch": "#/components/schemas/OpenAI.SpecificApplyPatchParam",
- "shell": "#/components/schemas/OpenAI.SpecificFunctionShellParam",
- "file_search": "#/components/schemas/OpenAI.ToolChoiceFileSearch",
- "web_search_preview": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview",
- "computer_use_preview": "#/components/schemas/OpenAI.ToolChoiceComputerUsePreview",
- "web_search_preview_2025_03_11": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311",
- "image_generation": "#/components/schemas/OpenAI.ToolChoiceImageGeneration",
- "code_interpreter": "#/components/schemas/OpenAI.ToolChoiceCodeInterpreter",
- "computer": "#/components/schemas/OpenAI.ToolChoiceComputer",
- "computer_use": "#/components/schemas/OpenAI.ToolChoiceComputerUse"
- }
- },
- "description": "How the model should select which tool (or tools) to use when generating\na response. See the `tools` parameter to see how to specify which tools\nthe model can call."
+ "x-oaiMeta": {
+ "name": "Vector store search results page"
+ }
},
- "OpenAI.ToolChoiceParamType": {
+ "OpenAI.Verbosity": {
"anyOf": [
{
- "type": "string"
- },
- {
- "type": "string",
- "enum": [
- "allowed_tools",
- "function",
- "mcp",
- "custom",
- "apply_patch",
- "shell",
- "file_search",
- "web_search_preview",
- "computer_use_preview",
- "web_search_preview_2025_03_11",
- "image_generation",
- "code_interpreter",
- "computer",
- "computer_use"
- ]
- }
- ]
- },
- "OpenAI.ToolChoiceWebSearchPreview": {
- "type": "object",
- "required": [
- "type"
- ],
- "properties": {
- "type": {
"type": "string",
"enum": [
- "web_search_preview"
+ "low",
+ "medium",
+ "high"
]
- }
- },
- "allOf": [
+ },
{
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
+ "type": "null"
}
],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ "description": "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\nCurrently supported values are `low`, `medium`, and `high`."
},
- "OpenAI.ToolChoiceWebSearchPreview20250311": {
+ "OpenAI.VideoCharacterResource": {
"type": "object",
"required": [
- "type"
+ "id",
+ "name",
+ "created_at"
],
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "web_search_preview_2025_03_11"
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (in seconds) when the character was created."
}
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ToolChoiceParam"
- }
- ],
- "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)."
+ }
},
- "OpenAI.ToolSearchExecutionType": {
+ "OpenAI.VideoContentVariant": {
"type": "string",
"enum": [
- "server",
- "client"
+ "video",
+ "thumbnail",
+ "spritesheet"
]
},
- "OpenAI.ToolSearchToolParam": {
+ "OpenAI.VideoListResource": {
"type": "object",
"required": [
- "type"
+ "object",
+ "data",
+ "first_id",
+ "last_id",
+ "has_more"
],
"properties": {
- "type": {
+ "object": {
"type": "string",
"enum": [
- "tool_search"
+ "list"
],
- "description": "The type of the tool. Always `tool_search`.",
- "x-stainless-const": true
+ "description": "The type of object returned, must be `list`.",
+ "x-stainless-const": true,
+ "default": "list"
},
- "execution": {
- "$ref": "#/components/schemas/OpenAI.ToolSearchExecutionType",
- "description": "Whether tool search is executed by the server or by the client."
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OpenAI.VideoResource"
+ },
+ "description": "A list of items",
+ "x-ms-list-page-items": true
},
- "description": {
+ "first_id": {
"anyOf": [
{
"type": "string"
@@ -52987,26 +75497,24 @@
}
]
},
- "parameters": {
+ "last_id": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.EmptyModelParam"
+ "type": "string"
},
{
"type": "null"
}
- ]
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.Tool"
+ ],
+ "x-ms-list-continuation-token": true
+ },
+ "has_more": {
+ "type": "boolean",
+ "description": "Whether there are more items available."
}
- ],
- "description": "Hosted or BYOT tool search configuration for deferred tools.",
- "title": "Tool search tool"
+ }
},
- "OpenAI.ToolType": {
+ "OpenAI.VideoModel": {
"anyOf": [
{
"type": "string"
@@ -53014,195 +75522,218 @@
{
"type": "string",
"enum": [
- "function",
- "file_search",
- "computer",
- "computer_use_preview",
- "web_search",
- "mcp",
- "code_interpreter",
- "image_generation",
- "local_shell",
- "shell",
- "custom",
- "namespace",
- "tool_search",
- "web_search_preview",
- "apply_patch",
- "a2a_preview",
- "bing_custom_search_preview",
- "browser_automation_preview",
- "fabric_dataagent_preview",
- "sharepoint_grounding_preview",
- "memory_search_preview",
- "work_iq_preview",
- "fabric_iq_preview",
- "toolbox_search_preview",
- "azure_ai_search",
- "azure_function",
- "bing_grounding",
- "capture_structured_outputs",
- "openapi",
- "memory_search"
+ "sora-2",
+ "sora-2-pro",
+ "sora-2-2025-10-06",
+ "sora-2-pro-2025-10-06",
+ "sora-2-2025-12-08"
]
}
]
},
- "OpenAI.ToolsArray": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.Tool"
- },
- "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\nWe support the following categories of tools:\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\nmodel's capabilities, like [web search](/docs/guides/tools-web-search)\nor [file search](/docs/guides/tools-file-search). Learn more about\n[built-in tools](/docs/guides/tools).\n- **MCP Tools**: Integrations with third-party systems via custom MCP servers\nor predefined connectors such as Google Drive and SharePoint. Learn more about\n[MCP Tools](/docs/guides/tools-connectors-mcp).\n- **Function calls (custom tools)**: Functions that are defined by you,\nenabling the model to call your own code with strongly typed arguments\nand outputs. Learn more about\n[function calling](/docs/guides/function-calling). You can also use\ncustom tools to call your own code."
+ "OpenAI.VideoPrompt": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32000
},
- "OpenAI.TopLogProb": {
+ "OpenAI.VideoReferenceInputParam": {
"type": "object",
"required": [
- "token",
- "logprob",
- "bytes"
+ "id"
],
"properties": {
- "token": {
- "type": "string"
- },
- "logprob": {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- "bytes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OpenAI.integer"
- }
+ "id": {
+ "type": "string",
+ "description": "The identifier of the completed video."
}
},
- "description": "The top log probability of a token.",
- "title": "Top log probability"
+ "description": "Reference to the completed video."
},
- "OpenAI.TypeParam": {
+ "OpenAI.VideoResource": {
"type": "object",
"required": [
- "type",
- "text"
+ "id",
+ "object",
+ "model",
+ "status",
+ "progress",
+ "created_at",
+ "completed_at",
+ "expires_at",
+ "prompt",
+ "size",
+ "seconds",
+ "remixed_from_video_id",
+ "error"
],
"properties": {
- "type": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier for the video job."
+ },
+ "object": {
"type": "string",
"enum": [
- "type"
+ "video"
],
- "description": "Specifies the event type. For a type action, this property is always set to `type`.",
- "x-stainless-const": true
+ "description": "The object type, which is always `video`.",
+ "x-stainless-const": true,
+ "default": "video"
},
- "text": {
- "type": "string",
- "description": "The text to type."
- }
- },
- "allOf": [
- {
- "$ref": "#/components/schemas/OpenAI.ComputerAction"
- }
- ],
- "description": "An action to type in text.",
- "title": "Type"
- },
- "OpenAI.UpdateConversationBody": {
- "type": "object",
- "required": [
- "metadata"
- ],
- "properties": {
- "metadata": {
+ "model": {
+ "$ref": "#/components/schemas/OpenAI.VideoModel",
+ "description": "The video generation model that produced the job."
+ },
+ "status": {
+ "$ref": "#/components/schemas/OpenAI.VideoStatus",
+ "description": "Current lifecycle status of the video job."
+ },
+ "progress": {
+ "$ref": "#/components/schemas/OpenAI.integer",
+ "description": "Approximate completion percentage for the generation task."
+ },
+ "created_at": {
+ "type": "integer",
+ "format": "unixtime",
+ "description": "Unix timestamp (seconds) for when the job was created."
+ },
+ "completed_at": {
"anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Metadata"
+ "type": "string",
+ "format": "date-time"
},
{
"type": "null"
}
],
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
- }
- }
- },
- "OpenAI.UrlCitationBody": {
- "type": "object",
- "required": [
- "type",
- "url",
- "start_index",
- "end_index",
- "title"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "url_citation"
- ],
- "description": "The type of the URL citation. Always `url_citation`.",
- "x-stainless-const": true
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "Unix timestamp (seconds) for when the job completed, if finished."
},
- "url": {
- "type": "string",
- "format": "uri",
- "description": "The URL of the web resource."
+ "expires_at": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "type": "integer",
+ "format": "unixTimestamp",
+ "description": "Unix timestamp (seconds) for when the downloadable assets expire, if set."
},
- "start_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the first character of the URL citation in the message."
+ "prompt": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "end_index": {
- "$ref": "#/components/schemas/OpenAI.integer",
- "description": "The index of the last character of the URL citation in the message."
+ "size": {
+ "$ref": "#/components/schemas/OpenAI.VideoSize",
+ "description": "The resolution of the generated video."
},
- "title": {
+ "seconds": {
"type": "string",
- "description": "The title of the web resource."
+ "description": "Duration of the generated clip in seconds. For extensions, this is the stitched total duration."
+ },
+ "remixed_from_video_id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "error": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Error-2"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "allOf": [
+ "description": "Structured information describing a generated video job.",
+ "title": "Video job"
+ },
+ "OpenAI.VideoSeconds": {
+ "type": "string",
+ "enum": [
+ "4",
+ "8",
+ "12"
+ ]
+ },
+ "OpenAI.VideoSize": {
+ "type": "string",
+ "enum": [
+ "720x1280",
+ "1280x720",
+ "1024x1792",
+ "1792x1024"
+ ]
+ },
+ "OpenAI.VideoStatus": {
+ "type": "string",
+ "enum": [
+ "queued",
+ "in_progress",
+ "completed",
+ "failed"
+ ]
+ },
+ "OpenAI.VoiceIdsOrCustomVoice": {
+ "anyOf": [
{
- "$ref": "#/components/schemas/OpenAI.Annotation"
+ "$ref": "#/components/schemas/OpenAI.VoiceIdsShared"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ]
}
],
- "description": "A citation for a web resource used to generate a model response.",
- "title": "URL citation"
- },
- "OpenAI.VectorStoreFileAttributes": {
- "type": "object",
- "unevaluatedProperties": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/components/schemas/OpenAI.numeric"
- },
- {
- "type": "boolean"
- }
- ]
- },
- "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard. Keys are strings\nwith a maximum length of 64 characters. Values are strings with a maximum\nlength of 512 characters, booleans, or numbers.",
- "x-oaiTypeLabel": "map"
+ "description": "A built-in voice name or a custom voice reference.",
+ "title": "Voice"
},
- "OpenAI.Verbosity": {
+ "OpenAI.VoiceIdsShared": {
"anyOf": [
+ {
+ "type": "string"
+ },
{
"type": "string",
"enum": [
- "low",
- "medium",
- "high"
+ "alloy",
+ "ash",
+ "ballad",
+ "coral",
+ "echo",
+ "sage",
+ "shimmer",
+ "verse",
+ "marin",
+ "cedar"
]
- },
- {
- "type": "null"
}
- ],
- "description": "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\nCurrently supported values are `low`, `medium`, and `high`."
+ ]
},
"OpenAI.WaitParam": {
"type": "object",
@@ -53404,6 +75935,38 @@
"description": "The approximate location of the user.",
"title": "Web search approximate location"
},
+ "OpenAI.WebSearchContextSize": {
+ "type": "string",
+ "enum": [
+ "low",
+ "medium",
+ "high"
+ ],
+ "description": "High level guidance for the amount of context window space to use for the\nsearch. One of `low`, `medium`, or `high`. `medium` is the default."
+ },
+ "OpenAI.WebSearchLocation": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string",
+ "description": "The two-letter\n [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,\n e.g. `US`."
+ },
+ "region": {
+ "type": "string",
+ "description": "Free text input for the region of the user, e.g. `California`."
+ },
+ "city": {
+ "type": "string",
+ "description": "Free text input for the city of the user, e.g. `San Francisco`."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The [IANA timezone](https://timeapi.io/documentation/iana-timezones)\n of the user, e.g. `America/Los_Angeles`."
+ }
+ },
+ "description": "Approximate location parameters for the search.",
+ "title": "Web search location"
+ },
"OpenAI.WebSearchPreviewTool": {
"type": "object",
"required": [
@@ -54351,6 +76914,12 @@
"evaluation_level": {
"$ref": "#/components/schemas/EvaluationLevel",
"description": "Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for per-conversation multi-turn simulation scoring."
+ },
+ "max_stalls": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 1,
+ "description": "Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the score does not improve — so no full validation-set evaluation is triggered. The counter resets whenever a minibatch passes and its full-validation score beats the current best. Only a sustained plateau of `max_stalls` consecutive minibatch failures triggers the stop. When omitted, the optimizer uses its internal default. Must be >= 1 when set."
}
},
"description": "Tuning knobs and run-mode for an optimization job.",
@@ -55550,7 +78119,12 @@
"$ref": "#/components/schemas/ToolboxTool"
}
],
- "description": "A reminder tool stored in a toolbox."
+ "description": "A reminder tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"ResponseRetrievalItemGenerationParams": {
"type": "object",
@@ -56052,6 +78626,112 @@
]
}
},
+ "RubricGenerationInputQualityWarning": {
+ "type": "object",
+ "required": [
+ "code",
+ "severity",
+ "message",
+ "source"
+ ],
+ "properties": {
+ "code": {
+ "$ref": "#/components/schemas/RubricGenerationInputQualityWarningCode",
+ "description": "Stable searchable machine-readable warning code."
+ },
+ "severity": {
+ "$ref": "#/components/schemas/RubricGenerationInputQualityWarningSeverity",
+ "description": "Advisory severity. Initial values: `warning`."
+ },
+ "message": {
+ "type": "string",
+ "description": "Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, instruction, dataset, or trace text."
+ },
+ "source": {
+ "$ref": "#/components/schemas/RubricGenerationInputQualityWarningSource",
+ "description": "Which source category the warning applies to. `aggregate` is used only for cross-source warnings."
+ },
+ "source_index": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0,
+ "description": "Zero-based index into `EvaluatorGenerationJob.inputs.sources` when the warning applies to a specific source. Omitted for aggregate warnings and for warnings not tied to one source."
+ }
+ },
+ "description": "A non-fatal advisory produced during rubric evaluator generation when resolved inputs are technically valid but likely too weak to produce a high-quality rubric. Read-only; service-generated. Persisted with the terminal EvaluatorGenerationJob.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "RubricGenerationInputQualityWarningCode": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "empty_prompt",
+ "short_prompt",
+ "empty_agent_instructions",
+ "short_agent_instructions",
+ "empty_dataset_content",
+ "short_dataset_content",
+ "low_trace_count",
+ "insufficient_total_input"
+ ]
+ }
+ ],
+ "description": "Stable searchable machine-readable warning code for a rubric-generation input-quality warning. Values are `snake_case`; clients must tolerate additional service-defined identifiers.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "RubricGenerationInputQualityWarningSeverity": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "warning"
+ ]
+ }
+ ],
+ "description": "Advisory severity for a rubric-generation input-quality warning. Initial value set: `warning`.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
+ "RubricGenerationInputQualityWarningSource": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "enum": [
+ "prompt",
+ "agent",
+ "dataset",
+ "aggregate"
+ ]
+ }
+ ],
+ "description": "Warning source attribution for a rubric-generation input-quality warning. Per-source values (`prompt`, `agent`, `dataset`) match the source category visible to the generation runtime. `aggregate` is a synthetic value used only for warnings computed across successfully resolved sources. `traces` is not exposed because trace sources resolve into dataset content upstream.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "Evaluations=V1Preview"
+ ]
+ }
+ },
"SASCredentials": {
"type": "object",
"required": [
@@ -56504,7 +79184,12 @@
"$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "A SharePoint grounding tool call."
+ "description": "A SharePoint grounding tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"SharepointGroundingToolCallOutput": {
"type": "object",
@@ -56538,7 +79223,12 @@
"$ref": "#/components/schemas/OpenAI.OutputItem"
}
],
- "description": "The output of a SharePoint grounding tool call."
+ "description": "The output of a SharePoint grounding tool call.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"SharepointGroundingToolParameters": {
"type": "object",
@@ -56552,7 +79242,12 @@
"description": "The project connections attached to this tool. There can be a maximum of 1 connection\nresource attached to the tool."
}
},
- "description": "The sharepoint grounding tool parameters."
+ "description": "The sharepoint grounding tool parameters.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"SharepointPreviewTool": {
"type": "object",
@@ -56578,7 +79273,12 @@
"$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "The input definition information for a sharepoint tool as used to configure an agent."
+ "description": "The input definition information for a sharepoint tool as used to configure an agent.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"SimpleQnADataGenerationJobOptions": {
"type": "object",
@@ -57451,6 +80151,27 @@
},
"description": "A project connection resource."
},
+ "ToolSearchToolboxTool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "toolbox_search"
+ ],
+ "description": "The type of the tool. Always `toolbox_search`."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A toolbox search tool stored in a toolbox."
+ },
"ToolUseFineTuningDataGenerationJobOptions": {
"type": "object",
"required": [
@@ -57530,7 +80251,12 @@
"$ref": "#/components/schemas/ToolboxTool"
}
],
- "description": "A toolbox search tool stored in a toolbox."
+ "description": "A toolbox search tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"ToolboxSkill": {
"type": "object",
@@ -57621,7 +80347,9 @@
"reminder_preview": "#/components/schemas/ReminderPreviewToolboxTool",
"work_iq_preview": "#/components/schemas/WorkIQPreviewToolboxTool",
"fabric_iq_preview": "#/components/schemas/FabricIQPreviewToolboxTool",
- "toolbox_search_preview": "#/components/schemas/ToolboxSearchPreviewToolboxTool"
+ "web_iq_preview": "#/components/schemas/WebIQPreviewToolboxTool",
+ "toolbox_search_preview": "#/components/schemas/ToolboxSearchPreviewToolboxTool",
+ "toolbox_search": "#/components/schemas/ToolSearchToolboxTool"
}
},
"description": "An abstract representation of a tool stored in a toolbox."
@@ -57640,6 +80368,8 @@
"reminder_preview",
"work_iq_preview",
"fabric_iq_preview",
+ "web_iq_preview",
+ "toolbox_search",
"toolbox_search_preview"
],
"description": "Supported tool types for tools stored in a toolbox."
@@ -58398,6 +81128,115 @@
}
}
},
+ "WebIQPreviewTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "project_connection_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_iq_preview"
+ ],
+ "description": "The object type, which is always 'web_iq_preview'."
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the WebIQ project connection."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the WebIQ MCP server to connect to."
+ },
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the WebIQ MCP server. If not provided, the URL from the project connection will be used."
+ },
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Whether the agent requires approval before executing actions. Default is always.",
+ "default": "always"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.Tool"
+ }
+ ],
+ "description": "A WebIQ server-side tool.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
+ "WebIQPreviewToolboxTool": {
+ "type": "object",
+ "required": [
+ "type",
+ "project_connection_id"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "web_iq_preview"
+ ]
+ },
+ "project_connection_id": {
+ "type": "string",
+ "description": "The ID of the WebIQ project connection."
+ },
+ "server_label": {
+ "type": "string",
+ "description": "The label of the WebIQ MCP server to connect to."
+ },
+ "server_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "The URL of the WebIQ MCP server. If not provided, the URL from the project connection will be used."
+ },
+ "require_approval": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Whether the agent requires approval before executing actions. Default is always.",
+ "default": "always"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ToolboxTool"
+ }
+ ],
+ "description": "A WebIQ tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
+ },
"WebSearchConfiguration": {
"type": "object",
"required": [
@@ -58528,7 +81367,12 @@
"$ref": "#/components/schemas/OpenAI.Tool"
}
],
- "description": "A WorkIQ server-side tool."
+ "description": "A WorkIQ server-side tool.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"WorkIQPreviewToolboxTool": {
"type": "object",
@@ -58553,7 +81397,12 @@
"$ref": "#/components/schemas/ToolboxTool"
}
],
- "description": "A WorkIQ tool stored in a toolbox."
+ "description": "A WorkIQ tool stored in a toolbox.",
+ "x-ms-foundry-meta": {
+ "required_previews": [
+ "preview_tool"
+ ]
+ }
},
"WorkflowActionOutputItem": {
"type": "object",
diff --git a/specification/ai-foundry/data-plane/Foundry/openapi3/virtual-public-preview/microsoft-foundry-openapi3.yaml b/specification/ai-foundry/data-plane/Foundry/openapi3/virtual-public-preview/microsoft-foundry-openapi3.yaml
index fa00996df59b..af61217c4185 100644
--- a/specification/ai-foundry/data-plane/Foundry/openapi3/virtual-public-preview/microsoft-foundry-openapi3.yaml
+++ b/specification/ai-foundry/data-plane/Foundry/openapi3/virtual-public-preview/microsoft-foundry-openapi3.yaml
@@ -4,7 +4,6 @@ info:
version: virtual-public-preview
tags:
- name: EvaluationSuiteGenerationJobs
- - name: Fine-Tuning
- name: Responses Root
description: Responses
- name: Responses
@@ -95,7 +94,7 @@ tags:
parent: Platform APIs
summary: Agent optimization jobs
- name: EvaluatorGenerationJobs
- parent: Platform APIs
+ parent: Evaluations
summary: Evaluator generation jobs
- name: Evaluations
- name: Evals
@@ -117,8 +116,8 @@ paths:
/agent_optimization_jobs:
post:
operationId: AgentOptimizationJobs_create
- summary: Creates an agent optimization job.
- description: Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry.
+ summary: Create an agent optimization job
+ description: Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry.
parameters:
- name: Foundry-Features
in: header
@@ -185,8 +184,8 @@ paths:
- AgentsOptimization=V2Preview
get:
operationId: AgentOptimizationJobs_list
- summary: Returns a list of agent optimization jobs.
- description: List optimization jobs. Supports cursor pagination and optional status / agent_name filters.
+ summary: List agent optimization jobs
+ description: Lists optimization jobs with cursor pagination and optional status or agent name filters.
parameters:
- name: Foundry-Features
in: header
@@ -303,8 +302,8 @@ paths:
/agent_optimization_jobs/{jobId}:
get:
operationId: AgentOptimizationJobs_get
- summary: Get info about an agent optimization job.
- description: Get an optimization job by id.
+ summary: Get an agent optimization job
+ description: Retrieves an optimization job by its identifier.
parameters:
- name: Foundry-Features
in: header
@@ -360,8 +359,8 @@ paths:
- AgentsOptimization=V2Preview
delete:
operationId: AgentOptimizationJobs_delete
- summary: Deletes an agent optimization job.
- description: Delete the job and its candidate artifacts. Cancels first if non-terminal.
+ summary: Delete an agent optimization job
+ description: Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal.
parameters:
- name: Foundry-Features
in: header
@@ -407,8 +406,8 @@ paths:
/agent_optimization_jobs/{jobId}:cancel:
post:
operationId: AgentOptimizationJobs_cancel
- summary: Cancels an agent optimization job.
- description: Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state.
+ summary: Cancel an agent optimization job
+ description: Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state.
parameters:
- name: Foundry-Features
in: header
@@ -532,6 +531,7 @@ paths:
encoding:
metadata:
contentType: application/json
+ description: The content multipart request content.
get:
operationId: Agents_listAgents
summary: List agents
@@ -741,6 +741,7 @@ paths:
encoding:
metadata:
contentType: application/json
+ description: The content multipart request content.
delete:
operationId: Agents_deleteAgent
summary: Delete an agent
@@ -2041,6 +2042,7 @@ paths:
encoding:
metadata:
contentType: application/json
+ description: The content multipart request content.
get:
operationId: Agents_listAgentVersions
summary: List agent versions
@@ -2807,6 +2809,106 @@ paths:
x-ms-foundry-meta:
required_previews:
- ContainerAgents=V1Preview
+ /agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.json:
+ get:
+ operationId: AgentInvocations_getAgentInvocationAsyncApiSpecJson
+ description: |-
+ Retrieves the AsyncAPI (JSON) specification for an agent version's event-driven
+ invocation contract (e.g. the `invocations_ws` WebSocket protocol). AsyncAPI is the
+ companion to OpenAPI for streaming/bidirectional surfaces that OpenAPI cannot express.
+ Returns 404 if the agent does not publish an AsyncAPI specification. Publishing is
+ optional; when published, both JSON and YAML representations are available.
+ parameters:
+ - name: agent_name
+ in: path
+ required: true
+ description: The name of the agent.
+ schema:
+ type: string
+ - name: agent_version
+ in: path
+ required: true
+ description: The version of the agent.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ unevaluatedProperties: {}
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Agent Invocations
+ /agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.yaml:
+ get:
+ operationId: AgentInvocations_getAgentInvocationAsyncApiSpecYaml
+ description: |-
+ Retrieves the AsyncAPI (YAML) specification for an agent version's event-driven
+ invocation contract. Companion to `getAgentInvocationAsyncApiSpecJson`; the path
+ extension is authoritative for the returned content type (no `Accept` negotiation).
+ Returns 404 if the agent does not publish an AsyncAPI specification.
+ parameters:
+ - name: agent_name
+ in: path
+ required: true
+ description: The name of the agent.
+ schema:
+ type: string
+ - name: agent_version
+ in: path
+ required: true
+ description: The version of the agent.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/yaml:
+ schema:
+ type: string
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Agent Invocations
/agents/{agent_name}/versions/{agent_version}/sessions/{session_id}:logstream:
get:
operationId: Agents_getSessionLogStream
@@ -2973,6 +3075,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Agents
/agents/{agent_name}:enable:
post:
operationId: Agents_enableAgent
@@ -3009,6 +3113,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Agents
/agents:import:
post:
operationId: Agents_createAgentFromManifest
@@ -3796,7 +3902,7 @@ paths:
post:
operationId: Datasets_getCredentials
summary: Get dataset credentials
- description: Gets the SAS credential to access the storage account associated with a Dataset version.
+ description: Retrieves the SAS credential to access the storage account associated with a dataset version.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: name
@@ -3975,7 +4081,7 @@ paths:
get:
operationId: Deployments_get
summary: Get a deployment
- description: Gets a deployed model.
+ description: Retrieves a deployed model.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: name
@@ -4028,7 +4134,7 @@ paths:
post:
operationId: EvaluationSuiteGenerationJobs_create
summary: Create an evaluation suite generation job
- description: Create a new job (preview). Includes optional Foundry-Features header and Operation-Id for idempotent retries.
+ description: Creates an evaluation suite generation job and returns the queued job.
parameters:
- name: Foundry-Features
in: header
@@ -4096,7 +4202,7 @@ paths:
get:
operationId: EvaluationSuiteGenerationJobs_list
summary: List evaluation suite generation jobs
- description: List jobs with cursor-based pagination (preview). Includes optional Foundry-Features header.
+ description: Lists evaluation suite generation jobs for the project.
parameters:
- name: Foundry-Features
in: header
@@ -4200,7 +4306,7 @@ paths:
get:
operationId: EvaluationSuiteGenerationJobs_get
summary: Get an evaluation suite generation job
- description: Get a job by ID (preview). Includes optional Foundry-Features header.
+ description: Retrieves an evaluation suite generation job by its identifier.
parameters:
- name: Foundry-Features
in: header
@@ -4257,7 +4363,7 @@ paths:
delete:
operationId: EvaluationSuiteGenerationJobs_delete
summary: Delete an evaluation suite generation job
- description: Delete a job (preview). Returns 204 No Content.
+ description: Deletes an evaluation suite generation job by its identifier.
parameters:
- name: Foundry-Features
in: header
@@ -4304,7 +4410,7 @@ paths:
post:
operationId: EvaluationSuiteGenerationJobs_cancel
summary: Cancel an evaluation suite generation job
- description: Cancel a running job (preview). Returns 200 with the updated job.
+ description: Requests cancellation of a running or queued evaluation suite generation job.
parameters:
- name: Foundry-Features
in: header
@@ -4443,7 +4549,7 @@ paths:
post:
operationId: EvaluationSuites_createEvaluationSuiteVersion
summary: Create an evaluation suite version
- description: Create a new EvaluationSuiteVersion with auto incremented version id
+ description: Creates a new evaluation suite version with an auto-incremented version identifier.
parameters:
- name: Foundry-Features
in: header
@@ -5435,7 +5541,7 @@ paths:
patch:
operationId: EvaluationTaxonomies_update
summary: Update an evaluation taxonomy
- description: Update an evaluation taxonomy.
+ description: Modifies the specified evaluation taxonomy with the provided changes.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: Foundry-Features
@@ -5831,7 +5937,7 @@ paths:
get:
operationId: Evaluators_listLatestVersions
summary: List latest evaluator versions
- description: Lists the latest version of each evaluator
+ description: Lists the latest version of each evaluator.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: type
@@ -6226,6 +6332,7 @@ paths:
- name: name
in: path
required: true
+ description: The name path parameter.
schema:
type: string
- name: version
@@ -6289,6 +6396,7 @@ paths:
- name: name
in: path
required: true
+ description: The name path parameter.
schema:
type: string
- name: version
@@ -8116,7 +8224,7 @@ paths:
delete:
operationId: Models_deleteVersion
summary: Delete a model version
- description: Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist.
+ description: Removes the specified model version. Returns 200 whether the version existed or not.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: name
@@ -8174,7 +8282,7 @@ paths:
patch:
operationId: Models_updateVersion
summary: Update a model version
- description: Update an existing ModelVersion with the given version id
+ description: Updates an existing model version identified by its version ID.
parameters:
- $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- name: name
@@ -8400,6 +8508,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ModelCredentialRequest'
+ description: The credential request request body.
x-ms-foundry-meta:
required_previews:
- Models=V1Preview
@@ -8469,111 +8578,41 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ModelPendingUploadRequest'
+ description: The pending upload request request body.
x-ms-foundry-meta:
required_previews:
- Models=V1Preview
- /openai/v1/conversations:
- post:
- operationId: createConversation
- summary: Create a conversation
- description: Creates a new conversation resource.
- parameters:
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Conversations
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.CreateConversationBody'
+ /openai/v1/assistants:
get:
- operationId: listConversations
- summary: List conversations
- description: Returns the conversations available in the current project.
+ operationId: Assistants_listAssistants
+ summary: List assistants
+ description: Lists assistants matching the request filters.
parameters:
- name: limit
in: query
required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
schema:
- type: integer
- format: int32
+ $ref: '#/components/schemas/integer'
default: 20
- explode: false
- name: order
in: query
required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
- name: after
in: query
required: false
- description: |-
- 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.
+ description: 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.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
- name: before
in: query
required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: agent_name
- in: query
- required: false
- description: Filter by agent name. If provided, only items associated with the specified agent will be returned.
- schema:
- type: string
- explode: false
- - name: agent_id
- in: query
- required: false
- description: Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.
- schema:
- type: string
- explode: false
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ description: 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.
schema:
type: string
responses:
@@ -8582,26 +8621,7 @@ paths:
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ListAssistantsResponse'
4XX:
description: Client error
content:
@@ -8615,32 +8635,168 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- /openai/v1/conversations/{conversation_id}:
+ - Assistants
+ deprecated: true
+ x-oaiMeta:
+ name: List assistants
+ group: assistants
+ examples:
+ request:
+ curl: |
+ curl "https://api.openai.com/v1/assistants?order=desc&limit=20" \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.assistants.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistants = await openai.beta.assistants.list({
+ order: "desc",
+ limit: "20",
+ });
+
+ console.log(myAssistants.data);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const assistant of client.beta.assistants.list()) {
+ console.log(assistant.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Assistants.List(context.TODO(), openai.BetaAssistantListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.AssistantListPage;
+ import com.openai.models.beta.assistants.AssistantListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantListPage page = client.beta().assistants().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.assistants.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698982736,
+ "name": "Coding Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc456",
+ "object": "assistant",
+ "created_at": 1698982718,
+ "name": "My Assistant",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc789",
+ "object": "assistant",
+ "created_at": 1698982643,
+ "name": null,
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ ],
+ "first_id": "asst_abc123",
+ "last_id": "asst_abc789",
+ "has_more": false
+ }
+ x-ms-list: true
post:
- operationId: updateConversation
- summary: Update a conversation
- description: Modifies the specified conversation's properties.
- parameters:
- - name: conversation_id
- in: path
- required: true
- description: The id of the conversation to update.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
+ operationId: Assistants_createAssistant
+ summary: Create an assistant
+ description: Creates an assistant from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
+ $ref: '#/components/schemas/OpenAI.AssistantObject'
4XX:
description: Client error
content:
@@ -8654,28 +8810,289 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
+ - Assistants
requestBody:
required: true
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.UpdateConversationBody'
- get:
- operationId: getConversation
- summary: Retrieve a conversation
- description: Retrieves the specified conversation and its metadata.
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequest'
+ description: The request body.
+ deprecated: true
+ x-oaiMeta:
+ name: Create assistant
+ group: assistants
+ examples:
+ - title: Code Interpreter
+ request:
+ curl: |
+ curl "https://api.openai.com/v1/assistants" \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ "name": "Math Tutor",
+ "tools": [{"type": "code_interpreter"}],
+ "model": "gpt-4o"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.create(
+ model="gpt-4o",
+ )
+ print(assistant.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistant = await openai.beta.assistants.create({
+ instructions:
+ "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ name: "Math Tutor",
+ tools: [{ type: "code_interpreter" }],
+ model: "gpt-4o",
+ });
+
+ console.log(myAssistant);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.create({ model: 'gpt-4o' });
+
+ console.log(assistant.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{
+ Model: shared.ChatModelGPT4o,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantCreateParams params = AssistantCreateParams.builder()
+ .model(ChatModel.GPT_4O)
+ .build();
+ Assistant assistant = client.beta().assistants().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.create(model: :"gpt-4o")
+
+ puts(assistant)
+ response: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698984975,
+ "name": "Math Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ - title: Files
+ request:
+ curl: |
+ curl https://api.openai.com/v1/assistants \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ "tools": [{"type": "file_search"}],
+ "tool_resources": {"file_search": {"vector_store_ids": ["vs_123"]}},
+ "model": "gpt-4o"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.create(
+ model="gpt-4o",
+ )
+ print(assistant.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistant = await openai.beta.assistants.create({
+ instructions:
+ "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ name: "HR Helper",
+ tools: [{ type: "file_search" }],
+ tool_resources: {
+ file_search: {
+ vector_store_ids: ["vs_123"]
+ }
+ },
+ model: "gpt-4o"
+ });
+
+ console.log(myAssistant);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.create({ model: 'gpt-4o' });
+
+ console.log(assistant.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{
+ Model: shared.ChatModelGPT4o,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantCreateParams params = AssistantCreateParams.builder()
+ .model(ChatModel.GPT_4O)
+ .build();
+ Assistant assistant = client.beta().assistants().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.create(model: :"gpt-4o")
+
+ puts(assistant)
+ response: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1699009403,
+ "name": "HR Helper",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "tool_resources": {
+ "file_search": {
+ "vector_store_ids": ["vs_123"]
+ }
+ },
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ /openai/v1/assistants/{assistant_id}:
+ delete:
+ operationId: Assistants_deleteAssistant
+ summary: Delete an assistant
+ description: Deletes an assistant by its identifier.
parameters:
- - name: conversation_id
+ - name: assistant_id
in: path
required: true
- description: The id of the conversation to retrieve.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ description: The ID of the assistant to delete.
schema:
type: string
responses:
@@ -8684,7 +9101,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
+ $ref: '#/components/schemas/OpenAI.DeleteAssistantResponse'
4XX:
description: Client error
content:
@@ -8698,22 +9115,113 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- delete:
- operationId: deleteConversation
- summary: Delete a conversation
- description: Removes the specified conversation resource from the current project.
+ - Assistants
+ deprecated: true
+ x-oaiMeta:
+ name: Delete assistant
+ group: assistants
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/assistants/asst_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X DELETE
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant_deleted = client.beta.assistants.delete(
+ "assistant_id",
+ )
+ print(assistant_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const response = await openai.beta.assistants.delete("asst_abc123");
+
+ console.log(response);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistantDeleted = await client.beta.assistants.delete('assistant_id');
+
+ console.log(assistantDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistantDeleted, err := client.Beta.Assistants.Delete(context.TODO(), "assistant_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistantDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.AssistantDeleteParams;
+ import com.openai.models.beta.assistants.AssistantDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantDeleted assistantDeleted = client.beta().assistants().delete("assistant_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant_deleted = openai.beta.assistants.delete("assistant_id")
+
+ puts(assistant_deleted)
+ response: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Assistants_getAssistant
+ summary: Get an assistant
+ description: Retrieves an assistant by its identifier.
parameters:
- - name: conversation_id
+ - name: assistant_id
in: path
required: true
- description: The id of the conversation to delete.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ description: The ID of the assistant to retrieve.
schema:
type: string
responses:
@@ -8722,7 +9230,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.DeletedConversationResource'
+ $ref: '#/components/schemas/OpenAI.AssistantObject'
4XX:
description: Client error
content:
@@ -8736,34 +9244,128 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- /openai/v1/conversations/{conversation_id}/items:
+ - Assistants
+ deprecated: true
+ x-oaiMeta:
+ name: Retrieve assistant
+ group: assistants
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/assistants/asst_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.retrieve(
+ "assistant_id",
+ )
+ print(assistant.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistant = await openai.beta.assistants.retrieve(
+ "asst_abc123"
+ );
+
+ console.log(myAssistant);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.retrieve('assistant_id');
+
+ console.log(assistant.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.Get(context.TODO(), "assistant_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Assistant assistant = client.beta().assistants().retrieve("assistant_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.retrieve("assistant_id")
+
+ puts(assistant)
+ response: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1699009709,
+ "name": "HR Helper",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
post:
- operationId: createConversationItems
- summary: Create conversation items
- description: Adds one or more items to the specified conversation.
+ operationId: Assistants_modifyAssistant
+ summary: Update an assistant
+ description: Updates an assistant with the supplied changes.
parameters:
- - name: conversation_id
+ - name: assistant_id
in: path
required: true
- description: The id of the conversation on which the item needs to be created.
- schema:
- type: string
- - name: include
- in: query
- required: false
- description: |-
- Additional fields to include in the response.
- See the `include` parameter for listing Conversation items for more information.
- schema:
- type: array
- items:
- type: string
- explode: false
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ description: The ID of the assistant to modify.
schema:
type: string
responses:
@@ -8772,7 +9374,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ConversationItemList'
+ $ref: '#/components/schemas/OpenAI.AssistantObject'
4XX:
description: Client error
content:
@@ -8786,112 +9388,166 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
+ - Assistants
requestBody:
required: true
content:
application/json:
schema:
- type: object
- properties:
- items:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Item'
- maxItems: 20
- description: The items to add to the conversation. You may add up to 20 items at a time.
- required:
- - items
- get:
- operationId: listConversationItems
- summary: List conversation items
- description: Returns the items belonging to the specified conversation.
- parameters:
- - name: conversation_id
- in: path
- required: true
- description: The id of the conversation on which the items needs to be listed.
- schema:
- type: string
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- - name: after
- in: query
- required: false
- description: |-
- 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.
- schema:
- type: string
- explode: false
- - name: before
- in: query
- required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: item_type
- in: query
- required: false
- description: Filter by item type. If provided, only items of the specified type will be returned.
- schema:
- $ref: '#/components/schemas/OpenAI.ItemType'
- explode: false
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ModifyAssistantRequest'
+ description: The request body.
+ deprecated: true
+ x-oaiMeta:
+ name: Modify assistant
+ group: assistants
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/assistants/asst_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
+ "tools": [{"type": "file_search"}],
+ "model": "gpt-4o"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.update(
+ assistant_id="assistant_id",
+ )
+ print(assistant.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myUpdatedAssistant = await openai.beta.assistants.update(
+ "asst_abc123",
+ {
+ instructions:
+ "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
+ name: "HR Helper",
+ tools: [{ type: "file_search" }],
+ model: "gpt-4o"
+ }
+ );
+
+ console.log(myUpdatedAssistant);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.update('assistant_id');
+
+ console.log(assistant.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.Update(
+ context.TODO(),
+ "assistant_id",
+ openai.BetaAssistantUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Assistant assistant = client.beta().assistants().update("assistant_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.update("assistant_id")
+
+ puts(assistant)
+ response: |
+ {
+ "id": "asst_123",
+ "object": "assistant",
+ "created_at": 1699009709,
+ "name": "HR Helper",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "tool_resources": {
+ "file_search": {
+ "vector_store_ids": []
+ }
+ },
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ /openai/v1/audio/speech:
+ post:
+ operationId: Audio_createSpeech
+ summary: Create a speech
+ description: Creates a speech from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ Transfer-Encoding:
+ required: false
+ description: The TransferEncoding header.
+ schema:
+ type: string
+ content:
+ application/octet-stream:
+ schema:
+ contentMediaType: application/octet-stream
4XX:
description: Client error
content:
@@ -8905,38 +9561,278 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- /openai/v1/conversations/{conversation_id}/items/{item_id}:
- get:
- operationId: getConversationItem
- summary: Get a conversation item
- description: Retrieves a specific item from the specified conversation.
- parameters:
- - name: conversation_id
- in: path
- required: true
- description: The ID of the conversation that contains the item.
- schema:
- type: string
- - name: item_id
- in: path
- required: true
- description: The id of the conversation item to retrieve.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
+ - Audio
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateSpeechRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create speech
+ group: audio
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/speech \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "gpt-4o-mini-tts",
+ "input": "The quick brown fox jumped over the lazy dog.",
+ "voice": "alloy"
+ }' \
+ --output speech.mp3
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ speech = client.audio.speech.create(
+ input="input",
+ model="tts-1",
+ voice="alloy",
+ )
+ print(speech)
+ content = speech.read()
+ print(content)
+ javascript: |
+ import fs from "fs";
+ import path from "path";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const speechFile = path.resolve("./speech.mp3");
+
+ async function main() {
+ const mp3 = await openai.audio.speech.create({
+ model: "gpt-4o-mini-tts",
+ voice: "alloy",
+ input: "Today is a wonderful day to build something people love!",
+ });
+ console.log(speechFile);
+ const buffer = Buffer.from(await mp3.arrayBuffer());
+ await fs.promises.writeFile(speechFile, buffer);
+ }
+ main();
+ csharp: |
+ using System;
+ using System.IO;
+
+ using OpenAI.Audio;
+
+ AudioClient client = new(
+ model: "gpt-4o-mini-tts",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ BinaryData speech = client.GenerateSpeech(
+ text: "The quick brown fox jumped over the lazy dog.",
+ voice: GeneratedSpeechVoice.Alloy
+ );
+
+ using FileStream stream = File.OpenWrite("speech.mp3");
+ speech.ToStream().CopyTo(stream);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const speech = await client.audio.speech.create({
+ input: 'input',
+ model: 'tts-1',
+ voice: 'alloy',
+ });
+
+ console.log(speech);
+
+ const content = await speech.blob();
+ console.log(content);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ speech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{
+ Input: "input",
+ Model: openai.SpeechModelTTS1,
+ Voice: openai.AudioSpeechNewParamsVoiceUnion{
+ OfAudioSpeechNewsVoiceString2: openai.String("alloy"),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", speech)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.audio.speech.SpeechCreateParams;
+ import com.openai.models.audio.speech.SpeechModel;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ SpeechCreateParams params = SpeechCreateParams.builder()
+ .input("input")
+ .model(SpeechModel.TTS_1)
+ .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)
+ .build();
+ HttpResponse speech = client.audio().speech().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ speech = openai.audio.speech.create(input: "input", model: :"tts-1", voice: :alloy)
+
+ puts(speech)
+ - title: SSE Stream Format
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/speech \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "gpt-4o-mini-tts",
+ "input": "The quick brown fox jumped over the lazy dog.",
+ "voice": "alloy",
+ "stream_format": "sse"
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const speech = await client.audio.speech.create({
+ input: 'input',
+ model: 'tts-1',
+ voice: 'alloy',
+ });
+
+ console.log(speech);
+
+ const content = await speech.blob();
+ console.log(content);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ speech = client.audio.speech.create(
+ input="input",
+ model="tts-1",
+ voice="alloy",
+ )
+ print(speech)
+ content = speech.read()
+ print(content)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ speech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{
+ Input: "input",
+ Model: openai.SpeechModelTTS1,
+ Voice: openai.AudioSpeechNewParamsVoiceUnion{
+ OfAudioSpeechNewsVoiceString2: openai.String("alloy"),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", speech)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.audio.speech.SpeechCreateParams;
+ import com.openai.models.audio.speech.SpeechModel;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ SpeechCreateParams params = SpeechCreateParams.builder()
+ .input("input")
+ .model(SpeechModel.TTS_1)
+ .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)
+ .build();
+ HttpResponse speech = client.audio().speech().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ speech = openai.audio.speech.create(input: "input", model: :"tts-1", voice: :alloy)
+
+ puts(speech)
+ /openai/v1/audio/transcriptions:
+ post:
+ operationId: Audio_createTranscription
+ summary: Create a transcription
+ description: Creates a transcription from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.OutputItem'
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJson'
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseDiarizedJson'
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseVerboseJson'
4XX:
description: Client error
content:
@@ -8950,37 +9846,996 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- delete:
- operationId: deleteConversationItem
- summary: Delete a conversation item
- description: Removes the specified item from a conversation.
- parameters:
- - name: conversation_id
- in: path
- required: true
- description: The id of the conversation on which the item needs to be deleted from.
- schema:
- type: string
- - name: item_id
- in: path
- required: true
- description: The id of the conversation item to delete.
- schema:
- type: string
- - name: x-ms-user-identity
- in: header
- required: false
- description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
- schema:
- type: string
+ - Audio
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionRequest'
+ encoding:
+ model:
+ contentType: text/plain
+ response_format:
+ contentType: application/json
+ temperature:
+ contentType: text/plain
+ include:
+ contentType: application/json
+ timestamp_granularities:
+ contentType: application/json
+ stream:
+ contentType: application/json
+ chunking_strategy:
+ contentType: application/json
+ known_speaker_names:
+ contentType: application/json
+ known_speaker_references:
+ contentType: application/json
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Create transcription
+ group: audio
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F model="gpt-4o-transcribe"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "gpt-4o-transcribe",
+ });
+
+ console.log(transcription.text);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Audio;
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "gpt-4o-transcribe",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath);
+
+ Console.WriteLine($"{transcription.Text}");
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.",
+ "usage": {
+ "type": "tokens",
+ "input_tokens": 14,
+ "input_token_details": {
+ "text_tokens": 0,
+ "audio_tokens": 14
+ },
+ "output_tokens": 45,
+ "total_tokens": 59
+ }
+ }
+ - title: Diarization
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/meeting.wav" \
+ -F model="gpt-4o-transcribe-diarize" \
+ -F response_format="diarized_json" \
+ -F chunking_strategy=auto \
+ -F 'known_speaker_names[]=agent' \
+ -F 'known_speaker_references[]=data:audio/wav;base64,AAA...'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const speakerRef = fs.readFileSync("agent.wav").toString("base64");
+
+ const transcript = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("meeting.wav"),
+ model: "gpt-4o-transcribe-diarize",
+ response_format: "diarized_json",
+ chunking_strategy: "auto",
+ extra_body: {
+ known_speaker_names: ["agent"],
+ known_speaker_references: [`data:audio/wav;base64,${speakerRef}`],
+ },
+ });
+
+ console.log(transcript.segments);
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "task": "transcribe",
+ "duration": 27.4,
+ "text": "Agent: Thanks for calling OpenAI support.
+ A: Hi, I'm trying to enable diarization.
+ Agent: Happy to walk you through the steps.",
+ "segments": [
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_001",
+ "start": 0.0,
+ "end": 4.7,
+ "text": "Thanks for calling OpenAI support.",
+ "speaker": "agent"
+ },
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_002",
+ "start": 4.7,
+ "end": 11.8,
+ "text": "Hi, I'm trying to enable diarization.",
+ "speaker": "A"
+ },
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_003",
+ "start": 12.1,
+ "end": 18.5,
+ "text": "Happy to walk you through the steps.",
+ "speaker": "agent"
+ }
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 27
+ }
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F model="gpt-4o-mini-transcribe" \
+ -F stream=true
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const stream = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "gpt-4o-mini-transcribe",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ data: {"type":"transcript.text.delta","delta":"I","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]}]}
+
+ data: {"type":"transcript.text.delta","delta":" see","logprobs":[{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" skies","logprobs":[{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]}]}
+
+ data: {"type":"transcript.text.delta","delta":" blue","logprobs":[{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" clouds","logprobs":[{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]}]}
+
+ data: {"type":"transcript.text.delta","delta":" white","logprobs":[{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0014890312,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" bright","logprobs":[{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]}]}
+
+ data: {"type":"transcript.text.delta","delta":" blessed","logprobs":[{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" days","logprobs":[{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.00001700133,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" dark","logprobs":[{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]}]}
+
+ data: {"type":"transcript.text.delta","delta":" sacred","logprobs":[{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" nights","logprobs":[{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0036910512,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" I","logprobs":[{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]}]}
+
+ data: {"type":"transcript.text.delta","delta":" think","logprobs":[{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]}]}
+
+ data: {"type":"transcript.text.delta","delta":" to","logprobs":[{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]}]}
+
+ data: {"type":"transcript.text.delta","delta":" myself","logprobs":[{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.29254505,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" what","logprobs":[{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]}]}
+
+ data: {"type":"transcript.text.delta","delta":" a","logprobs":[{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]}]}
+
+ data: {"type":"transcript.text.delta","delta":" wonderful","logprobs":[{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]}]}
+
+ data: {"type":"transcript.text.delta","delta":" world","logprobs":[{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":".","logprobs":[{"token":".","logprob":-0.014231676,"bytes":[46]}]}
+
+ data: {"type":"transcript.text.done","text":"I see skies of blue and clouds of white, the bright blessed days, the dark sacred nights, and I think to myself, what a wonderful world.","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]},{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]},{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]},{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]},{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]},{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]},{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]},{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]},{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]},{"token":",","logprob":-0.0014890312,"bytes":[44]},{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]},{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]},{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]},{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]},{"token":",","logprob":-0.00001700133,"bytes":[44]},{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]},{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]},{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]},{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]},{"token":",","logprob":-0.0036910512,"bytes":[44]},{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]},{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]},{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]},{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]},{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]},{"token":",","logprob":-0.29254505,"bytes":[44]},{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]},{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]},{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]},{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]},{"token":".","logprob":-0.014231676,"bytes":[46]}],"usage":{"input_tokens":14,"input_token_details":{"text_tokens":0,"audio_tokens":14},"output_tokens":45,"total_tokens":59}}
+ - title: Logprobs
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F "include[]=logprobs" \
+ -F model="gpt-4o-transcribe" \
+ -F response_format="json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "gpt-4o-transcribe",
+ response_format: "json",
+ include: ["logprobs"]
+ });
+
+ console.log(transcription);
+ }
+ main();
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "text": "Hey, my knee is hurting and I want to see the doctor tomorrow ideally.",
+ "logprobs": [
+ { "token": "Hey", "logprob": -1.0415299, "bytes": [72, 101, 121] },
+ { "token": ",", "logprob": -9.805982e-5, "bytes": [44] },
+ { "token": " my", "logprob": -0.00229799, "bytes": [32, 109, 121] },
+ {
+ "token": " knee",
+ "logprob": -4.7159858e-5,
+ "bytes": [32, 107, 110, 101, 101]
+ },
+ { "token": " is", "logprob": -0.043909557, "bytes": [32, 105, 115] },
+ {
+ "token": " hurting",
+ "logprob": -1.1041146e-5,
+ "bytes": [32, 104, 117, 114, 116, 105, 110, 103]
+ },
+ { "token": " and", "logprob": -0.011076359, "bytes": [32, 97, 110, 100] },
+ { "token": " I", "logprob": -5.3193703e-6, "bytes": [32, 73] },
+ {
+ "token": " want",
+ "logprob": -0.0017156356,
+ "bytes": [32, 119, 97, 110, 116]
+ },
+ { "token": " to", "logprob": -7.89631e-7, "bytes": [32, 116, 111] },
+ { "token": " see", "logprob": -5.5122365e-7, "bytes": [32, 115, 101, 101] },
+ { "token": " the", "logprob": -0.0040786397, "bytes": [32, 116, 104, 101] },
+ {
+ "token": " doctor",
+ "logprob": -2.3392786e-6,
+ "bytes": [32, 100, 111, 99, 116, 111, 114]
+ },
+ {
+ "token": " tomorrow",
+ "logprob": -7.89631e-7,
+ "bytes": [32, 116, 111, 109, 111, 114, 114, 111, 119]
+ },
+ {
+ "token": " ideally",
+ "logprob": -0.5800861,
+ "bytes": [32, 105, 100, 101, 97, 108, 108, 121]
+ },
+ { "token": ".", "logprob": -0.00011093382, "bytes": [46] }
+ ],
+ "usage": {
+ "type": "tokens",
+ "input_tokens": 14,
+ "input_token_details": {
+ "text_tokens": 0,
+ "audio_tokens": 14
+ },
+ "output_tokens": 45,
+ "total_tokens": 59
+ }
+ }
+ - title: Word timestamps
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F "timestamp_granularities[]=word" \
+ -F model="whisper-1" \
+ -F response_format="verbose_json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "whisper-1",
+ response_format: "verbose_json",
+ timestamp_granularities: ["word"]
+ });
+
+ console.log(transcription.text);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Audio;
+
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "whisper-1",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscriptionOptions options = new()
+ {
+ ResponseFormat = AudioTranscriptionFormat.Verbose,
+ TimestampGranularities = AudioTimestampGranularities.Word,
+ };
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);
+
+ Console.WriteLine($"{transcription.Text}");
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "task": "transcribe",
+ "language": "english",
+ "duration": 8.470000267028809,
+ "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
+ "words": [
+ {
+ "word": "The",
+ "start": 0.0,
+ "end": 0.23999999463558197
+ },
+ ...
+ {
+ "word": "volleyball",
+ "start": 7.400000095367432,
+ "end": 7.900000095367432
+ }
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 9
+ }
+ }
+ - title: Segment timestamps
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/transcriptions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/audio.mp3" \
+ -F "timestamp_granularities[]=segment" \
+ -F model="whisper-1" \
+ -F response_format="verbose_json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "whisper-1",
+ response_format: "verbose_json",
+ timestamp_granularities: ["segment"]
+ });
+
+ console.log(transcription.text);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Audio;
+
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "whisper-1",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscriptionOptions options = new()
+ {
+ ResponseFormat = AudioTranscriptionFormat.Verbose,
+ TimestampGranularities = AudioTimestampGranularities.Segment,
+ };
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);
+
+ Console.WriteLine($"{transcription.Text}");
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ response: |
+ {
+ "task": "transcribe",
+ "language": "english",
+ "duration": 8.470000267028809,
+ "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
+ "segments": [
+ {
+ "id": 0,
+ "seek": 0,
+ "start": 0.0,
+ "end": 3.319999933242798,
+ "text": " The beach was a popular spot on a hot summer day.",
+ "tokens": [
+ 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530
+ ],
+ "temperature": 0.0,
+ "avg_logprob": -0.2860786020755768,
+ "compression_ratio": 1.2363636493682861,
+ "no_speech_prob": 0.00985979475080967
+ },
+ ...
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 9
+ }
+ }
+ /openai/v1/audio/translations:
+ post:
+ operationId: Audio_createTranslation
+ summary: Create a translation
+ description: Creates a translation from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ConversationResource'
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateTranslationResponseJson'
+ - $ref: '#/components/schemas/OpenAI.CreateTranslationResponseVerboseJson'
4XX:
description: Client error
content:
@@ -8994,77 +10849,175 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Conversations
- /openai/v1/evals:
+ - Audio
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateTranslationRequest'
+ encoding:
+ model:
+ contentType: text/plain
+ temperature:
+ contentType: text/plain
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Create translation
+ group: audio
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/audio/translations \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: multipart/form-data" \
+ -F file="@/path/to/file/german.m4a" \
+ -F model="whisper-1"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ translation = client.audio.translations.create(
+ file=b"Example data",
+ model="whisper-1",
+ )
+ print(translation)
+ javascript: |
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const translation = await openai.audio.translations.create({
+ file: fs.createReadStream("speech.mp3"),
+ model: "whisper-1",
+ });
+
+ console.log(translation.text);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Audio;
+
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "whisper-1",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath);
+
+ Console.WriteLine($"{transcription.Text}");
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const translation = await client.audio.translations.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'whisper-1',
+ });
+
+ console.log(translation);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ translation, err := client.Audio.Translations.New(context.TODO(), openai.AudioTranslationNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelWhisper1,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", translation)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.translations.TranslationCreateParams;
+ import com.openai.models.audio.translations.TranslationCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranslationCreateParams params = TranslationCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.WHISPER_1)
+ .build();
+ TranslationCreateResponse translation = client.audio().translations().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ translation = openai.audio.translations.create(file: StringIO.new("Example data"), model: :"whisper-1")
+
+ puts(translation)
+ response: |
+ {
+ "text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?"
+ }
+ /openai/v1/batches:
get:
- operationId: Evals_listEvals
- summary: List evaluations
- description: Returns the evaluations configured in the current project.
+ operationId: Batches_listBatches
+ summary: List batches
+ description: Lists batches matching the request filters.
parameters:
- name: after
in: query
required: false
- description: Identifier for the last run from the previous pagination request.
+ description: 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.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
- name: limit
in: query
required: false
- description: Number of runs to retrieve.
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
schema:
$ref: '#/components/schemas/integer'
default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
- schema:
- type: string
- enum:
- - asc
- - desc
- default: asc
- explode: false
- - name: order_by
- in: query
- required: false
- description: |-
- Evals can be ordered by creation time or last updated time.
- Use `created_at` for creation time or `updated_at` for last updated time.
- schema:
- type: string
- enum:
- - created_at
- - updated_at
- default: created_at
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Eval'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ListBatchesResponse'
4XX:
description: Client error
content:
@@ -9078,61 +11031,150 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- post:
- operationId: Evals_createEval
- summary: Create an evaluation
- description: |-
- Creates 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).
- parameters: []
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Eval'
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Evals
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CreateEvalRequest'
- /openai/v1/evals/{eval_id}:
- delete:
- operationId: Evals_deleteEval
- summary: Delete an evaluation
- description: Removes the specified evaluation and its associated data.
- parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to delete.
- schema:
- type: string
+ - Batch
+ x-oaiMeta:
+ name: List batches
+ group: batch
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/batches?limit=2 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.batches.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.batches.list();
+
+ for await (const batch of list) {
+ console.log(batch);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const batch of client.batches.list()) {
+ console.log(batch.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Batches.List(context.TODO(), openai.BatchListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.BatchListPage;
+ import com.openai.models.batches.BatchListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ BatchListPage page = client.batches().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.batches.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/chat/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "completed",
+ "output_file_id": "file-cvaTdG",
+ "error_file_id": "file-HOWS94",
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": 1711493133,
+ "completed_at": 1711493163,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 95,
+ "failed": 5
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly job",
+ }
+ },
+ { ... },
+ ],
+ "first_id": "batch_abc123",
+ "last_id": "batch_abc456",
+ "has_more": true
+ }
+ x-ms-list: true
+ post:
+ operationId: Batches_createBatch
+ summary: Create a batch
+ description: Creates a batch from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteEvalResponse'
+ $ref: '#/components/schemas/OpenAI.Batch'
4XX:
description: Client error
content:
@@ -9146,16 +11188,171 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Batch
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateBatchParametersBody'
+ description: The request body.
+ x-oaiMeta:
+ name: Create batch
+ group: batch
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/batches \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "input_file_id": "file-abc123",
+ "endpoint": "/v1/chat/completions",
+ "completion_window": "24h"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ batch = client.batches.create(
+ completion_window="24h",
+ endpoint="/v1/responses",
+ input_file_id="input_file_id",
+ )
+ print(batch.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const batch = await openai.batches.create({
+ input_file_id: "file-abc123",
+ endpoint: "/v1/chat/completions",
+ completion_window: "24h"
+ });
+
+ console.log(batch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const batch = await client.batches.create({
+ completion_window: '24h',
+ endpoint: '/v1/responses',
+ input_file_id: 'input_file_id',
+ });
+
+ console.log(batch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ batch, err := client.Batches.New(context.TODO(), openai.BatchNewParams{
+ CompletionWindow: openai.BatchNewParamsCompletionWindow24h,
+ Endpoint: openai.BatchNewParamsEndpointV1Responses,
+ InputFileID: "input_file_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", batch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.Batch;
+ import com.openai.models.batches.BatchCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ BatchCreateParams params = BatchCreateParams.builder()
+ .completionWindow(BatchCreateParams.CompletionWindow._24H)
+ .endpoint(BatchCreateParams.Endpoint.V1_RESPONSES)
+ .inputFileId("input_file_id")
+ .build();
+ Batch batch = client.batches().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ batch = openai.batches.create(
+ completion_window: :"24h",
+ endpoint: :"/v1/responses",
+ input_file_id: "input_file_id"
+ )
+
+ puts(batch)
+ response: |
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/chat/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "validating",
+ "output_file_id": null,
+ "error_file_id": null,
+ "created_at": 1711471533,
+ "in_progress_at": null,
+ "expires_at": null,
+ "finalizing_at": null,
+ "completed_at": null,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 0,
+ "completed": 0,
+ "failed": 0
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+ /openai/v1/batches/{batch_id}:
get:
- operationId: Evals_getEval
- summary: Get an evaluation
- description: Retrieves the specified evaluation and its configuration.
+ operationId: Batches_retrieveBatch
+ summary: Get a batch
+ description: Retrieves a batch by its identifier.
parameters:
- - name: eval_id
+ - name: batch_id
in: path
required: true
- description: The ID of the evaluation to retrieve.
+ description: The ID of the batch to retrieve.
schema:
type: string
responses:
@@ -9164,7 +11361,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/Eval'
+ $ref: '#/components/schemas/OpenAI.Batch'
4XX:
description: Client error
content:
@@ -9178,16 +11375,136 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Batch
+ x-oaiMeta:
+ name: Retrieve batch
+ group: batch
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/batches/batch_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ batch = client.batches.retrieve(
+ "batch_id",
+ )
+ print(batch.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const batch = await openai.batches.retrieve("batch_abc123");
+
+ console.log(batch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const batch = await client.batches.retrieve('batch_id');
+
+ console.log(batch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ batch, err := client.Batches.Get(context.TODO(), "batch_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", batch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.Batch;
+ import com.openai.models.batches.BatchRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Batch batch = client.batches().retrieve("batch_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ batch = openai.batches.retrieve("batch_id")
+
+ puts(batch)
+ response: |
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "completed",
+ "output_file_id": "file-cvaTdG",
+ "error_file_id": "file-HOWS94",
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": 1711493133,
+ "completed_at": 1711493163,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 95,
+ "failed": 5
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+ /openai/v1/batches/{batch_id}/cancel:
post:
- operationId: Evals_updateEval
- summary: Update an evaluation
- description: Updates certain properties of an evaluation.
+ operationId: Batches_cancelBatch
+ summary: Cancel a batch
+ description: Cancels a batch by its identifier.
parameters:
- - name: eval_id
+ - name: batch_id
in: path
required: true
- description: The ID of the evaluation to update.
+ description: The ID of the batch to cancel.
schema:
type: string
responses:
@@ -9196,7 +11513,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/Eval'
+ $ref: '#/components/schemas/OpenAI.Batch'
4XX:
description: Client error
content:
@@ -9210,90 +11527,177 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UpdateEvalParametersBody'
- /openai/v1/evals/{eval_id}/runs:
+ - Batch
+ x-oaiMeta:
+ name: Cancel batch
+ group: batch
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/batches/batch_abc123/cancel \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -X POST
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ batch = client.batches.cancel(
+ "batch_id",
+ )
+ print(batch.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const batch = await openai.batches.cancel("batch_abc123");
+
+ console.log(batch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const batch = await client.batches.cancel('batch_id');
+
+ console.log(batch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ batch, err := client.Batches.Cancel(context.TODO(), "batch_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", batch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.Batch;
+ import com.openai.models.batches.BatchCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Batch batch = client.batches().cancel("batch_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ batch = openai.batches.cancel("batch_id")
+
+ puts(batch)
+ response: |
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/chat/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "cancelling",
+ "output_file_id": null,
+ "error_file_id": null,
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": null,
+ "completed_at": null,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": 1711475133,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 23,
+ "failed": 1
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+ /openai/v1/chat/completions:
get:
- operationId: Evals_listRuns
- summary: List evaluation runs
- description: Returns the runs associated with the specified evaluation.
+ operationId: Chat_listChatCompletions
+ summary: List chat completions
+ description: Lists chat completions matching the request filters.
parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to retrieve runs for.
+ - name: model
+ in: query
+ required: false
+ description: The model used to generate the Chat Completions.
schema:
type: string
+ - name: metadata
+ in: query
+ required: false
+ description: |-
+ A list of metadata keys to filter the Chat Completions by. Example:
+ `metadata[key1]=value1&metadata[key2]=value2`
+ schema:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
- name: after
in: query
required: false
- description: Identifier for the last run from the previous pagination request.
+ description: Identifier for the last chat completion from the previous pagination request.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
- name: limit
in: query
required: false
- description: Number of runs to retrieve.
+ description: Number of Chat Completions to retrieve.
schema:
$ref: '#/components/schemas/integer'
default: 20
- explode: false
- name: order
in: query
required: false
- description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
+ description: Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
- type: string
- enum:
- - asc
- - desc
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
default: asc
- explode: false
- - name: status
- in: query
- required: false
- description: Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.
- schema:
- type: string
- enum:
- - queued
- - in_progress
- - completed
- - canceled
- - failed
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/EvalRun'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ChatCompletionList'
4XX:
description: Client error
content:
@@ -9307,25 +11711,146 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Chat
+ x-oaiMeta:
+ name: List Chat Completions
+ group: chat
+ path: list
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.chat.completions.list()
+ page = page.data[0]
+ print(page.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const chatCompletion of client.chat.completions.list()) {
+ console.log(chatCompletion.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Chat.Completions.List(context.TODO(), openai.ChatCompletionListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.ChatCompletionListPage;
+ import com.openai.models.chat.completions.ChatCompletionListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionListPage page = client.chat().completions().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.chat.completions.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "model": "gpt-5.4",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {},
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "has_more": false
+ }
+ x-ms-list: true
post:
- operationId: Evals_createEvalRun
- summary: Create an evaluation run
- description: Creates an evaluation run for the specified evaluation.
- parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to create a run for.
- schema:
- type: string
+ operationId: Chat_createChatCompletion
+ summary: Create a chat completion
+ description: Creates a chat completion from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/EvalRun'
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponse'
4XX:
description: Client error
content:
@@ -9339,29 +11864,1174 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Chat
requestBody:
required: true
content:
application/json:
schema:
- $ref: '#/components/schemas/CreateEvalRunRequest'
- /openai/v1/evals/{eval_id}/runs/{run_id}:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create chat completion
+ group: chat
+ path: create
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_chat_model_id",
+ "messages": [
+ {
+ "role": "developer",
+ "content": "You are a helpful assistant."
+ },
+ {
+ "role": "user",
+ "content": "Hello!"
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ messages: [{ role: "developer", content: "You are a helpful assistant." }],
+ model: "VAR_chat_model_id",
+ store: true,
+ });
+
+ console.log(completion.choices[0]);
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new SystemChatMessage("You are a helpful assistant."),
+ new UserChatMessage("Hello!")
+ ];
+
+ ChatCompletion completion = client.CompleteChat(messages);
+
+ Console.WriteLine(completion.Content[0].Text);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {
+ "id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT",
+ "object": "chat.completion",
+ "created": 1741569952,
+ "model": "gpt-5.4",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "Hello! How can I assist you today?",
+ "refusal": null,
+ "annotations": []
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 19,
+ "completion_tokens": 10,
+ "total_tokens": 29,
+ "prompt_tokens_details": {
+ "cached_tokens": 0,
+ "audio_tokens": 0
+ },
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "audio_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "service_tier": "default"
+ }
+ - title: Image input
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "messages": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": "What is in this image?"
+ },
+ {
+ "type": "image_url",
+ "image_url": {
+ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
+ }
+ }
+ ]
+ }
+ ],
+ "max_tokens": 300
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const response = await openai.chat.completions.create({
+ model: "gpt-5.4",
+ messages: [
+ {
+ role: "user",
+ content: [
+ { type: "text", text: "What's in this image?" },
+ {
+ type: "image_url",
+ image_url: {
+ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
+ },
+ }
+ ],
+ },
+ ],
+ });
+ console.log(response.choices[0]);
+ }
+ main();
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new UserChatMessage(
+ [
+ ChatMessageContentPart.CreateTextPart("What's in this image?"),
+ ChatMessageContentPart.CreateImagePart(new Uri("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"))
+ ])
+ ];
+
+ ChatCompletion completion = client.CompleteChat(messages);
+
+ Console.WriteLine(completion.Content[0].Text);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {
+ "id": "chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG",
+ "object": "chat.completion",
+ "created": 1741570283,
+ "model": "gpt-5.4",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.",
+ "refusal": null,
+ "annotations": []
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 1117,
+ "completion_tokens": 46,
+ "total_tokens": 1163,
+ "prompt_tokens_details": {
+ "cached_tokens": 0,
+ "audio_tokens": 0
+ },
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "audio_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "service_tier": "default"
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_chat_model_id",
+ "messages": [
+ {
+ "role": "developer",
+ "content": "You are a helpful assistant."
+ },
+ {
+ "role": "user",
+ "content": "Hello!"
+ }
+ ],
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ model: "VAR_chat_model_id",
+ messages: [
+ {"role": "developer", "content": "You are a helpful assistant."},
+ {"role": "user", "content": "Hello!"}
+ ],
+ stream: true,
+ });
+
+ for await (const chunk of completion) {
+ console.log(chunk.choices[0].delta.content);
+ }
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.ClientModel;
+ using System.Collections.Generic;
+ using System.Threading.Tasks;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new SystemChatMessage("You are a helpful assistant."),
+ new UserChatMessage("Hello!")
+ ];
+
+ AsyncCollectionResult completionUpdates = client.CompleteChatStreamingAsync(messages);
+
+ await foreach (StreamingChatCompletionUpdate completionUpdate in completionUpdates)
+ {
+ if (completionUpdate.ContentUpdate.Count > 0)
+ {
+ Console.Write(completionUpdate.ContentUpdate[0].Text);
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
+
+ {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}]}
+
+ ....
+
+ {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
+ - title: Functions
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "messages": [
+ {
+ "role": "user",
+ "content": "What is the weather like in Boston today?"
+ }
+ ],
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "tool_choice": "auto"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ const response = await openai.chat.completions.create({
+ model: "gpt-5.4",
+ messages: messages,
+ tools: tools,
+ tool_choice: "auto",
+ });
+
+ console.log(response);
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ChatTool getCurrentWeatherTool = ChatTool.CreateFunctionTool(
+ functionName: "get_current_weather",
+ functionDescription: "Get the current weather in a given location",
+ functionParameters: BinaryData.FromString("""
+ {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": [ "celsius", "fahrenheit" ]
+ }
+ },
+ "required": [ "location" ]
+ }
+ """)
+ );
+
+ List messages =
+ [
+ new UserChatMessage("What's the weather like in Boston today?"),
+ ];
+
+ ChatCompletionOptions options = new()
+ {
+ Tools =
+ {
+ getCurrentWeatherTool
+ },
+ ToolChoice = ChatToolChoice.CreateAutoChoice(),
+ };
+
+ ChatCompletion completion = client.CompleteChat(messages, options);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {
+ "id": "chatcmpl-abc123",
+ "object": "chat.completion",
+ "created": 1699896916,
+ "model": "gpt-4o-mini",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": null,
+ "tool_calls": [
+ {
+ "id": "call_abc123",
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "arguments": "{
+ "location": "Boston, MA"
+ }"
+ }
+ }
+ ]
+ },
+ "logprobs": null,
+ "finish_reason": "tool_calls"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 82,
+ "completion_tokens": 17,
+ "total_tokens": 99,
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ }
+ }
+ - title: Logprobs
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_chat_model_id",
+ "messages": [
+ {
+ "role": "user",
+ "content": "Hello!"
+ }
+ ],
+ "logprobs": true,
+ "top_logprobs": 2
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ messages: [{ role: "user", content: "Hello!" }],
+ model: "VAR_chat_model_id",
+ logprobs: true,
+ top_logprobs: 2,
+ });
+
+ console.log(completion.choices[0]);
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new UserChatMessage("Hello!")
+ ];
+
+ ChatCompletionOptions options = new()
+ {
+ IncludeLogProbabilities = true,
+ TopLogProbabilityCount = 2
+ };
+
+ ChatCompletion completion = client.CompleteChat(messages, options);
+
+ Console.WriteLine(completion.Content[0].Text);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ response: |
+ {
+ "id": "chatcmpl-123",
+ "object": "chat.completion",
+ "created": 1702685778,
+ "model": "gpt-4o-mini",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "Hello! How can I assist you today?"
+ },
+ "logprobs": {
+ "content": [
+ {
+ "token": "Hello",
+ "logprob": -0.31725305,
+ "bytes": [72, 101, 108, 108, 111],
+ "top_logprobs": [
+ {
+ "token": "Hello",
+ "logprob": -0.31725305,
+ "bytes": [72, 101, 108, 108, 111]
+ },
+ {
+ "token": "Hi",
+ "logprob": -1.3190403,
+ "bytes": [72, 105]
+ }
+ ]
+ },
+ {
+ "token": "!",
+ "logprob": -0.02380986,
+ "bytes": [
+ 33
+ ],
+ "top_logprobs": [
+ {
+ "token": "!",
+ "logprob": -0.02380986,
+ "bytes": [33]
+ },
+ {
+ "token": " there",
+ "logprob": -3.787621,
+ "bytes": [32, 116, 104, 101, 114, 101]
+ }
+ ]
+ },
+ {
+ "token": " How",
+ "logprob": -0.000054669687,
+ "bytes": [32, 72, 111, 119],
+ "top_logprobs": [
+ {
+ "token": " How",
+ "logprob": -0.000054669687,
+ "bytes": [32, 72, 111, 119]
+ },
+ {
+ "token": "<|end|>",
+ "logprob": -10.953937,
+ "bytes": null
+ }
+ ]
+ },
+ {
+ "token": " can",
+ "logprob": -0.015801601,
+ "bytes": [32, 99, 97, 110],
+ "top_logprobs": [
+ {
+ "token": " can",
+ "logprob": -0.015801601,
+ "bytes": [32, 99, 97, 110]
+ },
+ {
+ "token": " may",
+ "logprob": -4.161023,
+ "bytes": [32, 109, 97, 121]
+ }
+ ]
+ },
+ {
+ "token": " I",
+ "logprob": -3.7697225e-6,
+ "bytes": [
+ 32,
+ 73
+ ],
+ "top_logprobs": [
+ {
+ "token": " I",
+ "logprob": -3.7697225e-6,
+ "bytes": [32, 73]
+ },
+ {
+ "token": " assist",
+ "logprob": -13.596657,
+ "bytes": [32, 97, 115, 115, 105, 115, 116]
+ }
+ ]
+ },
+ {
+ "token": " assist",
+ "logprob": -0.04571125,
+ "bytes": [32, 97, 115, 115, 105, 115, 116],
+ "top_logprobs": [
+ {
+ "token": " assist",
+ "logprob": -0.04571125,
+ "bytes": [32, 97, 115, 115, 105, 115, 116]
+ },
+ {
+ "token": " help",
+ "logprob": -3.1089056,
+ "bytes": [32, 104, 101, 108, 112]
+ }
+ ]
+ },
+ {
+ "token": " you",
+ "logprob": -5.4385737e-6,
+ "bytes": [32, 121, 111, 117],
+ "top_logprobs": [
+ {
+ "token": " you",
+ "logprob": -5.4385737e-6,
+ "bytes": [32, 121, 111, 117]
+ },
+ {
+ "token": " today",
+ "logprob": -12.807695,
+ "bytes": [32, 116, 111, 100, 97, 121]
+ }
+ ]
+ },
+ {
+ "token": " today",
+ "logprob": -0.0040071653,
+ "bytes": [32, 116, 111, 100, 97, 121],
+ "top_logprobs": [
+ {
+ "token": " today",
+ "logprob": -0.0040071653,
+ "bytes": [32, 116, 111, 100, 97, 121]
+ },
+ {
+ "token": "?",
+ "logprob": -5.5247097,
+ "bytes": [63]
+ }
+ ]
+ },
+ {
+ "token": "?",
+ "logprob": -0.0008108172,
+ "bytes": [63],
+ "top_logprobs": [
+ {
+ "token": "?",
+ "logprob": -0.0008108172,
+ "bytes": [63]
+ },
+ {
+ "token": "?
+ ",
+ "logprob": -7.184561,
+ "bytes": [63, 10]
+ }
+ ]
+ }
+ ]
+ },
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 9,
+ "completion_tokens": 9,
+ "total_tokens": 18,
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "system_fingerprint": null
+ }
+ /openai/v1/chat/completions/{completion_id}:
delete:
- operationId: Evals_deleteEvalRun
- summary: Delete an evaluation run
- description: Removes the specified evaluation run.
+ operationId: Chat_deleteChatCompletion
+ summary: Delete a chat completion
+ description: Deletes a chat completion by its identifier.
parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to delete the run from.
- schema:
- type: string
- - name: run_id
+ - name: completion_id
in: path
required: true
- description: The ID of the run to delete.
+ description: The ID of the chat completion to delete.
schema:
type: string
responses:
@@ -9370,7 +13040,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteEvalRunResponse'
+ $ref: '#/components/schemas/OpenAI.ChatCompletionDeleted'
4XX:
description: Client error
content:
@@ -9384,22 +13054,99 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Chat
+ x-oaiMeta:
+ name: Delete chat completion
+ group: chat
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/chat/completions/chat_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ chat_completion_deleted = client.chat.completions.delete(
+ "completion_id",
+ )
+ print(chat_completion_deleted.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletionDeleted = await client.chat.completions.delete('completion_id');
+
+ console.log(chatCompletionDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletionDeleted, err := client.Chat.Completions.Delete(context.TODO(), "completion_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletionDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.ChatCompletionDeleteParams;
+ import com.openai.models.chat.completions.ChatCompletionDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionDeleted chatCompletionDeleted = client.chat().completions().delete("completion_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion_deleted = openai.chat.completions.delete("completion_id")
+
+ puts(chat_completion_deleted)
+ response: |
+ {
+ "object": "chat.completion.deleted",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "deleted": true
+ }
get:
- operationId: Evals_getEvalRun
- summary: Get an evaluation run
- description: Retrieves the specified evaluation run and its current status.
+ operationId: Chat_getChatCompletion
+ summary: Get a chat completion
+ description: Retrieves a chat completion by its identifier.
parameters:
- - name: eval_id
+ - name: completion_id
in: path
required: true
- description: The ID of the evaluation to retrieve runs for.
- schema:
- type: string
- - name: run_id
- in: path
- required: true
- description: The ID of the run to retrieve.
+ description: The ID of the chat completion to retrieve.
schema:
type: string
responses:
@@ -9408,7 +13155,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/EvalRun'
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponse'
4XX:
description: Client error
content:
@@ -9422,22 +13169,133 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
+ - Chat
+ x-oaiMeta:
+ name: Get chat completion
+ group: chat
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions/chatcmpl-abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ chat_completion = client.chat.completions.retrieve(
+ "completion_id",
+ )
+ print(chat_completion.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.retrieve('completion_id');
+
+ console.log(chatCompletion.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.Get(context.TODO(), "completion_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletion chatCompletion = client.chat().completions().retrieve("completion_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.retrieve("completion_id")
+
+ puts(chat_completion)
+ response: |
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-abc123",
+ "model": "gpt-4o-2024-08-06",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {},
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
post:
- operationId: Evals_cancelEvalRun
- summary: Cancel an evaluation run
- description: Cancels an ongoing evaluation run.
+ operationId: Chat_updateChatCompletion
+ summary: Update a chat completion
+ description: Updates a chat completion with the supplied changes.
parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation whose run you want to cancel.
- schema:
- type: string
- - name: run_id
+ - name: completion_id
in: path
required: true
- description: The ID of the run to cancel.
+ description: The ID of the chat completion to update.
schema:
type: string
responses:
@@ -9446,7 +13304,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/EvalRun'
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponse'
4XX:
description: Client error
content:
@@ -9460,87 +13318,195 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- /openai/v1/evals/{eval_id}/runs/{run_id}/output_items:
+ - Chat
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.UpdateChatCompletionParametersBody'
+ description: The request body.
+ x-oaiMeta:
+ name: Update chat completion
+ group: chat
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/chat/completions/chat_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"metadata": {"foo": "bar"}}'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ chat_completion = client.chat.completions.update(
+ completion_id="completion_id",
+ metadata={
+ "foo": "string"
+ },
+ )
+ print(chat_completion.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.update('completion_id', {
+ metadata: { foo: 'string' },
+ });
+
+ console.log(chatCompletion.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.Update(
+ context.TODO(),
+ "completion_id",
+ openai.ChatCompletionUpdateParams{
+ Metadata: shared.Metadata{
+ "foo": "string",
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionUpdateParams params = ChatCompletionUpdateParams.builder()
+ .completionId("completion_id")
+ .metadata(ChatCompletionUpdateParams.Metadata.builder()
+ .putAdditionalProperty("foo", JsonValue.from("string"))
+ .build())
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.update("completion_id", metadata: {foo: "string"})
+
+ puts(chat_completion)
+ response: |
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "model": "gpt-4o-2024-08-06",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {
+ "foo": "bar"
+ },
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
+ /openai/v1/chat/completions/{completion_id}/messages:
get:
- operationId: Evals_getEvalRunOutputItems
- summary: List evaluation run output items
- description: Returns the output items produced by the specified evaluation run.
+ operationId: Chat_getChatCompletionMessages
+ summary: Get chat completion messages
+ description: Retrieves chat completion messages by its identifier.
parameters:
- - name: eval_id
- in: path
- required: true
- schema:
- type: string
- - name: run_id
+ - name: completion_id
in: path
required: true
- description: The ID of the run to retrieve output items for.
+ description: The ID of the chat completion to retrieve messages from.
schema:
type: string
- name: after
in: query
required: false
- description: Identifier for the last run from the previous pagination request.
+ description: Identifier for the last message from the previous pagination request.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
- name: limit
in: query
required: false
- description: Number of runs to retrieve.
+ description: Number of messages to retrieve.
schema:
$ref: '#/components/schemas/integer'
default: 20
- explode: false
- name: order
in: query
required: false
- description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
+ description: Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
- type: string
- enum:
- - asc
- - desc
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
default: asc
- explode: false
- - name: status
- in: query
- required: false
- description: |-
- Filter output items by status. Use `failed` to filter by failed output
- items or `pass` to filter by passed output items.
- schema:
- type: string
- enum:
- - fail
- - pass
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/EvalRunOutputItem'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageList'
4XX:
description: Client error
content:
@@ -9554,38 +13520,122 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- /openai/v1/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}:
- get:
- operationId: Evals_getEvalRunOutputItem
- summary: Get an output item of an evaluation run
- description: Retrieves a single output item from the specified evaluation run.
- parameters:
- - name: eval_id
- in: path
- required: true
- description: The ID of the evaluation to retrieve runs for.
- schema:
- type: string
- - name: run_id
- in: path
- required: true
- description: The ID of the run to retrieve.
- schema:
- type: string
- - name: output_item_id
- in: path
- required: true
- description: The ID of the output item to retrieve.
- schema:
- type: string
+ - Chat
+ x-oaiMeta:
+ name: Get chat messages
+ group: chat
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/chat/completions/chat_abc123/messages \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.chat.completions.messages.list(
+ completion_id="completion_id",
+ )
+ page = page.data[0]
+ print(page)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const chatCompletionStoreMessage of client.chat.completions.messages.list(
+ 'completion_id',
+ )) {
+ console.log(chatCompletionStoreMessage);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Chat.Completions.Messages.List(
+ context.TODO(),
+ "completion_id",
+ openai.ChatCompletionMessageListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.messages.MessageListPage;
+ import com.openai.models.chat.completions.messages.MessageListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageListPage page = client.chat().completions().messages().list("completion_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.chat.completions.messages.list("completion_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "role": "user",
+ "content": "write a haiku about ai",
+ "name": null,
+ "content_parts": null
+ }
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/completions:
+ post:
+ operationId: Completions_createCompletion
+ summary: Create a completion
+ description: Creates a completion from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/EvalRunOutputItem'
+ $ref: '#/components/schemas/OpenAI.CreateCompletionResponse'
4XX:
description: Client error
content:
@@ -9599,32 +13649,318 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Evals
- /openai/v1/fine_tuning/jobs:
- post:
- operationId: createFineTuningJob
- summary: Create a fine-tuning job
- description: |-
- Creates a fine-tuning job which begins the process of creating a new model from a given dataset.
+ - Completions
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateCompletionRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create completion
+ group: completions
+ legacy: true
+ examples:
+ - title: No streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_completion_model_id",
+ "prompt": "Say this is a test",
+ "max_tokens": 7,
+ "temperature": 0
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.completions.create(
+ model="gpt-3.5-turbo-instruct",
+ prompt="This is a test.",
+ ):
+ print(completion)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.completions.create({
+ model: "VAR_completion_model_id",
+ prompt: "Say this is a test.",
+ max_tokens: 7,
+ temperature: 0,
+ });
+
+ console.log(completion);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const completion = await client.completions.create({
+ model: 'gpt-3.5-turbo-instruct',
+ prompt: 'This is a test.',
+ });
+
+ console.log(completion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ completion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{
+ Model: openai.CompletionNewParamsModelGPT3_5TurboInstruct,
+ Prompt: openai.CompletionNewParamsPromptUnion{
+ OfString: openai.String("This is a test."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", completion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.completions.Completion;
+ import com.openai.models.completions.CompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ CompletionCreateParams params = CompletionCreateParams.builder()
+ .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)
+ .prompt("This is a test.")
+ .build();
+ Completion completion = client.completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ completion = openai.completions.create(model: :"gpt-3.5-turbo-instruct", prompt: "This is a test.")
+
+ puts(completion)
+ response: |
+ {
+ "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
+ "object": "text_completion",
+ "created": 1589478378,
+ "model": "VAR_completion_model_id",
+ "system_fingerprint": "fp_44709d6fcb",
+ "choices": [
+ {
+ "text": "
+
+ This is indeed a test",
+ "index": 0,
+ "logprobs": null,
+ "finish_reason": "length"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 5,
+ "completion_tokens": 7,
+ "total_tokens": 12
+ }
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/completions \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "VAR_completion_model_id",
+ "prompt": "Say this is a test",
+ "max_tokens": 7,
+ "temperature": 0,
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.completions.create(
+ model="gpt-3.5-turbo-instruct",
+ prompt="This is a test.",
+ ):
+ print(completion)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.completions.create({
+ model: "VAR_completion_model_id",
+ prompt: "Say this is a test.",
+ stream: true,
+ });
+
+ for await (const chunk of stream) {
+ console.log(chunk.choices[0].text)
+ }
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const completion = await client.completions.create({
+ model: 'gpt-3.5-turbo-instruct',
+ prompt: 'This is a test.',
+ });
+
+ console.log(completion);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
- Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ completion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{
+ Model: openai.CompletionNewParamsModelGPT3_5TurboInstruct,
+ Prompt: openai.CompletionNewParamsPromptUnion{
+ OfString: openai.String("This is a test."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", completion)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.completions.Completion;
+ import com.openai.models.completions.CompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ CompletionCreateParams params = CompletionCreateParams.builder()
+ .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)
+ .prompt("This is a test.")
+ .build();
+ Completion completion = client.completions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
- [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
+ completion = openai.completions.create(model: :"gpt-3.5-turbo-instruct", prompt: "This is a test.")
+
+ puts(completion)
+ response: |
+ {
+ "id": "cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe",
+ "object": "text_completion",
+ "created": 1690759702,
+ "choices": [
+ {
+ "text": "This",
+ "index": 0,
+ "logprobs": null,
+ "finish_reason": null
+ }
+ ],
+ "model": "gpt-3.5-turbo-instruct"
+ "system_fingerprint": "fp_44709d6fcb",
+ }
+ /openai/v1/containers:
+ get:
+ operationId: Containers_listContainers
+ summary: List containers
+ description: Lists containers matching the request filters.
parameters:
- - name: api-version
+ - name: limit
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: name
+ in: query
+ required: false
+ description: Filter results by container name.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ $ref: '#/components/schemas/OpenAI.ContainerListResource'
4XX:
description: Client error
content:
@@ -9638,48 +13974,119 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequest'
- get:
- operationId: listPaginatedFineTuningJobs
- summary: List fine-tuning jobs
- description: Returns the fine-tuning jobs for the current organization.
- parameters:
- - name: after
- in: query
- required: false
- description: Identifier for the last job from the previous pagination request.
- schema:
- type: string
- explode: false
- - name: limit
- in: query
- required: false
- description: Number of fine-tuning jobs to retrieve.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Containers
+ x-oaiMeta:
+ name: List containers
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const containerListResponse of client.containers.list()) {
+ console.log(containerListResponse.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.containers.list()
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Containers.List(context.TODO(), openai.ContainerListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerListPage;
+ import com.openai.models.containers.ContainerListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContainerListPage page = client.containers().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.containers.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container",
+ "created_at": 1747844794,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747844794,
+ "memory_limit": "4g",
+ "name": "My Container"
+ }
+ ],
+ "first_id": "container_123",
+ "last_id": "container_123",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: Containers_createContainer
+ summary: Create a container
+ description: Creates a container from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse'
+ $ref: '#/components/schemas/OpenAI.ContainerResource'
4XX:
description: Client error
content:
@@ -9693,36 +14100,149 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}:
- get:
- operationId: retrieveFineTuningJob
- summary: Get a fine-tuning job
- description: |-
- Gets info about a fine-tuning job.
+ - Containers
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateContainerBody'
+ description: The request body.
+ x-oaiMeta:
+ name: Create container
+ group: containers
+ path: post
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "My Container",
+ "memory_limit": "4g",
+ "skills": [
+ {
+ "type": "skill_reference",
+ "skill_id": "skill_4db6f1a2c9e73508b41f9da06e2c7b5f"
+ },
+ {
+ "type": "skill_reference",
+ "skill_id": "openai-spreadsheets",
+ "version": "latest"
+ }
+ ],
+ "network_policy": {
+ "type": "allowlist",
+ "allowed_domains": ["api.buildkite.com"]
+ }
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const container = await client.containers.create({ name: 'name' });
+
+ console.log(container.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ container = client.containers.create(
+ name="name",
+ )
+ print(container.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
- [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ container, err := client.Containers.New(context.TODO(), openai.ContainerNewParams{
+ Name: "name",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", container.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerCreateParams;
+ import com.openai.models.containers.ContainerCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContainerCreateParams params = ContainerCreateParams.builder()
+ .name("name")
+ .build();
+ ContainerCreateResponse container = client.containers().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ container = openai.containers.create(name: "name")
+
+ puts(container)
+ response: |
+ {
+ "id": "cntr_682e30645a488191b6363a0cbefc0f0a025ec61b66250591",
+ "object": "container",
+ "created_at": 1747857508,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747857508,
+ "network_policy": {
+ "type": "allowlist",
+ "allowed_domains": ["api.buildkite.com"]
+ },
+ "memory_limit": "4g",
+ "name": "My Container"
+ }
+ /openai/v1/containers/{container_id}:
+ delete:
+ operationId: Containers_deleteContainer
+ summary: Delete a container
+ description: Deletes a container by its identifier.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job.
- schema:
- type: string
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the container to delete.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -9736,33 +14256,101 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel:
- post:
- operationId: cancelFineTuningJob
- summary: Cancel a fine-tuning job
- description: Immediately cancels the specified fine-tuning job.
+ - Containers
+ x-oaiMeta:
+ name: Delete a container
+ group: containers
+ path: delete
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ await client.containers.delete('container_id');
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ client.containers.delete(
+ "container_id",
+ )
+ go: |
+ package main
+
+ import (
+ "context"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ err := client.Containers.Delete(context.TODO(), "container_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ client.containers().delete("container_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ result = openai.containers.delete("container_id")
+
+ puts(result)
+ response: |
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Containers_retrieveContainer
+ summary: Get a container
+ description: Retrieves a container by its identifier.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to cancel.
- schema:
- type: string
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the container.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ $ref: '#/components/schemas/OpenAI.ContainerResource'
4XX:
description: Client error
content:
@@ -9776,49 +14364,138 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints:
+ - Containers
+ x-oaiMeta:
+ name: Retrieve container
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const container = await client.containers.retrieve('container_id');
+
+ console.log(container.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ container = client.containers.retrieve(
+ "container_id",
+ )
+ print(container.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ container, err := client.Containers.Get(context.TODO(), "container_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", container.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerRetrieveParams;
+ import com.openai.models.containers.ContainerRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContainerRetrieveResponse container = client.containers().retrieve("container_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ container = openai.containers.retrieve("container_id")
+
+ puts(container)
+ response: |
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container",
+ "created_at": 1747844794,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747844794,
+ "memory_limit": "4g",
+ "name": "My Container"
+ }
+ /openai/v1/containers/{container_id}/files:
get:
- operationId: listFineTuningJobCheckpoints
- summary: List fine-tuning job checkpoints
- description: Returns the checkpoints saved during the specified fine-tuning job.
+ operationId: Containers_listContainerFiles
+ summary: List container files
+ description: Lists container files matching the request filters.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to get checkpoints for.
+ description: The ID of the container.
schema:
type: string
- - name: after
+ - name: limit
in: query
required: false
- description: Identifier for the last checkpoint ID from the previous pagination request.
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
schema:
- type: string
- explode: false
- - name: limit
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
in: query
required: false
- description: Number of checkpoints to retrieve.
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
schema:
- type: integer
- format: int32
- default: 10
- explode: false
- - name: api-version
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: 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.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse'
+ $ref: '#/components/schemas/OpenAI.ContainerFileListResource'
4XX:
description: Client error
content:
@@ -9832,49 +14509,127 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/events:
- get:
- operationId: listFineTuningJobEvents
- summary: List fine-tuning job events
- description: Returns the status events emitted during the specified fine-tuning job.
+ - Containers
+ x-oaiMeta:
+ name: List container files
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fileListResponse of client.containers.files.list('container_id')) {
+ console.log(fileListResponse.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.containers.files.list(
+ container_id="container_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Containers.Files.List(
+ context.TODO(),
+ "container_id",
+ openai.ContainerFileListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileListPage;
+ import com.openai.models.containers.files.FileListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileListPage page = client.containers().files().list("container_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.containers.files.list("container_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+ ],
+ "first_id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "has_more": false,
+ "last_id": "cfile_682e0e8a43c88191a7978f477a09bdf5"
+ }
+ x-ms-list: true
+ post:
+ operationId: Containers_createContainerFileMultipart_Containers_createContainerFileJson
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to get events for.
- schema:
- type: string
- - name: after
- in: query
- required: false
- description: Identifier for the last event from the previous pagination request.
- schema:
- type: string
- explode: false
- - name: limit
- in: query
- required: false
- description: Number of events to retrieve.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the container.
schema:
type: string
- explode: false
+ description: Creates a container file multipart from the supplied request. Creates a container file json from the supplied request.
+ summary: Create a container file multipart Create a container file json
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.ListFineTuningJobEventsResponse'
+ $ref: '#/components/schemas/OpenAI.ContainerFileResource'
4XX:
description: Client error
content:
@@ -9887,34 +14642,258 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause:
- post:
- operationId: pauseFineTuningJob
- summary: Pause a fine-tuning job
- description: Pauses the specified fine-tuning job while it is running.
+ x-ms-request-body-description-override: The request body.
+ x-oaiMeta:
+ name: Create container file
+ group: containers
+ path: post
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F file="@example.txt"
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const file = await client.containers.files.create('container_id');
+
+ console.log(file.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file = client.containers.files.create(
+ container_id="container_id",
+ )
+ print(file.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ file, err := client.Containers.Files.New(
+ context.TODO(),
+ "container_id",
+ openai.ContainerFileNewParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", file.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileCreateParams;
+ import com.openai.models.containers.files.FileCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateResponse file = client.containers().files().create("container_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file = openai.containers.files.create("container_id")
+
+ puts(file)
+ response: |
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+ tags:
+ - Containers
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateContainerFileBody'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateContainerFileBody'
+ description: The multipart request body. The request body.
+ /openai/v1/containers/{container_id}/files/{file_id}:
+ delete:
+ operationId: Containers_deleteContainerFile
+ summary: Delete a container file
+ description: Deletes a container file by its identifier.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to pause.
+ description: The ID of the container.
schema:
type: string
- - name: api-version
- in: query
+ - name: file_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the file.
schema:
type: string
- explode: false
+ x-ms-description-override: The ID of the file.
responses:
'200':
description: The request has succeeded.
+ 4XX:
+ description: Client error
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Containers
+ x-oaiMeta:
+ name: Delete a container file
+ group: containers
+ path: delete
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863/files/cfile_682e0e8a43c88191a7978f477a09bdf5 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ await client.containers.files.delete('file_id', { container_id: 'container_id' });
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ client.containers.files.delete(
+ file_id="file_id",
+ container_id="container_id",
+ )
+ go: |
+ package main
+
+ import (
+ "context"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ err := client.Containers.Files.Delete(
+ context.TODO(),
+ "container_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileDeleteParams params = FileDeleteParams.builder()
+ .containerId("container_id")
+ .fileId("file_id")
+ .build();
+ client.containers().files().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ result = openai.containers.files.delete("file_id", container_id: "container_id")
+
+ puts(result)
+ response: |
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Containers_retrieveContainerFile
+ summary: Get a container file
+ description: Retrieves a container file by its identifier.
+ parameters:
+ - name: container_id
+ in: path
+ required: true
+ description: The ID of the container.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file.
+ schema:
+ type: string
+ x-ms-description-override: The ID of the file.
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ContainerFileResource'
4XX:
description: Client error
content:
@@ -9928,33 +14907,253 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume:
- post:
- operationId: resumeFineTuningJob
- summary: Resume a fine-tuning job
- description: Resumes the specified fine-tuning job after it has been paused.
+ - Containers
+ x-oaiMeta:
+ name: Retrieve container file
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/container_123/files/file_456 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const file = await client.containers.files.retrieve('file_id', { container_id: 'container_id' });
+
+ console.log(file.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file = client.containers.files.retrieve(
+ file_id="file_id",
+ container_id="container_id",
+ )
+ print(file.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ file, err := client.Containers.Files.Get(
+ context.TODO(),
+ "container_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", file.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileRetrieveParams;
+ import com.openai.models.containers.files.FileRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileRetrieveParams params = FileRetrieveParams.builder()
+ .containerId("container_id")
+ .fileId("file_id")
+ .build();
+ FileRetrieveResponse file = client.containers().files().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file = openai.containers.files.retrieve("file_id", container_id: "container_id")
+
+ puts(file)
+ response: |
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+ /openai/v1/containers/{container_id}/files/{file_id}/content:
+ get:
+ operationId: Containers_retrieveContainerFileContent
+ summary: Get a container file content
+ description: Retrieves a container file content by its identifier.
parameters:
- - name: fine_tuning_job_id
+ - name: container_id
in: path
required: true
- description: The ID of the fine-tuning job to resume.
+ description: The ID of the container.
schema:
type: string
- - name: api-version
- in: query
+ - name: file_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the file.
schema:
type: string
- explode: false
+ x-ms-description-override: The ID of the file.
responses:
'200':
description: The request has succeeded.
+ 4XX:
+ description: Client error
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Containers
+ x-oaiMeta:
+ name: Retrieve container file content
+ group: containers
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/containers/container_123/files/cfile_456/content \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const content = await client.containers.files.content.retrieve('file_id', {
+ container_id: 'container_id',
+ });
+
+ console.log(content);
+
+ const data = await content.blob();
+ console.log(data);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ content = client.containers.files.content.retrieve(
+ file_id="file_id",
+ container_id="container_id",
+ )
+ print(content)
+ data = content.read()
+ print(data)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ content, err := client.Containers.Files.Content.Get(
+ context.TODO(),
+ "container_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", content)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.containers.files.content.ContentRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContentRetrieveParams params = ContentRetrieveParams.builder()
+ .containerId("container_id")
+ .fileId("file_id")
+ .build();
+ HttpResponse content = client.containers().files().content().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ content = openai.containers.files.content.retrieve("file_id", container_id: "container_id")
+
+ puts(content)
+ response: |
+
+ /openai/v1/conversations:
+ post:
+ operationId: createConversation
+ summary: Create a conversation
+ description: Creates a new conversation resource.
+ parameters:
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
4XX:
description: Client error
content:
@@ -9968,13 +15167,204 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Fine-Tuning
- /openai/v1/responses:
- post:
- operationId: createResponse
- summary: Create a model response
- description: Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response.
+ - Conversations
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateConversationBody'
+ x-oaiMeta:
+ name: Create a conversation
+ group: conversations
+ path: create
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "metadata": {"topic": "demo"},
+ "items": [
+ {
+ "type": "message",
+ "role": "user",
+ "content": "Hello!"
+ }
+ ]
+ }'
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const conversation = await client.conversations.create({
+ metadata: { topic: "demo" },
+ items: [
+ { type: "message", role: "user", content: "Hello!" }
+ ],
+ });
+ console.log(conversation);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.create()
+ print(conversation.id)
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation conversation = client.CreateConversation(
+ new CreateConversationOptions
+ {
+ Metadata = new Dictionary
+ {
+ { "topic", "demo" }
+ },
+ Items =
+ {
+ new ConversationMessageInput
+ {
+ Role = "user",
+ Content = "Hello!",
+ }
+ }
+ }
+ );
+ Console.WriteLine(conversation.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.create();
+
+ console.log(conversation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.New(context.TODO(), conversations.ConversationNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.ConversationCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Conversation conversation = client.conversations().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.create
+
+ puts(conversation)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "demo"}
+ }
+ get:
+ operationId: listConversations
+ summary: List conversations
+ description: Returns the conversations available in the current project.
parameters:
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: agent_name
+ in: query
+ required: false
+ description: Filter by agent name. If provided, only items associated with the specified agent will be returned.
+ schema:
+ type: string
+ explode: false
+ - name: agent_id
+ in: query
+ required: false
+ description: Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.
+ schema:
+ type: string
+ explode: false
- name: x-ms-user-identity
in: header
required: false
@@ -9984,213 +15374,29 @@ paths:
responses:
'200':
description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
content:
application/json:
schema:
type: object
+ required:
+ - data
+ - has_more
properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- top_logprobs:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- user:
- type: string
- description: |-
- 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](/docs/guides/safety-best-practices#safety-identifiers).
- deprecated: true
- safety_identifier:
- type: string
- maxLength: 64
- description: |-
- 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
- prompt_cache_key:
- type: string
- description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
- service_tier:
- $ref: '#/components/schemas/OpenAI.ServiceTier'
- prompt_cache_retention:
- anyOf:
- - type: string
- enum:
- - in_memory
- - 24h
- - type: 'null'
- previous_response_id:
- anyOf:
- - type: string
- - type: 'null'
- model:
- type: string
- description: The model deployment to use for the creation of this response.
- background:
- anyOf:
- - type: boolean
- - type: 'null'
- max_tool_calls:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- text:
- $ref: '#/components/schemas/OpenAI.ResponseTextParam'
- tools:
- $ref: '#/components/schemas/OpenAI.ToolsArray'
- tool_choice:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- prompt:
- $ref: '#/components/schemas/OpenAI.Prompt'
- truncation:
- anyOf:
- - type: string
- enum:
- - auto
- - disabled
- - type: 'null'
- default: disabled
- id:
- type: string
- description: Unique identifier for this Response.
- object:
- type: string
- enum:
- - response
- description: The object type of this resource - always set to `response`.
- x-stainless-const: true
- status:
- type: string
- enum:
- - completed
- - failed
- - in_progress
- - cancelled
- - queued
- - incomplete
- description: |-
- The status of the response generation. One of `completed`, `failed`,
- `in_progress`, `cancelled`, `queued`, or `incomplete`.
- created_at:
- type: integer
- format: unixtime
- description: Unix timestamp (in seconds) of when this Response was created.
- completed_at:
- anyOf:
- - type: string
- format: date-time
- - type: 'null'
- type: integer
- format: unixTimestamp
- error:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseError'
- - type: 'null'
- incomplete_details:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails'
- - type: 'null'
- output:
+ data:
type: array
items:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- An array of content items generated by the model.
- - The length and order of items in the `output` array is dependent
- on the model's response.
- - Rather than accessing the first item in the `output` array and
- assuming it's an `assistant` message with the content generated by
- the model, you might consider using the `output_text` property where
- supported in SDKs.
- reasoning:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Reasoning'
- - type: 'null'
- instructions:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputItem'
- - type: 'null'
- output_text:
- anyOf:
- - type: string
- - type: 'null'
- usage:
- $ref: '#/components/schemas/OpenAI.ResponseUsage'
- moderation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Moderation'
- - type: 'null'
- parallel_tool_calls:
- type: boolean
- description: Whether to allow the model to run tool calls in parallel.
- default: true
- conversation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ConversationReference'
- - type: 'null'
- max_output_tokens:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- agent:
- $ref: '#/components/schemas/AgentId'
- description: |-
- (Deprecated) Use agent_reference instead.
- The agent used for this response
- agent_session_id:
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
+ description: The requested list of items.
+ first_id:
type: string
- description: |-
- The session identifier for this response. Currently only relevant for hosted agents.
- Always returned for hosted agents — either the caller-provided value, the auto-derived value,
- or an auto-generated UUID. Use for session-scoped operations and to maintain sandbox
- affinity in follow-up calls.
- agent_reference:
- anyOf:
- - $ref: '#/components/schemas/AgentReference'
- - type: 'null'
- description: The agent used for this response
- content_filters:
- type: array
- items:
- $ref: '#/components/schemas/ContentFilterResult'
- description: The content filter evaluation results.
- required:
- - id
- - object
- - created_at
- - error
- - incomplete_details
- - output
- - instructions
- - parallel_tool_calls
- - agent_reference
- text/event-stream:
- schema:
- $ref: '#/components/schemas/OpenAI.CreateResponseStreamingResponse'
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
4XX:
description: Client error
content:
@@ -10204,228 +15410,19 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- top_logprobs:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- user:
- type: string
- description: |-
- 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](/docs/guides/safety-best-practices#safety-identifiers).
- deprecated: true
- safety_identifier:
- type: string
- maxLength: 64
- description: |-
- 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
- prompt_cache_key:
- type: string
- description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
- service_tier:
- $ref: '#/components/schemas/OpenAI.ServiceTier'
- prompt_cache_retention:
- anyOf:
- - type: string
- enum:
- - in_memory
- - 24h
- - type: 'null'
- previous_response_id:
- anyOf:
- - type: string
- - type: 'null'
- model:
- type: string
- description: The model deployment to use for the creation of this response.
- background:
- anyOf:
- - type: boolean
- - type: 'null'
- max_tool_calls:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- text:
- $ref: '#/components/schemas/OpenAI.ResponseTextParam'
- tools:
- $ref: '#/components/schemas/OpenAI.ToolsArray'
- tool_choice:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- prompt:
- $ref: '#/components/schemas/OpenAI.Prompt'
- truncation:
- anyOf:
- - type: string
- enum:
- - auto
- - disabled
- - type: 'null'
- deprecated: true
- default: disabled
- reasoning:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Reasoning'
- - type: 'null'
- input:
- $ref: '#/components/schemas/OpenAI.InputParam'
- include:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.IncludeEnum'
- - type: 'null'
- parallel_tool_calls:
- anyOf:
- - type: boolean
- - type: 'null'
- default: true
- store:
- anyOf:
- - type: boolean
- - type: 'null'
- default: true
- instructions:
- anyOf:
- - type: string
- - type: 'null'
- moderation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ModerationParam'
- - type: 'null'
- stream:
- anyOf:
- - type: boolean
- - type: 'null'
- stream_options:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamOptions'
- - type: 'null'
- conversation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ConversationParam'
- - type: 'null'
- context_management:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.ContextManagementParam'
- - type: 'null'
- description: Context management configuration for this request.
- max_output_tokens:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- agent:
- $ref: '#/components/schemas/AgentReference'
- description: |-
- (Deprecated) Use agent_reference instead.
- The agent to use for generating the response.
- agent_session_id:
- type: string
- description: |-
- Optional session identifier for sandbox affinity. Currently only relevant for hosted agents.
- When provided, the request is routed to the same sandbox. When omitted, auto-derived from
- conversation_id/prev_response_id or a new UUID is generated.
- agent_reference:
- $ref: '#/components/schemas/AgentReference'
- description: The agent to use for generating the response.
- structured_inputs:
- type: object
- unevaluatedProperties: {}
- description: The structured inputs to the response that can participate in prompt template substitution or tool argument bindings.
- get:
- operationId: listResponses
- summary: List responses
- description: Returns a collection of all stored responses matching specified filter criteria.
+ - Conversations
+ /openai/v1/conversations/{conversation_id}:
+ post:
+ operationId: updateConversation
+ summary: Update a conversation
+ description: Modifies the specified conversation's properties.
parameters:
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- - name: after
- in: query
- required: false
- description: |-
- 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.
- schema:
- type: string
- explode: false
- - name: before
- in: query
- required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: agent_name
- in: query
- required: false
- description: Filter by agent name. If provided, only items associated with the specified agent will be returned.
- schema:
- type: string
- explode: false
- - name: agent_id
- in: query
- required: false
- description: Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.
- schema:
- type: string
- explode: false
- name: conversation_id
- in: query
- required: false
- description: Filter by conversation ID. If provided, only responses associated with the specified conversation will be returned.
+ in: path
+ required: true
+ description: The id of the conversation to update.
schema:
type: string
- explode: false
- name: x-ms-user-identity
in: header
required: false
@@ -10438,53 +15435,7 @@ paths:
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Responses
- /openai/v1/responses/compact:
- post:
- operationId: compactResponseConversation
- summary: Compact a conversation
- description: Compacts a conversation into a response object suitable for long-running and zero-data-retention scenarios.
- parameters: []
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenAI.CompactResource'
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
4XX:
description: Client error
content:
@@ -10498,46 +15449,161 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
+ - Conversations
requestBody:
required: true
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.CompactResponseMethodPublicBody'
- /openai/v1/responses/{response_id}:
+ $ref: '#/components/schemas/OpenAI.UpdateConversationBody'
+ x-oaiMeta:
+ name: Update a conversation
+ group: conversations
+ path: update
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations/conv_123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "metadata": {"topic": "project-x"}
+ }'
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const updated = await client.conversations.update(
+ "conv_123",
+ { metadata: { topic: "project-x" } }
+ );
+ console.log(updated);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.update(
+ conversation_id="conv_123",
+ metadata={
+ "foo": "string"
+ },
+ )
+ print(conversation.id)
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation updated = client.UpdateConversation(
+ conversationId: "conv_123",
+ new UpdateConversationOptions
+ {
+ Metadata = new Dictionary
+ {
+ { "topic", "project-x" }
+ }
+ }
+ );
+ Console.WriteLine(updated.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.update('conv_123', { metadata: { foo: 'string' } });
+
+ console.log(conversation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.Update(
+ context.TODO(),
+ "conv_123",
+ conversations.ConversationUpdateParams{
+ Metadata: shared.Metadata{
+ "foo": "string",
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.ConversationUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ConversationUpdateParams params = ConversationUpdateParams.builder()
+ .conversationId("conv_123")
+ .metadata(ConversationUpdateParams.Metadata.builder()
+ .putAdditionalProperty("foo", JsonValue.from("string"))
+ .build())
+ .build();
+ Conversation conversation = client.conversations().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.update("conv_123", metadata: {foo: "string"})
+
+ puts(conversation)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "project-x"}
+ }
get:
- operationId: getResponse
- summary: Retrieve a model response
- description: Retrieves a model response with the given ID.
+ operationId: getConversation
+ summary: Retrieve a conversation
+ description: Retrieves the specified conversation and its metadata.
parameters:
- - name: response_id
+ - name: conversation_id
in: path
required: true
+ description: The id of the conversation to retrieve.
schema:
type: string
- - name: include[]
- in: query
- required: false
- schema:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.IncludeEnum'
- default: []
- - name: stream
- in: query
- required: false
- schema:
- type: boolean
- default: false
- explode: false
- - name: starting_after
- in: query
- required: false
- schema:
- type: integer
- format: int32
- explode: false
- name: x-ms-user-identity
in: header
required: false
@@ -10547,19 +15613,10 @@ paths:
responses:
'200':
description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.Response'
- text/event-stream:
- schema:
- $ref: '#/components/schemas/OpenAI.CreateResponseStreamingResponse'
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
4XX:
description: Client error
content:
@@ -10573,16 +15630,116 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
+ - Conversations
+ x-oaiMeta:
+ name: Retrieve a conversation
+ group: conversations
+ path: retrieve
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations/conv_123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const conversation = await client.conversations.retrieve("conv_123");
+ console.log(conversation);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.retrieve(
+ "conv_123",
+ )
+ print(conversation.id)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation conversation = client.GetConversation("conv_123");
+ Console.WriteLine(conversation.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.retrieve('conv_123');
+
+ console.log(conversation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.Get(context.TODO(), "conv_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.ConversationRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Conversation conversation = client.conversations().retrieve("conv_123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.retrieve("conv_123")
+
+ puts(conversation)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "demo"}
+ }
delete:
- operationId: deleteResponse
- summary: Delete a model response
- description: Deletes a model response.
+ operationId: deleteConversation
+ summary: Delete a conversation
+ description: Removes the specified conversation resource from the current project.
parameters:
- - name: response_id
+ - name: conversation_id
in: path
required: true
- description: The ID of the response to delete.
+ description: The id of the conversation to delete.
schema:
type: string
- name: x-ms-user-identity
@@ -10594,16 +15751,10 @@ paths:
responses:
'200':
description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteResponseResult'
+ $ref: '#/components/schemas/OpenAI.DeletedConversationResource'
4XX:
description: Client error
content:
@@ -10617,19 +15768,129 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
- /openai/v1/responses/{response_id}/cancel:
+ - Conversations
+ x-oaiMeta:
+ name: Delete a conversation
+ group: conversations
+ path: delete
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/conversations/conv_123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const deleted = await client.conversations.delete("conv_123");
+ console.log(deleted);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation_deleted_resource = client.conversations.delete(
+ "conv_123",
+ )
+ print(conversation_deleted_resource.id)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ DeletedConversation deleted = client.DeleteConversation("conv_123");
+ Console.WriteLine(deleted.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversationDeletedResource = await client.conversations.delete('conv_123');
+
+ console.log(conversationDeletedResource.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversationDeletedResource, err := client.Conversations.Delete(context.TODO(), "conv_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversationDeletedResource.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.ConversationDeleteParams;
+ import com.openai.models.conversations.ConversationDeletedResource;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ConversationDeletedResource conversationDeletedResource = client.conversations().delete("conv_123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation_deleted_resource = openai.conversations.delete("conv_123")
+
+ puts(conversation_deleted_resource)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation.deleted",
+ "deleted": true
+ }
+ /openai/v1/conversations/{conversation_id}/items:
post:
- operationId: cancelResponse
- summary: Cancel a model response
- description: Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.
+ operationId: createConversationItems
+ summary: Create conversation items
+ description: Adds one or more items to the specified conversation.
parameters:
- - name: response_id
+ - name: conversation_id
in: path
required: true
- description: The ID of the response to cancel.
+ description: The id of the conversation on which the item needs to be created.
schema:
type: string
+ - name: include
+ in: query
+ required: false
+ description: |-
+ Additional fields to include in the response.
+ See the `include` parameter for listing Conversation items for more information.
+ schema:
+ type: array
+ items:
+ type: string
+ explode: false
- name: x-ms-user-identity
in: header
required: false
@@ -10639,16 +15900,10 @@ paths:
responses:
'200':
description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/OpenAI.Response'
+ $ref: '#/components/schemas/OpenAI.ConversationItemList'
4XX:
description: Client error
content:
@@ -10662,16 +15917,249 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
- /openai/v1/responses/{response_id}/input_items:
+ - Conversations
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Item'
+ maxItems: 20
+ description: The items to add to the conversation. You may add up to 20 items at a time.
+ required:
+ - items
+ x-oaiMeta:
+ name: Create items
+ group: conversations
+ path: create-item
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations/conv_123/items \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "items": [
+ {
+ "type": "message",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "How are you?"}
+ ]
+ }
+ ]
+ }'
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const items = await client.conversations.items.create(
+ "conv_123",
+ {
+ items: [
+ {
+ type: "message",
+ role: "user",
+ content: [{ type: "input_text", text: "Hello!" }],
+ },
+ {
+ type: "message",
+ role: "user",
+ content: [{ type: "input_text", text: "How are you?" }],
+ },
+ ],
+ }
+ );
+ console.log(items.data);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation_item_list = client.conversations.items.create(
+ conversation_id="conv_123",
+ items=[{
+ "content": "string",
+ "role": "user",
+ "type": "message",
+ }],
+ )
+ print(conversation_item_list.first_id)
+ csharp: |
+ using System;
+ using System.Collections.Generic;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ConversationItemList created = client.ConversationItems.Create(
+ conversationId: "conv_123",
+ new CreateConversationItemsOptions
+ {
+ Items = new List
+ {
+ new ConversationMessage
+ {
+ Role = "user",
+ Content =
+ {
+ new ConversationInputText { Text = "Hello!" }
+ }
+ },
+ new ConversationMessage
+ {
+ Role = "user",
+ Content =
+ {
+ new ConversationInputText { Text = "How are you?" }
+ }
+ }
+ }
+ }
+ );
+ Console.WriteLine(created.Data.Count);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversationItemList = await client.conversations.items.create('conv_123', {
+ items: [
+ {
+ content: 'string',
+ role: 'user',
+ type: 'message',
+ },
+ ],
+ });
+
+ console.log(conversationItemList.first_id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversationItemList, err := client.Conversations.Items.New(
+ context.TODO(),
+ "conv_123",
+ conversations.ItemNewParams{
+ Items: []responses.ResponseInputItemUnionParam{{
+ OfMessage: &responses.EasyInputMessageParam{
+ Content: responses.EasyInputMessageContentUnionParam{
+ OfString: openai.String("string"),
+ },
+ Role: responses.EasyInputMessageRoleUser,
+ Type: responses.EasyInputMessageTypeMessage,
+ },
+ }},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversationItemList.FirstID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.items.ConversationItemList;
+ import com.openai.models.conversations.items.ItemCreateParams;
+ import com.openai.models.responses.EasyInputMessage;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemCreateParams params = ItemCreateParams.builder()
+ .conversationId("conv_123")
+ .addItem(EasyInputMessage.builder()
+ .content("string")
+ .role(EasyInputMessage.Role.USER)
+ .type(EasyInputMessage.Type.MESSAGE)
+ .build())
+ .build();
+ ConversationItemList conversationItemList = client.conversations().items().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation_item_list = openai.conversations.items.create("conv_123", items: [{content: "string", role: :user, type: :message}])
+
+ puts(conversation_item_list)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "type": "message",
+ "id": "msg_abc",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ },
+ {
+ "type": "message",
+ "id": "msg_def",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "How are you?"}
+ ]
+ }
+ ],
+ "first_id": "msg_abc",
+ "last_id": "msg_def",
+ "has_more": false
+ }
get:
- operationId: listInputItems
- summary: List input items for a response
- description: Retrieves the input items associated with the specified response.
+ operationId: listConversationItems
+ summary: List conversation items
+ description: Returns the items belonging to the specified conversation.
parameters:
- - name: response_id
+ - name: conversation_id
in: path
required: true
+ description: The id of the conversation on which the items needs to be listed.
schema:
type: string
- name: limit
@@ -10714,6 +16202,13 @@ paths:
schema:
type: string
explode: false
+ - name: item_type
+ in: query
+ required: false
+ description: Filter by item type. If provided, only items of the specified type will be returned.
+ schema:
+ $ref: '#/components/schemas/OpenAI.ItemType'
+ explode: false
- name: x-ms-user-identity
in: header
required: false
@@ -10723,12 +16218,6 @@ paths:
responses:
'200':
description: The request has succeeded.
- headers:
- x-agent-session-id:
- required: false
- description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
- schema:
- type: string
content:
application/json:
schema:
@@ -10740,7 +16229,7 @@ paths:
data:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ItemResource'
+ $ref: '#/components/schemas/OpenAI.OutputItem'
description: The requested list of items.
first_id:
type: string
@@ -10765,137 +16254,470 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Responses
- /redTeams/runs:
+ - Conversations
+ x-oaiMeta:
+ name: List items
+ group: conversations
+ path: list-items
+ examples:
+ request:
+ curl: |
+ curl "https://api.openai.com/v1/conversations/conv_123/items?limit=10" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const items = await client.conversations.items.list("conv_123", { limit: 10 });
+ console.log(items.data);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.conversations.items.list(
+ conversation_id="conv_123",
+ )
+ page = page.data[0]
+ print(page)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ConversationItemList items = client.ConversationItems.List(
+ conversationId: "conv_123",
+ new ListConversationItemsOptions { Limit = 10 }
+ );
+ Console.WriteLine(items.Data.Count);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const conversationItem of client.conversations.items.list('conv_123')) {
+ console.log(conversationItem);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Conversations.Items.List(
+ context.TODO(),
+ "conv_123",
+ conversations.ItemListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.items.ItemListPage;
+ import com.openai.models.conversations.items.ItemListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemListPage page = client.conversations().items().list("conv_123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.conversations.items.list("conv_123")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "type": "message",
+ "id": "msg_abc",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ }
+ ],
+ "first_id": "msg_abc",
+ "last_id": "msg_abc",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/conversations/{conversation_id}/items/{item_id}:
get:
- operationId: RedTeams_list
- summary: List redteams
- description: Returns the redteams available in the current project.
+ operationId: getConversationItem
+ summary: Get a conversation item
+ description: Retrieves a specific item from the specified conversation.
parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: Foundry-Features
- in: header
+ - name: conversation_id
+ in: path
required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the conversation that contains the item.
+ schema:
+ type: string
+ - name: item_id
+ in: path
+ required: true
+ description: The id of the conversation item to retrieve.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
schema:
type: string
- enum:
- - RedTeams=V1Preview
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/PagedRedTeam'
+ $ref: '#/components/schemas/OpenAI.OutputItem'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Redteams
- /redTeams/runs/{name}:
- get:
- operationId: RedTeams_get
- summary: Get a redteam
- description: Retrieves the specified redteam and its configuration.
+ - Conversations
+ x-oaiMeta:
+ name: Retrieve an item
+ group: conversations
+ path: get-item
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/conversations/conv_123/items/msg_abc \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const item = await client.conversations.items.retrieve(
+ "conv_123",
+ "msg_abc"
+ );
+ console.log(item);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation_item = client.conversations.items.retrieve(
+ item_id="msg_abc",
+ conversation_id="conv_123",
+ )
+ print(conversation_item)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ConversationItem item = client.ConversationItems.Get(
+ conversationId: "conv_123",
+ itemId: "msg_abc"
+ );
+ Console.WriteLine(item.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversationItem = await client.conversations.items.retrieve('msg_abc', {
+ conversation_id: 'conv_123',
+ });
+
+ console.log(conversationItem);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversationItem, err := client.Conversations.Items.Get(
+ context.TODO(),
+ "conv_123",
+ "msg_abc",
+ conversations.ItemGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversationItem)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.items.ConversationItem;
+ import com.openai.models.conversations.items.ItemRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemRetrieveParams params = ItemRetrieveParams.builder()
+ .conversationId("conv_123")
+ .itemId("msg_abc")
+ .build();
+ ConversationItem conversationItem = client.conversations().items().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation_item = openai.conversations.items.retrieve("msg_abc", conversation_id: "conv_123")
+
+ puts(conversation_item)
+ response: |
+ {
+ "type": "message",
+ "id": "msg_abc",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ }
+ delete:
+ operationId: deleteConversationItem
+ summary: Delete a conversation item
+ description: Removes the specified item from a conversation.
parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: name
+ - name: conversation_id
in: path
required: true
- description: Identifier of the red team run.
+ description: The id of the conversation on which the item needs to be deleted from.
schema:
type: string
- - name: Foundry-Features
- in: header
+ - name: item_id
+ in: path
required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The id of the conversation item to delete.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
schema:
type: string
- enum:
- - RedTeams=V1Preview
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/RedTeam'
+ $ref: '#/components/schemas/OpenAI.ConversationResource'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Redteams
- /redTeams/runs:run:
+ - Conversations
+ x-oaiMeta:
+ name: Delete an item
+ group: conversations
+ path: delete-item
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/conversations/conv_123/items/msg_abc \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const conversation = await client.conversations.items.delete(
+ "conv_123",
+ "msg_abc"
+ );
+ console.log(conversation);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.items.delete(
+ item_id="msg_abc",
+ conversation_id="conv_123",
+ )
+ print(conversation.id)
+ csharp: |
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation conversation = client.ConversationItems.Delete(
+ conversationId: "conv_123",
+ itemId: "msg_abc"
+ );
+ Console.WriteLine(conversation.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.items.delete('msg_abc', {
+ conversation_id: 'conv_123',
+ });
+
+ console.log(conversation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.Items.Delete(
+ context.TODO(),
+ "conv_123",
+ "msg_abc",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.items.ItemDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemDeleteParams params = ItemDeleteParams.builder()
+ .conversationId("conv_123")
+ .itemId("msg_abc")
+ .build();
+ Conversation conversation = client.conversations().items().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.items.delete("msg_abc", conversation_id: "conv_123")
+
+ puts(conversation)
+ response: |
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "demo"}
+ }
+ /openai/v1/embeddings:
post:
- operationId: RedTeams_create
- summary: Create a redteam run
- description: Submits a new redteam run for execution with the provided configuration.
- parameters:
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - RedTeams=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ operationId: Embeddings_createEmbedding
+ summary: Create an embedding
+ description: Creates an embedding from the supplied request.
+ parameters: []
responses:
- '201':
- description: The request has succeeded and a new resource has been created as a result.
+ '200':
+ description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/RedTeam'
+ $ref: '#/components/schemas/OpenAI.CreateEmbeddingResponse'
4XX:
description: Client error
content:
@@ -10909,39 +16731,211 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Redteams
+ - Embeddings
requestBody:
required: true
content:
application/json:
schema:
- $ref: '#/components/schemas/RedTeam'
- description: Redteam to be run
- /routines:
+ $ref: '#/components/schemas/OpenAI.CreateEmbeddingRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create embeddings
+ group: embeddings
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/embeddings \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "input": "The food was delicious and the waiter...",
+ "model": "text-embedding-ada-002",
+ "encoding_format": "float"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ create_embedding_response = client.embeddings.create(
+ input="The quick brown fox jumped over the lazy dog",
+ model="text-embedding-3-small",
+ )
+ print(create_embedding_response.data)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const embedding = await openai.embeddings.create({
+ model: "text-embedding-ada-002",
+ input: "The quick brown fox jumped over the lazy dog",
+ encoding_format: "float",
+ });
+
+ console.log(embedding);
+ }
+
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Embeddings;
+
+ EmbeddingClient client = new(
+ model: "text-embedding-3-small",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ OpenAIEmbedding embedding = client.GenerateEmbedding(input: "The quick brown fox jumped over the lazy dog");
+ ReadOnlyMemory vector = embedding.ToFloats();
+
+ for (int i = 0; i < vector.Length; i++)
+ {
+ Console.WriteLine($" [{i,4}] = {vector.Span[i]}");
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const createEmbeddingResponse = await client.embeddings.create({
+ input: 'The quick brown fox jumped over the lazy dog',
+ model: 'text-embedding-3-small',
+ });
+
+ console.log(createEmbeddingResponse.data);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ createEmbeddingResponse, err := client.Embeddings.New(context.TODO(), openai.EmbeddingNewParams{
+ Input: openai.EmbeddingNewParamsInputUnion{
+ OfString: openai.String("The quick brown fox jumped over the lazy dog"),
+ },
+ Model: openai.EmbeddingModelTextEmbedding3Small,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", createEmbeddingResponse.Data)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.embeddings.CreateEmbeddingResponse;
+ import com.openai.models.embeddings.EmbeddingCreateParams;
+ import com.openai.models.embeddings.EmbeddingModel;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EmbeddingCreateParams params = EmbeddingCreateParams.builder()
+ .input("The quick brown fox jumped over the lazy dog")
+ .model(EmbeddingModel.TEXT_EMBEDDING_3_SMALL)
+ .build();
+ CreateEmbeddingResponse createEmbeddingResponse = client.embeddings().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ create_embedding_response = openai.embeddings.create(
+ input: "The quick brown fox jumped over the lazy dog",
+ model: :"text-embedding-3-small"
+ )
+
+ puts(create_embedding_response)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "embedding",
+ "embedding": [
+ 0.0023064255,
+ -0.009327292,
+ .... (1536 floats total for ada-002)
+ -0.0028842222,
+ ],
+ "index": 0
+ }
+ ],
+ "model": "text-embedding-ada-002",
+ "usage": {
+ "prompt_tokens": 8,
+ "total_tokens": 8
+ }
+ }
+ /openai/v1/evals:
get:
- operationId: listRoutines
- summary: List routines
- description: Returns the routines available in the current project.
+ operationId: Evals_listEvals
+ summary: List evaluations
+ description: Returns the evaluations configured in the current project.
parameters:
- - name: Foundry-Features
- in: header
+ - name: after
+ in: query
required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: Identifier for the last run from the previous pagination request.
schema:
type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/ListRoutinesParameters.limit'
- - $ref: '#/components/parameters/ListRoutinesParameters.after'
- - $ref: '#/components/parameters/ListRoutinesParameters.before'
- - $ref: '#/components/parameters/ListRoutinesParameters.order'
- - name: api-version
+ explode: false
+ - name: limit
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: Number of runs to retrieve.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
type: string
+ enum:
+ - asc
+ - desc
+ default: asc
explode: false
+ - name: order_by
+ in: query
+ required: false
+ description: |-
+ Evals can be ordered by creation time or last updated time.
+ Use `created_at` for creation time or `updated_at` for last updated time.
+ schema:
+ type: string
+ enum:
+ - created_at
+ - updated_at
+ default: created_at
responses:
'200':
description: The request has succeeded.
@@ -10956,7 +16950,7 @@ paths:
data:
type: array
items:
- $ref: '#/components/schemas/Routine'
+ $ref: '#/components/schemas/Eval'
description: The requested list of items.
first_id:
type: string
@@ -10981,39 +16975,167 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}:
- put:
- operationId: createOrUpdateRoutine
- summary: Create or update a routine
- description: Creates a new routine or replaces an existing routine with the supplied definition.
- parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/CreateOrUpdateRoutineParameters.routine_name'
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Evals
+ x-oaiMeta:
+ name: List evals
+ group: evals
+ path: list
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals?limit=1 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.evals.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const evals = await openai.evals.list({ limit: 1 });
+ console.log(evals);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const evalListResponse of client.evals.list()) {
+ console.log(evalListResponse.id);
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalListPage;
+ import com.openai.models.evals.EvalListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalListPage page = client.evals().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.evals.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "object": "eval",
+ "data_source_config": {
+ "type": "stored_completions",
+ "metadata": {
+ "usecase": "push_notifications_summarizer"
+ },
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object"
+ },
+ "sample": {
+ "type": "object"
+ }
+ },
+ "required": [
+ "item",
+ "sample"
+ ]
+ }
+ },
+ "testing_criteria": [
+ {
+ "name": "Push Notification Summary Grader",
+ "id": "Push Notification Summary Grader-9b876f24-4762-4be9-aff4-db7a9b31c673",
+ "type": "label_model",
+ "model": "o3-mini",
+ "input": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "
+ Label the following push notification summary as either correct or incorrect.
+ The push notification and the summary will be provided below.
+ A good push notificiation summary is concise and snappy.
+ If it is good, then label it as correct, if not, then incorrect.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "
+ Push notifications: {{item.input}}
+ Summary: {{sample.output_text}}
+ "
+ }
+ }
+ ],
+ "passing_labels": [
+ "correct"
+ ],
+ "labels": [
+ "correct",
+ "incorrect"
+ ],
+ "sampling_params": null
+ }
+ ],
+ "name": "Push Notification Summary Grader",
+ "created_at": 1739314509,
+ "metadata": {
+ "description": "A stored completions eval for push notification summaries"
+ }
+ }
+ ],
+ "first_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "last_id": "eval_67aa884cf6688190b58f657d4441c8b7",
+ "has_more": true
+ }
+ x-ms-list: true
+ post:
+ operationId: Evals_createEval
+ summary: Create an evaluation
+ description: |-
+ Creates 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).
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Routine'
+ $ref: '#/components/schemas/Eval'
4XX:
description: Client error
content:
@@ -11027,44 +17149,270 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
+ - Evals
requestBody:
required: true
content:
application/json:
schema:
- $ref: '#/components/schemas/RoutineCreateOrUpdateRequest'
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- get:
- operationId: getRoutine
- summary: Get a routine
- description: Retrieves the specified routine and its current configuration.
+ $ref: '#/components/schemas/CreateEvalRequest'
+ x-oaiMeta:
+ name: Create eval
+ group: evals
+ path: post
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "Sentiment",
+ "data_source_config": {
+ "type": "stored_completions",
+ "metadata": {
+ "usecase": "chatbot"
+ }
+ },
+ "testing_criteria": [
+ {
+ "type": "label_model",
+ "model": "o3-mini",
+ "input": [
+ {
+ "role": "developer",
+ "content": "Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'"
+ },
+ {
+ "role": "user",
+ "content": "Statement: {{item.input}}"
+ }
+ ],
+ "passing_labels": [
+ "positive"
+ ],
+ "labels": [
+ "positive",
+ "neutral",
+ "negative"
+ ],
+ "name": "Example label grader"
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.create(
+ data_source_config={
+ "item_schema": {
+ "foo": "bar"
+ },
+ "type": "custom",
+ },
+ testing_criteria=[{
+ "input": [{
+ "content": "content",
+ "role": "role",
+ }],
+ "labels": ["string"],
+ "model": "model",
+ "name": "name",
+ "passing_labels": ["string"],
+ "type": "label_model",
+ }],
+ )
+ print(eval.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const evalObj = await openai.evals.create({
+ name: "Sentiment",
+ data_source_config: {
+ type: "stored_completions",
+ metadata: { usecase: "chatbot" }
+ },
+ testing_criteria: [
+ {
+ type: "label_model",
+ model: "o3-mini",
+ input: [
+ { role: "developer", content: "Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'" },
+ { role: "user", content: "Statement: {{item.input}}" }
+ ],
+ passing_labels: ["positive"],
+ labels: ["positive", "neutral", "negative"],
+ name: "Example label grader"
+ }
+ ]
+ });
+ console.log(evalObj);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.create({
+ data_source_config: {
+ item_schema: { foo: 'bar' },
+ type: 'custom',
+ },
+ testing_criteria: [
+ {
+ input: [{ content: 'content', role: 'role' }],
+ labels: ['string'],
+ model: 'model',
+ name: 'name',
+ passing_labels: ['string'],
+ type: 'label_model',
+ },
+ ],
+ });
+
+ console.log(_eval.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.evals.EvalCreateParams;
+ import com.openai.models.evals.EvalCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalCreateParams params = EvalCreateParams.builder()
+ .customDataSourceConfig(EvalCreateParams.DataSourceConfig.Custom.ItemSchema.builder()
+ .putAdditionalProperty("foo", JsonValue.from("bar"))
+ .build())
+ .addTestingCriterion(EvalCreateParams.TestingCriterion.LabelModel.builder()
+ .addInput(EvalCreateParams.TestingCriterion.LabelModel.Input.SimpleInputMessage.builder()
+ .content("content")
+ .role("role")
+ .build())
+ .addLabel("string")
+ .model("model")
+ .name("name")
+ .addPassingLabel("string")
+ .build())
+ .build();
+ EvalCreateResponse eval = client.evals().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.create(
+ data_source_config: {item_schema: {foo: "bar"}, type: :custom},
+ testing_criteria: [
+ {
+ input: [{content: "content", role: "role"}],
+ labels: ["string"],
+ model: "model",
+ name: "name",
+ passing_labels: ["string"],
+ type: :label_model
+ }
+ ]
+ )
+
+ puts(eval_)
+ response: |
+ {
+ "object": "eval",
+ "id": "eval_67b7fa9a81a88190ab4aa417e397ea21",
+ "data_source_config": {
+ "type": "stored_completions",
+ "metadata": {
+ "usecase": "chatbot"
+ },
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object"
+ },
+ "sample": {
+ "type": "object"
+ }
+ },
+ "required": [
+ "item",
+ "sample"
+ ]
+ },
+ "testing_criteria": [
+ {
+ "name": "Example label grader",
+ "type": "label_model",
+ "model": "o3-mini",
+ "input": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Classify the sentiment of the following statement as one of positive, neutral, or negative"
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "Statement: {{item.input}}"
+ }
+ }
+ ],
+ "passing_labels": [
+ "positive"
+ ],
+ "labels": [
+ "positive",
+ "neutral",
+ "negative"
+ ]
+ }
+ ],
+ "name": "Sentiment",
+ "created_at": 1740110490,
+ "metadata": {
+ "description": "An eval for sentiment analysis"
+ }
+ }
+ /openai/v1/evals/{eval_id}:
+ delete:
+ operationId: Evals_deleteEval
+ summary: Delete an evaluation
+ description: Removes the specified evaluation and its associated data.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/GetRoutineParameters'
- - name: api-version
- in: query
+ - name: eval_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the evaluation to delete.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Routine'
+ $ref: '#/components/schemas/DeleteEvalResponse'
4XX:
description: Client error
content:
@@ -11078,40 +17426,99 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- delete:
- operationId: deleteRoutine
- summary: Delete a routine
- description: Deletes the specified routine.
+ - Evals
+ x-oaiMeta:
+ name: Delete an eval
+ group: evals
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_abc123 \
+ -X DELETE \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.delete(
+ "eval_id",
+ )
+ print(eval.eval_id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const deleted = await openai.evals.delete("eval_abc123");
+ console.log(deleted);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.delete('eval_id');
+
+ console.log(_eval.eval_id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalDeleteParams;
+ import com.openai.models.evals.EvalDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalDeleteResponse eval = client.evals().delete("eval_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.delete("eval_id")
+
+ puts(eval_)
+ response: |
+ {
+ "object": "eval.deleted",
+ "deleted": true,
+ "eval_id": "eval_abc123"
+ }
+ get:
+ operationId: Evals_getEval
+ summary: Get an evaluation
+ description: Retrieves the specified evaluation and its configuration.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/DeleteRoutineParameters'
- - name: api-version
- in: query
+ - name: eval_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the evaluation to retrieve.
schema:
type: string
- explode: false
responses:
- '204':
- description: There is no content to send for this request, but the headers may be useful.
- 4XX:
- description: Client error
+ '200':
+ description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ApiErrorResponse'
+ $ref: '#/components/schemas/Eval'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
content:
@@ -11119,36 +17526,316 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}/runs:
+ - Evals
+ x-oaiMeta:
+ name: Get an eval
+ group: evals
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.retrieve(
+ "eval_id",
+ )
+ print(eval.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const evalObj = await openai.evals.retrieve("eval_67abd54d9b0081909a86353f6fb9317a");
+ console.log(evalObj);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.retrieve('eval_id');
+
+ console.log(_eval.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalRetrieveParams;
+ import com.openai.models.evals.EvalRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalRetrieveResponse eval = client.evals().retrieve("eval_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.retrieve("eval_id")
+
+ puts(eval_)
+ response: |
+ {
+ "object": "eval",
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "data_source_config": {
+ "type": "custom",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "type": "string"
+ },
+ "ground_truth": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "input",
+ "ground_truth"
+ ]
+ }
+ },
+ "required": [
+ "item"
+ ]
+ }
+ },
+ "testing_criteria": [
+ {
+ "name": "String check",
+ "id": "String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2",
+ "type": "string_check",
+ "input": "{{item.input}}",
+ "reference": "{{item.ground_truth}}",
+ "operation": "eq"
+ }
+ ],
+ "name": "External Data Eval",
+ "created_at": 1739314509,
+ "metadata": {},
+ }
+ post:
+ operationId: Evals_updateEval
+ summary: Update an evaluation
+ description: Updates certain properties of an evaluation.
+ parameters:
+ - name: eval_id
+ in: path
+ required: true
+ description: The ID of the evaluation to update.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Eval'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Evals
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateEvalParametersBody'
+ x-oaiMeta:
+ name: Update an eval
+ group: evals
+ path: update
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"name": "Updated Eval", "metadata": {"description": "Updated description"}}'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.update(
+ eval_id="eval_id",
+ )
+ print(eval.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const updatedEval = await openai.evals.update(
+ "eval_67abd54d9b0081909a86353f6fb9317a",
+ {
+ name: "Updated Eval",
+ metadata: { description: "Updated description" }
+ }
+ );
+ console.log(updatedEval);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.update('eval_id');
+
+ console.log(_eval.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalUpdateParams;
+ import com.openai.models.evals.EvalUpdateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalUpdateResponse eval = client.evals().update("eval_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.update("eval_id")
+
+ puts(eval_)
+ response: |
+ {
+ "object": "eval",
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "data_source_config": {
+ "type": "custom",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "type": "string"
+ },
+ "ground_truth": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "input",
+ "ground_truth"
+ ]
+ }
+ },
+ "required": [
+ "item"
+ ]
+ }
+ },
+ "testing_criteria": [
+ {
+ "name": "String check",
+ "id": "String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2",
+ "type": "string_check",
+ "input": "{{item.input}}",
+ "reference": "{{item.ground_truth}}",
+ "operation": "eq"
+ }
+ ],
+ "name": "Updated Eval",
+ "created_at": 1739314509,
+ "metadata": {"description": "Updated description"},
+ }
+ /openai/v1/evals/{eval_id}/runs:
get:
- operationId: listRoutineRuns
- summary: List prior runs for a routine
- description: Returns prior runs recorded for the specified routine.
+ operationId: Evals_listRuns
+ summary: List evaluation runs
+ description: Returns the runs associated with the specified evaluation.
parameters:
- - name: Foundry-Features
- in: header
+ - name: eval_id
+ in: path
+ required: true
+ description: The ID of the evaluation to retrieve runs for.
+ schema:
+ type: string
+ - name: after
+ in: query
required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: Identifier for the last run from the previous pagination request.
+ schema:
+ type: string
+ explode: false
+ - name: limit
+ in: query
+ required: false
+ description: Number of runs to retrieve.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
type: string
enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/ListRoutineRunsParameters.routine_name'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.filter'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.limit'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.after'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.before'
- - $ref: '#/components/parameters/ListRoutineRunsParameters.order'
- - name: api-version
+ - asc
+ - desc
+ default: asc
+ explode: false
+ - name: status
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.
schema:
type: string
+ enum:
+ - queued
+ - in_progress
+ - completed
+ - canceled
+ - failed
explode: false
responses:
'200':
@@ -11164,7 +17851,7 @@ paths:
data:
type: array
items:
- $ref: '#/components/schemas/RoutineRun'
+ $ref: '#/components/schemas/EvalRun'
description: The requested list of items.
first_id:
type: string
@@ -11189,39 +17876,25 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}:disable:
+ - Evals
post:
- operationId: disableRoutine
- summary: Disable a routine
- description: Disables the specified routine so it no longer runs.
+ operationId: Evals_createEvalRun
+ summary: Create an evaluation run
+ description: Creates an evaluation run for the specified evaluation.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/DisableRoutineParameters'
- - name: api-version
- in: query
+ - name: eval_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the evaluation to create a run for.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Routine'
+ $ref: '#/components/schemas/EvalRun'
4XX:
description: Client error
content:
@@ -11235,39 +17908,338 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}:dispatch_async:
- post:
- operationId: dispatchRoutineAsync
- summary: Queue an asynchronous routine dispatch
- description: Queues an asynchronous dispatch for the specified routine.
+ - Evals
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateEvalRunRequest'
+ x-oaiMeta:
+ name: Create eval run
+ group: evals
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67e579652b548190aaa83ada4b125f47/runs \
+ -X POST \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"gpt-4o-mini","data_source":{"type":"completions","input_messages":{"type":"template","template":[{"role":"developer","content":"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "} , {"role":"user","content":"{{item.input}}"}]} ,"sampling_params":{"temperature":1,"max_completions_tokens":2048,"top_p":1,"seed":42},"model":"gpt-4o-mini","source":{"type":"file_content","content":[{"item":{"input":"Tech Company Launches Advanced Artificial Intelligence Platform","ground_truth":"Technology"}}]}}'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.evals.runs.create(
+ eval_id="eval_id",
+ data_source={
+ "source": {
+ "content": [{
+ "item": {
+ "foo": "bar"
+ }
+ }],
+ "type": "file_content",
+ },
+ "type": "jsonl",
+ },
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const run = await openai.evals.runs.create(
+ "eval_67e579652b548190aaa83ada4b125f47",
+ {
+ name: "gpt-4o-mini",
+ data_source: {
+ type: "completions",
+ input_messages: {
+ type: "template",
+ template: [
+ {
+ role: "developer",
+ content: "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ },
+ {
+ role: "user",
+ content: "{{item.input}}"
+ }
+ ]
+ },
+ sampling_params: {
+ temperature: 1,
+ max_completions_tokens: 2048,
+ top_p: 1,
+ seed: 42
+ },
+ model: "gpt-4o-mini",
+ source: {
+ type: "file_content",
+ content: [
+ {
+ item: {
+ input: "Tech Company Launches Advanced Artificial Intelligence Platform",
+ ground_truth: "Technology"
+ }
+ }
+ ]
+ }
+ }
+ }
+ );
+ console.log(run);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.evals.runs.create('eval_id', {
+ data_source: {
+ source: { content: [{ item: { foo: 'bar' } }], type: 'file_content' },
+ type: 'jsonl',
+ },
+ });
+
+ console.log(run.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.evals.runs.CreateEvalJsonlRunDataSource;
+ import com.openai.models.evals.runs.RunCreateParams;
+ import com.openai.models.evals.runs.RunCreateResponse;
+ import java.util.List;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .evalId("eval_id")
+ .dataSource(CreateEvalJsonlRunDataSource.builder()
+ .fileContentSource(List.of(CreateEvalJsonlRunDataSource.Source.FileContent.Content.builder()
+ .item(CreateEvalJsonlRunDataSource.Source.FileContent.Content.Item.builder()
+ .putAdditionalProperty("foo", JsonValue.from("bar"))
+ .build())
+ .build()))
+ .build())
+ .build();
+ RunCreateResponse run = client.evals().runs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.evals.runs.create(
+ "eval_id",
+ data_source: {source: {content: [{item: {foo: "bar"}}], type: :file_content}, type: :jsonl}
+ )
+
+ puts(run)
+ response: |
+ {
+ "object": "eval.run",
+ "id": "evalrun_67e57965b480819094274e3a32235e4c",
+ "eval_id": "eval_67e579652b548190aaa83ada4b125f47",
+ "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47&run_id=evalrun_67e57965b480819094274e3a32235e4c",
+ "status": "queued",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+ /openai/v1/evals/{eval_id}/runs/{run_id}:
+ delete:
+ operationId: Evals_deleteEvalRun
+ summary: Delete an evaluation run
+ description: Removes the specified evaluation run.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ - name: eval_id
+ in: path
+ required: true
+ description: The ID of the evaluation to delete the run from.
schema:
type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/DispatchRoutineAsyncParameters.routine_name'
- - name: api-version
- in: query
+ - name: run_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the run to delete.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/DispatchRoutineResponse'
+ $ref: '#/components/schemas/DeleteEvalRunResponse'
4XX:
description: Client error
content:
@@ -11281,45 +18253,109 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DispatchRoutineRequest'
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /routines/{routine_name}:enable:
- post:
- operationId: enableRoutine
- summary: Enable a routine
- description: Enables the specified routine so it can be dispatched.
+ - Evals
+ x-oaiMeta:
+ name: Delete eval run
+ group: evals
+ path: delete
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_123abc/runs/evalrun_abc456 \
+ -X DELETE \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.evals.runs.delete(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ print(run.run_id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const deleted = await openai.evals.runs.delete(
+ "eval_123abc",
+ "evalrun_abc456"
+ );
+ console.log(deleted);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.evals.runs.delete('run_id', { eval_id: 'eval_id' });
+
+ console.log(run.run_id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.RunDeleteParams;
+ import com.openai.models.evals.runs.RunDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunDeleteParams params = RunDeleteParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ RunDeleteResponse run = client.evals().runs().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.evals.runs.delete("run_id", eval_id: "eval_id")
+
+ puts(run)
+ response: |
+ {
+ "object": "eval.run.deleted",
+ "deleted": true,
+ "run_id": "evalrun_abc456"
+ }
+ get:
+ operationId: Evals_getEvalRun
+ summary: Get an evaluation run
+ description: Retrieves the specified evaluation run and its current status.
parameters:
- - name: Foundry-Features
- in: header
- required: false
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ - name: eval_id
+ in: path
+ required: true
+ description: The ID of the evaluation to retrieve runs for.
schema:
type: string
- enum:
- - Routines=V1Preview
- - $ref: '#/components/parameters/EnableRoutineParameters'
- - name: api-version
- in: query
+ - name: run_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the run to retrieve.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Routine'
+ $ref: '#/components/schemas/EvalRun'
4XX:
description: Client error
content:
@@ -11333,349 +18369,1402 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Routines
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- /schedules:
- get:
- operationId: Schedules_list
- summary: List schedules
- description: Returns schedules that match the supplied type and enabled filters.
+ - Evals
+ x-oaiMeta:
+ name: Get an eval run
+ group: evals
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.evals.runs.retrieve(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const run = await openai.evals.runs.retrieve(
+ "evalrun_67abd54d60ec8190832b46859da808f7",
+ { eval_id: "eval_67abd54d9b0081909a86353f6fb9317a" }
+ );
+ console.log(run);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.evals.runs.retrieve('run_id', { eval_id: 'eval_id' });
+
+ console.log(run.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.RunRetrieveParams;
+ import com.openai.models.evals.runs.RunRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunRetrieveParams params = RunRetrieveParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ RunRetrieveResponse run = client.evals().runs().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.evals.runs.retrieve("run_id", eval_id: "eval_id")
+
+ puts(run)
+ response: |
+ {
+ "object": "eval.run",
+ "id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "report_url": "https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7",
+ "status": "queued",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Summit Addresses Climate Change Strategies",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Major Retailer Reports Record-Breaking Holiday Sales",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "National Team Qualifies for World Championship Finals",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Manufacturer Announces Merger with Competitor",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Breakthrough in Renewable Energy Technology Unveiled",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "World Leaders Sign Historic Climate Agreement",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Professional Athlete Sets New Record in Championship Event",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Financial Institutions Adapt to New Regulatory Requirements",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Tech Conference Showcases Advances in Artificial Intelligence",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Markets Respond to Oil Price Fluctuations",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Cooperation Strengthened Through New Treaty",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Sports League Announces Revised Schedule for Upcoming Season",
+ "ground_truth": "Sports"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+ post:
+ operationId: Evals_cancelEvalRun
+ summary: Cancel an evaluation run
+ description: Cancels an ongoing evaluation run.
parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: type
- in: query
- required: false
- description: Filter by the type of schedule.
- schema:
- $ref: '#/components/schemas/ScheduleTaskType'
- explode: false
- - name: enabled
- in: query
- required: false
- description: Filter by the enabled status.
+ - name: eval_id
+ in: path
+ required: true
+ description: The ID of the evaluation whose run you want to cancel.
schema:
- type: boolean
- explode: false
- - name: Foundry-Features
- in: header
+ type: string
+ - name: run_id
+ in: path
required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the run to cancel.
schema:
type: string
- enum:
- - Schedules=V1Preview
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/PagedSchedule'
+ $ref: '#/components/schemas/EvalRun'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- /schedules/{id}:
- delete:
- operationId: Schedules_delete
- summary: Delete a schedule
- description: Deletes the specified schedule resource.
- parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: id
- in: path
+ - Evals
+ x-oaiMeta:
+ name: Cancel eval run
+ group: evals
+ path: post
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/cancel \
+ -X POST \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.evals.runs.cancel(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ print(response.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const canceledRun = await openai.evals.runs.cancel(
+ "evalrun_67abd54d60ec8190832b46859da808f7",
+ { eval_id: "eval_67abd54d9b0081909a86353f6fb9317a" }
+ );
+ console.log(canceledRun);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.evals.runs.cancel('run_id', { eval_id: 'eval_id' });
+
+ console.log(response.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.RunCancelParams;
+ import com.openai.models.evals.runs.RunCancelResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCancelParams params = RunCancelParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ RunCancelResponse response = client.evals().runs().cancel(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.evals.runs.cancel("run_id", eval_id: "eval_id")
+
+ puts(response)
+ response: |
+ {
+ "object": "eval.run",
+ "id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "report_url": "https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7",
+ "status": "canceled",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Summit Addresses Climate Change Strategies",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Major Retailer Reports Record-Breaking Holiday Sales",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "National Team Qualifies for World Championship Finals",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Manufacturer Announces Merger with Competitor",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Breakthrough in Renewable Energy Technology Unveiled",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "World Leaders Sign Historic Climate Agreement",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Professional Athlete Sets New Record in Championship Event",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Financial Institutions Adapt to New Regulatory Requirements",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Tech Conference Showcases Advances in Artificial Intelligence",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Markets Respond to Oil Price Fluctuations",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Cooperation Strengthened Through New Treaty",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Sports League Announces Revised Schedule for Upcoming Season",
+ "ground_truth": "Sports"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+ /openai/v1/evals/{eval_id}/runs/{run_id}/output_items:
+ get:
+ operationId: Evals_getEvalRunOutputItems
+ summary: List evaluation run output items
+ description: Returns the output items produced by the specified evaluation run.
+ parameters:
+ - name: eval_id
+ in: path
required: true
- description: Identifier of the schedule.
+ description: The eval id path parameter.
schema:
type: string
- - name: Foundry-Features
- in: header
+ - name: run_id
+ in: path
required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the run to retrieve output items for.
+ schema:
+ type: string
+ - name: after
+ in: query
+ required: false
+ description: Identifier for the last run from the previous pagination request.
+ schema:
+ type: string
+ explode: false
+ - name: limit
+ in: query
+ required: false
+ description: Number of runs to retrieve.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
schema:
type: string
enum:
- - Schedules=V1Preview
+ - asc
+ - desc
+ default: asc
+ explode: false
+ - name: status
+ in: query
+ required: false
+ description: |-
+ Filter output items by status. Use `failed` to filter by failed output
+ items or `pass` to filter by passed output items.
+ schema:
+ type: string
+ enum:
+ - fail
+ - pass
responses:
- '204':
- description: There is no content to send for this request, but the headers may be useful.
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunOutputItem'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
+ - Evals
+ x-oaiMeta:
+ name: Get eval run output items
+ group: evals
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/egroup_67abd54d9b0081909a86353f6fb9317a/runs/erun_67abd54d60ec8190832b46859da808f7/output_items \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.evals.runs.output_items.list(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const outputItems = await openai.evals.runs.outputItems.list(
+ "egroup_67abd54d9b0081909a86353f6fb9317a",
+ "erun_67abd54d60ec8190832b46859da808f7"
+ );
+ console.log(outputItems);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const outputItemListResponse of client.evals.runs.outputItems.list('run_id', {
+ eval_id: 'eval_id',
+ })) {
+ console.log(outputItemListResponse.id);
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.outputitems.OutputItemListPage;
+ import com.openai.models.evals.runs.outputitems.OutputItemListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ OutputItemListParams params = OutputItemListParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ OutputItemListPage page = client.evals().runs().outputItems().list(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.evals.runs.output_items.list("run_id", eval_id: "eval_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "eval.run.output_item",
+ "id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "created_at": 1743092076,
+ "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "status": "pass",
+ "datasource_item_id": 5,
+ "datasource_item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ },
+ "results": [
+ {
+ "name": "String check-a2486074-d803-4445-b431-ad2262e85d47",
+ "sample": null,
+ "passed": true,
+ "score": 1.0
+ }
+ ],
+ "sample": {
+ "input": [
+ {
+ "role": "developer",
+ "content": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ ",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ },
+ {
+ "role": "user",
+ "content": "Stock Markets Rally After Positive Economic Data Released",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "output": [
+ {
+ "role": "assistant",
+ "content": "Markets",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "finish_reason": "stop",
+ "model": "gpt-4o-mini-2024-07-18",
+ "usage": {
+ "total_tokens": 325,
+ "completion_tokens": 2,
+ "prompt_tokens": 323,
+ "cached_tokens": 0
+ },
+ "error": null,
+ "temperature": 1.0,
+ "max_completion_tokens": 2048,
+ "top_p": 1.0,
+ "seed": 42
+ }
+ }
+ ],
+ "first_id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "last_id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "has_more": true
+ }
+ x-ms-list: true
+ /openai/v1/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}:
get:
- operationId: Schedules_get
- summary: Get a schedule
- description: Retrieves the specified schedule resource.
+ operationId: Evals_getEvalRunOutputItem
+ summary: Get an output item of an evaluation run
+ description: Retrieves a single output item from the specified evaluation run.
parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: id
+ - name: eval_id
in: path
required: true
- description: Identifier of the schedule.
+ description: The ID of the evaluation to retrieve runs for.
schema:
type: string
- - name: Foundry-Features
- in: header
+ - name: run_id
+ in: path
required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the run to retrieve.
+ schema:
+ type: string
+ - name: output_item_id
+ in: path
+ required: true
+ description: The ID of the output item to retrieve.
schema:
type: string
- enum:
- - Schedules=V1Preview
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Schedule'
+ $ref: '#/components/schemas/EvalRunOutputItem'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- put:
- operationId: Schedules_createOrUpdate
- summary: Create or update a schedule
- description: Creates a new schedule or updates an existing schedule with the supplied definition.
+ - Evals
+ x-oaiMeta:
+ name: Get an output item of an eval run
+ group: evals
+ path: get
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/output_items/outputitem_67abd55eb6548190bb580745d5644a33 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ output_item = client.evals.runs.output_items.retrieve(
+ output_item_id="output_item_id",
+ eval_id="eval_id",
+ run_id="run_id",
+ )
+ print(output_item.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const outputItem = await openai.evals.runs.outputItems.retrieve(
+ "outputitem_67abd55eb6548190bb580745d5644a33",
+ {
+ eval_id: "eval_67abd54d9b0081909a86353f6fb9317a",
+ run_id: "evalrun_67abd54d60ec8190832b46859da808f7",
+ }
+ );
+ console.log(outputItem);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const outputItem = await client.evals.runs.outputItems.retrieve('output_item_id', {
+ eval_id: 'eval_id',
+ run_id: 'run_id',
+ });
+
+ console.log(outputItem.id);
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.outputitems.OutputItemRetrieveParams;
+ import com.openai.models.evals.runs.outputitems.OutputItemRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ OutputItemRetrieveParams params = OutputItemRetrieveParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .outputItemId("output_item_id")
+ .build();
+ OutputItemRetrieveResponse outputItem = client.evals().runs().outputItems().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ output_item = openai.evals.runs.output_items.retrieve("output_item_id", eval_id: "eval_id", run_id: "run_id")
+
+ puts(output_item)
+ response: |
+ {
+ "object": "eval.run.output_item",
+ "id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "created_at": 1743092076,
+ "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "status": "pass",
+ "datasource_item_id": 5,
+ "datasource_item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ },
+ "results": [
+ {
+ "name": "String check-a2486074-d803-4445-b431-ad2262e85d47",
+ "sample": null,
+ "passed": true,
+ "score": 1.0
+ }
+ ],
+ "sample": {
+ "input": [
+ {
+ "role": "developer",
+ "content": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ ",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ },
+ {
+ "role": "user",
+ "content": "Stock Markets Rally After Positive Economic Data Released",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "output": [
+ {
+ "role": "assistant",
+ "content": "Markets",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "finish_reason": "stop",
+ "model": "gpt-4o-mini-2024-07-18",
+ "usage": {
+ "total_tokens": 325,
+ "completion_tokens": 2,
+ "prompt_tokens": 323,
+ "cached_tokens": 0
+ },
+ "error": null,
+ "temperature": 1.0,
+ "max_completion_tokens": 2048,
+ "top_p": 1.0,
+ "seed": 42
+ }
+ }
+ /openai/v1/files:
+ get:
+ operationId: Files_listFiles
+ summary: List files
+ description: Lists files matching the request filters.
parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: id
- in: path
- required: true
- description: Identifier of the schedule.
+ - name: purpose
+ in: query
+ required: false
+ description: Only return files with the given purpose.
schema:
type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 10000
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
schema:
type: string
- enum:
- - Schedules=V1Preview
+ x-ms-list-continuation-token: true
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Schedule'
- '201':
- description: The request has succeeded and a new resource has been created as a result.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Schedule'
+ $ref: '#/components/schemas/OpenAI.ListFilesResponse'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Schedule'
- description: The resource instance.
- /schedules/{id}/runs:
- get:
- operationId: Schedules_listRuns
- summary: List schedule runs
- description: Returns schedule runs that match the supplied filters.
- parameters:
- - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
- - name: id
- in: path
- required: true
- description: Identifier of the schedule.
- schema:
- type: string
- - name: type
- in: query
- required: false
- description: Filter by the type of schedule.
- schema:
- $ref: '#/components/schemas/ScheduleTaskType'
- explode: false
- - name: enabled
- in: query
- required: false
- description: Filter by the enabled status.
- schema:
- type: boolean
- explode: false
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Schedules=V1Preview
+ - Files
+ x-oaiMeta:
+ name: List files
+ group: files
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.files.list()
+ page = page.data[0]
+ print(page)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.files.list();
+
+ for await (const file of list) {
+ console.log(file);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fileObject of client.files.list()) {
+ console.log(fileObject);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Files.List(context.TODO(), openai.FileListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileListPage;
+ import com.openai.models.files.FileListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileListPage page = client.files().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.files.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 175,
+ "created_at": 1613677385,
+ "expires_at": 1677614202,
+ "filename": "salesOverview.pdf",
+ "purpose": "assistants",
+ },
+ {
+ "id": "file-abc456",
+ "object": "file",
+ "bytes": 140,
+ "created_at": 1613779121,
+ "expires_at": 1677614202,
+ "filename": "puppy.jsonl",
+ "purpose": "fine-tune",
+ }
+ ],
+ "first_id": "file-abc123",
+ "last_id": "file-abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: Files_createFile
+ summary: Create a file
+ description: Creates a file from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/PagedScheduleRun'
+ $ref: '#/components/schemas/OpenAI.OpenAIFile'
4XX:
description: Client error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
5XX:
description: Server error
- headers:
- x-ms-error-code:
- required: false
- description: String error code indicating what went wrong.
- schema:
- type: string
content:
application/json:
schema:
- $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ $ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- /schedules/{schedule_id}/runs/{run_id}:
- get:
- operationId: Schedules_getRun
- summary: Get a schedule run
- description: Retrieves the specified run for a schedule.
+ - Files
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateFileRequest'
+ encoding:
+ purpose:
+ contentType: application/json
+ expires_after:
+ contentType: application/json
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Upload file
+ group: files
+ description: |
+ Uploads a file for later use across OpenAI APIs. Uploads to this endpoint are rate-limited to 1,000 requests per minute per authenticated user. For Retrieval or `file_search` ingestion, upload files here first. If you need to attach multiple uploaded files to the same vector store, use vector store file batches instead of attaching them one by one.
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F purpose="fine-tune" \
+ -F file="@mydata.jsonl"
+ -F expires_after[anchor]="created_at"
+ -F expires_after[seconds]=2592000
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file_object = client.files.create(
+ file=b"Example data",
+ purpose="assistants",
+ )
+ print(file_object.id)
+ javascript: |-
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.create({
+ file: fs.createReadStream("mydata.jsonl"),
+ purpose: "fine-tune",
+ expires_after: {
+ anchor: "created_at",
+ seconds: 2592000
+ }
+ });
+
+ console.log(file);
+ }
+
+ main();
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fileObject = await client.files.create({
+ file: fs.createReadStream('fine-tune.jsonl'),
+ purpose: 'assistants',
+ });
+
+ console.log(fileObject.id);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fileObject, err := client.Files.New(context.TODO(), openai.FileNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Purpose: openai.FilePurposeAssistants,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fileObject.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileCreateParams;
+ import com.openai.models.files.FileObject;
+ import com.openai.models.files.FilePurpose;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateParams params = FileCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .purpose(FilePurpose.ASSISTANTS)
+ .build();
+ FileObject fileObject = client.files().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file_object = openai.files.create(file: StringIO.new("Example data"), purpose: :assistants)
+
+ puts(file_object)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 120000,
+ "created_at": 1677610602,
+ "expires_at": 1677614202,
+ "filename": "mydata.jsonl",
+ "purpose": "fine-tune",
+ }
+ /openai/v1/files/{file_id}:
+ delete:
+ operationId: Files_deleteFile
+ summary: Delete a file
+ description: Deletes a file by its identifier.
parameters:
- - name: schedule_id
- in: path
- required: true
- description: The unique identifier of the schedule.
- schema:
- type: string
- - name: run_id
+ - name: file_id
in: path
required: true
- description: The unique identifier of the schedule run.
- schema:
- type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Schedules=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the file to use for this request.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ScheduleRun'
+ $ref: '#/components/schemas/OpenAI.DeleteFileResponse'
4XX:
description: Client error
content:
@@ -11689,94 +19778,120 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Schedules
- /skills:
- get:
- operationId: Skills_listSkills
- summary: List skills
- description: Returns the skills available in the current project.
+ - Files
+ x-oaiMeta:
+ name: Delete file
+ group: files
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files/file-abc123 \
+ -X DELETE \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file_deleted = client.files.delete(
+ "file_id",
+ )
+ print(file_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.delete("file-abc123");
+
+ console.log(file);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fileDeleted = await client.files.delete('file_id');
+
+ console.log(fileDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fileDeleted, err := client.Files.Delete(context.TODO(), "file_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fileDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileDeleteParams;
+ import com.openai.models.files.FileDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileDeleted fileDeleted = client.files().delete("file_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file_deleted = openai.files.delete("file_id")
+
+ puts(file_deleted)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "deleted": true
+ }
+ get:
+ operationId: Files_retrieveFile
+ summary: Get a file
+ description: Retrieves a file by its identifier.
parameters:
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- - name: after
- in: query
- required: false
- description: |-
- 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.
- schema:
- type: string
- explode: false
- - name: before
- in: query
- required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
+ - name: file_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the file to use for this request.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Skill'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.OpenAIFile'
4XX:
description: Client error
content:
@@ -11790,44 +19905,245 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}:
+ - Files
+ x-oaiMeta:
+ name: Retrieve file
+ group: files
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files/file-abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file_object = client.files.retrieve(
+ "file_id",
+ )
+ print(file_object.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.retrieve("file-abc123");
+
+ console.log(file);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fileObject = await client.files.retrieve('file_id');
+
+ console.log(fileObject.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fileObject, err := client.Files.Get(context.TODO(), "file_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fileObject.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileObject;
+ import com.openai.models.files.FileRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileObject fileObject = client.files().retrieve("file_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file_object = openai.files.retrieve("file_id")
+
+ puts(file_object)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 120000,
+ "created_at": 1677610602,
+ "expires_at": 1677614202,
+ "filename": "mydata.jsonl",
+ "purpose": "fine-tune",
+ }
+ /openai/v1/files/{file_id}/content:
get:
- operationId: Skills_getSkill
- summary: Retrieve a skill
- description: Retrieves the specified skill and its current configuration.
+ operationId: Files_downloadFile
+ summary: Download a file
+ description: Downloads a file.
parameters:
- - name: name
+ - name: file_id
in: path
required: true
- description: The unique name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the file to use for this request.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
+ content:
+ text/plain:
+ schema:
+ type: string
+ 4XX:
+ description: Client error
content:
application/json:
schema:
- $ref: '#/components/schemas/Skill'
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Files
+ x-oaiMeta:
+ name: Retrieve file content
+ group: files
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/files/file-abc123/content \
+ -H "Authorization: Bearer $OPENAI_API_KEY" > file.jsonl
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.files.content(
+ "file_id",
+ )
+ print(response)
+ content = response.read()
+ print(content)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.content("file-abc123");
+
+ console.log(file);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.files.content('file_id');
+
+ console.log(response);
+
+ const content = await response.blob();
+ console.log(content);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Files.Content(context.TODO(), "file_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.files.FileContentParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ HttpResponse response = client.files().content("file_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.files.content("file_id")
+
+ puts(response)
+ response: ''
+ /openai/v1/fine_tuning/alpha/graders/run:
+ post:
+ operationId: Graders_runGrader
+ summary: Run a grader
+ description: Runs a grader.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunGraderResponse'
4XX:
description: Client error
content:
@@ -11841,43 +20157,543 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
+ - Fine-tuning
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunGraderRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Run grader
+ beta: true
+ group: graders
+ examples:
+ - title: Score text alignment
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "grader": {
+ "type": "score_model",
+ "name": "Example score model grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.
+
+ Reference answer: {{item.reference_answer}}
+
+ Model answer: {{sample.output_text}}"
+ }
+ ]
+ }
+ ],
+ "model": "gpt-5-mini",
+ "sampling_params": {
+ "temperature": 1,
+ "top_p": 1,
+ "seed": 42
+ }
+ },
+ "item": {
+ "reference_answer": "fuzzy wuzzy was a bear"
+ },
+ "model_sample": "fuzzy wuzzy was a bear"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.run(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ model_sample="model_sample",
+ )
+ print(response.metadata)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const result = await openai.fineTuning.alpha.graders.run({
+ grader: {
+ type: "score_model",
+ name: "Example score model grader",
+ input: [
+ {
+ role: "user",
+ content: [
+ {
+ type: "input_text",
+ text: "Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.
+
+ Reference answer: {{item.reference_answer}}
+
+ Model answer: {{sample.output_text}}",
+ },
+ ],
+ },
+ ],
+ model: "gpt-5-mini",
+ sampling_params: { temperature: 1, top_p: 1, seed: 42 },
+ },
+ item: { reference_answer: "fuzzy wuzzy was a bear" },
+ model_sample: "fuzzy wuzzy was a bear",
+ });
+ console.log(result);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.run({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ model_sample: 'model_sample',
+ });
+
+ console.log(response.metadata);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{
+ Grader: openai.FineTuningAlphaGraderRunParamsGraderUnion{
+ OfStringCheck: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ ModelSample: "model_sample",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Metadata)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderRunParams;
+ import com.openai.models.finetuning.alpha.graders.GraderRunResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderRunParams params = GraderRunParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .modelSample("model_sample")
+ .build();
+ GraderRunResponse response = client.fineTuning().alpha().graders().run(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.run(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check},
+ model_sample: "model_sample"
+ )
+
+ puts(response)
+ response: |
+ {
+ "reward": 1.0,
+ "metadata": {
+ "name": "Example score model grader",
+ "type": "score_model",
+ "errors": {
+ "formula_parse_error": false,
+ "sample_parse_error": false,
+ "truncated_observation_error": false,
+ "unresponsive_reward_error": false,
+ "invalid_variable_error": false,
+ "other_error": false,
+ "python_grader_server_error": false,
+ "python_grader_server_error_type": null,
+ "python_grader_runtime_error": false,
+ "python_grader_runtime_error_details": null,
+ "model_grader_server_error": false,
+ "model_grader_refusal_error": false,
+ "model_grader_parse_error": false,
+ "model_grader_server_error_details": null
+ },
+ "execution_time": 4.365238428115845,
+ "scores": {},
+ "token_usage": {
+ "prompt_tokens": 190,
+ "total_tokens": 324,
+ "completion_tokens": 134,
+ "cached_tokens": 0
+ },
+ "sampled_model_name": "gpt-4o-2024-08-06"
+ },
+ "sub_rewards": {},
+ "model_grader_token_usage_per_model": {
+ "gpt-4o-2024-08-06": {
+ "prompt_tokens": 190,
+ "total_tokens": 324,
+ "completion_tokens": 134,
+ "cached_tokens": 0
+ }
+ }
+ }
+ - title: Score an image caption
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "grader": {
+ "type": "score_model",
+ "name": "Image caption grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Score how well the provided caption matches the image on a 0-1 scale. Only return the score.
+
+ Caption: {{sample.output_text}}"
+ },
+ {
+ "type": "input_image",
+ "image_url": "https://example.com/dog-catching-ball.png",
+ "file_id": null,
+ "detail": "high"
+ }
+ ]
+ }
+ ],
+ "model": "gpt-5-mini",
+ "sampling_params": {
+ "temperature": 0.2
+ }
+ },
+ "item": {
+ "expected_caption": "A golden retriever jumps to catch a tennis ball"
+ },
+ "model_sample": "A dog leaps to grab a tennis ball mid-air"
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.run({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ model_sample: 'model_sample',
+ });
+
+ console.log(response.metadata);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.run(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ model_sample="model_sample",
+ )
+ print(response.metadata)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{
+ Grader: openai.FineTuningAlphaGraderRunParamsGraderUnion{
+ OfStringCheck: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ ModelSample: "model_sample",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Metadata)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderRunParams;
+ import com.openai.models.finetuning.alpha.graders.GraderRunResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderRunParams params = GraderRunParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .modelSample("model_sample")
+ .build();
+ GraderRunResponse response = client.fineTuning().alpha().graders().run(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.run(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check},
+ model_sample: "model_sample"
+ )
+
+ puts(response)
+ - title: Score an audio response
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "grader": {
+ "type": "score_model",
+ "name": "Audio clarity grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Listen to the clip and return a confidence score from 0 to 1 that the speaker said: {{item.target_phrase}}"
+ },
+ {
+ "type": "input_audio",
+ "input_audio": {
+ "data": "{{item.audio_clip_b64}}",
+ "format": "mp3"
+ }
+ }
+ ]
+ }
+ ],
+ "model": "gpt-audio",
+ "sampling_params": {
+ "temperature": 0.2,
+ "top_p": 1,
+ "seed": 123
+ }
+ },
+ "item": {
+ "target_phrase": "Please deliver the package on Tuesday",
+ "audio_clip_b64": ""
+ },
+ "model_sample": "Please deliver the package on Tuesday"
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.run({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ model_sample: 'model_sample',
+ });
+
+ console.log(response.metadata);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.run(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ model_sample="model_sample",
+ )
+ print(response.metadata)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{
+ Grader: openai.FineTuningAlphaGraderRunParamsGraderUnion{
+ OfStringCheck: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ ModelSample: "model_sample",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Metadata)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderRunParams;
+ import com.openai.models.finetuning.alpha.graders.GraderRunResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderRunParams params = GraderRunParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .modelSample("model_sample")
+ .build();
+ GraderRunResponse response = client.fineTuning().alpha().graders().run(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.run(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check},
+ model_sample: "model_sample"
+ )
+
+ puts(response)
+ /openai/v1/fine_tuning/alpha/graders/validate:
post:
- operationId: updateSkill
- summary: Update a skill
- description: Modifies the specified skill's configuration.
- parameters:
- - name: name
- in: path
- required: true
- description: The name of the skill to update.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ operationId: Graders_validateGrader
+ summary: Validate a grader
+ description: Validates a grader.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/Skill'
+ $ref: '#/components/schemas/OpenAI.ValidateGraderResponse'
4XX:
description: Client error
content:
@@ -11891,55 +20707,194 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
+ - Fine-tuning
requestBody:
required: true
content:
application/json:
schema:
- type: object
- properties:
- default_version:
- type: string
- description: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest.
- required:
- - default_version
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- delete:
- operationId: Skills_deleteSkill
- summary: Delete a skill
- description: Removes the specified skill and its associated versions.
+ $ref: '#/components/schemas/OpenAI.ValidateGraderRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Validate grader
+ beta: true
+ group: graders
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/alpha/graders/validate \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ }
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.validate({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ });
+
+ console.log(response.grader);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.validate(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ )
+ print(response.grader)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Validate(context.TODO(), openai.FineTuningAlphaGraderValidateParams{
+ Grader: openai.FineTuningAlphaGraderValidateParamsGraderUnion{
+ OfStringCheckGrader: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Grader)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderValidateParams;
+ import com.openai.models.finetuning.alpha.graders.GraderValidateResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderValidateParams params = GraderValidateParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .build();
+ GraderValidateResponse response = client.fineTuning().alpha().graders().validate(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.validate(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check}
+ )
+
+ puts(response)
+ response: |
+ {
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ }
+ }
+ /openai/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions:
+ get:
+ operationId: FineTuning_listFineTuningCheckpointPermissions
+ summary: List fine tuning checkpoint permissions
+ description: Lists fine tuning checkpoint permissions matching the request filters.
parameters:
- - name: name
+ - name: fine_tuned_model_checkpoint
in: path
required: true
- description: The unique name of the skill.
+ description: The ID of the fine-tuned model checkpoint to get permissions for.
schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ type: string
+ - name: project_id
+ in: query
+ required: false
+ description: The ID of the project to get permissions for.
schema:
type: string
- enum:
- - Skills=V1Preview
- - name: api-version
+ - name: after
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: Identifier for the last permission ID from the previous pagination request.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
+ - name: limit
+ in: query
+ required: false
+ description: Number of permissions to retrieve.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 10
+ - name: order
+ in: query
+ required: false
+ description: The order in which to retrieve permissions.
+ schema:
+ type: string
+ enum:
+ - ascending
+ - descending
+ default: descending
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteSkillResponse'
+ $ref: '#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse'
4XX:
description: Client error
content:
@@ -11953,44 +20908,129 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}/content:
- get:
- operationId: getSkillContent
- summary: Download the zip content for the default version of a skill
- description: Downloads the zip content for the default version of a skill.
+ - Fine-tuning
+ x-oaiMeta:
+ name: List checkpoint permissions
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const permission = await client.fineTuning.checkpoints.permissions.retrieve(
+ 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
+ );
+
+ console.log(permission.first_id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ permission = client.fine_tuning.checkpoints.permissions.retrieve(
+ fine_tuned_model_checkpoint="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(permission.first_id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ permission, err := client.FineTuning.Checkpoints.Permissions.Get(
+ context.TODO(),
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ openai.FineTuningCheckpointPermissionGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", permission.FirstID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveParams;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PermissionRetrieveResponse permission = client.fineTuning().checkpoints().permissions().retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ permission = openai.fine_tuning.checkpoints.permissions.retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(permission)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1721764867,
+ "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"
+ },
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_enQCFmOTGj3syEpYVhBRLTSy",
+ "created_at": 1721764800,
+ "project_id": "proj_iqGMw1llN8IrBb6SvvY5A1oF"
+ },
+ ],
+ "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "last_id": "cp_enQCFmOTGj3syEpYVhBRLTSy",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: FineTuning_createFineTuningCheckpointPermission
+ summary: Create a fine tuning checkpoint permission
+ description: Creates a fine tuning checkpoint permission from the supplied request.
parameters:
- - name: name
+ - name: fine_tuned_model_checkpoint
in: path
required: true
- description: The name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuned model checkpoint to create a permission for.
schema:
type: string
- explode: false
responses:
'200':
- description: The response body for downloading a skill package.
+ description: The request has succeeded.
content:
- application/zip:
+ application/json:
schema:
- contentMediaType: application/zip
+ $ref: '#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse'
4XX:
description: Client error
content:
@@ -12004,44 +21044,150 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}/versions:
- post:
- operationId: createSkillVersion_createSkillVersionFromFiles
+ - Fine-tuning
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create checkpoint permissions
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ -d '{"project_ids": ["proj_abGMw1llN8IrBb6SvvY5A1iH"]}'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const permissionCreateResponse of client.fineTuning.checkpoints.permissions.create(
+ 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd',
+ { project_ids: ['string'] },
+ )) {
+ console.log(permissionCreateResponse.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.checkpoints.permissions.create(
+ fine_tuned_model_checkpoint="ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ project_ids=["string"],
+ )
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Checkpoints.Permissions.New(
+ context.TODO(),
+ "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ openai.FineTuningCheckpointPermissionNewParams{
+ ProjectIDs: []string{"string"},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionCreatePage;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PermissionCreateParams params = PermissionCreateParams.builder()
+ .fineTunedModelCheckpoint("ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd")
+ .addProjectId("string")
+ .build();
+ PermissionCreatePage page = client.fineTuning().checkpoints().permissions().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.checkpoints.permissions.create(
+ "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ project_ids: ["string"]
+ )
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1721764867,
+ "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"
+ }
+ ],
+ "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "last_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "has_more": false
+ }
+ /openai/v1/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}:
+ delete:
+ operationId: FineTuning_deleteFineTuningCheckpointPermission
+ summary: Delete a fine tuning checkpoint permission
+ description: Deletes a fine tuning checkpoint permission by its identifier.
parameters:
- - name: name
+ - name: fine_tuned_model_checkpoint
in: path
required: true
- description: The name of the skill. If the skill does not exist, it will be created.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: The ID of the fine-tuned model checkpoint to delete a permission for.
schema:
type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
+ - name: permission_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuned model checkpoint permission to delete.
schema:
type: string
- explode: false
- description: Creates a new version of a skill. If the skill does not exist, it will be created. Creates a new version of a skill from uploaded files via multipart form data.
- summary: Create a new version of a skill Create a skill version from uploaded files
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/SkillVersion'
+ $ref: '#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse'
4XX:
description: Client error
content:
@@ -12054,126 +21200,142 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
- x-ms-description-override: Creates a new version of a skill. If the skill does not exist, it will be created.
- x-ms-summary-override: Create a new version of a skill
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
tags:
- - Skills
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- inline_content:
- $ref: '#/components/schemas/SkillInlineContent'
- description: Inline skill content for simple skills without file uploads. Foundry-specific extension.
- default:
- type: boolean
- description: Whether to set this version as the default.
- multipart/form-data:
- schema:
- $ref: '#/components/schemas/CreateSkillVersionFromFilesBody'
- encoding:
- files:
- contentType: '*/*'
- default:
- contentType: text/plain
+ - Fine-tuning
+ x-oaiMeta:
+ name: Delete checkpoint permission
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions/cp_zc4Q7MP6XxulcVzj4MZdwsAB \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const permission = await client.fineTuning.checkpoints.permissions.delete(
+ 'cp_zc4Q7MP6XxulcVzj4MZdwsAB',
+ { fine_tuned_model_checkpoint: 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd' },
+ );
+
+ console.log(permission.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ permission = client.fine_tuning.checkpoints.permissions.delete(
+ permission_id="cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ fine_tuned_model_checkpoint="ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ )
+ print(permission.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ permission, err := client.FineTuning.Checkpoints.Permissions.Delete(
+ context.TODO(),
+ "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", permission.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteParams;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PermissionDeleteParams params = PermissionDeleteParams.builder()
+ .fineTunedModelCheckpoint("ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd")
+ .permissionId("cp_zc4Q7MP6XxulcVzj4MZdwsAB")
+ .build();
+ PermissionDeleteResponse permission = client.fineTuning().checkpoints().permissions().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ permission = openai.fine_tuning.checkpoints.permissions.delete(
+ "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ fine_tuned_model_checkpoint: "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd"
+ )
+
+ puts(permission)
+ response: |
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "deleted": true
+ }
+ /openai/v1/fine_tuning/jobs:
get:
- operationId: listSkillVersions
- summary: List skill versions
- description: Returns the available versions for the specified skill.
+ operationId: FineTuning_listPaginatedFineTuningJobs
+ summary: List paginated fine tuning jobs
+ description: Lists paginated fine tuning jobs matching the request filters.
parameters:
- - name: name
- in: path
- required: true
- description: The name of the skill to list versions for.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- name: after
in: query
required: false
- description: |-
- 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.
+ description: Identifier for the last job from the previous pagination request.
schema:
type: string
- explode: false
- - name: before
+ x-ms-list-continuation-token: true
+ - name: limit
in: query
required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ description: Number of fine-tuning jobs to retrieve.
schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: metadata
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to indicate no metadata.
schema:
- type: string
- explode: false
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ type: string
+ - type: 'null'
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/SkillVersion'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse'
4XX:
description: Client error
content:
@@ -12187,50 +21349,133 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}/versions/{version}:
- get:
- operationId: getSkillVersion
- summary: Retrieve a specific version of a skill
- description: Retrieves the specified version of a skill by name and version identifier.
- parameters:
- - name: name
- in: path
- required: true
- description: The name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: version
- in: path
- required: true
- description: The version identifier to retrieve.
- schema:
- type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Fine-tuning
+ x-oaiMeta:
+ name: List fine-tuning jobs
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs?limit=2&metadata[key]=value \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.jobs.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.fineTuning.jobs.list();
+
+ for await (const fineTune of list) {
+ console.log(fineTune);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fineTuningJob of client.fineTuning.jobs.list()) {
+ console.log(fineTuningJob.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Jobs.List(context.TODO(), openai.FineTuningJobListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.JobListPage;
+ import com.openai.models.finetuning.jobs.JobListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobListPage page = client.fineTuning().jobs().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.jobs.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "metadata": {
+ "key": "value"
+ }
+ },
+ { ... },
+ { ... }
+ ], "has_more": true
+ }
+ x-ms-list: true
+ post:
+ operationId: FineTuning_createFineTuningJob
+ summary: Create a fine tuning job
+ description: Creates a fine tuning job from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/SkillVersion'
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -12244,49 +21489,879 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- delete:
- operationId: deleteSkillVersion
- summary: Delete a specific version of a skill
- description: Removes the specified version of a skill.
+ - Fine-tuning
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create fine-tuning job
+ group: fine-tuning
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-BK7bzQj3FfZFXr7DbL6xJwfo",
+ "model": "gpt-4o-mini"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123"
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ }
+ }
+ },
+ "metadata": null
+ }
+ - title: Epochs
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc123",
+ "model": "gpt-4o-mini",
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "n_epochs": 2
+ }
+ }
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ javascript: |
+ import OpenAI from "openai";
+ import { SupervisedMethod, SupervisedHyperparameters } from "openai/resources/fine-tuning/methods";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123",
+ model: "gpt-4o-mini",
+ method: {
+ type: "supervised",
+ supervised: {
+ hyperparameters: {
+ n_epochs: 2
+ }
+ }
+ }
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": 2
+ },
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": 2
+ }
+ }
+ },
+ "metadata": null,
+ "error": {
+ "code": null,
+ "message": null,
+ "param": null
+ },
+ "finished_at": null,
+ "seed": 683058546,
+ "trained_tokens": null,
+ "estimated_finish": null,
+ "integrations": [],
+ "user_provided_suffix": null,
+ "usage_metrics": null,
+ "shared_with_openai": false
+ }
+ - title: DPO
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc123",
+ "validation_file": "file-abc123",
+ "model": "gpt-4o-mini",
+ "method": {
+ "type": "dpo",
+ "dpo": {
+ "hyperparameters": {
+ "beta": 0.1
+ }
+ }
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc",
+ "model": "gpt-4o-mini",
+ "created_at": 1746130590,
+ "fine_tuned_model": null,
+ "organization_id": "org-abc",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-123",
+ "training_file": "file-abc",
+ "method": {
+ "type": "dpo",
+ "dpo": {
+ "hyperparameters": {
+ "beta": 0.1,
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto"
+ }
+ }
+ },
+ "metadata": null,
+ "error": {
+ "code": null,
+ "message": null,
+ "param": null
+ },
+ "finished_at": null,
+ "hyperparameters": null,
+ "seed": 1036326793,
+ "estimated_finish": null,
+ "integrations": [],
+ "user_provided_suffix": null,
+ "usage_metrics": null,
+ "shared_with_openai": false
+ }
+ - title: Reinforcement
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc",
+ "validation_file": "file-123",
+ "model": "o4-mini",
+ "method": {
+ "type": "reinforcement",
+ "reinforcement": {
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ },
+ "hyperparameters": {
+ "reasoning_effort": "medium"
+ }
+ }
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |+
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "o4-mini",
+ "created_at": 1721764800,
+ "finished_at": null,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "validating_files",
+ "validation_file": "file-123",
+ "training_file": "file-abc",
+ "trained_tokens": null,
+ "error": {},
+ "user_provided_suffix": null,
+ "seed": 950189191,
+ "estimated_finish": null,
+ "integrations": [],
+ "method": {
+ "type": "reinforcement",
+ "reinforcement": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ "eval_interval": "auto",
+ "eval_samples": "auto",
+ "compute_multiplier": "auto",
+ "reasoning_effort": "medium"
+ },
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ },
+ "response_format": null
+ }
+ },
+ "metadata": null,
+ "usage_metrics": null,
+ "shared_with_openai": false
+ }
+
+ - title: Validation file
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc123",
+ "validation_file": "file-abc123",
+ "model": "gpt-4o-mini"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123",
+ validation_file: "file-abc123"
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123",
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ }
+ }
+ },
+ "metadata": null
+ }
+ - title: W&B Integration
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "training_file": "file-abc123",
+ "validation_file": "file-abc123",
+ "model": "gpt-4o-mini",
+ "integrations": [
+ {
+ "type": "wandb",
+ "wandb": {
+ "project": "my-wandb-project",
+ "name": "ft-run-display-name"
+ "tags": [
+ "first-experiment", "v2"
+ ]
+ }
+ }
+ ]
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123",
+ "integrations": [
+ {
+ "type": "wandb",
+ "wandb": {
+ "project": "my-wandb-project",
+ "entity": None,
+ "run_id": "ftjob-abc123"
+ }
+ }
+ ],
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ }
+ }
+ },
+ "metadata": null
+ }
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}:
+ get:
+ operationId: FineTuning_retrieveFineTuningJob
+ summary: Get a fine tuning job
+ description: Retrieves a fine tuning job by its identifier.
parameters:
- - name: name
- in: path
- required: true
- description: The name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: version
+ - name: fine_tuning_job_id
in: path
required: true
- description: The version identifier to delete.
- schema:
- type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuning job.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/DeleteSkillVersionResponse'
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -12300,50 +22375,149 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /skills/{name}/versions/{version}/content:
- get:
- operationId: getSkillVersionContent
- summary: Download the zip content for a specific version of a skill
- description: Downloads the zip content for a specific version of a skill.
+ - Fine-tuning
+ x-oaiMeta:
+ name: Retrieve fine-tuning job
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.retrieve(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.retrieve("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.retrieve('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Get(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "davinci-002",
+ "created_at": 1692661014,
+ "finished_at": 1692661190,
+ "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
+ "organization_id": "org-123",
+ "result_files": [
+ "file-abc123"
+ ],
+ "status": "succeeded",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ },
+ "trained_tokens": 5768,
+ "integrations": [],
+ "seed": 0,
+ "estimated_finish": 0,
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ }
+ }
+ }
+ }
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel:
+ post:
+ operationId: FineTuning_cancelFineTuningJob
+ summary: Cancel a fine tuning job
+ description: Cancels a fine tuning job by its identifier.
parameters:
- - name: name
- in: path
- required: true
- description: The name of the skill.
- schema:
- $ref: '#/components/schemas/SkillName'
- - name: version
+ - name: fine_tuning_job_id
in: path
required: true
- description: The version to download content for.
- schema:
- type: string
- - name: Foundry-Features
- in: header
- required: true
- description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
- schema:
- type: string
- enum:
- - Skills=V1Preview
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuning job to cancel.
schema:
type: string
- explode: false
responses:
'200':
- description: The response body for downloading a skill package.
+ description: The request has succeeded.
content:
- application/zip:
+ application/json:
schema:
- contentMediaType: application/zip
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -12357,89 +22531,140 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Skills
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- /toolboxes:
+ - Fine-tuning
+ x-oaiMeta:
+ name: Cancel fine-tuning
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/cancel \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.cancel(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.cancel("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.cancel('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Cancel(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().cancel("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.cancel("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "cancelled",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123"
+ }
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints:
get:
- operationId: listToolboxes
- summary: List toolboxes
- description: Returns the toolboxes available in the current project.
+ operationId: FineTuning_listFineTuningJobCheckpoints
+ summary: List fine tuning job checkpoints
+ description: Lists fine tuning job checkpoints matching the request filters.
parameters:
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
+ - name: fine_tuning_job_id
+ in: path
+ required: true
+ description: The ID of the fine-tuning job to get checkpoints for.
schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
+ type: string
- name: after
in: query
required: false
- description: |-
- 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.
+ description: Identifier for the last checkpoint ID from the previous pagination request.
schema:
type: string
- explode: false
- - name: before
+ x-ms-list-continuation-token: true
+ - name: limit
in: query
required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: Number of checkpoints to retrieve.
schema:
- type: string
- explode: false
+ $ref: '#/components/schemas/integer'
+ default: 10
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/ToolboxObject'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse'
4XX:
description: Client error
content:
@@ -12453,33 +22678,158 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- /toolboxes/{name}:
+ - Fine-tuning
+ x-oaiMeta:
+ name: List fine-tuning checkpoints
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/checkpoints \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list(
+ 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
+ )) {
+ console.log(fineTuningJobCheckpoint.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.jobs.checkpoints.list(
+ fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Jobs.Checkpoints.List(
+ context.TODO(),
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ openai.FineTuningJobCheckpointListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.checkpoints.CheckpointListPage;
+ import com.openai.models.finetuning.jobs.checkpoints.CheckpointListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ CheckpointListPage page = client.fineTuning().jobs().checkpoints().list("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.jobs.checkpoints.list("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "fine_tuning.job.checkpoint",
+ "id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1721764867,
+ "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000",
+ "metrics": {
+ "full_valid_loss": 0.134,
+ "full_valid_mean_token_accuracy": 0.874
+ },
+ "fine_tuning_job_id": "ftjob-abc123",
+ "step_number": 2000
+ },
+ {
+ "object": "fine_tuning.job.checkpoint",
+ "id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",
+ "created_at": 1721764800,
+ "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000",
+ "metrics": {
+ "full_valid_loss": 0.167,
+ "full_valid_mean_token_accuracy": 0.781
+ },
+ "fine_tuning_job_id": "ftjob-abc123",
+ "step_number": 1000
+ }
+ ],
+ "first_id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "last_id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",
+ "has_more": true
+ }
+ x-ms-list: true
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/events:
get:
- operationId: getToolbox
- summary: Retrieve a toolbox
- description: Retrieves the specified toolbox and its current configuration.
+ operationId: FineTuning_listFineTuningEvents
+ summary: List fine tuning events
+ description: Lists fine tuning events matching the request filters.
parameters:
- - name: name
+ - name: fine_tuning_job_id
in: path
required: true
- description: The name of the toolbox to retrieve.
+ description: The ID of the fine-tuning job to get events for.
schema:
type: string
- - name: api-version
+ - name: after
in: query
- required: true
- description: The API version to use for this operation.
+ required: false
+ description: Identifier for the last event from the previous pagination request.
schema:
type: string
- explode: false
+ x-ms-list-continuation-token: true
+ - name: limit
+ in: query
+ required: false
+ description: Number of events to retrieve.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ToolboxObject'
+ $ref: '#/components/schemas/OpenAI.ListFineTuningJobEventsResponse'
4XX:
description: Client error
content:
@@ -12493,68 +22843,150 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- patch:
- operationId: updateToolbox
- summary: Update a toolbox to point to a specific version
- description: Updates the toolbox's default version pointer to the specified version.
+ - Fine-tuning
+ x-oaiMeta:
+ name: List fine-tuning events
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/events \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.jobs.list_events(
+ fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.fineTuning.list_events(id="ftjob-abc123", limit=2);
+
+ for await (const fineTune of list) {
+ console.log(fineTune);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fineTuningJobEvent of client.fineTuning.jobs.listEvents(
+ 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
+ )) {
+ console.log(fineTuningJobEvent.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Jobs.ListEvents(
+ context.TODO(),
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ openai.FineTuningJobListEventsParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.JobListEventsPage;
+ import com.openai.models.finetuning.jobs.JobListEventsParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobListEventsPage page = client.fineTuning().jobs().listEvents("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.jobs.list_events("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "fine_tuning.job.event",
+ "id": "ft-event-ddTJfwuMVpfLXseO0Am0Gqjm",
+ "created_at": 1721764800,
+ "level": "info",
+ "message": "Fine tuning job successfully completed",
+ "data": null,
+ "type": "message"
+ },
+ {
+ "object": "fine_tuning.job.event",
+ "id": "ft-event-tyiGuB72evQncpH87xe505Sv",
+ "created_at": 1721764800,
+ "level": "info",
+ "message": "New fine-tuned model created: ft:gpt-4o-mini:openai::7p4lURel",
+ "data": null,
+ "type": "message"
+ }
+ ],
+ "has_more": true
+ }
+ x-ms-list: true
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/pause:
+ post:
+ operationId: FineTuning_pauseFineTuningJob
+ summary: Pause a fine tuning job
+ description: Pauses a fine tuning job.
parameters:
- - $ref: '#/components/parameters/UpdateToolboxRequest.name'
- - name: api-version
- in: query
+ - name: fine_tuning_job_id
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuning job to pause.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ToolboxObject'
- 4XX:
- description: Client error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- 5XX:
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiErrorResponse'
- tags:
- - Toolboxes
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UpdateToolboxRequest'
- delete:
- operationId: deleteToolbox
- summary: Delete a toolbox
- description: Removes the specified toolbox along with all of its versions.
- parameters:
- - name: name
- in: path
- required: true
- description: The name of the toolbox to delete.
- schema:
- type: string
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
- responses:
- '204':
- description: 'There is no content to send for this request, but the headers may be useful. '
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -12568,34 +23000,126 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- /toolboxes/{name}/versions:
+ - Fine-tuning
+ x-oaiMeta:
+ name: Pause fine-tuning
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/pause \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.pause(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.pause("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.pause('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Pause(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobPauseParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().pause("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.pause("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "paused",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123"
+ }
+ /openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/resume:
post:
- operationId: createToolboxVersion
- summary: Create a new version of a toolbox
- description: Creates a new toolbox version, provisioning the toolbox itself if it does not already exist.
+ operationId: FineTuning_resumeFineTuningJob
+ summary: Resume a fine tuning job
+ description: Resumes a fine tuning job.
parameters:
- - name: name
+ - name: fine_tuning_job_id
in: path
required: true
- description: The name of the toolbox. If the toolbox does not exist, it will be created.
- schema:
- type: string
- maxLength: 256
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
+ description: The ID of the fine-tuning job to resume.
schema:
type: string
- explode: false
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ToolboxVersionObject'
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
4XX:
description: Client error
content:
@@ -12609,122 +23133,120 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the toolbox.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Arbitrary key-value metadata to associate with the toolbox.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/ToolboxTool'
- description: The list of tools to include in this version.
- skills:
- type: array
- items:
- $ref: '#/components/schemas/ToolboxSkill'
- description: The list of skill sources to include in this version. A skill reference specifies a skill name and optionally a version. If version is omitted, the skill's default version is used.
- policies:
- $ref: '#/components/schemas/ToolboxPolicies'
- description: Policy configuration for this toolbox version.
- required:
- - tools
- get:
- operationId: listToolboxVersions
- summary: List toolbox versions
- description: Returns the available versions for the specified toolbox.
- parameters:
- - name: name
- in: path
- required: true
- description: The name of the toolbox to list versions for.
- schema:
- type: string
- - name: limit
- in: query
- required: false
- description: |-
- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
- default is 20.
- schema:
- type: integer
- format: int32
- default: 20
- explode: false
- - name: order
- in: query
- required: false
- description: |-
- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
- for descending order.
- schema:
- $ref: '#/components/schemas/PageOrder'
- explode: false
- - name: after
- in: query
- required: false
- description: |-
- 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.
- schema:
- type: string
- explode: false
- - name: before
- in: query
- required: false
- description: |-
- 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, ending with obj_foo, your
- subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- schema:
- type: string
- explode: false
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Fine-tuning
+ x-oaiMeta:
+ name: Resume fine-tuning
+ group: fine-tuning
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/resume \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.resume(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.resume("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.resume('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Resume(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobResumeParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().resume("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.resume("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ response: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123"
+ }
+ /openai/v1/images/edits:
+ post:
+ operationId: Images_createImageEditMultipart_Images_createImageEditJson
+ parameters: []
+ description: Creates an image edit multipart from the supplied request. Creates an image edit json from the supplied request.
+ summary: Create an image edit multipart Create an image edit json
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- type: object
- required:
- - data
- - has_more
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/ToolboxVersionObject'
- description: The requested list of items.
- first_id:
- type: string
- description: The first ID represented in this list.
- last_id:
- type: string
- description: The last ID represented in this list.
- has_more:
- type: boolean
- description: A value indicating whether there are additional values available not captured in this list.
- description: The response data for a requested list of items.
+ $ref: '#/components/schemas/OpenAI.ImagesResponse'
4XX:
description: Client error
content:
@@ -12737,40 +23259,326 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
+ x-ms-request-body-description-override: The request body.
+ x-oaiMeta:
+ name: Create image edit
+ group: images
+ examples:
+ - title: Edit image
+ request:
+ curl: |
+ curl -s -D >(grep -i x-request-id >&2) \
+ -o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) \
+ -X POST "https://api.openai.com/v1/images/edits" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F "model=gpt-image-1.5" \
+ -F "image[]=@body-lotion.png" \
+ -F "image[]=@bath-bomb.png" \
+ -F "image[]=@incense-kit.png" \
+ -F "image[]=@soap.png" \
+ -F 'prompt=Create a lovely gift basket with these four items in it'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.edit(
+ image=b"Example data",
+ prompt="A cute baby sea otter wearing a beret",
+ ):
+ print(image)
+ javascript: |
+ import fs from "fs";
+ import OpenAI, { toFile } from "openai";
+
+ const client = new OpenAI();
+
+ const imageFiles = [
+ "bath-bomb.png",
+ "body-lotion.png",
+ "incense-kit.png",
+ "soap.png",
+ ];
+
+ const images = await Promise.all(
+ imageFiles.map(async (file) =>
+ await toFile(fs.createReadStream(file), null, {
+ type: "image/png",
+ })
+ ),
+ );
+
+ const rsp = await client.images.edit({
+ model: "gpt-image-1.5",
+ image: images,
+ prompt: "Create a lovely gift basket with these four items in it",
+ });
+
+ // Save the image to a file
+ const image_base64 = rsp.data[0].b64_json;
+ const image_bytes = Buffer.from(image_base64, "base64");
+ fs.writeFileSync("basket.png", image_bytes);
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.edit({
+ image: fs.createReadStream('path/to/file'),
+ prompt: 'A cute baby sea otter wearing a beret',
+ });
+
+ console.log(imagesResponse);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{
+ Image: openai.ImageEditParamsImageUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ Prompt: "A cute baby sea otter wearing a beret",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageEditParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageEditParams params = ImageEditParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .prompt("A cute baby sea otter wearing a beret")
+ .build();
+ ImagesResponse imagesResponse = client.images().edit(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.edit(image: StringIO.new("Example data"), prompt: "A cute baby sea otter wearing a beret")
+
+ puts(images_response)
+ - title: Streaming
+ request:
+ curl: |
+ curl -s -N -X POST "https://api.openai.com/v1/images/edits" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F "model=gpt-image-1.5" \
+ -F "image[]=@body-lotion.png" \
+ -F "image[]=@bath-bomb.png" \
+ -F "image[]=@incense-kit.png" \
+ -F "image[]=@soap.png" \
+ -F 'prompt=Create a lovely gift basket with these four items in it' \
+ -F "stream=true"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.edit(
+ image=b"Example data",
+ prompt="A cute baby sea otter wearing a beret",
+ ):
+ print(image)
+ javascript: |
+ import fs from "fs";
+ import OpenAI, { toFile } from "openai";
+
+ const client = new OpenAI();
+
+ const imageFiles = [
+ "bath-bomb.png",
+ "body-lotion.png",
+ "incense-kit.png",
+ "soap.png",
+ ];
+
+ const images = await Promise.all(
+ imageFiles.map(async (file) =>
+ await toFile(fs.createReadStream(file), null, {
+ type: "image/png",
+ })
+ ),
+ );
+
+ const stream = await client.images.edit({
+ model: "gpt-image-1.5",
+ image: images,
+ prompt: "Create a lovely gift basket with these four items in it",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.edit({
+ image: fs.createReadStream('path/to/file'),
+ prompt: 'A cute baby sea otter wearing a beret',
+ });
+
+ console.log(imagesResponse);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{
+ Image: openai.ImageEditParamsImageUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ Prompt: "A cute baby sea otter wearing a beret",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageEditParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageEditParams params = ImageEditParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .prompt("A cute baby sea otter wearing a beret")
+ .build();
+ ImagesResponse imagesResponse = client.images().edit(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.edit(image: StringIO.new("Example data"), prompt: "A cute baby sea otter wearing a beret")
+
+ puts(images_response)
+ response: |
+ event: image_edit.partial_image
+ data: {"type":"image_edit.partial_image","b64_json":"...","partial_image_index":0}
+
+ event: image_edit.completed
+ data: {"type":"image_edit.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}}
tags:
- - Toolboxes
- /toolboxes/{name}/versions/{version}:
- get:
- operationId: getToolboxVersion
- summary: Retrieve a specific version of a toolbox
- description: Retrieves the specified version of a toolbox by name and version identifier.
- parameters:
- - name: name
- in: path
- required: true
- description: The name of the toolbox.
- schema:
- type: string
- - name: version
- in: path
- required: true
- description: The version identifier to retrieve.
- schema:
- type: string
- - name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- explode: false
+ - Images
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateImageEditRequest'
+ encoding:
+ image:
+ contentType: application/octet-stream, application/json
+ background:
+ contentType: application/json
+ model:
+ contentType: application/json
+ 'n':
+ contentType: application/json
+ size:
+ contentType: application/json
+ response_format:
+ contentType: application/json
+ output_format:
+ contentType: application/json
+ output_compression:
+ contentType: application/json
+ input_fidelity:
+ contentType: application/json
+ stream:
+ contentType: application/json
+ partial_images:
+ contentType: application/json
+ quality:
+ contentType: application/json
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.EditImageBodyJsonParam'
+ description: The multipart request body. The request body.
+ /openai/v1/images/generations:
+ post:
+ operationId: Images_createImage
+ summary: Create an image
+ description: Creates an image from the supplied request.
+ parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
- $ref: '#/components/schemas/ToolboxVersionObject'
+ $ref: '#/components/schemas/OpenAI.ImagesResponse'
4XX:
description: Client error
content:
@@ -12784,34 +23592,590 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
- delete:
- operationId: deleteToolboxVersion
- summary: Delete a specific version of a toolbox
- description: Removes the specified version of a toolbox.
- parameters:
- - name: name
- in: path
- required: true
- description: The name of the toolbox.
- schema:
- type: string
- - name: version
- in: path
- required: true
- description: The version identifier to delete.
- schema:
- type: string
- - name: api-version
- in: query
+ - Images
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateImageRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create image
+ group: images
+ examples:
+ - title: Generate image
+ request:
+ curl: |
+ curl https://api.openai.com/v1/images/generations \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-image-1.5",
+ "prompt": "A cute baby sea otter",
+ "n": 1,
+ "size": "1024x1024"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.generate(
+ prompt="A cute baby sea otter",
+ ):
+ print(image)
+ javascript: |
+ import OpenAI from "openai";
+ import { writeFile } from "fs/promises";
+
+ const client = new OpenAI();
+
+ const img = await client.images.generate({
+ model: "gpt-image-1.5",
+ prompt: "A cute baby sea otter",
+ n: 1,
+ size: "1024x1024"
+ });
+
+ const imageBuffer = Buffer.from(img.data[0].b64_json, "base64");
+ await writeFile("output.png", imageBuffer);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });
+
+ console.log(imagesResponse);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{
+ Prompt: "A cute baby sea otter",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageGenerateParams;
+ import com.openai.models.images.ImagesResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageGenerateParams params = ImageGenerateParams.builder()
+ .prompt("A cute baby sea otter")
+ .build();
+ ImagesResponse imagesResponse = client.images().generate(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.generate(prompt: "A cute baby sea otter")
+
+ puts(images_response)
+ response: |
+ {
+ "created": 1713833628,
+ "data": [
+ {
+ "b64_json": "..."
+ }
+ ],
+ "usage": {
+ "total_tokens": 100,
+ "input_tokens": 50,
+ "output_tokens": 50,
+ "input_tokens_details": {
+ "text_tokens": 10,
+ "image_tokens": 40
+ }
+ }
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/images/generations \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-image-1.5",
+ "prompt": "A cute baby sea otter",
+ "n": 1,
+ "size": "1024x1024",
+ "stream": true
+ }' \
+ --no-buffer
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.generate(
+ prompt="A cute baby sea otter",
+ ):
+ print(image)
+ javascript: |
+ import OpenAI from "openai";
+
+ const client = new OpenAI();
+
+ const stream = await client.images.generate({
+ model: "gpt-image-1.5",
+ prompt: "A cute baby sea otter",
+ n: 1,
+ size: "1024x1024",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });
+
+ console.log(imagesResponse);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{
+ Prompt: "A cute baby sea otter",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageGenerateParams;
+ import com.openai.models.images.ImagesResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageGenerateParams params = ImageGenerateParams.builder()
+ .prompt("A cute baby sea otter")
+ .build();
+ ImagesResponse imagesResponse = client.images().generate(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.generate(prompt: "A cute baby sea otter")
+
+ puts(images_response)
+ response: |
+ event: image_generation.partial_image
+ data: {"type":"image_generation.partial_image","b64_json":"...","partial_image_index":0}
+
+ event: image_generation.completed
+ data: {"type":"image_generation.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}}
+ /openai/v1/images/variations:
+ post:
+ operationId: Images_createImageVariation
+ summary: Create an image variation
+ description: Creates an image variation from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ImagesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Images
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateImageVariationRequest'
+ encoding:
+ model:
+ contentType: application/json
+ 'n':
+ contentType: application/json
+ response_format:
+ contentType: application/json
+ size:
+ contentType: application/json
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Create image variation
+ group: images
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/images/variations \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F image="@otter.png" \
+ -F n=2 \
+ -F size="1024x1024"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ images_response = client.images.create_variation(
+ image=b"Example data",
+ )
+ print(images_response.created)
+ javascript: |-
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const image = await openai.images.createVariation({
+ image: fs.createReadStream("otter.png"),
+ });
+
+ console.log(image.data);
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Images;
+
+ ImageClient client = new(
+ model: "dall-e-2",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ GeneratedImage image = client.GenerateImageVariation(imageFilePath: "otter.png");
+
+ Console.WriteLine(image.ImageUri);
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.createVariation({
+ image: fs.createReadStream('otter.png'),
+ });
+
+ console.log(imagesResponse.created);
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.NewVariation(context.TODO(), openai.ImageNewVariationParams{
+ Image: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse.Created)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageCreateVariationParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageCreateVariationParams params = ImageCreateVariationParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ ImagesResponse imagesResponse = client.images().createVariation(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.create_variation(image: StringIO.new("Example data"))
+
+ puts(images_response)
+ response: |
+ {
+ "created": 1589478378,
+ "data": [
+ {
+ "url": "https://..."
+ },
+ {
+ "url": "https://..."
+ }
+ ]
+ }
+ /openai/v1/models:
+ get:
+ operationId: OpenAIModels_listModels
+ summary: List models
+ description: Lists models matching the request filters.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListModelsResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Models
+ x-oaiMeta:
+ name: List models
+ group: models
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/models \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.models.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.models.list();
+
+ for await (const model of list) {
+ console.log(model);
+ }
+ }
+ main();
+ csharp: |
+ using System;
+
+ using OpenAI.Models;
+
+ OpenAIModelClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ foreach (var model in client.GetModels().Value)
+ {
+ Console.WriteLine(model.Id);
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const model of client.models.list()) {
+ console.log(model.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Models.List(context.TODO())
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.models.ModelListPage;
+ import com.openai.models.models.ModelListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModelListPage page = client.models().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.models.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "model-id-0",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "organization-owner"
+ },
+ {
+ "id": "model-id-1",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "organization-owner",
+ },
+ {
+ "id": "model-id-2",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "openai"
+ },
+ ]
+ }
+ x-ms-list: true
+ /openai/v1/models/{model}:
+ delete:
+ operationId: OpenAIModels_deleteModel
+ summary: Delete a model
+ description: Deletes a model by its identifier.
+ parameters:
+ - name: model
+ in: path
required: true
- description: The API version to use for this operation.
+ description: The model to delete
schema:
type: string
- explode: false
responses:
- '204':
- description: 'There is no content to send for this request, but the headers may be useful. '
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteModelResponse'
4XX:
description: Client error
content:
@@ -12825,895 +24189,24486 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
tags:
- - Toolboxes
-security:
- - OAuth2Auth:
- - https://ai.azure.com/.default
-components:
- parameters:
- Azure.Core.ClientRequestIdHeader:
- name: x-ms-client-request-id
- in: header
- required: false
- description: An opaque, globally-unique, client-generated string identifier for the request.
- schema:
- $ref: '#/components/schemas/Azure.Core.uuid'
- Azure.Core.Foundations.ApiVersionParameter:
- name: api-version
- in: query
- required: true
- description: The API version to use for this operation.
- schema:
- type: string
- minLength: 1
- explode: false
- CreateOrUpdateRoutineParameters.routine_name:
- name: routine_name
- in: path
- required: true
- description: The unique name of the routine.
- schema:
- type: string
- maxLength: 128
- DeleteRoutineParameters:
- name: routine_name
- in: path
- required: true
- description: The unique name of the routine.
- schema:
- type: string
- maxLength: 128
- DisableRoutineParameters:
- name: routine_name
- in: path
- required: true
- description: The unique name of the routine.
- schema:
- type: string
- maxLength: 128
- DispatchRoutineAsyncParameters.routine_name:
- name: routine_name
- in: path
- required: true
- description: The unique name of the routine.
- schema:
- type: string
- maxLength: 128
- EnableRoutineParameters:
- name: routine_name
- in: path
- required: true
- description: The unique name of the routine.
- schema:
- type: string
- maxLength: 128
- GetRoutineParameters:
- name: routine_name
- in: path
- required: true
- description: The unique name of the routine.
- schema:
- type: string
- maxLength: 128
- ListRoutineRunsParameters.after:
- name: after
- in: query
- required: false
- description: An opaque cursor returned as last_id by the previous list-runs response.
- schema:
- type: string
- explode: false
- ListRoutineRunsParameters.before:
- name: before
- in: query
- required: false
- description: Unsupported. Reserved for future backward pagination support.
- schema:
- type: string
- explode: false
- ListRoutineRunsParameters.filter:
- name: filter
- in: query
- required: false
- description: An optional MLflow search-runs filter expression applied within the routine's experiment.
- schema:
- type: string
- explode: false
- ListRoutineRunsParameters.limit:
- name: limit
- in: query
- required: false
- description: The maximum number of runs to return.
- schema:
- type: integer
- format: int32
- explode: false
- ListRoutineRunsParameters.order:
- name: order
- in: query
- required: false
- description: The ordering direction. Supported values are asc and desc.
- schema:
- type: string
- explode: false
- ListRoutineRunsParameters.routine_name:
- name: routine_name
- in: path
- required: true
- description: The unique name of the routine.
- schema:
- type: string
- maxLength: 128
- ListRoutinesParameters.after:
- name: after
- in: query
- required: false
- description: An opaque cursor returned as last_id by the previous list response.
- schema:
- type: string
- explode: false
- ListRoutinesParameters.before:
- name: before
- in: query
- required: false
- description: Unsupported. Reserved for future backward pagination support.
- schema:
- type: string
- explode: false
- ListRoutinesParameters.limit:
- name: limit
- in: query
- required: false
- description: The maximum number of routines to return.
- schema:
- type: integer
- format: int32
- explode: false
- ListRoutinesParameters.order:
- name: order
- in: query
- required: false
- description: The ordering direction. Supported values are asc and desc.
- schema:
- type: string
- explode: false
- UpdateToolboxRequest.name:
- name: name
- in: path
- required: true
- description: The name of the toolbox to update.
- schema:
- type: string
- schemas:
- A2APreviewTool:
+ - Models
+ x-oaiMeta:
+ name: Delete a fine-tuned model
+ group: models
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/models/ft:gpt-4o-mini:acemeco:suffix:abc123 \
+ -X DELETE \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ model_deleted = client.models.delete(
+ "ft:gpt-4o-mini:acemeco:suffix:abc123",
+ )
+ print(model_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const model = await openai.models.delete("ft:gpt-4o-mini:acemeco:suffix:abc123");
+
+ console.log(model);
+ }
+ main();
+ csharp: |
+ using System;
+ using System.ClientModel;
+
+ using OpenAI.Models;
+
+ OpenAIModelClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ClientResult success = client.DeleteModel("ft:gpt-4o-mini:acemeco:suffix:abc123");
+ Console.WriteLine(success);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const modelDeleted = await client.models.delete('ft:gpt-4o-mini:acemeco:suffix:abc123');
+
+ console.log(modelDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ modelDeleted, err := client.Models.Delete(context.TODO(), "ft:gpt-4o-mini:acemeco:suffix:abc123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", modelDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.models.ModelDeleteParams;
+ import com.openai.models.models.ModelDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModelDeleted modelDeleted = client.models().delete("ft:gpt-4o-mini:acemeco:suffix:abc123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ model_deleted = openai.models.delete("ft:gpt-4o-mini:acemeco:suffix:abc123")
+
+ puts(model_deleted)
+ response: |
+ {
+ "id": "ft:gpt-4o-mini:acemeco:suffix:abc123",
+ "object": "model",
+ "deleted": true
+ }
+ get:
+ operationId: OpenAIModels_retrieveModel
+ summary: Get a model
+ description: Retrieves a model by its identifier.
+ parameters:
+ - name: model
+ in: path
+ required: true
+ description: The ID of the model to use for this request
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Model'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Models
+ x-oaiMeta:
+ name: Retrieve model
+ group: models
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/models/VAR_chat_model_id \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ model = client.models.retrieve(
+ "gpt-4o-mini",
+ )
+ print(model.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const model = await openai.models.retrieve("VAR_chat_model_id");
+
+ console.log(model);
+ }
+
+ main();
+ csharp: |
+ using System;
+ using System.ClientModel;
+
+ using OpenAI.Models;
+
+ OpenAIModelClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ClientResult model = client.GetModel("babbage-002");
+ Console.WriteLine(model.Value.Id);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const model = await client.models.retrieve('gpt-4o-mini');
+
+ console.log(model.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ model, err := client.Models.Get(context.TODO(), "gpt-4o-mini")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", model.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.models.Model;
+ import com.openai.models.models.ModelRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Model model = client.models().retrieve("gpt-4o-mini");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ model = openai.models.retrieve("gpt-4o-mini")
+
+ puts(model)
+ response: |
+ {
+ "id": "VAR_chat_model_id",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "openai"
+ }
+ /openai/v1/moderations:
+ post:
+ operationId: Moderations_createModeration
+ summary: Create a moderation
+ description: Creates a moderation from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Moderations
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateModerationRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create moderation
+ group: moderations
+ examples:
+ - title: Single string
+ request:
+ curl: |
+ curl https://api.openai.com/v1/moderations \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "input": "I want to kill them."
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ moderation = client.moderations.create(
+ input="I want to kill them.",
+ )
+ print(moderation.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const moderation = await openai.moderations.create({ input: "I want to kill them." });
+
+ console.log(moderation);
+ }
+ main();
+ csharp: |
+ using System;
+ using System.ClientModel;
+
+ using OpenAI.Moderations;
+
+ ModerationClient client = new(
+ model: "omni-moderation-latest",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ClientResult moderation = client.ClassifyText("I want to kill them.");
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const moderation = await client.moderations.create({ input: 'I want to kill them.' });
+
+ console.log(moderation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ moderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{
+ Input: openai.ModerationNewParamsInputUnion{
+ OfString: openai.String("I want to kill them."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", moderation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.moderations.ModerationCreateParams;
+ import com.openai.models.moderations.ModerationCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModerationCreateParams params = ModerationCreateParams.builder()
+ .input("I want to kill them.")
+ .build();
+ ModerationCreateResponse moderation = client.moderations().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ moderation = openai.moderations.create(input: "I want to kill them.")
+
+ puts(moderation)
+ response: |
+ {
+ "id": "modr-AB8CjOTu2jiq12hp1AQPfeqFWaORR",
+ "model": "text-moderation-007",
+ "results": [
+ {
+ "flagged": true,
+ "categories": {
+ "sexual": false,
+ "hate": false,
+ "harassment": true,
+ "self-harm": false,
+ "sexual/minors": false,
+ "hate/threatening": false,
+ "violence/graphic": false,
+ "self-harm/intent": false,
+ "self-harm/instructions": false,
+ "harassment/threatening": true,
+ "violence": true
+ },
+ "category_scores": {
+ "sexual": 0.000011726012417057063,
+ "hate": 0.22706663608551025,
+ "harassment": 0.5215635299682617,
+ "self-harm": 2.227119921371923e-6,
+ "sexual/minors": 7.107352217872176e-8,
+ "hate/threatening": 0.023547329008579254,
+ "violence/graphic": 0.00003391829886822961,
+ "self-harm/intent": 1.646940972932498e-6,
+ "self-harm/instructions": 1.1198755256458526e-9,
+ "harassment/threatening": 0.5694745779037476,
+ "violence": 0.9971134662628174
+ }
+ }
+ ]
+ }
+ - title: Image and text
+ request:
+ curl: |
+ curl https://api.openai.com/v1/moderations \
+ -X POST \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "omni-moderation-latest",
+ "input": [
+ { "type": "text", "text": "...text to classify goes here..." },
+ {
+ "type": "image_url",
+ "image_url": {
+ "url": "https://example.com/image.png"
+ }
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ moderation = client.moderations.create(
+ input="I want to kill them.",
+ )
+ print(moderation.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ const moderation = await openai.moderations.create({
+ model: "omni-moderation-latest",
+ input: [
+ { type: "text", text: "...text to classify goes here..." },
+ {
+ type: "image_url",
+ image_url: {
+ url: "https://example.com/image.png"
+ // can also use base64 encoded image URLs
+ // url: "data:image/jpeg;base64,abcdefg..."
+ }
+ }
+ ],
+ });
+
+ console.log(moderation);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const moderation = await client.moderations.create({ input: 'I want to kill them.' });
+
+ console.log(moderation.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ moderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{
+ Input: openai.ModerationNewParamsInputUnion{
+ OfString: openai.String("I want to kill them."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", moderation.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.moderations.ModerationCreateParams;
+ import com.openai.models.moderations.ModerationCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModerationCreateParams params = ModerationCreateParams.builder()
+ .input("I want to kill them.")
+ .build();
+ ModerationCreateResponse moderation = client.moderations().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ moderation = openai.moderations.create(input: "I want to kill them.")
+
+ puts(moderation)
+ response: |
+ {
+ "id": "modr-0d9740456c391e43c445bf0f010940c7",
+ "model": "omni-moderation-latest",
+ "results": [
+ {
+ "flagged": true,
+ "categories": {
+ "harassment": true,
+ "harassment/threatening": true,
+ "sexual": false,
+ "hate": false,
+ "hate/threatening": false,
+ "illicit": false,
+ "illicit/violent": false,
+ "self-harm/intent": false,
+ "self-harm/instructions": false,
+ "self-harm": false,
+ "sexual/minors": false,
+ "violence": true,
+ "violence/graphic": true
+ },
+ "category_scores": {
+ "harassment": 0.8189693396524255,
+ "harassment/threatening": 0.804985420696006,
+ "sexual": 1.573112165348997e-6,
+ "hate": 0.007562942636942845,
+ "hate/threatening": 0.004208854591835476,
+ "illicit": 0.030535955153511665,
+ "illicit/violent": 0.008925306722380033,
+ "self-harm/intent": 0.00023023930975076432,
+ "self-harm/instructions": 0.0002293869201073356,
+ "self-harm": 0.012598046106750154,
+ "sexual/minors": 2.212566909570261e-8,
+ "violence": 0.9999992735124786,
+ "violence/graphic": 0.843064871157054
+ },
+ "category_applied_input_types": {
+ "harassment": [
+ "text"
+ ],
+ "harassment/threatening": [
+ "text"
+ ],
+ "sexual": [
+ "text",
+ "image"
+ ],
+ "hate": [
+ "text"
+ ],
+ "hate/threatening": [
+ "text"
+ ],
+ "illicit": [
+ "text"
+ ],
+ "illicit/violent": [
+ "text"
+ ],
+ "self-harm/intent": [
+ "text",
+ "image"
+ ],
+ "self-harm/instructions": [
+ "text",
+ "image"
+ ],
+ "self-harm": [
+ "text",
+ "image"
+ ],
+ "sexual/minors": [
+ "text"
+ ],
+ "violence": [
+ "text",
+ "image"
+ ],
+ "violence/graphic": [
+ "text",
+ "image"
+ ]
+ }
+ }
+ ]
+ }
+ /openai/v1/realtime/calls:
+ post:
+ operationId: Realtime_create-realtime-call
+ summary: Create a Realtime call
+ description: Creates a Realtime API call over WebRTC and returns the SDP answer needed to complete the peer connection.
+ parameters: []
+ responses:
+ '201':
+ description: The request has succeeded and a new resource has been created as a result.
+ headers:
+ location:
+ required: false
+ description: The location request header.
+ schema:
+ type: string
+ content:
+ application/sdp:
+ schema:
+ type: string
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Realtime
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RealtimeCallCreateRequest'
+ encoding:
+ session:
+ contentType: application/json
+ description: The request body.
+ x-oaiMeta:
+ name: Create call
+ group: realtime
+ returns: |-
+ Returns `201 Created` with the SDP answer in the response body. The
+ `Location` response header includes the call ID for follow-up requests,
+ e.g., establishing a monitoring WebSocket or hanging up the call.
+ examples:
+ request:
+ curl: |-
+ curl -X POST https://api.openai.com/v1/realtime/calls \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F "sdp= inputItems =
+ [
+ ResponseItem.CreateUserMessageItem(
+ [
+ ResponseContentPart.CreateInputTextPart("What is in this image?"),
+ ResponseContentPart.CreateInputImagePart(new Uri("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"))
+ ]
+ )
+ ];
+
+ OpenAIResponse response = client.CreateResponse(inputItems);
+
+ Console.WriteLine(response.GetOutputText());
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
+ "object": "response",
+ "created_at": 1741476777,
+ "status": "completed",
+ "completed_at": 1741476778,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 328,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 52,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 380
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: File input
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "what is in this file?"},
+ {
+ "type": "input_file",
+ "file_url": "https://www.berkshirehathaway.com/letters/2024ltr.pdf"
+ }
+ ]
+ }
+ ]
+ }'
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ input: [
+ {
+ role: "user",
+ content: [
+ { type: "input_text", text: "what is in this file?" },
+ {
+ type: "input_file",
+ file_url: "https://www.berkshirehathaway.com/letters/2024ltr.pdf",
+ },
+ ],
+ },
+ ],
+ });
+
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86",
+ "object": "response",
+ "created_at": 1752100704,
+ "status": "completed",
+ "completed_at": 1752100705,
+ "background": false,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "max_tool_calls": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "id": "msg_686eef60d3e081a29283bdcbc4322fd90e34c516d176ff86",
+ "type": "message",
+ "status": "completed",
+ "content": [
+ {
+ "type": "output_text",
+ "annotations": [],
+ "logprobs": [],
+ "text": "The file seems to contain excerpts from a letter to the shareholders of Berkshire Hathaway Inc., likely written by Warren Buffett. It covers several topics:
+
+ 1. **Communication Philosophy**: Buffett emphasizes the importance of transparency and candidness in reporting mistakes and successes to shareholders.
+
+ 2. **Mistakes and Learnings**: The letter acknowledges past mistakes in business assessments and management hires, highlighting the importance of correcting errors promptly.
+
+ 3. **CEO Succession**: Mention of Greg Abel stepping in as the new CEO and continuing the tradition of honest communication.
+
+ 4. **Pete Liegl Story**: A detailed account of acquiring Forest River and the relationship with its founder, highlighting trust and effective business decisions.
+
+ 5. **2024 Performance**: Overview of business performance, particularly in insurance and investment activities, with a focus on GEICO's improvement.
+
+ 6. **Tax Contributions**: Discussion of significant tax payments to the U.S. Treasury, credited to shareholders' reinvestments.
+
+ 7. **Investment Strategy**: A breakdown of Berkshire\u2019s investments in both controlled subsidiaries and marketable equities, along with a focus on long-term holding strategies.
+
+ 8. **American Capitalism**: Reflections on America\u2019s economic development and Berkshire\u2019s role within it.
+
+ 9. **Property-Casualty Insurance**: Insights into the P/C insurance business model and its challenges and benefits.
+
+ 10. **Japanese Investments**: Information about Berkshire\u2019s investments in Japanese companies and future plans.
+
+ 11. **Annual Meeting**: Details about the upcoming annual gathering in Omaha, including schedule changes and new book releases.
+
+ 12. **Personal Anecdotes**: Light-hearted stories about family and interactions, conveying Buffett's personable approach.
+
+ 13. **Financial Performance Data**: Tables comparing Berkshire\u2019s annual performance to the S&P 500, showing impressive long-term gains.
+
+ Overall, the letter reinforces Berkshire Hathaway's commitment to transparency, investment in both its businesses and the wider economy, and emphasizes strong leadership and prudent financial management."
+ }
+ ],
+ "role": "assistant"
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "service_tier": "default",
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_logprobs": 0,
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 8438,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 398,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 8836
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: Web search
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "tools": [{ "type": "web_search_preview" }],
+ "input": "What was a positive news story from today?"
+ }'
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ tools: [{ type: "web_search_preview" }],
+ input: "What was a positive news story from today?",
+ });
+
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ csharp: |
+ using System;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "What was a positive news story from today?";
+
+ ResponseCreationOptions options = new()
+ {
+ Tools =
+ {
+ ResponseTool.CreateWebSearchTool()
+ },
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ Console.WriteLine(response.GetOutputText());
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c",
+ "object": "response",
+ "created_at": 1741484430,
+ "status": "completed",
+ "completed_at": 1741484431,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "web_search_call",
+ "id": "ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c",
+ "status": "completed"
+ },
+ {
+ "type": "message",
+ "id": "msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "As of today, March 9, 2025, one notable positive news story...",
+ "annotations": [
+ {
+ "type": "url_citation",
+ "start_index": 442,
+ "end_index": 557,
+ "url": "https://.../?utm_source=chatgpt.com",
+ "title": "..."
+ },
+ {
+ "type": "url_citation",
+ "start_index": 962,
+ "end_index": 1077,
+ "url": "https://.../?utm_source=chatgpt.com",
+ "title": "..."
+ },
+ {
+ "type": "url_citation",
+ "start_index": 1336,
+ "end_index": 1451,
+ "url": "https://.../?utm_source=chatgpt.com",
+ "title": "..."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [
+ {
+ "type": "web_search_preview",
+ "domains": [],
+ "search_context_size": "medium",
+ "user_location": {
+ "type": "approximate",
+ "city": null,
+ "country": "US",
+ "region": null,
+ "timezone": null
+ }
+ }
+ ],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 328,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 356,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 684
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: File search
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "tools": [{
+ "type": "file_search",
+ "vector_store_ids": ["vs_1234567890"],
+ "max_num_results": 20
+ }],
+ "input": "What are the attributes of an ancient brown dragon?"
+ }'
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ tools: [{
+ type: "file_search",
+ vector_store_ids: ["vs_1234567890"],
+ max_num_results: 20
+ }],
+ input: "What are the attributes of an ancient brown dragon?",
+ });
+
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ csharp: |
+ using System;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "What are the attributes of an ancient brown dragon?";
+
+ ResponseCreationOptions options = new()
+ {
+ Tools =
+ {
+ ResponseTool.CreateFileSearchTool(
+ vectorStoreIds: ["vs_1234567890"],
+ maxResultCount: 20
+ )
+ },
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ Console.WriteLine(response.GetOutputText());
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7",
+ "object": "response",
+ "created_at": 1741485253,
+ "status": "completed",
+ "completed_at": 1741485254,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "file_search_call",
+ "id": "fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7",
+ "status": "completed",
+ "queries": [
+ "attributes of an ancient brown dragon"
+ ],
+ "results": null
+ },
+ {
+ "type": "message",
+ "id": "msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "The attributes of an ancient brown dragon include...",
+ "annotations": [
+ {
+ "type": "file_citation",
+ "index": 320,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 576,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 815,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 815,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1030,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1030,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1156,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1225,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [
+ {
+ "type": "file_search",
+ "filters": null,
+ "max_num_results": 20,
+ "ranking_options": {
+ "ranker": "auto",
+ "score_threshold": 0.0
+ },
+ "vector_store_ids": [
+ "vs_1234567890"
+ ]
+ }
+ ],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 18307,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 348,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 18655
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "instructions": "You are a helpful assistant.",
+ "input": "Hello!",
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ instructions: "You are a helpful assistant.",
+ input: "Hello!",
+ stream: true,
+ });
+
+ for await (const event of response) {
+ console.log(event);
+ }
+ csharp: |
+ using System;
+ using System.ClientModel;
+ using System.Threading.Tasks;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "Hello!";
+
+ ResponseCreationOptions options = new()
+ {
+ Instructions = "You are a helpful assistant.",
+ };
+
+ AsyncCollectionResult responseUpdates = client.CreateResponseStreamingAsync(userInputText, options);
+
+ await foreach (StreamingResponseUpdate responseUpdate in responseUpdates)
+ {
+ if (responseUpdate is StreamingResponseOutputTextDeltaUpdate outputTextDeltaUpdate)
+ {
+ Console.Write(outputTextDeltaUpdate.Delta);
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ event: response.created
+ data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
+
+ event: response.in_progress
+ data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
+
+ event: response.output_item.added
+ data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}}
+
+ event: response.content_part.added
+ data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}
+
+ event: response.output_text.delta
+ data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"Hi"}
+
+ ...
+
+ event: response.output_text.done
+ data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"Hi there! How can I assist you today?"}
+
+ event: response.content_part.done
+ data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}}
+
+ event: response.output_item.done
+ data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}}
+
+ event: response.completed
+ data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}}
+ - title: Functions
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.4",
+ "input": "What is the weather like in Boston today?",
+ "tools": [
+ {
+ "type": "function",
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location", "unit"]
+ }
+ }
+ ],
+ "tool_choice": "auto"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const tools = [
+ {
+ type: "function",
+ name: "get_current_weather",
+ description: "Get the current weather in a given location",
+ parameters: {
+ type: "object",
+ properties: {
+ location: {
+ type: "string",
+ description: "The city and state, e.g. San Francisco, CA",
+ },
+ unit: { type: "string", enum: ["celsius", "fahrenheit"] },
+ },
+ required: ["location", "unit"],
+ },
+ },
+ ];
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ tools: tools,
+ input: "What is the weather like in Boston today?",
+ tool_choice: "auto",
+ });
+
+ console.log(response);
+ csharp: |
+ using System;
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ResponseTool getCurrentWeatherFunctionTool = ResponseTool.CreateFunctionTool(
+ functionName: "get_current_weather",
+ functionDescription: "Get the current weather in a given location",
+ functionParameters: BinaryData.FromString("""
+ {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
+ },
+ "required": ["location", "unit"]
+ }
+ """
+ )
+ );
+
+ string userInputText = "What is the weather like in Boston today?";
+
+ ResponseCreationOptions options = new()
+ {
+ Tools =
+ {
+ getCurrentWeatherFunctionTool
+ },
+ ToolChoice = ResponseToolChoice.CreateAutoChoice(),
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0",
+ "object": "response",
+ "created_at": 1741294021,
+ "status": "completed",
+ "completed_at": 1741294022,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "function_call",
+ "id": "fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0",
+ "call_id": "call_unLAR8MvFNptuiZK6K6HCy5k",
+ "name": "get_current_weather",
+ "arguments": "{"location":"Boston, MA","unit":"celsius"}",
+ "status": "completed"
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [
+ {
+ "type": "function",
+ "description": "Get the current weather in a given location",
+ "name": "get_current_weather",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": [
+ "celsius",
+ "fahrenheit"
+ ]
+ }
+ },
+ "required": [
+ "location",
+ "unit"
+ ]
+ },
+ "strict": true
+ }
+ ],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 291,
+ "output_tokens": 23,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 314
+ },
+ "user": null,
+ "metadata": {}
+ }
+ - title: Reasoning
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "o3-mini",
+ "input": "How much wood would a woodchuck chuck?",
+ "reasoning": {
+ "effort": "high"
+ }
+ }'
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "o3-mini",
+ input: "How much wood would a woodchuck chuck?",
+ reasoning: {
+ effort: "high"
+ }
+ });
+
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ csharp: |
+ using System;
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "o3-mini",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "How much wood would a woodchuck chuck?";
+
+ ResponseCreationOptions options = new()
+ {
+ ReasoningOptions = new()
+ {
+ ReasoningEffortLevel = ResponseReasoningEffortLevel.High,
+ },
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ Console.WriteLine(response.GetOutputText());
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808",
+ "object": "response",
+ "created_at": 1741477868,
+ "status": "completed",
+ "completed_at": 1741477869,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "o1-2024-12-17",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "The classic tongue twister...",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": "high",
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 81,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 1035,
+ "output_tokens_details": {
+ "reasoning_tokens": 832
+ },
+ "total_tokens": 1116
+ },
+ "user": null,
+ "metadata": {}
+ }
+ get:
+ operationId: listResponses
+ summary: List responses
+ description: Returns a collection of all stored responses matching specified filter criteria.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: agent_name
+ in: query
+ required: false
+ description: Filter by agent name. If provided, only items associated with the specified agent will be returned.
+ schema:
+ type: string
+ explode: false
+ - name: agent_id
+ in: query
+ required: false
+ description: Filter by agent ID in the format `name:version`. If provided, only items associated with the specified agent ID will be returned.
+ schema:
+ type: string
+ explode: false
+ - name: conversation_id
+ in: query
+ required: false
+ description: Filter by conversation ID. If provided, only responses associated with the specified conversation will be returned.
+ schema:
+ type: string
+ explode: false
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ /openai/v1/responses/compact:
+ post:
+ operationId: Compactconversation
+ summary: Compact a conversation
+ description: Compacts a conversation into a response object suitable for long-running and zero-data-retention scenarios.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CompactResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CompactResponseMethodPublicBody'
+ x-oaiMeta:
+ name: Compact a response
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/responses/compact \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "model": "gpt-5.1-codex-max",
+ "input": [
+ {
+ "role": "user",
+ "content": "Create a simple landing page for a dog petting café."
+ },
+ {
+ "id": "msg_001",
+ "type": "message",
+ "status": "completed",
+ "content": [
+ {
+ "type": "output_text",
+ "annotations": [],
+ "logprobs": [],
+ "text": "Below is a single file, ready-to-use landing page for a dog petting café:..."
+ }
+ ],
+ "role": "assistant"
+ }
+ ]
+ }'
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ // Compact the previous response if you are running out of tokens
+ const compactedResponse = await openai.responses.compact({
+ model: "gpt-5.1-codex-max",
+ input: [
+ {
+ role: "user",
+ content: "Create a simple landing page for a dog petting café.",
+ },
+ // All items returned from previous requests are included here, like reasoning, message, function call, etc.
+ {
+ id: "msg_030d085c0b53e67e0069332e3a72d4819c96c6f2c4adc15d33",
+ type: "message",
+ status: "completed",
+ content: [
+ {
+ type: "output_text",
+ annotations: [],
+ logprobs: [],
+ text: "Below is a single file, ready-to-use landing page for a dog petting café:...",
+ },
+ ],
+ role: "assistant",
+ },
+ ],
+ });
+
+ // Pass the compactedResponse.output as input to the next request
+ console.log(compactedResponse);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ compacted_response = client.responses.compact(
+ model="gpt-5.4",
+ )
+ print(compacted_response.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const compactedResponse = await client.responses.compact({ model: 'gpt-5.4' });
+
+ console.log(compactedResponse.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ compactedResponse, err := client.Responses.Compact(context.TODO(), responses.ResponseCompactParams{
+ Model: responses.ResponseCompactParamsModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", compactedResponse.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.CompactedResponse;
+ import com.openai.models.responses.ResponseCompactParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ResponseCompactParams params = ResponseCompactParams.builder()
+ .model(ResponseCompactParams.Model.GPT_5_4)
+ .build();
+ CompactedResponse compactedResponse = client.responses().compact(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ compacted_response = openai.responses.compact(model: :"gpt-5.4")
+
+ puts(compacted_response)
+ response: |
+ {
+ "id": "resp_001",
+ "object": "response.compaction",
+ "created_at": 1764967971,
+ "output": [
+ {
+ "id": "msg_000",
+ "type": "message",
+ "status": "completed",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Create a simple landing page for a dog petting cafe."
+ }
+ ],
+ "role": "user"
+ },
+ {
+ "id": "cmp_001",
+ "type": "compaction",
+ "encrypted_content": "gAAAAABpM0Yj-...="
+ }
+ ],
+ "usage": {
+ "input_tokens": 139,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 438,
+ "output_tokens_details": {
+ "reasoning_tokens": 64
+ },
+ "total_tokens": 577
+ }
+ }
+ /openai/v1/responses/{response_id}:
+ get:
+ operationId: getResponse
+ summary: Retrieve a model response
+ description: Retrieves a model response with the given ID.
+ parameters:
+ - name: response_id
+ in: path
+ required: true
+ description: The response id path parameter.
+ schema:
+ type: string
+ - name: include[]
+ in: query
+ required: false
+ description: The includables query parameter.
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.IncludeEnum'
+ default: []
+ - name: stream
+ in: query
+ required: false
+ description: The stream query parameter.
+ schema:
+ type: boolean
+ default: false
+ explode: false
+ - name: starting_after
+ in: query
+ required: false
+ description: The sequence number of the event after which to start streaming.
+ schema:
+ type: integer
+ format: int32
+ explode: false
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ x-agent-session-id:
+ required: false
+ description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Response'
+ text/event-stream:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateResponseStreamingResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ x-oaiMeta:
+ name: Get a model response
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses/resp_123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.retrieve("resp_123");
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.retrieve(
+ response_id="resp_677efb5139a88190b512bc3fef8e535d",
+ ):
+ print(response)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.retrieve('resp_677efb5139a88190b512bc3fef8e535d');
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.Get(
+ context.TODO(),
+ "resp_677efb5139a88190b512bc3fef8e535d",
+ responses.ResponseGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().retrieve("resp_677efb5139a88190b512bc3fef8e535d");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.retrieve("resp_677efb5139a88190b512bc3fef8e535d")
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44",
+ "object": "response",
+ "created_at": 1741386163,
+ "status": "completed",
+ "completed_at": 1741386164,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "Silent circuits hum,
+ Thoughts emerge in data streams—
+ Digital dawn breaks.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 32,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 18,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 50
+ },
+ "user": null,
+ "metadata": {}
+ }
+ delete:
+ operationId: deleteResponse
+ summary: Delete a model response
+ description: Deletes a model response.
+ parameters:
+ - name: response_id
+ in: path
+ required: true
+ description: The ID of the response to delete.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ x-agent-session-id:
+ required: false
+ description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DeleteResponseResult'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ x-oaiMeta:
+ name: Delete a model response
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/responses/resp_123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.delete("resp_123");
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ client.responses.delete(
+ "resp_677efb5139a88190b512bc3fef8e535d",
+ )
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ await client.responses.delete('resp_677efb5139a88190b512bc3fef8e535d');
+ go: |
+ package main
+
+ import (
+ "context"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ err := client.Responses.Delete(context.TODO(), "resp_677efb5139a88190b512bc3fef8e535d")
+ if err != nil {
+ panic(err.Error())
+ }
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.ResponseDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ client.responses().delete("resp_677efb5139a88190b512bc3fef8e535d");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ result = openai.responses.delete("resp_677efb5139a88190b512bc3fef8e535d")
+
+ puts(result)
+ response: |
+ {
+ "id": "resp_6786a1bec27481909a17d673315b29f6",
+ "object": "response",
+ "deleted": true
+ }
+ /openai/v1/responses/{response_id}/cancel:
+ post:
+ operationId: cancelResponse
+ summary: Cancel a model response
+ description: Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.
+ parameters:
+ - name: response_id
+ in: path
+ required: true
+ description: The ID of the response to cancel.
+ schema:
+ type: string
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ x-agent-session-id:
+ required: false
+ description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Response'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ x-oaiMeta:
+ name: Cancel a response
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/responses/resp_123/cancel \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.cancel("resp_123");
+ console.log(response);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.responses.cancel(
+ "resp_677efb5139a88190b512bc3fef8e535d",
+ )
+ print(response.id)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.cancel('resp_677efb5139a88190b512bc3fef8e535d');
+
+ console.log(response.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.Cancel(context.TODO(), "resp_677efb5139a88190b512bc3fef8e535d")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().cancel("resp_677efb5139a88190b512bc3fef8e535d");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.cancel("resp_677efb5139a88190b512bc3fef8e535d")
+
+ puts(response)
+ response: |
+ {
+ "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44",
+ "object": "response",
+ "created_at": 1741386163,
+ "status": "cancelled",
+ "background": true,
+ "completed_at": null,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44",
+ "status": "in_progress",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "Silent circuits hum,
+ Thoughts emerge in data streams—
+ Digital dawn breaks.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ }
+ /openai/v1/responses/{response_id}/input_items:
+ get:
+ operationId: listInputItems
+ summary: List input items for a response
+ description: Retrieves the input items associated with the specified response.
+ parameters:
+ - name: response_id
+ in: path
+ required: true
+ description: The response id path parameter.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: x-ms-user-identity
+ in: header
+ required: false
+ description: Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the `agents/endpoints/UserIdentityImpersonation/action` RBAC permission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ headers:
+ x-agent-session-id:
+ required: false
+ description: Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Responses
+ x-oaiMeta:
+ name: List input items
+ group: responses
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/responses/resp_abc123/input_items \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.inputItems.list("resp_123");
+ console.log(response.data);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.responses.input_items.list(
+ response_id="response_id",
+ )
+ page = page.data[0]
+ print(page)
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const responseItem of client.responses.inputItems.list('response_id')) {
+ console.log(responseItem);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Responses.InputItems.List(
+ context.TODO(),
+ "response_id",
+ responses.InputItemListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.inputitems.InputItemListPage;
+ import com.openai.models.responses.inputitems.InputItemListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ InputItemListPage page = client.responses().inputItems().list("response_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.responses.input_items.list("response_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "msg_abc123",
+ "type": "message",
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Tell me a three sentence bedtime story about a unicorn."
+ }
+ ]
+ }
+ ],
+ "first_id": "msg_abc123",
+ "last_id": "msg_abc123",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/threads:
+ post:
+ operationId: Threads_createThread
+ summary: Create a thread
+ description: Creates a thread from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ThreadObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create thread
+ group: threads
+ beta: true
+ examples:
+ - title: Empty
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d ''
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.create()
+ print(thread.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const emptyThread = await openai.beta.threads.create();
+
+ console.log(emptyThread);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.create();
+
+ console.log(thread.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.create
+
+ puts(thread)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699012949,
+ "metadata": {},
+ "tool_resources": {}
+ }
+ - title: Messages
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "messages": [{
+ "role": "user",
+ "content": "Hello, what is AI?"
+ }, {
+ "role": "user",
+ "content": "How does AI work? Explain it in simple terms."
+ }]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.create()
+ print(thread.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const messageThread = await openai.beta.threads.create({
+ messages: [
+ {
+ role: "user",
+ content: "Hello, what is AI?"
+ },
+ {
+ role: "user",
+ content: "How does AI work? Explain it in simple terms.",
+ },
+ ],
+ });
+
+ console.log(messageThread);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.create();
+
+ console.log(thread.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.create
+
+ puts(thread)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699014083,
+ "metadata": {},
+ "tool_resources": {}
+ }
+ /openai/v1/threads/runs:
+ post:
+ operationId: Threads_createThreadAndRun
+ summary: Create a thread and run
+ description: Creates a thread and run from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create thread and run
+ group: threads
+ beta: true
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_abc123",
+ "thread": {
+ "messages": [
+ {"role": "user", "content": "Explain deep learning to a 5 year old."}
+ ]
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for thread in client.beta.threads.create_and_run(
+ assistant_id="assistant_id",
+ ):
+ print(thread)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.createAndRun({
+ assistant_id: "asst_abc123",
+ thread: {
+ messages: [
+ { role: "user", content: "Explain deep learning to a 5 year old." },
+ ],
+ },
+ });
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{
+ AssistantID: "assistant_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadCreateAndRunParams;
+ import com.openai.models.beta.threads.runs.Run;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().createAndRun(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.create_and_run(assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699076792,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "queued",
+ "started_at": null,
+ "expires_at": 1699077392,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": null,
+ "required_action": null,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant.",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completion_tokens": null,
+ "max_prompt_tokens": null,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "incomplete_details": null,
+ "usage": null,
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_123",
+ "thread": {
+ "messages": [
+ {"role": "user", "content": "Hello"}
+ ]
+ },
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for thread in client.beta.threads.create_and_run(
+ assistant_id="assistant_id",
+ ):
+ print(thread)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.beta.threads.createAndRun({
+ assistant_id: "asst_123",
+ thread: {
+ messages: [
+ { role: "user", content: "Hello" },
+ ],
+ },
+ stream: true
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{
+ AssistantID: "assistant_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadCreateAndRunParams;
+ import com.openai.models.beta.threads.runs.Run;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().createAndRun(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.create_and_run(assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ event: thread.created
+ data: {"id":"thread_123","object":"thread","created_at":1710348075,"metadata":{}}
+
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[], "metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[], "metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}], "metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}}
+
+ event: thread.run.completed
+ {"id":"run_123","object":"thread.run","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1713226836,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1713226837,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":345,"completion_tokens":11,"total_tokens":356},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: done
+ data: [DONE]
+ - title: Streaming with Functions
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_abc123",
+ "thread": {
+ "messages": [
+ {"role": "user", "content": "What is the weather like in San Francisco?"}
+ ]
+ },
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for thread in client.beta.threads.create_and_run(
+ assistant_id="assistant_id",
+ ):
+ print(thread)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ async function main() {
+ const stream = await openai.beta.threads.createAndRun({
+ assistant_id: "asst_123",
+ thread: {
+ messages: [
+ { role: "user", content: "What is the weather like in San Francisco?" },
+ ],
+ },
+ tools: tools,
+ stream: true
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{
+ AssistantID: "assistant_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadCreateAndRunParams;
+ import com.openai.models.beta.threads.runs.Run;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().createAndRun(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.create_and_run(assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ event: thread.created
+ data: {"id":"thread_123","object":"thread","created_at":1710351818,"metadata":{}}
+
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710351818,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710351819,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710352418,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710351819,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710352418,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"id":"call_XXNp8YGaFrjrSjgqxtC8JJ1B","type":"function","function":{"name":"get_current_weather","arguments":"","output":null}}]}}}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"{""}}]}}}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"location"}}]}}}
+
+ ...
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"ahrenheit"}}]}}}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":""}"}}]}}}
+
+ event: thread.run.requires_action
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"requires_action","started_at":1710351818,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":{"type":"submit_tool_outputs","submit_tool_outputs":{"tool_calls":[{"id":"call_XXNp8YGaFrjrSjgqxtC8JJ1B","type":"function","function":{"name":"get_current_weather","arguments":"{"location":"San Francisco, CA","unit":"fahrenheit"}"}}]}},"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":345,"completion_tokens":11,"total_tokens":356},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+ /openai/v1/threads/{thread_id}:
+ delete:
+ operationId: Threads_deleteThread
+ summary: Delete a thread
+ description: Deletes a thread by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteThreadResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Delete thread
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X DELETE
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread_deleted = client.beta.threads.delete(
+ "thread_id",
+ )
+ print(thread_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const response = await openai.beta.threads.delete("thread_abc123");
+
+ console.log(response);
+ }
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const threadDeleted = await client.beta.threads.delete('thread_id');
+
+ console.log(threadDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ threadDeleted, err := client.Beta.Threads.Delete(context.TODO(), "thread_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", threadDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadDeleteParams;
+ import com.openai.models.beta.threads.ThreadDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadDeleted threadDeleted = client.beta().threads().delete("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread_deleted = openai.beta.threads.delete("thread_id")
+
+ puts(thread_deleted)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Threads_getThread
+ summary: Get a thread
+ description: Retrieves a thread by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ThreadObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Retrieve thread
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.retrieve(
+ "thread_id",
+ )
+ print(thread.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myThread = await openai.beta.threads.retrieve(
+ "thread_abc123"
+ );
+
+ console.log(myThread);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.retrieve('thread_id');
+
+ console.log(thread.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.Get(context.TODO(), "thread_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().retrieve("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.retrieve("thread_id")
+
+ puts(thread)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699014083,
+ "metadata": {},
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": []
+ }
+ }
+ }
+ post:
+ operationId: Threads_modifyThread
+ summary: Update a thread
+ description: Updates a thread with the supplied changes.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to modify. Only the `metadata` can be modified.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ThreadObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ModifyThreadRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Modify thread
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.update(
+ thread_id="thread_id",
+ )
+ print(thread.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const updatedThread = await openai.beta.threads.update(
+ "thread_abc123",
+ {
+ metadata: { modified: "true", user: "abc123" },
+ }
+ );
+
+ console.log(updatedThread);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.update('thread_id');
+
+ console.log(thread.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.Update(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().update("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.update("thread_id")
+
+ puts(thread)
+ response: |
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699014083,
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ },
+ "tool_resources": {}
+ }
+ /openai/v1/threads/{thread_id}/messages:
+ get:
+ operationId: Threads_listMessages
+ summary: List messages
+ description: Lists messages matching the request filters.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) the messages belong to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ - name: run_id
+ in: query
+ required: false
+ description: Filter messages by the run ID that generated them.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListMessagesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: List messages
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/messages \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.threads.messages.list(
+ thread_id="thread_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const threadMessages = await openai.beta.threads.messages.list(
+ "thread_abc123"
+ );
+
+ console.log(threadMessages.data);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const message of client.beta.threads.messages.list('thread_id')) {
+ console.log(message.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Threads.Messages.List(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadMessageListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.MessageListPage;
+ import com.openai.models.beta.threads.messages.MessageListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageListPage page = client.beta().threads().messages().list("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.threads.messages.list("thread_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1699016383,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ },
+ {
+ "id": "msg_abc456",
+ "object": "thread.message",
+ "created_at": 1699016383,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "Hello, what is AI?",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ }
+ ],
+ "first_id": "msg_abc123",
+ "last_id": "msg_abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: Threads_createMessage
+ summary: Create a message
+ description: Creates a message from the supplied request.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) to create a message for.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.MessageObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateMessageRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create message
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/messages \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "role": "user",
+ "content": "How does AI work? Explain it in simple terms."
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message = client.beta.threads.messages.create(
+ thread_id="thread_id",
+ content="string",
+ role="user",
+ )
+ print(message.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const threadMessages = await openai.beta.threads.messages.create(
+ "thread_abc123",
+ { role: "user", content: "How does AI work? Explain it in simple terms." }
+ );
+
+ console.log(threadMessages);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const message = await client.beta.threads.messages.create('thread_id', {
+ content: 'string',
+ role: 'user',
+ });
+
+ console.log(message.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ message, err := client.Beta.Threads.Messages.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadMessageNewParams{
+ Content: openai.BetaThreadMessageNewParamsContentUnion{
+ OfString: openai.String("string"),
+ },
+ Role: openai.BetaThreadMessageNewParamsRoleUser,
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", message.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.Message;
+ import com.openai.models.beta.threads.messages.MessageCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageCreateParams params = MessageCreateParams.builder()
+ .threadId("thread_id")
+ .content("string")
+ .role(MessageCreateParams.Role.USER)
+ .build();
+ Message message = client.beta().threads().messages().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message = openai.beta.threads.messages.create("thread_id", content: "string", role: :user)
+
+ puts(message)
+ response: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1713226573,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ }
+ /openai/v1/threads/{thread_id}/messages/{message_id}:
+ delete:
+ operationId: Threads_deleteMessage
+ summary: Delete a message
+ description: Deletes a message by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to which this message belongs.
+ schema:
+ type: string
+ - name: message_id
+ in: path
+ required: true
+ description: The ID of the message to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteMessageResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Delete message
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message_deleted = client.beta.threads.messages.delete(
+ message_id="message_id",
+ thread_id="thread_id",
+ )
+ print(message_deleted.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedMessage = await openai.beta.threads.messages.delete(
+ "msg_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(deletedMessage);
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const messageDeleted = await client.beta.threads.messages.delete('message_id', {
+ thread_id: 'thread_id',
+ });
+
+ console.log(messageDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ messageDeleted, err := client.Beta.Threads.Messages.Delete(
+ context.TODO(),
+ "thread_id",
+ "message_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", messageDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.MessageDeleteParams;
+ import com.openai.models.beta.threads.messages.MessageDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageDeleteParams params = MessageDeleteParams.builder()
+ .threadId("thread_id")
+ .messageId("message_id")
+ .build();
+ MessageDeleted messageDeleted = client.beta().threads().messages().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message_deleted = openai.beta.threads.messages.delete("message_id", thread_id: "thread_id")
+
+ puts(message_deleted)
+ response: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message.deleted",
+ "deleted": true
+ }
+ get:
+ operationId: Threads_getMessage
+ summary: Get a message
+ description: Retrieves a message by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) to which this message belongs.
+ schema:
+ type: string
+ - name: message_id
+ in: path
+ required: true
+ description: The ID of the message to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.MessageObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Retrieve message
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message = client.beta.threads.messages.retrieve(
+ message_id="message_id",
+ thread_id="thread_id",
+ )
+ print(message.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const message = await openai.beta.threads.messages.retrieve(
+ "msg_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(message);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const message = await client.beta.threads.messages.retrieve('message_id', {
+ thread_id: 'thread_id',
+ });
+
+ console.log(message.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ message, err := client.Beta.Threads.Messages.Get(
+ context.TODO(),
+ "thread_id",
+ "message_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", message.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.Message;
+ import com.openai.models.beta.threads.messages.MessageRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageRetrieveParams params = MessageRetrieveParams.builder()
+ .threadId("thread_id")
+ .messageId("message_id")
+ .build();
+ Message message = client.beta().threads().messages().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message = openai.beta.threads.messages.retrieve("message_id", thread_id: "thread_id")
+
+ puts(message)
+ response: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1699017614,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ }
+ post:
+ operationId: Threads_modifyMessage
+ summary: Update a message
+ description: Updates a message with the supplied changes.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to which this message belongs.
+ schema:
+ type: string
+ - name: message_id
+ in: path
+ required: true
+ description: The ID of the message to modify.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.MessageObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ModifyMessageRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Modify message
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message = client.beta.threads.messages.update(
+ message_id="message_id",
+ thread_id="thread_id",
+ )
+ print(message.id)
+ javascript: |-
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const message = await openai.beta.threads.messages.update(
+ "thread_abc123",
+ "msg_abc123",
+ {
+ metadata: {
+ modified: "true",
+ user: "abc123",
+ },
+ }
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const message = await client.beta.threads.messages.update('message_id', { thread_id: 'thread_id' });
+
+ console.log(message.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ message, err := client.Beta.Threads.Messages.Update(
+ context.TODO(),
+ "thread_id",
+ "message_id",
+ openai.BetaThreadMessageUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", message.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.Message;
+ import com.openai.models.beta.threads.messages.MessageUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageUpdateParams params = MessageUpdateParams.builder()
+ .threadId("thread_id")
+ .messageId("message_id")
+ .build();
+ Message message = client.beta().threads().messages().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message = openai.beta.threads.messages.update("message_id", thread_id: "thread_id")
+
+ puts(message)
+ response: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1699017614,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "file_ids": [],
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ }
+ }
+ /openai/v1/threads/{thread_id}/runs:
+ get:
+ operationId: Threads_listRuns
+ summary: List runs
+ description: Lists runs matching the request filters.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread the run belongs to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListRunsResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: List runs
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.threads.runs.list(
+ thread_id="thread_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const runs = await openai.beta.threads.runs.list(
+ "thread_abc123"
+ );
+
+ console.log(runs);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const run of client.beta.threads.runs.list('thread_id')) {
+ console.log(run.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Threads.Runs.List(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.RunListPage;
+ import com.openai.models.beta.threads.runs.RunListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunListPage page = client.beta().threads().runs().list("thread_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.threads.runs.list("thread_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699075072,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699075072,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699075073,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": [
+ "file-abc123",
+ "file-abc456"
+ ]
+ }
+ },
+ "metadata": {},
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ },
+ {
+ "id": "run_abc456",
+ "object": "thread.run",
+ "created_at": 1699063290,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699063290,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699063291,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": [
+ "file-abc123",
+ "file-abc456"
+ ]
+ }
+ },
+ "metadata": {},
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ ],
+ "first_id": "run_abc123",
+ "last_id": "run_abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: Threads_createRun
+ summary: Create a run
+ description: Creates a run from the supplied request.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to run.
+ schema:
+ type: string
+ - name: include[]
+ in: query
+ required: false
+ description: |-
+ 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
+ schema:
+ type: array
+ items:
+ type: string
+ enum:
+ - step_details.tool_calls[*].file_search.results[*].content
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateRunRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create run
+ group: threads
+ beta: true
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_abc123"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.create(
+ thread_id="thread_id",
+ assistant_id="assistant_id",
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.create(
+ "thread_abc123",
+ { assistant_id: "asst_abc123" }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunNewParams{
+ AssistantID: "assistant_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .threadId("thread_id")
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().runs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.create("thread_id", assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699063290,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "queued",
+ "started_at": 1699063290,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699063291,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "usage": null,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_123/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_123",
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.create(
+ thread_id="thread_id",
+ assistant_id="assistant_id",
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.beta.threads.runs.create(
+ "thread_123",
+ { assistant_id: "asst_123", stream: true }
+ );
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunNewParams{
+ AssistantID: "assistant_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .threadId("thread_id")
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().runs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.create("thread_id", assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710330641,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710330642,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710330642,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}}
+
+ event: thread.run.completed
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710330641,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710330642,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+ - title: Streaming with Functions
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "assistant_id": "asst_abc123",
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.create(
+ thread_id="thread_id",
+ assistant_id="assistant_id",
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ async function main() {
+ const stream = await openai.beta.threads.runs.create(
+ "thread_abc123",
+ {
+ assistant_id: "asst_abc123",
+ tools: tools,
+ stream: true
+ }
+ );
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunNewParams{
+ AssistantID: "assistant_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .threadId("thread_id")
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().runs().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.create("thread_id", assistant_id: "assistant_id")
+
+ puts(run)
+ response: |
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710348075,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}}
+
+ event: thread.run.completed
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710348075,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710348077,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+ /openai/v1/threads/{thread_id}/runs/{run_id}:
+ get:
+ operationId: Threads_getRun
+ summary: Get a run
+ description: Retrieves a run by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) that was run.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Retrieve run
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.beta.threads.runs.retrieve(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.retrieve(
+ "run_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.retrieve('run_id', { thread_id: 'thread_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.Get(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunRetrieveParams params = RunRetrieveParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ Run run = client.beta().threads().runs().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.retrieve("run_id", thread_id: "thread_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699075072,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699075072,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699075073,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ post:
+ operationId: Threads_modifyRun
+ summary: Update a run
+ description: Updates a run with the supplied changes.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) that was run.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run to modify.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ModifyRunRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Modify run
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "metadata": {
+ "user_id": "user_abc123"
+ }
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.beta.threads.runs.update(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.update(
+ "run_abc123",
+ {
+ thread_id: "thread_abc123",
+ metadata: {
+ user_id: "user_abc123",
+ },
+ }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.update('run_id', { thread_id: 'thread_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.Update(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunUpdateParams params = RunUpdateParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ Run run = client.beta().threads().runs().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.update("run_id", thread_id: "thread_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699075072,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699075072,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699075073,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": [
+ "file-abc123",
+ "file-abc456"
+ ]
+ }
+ },
+ "metadata": {
+ "user_id": "user_abc123"
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ /openai/v1/threads/{thread_id}/runs/{run_id}/cancel:
+ post:
+ operationId: Threads_cancelRun
+ summary: Cancel a run
+ description: Cancels a run by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to which this run belongs.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run to cancel.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Cancel a run
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X POST
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.beta.threads.runs.cancel(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ print(run.id)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.cancel(
+ "run_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.cancel('run_id', { thread_id: 'thread_id' });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.Cancel(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCancelParams params = RunCancelParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ Run run = client.beta().threads().runs().cancel(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.cancel("run_id", thread_id: "thread_id")
+
+ puts(run)
+ response: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699076126,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "cancelling",
+ "started_at": 1699076126,
+ "expires_at": 1699076726,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": null,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": "You summarize books.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "tool_resources": {
+ "file_search": {
+ "vector_store_ids": ["vs_123"]
+ }
+ },
+ "metadata": {},
+ "usage": null,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ /openai/v1/threads/{thread_id}/runs/{run_id}/steps:
+ get:
+ operationId: Threads_listRunSteps
+ summary: List run steps
+ description: Lists run steps matching the request filters.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread the run and run steps belong to.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run the run steps belong to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ - name: include[]
+ in: query
+ required: false
+ description: |-
+ 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
+ schema:
+ type: array
+ items:
+ type: string
+ enum:
+ - step_details.tool_calls[*].file_search.results[*].content
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListRunStepsResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: List run steps
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.threads.runs.steps.list(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const runStep = await openai.beta.threads.runs.steps.list(
+ "run_abc123",
+ { thread_id: "thread_abc123" }
+ );
+ console.log(runStep);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const runStep of client.beta.threads.runs.steps.list('run_id', {
+ thread_id: 'thread_id',
+ })) {
+ console.log(runStep.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Threads.Runs.Steps.List(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunStepListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.steps.StepListPage;
+ import com.openai.models.beta.threads.runs.steps.StepListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ StepListParams params = StepListParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ StepListPage page = client.beta().threads().runs().steps().list(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.threads.runs.steps.list("run_id", thread_id: "thread_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "step_abc123",
+ "object": "thread.run.step",
+ "created_at": 1699063291,
+ "run_id": "run_abc123",
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "type": "message_creation",
+ "status": "completed",
+ "cancelled_at": null,
+ "completed_at": 1699063291,
+ "expired_at": null,
+ "failed_at": null,
+ "last_error": null,
+ "step_details": {
+ "type": "message_creation",
+ "message_creation": {
+ "message_id": "msg_abc123"
+ }
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ }
+ }
+ ],
+ "first_id": "step_abc123",
+ "last_id": "step_abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}:
+ get:
+ operationId: Threads_getRunStep
+ summary: Get a run step
+ description: Retrieves a run step by its identifier.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the thread to which the run and run step belongs.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run to which the run step belongs.
+ schema:
+ type: string
+ - name: step_id
+ in: path
+ required: true
+ description: The ID of the run step to retrieve.
+ schema:
+ type: string
+ - name: include[]
+ in: query
+ required: false
+ description: |-
+ 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
+ schema:
+ type: array
+ items:
+ type: string
+ enum:
+ - step_details.tool_calls[*].file_search.results[*].content
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunStepObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ x-oaiMeta:
+ name: Retrieve run step
+ group: threads
+ beta: true
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run_step = client.beta.threads.runs.steps.retrieve(
+ step_id="step_id",
+ thread_id="thread_id",
+ run_id="run_id",
+ )
+ print(run_step.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const runStep = await openai.beta.threads.runs.steps.retrieve(
+ "step_abc123",
+ { thread_id: "thread_abc123", run_id: "run_abc123" }
+ );
+ console.log(runStep);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const runStep = await client.beta.threads.runs.steps.retrieve('step_id', {
+ thread_id: 'thread_id',
+ run_id: 'run_id',
+ });
+
+ console.log(runStep.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ runStep, err := client.Beta.Threads.Runs.Steps.Get(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ "step_id",
+ openai.BetaThreadRunStepGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", runStep.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.steps.RunStep;
+ import com.openai.models.beta.threads.runs.steps.StepRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ StepRetrieveParams params = StepRetrieveParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .stepId("step_id")
+ .build();
+ RunStep runStep = client.beta().threads().runs().steps().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run_step = openai.beta.threads.runs.steps.retrieve("step_id", thread_id: "thread_id", run_id: "run_id")
+
+ puts(run_step)
+ response: |
+ {
+ "id": "step_abc123",
+ "object": "thread.run.step",
+ "created_at": 1699063291,
+ "run_id": "run_abc123",
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "type": "message_creation",
+ "status": "completed",
+ "cancelled_at": null,
+ "completed_at": 1699063291,
+ "expired_at": null,
+ "failed_at": null,
+ "last_error": null,
+ "step_details": {
+ "type": "message_creation",
+ "message_creation": {
+ "message_id": "msg_abc123"
+ }
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ }
+ }
+ /openai/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs:
+ post:
+ operationId: Threads_submitToolOuputsToRun
+ summary: Create a tool ouputs to run
+ description: Creates a tool ouputs to run from the supplied request.
+ parameters:
+ - name: thread_id
+ in: path
+ required: true
+ description: The ID of the [thread](/docs/api-reference/threads) to which this run belongs.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The ID of the run that requires the tool output submission.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Threads
+ - Assistants
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.SubmitToolOutputsRunRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Submit tool outputs to run
+ group: threads
+ beta: true
+ examples:
+ - title: Default
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "tool_outputs": [
+ {
+ "tool_call_id": "call_001",
+ "output": "70 degrees and sunny."
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.submit_tool_outputs(
+ run_id="run_id",
+ thread_id="thread_id",
+ tool_outputs=[{}],
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.submitToolOutputs(
+ "run_123",
+ {
+ thread_id: "thread_123",
+ tool_outputs: [
+ {
+ tool_call_id: "call_001",
+ output: "70 degrees and sunny.",
+ },
+ ],
+ }
+ );
+
+ console.log(run);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.submitToolOutputs('run_id', {
+ thread_id: 'thread_id',
+ tool_outputs: [{}],
+ });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.SubmitToolOutputs(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunSubmitToolOutputsParams{
+ ToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())
+ .build();
+ Run run = client.beta().threads().runs().submitToolOutputs(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.submit_tool_outputs("run_id", thread_id: "thread_id", tool_outputs: [{}])
+
+ puts(run)
+ response: |
+ {
+ "id": "run_123",
+ "object": "thread.run",
+ "created_at": 1699075592,
+ "assistant_id": "asst_123",
+ "thread_id": "thread_123",
+ "status": "queued",
+ "started_at": 1699075592,
+ "expires_at": 1699076192,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": null,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "metadata": {},
+ "usage": null,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ - title: Streaming
+ request:
+ curl: |
+ curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "tool_outputs": [
+ {
+ "tool_call_id": "call_001",
+ "output": "70 degrees and sunny."
+ }
+ ],
+ "stream": true
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.submit_tool_outputs(
+ run_id="run_id",
+ thread_id="thread_id",
+ tool_outputs=[{}],
+ ):
+ print(run)
+ javascript: |
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.beta.threads.runs.submitToolOutputs(
+ "run_123",
+ {
+ thread_id: "thread_123",
+ tool_outputs: [
+ {
+ tool_call_id: "call_001",
+ output: "70 degrees and sunny.",
+ },
+ ],
+ }
+ );
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.submitToolOutputs('run_id', {
+ thread_id: 'thread_id',
+ tool_outputs: [{}],
+ });
+
+ console.log(run.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.SubmitToolOutputs(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunSubmitToolOutputsParams{
+ ToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())
+ .build();
+ Run run = client.beta().threads().runs().submitToolOutputs(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.submit_tool_outputs("run_id", thread_id: "thread_id", tool_outputs: [{}])
+
+ puts(run)
+ response: |
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710352449,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"completed","cancelled_at":null,"completed_at":1710352475,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[{"id":"call_iWr0kQ2EaYMaxNdl0v3KYkx7","type":"function","function":{"name":"get_current_weather","arguments":"{"location":"San Francisco, CA","unit":"fahrenheit"}","output":"70 degrees and sunny."}}]},"usage":{"prompt_tokens":291,"completion_tokens":24,"total_tokens":315}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":1710352448,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710352475,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"The","annotations":[]}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" current"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" weather"}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" sunny"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"."}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710352477,"role":"assistant","content":[{"type":"text","text":{"value":"The current weather in San Francisco, CA is 70 degrees Fahrenheit and sunny.","annotations":[]}}],"metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710352477,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":{"prompt_tokens":329,"completion_tokens":18,"total_tokens":347}}
+
+ event: thread.run.completed
+ data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710352475,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710352477,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+ /openai/v1/uploads:
+ post:
+ operationId: Uploads_createUpload
+ summary: Create an upload
+ description: Creates an upload from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Upload'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Uploads
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateUploadRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create upload
+ group: uploads
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/uploads \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -d '{
+ "purpose": "fine-tune",
+ "filename": "training_examples.jsonl",
+ "bytes": 2147483648,
+ "mime_type": "text/jsonl",
+ "expires_after": {
+ "anchor": "created_at",
+ "seconds": 3600
+ }
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const upload = await client.uploads.create({
+ bytes: 0,
+ filename: 'filename',
+ mime_type: 'mime_type',
+ purpose: 'assistants',
+ });
+
+ console.log(upload.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload = client.uploads.create(
+ bytes=0,
+ filename="filename",
+ mime_type="mime_type",
+ purpose="assistants",
+ )
+ print(upload.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ upload, err := client.Uploads.New(context.TODO(), openai.UploadNewParams{
+ Bytes: 0,
+ Filename: "filename",
+ MimeType: "mime_type",
+ Purpose: openai.FilePurposeAssistants,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", upload.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FilePurpose;
+ import com.openai.models.uploads.Upload;
+ import com.openai.models.uploads.UploadCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ UploadCreateParams params = UploadCreateParams.builder()
+ .bytes(0L)
+ .filename("filename")
+ .mimeType("mime_type")
+ .purpose(FilePurpose.ASSISTANTS)
+ .build();
+ Upload upload = client.uploads().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload = openai.uploads.create(bytes: 0, filename: "filename", mime_type: "mime_type", purpose: :assistants)
+
+ puts(upload)
+ response: |
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "pending",
+ "expires_at": 1719127296
+ }
+ /openai/v1/uploads/{upload_id}/cancel:
+ post:
+ operationId: Uploads_cancelUpload
+ summary: Cancel an upload
+ description: Cancels an upload by its identifier.
+ parameters:
+ - name: upload_id
+ in: path
+ required: true
+ description: The ID of the Upload.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Upload'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Uploads
+ x-oaiMeta:
+ name: Cancel upload
+ group: uploads
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/uploads/upload_abc123/cancel
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const upload = await client.uploads.cancel('upload_abc123');
+
+ console.log(upload.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload = client.uploads.cancel(
+ "upload_abc123",
+ )
+ print(upload.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ upload, err := client.Uploads.Cancel(context.TODO(), "upload_abc123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", upload.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.uploads.Upload;
+ import com.openai.models.uploads.UploadCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Upload upload = client.uploads().cancel("upload_abc123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload = openai.uploads.cancel("upload_abc123")
+
+ puts(upload)
+ response: |
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "cancelled",
+ "expires_at": 1719127296
+ }
+ /openai/v1/uploads/{upload_id}/complete:
+ post:
+ operationId: Uploads_completeUpload
+ summary: Create an upload
+ description: Creates an upload from the supplied request.
+ parameters:
+ - name: upload_id
+ in: path
+ required: true
+ description: The ID of the Upload.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.Upload'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Uploads
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CompleteUploadRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Complete upload
+ group: uploads
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/uploads/upload_abc123/complete
+ -d '{
+ "part_ids": ["part_def456", "part_ghi789"]
+ }'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const upload = await client.uploads.complete('upload_abc123', { part_ids: ['string'] });
+
+ console.log(upload.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload = client.uploads.complete(
+ upload_id="upload_abc123",
+ part_ids=["string"],
+ )
+ print(upload.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ upload, err := client.Uploads.Complete(
+ context.TODO(),
+ "upload_abc123",
+ openai.UploadCompleteParams{
+ PartIDs: []string{"string"},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", upload.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.uploads.Upload;
+ import com.openai.models.uploads.UploadCompleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ UploadCompleteParams params = UploadCompleteParams.builder()
+ .uploadId("upload_abc123")
+ .addPartId("string")
+ .build();
+ Upload upload = client.uploads().complete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload = openai.uploads.complete("upload_abc123", part_ids: ["string"])
+
+ puts(upload)
+ response: |
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "completed",
+ "expires_at": 1719127296,
+ "file": {
+ "id": "file-xyz321",
+ "object": "file",
+ "bytes": 2147483648,
+ "created_at": 1719186911,
+ "expires_at": 1719127296,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ }
+ }
+ /openai/v1/uploads/{upload_id}/parts:
+ post:
+ operationId: Uploads_addUploadPart
+ summary: Add an upload part
+ description: Adds an upload part to the parent resource.
+ parameters:
+ - name: upload_id
+ in: path
+ required: true
+ description: The ID of the Upload.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.UploadPart'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Uploads
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.AddUploadPartRequest'
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Add upload part
+ group: uploads
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/uploads/upload_abc123/parts
+ -F data="aHR0cHM6Ly9hcGkub3BlbmFpLmNvbS92MS91cGxvYWRz..."
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const uploadPart = await client.uploads.parts.create('upload_abc123', {
+ data: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(uploadPart.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload_part = client.uploads.parts.create(
+ upload_id="upload_abc123",
+ data=b"Example data",
+ )
+ print(upload_part.id)
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ uploadPart, err := client.Uploads.Parts.New(
+ context.TODO(),
+ "upload_abc123",
+ openai.UploadPartNewParams{
+ Data: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", uploadPart.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.uploads.parts.PartCreateParams;
+ import com.openai.models.uploads.parts.UploadPart;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PartCreateParams params = PartCreateParams.builder()
+ .uploadId("upload_abc123")
+ .data(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ UploadPart uploadPart = client.uploads().parts().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload_part = openai.uploads.parts.create("upload_abc123", data: StringIO.new("Example data"))
+
+ puts(upload_part)
+ response: |
+ {
+ "id": "part_def456",
+ "object": "upload.part",
+ "created_at": 1719185911,
+ "upload_id": "upload_abc123"
+ }
+ /openai/v1/vector_stores:
+ get:
+ operationId: VectorStores_listVectorStores
+ summary: List vector stores
+ description: Lists vector stores matching the request filters.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoresResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: List vector stores
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.list()
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStores = await openai.vectorStores.list();
+ console.log(vectorStores);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStore of client.vectorStores.list()) {
+ console.log(vectorStore.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.List(context.TODO(), openai.VectorStoreListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStoreListPage;
+ import com.openai.models.vectorstores.VectorStoreListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreListPage page = client.vectorStores().list();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.list
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ",
+ "description": "Contains commonly asked questions and answers, organized by topic.",
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ },
+ {
+ "id": "vs_abc456",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ v2",
+ "description": null,
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ }
+ ],
+ "first_id": "vs_abc123",
+ "last_id": "vs_abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: VectorStores_createVectorStore
+ summary: Create a vector store
+ description: Creates a vector store from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVectorStoreRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "name": "Support FAQ"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store = client.vector_stores.create()
+ print(vector_store.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStore = await openai.vectorStores.create({
+ name: "Support FAQ"
+ });
+ console.log(vectorStore);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStore = await client.vectorStores.create();
+
+ console.log(vectorStore.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStore, err := client.VectorStores.New(context.TODO(), openai.VectorStoreNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStore.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStore;
+ import com.openai.models.vectorstores.VectorStoreCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStore vectorStore = client.vectorStores().create();
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store = openai.vector_stores.create
+
+ puts(vector_store)
+ response: |
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ",
+ "description": "Contains commonly asked questions and answers, organized by topic.",
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}:
+ delete:
+ operationId: VectorStores_deleteVectorStore
+ summary: Delete a vector store
+ description: Deletes a vector store by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteVectorStoreResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Delete vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X DELETE
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_deleted = client.vector_stores.delete(
+ "vector_store_id",
+ )
+ print(vector_store_deleted.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedVectorStore = await openai.vectorStores.delete(
+ "vs_abc123"
+ );
+ console.log(deletedVectorStore);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreDeleted = await client.vectorStores.delete('vector_store_id');
+
+ console.log(vectorStoreDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreDeleted, err := client.VectorStores.Delete(context.TODO(), "vector_store_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStoreDeleteParams;
+ import com.openai.models.vectorstores.VectorStoreDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreDeleted vectorStoreDeleted = client.vectorStores().delete("vector_store_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_deleted = openai.vector_stores.delete("vector_store_id")
+
+ puts(vector_store_deleted)
+ response: |
+ {
+ id: "vs_abc123",
+ object: "vector_store.deleted",
+ deleted: true
+ }
+ get:
+ operationId: VectorStores_getVectorStore
+ summary: Get a vector store
+ description: Retrieves a vector store by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Retrieve vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store = client.vector_stores.retrieve(
+ "vector_store_id",
+ )
+ print(vector_store.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStore = await openai.vectorStores.retrieve(
+ "vs_abc123"
+ );
+ console.log(vectorStore);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStore = await client.vectorStores.retrieve('vector_store_id');
+
+ console.log(vectorStore.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStore, err := client.VectorStores.Get(context.TODO(), "vector_store_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStore.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStore;
+ import com.openai.models.vectorstores.VectorStoreRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStore vectorStore = client.vectorStores().retrieve("vector_store_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store = openai.vector_stores.retrieve("vector_store_id")
+
+ puts(vector_store)
+ response: |
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776
+ }
+ post:
+ operationId: VectorStores_modifyVectorStore
+ summary: Update a vector store
+ description: Updates a vector store with the supplied changes.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store to modify.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.UpdateVectorStoreRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Modify vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ -d '{
+ "name": "Support FAQ"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store = client.vector_stores.update(
+ vector_store_id="vector_store_id",
+ )
+ print(vector_store.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStore = await openai.vectorStores.update(
+ "vs_abc123",
+ {
+ name: "Support FAQ"
+ }
+ );
+ console.log(vectorStore);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStore = await client.vectorStores.update('vector_store_id');
+
+ console.log(vectorStore.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStore, err := client.VectorStores.Update(
+ context.TODO(),
+ "vector_store_id",
+ openai.VectorStoreUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStore.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStore;
+ import com.openai.models.vectorstores.VectorStoreUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStore vectorStore = client.vectorStores().update("vector_store_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store = openai.vector_stores.update("vector_store_id")
+
+ puts(vector_store)
+ response: |
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ",
+ "description": "Contains commonly asked questions and answers, organized by topic.",
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}/file_batches:
+ post:
+ operationId: VectorStores_createVectorStoreFileBatch
+ summary: Create a vector store file batch
+ description: Creates a vector store file batch from the supplied request.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store for which to create a File Batch.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileBatchRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create vector store file batch
+ group: vector_stores
+ description: |
+ Attaches multiple files to a vector store in one request. This is the recommended approach for multi-file ingestion, especially because per-vector-store file attach writes are rate-limited (300 requests/minute shared with `/vector_stores/{vector_store_id}/files`).
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "files": [
+ {
+ "file_id": "file-abc123",
+ "attributes": {"category": "finance"}
+ },
+ {
+ "file_id": "file-abc456",
+ "chunking_strategy": {
+ "type": "static",
+ "max_chunk_size_tokens": 1200,
+ "chunk_overlap_tokens": 200
+ }
+ }
+ ]
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_batch = client.vector_stores.file_batches.create(
+ vector_store_id="vs_abc123",
+ )
+ print(vector_store_file_batch.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const myVectorStoreFileBatch = await openai.vectorStores.fileBatches.create(
+ "vs_abc123",
+ {
+ files: [
+ {
+ file_id: "file-abc123",
+ attributes: { category: "finance" },
+ },
+ {
+ file_id: "file-abc456",
+ chunking_strategy: {
+ type: "static",
+ max_chunk_size_tokens: 1200,
+ chunk_overlap_tokens: 200,
+ },
+ },
+ ]
+ }
+ );
+ console.log(myVectorStoreFileBatch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileBatch = await client.vectorStores.fileBatches.create('vs_abc123');
+
+ console.log(vectorStoreFileBatch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileBatch, err := client.VectorStores.FileBatches.New(
+ context.TODO(),
+ "vs_abc123",
+ openai.VectorStoreFileBatchNewParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileBatch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchCreateParams;
+ import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().create("vs_abc123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_batch = openai.vector_stores.file_batches.create("vs_abc123")
+
+ puts(vector_store_file_batch)
+ response: |
+ {
+ "id": "vsfb_abc123",
+ "object": "vector_store.file_batch",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123",
+ "status": "in_progress",
+ "file_counts": {
+ "in_progress": 1,
+ "completed": 1,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 0,
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}:
+ get:
+ operationId: VectorStores_getVectorStoreFileBatch
+ summary: Get a vector store file batch
+ description: Retrieves a vector store file batch by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the file batch belongs to.
+ schema:
+ type: string
+ - name: batch_id
+ in: path
+ required: true
+ description: The ID of the file batch being retrieved.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Retrieve vector store file batch
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches/vsfb_abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_batch = client.vector_stores.file_batches.retrieve(
+ batch_id="vsfb_abc123",
+ vector_store_id="vs_abc123",
+ )
+ print(vector_store_file_batch.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFileBatch = await openai.vectorStores.fileBatches.retrieve(
+ "vsfb_abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(vectorStoreFileBatch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileBatch = await client.vectorStores.fileBatches.retrieve('vsfb_abc123', {
+ vector_store_id: 'vs_abc123',
+ });
+
+ console.log(vectorStoreFileBatch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileBatch, err := client.VectorStores.FileBatches.Get(
+ context.TODO(),
+ "vs_abc123",
+ "vsfb_abc123",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileBatch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchRetrieveParams;
+ import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileBatchRetrieveParams params = FileBatchRetrieveParams.builder()
+ .vectorStoreId("vs_abc123")
+ .batchId("vsfb_abc123")
+ .build();
+ VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_batch = openai.vector_stores.file_batches.retrieve("vsfb_abc123", vector_store_id: "vs_abc123")
+
+ puts(vector_store_file_batch)
+ response: |
+ {
+ "id": "vsfb_abc123",
+ "object": "vector_store.file_batch",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123",
+ "status": "in_progress",
+ "file_counts": {
+ "in_progress": 1,
+ "completed": 1,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 0,
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel:
+ post:
+ operationId: VectorStores_cancelVectorStoreFileBatch
+ summary: Cancel a vector store file batch
+ description: Cancels a vector store file batch by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the file batch belongs to.
+ schema:
+ type: string
+ - name: batch_id
+ in: path
+ required: true
+ description: The ID of the file batch to cancel.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Cancel vector store file batch
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/cancel \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X POST
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_batch = client.vector_stores.file_batches.cancel(
+ batch_id="batch_id",
+ vector_store_id="vector_store_id",
+ )
+ print(vector_store_file_batch.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedVectorStoreFileBatch = await openai.vectorStores.fileBatches.cancel(
+ "vsfb_abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(deletedVectorStoreFileBatch);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileBatch = await client.vectorStores.fileBatches.cancel('batch_id', {
+ vector_store_id: 'vector_store_id',
+ });
+
+ console.log(vectorStoreFileBatch.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileBatch, err := client.VectorStores.FileBatches.Cancel(
+ context.TODO(),
+ "vector_store_id",
+ "batch_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileBatch.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchCancelParams;
+ import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileBatchCancelParams params = FileBatchCancelParams.builder()
+ .vectorStoreId("vector_store_id")
+ .batchId("batch_id")
+ .build();
+ VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().cancel(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_batch = openai.vector_stores.file_batches.cancel("batch_id", vector_store_id: "vector_store_id")
+
+ puts(vector_store_file_batch)
+ response: |
+ {
+ "id": "vsfb_abc123",
+ "object": "vector_store.file_batch",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123",
+ "status": "in_progress",
+ "file_counts": {
+ "in_progress": 12,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 15,
+ }
+ }
+ /openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files:
+ get:
+ operationId: VectorStores_listFilesInVectorStoreBatch
+ summary: List files in vector store batch
+ description: Lists files in vector store batch matching the request filters.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the files belong to.
+ schema:
+ type: string
+ - name: batch_id
+ in: path
+ required: true
+ description: The ID of the file batch that the files belong to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ - name: filter
+ in: query
+ required: false
+ description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesFilter'
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: List vector store files in a batch
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.file_batches.list_files(
+ batch_id="batch_id",
+ vector_store_id="vector_store_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFiles = await openai.vectorStores.fileBatches.listFiles(
+ "vsfb_abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(vectorStoreFiles);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStoreFile of client.vectorStores.fileBatches.listFiles('batch_id', {
+ vector_store_id: 'vector_store_id',
+ })) {
+ console.log(vectorStoreFile.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.FileBatches.ListFiles(
+ context.TODO(),
+ "vector_store_id",
+ "batch_id",
+ openai.VectorStoreFileBatchListFilesParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchListFilesPage;
+ import com.openai.models.vectorstores.filebatches.FileBatchListFilesParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileBatchListFilesParams params = FileBatchListFilesParams.builder()
+ .vectorStoreId("vector_store_id")
+ .batchId("batch_id")
+ .build();
+ FileBatchListFilesPage page = client.vectorStores().fileBatches().listFiles(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.file_batches.list_files("batch_id", vector_store_id: "vector_store_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ },
+ {
+ "id": "file-abc456",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ }
+ ],
+ "first_id": "file-abc123",
+ "last_id": "file-abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ /openai/v1/vector_stores/{vector_store_id}/files:
+ get:
+ operationId: VectorStores_listVectorStoreFiles
+ summary: List vector store files
+ description: Lists vector store files matching the request filters.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the files belong to.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
+ schema:
+ $ref: '#/components/schemas/integer'
+ default: 20
+ - name: order
+ in: query
+ required: false
+ description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ default: desc
+ - name: after
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ - name: before
+ in: query
+ required: false
+ description: 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.
+ schema:
+ type: string
+ - name: filter
+ in: query
+ required: false
+ description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesFilter'
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: List vector store files
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.files.list(
+ vector_store_id="vector_store_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFiles = await openai.vectorStores.files.list(
+ "vs_abc123"
+ );
+ console.log(vectorStoreFiles);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStoreFile of client.vectorStores.files.list('vector_store_id')) {
+ console.log(vectorStoreFile.id);
+ }
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.Files.List(
+ context.TODO(),
+ "vector_store_id",
+ openai.VectorStoreFileListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileListPage;
+ import com.openai.models.vectorstores.files.FileListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileListPage page = client.vectorStores().files().list("vector_store_id");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.files.list("vector_store_id")
+
+ puts(page)
+ response: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ },
+ {
+ "id": "file-abc456",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ }
+ ],
+ "first_id": "file-abc123",
+ "last_id": "file-abc456",
+ "has_more": false
+ }
+ x-ms-list: true
+ post:
+ operationId: VectorStores_createVectorStoreFile
+ summary: Create a vector store file
+ description: Creates a vector store file from the supplied request.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store for which to create a File.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Create vector store file
+ group: vector_stores
+ description: |
+ Attaches one file to a vector store. File attach writes are rate-limited per vector store (300 requests/minute shared with `/vector_stores/{vector_store_id}/file_batches`), so use file batches when uploading multiple files.
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -d '{
+ "file_id": "file-abc123"
+ }'
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file = client.vector_stores.files.create(
+ vector_store_id="vs_abc123",
+ file_id="file_id",
+ )
+ print(vector_store_file.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const myVectorStoreFile = await openai.vectorStores.files.create(
+ "vs_abc123",
+ {
+ file_id: "file-abc123"
+ }
+ );
+ console.log(myVectorStoreFile);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFile = await client.vectorStores.files.create('vs_abc123', { file_id: 'file_id' });
+
+ console.log(vectorStoreFile.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFile, err := client.VectorStores.Files.New(
+ context.TODO(),
+ "vs_abc123",
+ openai.VectorStoreFileNewParams{
+ FileID: "file_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFile.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileCreateParams;
+ import com.openai.models.vectorstores.files.VectorStoreFile;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateParams params = FileCreateParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file_id")
+ .build();
+ VectorStoreFile vectorStoreFile = client.vectorStores().files().create(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file = openai.vector_stores.files.create("vs_abc123", file_id: "file_id")
+
+ puts(vector_store_file)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "usage_bytes": 1234,
+ "vector_store_id": "vs_abcd",
+ "status": "completed",
+ "last_error": null
+ }
+ /openai/v1/vector_stores/{vector_store_id}/files/{file_id}:
+ delete:
+ operationId: VectorStores_deleteVectorStoreFile
+ summary: Delete a vector store file
+ description: Deletes a vector store file by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the file belongs to.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeleteVectorStoreFileResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Delete vector store file
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2" \
+ -X DELETE
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_deleted = client.vector_stores.files.delete(
+ file_id="file_id",
+ vector_store_id="vector_store_id",
+ )
+ print(vector_store_file_deleted.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedVectorStoreFile = await openai.vectorStores.files.delete(
+ "file-abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(deletedVectorStoreFile);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileDeleted = await client.vectorStores.files.delete('file_id', {
+ vector_store_id: 'vector_store_id',
+ });
+
+ console.log(vectorStoreFileDeleted.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileDeleted, err := client.VectorStores.Files.Delete(
+ context.TODO(),
+ "vector_store_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileDeleted.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileDeleteParams;
+ import com.openai.models.vectorstores.files.VectorStoreFileDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileDeleteParams params = FileDeleteParams.builder()
+ .vectorStoreId("vector_store_id")
+ .fileId("file_id")
+ .build();
+ VectorStoreFileDeleted vectorStoreFileDeleted = client.vectorStores().files().delete(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_deleted = openai.vector_stores.files.delete("file_id", vector_store_id: "vector_store_id")
+
+ puts(vector_store_file_deleted)
+ response: |
+ {
+ id: "file-abc123",
+ object: "vector_store.file.deleted",
+ deleted: true
+ }
+ get:
+ operationId: VectorStores_getVectorStoreFile
+ summary: Get a vector store file
+ description: Retrieves a vector store file by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store that the file belongs to.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file being retrieved.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Retrieve vector store file
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -H "OpenAI-Beta: assistants=v2"
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file = client.vector_stores.files.retrieve(
+ file_id="file-abc123",
+ vector_store_id="vs_abc123",
+ )
+ print(vector_store_file.id)
+ javascript: |
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFile = await openai.vectorStores.files.retrieve(
+ "file-abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(vectorStoreFile);
+ }
+
+ main();
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFile = await client.vectorStores.files.retrieve('file-abc123', {
+ vector_store_id: 'vs_abc123',
+ });
+
+ console.log(vectorStoreFile.id);
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFile, err := client.VectorStores.Files.Get(
+ context.TODO(),
+ "vs_abc123",
+ "file-abc123",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFile.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileRetrieveParams;
+ import com.openai.models.vectorstores.files.VectorStoreFile;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileRetrieveParams params = FileRetrieveParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file-abc123")
+ .build();
+ VectorStoreFile vectorStoreFile = client.vectorStores().files().retrieve(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file = openai.vector_stores.files.retrieve("file-abc123", vector_store_id: "vs_abc123")
+
+ puts(vector_store_file)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abcd",
+ "status": "completed",
+ "last_error": null
+ }
+ post:
+ operationId: VectorStores_updateVectorStoreFileAttributes
+ summary: Update vector store file attributes
+ description: Updates vector store file attributes with the supplied changes.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store the file belongs to.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file to update attributes.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.UpdateVectorStoreFileAttributesRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Update vector store file attributes
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id} \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"attributes": {"key1": "value1", "key2": 2}}'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFile = await client.vectorStores.files.update('file-abc123', {
+ vector_store_id: 'vs_abc123',
+ attributes: { foo: 'string' },
+ });
+
+ console.log(vectorStoreFile.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file = client.vector_stores.files.update(
+ file_id="file-abc123",
+ vector_store_id="vs_abc123",
+ attributes={
+ "foo": "string"
+ },
+ )
+ print(vector_store_file.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFile, err := client.VectorStores.Files.Update(
+ context.TODO(),
+ "vs_abc123",
+ "file-abc123",
+ openai.VectorStoreFileUpdateParams{
+ Attributes: map[string]openai.VectorStoreFileUpdateParamsAttributeUnion{
+ "foo": {
+ OfString: openai.String("string"),
+ },
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFile.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.vectorstores.files.FileUpdateParams;
+ import com.openai.models.vectorstores.files.VectorStoreFile;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileUpdateParams params = FileUpdateParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file-abc123")
+ .attributes(FileUpdateParams.Attributes.builder()
+ .putAdditionalProperty("foo", JsonValue.from("string"))
+ .build())
+ .build();
+ VectorStoreFile vectorStoreFile = client.vectorStores().files().update(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file = openai.vector_stores.files.update(
+ "file-abc123",
+ vector_store_id: "vs_abc123",
+ attributes: {foo: "string"}
+ )
+
+ puts(vector_store_file)
+ response: |
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "usage_bytes": 1234,
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abcd",
+ "status": "completed",
+ "last_error": null,
+ "chunking_strategy": {...},
+ "attributes": {"key1": "value1", "key2": 2}
+ }
+ /openai/v1/vector_stores/{vector_store_id}/files/{file_id}/content:
+ get:
+ operationId: VectorStores_retrieveVectorStoreFileContent
+ summary: Get a vector store file content
+ description: Retrieves a vector store file content by its identifier.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store.
+ schema:
+ type: string
+ - name: file_id
+ in: path
+ required: true
+ description: The ID of the file within the vector store.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileContentResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ x-oaiMeta:
+ name: Retrieve vector store file content
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl \
+ https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123/content \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fileContentResponse of client.vectorStores.files.content('file-abc123', {
+ vector_store_id: 'vs_abc123',
+ })) {
+ console.log(fileContentResponse.text);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.files.content(
+ file_id="file-abc123",
+ vector_store_id="vs_abc123",
+ )
+ page = page.data[0]
+ print(page.text)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.Files.Content(
+ context.TODO(),
+ "vs_abc123",
+ "file-abc123",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileContentPage;
+ import com.openai.models.vectorstores.files.FileContentParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileContentParams params = FileContentParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file-abc123")
+ .build();
+ FileContentPage page = client.vectorStores().files().content(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.files.content("file-abc123", vector_store_id: "vs_abc123")
+
+ puts(page)
+ response: |
+ {
+ "file_id": "file-abc123",
+ "filename": "example.txt",
+ "attributes": {"key": "value"},
+ "content": [
+ {"type": "text", "text": "..."},
+ ...
+ ]
+ }
+ /openai/v1/vector_stores/{vector_store_id}/search:
+ post:
+ operationId: VectorStores_searchVectorStore
+ summary: Search a vector store
+ description: Searchs a vector store.
+ parameters:
+ - name: vector_store_id
+ in: path
+ required: true
+ description: The ID of the vector store to search.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultsPage'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Vector stores
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchRequest'
+ description: The request body.
+ x-oaiMeta:
+ name: Search vector store
+ group: vector_stores
+ examples:
+ request:
+ curl: |
+ curl -X POST \
+ https://api.openai.com/v1/vector_stores/vs_abc123/search \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{"query": "What is the return policy?", "filters": {...}}'
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStoreSearchResponse of client.vectorStores.search('vs_abc123', {
+ query: 'string',
+ })) {
+ console.log(vectorStoreSearchResponse.file_id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.search(
+ vector_store_id="vs_abc123",
+ query="string",
+ )
+ page = page.data[0]
+ print(page.file_id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.Search(
+ context.TODO(),
+ "vs_abc123",
+ openai.VectorStoreSearchParams{
+ Query: openai.VectorStoreSearchParamsQueryUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStoreSearchPage;
+ import com.openai.models.vectorstores.VectorStoreSearchParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreSearchParams params = VectorStoreSearchParams.builder()
+ .vectorStoreId("vs_abc123")
+ .query("string")
+ .build();
+ VectorStoreSearchPage page = client.vectorStores().search(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.search("vs_abc123", query: "string")
+
+ puts(page)
+ response: |
+ {
+ "object": "vector_store.search_results.page",
+ "search_query": "What is the return policy?",
+ "data": [
+ {
+ "file_id": "file_123",
+ "filename": "document.pdf",
+ "score": 0.95,
+ "attributes": {
+ "author": "John Doe",
+ "date": "2023-01-01"
+ },
+ "content": [
+ {
+ "type": "text",
+ "text": "Relevant chunk"
+ }
+ ]
+ },
+ {
+ "file_id": "file_456",
+ "filename": "notes.txt",
+ "score": 0.89,
+ "attributes": {
+ "author": "Jane Smith",
+ "date": "2023-01-02"
+ },
+ "content": [
+ {
+ "type": "text",
+ "text": "Sample text content from the vector store."
+ }
+ ]
+ }
+ ],
+ "has_more": false,
+ "next_page": null
+ }
+ /openai/v1/videos:
+ get:
+ operationId: VideoGeneration_listVideos
+ summary: List videos
+ description: Lists videos matching the request filters.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: Number of items to retrieve
+ schema:
+ $ref: '#/components/schemas/integer'
+ minimum: 0
+ maximum: 100
+ - name: order
+ in: query
+ required: false
+ description: Sort order of results by timestamp. Use `asc` for ascending order or `desc` for descending order.
+ schema:
+ $ref: '#/components/schemas/OpenAI.OrderEnum'
+ - name: after
+ in: query
+ required: false
+ description: Identifier for the last item from the previous pagination request
+ schema:
+ type: string
+ x-ms-list-continuation-token: true
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoListResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ name: List videos
+ group: videos
+ path: list for the organization.
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/videos \
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ javascript: |
+ import OpenAI from 'openai';
+
+ const openai = new OpenAI();
+
+ // Automatically fetches more pages as needed.
+ for await (const video of openai.videos.list()) {
+ console.log(video.id);
+ }
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.videos.list()
+ page = page.data[0]
+ print(page.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Videos.List(context.TODO(), openai.VideoListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.videos.list
+
+ puts(page)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoListPage;
+ import com.openai.models.videos.VideoListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoListPage page = client.videos().list();
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const video of client.videos.list()) {
+ console.log(video.id);
+ }
+ response: |
+ {
+ "data": [
+ {
+ "id": "video_123",
+ "object": "video",
+ "model": "sora-2",
+ "status": "completed"
+ }
+ ],
+ "object": "list"
+ }
+ x-ms-list: true
+ post:
+ operationId: VideoGeneration_createVideo
+ summary: Create a video
+ description: Creates a video from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoMultipartBody'
+ encoding:
+ model:
+ contentType: text/plain
+ input_reference:
+ contentType: application/octet-stream, application/json
+ seconds:
+ contentType: application/json
+ size:
+ contentType: application/json
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Create video
+ group: videos
+ path: create
+ examples:
+ request:
+ curl: |
+ curl https://api.openai.com/v1/videos \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -F "model=sora-2" \
+ -F "prompt=A calico cat playing a piano on stage"
+ javascript: |
+ import OpenAI from 'openai';
+
+ const openai = new OpenAI();
+
+ const video = await openai.videos.create({ prompt: 'A calico cat playing a piano on stage' });
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.create(
+ prompt="x",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.New(context.TODO(), openai.VideoNewParams{
+ Prompt: "x",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.create(prompt: "x")
+
+ puts(video)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoCreateParams params = VideoCreateParams.builder()
+ .prompt("x")
+ .build();
+ Video video = client.videos().create(params);
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.create({ prompt: 'x' });
+
+ console.log(video.id);
+ response: |
+ {
+ "id": "video_123",
+ "object": "video",
+ "model": "sora-2",
+ "status": "queued",
+ "progress": 0,
+ "created_at": 1712697600,
+ "size": "1024x1792",
+ "seconds": "8",
+ "quality": "standard"
+ }
+ /openai/v1/videos/characters:
+ post:
+ operationId: VideoGeneration_createVideoCharacter
+ summary: Create a video character
+ description: Creates a video character from the supplied request.
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoCharacterResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoCharacterBody'
+ description: The multipart request body.
+ x-oaiMeta:
+ examples:
+ response: ''
+ request:
+ node.js: |-
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.videos.createCharacter({
+ name: 'x',
+ video: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(response.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.videos.create_character(
+ name="x",
+ video=b"Example data",
+ )
+ print(response.id)
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Videos.NewCharacter(context.TODO(), openai.VideoNewCharacterParams{
+ Name: "x",
+ Video: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoCreateCharacterParams;
+ import com.openai.models.videos.VideoCreateCharacterResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoCreateCharacterParams params = VideoCreateCharacterParams.builder()
+ .name("x")
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ VideoCreateCharacterResponse response = client.videos().createCharacter(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.videos.create_character(name: "x", video: StringIO.new("Example data"))
+
+ puts(response)
+ /openai/v1/videos/characters/{character_id}:
+ get:
+ operationId: VideoGeneration_getVideoCharacter
+ summary: Get a video character
+ description: Retrieves a video character by its identifier.
+ parameters:
+ - name: character_id
+ in: path
+ required: true
+ description: The identifier of the character to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoCharacterResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ examples:
+ response: ''
+ request:
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.videos.getCharacter('char_123');
+
+ console.log(response.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.videos.get_character(
+ "char_123",
+ )
+ print(response.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Videos.GetCharacter(context.TODO(), "char_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoGetCharacterParams;
+ import com.openai.models.videos.VideoGetCharacterResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoGetCharacterResponse response = client.videos().getCharacter("char_123");
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.videos.get_character("char_123")
+
+ puts(response)
+ /openai/v1/videos/edits:
+ post:
+ operationId: VideoGeneration_createVideoEditMultipart_VideoGeneration_createVideoEditJson
+ parameters: []
+ description: Creates a video edit from the supplied request. Creates a video edit from the supplied request.
+ summary: Create a video edit Create a video edit
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ x-ms-request-body-description-override: The request body.
+ x-ms-description-override: Creates a video edit from the supplied request.
+ x-ms-summary-override: Create a video edit
+ x-oaiMeta:
+ examples:
+ response: ''
+ request:
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.edit({ prompt: 'x', video: fs.createReadStream('path/to/file') });
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.edit(
+ prompt="x",
+ video=b"Example data",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Edit(context.TODO(), openai.VideoEditParams{
+ Prompt: "x",
+ Video: openai.VideoEditParamsVideoUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoEditParams;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoEditParams params = VideoEditParams.builder()
+ .prompt("x")
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ Video video = client.videos().edit(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.edit(prompt: "x", video: StringIO.new("Example data"))
+
+ puts(video)
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoEditMultipartBody'
+ encoding:
+ video:
+ contentType: application/octet-stream, application/json
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoEditJsonBody'
+ description: The multipart request body. The request body.
+ /openai/v1/videos/extensions:
+ post:
+ operationId: VideoGeneration_createVideoExtendMultipart_VideoGeneration_createVideoExtendJson
+ parameters: []
+ description: Extends a video from the supplied request. Extends a video from the supplied request.
+ summary: Extend a video Extend a video
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ x-ms-request-body-description-override: The request body.
+ x-ms-description-override: Extends a video from the supplied request.
+ x-ms-summary-override: Extend a video
+ x-oaiMeta:
+ examples:
+ response: ''
+ request:
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.extend({
+ prompt: 'x',
+ seconds: '4',
+ video: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.extend(
+ prompt="x",
+ seconds="4",
+ video=b"Example data",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Extend(context.TODO(), openai.VideoExtendParams{
+ Prompt: "x",
+ Seconds: openai.VideoSeconds4,
+ Video: openai.VideoExtendParamsVideoUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoExtendParams;
+ import com.openai.models.videos.VideoSeconds;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoExtendParams params = VideoExtendParams.builder()
+ .prompt("x")
+ .seconds(VideoSeconds._4)
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ Video video = client.videos().extend(params);
+ }
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.extend_(prompt: "x", seconds: :"4", video: StringIO.new("Example data"))
+
+ puts(video)
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoExtendMultipartBody'
+ encoding:
+ video:
+ contentType: application/json, application/octet-stream
+ seconds:
+ contentType: application/json
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoExtendJsonBody'
+ description: The multipart request body. The request body.
+ /openai/v1/videos/{video_id}:
+ delete:
+ operationId: VideoGeneration_deleteVideo
+ summary: Delete a video
+ description: Deletes a video by its identifier.
+ parameters:
+ - name: video_id
+ in: path
+ required: true
+ description: The identifier of the video to delete.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.DeletedVideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ name: Delete video
+ group: videos
+ path: delete
+ examples:
+ response: ''
+ request:
+ javascript: |
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const video = await client.videos.delete('video_123');
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.delete(
+ "video_123",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Delete(context.TODO(), "video_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.delete("video_123")
+
+ puts(video)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoDeleteParams;
+ import com.openai.models.videos.VideoDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoDeleteResponse video = client.videos().delete("video_123");
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.delete('video_123');
+
+ console.log(video.id);
+ get:
+ operationId: VideoGeneration_getVideo
+ summary: Get a video
+ description: Retrieves a video by its identifier.
+ parameters:
+ - name: video_id
+ in: path
+ required: true
+ description: The identifier of the video to retrieve.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ name: Retrieve video
+ group: videos
+ path: retrieve matching the provided identifier.
+ examples:
+ response: ''
+ request:
+ javascript: |
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const video = await client.videos.retrieve('video_123');
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.retrieve(
+ "video_123",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Get(context.TODO(), "video_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.retrieve("video_123")
+
+ puts(video)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Video video = client.videos().retrieve("video_123");
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.retrieve('video_123');
+
+ console.log(video.id);
+ /openai/v1/videos/{video_id}/content:
+ get:
+ operationId: VideoGeneration_retrieveVideoContent
+ summary: Get a video content
+ description: Retrieves a video content by its identifier.
+ parameters:
+ - name: video_id
+ in: path
+ required: true
+ description: The identifier of the video whose media to download.
+ schema:
+ type: string
+ - name: variant
+ in: query
+ required: false
+ description: Which downloadable asset to return. Defaults to the MP4 video.
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoContentVariant'
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ video/mp4:
+ schema:
+ contentMediaType: video/mp4
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ x-oaiMeta:
+ name: Retrieve video content
+ group: videos
+ path: content
+ examples:
+ response: ''
+ request:
+ javascript: |
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const response = await client.videos.downloadContent('video_123');
+
+ console.log(response);
+
+ const content = await response.blob();
+ console.log(content);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.videos.download_content(
+ video_id="video_123",
+ )
+ print(response)
+ content = response.read()
+ print(content)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Videos.DownloadContent(
+ context.TODO(),
+ "video_123",
+ openai.VideoDownloadContentParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.videos.download_content("video_123")
+
+ puts(response)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.videos.VideoDownloadContentParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ HttpResponse response = client.videos().downloadContent("video_123");
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.videos.downloadContent('video_123');
+
+ console.log(response);
+
+ const content = await response.blob();
+ console.log(content);
+ /openai/v1/videos/{video_id}/remix:
+ post:
+ operationId: VideoGeneration_createVideoRemix
+ summary: Create a video remix
+ description: Creates a video remix from the supplied request.
+ parameters:
+ - name: video_id
+ in: path
+ required: true
+ description: The identifier of the completed video to remix.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Videos
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/OpenAI.CreateVideoRemixBody'
+ encoding:
+ prompt:
+ contentType: text/plain
+ description: The multipart request body.
+ x-oaiMeta:
+ name: Remix video
+ group: videos
+ path: remix using the provided prompt.
+ examples:
+ request:
+ curl: |
+ curl -X POST https://api.openai.com/v1/videos/video_123/remix \
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "prompt": "Extend the scene with the cat taking a bow to the cheering audience"
+ }'
+ javascript: |
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const video = await client.videos.remix('video_123', { prompt: 'Extend the scene with the cat taking a bow to the cheering audience' });
+
+ console.log(video.id);
+ python: |-
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.remix(
+ video_id="video_123",
+ prompt="x",
+ )
+ print(video.id)
+ go: |
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Remix(
+ context.TODO(),
+ "video_123",
+ openai.VideoRemixParams{
+ Prompt: "x",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+ ruby: |-
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.remix("video_123", prompt: "x")
+
+ puts(video)
+ java: |-
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoRemixParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoRemixParams params = VideoRemixParams.builder()
+ .videoId("video_123")
+ .prompt("x")
+ .build();
+ Video video = client.videos().remix(params);
+ }
+ }
+ node.js: |-
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.remix('video_123', { prompt: 'x' });
+
+ console.log(video.id);
+ response: |
+ {
+ "id": "video_456",
+ "object": "video",
+ "model": "sora-2",
+ "status": "queued",
+ "progress": 0,
+ "created_at": 1712698600,
+ "size": "720x1280",
+ "seconds": "8",
+ "remixed_from_video_id": "video_123"
+ }
+ /redTeams/runs:
+ get:
+ operationId: RedTeams_list
+ summary: List redteams
+ description: Returns the redteams available in the current project.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - RedTeams=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PagedRedTeam'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Redteams
+ /redTeams/runs/{name}:
+ get:
+ operationId: RedTeams_get
+ summary: Get a redteam
+ description: Retrieves the specified redteam and its configuration.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: name
+ in: path
+ required: true
+ description: Identifier of the red team run.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - RedTeams=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RedTeam'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Redteams
+ /redTeams/runs:run:
+ post:
+ operationId: RedTeams_create
+ summary: Create a redteam run
+ description: Submits a new redteam run for execution with the provided configuration.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - RedTeams=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '201':
+ description: The request has succeeded and a new resource has been created as a result.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RedTeam'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Redteams
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RedTeam'
+ description: Redteam to be run
+ /routines:
+ get:
+ operationId: listRoutines
+ summary: List routines
+ description: Returns the routines available in the current project.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/ListRoutinesParameters.limit'
+ - $ref: '#/components/parameters/ListRoutinesParameters.after'
+ - $ref: '#/components/parameters/ListRoutinesParameters.before'
+ - $ref: '#/components/parameters/ListRoutinesParameters.order'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/Routine'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}:
+ put:
+ operationId: createOrUpdateRoutine
+ summary: Create or update a routine
+ description: Creates a new routine or replaces an existing routine with the supplied definition.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/CreateOrUpdateRoutineParameters.routine_name'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Routine'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RoutineCreateOrUpdateRequest'
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ get:
+ operationId: getRoutine
+ summary: Get a routine
+ description: Retrieves the specified routine and its current configuration.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/GetRoutineParameters'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Routine'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ delete:
+ operationId: deleteRoutine
+ summary: Delete a routine
+ description: Deletes the specified routine.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/DeleteRoutineParameters'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '204':
+ description: There is no content to send for this request, but the headers may be useful.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}/runs:
+ get:
+ operationId: listRoutineRuns
+ summary: List prior runs for a routine
+ description: Returns prior runs recorded for the specified routine.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.routine_name'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.filter'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.limit'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.after'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.before'
+ - $ref: '#/components/parameters/ListRoutineRunsParameters.order'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/RoutineRun'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}:disable:
+ post:
+ operationId: disableRoutine
+ summary: Disable a routine
+ description: Disables the specified routine so it no longer runs.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/DisableRoutineParameters'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Routine'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}:dispatch_async:
+ post:
+ operationId: dispatchRoutineAsync
+ summary: Queue an asynchronous routine dispatch
+ description: Queues an asynchronous dispatch for the specified routine.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/DispatchRoutineAsyncParameters.routine_name'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DispatchRoutineResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DispatchRoutineRequest'
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /routines/{routine_name}:enable:
+ post:
+ operationId: enableRoutine
+ summary: Enable a routine
+ description: Enables the specified routine so it can be dispatched.
+ parameters:
+ - name: Foundry-Features
+ in: header
+ required: false
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Routines=V1Preview
+ - $ref: '#/components/parameters/EnableRoutineParameters'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Routine'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Routines
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ /schedules:
+ get:
+ operationId: Schedules_list
+ summary: List schedules
+ description: Returns schedules that match the supplied type and enabled filters.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: type
+ in: query
+ required: false
+ description: Filter by the type of schedule.
+ schema:
+ $ref: '#/components/schemas/ScheduleTaskType'
+ explode: false
+ - name: enabled
+ in: query
+ required: false
+ description: Filter by the enabled status.
+ schema:
+ type: boolean
+ explode: false
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PagedSchedule'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ /schedules/{id}:
+ delete:
+ operationId: Schedules_delete
+ summary: Delete a schedule
+ description: Deletes the specified schedule resource.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: id
+ in: path
+ required: true
+ description: Identifier of the schedule.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '204':
+ description: There is no content to send for this request, but the headers may be useful.
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ get:
+ operationId: Schedules_get
+ summary: Get a schedule
+ description: Retrieves the specified schedule resource.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: id
+ in: path
+ required: true
+ description: Identifier of the schedule.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Schedule'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ put:
+ operationId: Schedules_createOrUpdate
+ summary: Create or update a schedule
+ description: Creates a new schedule or updates an existing schedule with the supplied definition.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: id
+ in: path
+ required: true
+ description: Identifier of the schedule.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Schedule'
+ '201':
+ description: The request has succeeded and a new resource has been created as a result.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Schedule'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Schedule'
+ description: The resource instance.
+ /schedules/{id}/runs:
+ get:
+ operationId: Schedules_listRuns
+ summary: List schedule runs
+ description: Returns schedule runs that match the supplied filters.
+ parameters:
+ - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
+ - name: id
+ in: path
+ required: true
+ description: Identifier of the schedule.
+ schema:
+ type: string
+ - name: type
+ in: query
+ required: false
+ description: Filter by the type of schedule.
+ schema:
+ $ref: '#/components/schemas/ScheduleTaskType'
+ explode: false
+ - name: enabled
+ in: query
+ required: false
+ description: Filter by the enabled status.
+ schema:
+ type: boolean
+ explode: false
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PagedScheduleRun'
+ 4XX:
+ description: Client error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ 5XX:
+ description: Server error
+ headers:
+ x-ms-error-code:
+ required: false
+ description: String error code indicating what went wrong.
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
+ tags:
+ - Schedules
+ /schedules/{schedule_id}/runs/{run_id}:
+ get:
+ operationId: Schedules_getRun
+ summary: Get a schedule run
+ description: Retrieves the specified run for a schedule.
+ parameters:
+ - name: schedule_id
+ in: path
+ required: true
+ description: The unique identifier of the schedule.
+ schema:
+ type: string
+ - name: run_id
+ in: path
+ required: true
+ description: The unique identifier of the schedule run.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Schedules=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ScheduleRun'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Schedules
+ /skills:
+ get:
+ operationId: Skills_listSkills
+ summary: List skills
+ description: Returns the skills available in the current project.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/Skill'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}:
+ get:
+ operationId: Skills_getSkill
+ summary: Retrieve a skill
+ description: Retrieves the specified skill and its current configuration.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The unique name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Skill'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ post:
+ operationId: updateSkill
+ summary: Update a skill
+ description: Modifies the specified skill's configuration.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill to update.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Skill'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ default_version:
+ type: string
+ description: The version identifier that the skill should point to. When set, the skill's default version will resolve to this version instead of the latest.
+ required:
+ - default_version
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ delete:
+ operationId: Skills_deleteSkill
+ summary: Delete a skill
+ description: Removes the specified skill and its associated versions.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The unique name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DeleteSkillResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}/content:
+ get:
+ operationId: getSkillContent
+ summary: Download the zip content for the default version of a skill
+ description: Downloads the zip content for the default version of a skill.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The response body for downloading a skill package.
+ content:
+ application/zip:
+ schema:
+ contentMediaType: application/zip
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}/versions:
+ post:
+ operationId: createSkillVersion_createSkillVersionFromFiles
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill. If the skill does not exist, it will be created.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ description: Creates a new version of a skill. If the skill does not exist, it will be created. Creates a new version of a skill from uploaded files via multipart form data.
+ summary: Create a new version of a skill Create a skill version from uploaded files
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SkillVersion'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ x-ms-description-override: Creates a new version of a skill. If the skill does not exist, it will be created.
+ x-ms-summary-override: Create a new version of a skill
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ tags:
+ - Skills
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ inline_content:
+ $ref: '#/components/schemas/SkillInlineContent'
+ description: Inline skill content for simple skills without file uploads. Foundry-specific extension.
+ default:
+ type: boolean
+ description: Whether to set this version as the default.
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/CreateSkillVersionFromFilesBody'
+ encoding:
+ files:
+ contentType: '*/*'
+ default:
+ contentType: text/plain
+ description: The multipart request content.
+ get:
+ operationId: listSkillVersions
+ summary: List skill versions
+ description: Returns the available versions for the specified skill.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill to list versions for.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/SkillVersion'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}/versions/{version}:
+ get:
+ operationId: getSkillVersion
+ summary: Retrieve a specific version of a skill
+ description: Retrieves the specified version of a skill by name and version identifier.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: version
+ in: path
+ required: true
+ description: The version identifier to retrieve.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SkillVersion'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ delete:
+ operationId: deleteSkillVersion
+ summary: Delete a specific version of a skill
+ description: Removes the specified version of a skill.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: version
+ in: path
+ required: true
+ description: The version identifier to delete.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DeleteSkillVersionResponse'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /skills/{name}/versions/{version}/content:
+ get:
+ operationId: getSkillVersionContent
+ summary: Download the zip content for a specific version of a skill
+ description: Downloads the zip content for a specific version of a skill.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the skill.
+ schema:
+ $ref: '#/components/schemas/SkillName'
+ - name: version
+ in: path
+ required: true
+ description: The version to download content for.
+ schema:
+ type: string
+ - name: Foundry-Features
+ in: header
+ required: true
+ description: A feature flag opt-in required when using preview operations or modifying persisted preview resources.
+ schema:
+ type: string
+ enum:
+ - Skills=V1Preview
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The response body for downloading a skill package.
+ content:
+ application/zip:
+ schema:
+ contentMediaType: application/zip
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Skills
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ /toolboxes:
+ get:
+ operationId: listToolboxes
+ summary: List toolboxes
+ description: Returns the toolboxes available in the current project.
+ parameters:
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolboxObject'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ /toolboxes/{name}:
+ get:
+ operationId: getToolbox
+ summary: Retrieve a toolbox
+ description: Retrieves the specified toolbox and its current configuration.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox to retrieve.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ToolboxObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ patch:
+ operationId: updateToolbox
+ summary: Update a toolbox to point to a specific version
+ description: Updates the toolbox's default version pointer to the specified version.
+ parameters:
+ - $ref: '#/components/parameters/UpdateToolboxRequest.name'
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ToolboxObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateToolboxRequest'
+ delete:
+ operationId: deleteToolbox
+ summary: Delete a toolbox
+ description: Removes the specified toolbox along with all of its versions.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox to delete.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '204':
+ description: 'There is no content to send for this request, but the headers may be useful. '
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ /toolboxes/{name}/versions:
+ post:
+ operationId: createToolboxVersion
+ summary: Create a new version of a toolbox
+ description: Creates a new toolbox version, provisioning the toolbox itself if it does not already exist.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox. If the toolbox does not exist, it will be created.
+ schema:
+ type: string
+ maxLength: 256
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ToolboxVersionObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the toolbox.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Arbitrary key-value metadata to associate with the toolbox.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolboxTool'
+ description: The list of tools to include in this version.
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolboxSkill'
+ description: The list of skill sources to include in this version. A skill reference specifies a skill name and optionally a version. If version is omitted, the skill's default version is used.
+ policies:
+ $ref: '#/components/schemas/ToolboxPolicies'
+ description: Policy configuration for this toolbox version.
+ required:
+ - tools
+ get:
+ operationId: listToolboxVersions
+ summary: List toolbox versions
+ description: Returns the available versions for the specified toolbox.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox to list versions for.
+ schema:
+ type: string
+ - name: limit
+ in: query
+ required: false
+ description: |-
+ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ default is 20.
+ schema:
+ type: integer
+ format: int32
+ default: 20
+ explode: false
+ - name: order
+ in: query
+ required: false
+ description: |-
+ Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ for descending order.
+ schema:
+ $ref: '#/components/schemas/PageOrder'
+ explode: false
+ - name: after
+ in: query
+ required: false
+ description: |-
+ 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.
+ schema:
+ type: string
+ explode: false
+ - name: before
+ in: query
+ required: false
+ description: |-
+ 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, ending with obj_foo, your
+ subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ schema:
+ type: string
+ explode: false
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - data
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolboxVersionObject'
+ description: The requested list of items.
+ first_id:
+ type: string
+ description: The first ID represented in this list.
+ last_id:
+ type: string
+ description: The last ID represented in this list.
+ has_more:
+ type: boolean
+ description: A value indicating whether there are additional values available not captured in this list.
+ description: The response data for a requested list of items.
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ /toolboxes/{name}/versions/{version}:
+ get:
+ operationId: getToolboxVersion
+ summary: Retrieve a specific version of a toolbox
+ description: Retrieves the specified version of a toolbox by name and version identifier.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox.
+ schema:
+ type: string
+ - name: version
+ in: path
+ required: true
+ description: The version identifier to retrieve.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ToolboxVersionObject'
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+ delete:
+ operationId: deleteToolboxVersion
+ summary: Delete a specific version of a toolbox
+ description: Removes the specified version of a toolbox.
+ parameters:
+ - name: name
+ in: path
+ required: true
+ description: The name of the toolbox.
+ schema:
+ type: string
+ - name: version
+ in: path
+ required: true
+ description: The version identifier to delete.
+ schema:
+ type: string
+ - name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ explode: false
+ responses:
+ '204':
+ description: 'There is no content to send for this request, but the headers may be useful. '
+ 4XX:
+ description: Client error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ 5XX:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiErrorResponse'
+ tags:
+ - Toolboxes
+security:
+ - OAuth2Auth:
+ - https://ai.azure.com/.default
+components:
+ parameters:
+ Azure.Core.ClientRequestIdHeader:
+ name: x-ms-client-request-id
+ in: header
+ required: false
+ description: An opaque, globally-unique, client-generated string identifier for the request.
+ schema:
+ $ref: '#/components/schemas/Azure.Core.uuid'
+ Azure.Core.Foundations.ApiVersionParameter:
+ name: api-version
+ in: query
+ required: true
+ description: The API version to use for this operation.
+ schema:
+ type: string
+ minLength: 1
+ explode: false
+ CreateOrUpdateRoutineParameters.routine_name:
+ name: routine_name
+ in: path
+ required: true
+ description: The unique name of the routine.
+ schema:
+ type: string
+ maxLength: 128
+ DeleteRoutineParameters:
+ name: routine_name
+ in: path
+ required: true
+ description: The unique name of the routine.
+ schema:
+ type: string
+ maxLength: 128
+ DisableRoutineParameters:
+ name: routine_name
+ in: path
+ required: true
+ description: The unique name of the routine.
+ schema:
+ type: string
+ maxLength: 128
+ DispatchRoutineAsyncParameters.routine_name:
+ name: routine_name
+ in: path
+ required: true
+ description: The unique name of the routine.
+ schema:
+ type: string
+ maxLength: 128
+ EnableRoutineParameters:
+ name: routine_name
+ in: path
+ required: true
+ description: The unique name of the routine.
+ schema:
+ type: string
+ maxLength: 128
+ GetRoutineParameters:
+ name: routine_name
+ in: path
+ required: true
+ description: The unique name of the routine.
+ schema:
+ type: string
+ maxLength: 128
+ ListRoutineRunsParameters.after:
+ name: after
+ in: query
+ required: false
+ description: An opaque cursor returned as last_id by the previous list-runs response.
+ schema:
+ type: string
+ explode: false
+ ListRoutineRunsParameters.before:
+ name: before
+ in: query
+ required: false
+ description: Unsupported. Reserved for future backward pagination support.
+ schema:
+ type: string
+ explode: false
+ ListRoutineRunsParameters.filter:
+ name: filter
+ in: query
+ required: false
+ description: An optional MLflow search-runs filter expression applied within the routine's experiment.
+ schema:
+ type: string
+ explode: false
+ ListRoutineRunsParameters.limit:
+ name: limit
+ in: query
+ required: false
+ description: The maximum number of runs to return.
+ schema:
+ type: integer
+ format: int32
+ explode: false
+ ListRoutineRunsParameters.order:
+ name: order
+ in: query
+ required: false
+ description: The ordering direction. Supported values are asc and desc.
+ schema:
+ type: string
+ explode: false
+ ListRoutineRunsParameters.routine_name:
+ name: routine_name
+ in: path
+ required: true
+ description: The unique name of the routine.
+ schema:
+ type: string
+ maxLength: 128
+ ListRoutinesParameters.after:
+ name: after
+ in: query
+ required: false
+ description: An opaque cursor returned as last_id by the previous list response.
+ schema:
+ type: string
+ explode: false
+ ListRoutinesParameters.before:
+ name: before
+ in: query
+ required: false
+ description: Unsupported. Reserved for future backward pagination support.
+ schema:
+ type: string
+ explode: false
+ ListRoutinesParameters.limit:
+ name: limit
+ in: query
+ required: false
+ description: The maximum number of routines to return.
+ schema:
+ type: integer
+ format: int32
+ explode: false
+ ListRoutinesParameters.order:
+ name: order
+ in: query
+ required: false
+ description: The ordering direction. Supported values are asc and desc.
+ schema:
+ type: string
+ explode: false
+ UpdateToolboxRequest.name:
+ name: name
+ in: path
+ required: true
+ description: The name of the toolbox to update.
+ schema:
+ type: string
+ schemas:
+ A2APreviewTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - a2a_preview
+ description: The type of the tool. Always `"a2a_preview`.
+ base_url:
+ type: string
+ format: uri
+ description: Base URL of the agent.
+ agent_card_path:
+ type: string
+ description: |-
+ The path to the agent card relative to the `base_url`.
+ If not provided, defaults to `/.well-known/agent-card.json`
+ project_connection_id:
+ type: string
+ description: |-
+ The connection ID in the project for the A2A server.
+ The connection stores authentication and other connection details needed to connect to the A2A server.
+ send_credentials_for_agent_card:
+ type: boolean
+ description: |-
+ When `true`, Foundry sends its credentials when fetching the remote
+ agent's Agent Card. The service defaults to `false` if a value is not
+ specified by the caller (anonymous fetch).
+ default: false
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: An agent implementing the A2A protocol.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ A2APreviewToolboxTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - a2a_preview
+ base_url:
+ type: string
+ format: uri
+ description: Base URL of the agent.
+ agent_card_path:
+ type: string
+ description: |-
+ The path to the agent card relative to the `base_url`.
+ If not provided, defaults to `/.well-known/agent-card.json`
+ project_connection_id:
+ type: string
+ description: |-
+ The connection ID in the project for the A2A server.
+ The connection stores authentication and other connection details needed to connect to the A2A server.
+ send_credentials_for_agent_card:
+ type: boolean
+ description: |-
+ When `true`, Foundry sends its credentials when fetching the remote
+ agent's Agent Card. The service defaults to `false` if a value is not
+ specified by the caller (anonymous fetch).
+ default: false
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: An A2A tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ A2AProtocolConfiguration:
+ type: object
+ description: Configuration specific to the A2A protocol.
+ A2AToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - a2a_preview_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ name:
+ type: string
+ description: The name of the A2A agent card being called.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: An A2A (Agent-to-Agent) tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ A2AToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - a2a_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ name:
+ type: string
+ description: The name of the A2A agent card that was called.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the A2A tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of an A2A (Agent-to-Agent) tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ AISearchIndexResource:
+ type: object
+ properties:
+ project_connection_id:
+ type: string
+ description: An index connection ID in an IndexResource attached to this agent.
+ index_name:
+ type: string
+ description: The name of an index in an IndexResource attached to this agent.
+ query_type:
+ $ref: '#/components/schemas/AzureAISearchQueryType'
+ description: Type of query in an AIIndexResource attached to this agent.
+ top_k:
+ type: integer
+ format: int32
+ description: Number of documents to retrieve from search and present to the model.
+ filter:
+ type: string
+ description: filter string for search resource. [Learn more here](https://learn.microsoft.com/azure/search/search-filters).
+ index_asset_id:
+ type: string
+ description: Index asset id for search resource.
+ description: A AI Search Index resource.
+ ActivityProtocolConfiguration:
+ type: object
+ properties:
+ enable_m365_public_endpoint:
+ type: boolean
+ description: Whether to enable the M365 public endpoint for the activity protocol.
+ description: Configuration specific to the activity protocol.
+ AgentBlueprintReference:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/AgentBlueprintReferenceType'
+ discriminator:
+ propertyName: type
+ mapping:
+ ManagedAgentIdentityBlueprint: '#/components/schemas/ManagedAgentIdentityBlueprintReference'
+ AgentBlueprintReferenceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - ManagedAgentIdentityBlueprint
+ AgentCard:
+ type: object
+ required:
+ - version
+ - skills
+ properties:
+ version:
+ type: string
+ minLength: 1
+ maxLength: 32
+ description: The version of the agent card.
+ description:
+ type: string
+ maxLength: 2048
+ description: The description of the agent card.
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentCardSkill'
+ minItems: 1
+ maxItems: 16
+ description: The set of skills that an agent can perform.
+ AgentCardSkill:
+ type: object
+ required:
+ - id
+ - name
+ properties:
+ id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: a unique identifier for the skill
+ name:
+ type: string
+ minLength: 1
+ maxLength: 128
+ description: The name of the skill
+ description:
+ type: string
+ maxLength: 2048
+ description: A description of the skill
+ tags:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentCardSkillTag'
+ maxItems: 5
+ description: set of tagwords describing classes of capabilities for the skill
+ examples:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentCardSkillExample'
+ maxItems: 5
+ description: A list of example scenarios that the skill can perform.
+ AgentCardSkillExample:
+ type: string
+ maxLength: 1024
+ description: A skill example string with a maximum length of 1024 characters.
+ AgentCardSkillTag:
+ type: string
+ maxLength: 32
+ AgentCardUpdate:
+ type: object
+ properties:
+ version:
+ type: string
+ minLength: 1
+ maxLength: 32
+ description: The version of the agent card.
+ description:
+ type: string
+ maxLength: 2048
+ description: The description of the agent card.
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentCardSkill'
+ minItems: 1
+ maxItems: 16
+ description: The set of skills that an agent can perform.
+ AgentClusterInsightRequest:
+ type: object
+ required:
+ - type
+ - agentName
+ properties:
+ type:
+ type: string
+ enum:
+ - AgentClusterInsight
+ description: The type of request.
+ agentName:
+ type: string
+ description: Identifier for the agent.
+ modelConfiguration:
+ $ref: '#/components/schemas/InsightModelConfiguration'
+ description: Configuration of the model used in the insight generation.
+ allOf:
+ - $ref: '#/components/schemas/InsightRequest'
+ description: Insights on set of Agent Evaluation Results
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ AgentClusterInsightResult:
+ type: object
+ required:
+ - type
+ - clusterInsight
+ properties:
+ type:
+ type: string
+ enum:
+ - AgentClusterInsight
+ description: The type of insights result.
+ clusterInsight:
+ $ref: '#/components/schemas/ClusterInsightResult'
+ allOf:
+ - $ref: '#/components/schemas/InsightResult'
+ description: Insights from the agent cluster analysis.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ AgentContainerObject:
+ type: object
+ required:
+ - object
+ - status
+ - created_at
+ - updated_at
+ properties:
+ object:
+ type: string
+ enum:
+ - agent.container
+ description: The object type, which is always 'agent.container'.
+ readOnly: true
+ id:
+ type: string
+ description: The identifier of the container.
+ readOnly: true
+ status:
+ $ref: '#/components/schemas/AgentContainerStatus'
+ description: The status of the container of a specific version of an agent.
+ readOnly: true
+ max_replicas:
+ type: integer
+ format: int32
+ description: The maximum number of replicas for the container. Default is 1.
+ examples:
+ - 10
+ min_replicas:
+ type: integer
+ format: int32
+ description: The minimum number of replicas for the container. Default is 1.
+ examples:
+ - 1
+ error_message:
+ type: string
+ description: The error message if the container failed to operate, if any.
+ readOnly: true
+ created_at:
+ type: string
+ format: date-time
+ description: The creation time of the container.
+ readOnly: true
+ updated_at:
+ type: string
+ format: date-time
+ description: The last update time of the container.
+ readOnly: true
+ container:
+ $ref: '#/components/schemas/ContainerDetails'
+ description: The detailed container information.
+ readOnly: true
+ description: The details of the container of a specific version of an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - ContainerAgents=V1Preview
+ AgentContainerOperationError:
+ type: object
+ required:
+ - code
+ - type
+ - message
+ properties:
+ code:
+ type: string
+ description: The error code of the container operation.
+ type:
+ type: string
+ description: The error type of the container operation.
+ message:
+ type: string
+ description: The error message of the container operation.
+ description: The error details of the container operation, if any.
+ x-ms-foundry-meta:
+ required_previews:
+ - ContainerAgents=V1Preview
+ AgentContainerOperationObject:
+ type: object
+ required:
+ - id
+ - agent_id
+ - agent_version_id
+ - status
+ properties:
+ id:
+ type: string
+ description: The ID of the container operation. This id is a globally unique identifier.
+ agent_id:
+ type: string
+ description: The ID of the agent.
+ agent_version_id:
+ type: string
+ description: The ID of the agent version.
+ status:
+ $ref: '#/components/schemas/AgentContainerOperationStatus'
+ description: The status of the container operation.
+ error:
+ $ref: '#/components/schemas/AgentContainerOperationError'
+ description: The error of the container operation, if any.
+ container:
+ $ref: '#/components/schemas/AgentContainerObject'
+ description: The container of the specific version of an agent.
+ description: The container operation for a specific version of an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - ContainerAgents=V1Preview
+ AgentContainerOperationStatus:
+ type: string
+ enum:
+ - NotStarted
+ - InProgress
+ - Succeeded
+ - Failed
+ description: Status of the container operation for a specific version of an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - ContainerAgents=V1Preview
+ AgentContainerStatus:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - Starting
+ - Running
+ - Stopping
+ - Stopped
+ - Failed
+ - Deleting
+ - Deleted
+ - Updating
+ description: Status of the container of a specific version of an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - ContainerAgents=V1Preview
+ AgentDataGenerationJobSource:
+ type: object
+ required:
+ - type
+ - agent_name
+ properties:
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ type:
+ type: string
+ enum:
+ - agent
+ description: The source type for this source, which is Agent.
+ agent_name:
+ type: string
+ description: The agent name to fetch instructions from.
+ agent_version:
+ type: string
+ description: The agent version. If not specified, the latest version is used.
+ allOf:
+ - $ref: '#/components/schemas/DataGenerationJobSource'
+ description: Agent source for data generation jobs — references an agent to fetch instructions and metadata from.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ AgentDefinition:
+ type: object
+ required:
+ - kind
+ properties:
+ kind:
+ $ref: '#/components/schemas/AgentKind'
+ rai_config:
+ $ref: '#/components/schemas/RaiConfig'
+ description: Configuration for Responsible AI (RAI) content filtering and safety features.
+ discriminator:
+ propertyName: kind
+ mapping:
+ hosted: '#/components/schemas/HostedAgentDefinition'
+ prompt: '#/components/schemas/PromptAgentDefinition'
+ workflow: '#/components/schemas/WorkflowAgentDefinition'
+ external: '#/components/schemas/ExternalAgentDefinition'
+ container_app: '#/components/schemas/ContainerAppAgentDefinition'
+ AgentDefinitionOptInKeys:
+ type: string
+ enum:
+ - WorkflowAgents=V1Preview
+ - ExternalAgents=V1Preview
+ - DraftAgents=V1Preview
+ - HostedAgents=V1Preview
+ - ContainerAgents=V1Preview
+ description: Feature opt-in keys for agent definition operations supporting hosted or workflow agents.
+ AgentEndpointAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/AgentEndpointAuthorizationSchemeType'
+ discriminator:
+ propertyName: type
+ mapping:
+ Entra: '#/components/schemas/EntraAuthorizationScheme'
+ BotService: '#/components/schemas/BotServiceAuthorizationScheme'
+ BotServiceRbac: '#/components/schemas/BotServiceRbacAuthorizationScheme'
+ BotServiceTenant: '#/components/schemas/BotServiceTenantAuthorizationScheme'
+ AgentEndpointAuthorizationSchemeType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - Entra
+ - BotService
+ - BotServiceRbac
+ - BotServiceTenant
+ AgentEndpointConfig:
+ type: object
+ properties:
+ version_selector:
+ $ref: '#/components/schemas/VersionSelector'
+ description: The version selector of the agent endpoint determines how traffic is routed to different versions of the agent.
+ protocols:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentEndpointProtocol'
+ description: 'Deprecated: Use protocol_configuration instead. The presence of a key in protocol_configuration declares the protocol is enabled.'
+ protocol_configuration:
+ $ref: '#/components/schemas/ProtocolConfiguration'
+ description: Per-protocol configuration for the agent endpoint.
+ authorization_schemes:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ description: The authorization schemes supported by the agent endpoint
+ AgentEndpointConfigUpdate:
+ type: object
+ properties:
+ version_selector:
+ $ref: '#/components/schemas/VersionSelectorUpdate'
+ description: The version selector of the agent endpoint determines how traffic is routed to different versions of the agent.
+ protocols:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentEndpointProtocol'
+ description: 'Deprecated: Use protocol_configuration instead. The presence of a key in protocol_configuration declares the protocol is enabled.'
+ protocol_configuration:
+ $ref: '#/components/schemas/ProtocolConfiguration'
+ description: Per-protocol configuration for the agent endpoint.
+ authorization_schemes:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ description: The authorization schemes supported by the agent endpoint
+ AgentEndpointProtocol:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - activity
+ - responses
+ - a2a
+ - mcp
+ - invocations
+ - invocations_ws
+ AgentEvaluation:
+ type: object
+ required:
+ - id
+ - status
+ properties:
+ id:
+ type: string
+ description: Identifier of the agent evaluation run.
+ status:
+ type: string
+ description: 'Status of the agent evaluation. Options: Running, Completed, Failed.'
+ error:
+ type: string
+ description: The reason of the request failure for the long running process, if applicable.
+ result:
+ type: array
+ items:
+ $ref: '#/components/schemas/AgentEvaluationResult'
+ description: The agent evaluation result.
+ description: Evaluation response for agent evaluation run.
+ AgentEvaluationRedactionConfiguration:
+ type: object
+ properties:
+ redactScoreProperties:
+ type: boolean
+ description: Redact score properties. If not specified, the default is to redact in production.
+ description: The redaction configuration will allow the user to control what is redacted.
+ AgentEvaluationRequest:
+ type: object
+ required:
+ - runId
+ - evaluators
+ - appInsightsConnectionString
+ properties:
+ runId:
+ type: string
+ description: Identifier of the agent run.
+ threadId:
+ type: string
+ description: Identifier of the agent thread. This field is mandatory currently, but it will be optional in the future.
+ evaluators:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/EvaluatorConfiguration'
+ description: Evaluators to be used for the evaluation.
+ samplingConfiguration:
+ $ref: '#/components/schemas/AgentEvaluationSamplingConfiguration'
+ description: Sampling configuration for the evaluation.
+ redactionConfiguration:
+ $ref: '#/components/schemas/AgentEvaluationRedactionConfiguration'
+ description: Redaction configuration for the evaluation.
+ appInsightsConnectionString:
+ type: string
+ description: Pass the AppInsights connection string to the agent evaluation for the evaluation results and the errors logs.
+ description: Evaluation request for agent run.
+ AgentEvaluationResult:
+ type: object
+ required:
+ - evaluator
+ - evaluatorId
+ - score
+ - status
+ - runId
+ properties:
+ evaluator:
+ type: string
+ description: Evaluator's name. This is the name of the evaluator that was used to evaluate the agent's completion.
+ evaluatorId:
+ type: string
+ description: Identifier of the evaluator.
+ score:
+ type: number
+ format: float
+ description: Score of the given evaluator. No restriction on range.
+ status:
+ type: string
+ description: 'Status of the evaluator result. Options: Running, Completed, Failed, NotApplicable.'
+ reason:
+ type: string
+ description: Reasoning for the evaluation result.
+ version:
+ type: string
+ description: Version of the evaluator that was used to evaluate the agent's completion.
+ threadId:
+ type: string
+ description: The unique identifier of the thread.
+ runId:
+ type: string
+ description: The unique identifier of the run.
+ error:
+ type: string
+ description: A string explaining why there was an error, if applicable.
+ additionalDetails:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Additional properties relevant to the evaluator. These will differ between evaluators.
+ description: Result for the agent evaluation evaluator run.
+ AgentEvaluationSamplingConfiguration:
+ type: object
+ required:
+ - name
+ - samplingPercent
+ - maxRequestRate
+ properties:
+ name:
+ type: string
+ description: Name of the sampling strategy.
+ samplingPercent:
+ type: number
+ format: float
+ description: Percentage of sampling per hour (0-100).
+ maxRequestRate:
+ type: number
+ format: float
+ description: Maximum request rate per hour (0 to 1000).
+ description: Definition for sampling strategy.
+ AgentEvaluationSuiteJobSource:
+ type: object
+ required:
+ - type
+ - agent_name
+ properties:
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ type:
+ type: string
+ enum:
+ - agent
+ description: The source type for this source, which is Agent.
+ agent_name:
+ type: string
+ description: The agent name to fetch instructions from.
+ agent_version:
+ type: string
+ description: The agent version. If not specified, the latest version is used.
+ allOf:
+ - $ref: '#/components/schemas/EvaluationSuiteJobSource'
+ description: Agent source for evaluation suite generation jobs — references an agent to fetch instructions and metadata from.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ AgentEvaluatorGenerationJobSource:
+ type: object
+ required:
+ - type
+ - agent_name
+ properties:
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ type:
+ type: string
+ enum:
+ - agent
+ description: The source type for this source, which is Agent.
+ agent_name:
+ type: string
+ description: The agent name to fetch instructions from.
+ agent_version:
+ type: string
+ description: The agent version. If not specified, the latest version is used.
+ allOf:
+ - $ref: '#/components/schemas/EvaluatorGenerationJobSource'
+ description: Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ AgentFilterTraceSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - agent_filter
+ description: The type of trace source, always `agent_filter`.
+ agent_id:
+ type: string
+ description: The identifier of the agent to filter traces by.
+ agent_name:
+ type: string
+ description: The name of the agent to filter traces by.
+ agent_version:
+ type: string
+ description: The version of the agent to filter traces by.
+ start_time:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: Start time for the trace query window, expressed as a Unix timestamp (seconds).
+ end_time:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: End time for the trace query window, expressed as a Unix timestamp (seconds).
+ max_traces:
+ type: integer
+ format: int32
+ description: Maximum number of traces to sample. Must be greater than 0.
+ filter_strategy:
+ $ref: '#/components/schemas/FilterStrategyType'
+ description: The strategy used to filter traces.
+ allOf:
+ - $ref: '#/components/schemas/TraceSource'
+ description: A trace source that selects traces by agent reference with time-based filtering.
+ AgentId:
+ type: object
+ required:
+ - type
+ - name
+ - version
+ properties:
+ type:
+ type: string
+ enum:
+ - agent_id
+ name:
+ type: string
+ maxLength: 256
+ description: The name of the agent.
+ version:
+ type: string
+ description: The version identifier of the agent.
+ AgentIdentity:
+ type: object
+ required:
+ - principal_id
+ - client_id
+ properties:
+ principal_id:
+ type: string
+ description: The principal ID of the agent instance
+ client_id:
+ type: string
+ description: The client ID of the agent instance. Also referred to as the instance ID
+ status:
+ $ref: '#/components/schemas/AgentIdentityStatus'
+ description: The status of the agent identity. Present for both the agent instance identity and the agent blueprint.
+ AgentIdentityStatus:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - active
+ - disabled
+ description: The status of an agent identity, applicable to both the agent instance identity and the agent blueprint.
+ AgentKind:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - hosted
+ - workflow
+ - external
+ - container_app
+ AgentObject:
+ type: object
+ required:
+ - object
+ - id
+ - name
+ - state
+ - versions
+ properties:
+ object:
+ type: string
+ enum:
+ - agent
+ description: The object type, which is always 'agent'.
+ id:
+ type: string
+ description: The unique identifier of the agent.
+ name:
+ type: string
+ maxLength: 63
+ description: The name of the agent.
+ state:
+ $ref: '#/components/schemas/AgentState'
+ description: The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests.
+ readOnly: true
+ versions:
+ type: object
+ properties:
+ latest:
+ $ref: '#/components/schemas/AgentVersionObject'
+ required:
+ - latest
+ description: The latest version of the agent.
+ agent_endpoint:
+ $ref: '#/components/schemas/AgentEndpointConfig'
+ description: The endpoint configuration for the agent
+ instance_identity:
+ $ref: '#/components/schemas/AgentIdentity'
+ description: The instance identity of the agent
+ readOnly: true
+ blueprint:
+ $ref: '#/components/schemas/AgentIdentity'
+ description: The blueprint for the agent
+ readOnly: true
+ blueprint_reference:
+ $ref: '#/components/schemas/AgentBlueprintReference'
+ description: The blueprint for the agent
+ readOnly: true
+ agent_card:
+ $ref: '#/components/schemas/AgentCard'
+ AgentReference:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ type:
+ type: string
+ enum:
+ - agent_reference
+ name:
+ type: string
+ maxLength: 256
+ description: The name of the agent.
+ version:
+ type: string
+ description: The version identifier of the agent.
+ AgentSessionResource:
+ type: object
+ required:
+ - agent_session_id
+ - version_indicator
+ - status
+ - created_at
+ - last_accessed_at
+ - expires_at
+ properties:
+ agent_session_id:
+ type: string
+ description: The session identifier.
+ version_indicator:
+ $ref: '#/components/schemas/VersionIndicator'
+ description: The version indicator determining which agent version backs this session.
+ status:
+ $ref: '#/components/schemas/AgentSessionStatus'
+ description: The current status of the session.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) when the session was created.
+ readOnly: true
+ last_accessed_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) when the session was last accessed.
+ readOnly: true
+ expires_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).
+ readOnly: true
+ description: An agent session providing a long-lived compute sandbox for hosted agent invocations.
+ AgentSessionStatus:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - creating
+ - active
+ - idle
+ - updating
+ - failed
+ - deleting
+ - deleted
+ - expired
+ description: The status of an agent session.
+ AgentState:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - enabled
+ - disabled
+ description: The operational state of an agent.
+ AgentTaxonomyInput:
+ type: object
+ required:
+ - type
+ - target
+ - riskCategories
+ properties:
+ type:
+ type: string
+ enum:
+ - agent
+ description: Input type of the evaluation taxonomy.
+ target:
+ $ref: '#/components/schemas/Target'
+ description: Target configuration for the agent.
+ riskCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/RiskCategory'
+ description: List of risk categories to evaluate against.
+ allOf:
+ - $ref: '#/components/schemas/EvaluationTaxonomyInput'
+ description: Input configuration for the evaluation taxonomy when the input type is agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ AgentTaxonomyInputUpdate:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - agent
+ description: Input type of the evaluation taxonomy.
+ target:
+ $ref: '#/components/schemas/TargetUpdate'
+ description: Target configuration for the agent.
+ riskCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/RiskCategory'
+ description: List of risk categories to evaluate against.
+ allOf:
+ - $ref: '#/components/schemas/EvaluationTaxonomyInputUpdate'
+ description: Input configuration for the evaluation taxonomy when the input type is agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ AgentVersionObject:
+ type: object
+ required:
+ - metadata
+ - object
+ - id
+ - name
+ - version
+ - created_at
+ - definition
+ properties:
+ metadata:
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ type: string
+ - type: 'null'
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ object:
+ type: string
+ enum:
+ - agent.version
+ description: The object type, which is always 'agent.version'.
+ id:
+ type: string
+ description: The unique identifier of the agent version.
+ name:
+ type: string
+ maxLength: 256
+ description: The name of the agent. Name can be used to retrieve/update/delete the agent.
+ version:
+ type: string
+ description: The version identifier of the agent. Agents are immutable and every update creates a new version while keeping the name same.
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The Unix timestamp (seconds) when the agent was created.
+ definition:
+ $ref: '#/components/schemas/AgentDefinition'
+ draft:
+ type: boolean
+ description: Whether this agent version is a draft (candidate) rather than a release. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to false.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DraftAgents=V1Preview
+ default: false
+ status:
+ $ref: '#/components/schemas/AgentVersionStatus'
+ description: The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For hosted agents, reflects infrastructure readiness.
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error details if the agent version provisioning failed.
+ instance_identity:
+ $ref: '#/components/schemas/AgentIdentity'
+ description: The instance identity of the agent
+ readOnly: true
+ blueprint:
+ $ref: '#/components/schemas/AgentIdentity'
+ description: The blueprint for the agent
+ readOnly: true
+ blueprint_reference:
+ $ref: '#/components/schemas/AgentBlueprintReference'
+ description: The blueprint for the agent
+ readOnly: true
+ agent_guid:
+ type: string
+ description: The unique GUID identifier of the agent.
+ readOnly: true
+ AgentVersionStatus:
+ type: string
+ enum:
+ - creating
+ - active
+ - failed
+ - deleting
+ - deleted
+ description: The provisioning status of an agent version.
+ AgenticIdentityPreviewCredentials:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - AgenticIdentityToken_Preview
+ description: The credential type
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: Agentic identity credential definition
+ ApiErrorResponse:
+ type: object
+ required:
+ - error
+ properties:
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error response for API failures.
+ ApiKeyCredentials:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - ApiKey
+ description: The credential type
+ readOnly: true
+ key:
+ type: string
+ description: API Key
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: API Key Credential definition
+ ArtifactProfile:
+ type: object
+ required:
+ - category
+ properties:
+ category:
+ $ref: '#/components/schemas/FoundryModelArtifactProfileCategory'
+ description: The category of the artifact profile
+ signals:
+ type: array
+ items:
+ $ref: '#/components/schemas/FoundryModelArtifactProfileSignal'
+ description: Signals detected in the model artifact
+ description: Artifact profile of the model
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ AssetCredentialResponse:
+ type: object
+ required:
+ - blobReference
+ properties:
+ blobReference:
+ $ref: '#/components/schemas/BlobReference'
+ description: Credential info to access the storage account.
+ description: Represents a reference to a blob for consumption
+ AssetId:
+ type: string
+ description: Identifier of a saved asset.
+ AssistantMessage:
+ type: object
+ required:
+ - role
+ - content
+ properties:
+ role:
+ type: string
+ enum:
+ - assistant
+ description: Indicates this is an assistant message.
+ content:
+ type: string
+ description: Response content generated by the assistant.
+ allOf:
+ - $ref: '#/components/schemas/Message'
+ description: A message generated by the assistant in response to previous messages.
+ AttackStrategy:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - easy
+ - moderate
+ - difficult
+ - ascii_art
+ - ascii_smuggler
+ - atbash
+ - base64
+ - binary
+ - caesar
+ - character_space
+ - jailbreak
+ - ansi_attack
+ - character_swap
+ - suffix_append
+ - string_join
+ - unicode_confusable
+ - unicode_substitution
+ - diacritic
+ - flip
+ - leetspeak
+ - rot13
+ - morse
+ - url
+ - baseline
+ - indirect_jailbreak
+ - tense
+ - multi_turn
+ - crescendo
+ description: Strategies for attacks.
+ x-ms-foundry-meta:
+ required_previews:
+ - RedTeams=V1Preview
+ Azure.Core.Foundations.Error:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: string
+ description: One of a server-defined set of error codes.
+ message:
+ type: string
+ description: A human-readable representation of the error.
+ target:
+ type: string
+ description: The target of the error.
+ details:
+ type: array
+ items:
+ $ref: '#/components/schemas/Azure.Core.Foundations.Error'
+ description: An array of details about specific errors that led to this reported error.
+ innererror:
+ $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
+ description: An object containing more specific information than the current object about the error.
+ description: The error object.
+ Azure.Core.Foundations.ErrorResponse:
+ type: object
+ required:
+ - error
+ properties:
+ error:
+ $ref: '#/components/schemas/Azure.Core.Foundations.Error'
+ description: The error object.
+ description: A response containing error details.
+ Azure.Core.Foundations.InnerError:
+ type: object
+ properties:
+ code:
+ type: string
+ description: One of a server-defined set of error codes.
+ innererror:
+ description: Inner error.
+ $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
+ description: An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.
+ Azure.Core.Foundations.OperationState:
+ anyOf:
+ - type: string
+ enum:
+ - NotStarted
+ - Running
+ - Succeeded
+ - Failed
+ - Canceled
+ - type: string
+ description: Enum describing allowed operation states.
+ Azure.Core.uuid:
+ type: string
+ format: uuid
+ description: Universally Unique Identifier
+ AzureAIAgentTarget:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_agent
+ description: The type of target, always `azure_ai_agent`.
+ name:
+ type: string
+ description: The unique identifier of the Azure AI agent.
+ version:
+ type: string
+ description: The version of the Azure AI agent.
+ tool_descriptions:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolDescription'
+ description: The parameters used to control the sampling behavior of the agent during text generation.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ allOf:
+ - $ref: '#/components/schemas/Target'
+ description: Represents a target specifying an Azure AI agent.
+ AzureAIAgentTargetUpdate:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_agent
+ description: The type of target, always `azure_ai_agent`.
+ name:
+ type: string
+ description: The unique identifier of the Azure AI agent.
+ version:
+ type: string
+ description: The version of the Azure AI agent.
+ tool_descriptions:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolDescription'
+ description: The parameters used to control the sampling behavior of the agent during text generation.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ allOf:
+ - $ref: '#/components/schemas/TargetUpdate'
+ description: Represents a target specifying an Azure AI agent.
+ AzureAIBenchmarkDataSourceConfig:
+ type: object
+ required:
+ - scenario
+ - benchmark_name
+ properties:
+ scenario:
+ type: string
+ enum:
+ - benchmark_preview
+ description: Data schema scenario, always `benchmark` for benchmark evaluations.
+ benchmark_name:
+ type: string
+ description: The name of the benchmark specification.
+ benchmark_version:
+ type: string
+ description: The version of the benchmark specification (e.g., '0.1'). Latest version if not specified.
+ grader_model:
+ type: string
+ description: Optional grader model for benchmarks that use model graders, Required when the benchmark's testing_criteria uses a model grader type.
+ allOf:
+ - $ref: '#/components/schemas/AzureAIDataSourceConfig'
+ description: Data source configuration for benchmark evaluations.
+ AzureAIBenchmarkPreviewEvalRunDataSource:
+ type: object
+ required:
+ - type
+ - target
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_benchmark_preview
+ description: The type of data source, always `azure_ai_benchmark_preview`.
+ input_messages:
+ $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ description: Input messages configuration.
+ target:
+ anyOf:
+ - $ref: '#/components/schemas/AzureAIModelTarget'
+ - $ref: '#/components/schemas/AzureAIAgentTarget'
+ description: |-
+ The target model or agent to evaluate against the benchmark.
+ When using `azure_ai_model` target, `sampling_params` must not be provided;
+ inference parameters are auto-filled from the benchmark specification stored in eval group properties.
+ allOf:
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Represents a data source for benchmark evaluation runs.
+ AzureAIDataSourceConfig:
+ type: object
+ required:
+ - type
+ - scenario
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_source
+ description: The object type, which is always `azure_ai_source`.
+ scenario:
+ type: string
+ enum:
+ - red_team
+ - responses
+ - traces_preview
+ - synthetic_data_gen_preview
+ - benchmark_preview
+ description: Data schema scenario.
+ discriminator:
+ propertyName: scenario
+ mapping:
+ benchmark_preview: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
+ allOf:
+ - $ref: '#/components/schemas/DataSourceConfig'
+ description: Base data source configuration for Azure AI evaluation scenarios.
+ AzureAIModelTarget:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_model
+ description: The type of target, always `azure_ai_model`.
+ model:
+ type: string
+ description: The unique identifier of the Azure AI model.
+ sampling_params:
+ $ref: '#/components/schemas/ModelSamplingParams'
+ description: The parameters used to control the sampling behavior of the model during text generation.
+ allOf:
+ - $ref: '#/components/schemas/Target'
+ description: Represents a target specifying an Azure AI model for operations requiring model selection.
+ AzureAIModelTargetUpdate:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_model
+ description: The type of target, always `azure_ai_model`.
+ model:
+ type: string
+ description: The unique identifier of the Azure AI model.
+ sampling_params:
+ $ref: '#/components/schemas/ModelSamplingParams'
+ description: The parameters used to control the sampling behavior of the model during text generation.
+ allOf:
+ - $ref: '#/components/schemas/TargetUpdate'
+ description: Represents a target specifying an Azure AI model for operations requiring model selection.
+ AzureAIResponsesEvalRunDataSource:
+ type: object
+ required:
+ - type
+ - item_generation_params
+ - max_runs_hourly
+ - event_configuration_id
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_responses
+ description: The type of data source, always `azure_ai_responses`.
+ item_generation_params:
+ $ref: '#/components/schemas/ResponseRetrievalItemGenerationParams'
+ description: The parameters for item generation.
+ max_runs_hourly:
+ type: integer
+ format: int32
+ description: Maximum number of evaluation runs allowed per hour.
+ event_configuration_id:
+ type: string
+ description: The event configuration name associated with this evaluation run.
+ allOf:
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Represents a data source for evaluation runs that are specific to Continuous Evaluation scenarios.
+ AzureAISearchIndex:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - AzureSearch
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/Index'
+ description: Azure AI Search Index Definition
+ AzureAISearchIndexUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - AzureSearch
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/IndexUpdate'
+ description: Azure AI Search Index Definition
+ AzureAISearchQueryType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - simple
+ - semantic
+ - vector
+ - vector_simple_hybrid
+ - vector_semantic_hybrid
+ description: Available query types for Azure AI Search tool.
+ AzureAISearchTool:
+ type: object
+ required:
+ - type
+ - azure_ai_search
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_search
+ description: The object type, which is always 'azure_ai_search'.
+ name:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ azure_ai_search:
+ $ref: '#/components/schemas/AzureAISearchToolResource'
+ description: The azure ai search index resource.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for an Azure AI search tool as used to configure an agent.
+ AzureAISearchToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_search_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: An Azure AI Search tool call.
+ AzureAISearchToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_search_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Azure AI Search tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of an Azure AI Search tool call.
+ AzureAISearchToolResource:
+ type: object
+ required:
+ - indexes
+ properties:
+ indexes:
+ type: array
+ items:
+ $ref: '#/components/schemas/AISearchIndexResource'
+ maxItems: 1
+ description: |-
+ The indices attached to this agent. There can be a maximum of 1 index
+ resource attached to the agent.
+ description: A set of index resources used by the `azure_ai_search` tool.
+ AzureAISearchToolboxTool:
+ type: object
+ required:
+ - type
+ - azure_ai_search
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_search
+ azure_ai_search:
+ $ref: '#/components/schemas/AzureAISearchToolResource'
+ description: The azure ai search index resource.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: An Azure AI Search tool stored in a toolbox.
+ AzureAITraceDataSourcePreviewEvalRunDataSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_ai_trace_data_source_preview
+ description: The type of data source, always `azure_ai_trace_data_source_preview`.
+ trace_source:
+ $ref: '#/components/schemas/TraceSource'
+ description: The trace source that defines how traces are selected for evaluation.
+ allOf:
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: A wrapper data source that contains a polymorphic trace source to specify how traces are selected for evaluation.
+ AzureContentFilterBlocklistIdResult:
+ type: object
+ required:
+ - id
+ - filtered
+ properties:
+ id:
+ type: string
+ description: The ID of the custom blocklist.
+ filtered:
+ type: boolean
+ description: Whether the blocklist resulted in filtering.
+ description: A content filter blocklist ID result.
+ AzureContentFilterBlocklistResult:
+ type: object
+ required:
+ - filtered
+ properties:
+ filtered:
+ type: boolean
+ description: Whether any blocklist resulted in filtering.
+ details:
+ type: array
+ items:
+ $ref: '#/components/schemas/AzureContentFilterBlocklistIdResult'
+ description: The pairs of individual blocklist IDs and their filtering results.
+ description: A collection of filtering results for configured custom blocklists.
+ AzureContentFilterCitation:
+ type: object
+ properties:
+ license:
+ type: string
+ description: The license associated with the detection.
+ url:
+ type: string
+ format: uri
+ description: The URL associated with the license.
+ description: Citation details for protected material detection.
+ AzureContentFilterCompletionTextSpan:
+ type: object
+ required:
+ - completion_start_offset
+ - completion_end_offset
+ properties:
+ completion_start_offset:
+ type: integer
+ format: int32
+ description: Offset of the UTF32 code point which begins the span.
+ completion_end_offset:
+ type: integer
+ format: int32
+ description: Offset of the first UTF32 code point which is excluded from the span.
+ description: A representation of a span of completion text as used by Azure OpenAI content filter results.
+ AzureContentFilterCompletionTextSpanDetectionResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ - details
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether the content category was detected.
+ details:
+ type: array
+ items:
+ $ref: '#/components/schemas/AzureContentFilterCompletionTextSpan'
+ description: Detailed information about the detected completion text spans.
+ description: A content filter detection result with completion text span details.
+ AzureContentFilterDetectionResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether the content category was detected.
+ description: A content filter result indicating whether the content was detected and filtered.
+ AzureContentFilterDetectionWithCitationResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether the content category was detected.
+ citation:
+ $ref: '#/components/schemas/AzureContentFilterCitation'
+ description: Citation details describing the associated license and its location.
+ description: A content filter detection result that includes citation information for protected material.
+ AzureContentFilterDetectionWithReasonResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether the content category was detected.
+ reason:
+ type: string
+ description: A human-readable explanation of why the detection result was produced.
+ description: A content filter detection result that includes a reason description.
+ AzureContentFilterError:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: integer
+ format: int32
+ description: A machine-readable error code.
+ message:
+ type: string
+ description: A human-readable error message.
+ description: Error details from the content filtering system.
+ AzureContentFilterPersonallyIdentifiableInformationResult:
+ type: object
+ required:
+ - filtered
+ - detected
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ detected:
+ type: boolean
+ description: Whether PII was detected in the content.
+ sub_categories:
+ type: array
+ items:
+ $ref: '#/components/schemas/AzureContentFilterPiiSubCategoryResult'
+ description: Detailed results for individual PII subcategories.
+ description: A content filter detection result for Personally Identifiable Information.
+ AzureContentFilterPiiSubCategoryResult:
+ type: object
+ required:
+ - sub_category
+ - filtered
+ - detected
+ properties:
+ sub_category:
+ type: string
+ description: The PII subcategory that was evaluated.
+ filtered:
+ type: boolean
+ description: Whether the content was filtered for this subcategory.
+ detected:
+ type: boolean
+ description: Whether the subcategory was detected in the content.
+ description: Result details for an individual PII subcategory.
+ AzureContentFilterResultsForResponses:
+ type: object
+ properties:
+ sexual:
+ $ref: '#/components/schemas/AzureContentFilterSeverityResult'
+ description: Severity result for sexual content.
+ hate:
+ $ref: '#/components/schemas/AzureContentFilterSeverityResult'
+ description: Severity result for hate content.
+ violence:
+ $ref: '#/components/schemas/AzureContentFilterSeverityResult'
+ description: Severity result for violence content.
+ self_harm:
+ $ref: '#/components/schemas/AzureContentFilterSeverityResult'
+ description: Severity result for self-harm content.
+ profanity:
+ $ref: '#/components/schemas/AzureContentFilterDetectionResult'
+ description: Detection result for profanity.
+ custom_blocklists:
+ $ref: '#/components/schemas/AzureContentFilterBlocklistResult'
+ description: Results for configured custom blocklists.
+ jailbreak:
+ $ref: '#/components/schemas/AzureContentFilterDetectionResult'
+ description: Detection result for jailbreak attempts.
+ task_adherence:
+ $ref: '#/components/schemas/AzureContentFilterDetectionWithReasonResult'
+ description: Detection result for task adherence evaluation.
+ protected_material_text:
+ $ref: '#/components/schemas/AzureContentFilterDetectionResult'
+ description: Detection result for protected material text.
+ protected_material_code:
+ $ref: '#/components/schemas/AzureContentFilterDetectionWithCitationResult'
+ description: Detection result for protected material code with citation.
+ ungrounded_material:
+ $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult'
+ description: Detection result for ungrounded material with completion text span details.
+ personally_identifiable_information:
+ $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult'
+ description: Detection result for Personally Identifiable Information.
+ indirect_attack:
+ $ref: '#/components/schemas/AzureContentFilterDetectionResult'
+ description: Detection result for indirect attacks.
+ error:
+ $ref: '#/components/schemas/AzureContentFilterError'
+ description: Error details if content filtering evaluation failed.
+ description: Content filter results for the Responses API.
+ AzureContentFilterSeverity:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - safe
+ - low
+ - medium
+ - high
+ description: Ratings for the intensity and risk level of harmful content.
+ AzureContentFilterSeverityResult:
+ type: object
+ required:
+ - filtered
+ - severity
+ properties:
+ filtered:
+ type: boolean
+ description: Whether the content was filtered.
+ severity:
+ $ref: '#/components/schemas/AzureContentFilterSeverity'
+ description: The severity level of the content.
+ description: A content filter result indicating severity level and whether content was filtered.
+ AzureFunctionBinding:
+ type: object
+ required:
+ - type
+ - storage_queue
+ properties:
+ type:
+ type: string
+ enum:
+ - storage_queue
+ description: The type of binding, which is always 'storage_queue'.
+ storage_queue:
+ $ref: '#/components/schemas/AzureFunctionStorageQueue'
+ description: Storage queue.
+ description: The structure for keeping storage queue name and URI.
+ AzureFunctionDefinition:
+ type: object
+ required:
+ - function
+ - input_binding
+ - output_binding
+ properties:
+ function:
+ type: object
+ properties:
+ name:
+ type: string
+ description: The name of the function to be called.
+ description:
+ type: string
+ description: A description of what the function does, used by the model to choose when and how to call the function.
+ parameters:
+ type: object
+ unevaluatedProperties: {}
+ description: The parameters the functions accepts, described as a JSON Schema object.
+ required:
+ - name
+ - parameters
+ description: The definition of azure function and its parameters.
+ input_binding:
+ $ref: '#/components/schemas/AzureFunctionBinding'
+ description: Input storage queue. The queue storage trigger runs a function as messages are added to it.
+ output_binding:
+ $ref: '#/components/schemas/AzureFunctionBinding'
+ description: Output storage queue. The function writes output to this queue when the input items are processed.
+ description: The definition of Azure function.
+ AzureFunctionStorageQueue:
+ type: object
+ required:
+ - queue_service_endpoint
+ - queue_name
+ properties:
+ queue_service_endpoint:
+ type: string
+ description: URI to the Azure Storage Queue service allowing you to manipulate a queue.
+ queue_name:
+ type: string
+ description: The name of an Azure function storage queue.
+ description: The structure for keeping storage queue name and URI.
+ AzureFunctionTool:
+ type: object
+ required:
+ - type
+ - azure_function
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_function
+ description: The object type, which is always 'browser_automation'.
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ azure_function:
+ $ref: '#/components/schemas/AzureFunctionDefinition'
+ description: The Azure Function Tool definition.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for an Azure Function Tool, as used to configure an Agent.
+ AzureFunctionToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_function_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ name:
+ type: string
+ description: The name of the Azure Function being called.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: An Azure Function tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ AzureFunctionToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - name
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - azure_function_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ name:
+ type: string
+ description: The name of the Azure Function that was called.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Azure Function tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of an Azure Function tool call.
+ AzureOpenAIModelConfiguration:
+ type: object
+ required:
+ - type
+ - modelDeploymentName
+ properties:
+ type:
+ type: string
+ enum:
+ - AzureOpenAIModel
+ modelDeploymentName:
+ type: string
+ description: 'Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`).'
+ allOf:
+ - $ref: '#/components/schemas/RedTeamTargetConfig'
+ description: Azure OpenAI model configuration. The API version would be selected by the service for querying the model.
+ x-ms-foundry-meta:
+ required_previews:
+ - RedTeams=V1Preview
+ AzureUserSecurityContext:
+ type: object
+ properties:
+ application_name:
+ type: string
+ description: The name of the application. Sensitive personal information should not be included in this field.
+ end_user_id:
+ type: string
+ description: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.
+ end_user_tenant_id:
+ type: string
+ description: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant.
+ source_ip:
+ type: string
+ description: Captures the original client's IP address.
+ description: User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.
+ BaseCredentials:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/CredentialType'
+ description: The type of credential used by the connection
+ readOnly: true
+ discriminator:
+ propertyName: type
+ mapping:
+ ApiKey: '#/components/schemas/ApiKeyCredentials'
+ AAD: '#/components/schemas/EntraIDCredentials'
+ CustomKeys: '#/components/schemas/CustomCredential'
+ SAS: '#/components/schemas/SASCredentials'
+ None: '#/components/schemas/NoAuthenticationCredentials'
+ AgenticIdentityToken_Preview: '#/components/schemas/AgenticIdentityPreviewCredentials'
+ description: A base class for connection credentials
+ BingCustomSearchConfiguration:
+ type: object
+ required:
+ - project_connection_id
+ - instance_name
+ properties:
+ project_connection_id:
+ type: string
+ description: Project connection id for grounding with bing search
+ instance_name:
+ type: string
+ description: Name of the custom configuration instance given to config.
+ market:
+ type: string
+ description: The market where the results come from.
+ set_lang:
+ type: string
+ description: The language to use for user interface strings when calling Bing API.
+ count:
+ type: integer
+ format: int64
+ description: The number of search results to return in the bing api response
+ freshness:
+ type: string
+ description: Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters).
+ description: A bing custom search configuration.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingCustomSearchPreviewTool:
+ type: object
+ required:
+ - type
+ - bing_custom_search_preview
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_custom_search_preview
+ description: The object type, which is always 'bing_custom_search_preview'.
+ bing_custom_search_preview:
+ $ref: '#/components/schemas/BingCustomSearchToolParameters'
+ description: The bing custom search tool parameters.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for a Bing custom search tool as used to configure an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingCustomSearchToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_custom_search_preview_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A Bing custom search tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingCustomSearchToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_custom_search_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Bing custom search tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a Bing custom search tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingCustomSearchToolParameters:
+ type: object
+ required:
+ - search_configurations
+ properties:
+ search_configurations:
+ type: array
+ items:
+ $ref: '#/components/schemas/BingCustomSearchConfiguration'
+ maxItems: 1
+ description: |-
+ The project connections attached to this tool. There can be a maximum of 1 connection
+ resource attached to the tool.
+ description: The bing custom search tool parameters.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BingGroundingSearchConfiguration:
+ type: object
+ required:
+ - project_connection_id
+ properties:
+ project_connection_id:
+ type: string
+ description: Project connection id for grounding with bing search
+ market:
+ type: string
+ description: The market where the results come from.
+ set_lang:
+ type: string
+ description: The language to use for user interface strings when calling Bing API.
+ count:
+ type: integer
+ format: int64
+ description: The number of search results to return in the bing api response
+ freshness:
+ type: string
+ description: Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters).
+ description: Search configuration for Bing Grounding
+ BingGroundingSearchToolParameters:
+ type: object
+ required:
+ - search_configurations
+ properties:
+ search_configurations:
+ type: array
+ items:
+ $ref: '#/components/schemas/BingGroundingSearchConfiguration'
+ maxItems: 1
+ description: |-
+ The search configurations attached to this tool. There can be a maximum of 1
+ search configuration resource attached to the tool.
+ description: The bing grounding search tool parameters.
+ BingGroundingTool:
+ type: object
+ required:
+ - type
+ - bing_grounding
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_grounding
+ description: The object type, which is always 'bing_grounding'.
+ name:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ bing_grounding:
+ $ref: '#/components/schemas/BingGroundingSearchToolParameters'
+ description: The bing grounding search tool parameters.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for a bing grounding search tool as used to configure an agent.
+ BingGroundingToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_grounding_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A Bing grounding tool call.
+ BingGroundingToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - bing_grounding_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Bing grounding tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a Bing grounding tool call.
+ BlobReference:
+ type: object
+ required:
+ - blobUri
+ - storageAccountArmId
+ - credential
+ properties:
+ blobUri:
+ type: string
+ format: uri
+ description: 'Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path`'
+ storageAccountArmId:
+ type: string
+ description: ARM ID of the storage account to use.
+ credential:
+ $ref: '#/components/schemas/SasCredential'
+ description: Credential info to access the storage account.
+ description: Blob reference details.
+ BotServiceAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - BotService
+ allOf:
+ - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ BotServiceRbacAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - BotServiceRbac
+ allOf:
+ - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ BotServiceTenantAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - BotServiceTenant
+ allOf:
+ - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ BrowserAutomationPreviewTool:
+ type: object
+ required:
+ - type
+ - browser_automation_preview
+ properties:
+ type:
+ type: string
+ enum:
+ - browser_automation_preview
+ description: The object type, which is always 'browser_automation_preview'.
+ browser_automation_preview:
+ $ref: '#/components/schemas/BrowserAutomationToolParameters'
+ description: The Browser Automation Tool parameters.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: The input definition information for a Browser Automation Tool, as used to configure an Agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationPreviewToolboxTool:
+ type: object
+ required:
+ - type
+ - browser_automation_preview
+ properties:
+ type:
+ type: string
+ enum:
+ - browser_automation_preview
+ browser_automation_preview:
+ $ref: '#/components/schemas/BrowserAutomationToolParameters'
+ description: The Browser Automation Tool parameters.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A browser automation tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - browser_automation_preview_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A browser automation tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - browser_automation_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the browser automation tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a browser automation tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationToolConnectionParameters:
+ type: object
+ required:
+ - project_connection_id
+ properties:
+ project_connection_id:
+ type: string
+ description: The ID of the project connection to your Azure Playwright resource.
+ description: Definition of input parameters for the connection used by the Browser Automation Tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ BrowserAutomationToolParameters:
+ type: object
+ required:
+ - connection
+ properties:
+ connection:
+ $ref: '#/components/schemas/BrowserAutomationToolConnectionParameters'
+ description: The project connection parameters associated with the Browser Automation Tool.
+ description: Definition of input parameters for the Browser Automation Tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ CaptureStructuredOutputsTool:
+ type: object
+ required:
+ - type
+ - outputs
+ properties:
+ type:
+ type: string
+ enum:
+ - capture_structured_outputs
+ description: The type of the tool. Always `capture_structured_outputs`.
+ name:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
+ type: string
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ outputs:
+ $ref: '#/components/schemas/StructuredOutputDefinition'
+ description: The structured outputs to capture from the model.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool for capturing structured outputs
+ ChartCoordinate:
+ type: object
+ required:
+ - x
+ - 'y'
+ - size
+ properties:
+ x:
+ type: integer
+ format: int32
+ description: X-axis coordinate.
+ 'y':
+ type: integer
+ format: int32
+ description: Y-axis coordinate.
+ size:
+ type: integer
+ format: int32
+ description: Size of the chart element.
+ description: Coordinates for the analysis chart.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ ChatSummaryMemoryItem:
+ type: object
+ required:
+ - kind
+ properties:
+ kind:
+ type: string
+ enum:
+ - chat_summary
+ description: The kind of the memory item.
+ allOf:
+ - $ref: '#/components/schemas/MemoryItem'
+ description: A memory item containing a summary extracted from conversations.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ ClusterInsightResult:
+ type: object
+ required:
+ - summary
+ - clusters
+ properties:
+ summary:
+ $ref: '#/components/schemas/InsightSummary'
+ description: Summary of the insights report.
+ clusters:
+ type: array
+ items:
+ $ref: '#/components/schemas/InsightCluster'
+ description: List of clusters identified in the insights.
+ coordinates:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ChartCoordinate'
+ description: |2-
+ Optional mapping of IDs to 2D coordinates used by the UX for visualization.
+
+ The map keys are string identifiers (for example, a cluster id or a sample id)
+ and the values are the coordinates and visual size for rendering on a 2D chart.
+
+ This property is omitted unless the client requests coordinates (for example,
+ by passing `includeCoordinates=true` as a query parameter).
+
+ Example:
+ ```
+ {
+ "cluster-1": { "x": 12, "y": 34, "size": 8 },
+ "sample-123": { "x": 18, "y": 22, "size": 4 }
+ }
+ ```
+
+ Coordinates are intended only for client-side visualization and do not
+ modify the canonical insights results.
+ description: Insights from the cluster analysis.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ ClusterTokenUsage:
+ type: object
+ required:
+ - inputTokenUsage
+ - outputTokenUsage
+ - totalTokenUsage
+ properties:
+ inputTokenUsage:
+ type: integer
+ format: int32
+ description: input token usage
+ outputTokenUsage:
+ type: integer
+ format: int32
+ description: output token usage
+ totalTokenUsage:
+ type: integer
+ format: int32
+ description: total token usage
+ description: Token usage for cluster analysis
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ CodeBasedEvaluatorDefinition:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - code
+ code_text:
+ type: string
+ description: Inline code text for the evaluator
+ entry_point:
+ type: string
+ description: The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ image_tag:
+ type: string
+ description: The container image tag to use for evaluator code execution
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ blob_uri:
+ type: string
+ format: uri
+ description: The blob URI for the evaluator storage
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ allOf:
+ - $ref: '#/components/schemas/EvaluatorDefinition'
+ description: Code-based evaluator definition using python code
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ CodeConfiguration:
+ type: object
+ required:
+ - runtime
+ - entry_point
+ - dependency_resolution
+ properties:
+ runtime:
+ type: string
+ description: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13').
+ entry_point:
+ type: array
+ items:
+ type: string
+ description: The entry point command and arguments for the code execution.
+ dependency_resolution:
+ $ref: '#/components/schemas/CodeDependencyResolution'
+ description: |-
+ How package dependencies are resolved at deployment time. Defaults to `bundled`,
+ where the caller bundles all dependencies into the uploaded zip and the service
+ performs no remote build. `remote_build` instructs the service to build
+ dependencies remotely from the manifest included in the uploaded zip.
+ default: bundled
+ content_hash:
+ type: string
+ description: The SHA-256 hex digest of the uploaded code zip. Set by the service from the `x-ms-code-zip-sha256` request header; read-only in responses and never accepted in request payloads.
+ readOnly: true
+ description: Code-based deployment configuration for a hosted agent.
+ CodeDependencyResolution:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - bundled
+ - remote_build
+ description: How package dependencies are resolved at deployment time for a code-based hosted agent.
+ CodeInterpreterToolboxTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - code_interpreter
+ container:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.AutoCodeInterpreterToolParam'
+ description: |-
+ The code interpreter container. Can be a container ID or an object that
+ specifies uploaded file IDs to make available to your code, along with an
+ optional `memory_limit` setting.
+ If not provided, the service assumes auto.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A code interpreter tool stored in a toolbox.
+ CompletionMessageToolCallChunk:
+ type: object
+ required:
+ - id
+ - type
+ properties:
+ id:
+ type: string
+ description: The Id for the tool call.
+ type:
+ type: string
+ enum:
+ - function
+ description: The type of tool call, which is always "function".
+ function:
+ $ref: '#/components/schemas/FunctionToolCall'
+ description: Details of the function tool call, if applicable.
+ description: Tool call details within a message.
+ Connection:
+ type: object
+ required:
+ - name
+ - id
+ - type
+ - target
+ - isDefault
+ - credentials
+ - metadata
+ properties:
+ name:
+ type: string
+ description: The friendly name of the connection, provided by the user.
+ readOnly: true
+ id:
+ type: string
+ description: A unique identifier for the connection, generated by the service
+ readOnly: true
+ type:
+ $ref: '#/components/schemas/ConnectionType'
+ description: Category of the connection
+ readOnly: true
+ target:
+ type: string
+ description: The connection URL to be used for this service
+ readOnly: true
+ isDefault:
+ type: boolean
+ description: Whether the connection is tagged as the default connection of its type
+ readOnly: true
+ credentials:
+ $ref: '#/components/schemas/BaseCredentials'
+ description: The credentials used by the connection
+ readOnly: true
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Metadata of the connection
+ readOnly: true
+ description: Response from the list and get connections operations
+ ConnectionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - AzureOpenAI
+ - AzureBlob
+ - AzureStorageAccount
+ - CognitiveSearch
+ - CosmosDB
+ - ApiKey
+ - AppConfig
+ - AppInsights
+ - CustomKeys
+ - RemoteTool_Preview
+ description: The Type (or category) of the connection
+ ContainerAppAgentDefinition:
+ type: object
+ required:
+ - kind
+ - container_protocol_versions
+ - container_app_resource_id
+ - ingress_subdomain_suffix
+ properties:
+ kind:
+ type: string
+ enum:
+ - container_app
+ container_protocol_versions:
+ type: array
+ items:
+ $ref: '#/components/schemas/ProtocolVersionRecord'
+ description: The protocols that the agent supports for ingress communication of the containers.
+ examples:
+ - - protocol: responses
+ version: v0.1.1
+ - protocol: a2a
+ version: v0.3.0
+ container_app_resource_id:
+ type: string
+ description: The resource ID of the Azure Container App that hosts this agent. Not mutable across versions.
+ ingress_subdomain_suffix:
+ type: string
+ description: The suffix to apply to the app subdomain when sending ingress to the agent. This can be a label (e.g., '---current'), a specific revision (e.g., '--0000001'), or empty to use the default endpoint for the container app.
+ examples:
+ - --0000001
+ - ---current
+ - ''
+ allOf:
+ - $ref: '#/components/schemas/AgentDefinition'
+ description: The container app agent definition.
+ x-ms-foundry-meta:
+ required_previews:
+ - ContainerAgents=V1Preview
+ ContainerConfiguration:
+ type: object
+ required:
+ - image
+ properties:
+ image:
+ type: string
+ description: The container image for the hosted agent.
+ examples:
+ - my-registry.azurecr.io/my-hosted-agent:latest
+ description: Container-based deployment configuration for a hosted agent.
+ ContainerDetails:
+ type: object
+ required:
+ - provisioning_state
+ - state
+ - health_state
+ - replicas
+ - updated_on
+ properties:
+ provisioning_state:
+ type: string
+ description: The provisioning state of the container.
+ provisioning_error:
+ type: string
+ description: The provisioning error of the container, if any.
+ state:
+ type: string
+ description: The state of the container.
+ health_state:
+ type: string
+ description: The health state of the container.
+ replicas:
+ type: array
+ items:
+ $ref: '#/components/schemas/ContainerReplica'
+ description: The list of replicas in the container.
+ updated_on:
+ type: string
+ format: date-time
+ description: The last update time of the container.
+ description: Detailed information about the container.
+ x-ms-foundry-meta:
+ required_previews:
+ - ContainerAgents=V1Preview
+ ContainerLogKind:
+ type: string
+ enum:
+ - console
+ - system
+ description: The type of logs to stream from a container.
+ x-ms-foundry-meta:
+ required_previews:
+ - ContainerAgents=V1Preview
+ ContainerReplica:
+ type: object
+ required:
+ - name
+ - state
+ - container_state
+ properties:
+ name:
+ type: string
+ description: The name of the replica.
+ state:
+ type: string
+ description: The state of the replica.
+ container_state:
+ type: string
+ description: The container state of the replica.
+ description: Information about a container replica.
+ x-ms-foundry-meta:
+ required_previews:
+ - ContainerAgents=V1Preview
+ ContentFilterResult:
+ type: object
+ required:
+ - blocked
+ - source_type
+ - content_filter_results
+ properties:
+ blocked:
+ type: boolean
+ description: Whether the content was blocked by the content filter.
+ source_type:
+ type: string
+ description: The source type of the content filter evaluation (e.g., 'prompt', 'response', 'pre_tool_call', 'post_tool_call').
+ content_filter_results:
+ $ref: '#/components/schemas/AzureContentFilterResultsForResponses'
+ description: The content filter results for this evaluation.
+ tool_call_id:
+ type: string
+ description: The ID of the tool call associated with this content filter result, if applicable.
+ description: A content filter evaluation result for a specific source in the response.
+ ContinuousEvaluationRuleAction:
+ type: object
+ required:
+ - type
+ - evalId
+ properties:
+ type:
+ type: string
+ enum:
+ - continuousEvaluation
+ evalId:
+ type: string
+ description: Eval Id to add continuous evaluation runs to.
+ maxHourlyRuns:
+ type: integer
+ format: int32
+ description: Maximum number of evaluation runs allowed per hour.
+ samplingRate:
+ type: number
+ format: double
+ maximum: 100
+ description: Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the service-default is to evaluate every event, which is equivalent to setting a sampling rate of 100.
+ exclusiveMinimum: 0
+ default: 100
+ allOf:
+ - $ref: '#/components/schemas/EvaluationRuleAction'
+ description: Evaluation rule action for continuous evaluation.
+ ConversationGenPreviewItemGenerationParams:
+ type: object
+ required:
+ - type
+ - model
+ properties:
+ type:
+ type: string
+ enum:
+ - conversation_gen_preview
+ description: The type of item generation parameters, always `conversation_gen_preview`.
+ model:
+ type: string
+ description: The model deployment used for simulation, in the format '{connectionName}/modelDeploymentName'.
+ max_turns:
+ type: integer
+ format: int32
+ description: Maximum number of turns per simulated conversation. Defaults to 20.
+ default: 20
+ num_conversations:
+ type: integer
+ format: int32
+ description: Number of simulated conversations to generate per test scenario. Defaults to 5.
+ default: 5
+ data_mapping:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Mapping from source fields to response_id field, which is required for retrieving chat history.
+ sampling_params:
+ $ref: '#/components/schemas/ModelSamplingParams'
+ description: Sampling parameters for the conversation generation.
+ allOf:
+ - $ref: '#/components/schemas/ItemGenerationParams'
+ description: Represents the parameters for conversation simulation item generation.
+ ConversationIdTraceSource:
+ type: object
+ required:
+ - type
+ - conversation_ids
+ properties:
+ type:
+ type: string
+ enum:
+ - conversation_id_source
+ description: The type of trace source, always `conversation_id_source`.
+ conversation_ids:
+ type: array
+ items:
+ type: string
+ description: Collection of conversation identifiers to filter traces by.
+ allOf:
+ - $ref: '#/components/schemas/TraceSource'
+ description: A trace source that selects traces by conversation IDs.
+ CosmosDBIndex:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - CosmosDBNoSqlVectorStore
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/Index'
+ description: CosmosDB Vector Store Index Definition
+ CosmosDBIndexUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - CosmosDBNoSqlVectorStore
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/IndexUpdate'
+ description: CosmosDB Vector Store Index Definition
+ CreateAgentFromCodeContent:
+ type: object
+ properties:
+ metadata:
+ allOf:
+ - $ref: '#/components/schemas/CreateAgentVersionFromCodeMetadata'
+ description: JSON metadata including description and hosted definition.
+ code:
+ description: The code zip file (max 250 MB).
+ required:
+ - metadata
+ - code
+ CreateAgentFromManifestRequest:
+ type: object
+ required:
+ - name
+ - manifest_id
+ - parameter_values
+ properties:
+ name:
+ type: string
+ maxLength: 63
+ description: |-
+ The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ - Must start and end with alphanumeric characters,
+ - Can contain hyphens in the middle
+ - Must not exceed 63 characters.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ manifest_id:
+ type: string
+ description: The manifest ID to import the agent version from.
+ parameter_values:
+ type: object
+ unevaluatedProperties: {}
+ description: The inputs to the manifest that will result in a fully materialized Agent.
+ CreateAgentRequest:
+ type: object
+ required:
+ - name
+ - definition
+ properties:
+ name:
+ type: string
+ maxLength: 63
+ description: |-
+ The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ - Must start and end with alphanumeric characters,
+ - Can contain hyphens in the middle
+ - Must not exceed 63 characters.
+ state:
+ $ref: '#/components/schemas/AgentState'
+ description: The initial operational state of the agent. Defaults to 'enabled' if not specified.
+ default: enabled
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ definition:
+ $ref: '#/components/schemas/AgentDefinition'
+ description: The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - WorkflowAgents=V1Preview
+ - ExternalAgents=V1Preview
+ - DraftAgents=V1Preview
+ blueprint_reference:
+ $ref: '#/components/schemas/AgentBlueprintReference'
+ description: The blueprint reference for the agent.
+ draft:
+ type: boolean
+ description: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DraftAgents=V1Preview
+ default: false
+ agent_endpoint:
+ $ref: '#/components/schemas/AgentEndpointConfig'
+ description: An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent
+ agent_card:
+ $ref: '#/components/schemas/AgentCard'
+ description: Optional agent card for the agent
+ x-ms-foundry-meta:
+ conditional_previews:
+ - WorkflowAgents=V1Preview
+ - ExternalAgents=V1Preview
+ - DraftAgents=V1Preview
+ CreateAgentSessionRequest:
+ type: object
+ required:
+ - version_indicator
+ properties:
+ agent_session_id:
+ type: string
+ description: Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. Auto-generated if omitted.
+ version_indicator:
+ $ref: '#/components/schemas/VersionIndicator'
+ description: Determines which agent version backs the session.
+ description: Request to create a new agent session.
+ CreateAgentVersionFromCodeContent:
+ type: object
+ properties:
+ metadata:
+ allOf:
+ - $ref: '#/components/schemas/CreateAgentVersionFromCodeMetadata'
+ description: JSON metadata including description and hosted definition.
+ code:
+ description: The code zip file (max 250 MB).
+ required:
+ - metadata
+ - code
+ CreateAgentVersionFromCodeMetadata:
+ type: object
+ required:
+ - definition
+ properties:
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ definition:
+ $ref: '#/components/schemas/HostedAgentDefinition'
+ description: The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, and protocol_versions.
+ description: |-
+ JSON metadata for code-based agent operations (create, update, create version).
+ The agent name comes from the URL path parameter or the `x-ms-agent-name` header,
+ so it is not included in this model.
+ The content hash (SHA-256 of the zip) is carried in the `x-ms-code-zip-sha256` header.
+ CreateAgentVersionFromManifestRequest:
+ type: object
+ required:
+ - manifest_id
+ - parameter_values
+ properties:
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ manifest_id:
+ type: string
+ description: The manifest ID to import the agent version from.
+ parameter_values:
+ type: object
+ unevaluatedProperties: {}
+ description: The inputs to the manifest that will result in a fully materialized Agent.
+ CreateAgentVersionRequest:
+ type: object
+ required:
+ - definition
+ properties:
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the agent.
+ definition:
+ $ref: '#/components/schemas/AgentDefinition'
+ description: The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - WorkflowAgents=V1Preview
+ - ExternalAgents=V1Preview
+ - DraftAgents=V1Preview
+ blueprint_reference:
+ $ref: '#/components/schemas/AgentBlueprintReference'
+ description: The blueprint reference for the agent.
+ draft:
+ type: boolean
+ description: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DraftAgents=V1Preview
+ default: false
+ CreateEvalRequest:
+ type: object
+ required:
+ - data_source_config
+ - testing_criteria
+ properties:
+ name:
+ type: string
+ description: The name of the evaluation.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ data_source_config:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig'
+ - $ref: '#/components/schemas/AzureAIDataSourceConfig'
+ - $ref: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
+ description: The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation.
+ testing_criteria:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
+ - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
+ description: 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}}`).
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ title: CreateEvalRequest
+ CreateEvalRunRequest:
+ type: object
+ required:
+ - data_source
+ properties:
+ name:
+ type: string
+ description: The name of the run.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ data_source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource'
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Details about the run's data source.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ evaluation_level:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: The level at which evaluation is performed. Defaults to 'turn' if not specified.
+ default: turn
+ title: CreateEvalRunRequest
+ CreateOrUpdateManagedAgentIdentityBlueprintRequest:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ maxLength: 63
+ description: |-
+ The unique name that identifies the managed agent identity blueprint.
+ Name can be used to retrieve/update/delete the managed agent identity blueprint.
+ - Must start and end with alphanumeric characters,
+ - Can contain hyphens in the middle
+ - Must not exceed 63 characters.
+ CreateSkillVersionFromFilesBody:
+ type: object
+ properties:
+ files:
+ type: array
+ items: {}
+ description: Skill files to upload. Upload a single zip file or multiple individual files with relative paths.
+ default:
+ type: boolean
+ description: Whether to set this version as the default. Defaults to false.
+ required:
+ - files
+ CreatedBy:
+ type: object
+ properties:
+ agent:
+ $ref: '#/components/schemas/AgentId'
+ description: The agent that created the item.
+ response_id:
+ type: string
+ description: The response on which the item is created.
+ CredentialType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - ApiKey
+ - AAD
+ - SAS
+ - CustomKeys
+ - None
+ - AgenticIdentityToken_Preview
+ description: The credential type used by the connection
+ CronTrigger:
+ type: object
+ required:
+ - type
+ - expression
+ properties:
+ type:
+ type: string
+ enum:
+ - Cron
+ expression:
+ type: string
+ description: Cron expression that defines the schedule frequency.
+ timeZone:
+ type: string
+ description: Time zone for the cron schedule. Defaults to `UTC`.
+ default: UTC
+ startTime:
+ type: string
+ description: Start time for the cron schedule in ISO 8601 format.
+ endTime:
+ type: string
+ description: End time for the cron schedule in ISO 8601 format.
+ allOf:
+ - $ref: '#/components/schemas/Trigger'
+ description: Cron based trigger.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ CustomCredential:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - CustomKeys
+ description: The credential type
+ readOnly: true
+ unevaluatedProperties:
+ type: string
+ allOf:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: Custom credential definition
+ CustomRoutineTrigger:
+ type: object
+ required:
+ - type
+ - provider
+ - parameters
+ properties:
+ type:
+ type: string
+ enum:
+ - custom
+ description: The trigger type.
+ provider:
+ type: string
+ maxLength: 128
+ description: The external provider that emits the custom event.
+ event_name:
+ type: string
+ maxLength: 256
+ description: The provider-specific event name that fires the routine.
+ parameters:
+ type: object
+ unevaluatedProperties: {}
+ description: Provider-specific trigger parameters.
+ allOf:
+ - $ref: '#/components/schemas/RoutineTrigger'
+ description: A custom event routine trigger.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ DailyRecurrenceSchedule:
+ type: object
+ required:
+ - type
+ - hours
+ properties:
+ type:
+ type: string
+ enum:
+ - Daily
+ description: Daily recurrence type.
+ hours:
+ type: array
+ items:
+ type: integer
+ format: int32
+ description: Hours for the recurrence schedule.
+ allOf:
+ - $ref: '#/components/schemas/RecurrenceSchedule'
+ description: Daily recurrence schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ DataGenerationJob:
+ type: object
+ required:
+ - id
+ - status
+ - created_at
+ properties:
+ id:
+ type: string
+ description: Server-assigned unique identifier.
+ readOnly: true
+ inputs:
+ $ref: '#/components/schemas/DataGenerationJobInputs'
+ description: Caller-supplied inputs.
+ result:
+ $ref: '#/components/schemas/DataGenerationJobResult'
+ description: Result produced on success.
+ readOnly: true
+ status:
+ $ref: '#/components/schemas/JobStatus'
+ description: Current lifecycle status.
+ readOnly: true
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error details — populated only on failure.
+ readOnly: true
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).
+ readOnly: true
+ finished_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job was finished, represented in Unix time (seconds since January 1, 1970).
+ readOnly: true
+ description: Data Generation Job resource.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobInputs:
+ type: object
+ required:
+ - name
+ - sources
+ - options
+ - scenario
+ properties:
+ name:
+ type: string
+ description: The display name of the data generation job.
+ sources:
+ type: array
+ items:
+ $ref: '#/components/schemas/DataGenerationJobSource'
+ description: The sources used for the data generation job.
+ options:
+ $ref: '#/components/schemas/DataGenerationJobOptions'
+ description: The options for the data generation job.
+ scenario:
+ $ref: '#/components/schemas/DataGenerationJobScenario'
+ description: The scenario of the data generation job. Either for fine-tuning or evaluation.
+ output_options:
+ $ref: '#/components/schemas/DataGenerationJobOutputOptions'
+ description: Optional caller-supplied metadata for the job's output. See individual fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.
+ description: Caller-supplied inputs for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobOptions:
+ type: object
+ required:
+ - type
+ - max_samples
+ properties:
+ type:
+ $ref: '#/components/schemas/DataGenerationJobType'
+ description: The data generation job type.
+ max_samples:
+ type: integer
+ format: int32
+ description: Maximum number of samples to generate.
+ train_split:
+ type: number
+ format: float
+ minimum: 0
+ maximum: 1
+ description: The proportion of the generated data to be used for training when the data is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1.
+ model_options:
+ $ref: '#/components/schemas/DataGenerationModelOptions'
+ description: The LLM model options.
+ discriminator:
+ propertyName: type
+ mapping:
+ simple_qna: '#/components/schemas/SimpleQnADataGenerationJobOptions'
+ traces: '#/components/schemas/TracesDataGenerationJobOptions'
+ tool_use: '#/components/schemas/ToolUseFineTuningDataGenerationJobOptions'
+ description: Options for managing data generation jobs.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobOutput:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/DataGenerationJobOutputType'
+ description: The type of the output.
+ discriminator:
+ propertyName: type
+ mapping:
+ file: '#/components/schemas/FileDataGenerationJobOutput'
+ dataset: '#/components/schemas/DatasetDataGenerationJobOutput'
+ description: Output information for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobOutputOptions:
+ type: object
+ properties:
+ name:
+ type: string
+ description: Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario).
+ description:
+ type: string
+ description: Description to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs.
+ description: Output options for data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobOutputType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - file
+ - dataset
+ description: The supported output file types for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobResult:
+ type: object
+ required:
+ - generated_samples
+ properties:
+ outputs:
+ type: array
+ items:
+ $ref: '#/components/schemas/DataGenerationJobOutput'
+ description: 'The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.'
+ generated_samples:
+ type: integer
+ format: int32
+ description: The number of samples actually generated.
+ token_usage:
+ $ref: '#/components/schemas/DataGenerationTokenUsage'
+ description: The token usage information for the data generation job.
+ description: Result produced by a successful data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobScenario:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - supervised_finetuning
+ - reinforcement_finetuning
+ - evaluation
+ description: The supported scenarios for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/DataGenerationJobSourceType'
+ description: The type of source.
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ discriminator:
+ propertyName: type
+ mapping:
+ prompt: '#/components/schemas/PromptDataGenerationJobSource'
+ agent: '#/components/schemas/AgentDataGenerationJobSource'
+ traces: '#/components/schemas/TracesDataGenerationJobSource'
+ file: '#/components/schemas/FileDataGenerationJobSource'
+ description: The base source model for data generation jobs.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobSourceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - agent
+ - traces
+ - file
+ description: The supported source types for data generation jobs.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationJobType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - simple_qna
+ - traces
+ - tool_use
+ description: The supported data generation job types.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationModelOptions:
+ type: object
+ required:
+ - model
+ properties:
+ model:
+ type: string
+ description: Base model name used to generate data.
+ description: LLM model options for data generation jobs.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataGenerationTokenUsage:
+ type: object
+ required:
+ - prompt_tokens
+ - completion_tokens
+ - total_tokens
+ properties:
+ prompt_tokens:
+ type: integer
+ format: int64
+ description: The number of prompt tokens used.
+ readOnly: true
+ completion_tokens:
+ type: integer
+ format: int64
+ description: The number of completion tokens generated.
+ readOnly: true
+ total_tokens:
+ type: integer
+ format: int64
+ description: Total number of tokens used.
+ readOnly: true
+ description: Token usage information for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DataSourceConfig:
+ type: object
+ required:
+ - type
+ - schema
+ properties:
+ type:
+ type: string
+ description: The data source type discriminator.
+ schema:
+ type: object
+ unevaluatedProperties: {}
+ description: The overall object JSON schema for the run data source items.
+ discriminator:
+ propertyName: type
+ mapping:
+ azure_ai_source: '#/components/schemas/AzureAIDataSourceConfig'
+ description: Base class for run data sources with discriminator support.
+ DatasetDataGenerationJobOutput:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - dataset
+ description: Dataset output.
+ id:
+ type: string
+ description: The id of the output dataset created.
+ readOnly: true
+ name:
+ type: string
+ description: The name of the output dataset.
+ readOnly: true
+ version:
+ type: string
+ description: The version of the output dataset.
+ readOnly: true
+ description:
+ type: string
+ description: Description of the output dataset.
+ readOnly: true
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary of the output dataset.
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/DataGenerationJobOutput'
+ description: Dataset output for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ DatasetEvaluationSuiteJobSource:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ type:
+ type: string
+ enum:
+ - dataset
+ description: The source type for this source, which is Dataset.
+ name:
+ type: string
+ description: The name of the dataset.
+ version:
+ type: string
+ description: The version of the dataset. If not specified, the latest version is used.
+ allOf:
+ - $ref: '#/components/schemas/EvaluationSuiteJobSource'
+ description: Dataset source for evaluation suite generation jobs — reference to a dataset.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ DatasetEvaluatorGenerationJobSource:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ type:
+ type: string
+ enum:
+ - dataset
+ description: The source type for this source, which is Dataset.
+ name:
+ type: string
+ description: The name of the dataset.
+ version:
+ type: string
+ description: The version of the dataset. If not specified, the latest version is used.
+ allOf:
+ - $ref: '#/components/schemas/EvaluatorGenerationJobSource'
+ description: Dataset source for evaluator generation jobs — reference to a dataset.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ DatasetReference:
+ type: object
+ required:
+ - name
+ - version
+ properties:
+ name:
+ type: string
+ description: Dataset name.
+ version:
+ type: string
+ description: Dataset version.
+ description: Reference to a versioned Foundry Dataset.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ DatasetType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - uri_file
+ - uri_folder
+ description: Enum to determine the type of data.
+ DatasetVersion:
+ type: object
+ required:
+ - dataUri
+ - type
+ - name
+ - version
+ properties:
+ dataUri:
+ type: string
+ minLength: 1
+ pattern: '[a-zA-Z0-9_]'
+ description: URI of the data ([example](https://go.microsoft.com/fwlink/?linkid=2202330))
+ type:
+ $ref: '#/components/schemas/DatasetType'
+ description: Dataset type
+ isReference:
+ type: boolean
+ description: Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted
+ readOnly: true
+ connectionName:
+ type: string
+ description: The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset
+ id:
+ type: string
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
+ name:
+ type: string
+ description: The name of the resource
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource
+ readOnly: true
+ discriminator:
+ propertyName: type
+ mapping:
+ uri_file: '#/components/schemas/FileDatasetVersion'
+ uri_folder: '#/components/schemas/FolderDatasetVersion'
+ description: DatasetVersion Definition
+ DatasetVersionUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/DatasetType'
+ description: Dataset type
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ discriminator:
+ propertyName: type
+ mapping:
+ uri_file: '#/components/schemas/FileDatasetVersionUpdate'
+ uri_folder: '#/components/schemas/FolderDatasetVersionUpdate'
+ description: DatasetVersion Definition
+ DayOfWeek:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - Sunday
+ - Monday
+ - Tuesday
+ - Wednesday
+ - Thursday
+ - Friday
+ - Saturday
+ description: Days of the week for recurrence schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ DeleteAgentResponse:
+ type: object
+ required:
+ - object
+ - name
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - agent.deleted
+ description: The object type. Always 'agent.deleted'.
+ name:
+ type: string
+ description: The name of the agent.
+ deleted:
+ type: boolean
+ description: Whether the agent was successfully deleted.
+ description: A deleted agent Object
+ DeleteAgentVersionResponse:
+ type: object
+ required:
+ - object
+ - name
+ - version
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - agent.version.deleted
+ description: The object type. Always 'agent.version.deleted'.
+ name:
+ type: string
+ description: The name of the agent.
+ version:
+ type: string
+ description: The version identifier of the agent.
+ deleted:
+ type: boolean
+ description: Whether the agent was successfully deleted.
+ description: A deleted agent version Object
+ DeleteEvalResponse:
+ type: object
+ required:
+ - object
+ - eval_id
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - eval.deleted
+ description: The object type. Always 'eval.deleted'.
+ eval_id:
+ type: string
+ description: id of the eval.
+ deleted:
+ type: boolean
+ description: Whether the eval was successfully deleted.
+ description: A deleted evaluation Object
+ DeleteEvalRunResponse:
+ type: object
+ properties:
+ object:
+ type: string
+ enum:
+ - eval.deleted
+ description: The object type. Always 'eval.deleted'.
+ run_id:
+ type: string
+ description: id of the eval.
+ deleted:
+ type: boolean
+ description: Whether the eval was successfully deleted.
+ description: A deleted evaluation run Object.
+ DeleteMemoryResponse:
+ type: object
+ required:
+ - object
+ - memory_id
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - memory_store.item.deleted
+ description: The object type. Always 'memory_store.item.deleted'.
+ memory_id:
+ type: string
+ description: The unique ID of the deleted memory item.
+ deleted:
+ type: boolean
+ description: Whether the memory item was successfully deleted.
+ description: Response for deleting a memory item from a memory store.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ DeleteMemoryStoreResponse:
+ type: object
+ required:
+ - object
+ - name
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - memory_store.deleted
+ description: The object type. Always 'memory_store.deleted'.
+ name:
+ type: string
+ description: The name of the memory store.
+ deleted:
+ type: boolean
+ description: Whether the memory store was successfully deleted.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ DeleteResponseResult:
+ type: object
+ required:
+ - id
+ - object
+ - deleted
+ properties:
+ id:
+ type: string
+ description: The operation ID.
+ object:
+ type: string
+ enum:
+ - response
+ description: Always return 'response'.
+ deleted:
+ type: boolean
+ enum:
+ - true
+ description: Always return true
+ description: The result of a delete response operation.
+ DeleteSkillResponse:
+ type: object
+ required:
+ - id
+ - name
+ - deleted
+ properties:
+ id:
+ type: string
+ description: The unique identifier of the deleted skill.
+ name:
+ $ref: '#/components/schemas/SkillName'
+ description: The unique name of the skill.
+ deleted:
+ type: boolean
+ description: Whether the skill was successfully deleted.
+ description: A deleted skill.
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ DeleteSkillVersionResponse:
+ type: object
+ required:
+ - id
+ - name
+ - deleted
+ - version
+ properties:
+ id:
+ type: string
+ description: The unique identifier of the deleted skill version.
+ name:
+ $ref: '#/components/schemas/SkillName'
+ description: The name of the skill.
+ deleted:
+ type: boolean
+ description: Whether the skill version was successfully deleted.
+ version:
+ type: string
+ description: The version that was deleted.
+ description: A deleted skill version.
+ x-ms-foundry-meta:
+ required_previews:
+ - Skills=V1Preview
+ Deployment:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ type:
+ $ref: '#/components/schemas/DeploymentType'
+ description: The type of the deployment
+ name:
+ type: string
+ description: Name of the deployment
+ readOnly: true
+ discriminator:
+ propertyName: type
+ mapping:
+ ModelDeployment: '#/components/schemas/ModelDeployment'
+ description: Model Deployment Definition
+ DeploymentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - ModelDeployment
+ DeveloperMessage:
+ type: object
+ required:
+ - role
+ - content
+ properties:
+ role:
+ type: string
+ enum:
+ - developer
+ description: Indicates this is a developer message.
+ content:
+ type: string
+ description: Content provided by a developer to guide model behavior in an evaluation context.
+ allOf:
+ - $ref: '#/components/schemas/Message'
+ description: A message authored by a developer to guide the model during evaluation.
+ Dimension:
+ type: object
+ required:
+ - id
+ - description
+ - weight
+ properties:
+ id:
+ type: string
+ description: Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. Provided by the user when manually creating a rubric evaluator or during human-in-the-loop review of a generated set; the generation pipeline produces an initial value the user can edit. Editable when saving new versions.
+ description:
+ type: string
+ description: What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and pursues the appropriate workflow').
+ weight:
+ type: integer
+ format: int32
+ minimum: 1
+ maximum: 10
+ description: Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension weight 8-10; all others use 1-6. User edits are not constrained by this heuristic.
+ always_applicable:
+ type: boolean
+ description: When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is not specified by the caller.
+ default: false
+ description: A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ DispatchRoutineRequest:
+ type: object
+ properties:
+ payload:
+ $ref: '#/components/schemas/RoutineDispatchPayload'
+ description: A direct action-input override sent downstream when testing a routine.
+ description: Request body for the public dispatch_async route.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ DispatchRoutineResponse:
+ type: object
+ properties:
+ dispatch_id:
+ type: string
+ description: The dispatch identifier created for the routine dispatch.
+ action_correlation_id:
+ type: string
+ description: A downstream action correlation identifier, when available.
+ task_id:
+ type: string
+ description: A workspace task identifier created for the dispatch, when available.
+ description: Identifiers returned after a routine dispatch is queued.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ EndpointBasedEvaluatorDefinition:
+ type: object
+ required:
+ - type
+ - connection_name
+ properties:
+ type:
+ type: string
+ enum:
+ - endpoint
+ connection_name:
+ type: string
+ minLength: 1
+ description: "Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends `api-key` header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity)."
+ allOf:
+ - $ref: '#/components/schemas/EvaluatorDefinition'
+ description: Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row.
+ EntraAuthorizationScheme:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - Entra
+ allOf:
+ - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
+ EntraIDCredentials:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - AAD
+ description: The credential type
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: Entra ID credential definition
+ Eval:
+ type: object
+ required:
+ - object
+ - id
+ - name
+ - data_source_config
+ - testing_criteria
+ - created_at
+ - metadata
+ properties:
+ object:
+ type: string
+ enum:
+ - eval
+ description: The object type.
+ x-stainless-const: true
+ default: eval
+ id:
+ type: string
+ description: Unique identifier for the evaluation.
+ name:
+ type: string
+ description: The name of the evaluation.
+ data_source_config:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig'
+ - $ref: '#/components/schemas/AzureAIDataSourceConfig'
+ - $ref: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
+ description: Configuration of data sources used in runs of the evaluation.
+ testing_criteria:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
+ - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
+ description: A list of testing criteria.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the eval was created.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ modified_at:
+ $ref: '#/components/schemas/integer'
+ description: Unix timestamp (in seconds) when the evaluation run was last modified.
+ created_by:
+ type: string
+ description: the name of the person who created the run.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ description: |-
+ 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
+ title: Eval
+ x-oaiMeta:
+ name: The eval object
+ group: evals
+ example: |
+ {
+ "object": "eval",
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "data_source_config": {
+ "type": "custom",
+ "item_schema": {
+ "type": "object",
+ "properties": {
+ "label": {"type": "string"},
+ },
+ "required": ["label"]
+ },
+ "include_sample_schema": true
+ },
+ "testing_criteria": [
+ {
+ "name": "My string check grader",
+ "type": "string_check",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq",
+ }
+ ],
+ "name": "External Data Eval",
+ "created_at": 1739314509,
+ "metadata": {
+ "test": "synthetics",
+ }
+ }
+ EvalCsvFileIdSource:
+ type: object
+ required:
+ - type
+ - id
+ properties:
+ type:
+ type: string
+ enum:
+ - file_id
+ description: The type of source, always `file_id`.
+ id:
+ type: string
+ description: The identifier of the uploaded CSV file.
+ description: Represents a reference to an uploaded CSV file used as a source for evaluation data.
+ EvalCsvRunDataSource:
+ type: object
+ required:
+ - type
+ - source
+ properties:
+ type:
+ type: string
+ enum:
+ - csv
+ description: The type of data source, always `csv`.
+ source:
+ $ref: '#/components/schemas/EvalCsvFileIdSource'
+ description: The source of the CSV data, either inline content or a file reference.
+ allOf:
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Represents a CSV data source for evaluation runs.
+ EvalResult:
+ type: object
+ required:
+ - name
+ - type
+ - score
+ - passed
+ properties:
+ name:
+ type: string
+ description: name of the check
+ type:
+ type: string
+ description: type of the check
+ score:
+ type: number
+ format: float
+ description: score
+ passed:
+ type: boolean
+ description: indicates if the check passed or failed
+ description: Result of the evaluation.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvalRun:
+ type: object
+ required:
+ - object
+ - id
+ - eval_id
+ - status
+ - model
+ - name
+ - created_at
+ - report_url
+ - result_counts
+ - per_model_usage
+ - per_testing_criteria_results
+ - data_source
+ - metadata
+ - error
+ properties:
+ object:
+ type: string
+ enum:
+ - eval.run
+ description: The type of the object. Always "eval.run".
+ x-stainless-const: true
+ default: eval.run
+ id:
+ type: string
+ description: Unique identifier for the evaluation run.
+ eval_id:
+ type: string
+ description: The identifier of the associated evaluation.
+ status:
+ type: string
+ description: The status of the evaluation run.
+ model:
+ type: string
+ description: The model that is evaluated, if applicable.
+ name:
+ type: string
+ description: The name of the evaluation run.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the evaluation run was created.
+ report_url:
+ type: string
+ format: uri
+ description: The URL to the rendered evaluation run report on the UI dashboard.
+ result_counts:
+ $ref: '#/components/schemas/OpenAI.EvalRunResultCounts'
+ description: Counters summarizing the outcomes of the evaluation run.
+ per_model_usage:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalRunPerModelUsage'
+ description: Usage statistics for each model during the evaluation run.
+ per_testing_criteria_results:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults'
+ description: Results per testing criteria applied during the evaluation run.
+ data_source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource'
+ - $ref: '#/components/schemas/EvalRunDataSource'
+ description: Information about the run's data source.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ error:
+ $ref: '#/components/schemas/OpenAI.EvalApiError'
+ modified_at:
+ $ref: '#/components/schemas/integer'
+ description: Unix timestamp (in seconds) when the evaluation run was last modified.
+ created_by:
+ type: string
+ description: the name of the person who created the run.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ evaluation_level:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: The level at which evaluation is performed. Defaults to 'turn' if not specified.
+ default: turn
+ description: A schema representing an evaluation run.
+ title: EvalRun
+ x-oaiMeta:
+ name: The eval run object
+ group: evals
+ example: |
+ {
+ "object": "eval.run",
+ "id": "evalrun_67e57965b480819094274e3a32235e4c",
+ "eval_id": "eval_67e579652b548190aaa83ada4b125f47",
+ "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c",
+ "status": "queued",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Summit Addresses Climate Change Strategies",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Major Retailer Reports Record-Breaking Holiday Sales",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "National Team Qualifies for World Championship Finals",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Manufacturer Announces Merger with Competitor",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Breakthrough in Renewable Energy Technology Unveiled",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "World Leaders Sign Historic Climate Agreement",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Professional Athlete Sets New Record in Championship Event",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Financial Institutions Adapt to New Regulatory Requirements",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Tech Conference Showcases Advances in Artificial Intelligence",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Markets Respond to Oil Price Fluctuations",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Cooperation Strengthened Through New Treaty",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Sports League Announces Revised Schedule for Upcoming Season",
+ "ground_truth": "Sports"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+ EvalRunDataSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ description: The data source type discriminator.
+ discriminator:
+ propertyName: type
+ mapping:
+ azure_ai_traces_preview: '#/components/schemas/TracesPreviewEvalRunDataSource'
+ azure_ai_synthetic_data_gen_preview: '#/components/schemas/SyntheticDataGenerationPreviewEvalRunDataSource'
+ azure_ai_responses: '#/components/schemas/AzureAIResponsesEvalRunDataSource'
+ azure_ai_target_completions: '#/components/schemas/TargetCompletionEvalRunDataSource'
+ csv: '#/components/schemas/EvalCsvRunDataSource'
+ azure_ai_red_team: '#/components/schemas/RedTeamEvalRunDataSource'
+ azure_ai_trace_data_source_preview: '#/components/schemas/AzureAITraceDataSourcePreviewEvalRunDataSource'
+ azure_ai_benchmark_preview: '#/components/schemas/AzureAIBenchmarkPreviewEvalRunDataSource'
+ description: Base class for run data sources with discriminator support.
+ EvalRunOutputItem:
+ type: object
+ required:
+ - object
+ - id
+ - run_id
+ - eval_id
+ - created_at
+ - status
+ - datasource_item_id
+ - datasource_item
+ - results
+ - sample
+ properties:
+ object:
+ type: string
+ enum:
+ - eval.run.output_item
+ description: The type of the object. Always "eval.run.output_item".
+ x-stainless-const: true
+ default: eval.run.output_item
+ id:
+ type: string
+ description: Unique identifier for the evaluation run output item.
+ run_id:
+ type: string
+ description: The identifier of the evaluation run associated with this output item.
+ eval_id:
+ type: string
+ description: The identifier of the evaluation group.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the evaluation run was created.
+ status:
+ type: string
+ description: The status of the evaluation run.
+ datasource_item_id:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The identifier for the data source item.
+ datasource_item:
+ type: object
+ unevaluatedProperties: {}
+ description: Details of the input data source item.
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunOutputItemResult'
+ description: A list of grader results for this output item.
+ sample:
+ $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSample'
+ description: A sample containing the input and output of the evaluation run.
+ description: A schema representing an evaluation run output item.
+ title: EvalRunOutputItem
+ x-oaiMeta:
+ name: The eval run output item object
+ group: evals
+ example: |
+ {
+ "object": "eval.run.output_item",
+ "id": "outputitem_67abd55eb6548190bb580745d5644a33",
+ "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "created_at": 1739314509,
+ "status": "pass",
+ "datasource_item_id": 137,
+ "datasource_item": {
+ "teacher": "To grade essays, I only check for style, content, and grammar.",
+ "student": "I am a student who is trying to write the best essay."
+ },
+ "results": [
+ {
+ "name": "String Check Grader",
+ "type": "string-check-grader",
+ "score": 1.0,
+ "passed": true,
+ }
+ ],
+ "sample": {
+ "input": [
+ {
+ "role": "system",
+ "content": "You are an evaluator bot..."
+ },
+ {
+ "role": "user",
+ "content": "You are assessing..."
+ }
+ ],
+ "output": [
+ {
+ "role": "assistant",
+ "content": "The rubric is not clear nor concise."
+ }
+ ],
+ "finish_reason": "stop",
+ "model": "gpt-4o-2024-08-06",
+ "usage": {
+ "total_tokens": 521,
+ "completion_tokens": 2,
+ "prompt_tokens": 519,
+ "cached_tokens": 0
+ },
+ "error": null,
+ "temperature": 1.0,
+ "max_completion_tokens": 2048,
+ "top_p": 1.0,
+ "seed": 42
+ }
+ }
+ EvalRunOutputItemResult:
+ type: object
+ required:
+ - name
+ - score
+ - passed
+ properties:
+ name:
+ type: string
+ description: The name of the grader.
+ type:
+ type: string
+ description: The grader type (for example, "string-check-grader").
+ score:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The numeric score produced by the grader.
+ passed:
+ type: boolean
+ description: Whether the grader considered the output a pass.
+ sample:
+ anyOf:
+ - type: object
+ unevaluatedProperties: {}
+ - type: 'null'
+ description: Optional sample or intermediate data produced by the grader.
+ status:
+ $ref: '#/components/schemas/EvalRunOutputItemResultStatus'
+ description: 'The evaluation status for this result item. Values: "completed", "errored", "skipped". Null if not provided by evaluator. When status is skipped, passed/score can be ignored.'
+ metric:
+ type: string
+ description: The name of the metric (e.g., "fluency", "f1_score").
+ label:
+ type: string
+ description: The label associated with the test criteria metric (e.g., "pass", "fail", "good", "bad").
+ threshold:
+ type: number
+ format: float
+ description: The threshold used to determine pass/fail for this test criteria, if it is numerical.
+ reason:
+ type: string
+ description: The reason for the test criteria metric.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Additional details about the test criteria metric.
+ unevaluatedProperties: {}
+ description: A single grader result for an evaluation run output item.
+ title: EvalRunOutputItemResult
+ EvalRunOutputItemResultStatus:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - completed
+ - errored
+ - skipped
+ description: The evaluation status for an evaluation run output item result.
+ EvalRunOutputItemSampleInput:
+ type: object
+ required:
+ - role
+ - content
+ - tool_calls
+ properties:
+ role:
+ type: string
+ content:
+ type: string
+ tool_calls:
+ type: array
+ items:
+ $ref: '#/components/schemas/CompletionMessageToolCallChunk'
+ description: Tool calls made within the message, if any.
+ description: A message in the evaluation run.
+ EvalRunOutputItemSampleOutput:
+ type: object
+ required:
+ - tool_calls
+ properties:
+ role:
+ type: string
+ content:
+ type: string
+ tool_calls:
+ type: array
+ items:
+ $ref: '#/components/schemas/CompletionMessageToolCallChunk'
+ description: Tool calls made within the message, if any.
+ description: A message in the evaluation run.
+ EvalRunResultCompareItem:
+ type: object
+ required:
+ - treatmentRunId
+ - treatmentRunSummary
+ - deltaEstimate
+ - pValue
+ - treatmentEffect
+ properties:
+ treatmentRunId:
+ type: string
+ description: The treatment run ID.
+ treatmentRunSummary:
+ $ref: '#/components/schemas/EvalRunResultSummary'
+ description: Summary statistics of the treatment run.
+ deltaEstimate:
+ type: number
+ format: float
+ description: Estimated difference between treatment and baseline.
+ pValue:
+ type: number
+ format: float
+ description: P-value for the treatment effect.
+ treatmentEffect:
+ $ref: '#/components/schemas/TreatmentEffectType'
+ description: Type of treatment effect.
+ description: Metric comparison for a treatment against the baseline.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvalRunResultComparison:
+ type: object
+ required:
+ - testingCriteria
+ - metric
+ - evaluator
+ - baselineRunSummary
+ - compareItems
+ properties:
+ testingCriteria:
+ type: string
+ description: Name of the testing criteria.
+ metric:
+ type: string
+ description: Metric being evaluated.
+ evaluator:
+ type: string
+ description: Name of the evaluator for this testing criteria.
+ baselineRunSummary:
+ $ref: '#/components/schemas/EvalRunResultSummary'
+ description: Summary statistics of the baseline run.
+ compareItems:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunResultCompareItem'
+ description: List of comparison results for each treatment run.
+ description: Comparison results for treatment runs against the baseline.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvalRunResultSummary:
+ type: object
+ required:
+ - runId
+ - sampleCount
+ - average
+ - standardDeviation
+ properties:
+ runId:
+ type: string
+ description: The evaluation run ID.
+ sampleCount:
+ type: integer
+ format: int32
+ description: Number of samples in the evaluation run.
+ average:
+ type: number
+ format: float
+ description: Average value of the metric in the evaluation run.
+ standardDeviation:
+ type: number
+ format: float
+ description: Standard deviation of the metric in the evaluation run.
+ description: Summary statistics of a metric in an evaluation run.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ Evaluation:
+ type: object
+ required:
+ - id
+ - data
+ - evaluators
+ properties:
+ id:
+ type: string
+ description: Identifier of the evaluation.
+ readOnly: true
+ data:
+ $ref: '#/components/schemas/InputData'
+ description: Data for evaluation.
+ displayName:
+ type: string
+ description: Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique.
+ description:
+ type: string
+ description: Description of the evaluation. It can be used to store additional information about the evaluation and is mutable.
+ status:
+ type: string
+ description: Status of the evaluation. It is set by service and is read-only.
+ readOnly: true
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Evaluation's tags. Unlike properties, tags are fully mutable.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.
+ evaluators:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/EvaluatorConfiguration'
+ description: Evaluators to be used for the evaluation.
+ target:
+ $ref: '#/components/schemas/EvaluationTarget'
+ description: Specifies the type and configuration of the entity used for this evaluation.
+ description: Evaluation Definition
+ EvaluationComparisonInsightRequest:
+ type: object
+ required:
+ - type
+ - evalId
+ - baselineRunId
+ - treatmentRunIds
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationComparison
+ description: The type of request.
+ evalId:
+ type: string
+ description: Identifier for the evaluation.
+ baselineRunId:
+ type: string
+ description: The baseline run ID for comparison.
+ treatmentRunIds:
+ type: array
+ items:
+ type: string
+ description: List of treatment run IDs for comparison.
+ allOf:
+ - $ref: '#/components/schemas/InsightRequest'
+ description: Evaluation Comparison Request
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationComparisonInsightResult:
+ type: object
+ required:
+ - type
+ - comparisons
+ - method
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationComparison
+ description: The type of insights result.
+ comparisons:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunResultComparison'
+ description: Comparison results for each treatment run against the baseline.
+ method:
+ type: string
+ description: The statistical method used for comparison.
+ allOf:
+ - $ref: '#/components/schemas/InsightResult'
+ description: Insights from the evaluation comparison.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationDataGenerationType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - simple_qna
+ - traces
+ - tool_use
+ - task
+ description: The data generation type.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationDatasetReference:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ description: Dataset name.
+ version:
+ type: string
+ description: Dataset version. If not provided, resolves to the latest version.
+ schema_file_name:
+ type: string
+ description: |-
+ Name of the schema file within the dataset's blob folder (e.g., "a3f2b1c4_schema.json").
+ Optional — if not provided, schema is inferred at runtime from the data.
+ Only applicable for uri_folder datasets.
+ description: Reference to a dataset by name and version.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationLevel:
+ anyOf:
+ - type: string
+ enum:
+ - turn
+ - conversation
+ - type: string
+ description: The level at which evaluation is performed.
+ EvaluationResultSample:
+ type: object
+ required:
+ - type
+ - evaluationResult
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationResultSample
+ description: Evaluation Result Sample Type
+ evaluationResult:
+ $ref: '#/components/schemas/EvalResult'
+ description: Evaluation result for the analysis sample.
+ allOf:
+ - $ref: '#/components/schemas/InsightSample'
+ description: A sample from the evaluation result.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationRule:
+ type: object
+ required:
+ - id
+ - action
+ - eventType
+ - enabled
+ - systemData
+ properties:
+ id:
+ type: string
+ description: Unique identifier for the evaluation rule.
+ readOnly: true
+ displayName:
+ type: string
+ description: Display Name for the evaluation rule.
+ description:
+ type: string
+ description: Description for the evaluation rule.
+ action:
+ $ref: '#/components/schemas/EvaluationRuleAction'
+ description: Definition of the evaluation rule action.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ filter:
+ $ref: '#/components/schemas/EvaluationRuleFilter'
+ description: Filter condition of the evaluation rule.
+ eventType:
+ $ref: '#/components/schemas/EvaluationRuleEventType'
+ description: Event type that the evaluation rule applies to.
+ enabled:
+ type: boolean
+ description: Indicates whether the evaluation rule is enabled. Default is true.
+ systemData:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: System metadata for the evaluation rule.
+ readOnly: true
+ description: Evaluation rule model.
+ EvaluationRuleAction:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluationRuleActionType'
+ description: Type of the evaluation action.
+ discriminator:
+ propertyName: type
+ mapping:
+ continuousEvaluation: '#/components/schemas/ContinuousEvaluationRuleAction'
+ humanEvaluation: '#/components/schemas/HumanEvaluationRuleAction'
+ humanEvaluationPreview: '#/components/schemas/HumanEvaluationPreviewRuleAction'
+ description: Evaluation action model.
+ EvaluationRuleActionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - continuousEvaluation
+ - humanEvaluation
+ - humanEvaluationPreview
+ description: Type of the evaluation action.
+ EvaluationRuleEventType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - responseCompleted
+ - manual
+ description: Type of the evaluation rule event.
+ EvaluationRuleFilter:
+ type: object
+ required:
+ - agentName
+ properties:
+ agentName:
+ type: string
+ description: Filter by agent name.
+ description: Evaluation filter model.
+ EvaluationRunClusterInsightRequest:
+ type: object
+ required:
+ - type
+ - evalId
+ - runIds
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationRunClusterInsight
+ description: The type of insights request.
+ evalId:
+ type: string
+ description: Evaluation Id for the insights.
+ runIds:
+ type: array
+ items:
+ type: string
+ description: List of evaluation run IDs for the insights.
+ modelConfiguration:
+ $ref: '#/components/schemas/InsightModelConfiguration'
+ description: Configuration of the model used in the insight generation.
+ allOf:
+ - $ref: '#/components/schemas/InsightRequest'
+ description: Insights on set of Evaluation Results
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationRunClusterInsightResult:
+ type: object
+ required:
+ - type
+ - clusterInsight
+ properties:
+ type:
+ type: string
+ enum:
+ - EvaluationRunClusterInsight
+ description: The type of insights result.
+ clusterInsight:
+ $ref: '#/components/schemas/ClusterInsightResult'
+ allOf:
+ - $ref: '#/components/schemas/InsightResult'
+ description: Insights from the evaluation run cluster analysis.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ EvaluationScheduleTask:
+ type: object
+ required:
+ - type
+ - evalId
+ - evalRun
+ properties:
+ type:
+ type: string
+ enum:
+ - Evaluation
+ evalId:
+ type: string
+ description: Identifier of the evaluation group.
+ evalRun:
+ type: object
+ unevaluatedProperties: {}
+ description: The evaluation run payload.
+ allOf:
+ - $ref: '#/components/schemas/ScheduleTask'
+ description: Evaluation task for the schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ EvaluationSuiteDataGenerationOptions:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluationDataGenerationType'
+ description: The data generation type. Defaults to 'simple_qna' if not specified.
+ max_samples:
+ type: integer
+ format: int32
+ minimum: 15
+ maximum: 1000
+ description: 'Maximum number of samples to generate. Valid range: 15-1000.'
+ description: Options for dataset generation within an evaluation suite generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteGenerationCategory:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - quality
+ - safety
+ description: The category of evaluator generation.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteGenerationJob:
+ type: object
+ required:
+ - id
+ - status
+ - created_at
+ properties:
+ id:
+ type: string
+ description: Server-assigned unique identifier.
+ readOnly: true
+ inputs:
+ $ref: '#/components/schemas/EvaluationSuiteGenerationJobInputs'
+ description: Caller-supplied inputs.
+ result:
+ $ref: '#/components/schemas/EvaluationSuiteVersion'
+ description: Result produced on success.
+ readOnly: true
+ status:
+ $ref: '#/components/schemas/JobStatus'
+ description: Current lifecycle status.
+ readOnly: true
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error details — populated only on failure.
+ readOnly: true
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job was created, represented in Unix time.
+ readOnly: true
+ finished_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job finished, represented in Unix time.
+ readOnly: true
+ usage:
+ $ref: '#/components/schemas/EvaluationSuiteGenerationTokenUsage'
+ description: Token consumption summary. Populated on terminal states.
+ readOnly: true
+ description: Evaluation suite generation job resource — a long-running job that generates testing criteria and optionally a dataset from source materials. On success, the result is the persisted EvaluationSuiteVersion.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteGenerationJobCreate:
+ type: object
+ properties:
+ inputs:
+ $ref: '#/components/schemas/EvaluationSuiteGenerationJobInputs'
+ description: Caller-supplied inputs.
+ description: Evaluation suite generation job resource — a long-running job that generates testing criteria and optionally a dataset from source materials. On success, the result is the persisted EvaluationSuiteVersion.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteGenerationJobInputs:
+ type: object
+ required:
+ - evaluation_suite_name
+ - sources
+ - generation_model
+ properties:
+ evaluation_suite_name:
+ type: string
+ description: The evaluation suite name to create.
+ sources:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluationSuiteJobSource'
+ description: Source materials for generation — agent context, prompts, traces, or datasets.
+ generation_model:
+ type: string
+ description: The LLM model to use for rubric and data generation (e.g., 'gpt-4o').
+ category:
+ $ref: '#/components/schemas/EvaluationSuiteGenerationCategory'
+ description: 'Category determines the generation focus. Default: quality.'
+ default: quality
+ initialization_parameters:
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ Optional initialization parameters applied to all generated evaluators.
+ For example, deployment_name for LLM judge model, default threshold.
+ data_generation_options:
+ $ref: '#/components/schemas/EvaluationSuiteDataGenerationOptions'
+ description: |-
+ Data generation options. Controls how the evaluation dataset is generated.
+ If omitted, defaults are used (simple_qna, 100 max_samples).
+ target:
+ $ref: '#/components/schemas/Target'
+ description: |-
+ Target for the generated suite. Stored on the suite so it can be run
+ immediately after generation completes.
+ Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.
+ input_messages:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ description: |-
+ How to send dataset rows to the target.
+ If omitted and target is provided, defaults to a template using item.query.
+ evaluation_level:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: |-
+ Evaluation level for the generated suite.
+ Default: turn (single-turn evaluation).
+ Use conversation for multi-turn evaluation.
+ description: Caller-supplied inputs for an evaluation suite generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteGenerationTokenUsage:
+ type: object
+ properties:
+ input_tokens:
+ type: integer
+ format: int64
+ description: Number of input tokens consumed.
+ output_tokens:
+ type: integer
+ format: int64
+ description: Number of output tokens consumed.
+ total_tokens:
+ type: integer
+ format: int64
+ description: Total tokens consumed.
+ description: Token usage summary for an evaluation suite generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteJobSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluationSuiteJobSourceType'
+ description: The type of source.
+ description:
+ type: string
+ description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ discriminator:
+ propertyName: type
+ mapping:
+ prompt: '#/components/schemas/PromptEvaluationSuiteJobSource'
+ agent: '#/components/schemas/AgentEvaluationSuiteJobSource'
+ traces: '#/components/schemas/TracesEvaluationSuiteJobSource'
+ dataset: '#/components/schemas/DatasetEvaluationSuiteJobSource'
+ description: The base source model for evaluation suite generation jobs. Polymorphic over `type`.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteJobSourceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - agent
+ - traces
+ - dataset
+ description: The supported source types for evaluation suite generation jobs.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteRunRequest:
+ type: object
+ properties:
+ evaluation_name:
+ type: string
+ description: "Name for the evaluation. Default: '{suiteName}-runs'."
+ evaluation_suite_version:
+ type: string
+ description: 'Evaluation suite version to run. Default: latest.'
+ evaluation_level:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Overrides the suite's default evaluation level. If omitted, uses the level from the suite.
+ description: Request body for running an evaluation from a suite.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteRunResponse:
+ type: object
+ required:
+ - evaluation_suite_name
+ - evaluation_suite_version
+ - results
+ properties:
+ evaluation_suite_name:
+ type: string
+ description: The evaluation suite name used.
+ evaluation_suite_version:
+ type: string
+ description: The evaluation suite version resolved.
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluationSuiteRunResult'
+ description: The run results. Currently a single-element array; will support multiple runs in the future.
+ description: Response from running an evaluation suite.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteRunResult:
+ type: object
+ required:
+ - eval_id
+ - run_id
+ - status
+ - created_at
+ properties:
+ eval_id:
+ type: string
+ description: The evaluation ID created.
+ run_id:
+ type: string
+ description: The eval run ID created.
+ status:
+ $ref: '#/components/schemas/JobStatus'
+ description: Status of the run.
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: Timestamp when the run was created.
+ description: Result of a single evaluation run within a suite execution.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteSubtype:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - default
+ - benchmark
+ description: The subtype of an evaluation suite.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteVersion:
+ type: object
+ required:
+ - testing_criteria
+ - name
+ - version
+ properties:
+ display_name:
+ type: string
+ description: |-
+ Human-readable display name.
+ Does not need to be unique. Shown in Foundry portal list views and eval reports.
+ subtype:
+ $ref: '#/components/schemas/EvaluationSuiteSubtype'
+ description: Subtype of the evaluation suite.
+ dataset:
+ $ref: '#/components/schemas/EvaluationDatasetReference'
+ description: |-
+ Dataset reference for evaluation.
+ Optional — omit for evaluator-only suites where data comes from
+ live production traces or is provided at run time.
+ The referenced dataset must exist in the project's dataset registry.
+ testing_criteria:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
+ - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
+ minItems: 1
+ description: |-
+ Testing criteria — the evaluator configurations for this suite.
+ Supports all grader types: azure_ai_evaluator, string_check, label_model,
+ score_model, text_similarity, python, etc.
+ At least one entry is required.
+ target:
+ $ref: '#/components/schemas/Target'
+ description: |-
+ Target for this evaluation suite. Uses the existing Target discriminated type
+ from eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.
+ Optional — allows suites to exist without a target.
+ input_messages:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ description: |-
+ How to send dataset rows to the target (agent or model).
+ Supports template type (prompt with column placeholders) and
+ item_reference type (column containing pre-built messages).
+ evaluation_level:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Default evaluation level for this suite. Can be overridden at run time.
+ name:
+ type: string
+ description: The name of the resource.
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource.
+ readOnly: true
+ description: |-
+ An evaluation suite bundles testing criteria — an optional dataset, one or more
+ evaluator configs with thresholds and init params — into a reusable, named artifact that
+ can gate agent changes across batch, scheduled, continuous, and CI/CD evals.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteVersionCreate:
+ type: object
+ required:
+ - testing_criteria
+ properties:
+ display_name:
+ type: string
+ description: |-
+ Human-readable display name.
+ Does not need to be unique. Shown in Foundry portal list views and eval reports.
+ subtype:
+ $ref: '#/components/schemas/EvaluationSuiteSubtype'
+ description: Subtype of the evaluation suite.
+ dataset:
+ $ref: '#/components/schemas/EvaluationDatasetReference'
+ description: |-
+ Dataset reference for evaluation.
+ Optional — omit for evaluator-only suites where data comes from
+ live production traces or is provided at run time.
+ The referenced dataset must exist in the project's dataset registry.
+ testing_criteria:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
+ - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
+ minItems: 1
+ description: |-
+ Testing criteria — the evaluator configurations for this suite.
+ Supports all grader types: azure_ai_evaluator, string_check, label_model,
+ score_model, text_similarity, python, etc.
+ At least one entry is required.
+ target:
+ $ref: '#/components/schemas/Target'
+ description: |-
+ Target for this evaluation suite. Uses the existing Target discriminated type
+ from eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.
+ Optional — allows suites to exist without a target.
+ input_messages:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ description: |-
+ How to send dataset rows to the target (agent or model).
+ Supports template type (prompt with column placeholders) and
+ item_reference type (column containing pre-built messages).
+ evaluation_level:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Default evaluation level for this suite. Can be overridden at run time.
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ description: |-
+ An evaluation suite bundles testing criteria — an optional dataset, one or more
+ evaluator configs with thresholds and init params — into a reusable, named artifact that
+ can gate agent changes across batch, scheduled, continuous, and CI/CD evals.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationSuiteVersionUpdate:
+ type: object
+ required:
+ - testing_criteria
+ properties:
+ display_name:
+ type: string
+ description: |-
+ Human-readable display name.
+ Does not need to be unique. Shown in Foundry portal list views and eval reports.
+ subtype:
+ $ref: '#/components/schemas/EvaluationSuiteSubtype'
+ description: Subtype of the evaluation suite.
+ dataset:
+ $ref: '#/components/schemas/EvaluationDatasetReference'
+ description: |-
+ Dataset reference for evaluation.
+ Optional — omit for evaluator-only suites where data comes from
+ live production traces or is provided at run time.
+ The referenced dataset must exist in the project's dataset registry.
+ testing_criteria:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
+ - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
+ - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
+ minItems: 1
+ description: |-
+ Testing criteria — the evaluator configurations for this suite.
+ Supports all grader types: azure_ai_evaluator, string_check, label_model,
+ score_model, text_similarity, python, etc.
+ At least one entry is required.
+ target:
+ $ref: '#/components/schemas/Target'
+ description: |-
+ Target for this evaluation suite. Uses the existing Target discriminated type
+ from eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.
+ Optional — allows suites to exist without a target.
+ input_messages:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ description: |-
+ How to send dataset rows to the target (agent or model).
+ Supports template type (prompt with column placeholders) and
+ item_reference type (column containing pre-built messages).
+ evaluation_level:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Default evaluation level for this suite. Can be overridden at run time.
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ description: |-
+ An evaluation suite bundles testing criteria — an optional dataset, one or more
+ evaluator configs with thresholds and init params — into a reusable, named artifact that
+ can gate agent changes across batch, scheduled, continuous, and CI/CD evals.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Evaluations=V1Preview
+ EvaluationTarget:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluationTargetType'
+ description: Discriminator that defines the type of the evaluation target.
+ discriminator:
+ propertyName: type
+ mapping:
+ modelResponseGeneration: '#/components/schemas/modelResponseGenerationTarget'
+ description: Abstract base model for defining evaluation targets.
+ EvaluationTargetType:
+ anyOf:
+ - type: string
+ enum:
+ - modelResponseGeneration
+ - type: string
+ description: Allowed types of evaluation targets.
+ EvaluationTaxonomy:
+ type: object
+ required:
+ - name
+ - version
+ - taxonomyInput
+ properties:
+ id:
+ type: string
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
+ name:
+ type: string
+ description: The name of the resource
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource
+ readOnly: true
+ taxonomyInput:
+ $ref: '#/components/schemas/EvaluationTaxonomyInput'
+ description: Input configuration for the evaluation taxonomy.
+ taxonomyCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/TaxonomyCategory'
+ description: List of taxonomy categories.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Additional properties for the evaluation taxonomy.
+ description: Evaluation Taxonomy Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyCreateOrUpdate:
+ type: object
+ required:
+ - taxonomyInput
+ properties:
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ taxonomyInput:
+ $ref: '#/components/schemas/EvaluationTaxonomyInput'
+ description: Input configuration for the evaluation taxonomy.
+ taxonomyCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/TaxonomyCategory'
+ description: List of taxonomy categories.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Additional properties for the evaluation taxonomy.
+ description: Evaluation Taxonomy Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyInput:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluationTaxonomyInputType'
+ description: Input type of the evaluation taxonomy.
+ discriminator:
+ propertyName: type
+ mapping:
+ agent: '#/components/schemas/AgentTaxonomyInput'
+ description: Input configuration for the evaluation taxonomy.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyInputType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - agent
+ - policy
+ description: Type of the evaluation taxonomy input.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyInputUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluationTaxonomyInputType'
+ description: Input type of the evaluation taxonomy.
+ discriminator:
+ propertyName: type
+ mapping:
+ agent: '#/components/schemas/AgentTaxonomyInputUpdate'
+ description: Input configuration for the evaluation taxonomy.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluationTaxonomyUpdate:
+ type: object
+ properties:
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ taxonomyInput:
+ $ref: '#/components/schemas/EvaluationTaxonomyInputUpdate'
+ description: Input configuration for the evaluation taxonomy.
+ taxonomyCategories:
+ type: array
+ items:
+ $ref: '#/components/schemas/TaxonomyCategory'
+ description: List of taxonomy categories.
+ properties:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Additional properties for the evaluation taxonomy.
+ description: Evaluation Taxonomy Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorCategory:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - quality
+ - safety
+ - agents
+ description: The category of the evaluator
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorConfiguration:
+ type: object
+ required:
+ - id
+ properties:
+ id:
+ type: string
+ description: Identifier of the evaluator.
+ initParams:
+ type: object
+ unevaluatedProperties: {}
+ description: Initialization parameters of the evaluator.
+ dataMapping:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Data parameters of the evaluator.
+ description: Evaluator Configuration
+ EvaluatorCredentialRequest:
+ type: object
+ required:
+ - blob_uri
+ properties:
+ blob_uri:
+ type: string
+ format: uri
+ description: 'The blob URI for the evaluator storage. Example: `https://account.blob.core.windows.net:443/container`'
+ description: Request body for getting evaluator credentials
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorDefinition:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluatorDefinitionType'
+ description: The type of evaluator definition
+ init_parameters:
+ type: object
+ unevaluatedProperties: {}
+ description: The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters like type, properties, required.
+ data_schema:
+ type: object
+ unevaluatedProperties: {}
+ description: The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like type, properties, required.
+ metrics:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/EvaluatorMetric'
+ description: List of output metrics produced by this evaluator
+ discriminator:
+ propertyName: type
+ mapping:
+ code: '#/components/schemas/CodeBasedEvaluatorDefinition'
+ prompt: '#/components/schemas/PromptBasedEvaluatorDefinition'
+ rubric: '#/components/schemas/RubricBasedEvaluatorDefinition'
+ endpoint: '#/components/schemas/EndpointBasedEvaluatorDefinition'
+ description: Base evaluator configuration with discriminator
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorDefinitionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - code
+ - prompt_and_code
+ - service
+ - openai_graders
+ - rubric
+ - endpoint
+ description: The type of evaluator definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationArtifacts:
+ type: object
+ required:
+ - dataset
+ - kinds
+ properties:
+ dataset:
+ $ref: '#/components/schemas/DatasetReference'
+ description: Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to `EvaluatorVersion.version`) holding all artifacts produced by the generation pipeline. Each row in the JSONL carries a `kind` field discriminating its content (e.g. `spec`, `tools`, `context`).
+ kinds:
+ type: array
+ items:
+ type: string
+ description: The kinds of rows present in `dataset`. Always contains `"spec"` (the generated evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain `"tools"` (when the generation pipeline produced or inferred OpenAI tool schemas) and/or `"context"` (when supplementary materials such as file uploads or trace samples were used during generation).
+ description: Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationInputs:
+ type: object
+ required:
+ - sources
+ - model
+ - evaluator_name
+ properties:
+ sources:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluatorGenerationJobSource'
+ description: Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry is an `EvaluatorGenerationJobSource` variant discriminated by `type`.
+ model:
+ type: string
+ description: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide their own model rather than relying on service-owned capacity.
+ evaluator_name:
+ type: string
+ minLength: 1
+ maxLength: 256
+ pattern: ^[A-Za-z0-9_.~-]+$
+ description: The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII letters, digits, underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` is reserved for system-managed evaluators and is rejected by the service. If an evaluator with this name already exists in the project (and is rubric-subtype), the service creates a new version under the same name and uses the prior version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive loop). Old versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`.
+ evaluator_display_name:
+ type: string
+ description: Optional human-friendly display name for the resulting evaluator. Surfaced as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier.
+ evaluator_description:
+ type: string
+ description: Optional human-friendly description for the resulting evaluator. Surfaced as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related models.
+ description: Caller-supplied inputs for an evaluator generation job.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationJob:
+ type: object
+ required:
+ - id
+ - status
+ - created_at
+ properties:
+ id:
+ type: string
+ description: Server-assigned unique identifier.
+ readOnly: true
+ inputs:
+ $ref: '#/components/schemas/EvaluatorGenerationInputs'
+ description: Caller-supplied inputs.
+ result:
+ $ref: '#/components/schemas/EvaluatorVersion'
+ description: Result produced on success.
+ readOnly: true
+ status:
+ $ref: '#/components/schemas/JobStatus'
+ description: Current lifecycle status.
+ readOnly: true
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error details — populated only on failure.
+ readOnly: true
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).
+ readOnly: true
+ finished_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).
+ readOnly: true
+ usage:
+ $ref: '#/components/schemas/EvaluatorGenerationTokenUsage'
+ description: Token consumption summary. Populated when the job reaches a terminal state.
+ readOnly: true
+ input_quality_warnings:
+ type: array
+ items:
+ $ref: '#/components/schemas/RubricGenerationInputQualityWarning'
+ description: Non-fatal input-quality advisories produced by the generation pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. Omitted when generation was clean. Cleared when a subsequent `PATCH` to the paired `EvaluatorVersion.definition` invalidates the advisories.
+ readOnly: true
+ description: Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationJobCreate:
+ type: object
+ properties:
+ inputs:
+ $ref: '#/components/schemas/EvaluatorGenerationInputs'
+ description: Caller-supplied inputs.
+ description: Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationJobSource:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluatorGenerationJobSourceType'
+ description: The type of source.
+ discriminator:
+ propertyName: type
+ mapping:
+ prompt: '#/components/schemas/PromptEvaluatorGenerationJobSource'
+ agent: '#/components/schemas/AgentEvaluatorGenerationJobSource'
+ traces: '#/components/schemas/TracesEvaluatorGenerationJobSource'
+ dataset: '#/components/schemas/DatasetEvaluatorGenerationJobSource'
+ description: The base source model for evaluator generation jobs. Polymorphic over `type`.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationJobSourceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - agent
+ - traces
+ - dataset
+ description: The supported source types for evaluator generation jobs.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorGenerationTokenUsage:
+ type: object
+ required:
+ - input_tokens
+ - output_tokens
+ - total_tokens
+ properties:
+ input_tokens:
+ type: integer
+ format: int64
+ description: Number of input (prompt) tokens consumed.
+ output_tokens:
+ type: integer
+ format: int64
+ description: Number of output (completion) tokens generated.
+ total_tokens:
+ type: integer
+ format: int64
+ description: Total tokens consumed (input + output).
+ description: Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorMetric:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/EvaluatorMetricType'
+ description: Type of the metric.
+ desirable_direction:
+ $ref: '#/components/schemas/EvaluatorMetricDirection'
+ description: It indicates whether a higher value is better or a lower value is better for this metric.
+ min_value:
+ type: number
+ format: float
+ description: Minimum value for the metric
+ max_value:
+ type: number
+ format: float
+ description: Maximum value for the metric. If not specified, it is assumed to be unbounded.
+ threshold:
+ type: number
+ format: float
+ description: Default pass/fail threshold for this metric.
+ is_primary:
+ type: boolean
+ description: Indicates if this metric is primary when there are multiple metrics.
+ description: Evaluator Metric
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorMetricDirection:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - increase
+ - decrease
+ - neutral
+ description: The direction of the metric indicating whether a higher value is better, a lower value is better, or neutral
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorMetricType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - ordinal
+ - continuous
+ - boolean
+ description: The type of the evaluator
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - builtin
+ - custom
+ description: The type of the evaluator
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorVersion:
+ type: object
+ required:
+ - evaluator_type
+ - categories
+ - definition
+ - created_by
+ - created_at
+ - modified_at
+ - name
+ - version
+ properties:
+ display_name:
+ type: string
+ description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Metadata about the evaluator
+ evaluator_type:
+ $ref: '#/components/schemas/EvaluatorType'
+ description: The type of the evaluator
+ categories:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluatorCategory'
+ description: The categories of the evaluator
+ supported_evaluation_levels:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
+ default:
+ - turn
+ definition:
+ $ref: '#/components/schemas/EvaluatorDefinition'
+ description: Definition of the evaluator
+ generation_artifacts:
+ $ref: '#/components/schemas/EvaluatorGenerationArtifacts'
+ description: Provenance artifacts from the generation pipeline. Read-only; present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry Dataset.
+ readOnly: true
+ generation_job_id:
+ type: string
+ description: Read-only provenance link back to the EvaluatorGenerationJob that produced this version. Present only on evaluator versions created via the generation pipeline; absent for manually-created versions and unaffected by subsequent `PATCH` calls.
+ readOnly: true
+ warnings:
+ type: array
+ items:
+ $ref: '#/components/schemas/GenerationWarningType'
+ description: Categories of warnings surfaced on this generated evaluator version. Present only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent (treat as no warnings) when the version is not from generation, when the paired job was clean, or when a subsequent `PATCH` to `definition` cleared the paired job's advisories. Follow `generation_job_id` to fetch the detailed warning payloads.
+ readOnly: true
+ created_by:
+ type: string
+ description: Creator of the evaluator
+ readOnly: true
+ created_at:
+ type: string
+ description: Creation date/time of the evaluator
+ readOnly: true
+ modified_at:
+ type: string
+ description: Last modified date/time of the evaluator
+ readOnly: true
+ id:
+ type: string
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
+ name:
+ type: string
+ description: The name of the resource
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource
+ readOnly: true
+ description: Evaluator Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorVersionCreate:
+ type: object
+ required:
+ - evaluator_type
+ - categories
+ - definition
+ properties:
+ display_name:
+ type: string
+ description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Metadata about the evaluator
+ evaluator_type:
+ $ref: '#/components/schemas/EvaluatorType'
+ description: The type of the evaluator
+ categories:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluatorCategory'
+ description: The categories of the evaluator
+ supported_evaluation_levels:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
+ default:
+ - turn
+ definition:
+ $ref: '#/components/schemas/EvaluatorDefinition'
+ description: Definition of the evaluator
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ description: Evaluator Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ EvaluatorVersionUpdate:
+ type: object
+ properties:
+ display_name:
+ type: string
+ description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Metadata about the evaluator
+ categories:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluatorCategory'
+ description: The categories of the evaluator
+ supported_evaluation_levels:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvaluationLevel'
+ description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
+ default:
+ - turn
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ description: Evaluator Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ ExternalAgentDefinition:
+ type: object
+ required:
+ - kind
+ properties:
+ kind:
+ type: string
+ enum:
+ - external
+ otel_agent_id:
+ type: string
+ description: |-
+ The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry agent.
+ Spans must include the attribute `gen_ai.agent.id = ` to appear under this registration.
+ Defaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios
+ where the running external agent already emits a stable id that differs from the Foundry agent name.
+ The resolved value is always echoed on read.
+ allOf:
+ - $ref: '#/components/schemas/AgentDefinition'
+ description: |-
+ The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS).
+ Registration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations)
+ over customer-emitted OpenTelemetry data.
+ x-ms-foundry-meta:
+ required_previews:
+ - ExternalAgents=V1Preview
+ FabricDataAgentToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - fabric_dataagent_preview_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A Fabric data agent tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FabricDataAgentToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - fabric_dataagent_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ output:
+ $ref: '#/components/schemas/ToolCallOutputContent'
+ description: The output from the Fabric data agent tool call.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a Fabric data agent tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FabricDataAgentToolParameters:
+ type: object
+ properties:
+ project_connections:
+ type: array
+ items:
+ $ref: '#/components/schemas/ToolProjectConnection'
+ maxItems: 1
+ description: |-
+ The project connections attached to this tool. There can be a maximum of 1 connection
+ resource attached to the tool.
+ description: The fabric data agent tool parameters.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FabricIQPreviewTool:
+ type: object
+ required:
+ - type
+ - project_connection_id
+ properties:
+ type:
+ type: string
+ enum:
+ - fabric_iq_preview
+ description: The object type, which is always 'fabric_iq_preview'.
+ project_connection_id:
+ type: string
+ description: The ID of the FabricIQ project connection.
+ server_label:
+ type: string
+ description: (Optional) The label of the FabricIQ MCP server to connect to.
+ server_url:
+ type: string
+ format: uri
+ description: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used.
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ - type: 'null'
+ description: (Optional) Whether the agent requires approval before executing actions. Default is always.
+ default: always
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A FabricIQ server-side tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FabricIQPreviewToolboxTool:
+ type: object
+ required:
+ - type
+ - project_connection_id
+ properties:
+ type:
+ type: string
+ enum:
+ - fabric_iq_preview
+ project_connection_id:
+ type: string
+ description: The ID of the FabricIQ project connection.
+ server_label:
+ type: string
+ description: (Optional) The label of the FabricIQ MCP server to connect to.
+ server_url:
+ type: string
+ format: uri
+ description: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used.
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ - type: 'null'
+ description: (Optional) Whether the agent requires approval before executing actions. Default is always.
+ default: always
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A FabricIQ tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ FileDataGenerationJobOutput:
+ type: object
+ required:
+ - type
+ - id
+ - filename
+ properties:
+ type:
+ type: string
+ enum:
+ - file
+ description: Azure OpenAI file output.
+ id:
+ type: string
+ description: The id of the output Azure OpenAI file.
+ readOnly: true
+ filename:
+ type: string
+ description: The filename of the output Azure OpenAI file.
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/DataGenerationJobOutput'
+ description: Azure OpenAI file output for a data generation job.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ FileDataGenerationJobSource:
+ type: object
+ required:
+ - type
+ - id
+ properties:
+ type:
+ type: string
+ enum:
+ - file
+ description: The source type for this job, which is File.
+ id:
+ type: string
+ description: Input Azure Open AI file id used for data generation.
+ allOf:
+ - $ref: '#/components/schemas/DataGenerationJobSource'
+ description: File source for data generation jobs — Azure OpenAI file input.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - DataGenerationJobs=V1Preview
+ FileDatasetVersion:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - uri_file
+ description: Dataset type
+ allOf:
+ - $ref: '#/components/schemas/DatasetVersion'
+ description: FileDatasetVersion Definition
+ FileDatasetVersionUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - uri_file
+ description: Dataset type
+ allOf:
+ - $ref: '#/components/schemas/DatasetVersionUpdate'
+ description: FileDatasetVersion Definition
+ FileSearchToolboxTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - file_search
+ max_num_results:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.RankingOptions'
+ description: Ranking options for search.
+ filters:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Filters'
+ - type: 'null'
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ description: The IDs of the vector stores to search.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A file search tool stored in a toolbox.
+ FilterStrategyType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - random_sampling
+ - smart_filtering
+ description: Specifies the type of filter strategy used to select traces for evaluation.
+ FixedRatioVersionSelectionRule:
+ type: object
+ required:
+ - type
+ - traffic_percentage
+ properties:
+ type:
+ type: string
+ enum:
+ - FixedRatio
+ traffic_percentage:
+ type: integer
+ format: int32
+ minimum: 0
+ maximum: 100
+ description: The percentage of traffic to route to the version. Must be between 0 and 100.
+ allOf:
+ - $ref: '#/components/schemas/VersionSelectionRule'
+ FolderDatasetVersion:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - uri_folder
+ description: Dataset type
+ allOf:
+ - $ref: '#/components/schemas/DatasetVersion'
+ description: FileDatasetVersion Definition
+ FolderDatasetVersionUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - uri_folder
+ description: Dataset type
+ allOf:
+ - $ref: '#/components/schemas/DatasetVersionUpdate'
+ description: FileDatasetVersion Definition
+ FoundryModelArtifactProfileCategory:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - DataOnly
+ - RuntimeDependent
+ - Unknown
+ description: The artifact profile category.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelArtifactProfileSignal:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - PickleDeserialization
+ - CustomPythonCode
+ - DynamicOps
+ - NativeBinary
+ - UnknownFormat
+ description: Signals detected in the model artifact.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelSourceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - LocalUpload
+ - TrainingJob
+ description: The source type of the model.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelWarning:
+ type: object
+ properties:
+ code:
+ $ref: '#/components/schemas/FoundryModelWarningCode'
+ description: The warning code.
+ message:
+ type: string
+ description: The warning message.
+ description: A warning associated with a model.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelWarningCode:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - RuntimeDependentArtifact
+ - UnclassifiedArtifact
+ description: Warning code for model artifacts.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryModelWeightType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - FullWeight
+ - LoRA
+ - DraftModel
+ description: The weight type of the model.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ FoundryTimestamp:
+ type: integer
+ format: unixtime
+ FunctionToolCall:
+ type: object
+ required:
+ - name
+ - arguments
+ properties:
+ name:
+ type: string
+ description: The name of the function to call.
+ arguments:
+ type: string
+ description: The arguments to call the function with, as generated by the model in JSON format.
+ description: Details of a function tool call.
+ GenerationWarningType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - input_quality
+ description: Category of a warning surfaced on a generated evaluator version. Extensible so new warning categories (e.g., safety, output quality) can be introduced without a breaking change.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ GitHubIssueEvent:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - opened
+ - closed
+ description: Known GitHub issue events that can fire a routine.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ GitHubIssueRoutineTrigger:
+ type: object
+ required:
+ - type
+ - connection_id
+ - owner
+ - repository
+ - issue_event
+ properties:
+ type:
+ type: string
+ enum:
+ - github_issue
+ description: The trigger type.
+ connection_id:
+ type: string
+ maxLength: 256
+ description: The workspace connection identifier that resolves the GitHub configuration for the trigger.
+ owner:
+ type: string
+ maxLength: 128
+ description: The GitHub owner or organization that scopes which issues can fire the trigger.
+ repository:
+ type: string
+ maxLength: 128
+ description: The GitHub repository filter that scopes which issues can fire the trigger.
+ issue_event:
+ $ref: '#/components/schemas/GitHubIssueEvent'
+ description: The GitHub issue event that fires the routine.
+ allOf:
+ - $ref: '#/components/schemas/RoutineTrigger'
+ description: A GitHub issue routine trigger.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ HeaderTelemetryEndpointAuth:
+ type: object
+ required:
+ - type
+ - header_name
+ - secret_id
+ - secret_key
+ properties:
+ type:
+ type: string
+ enum:
+ - header
+ description: The authentication type, always 'header' for header-based secret authentication.
+ header_name:
+ type: string
+ description: The name of the HTTP header to inject the secret value into.
+ examples:
+ - X-Otlp-Api-Key
+ secret_id:
+ type: string
+ description: The identifier of the secret store or connection.
+ examples:
+ - my-secret-store
+ secret_key:
+ type: string
+ description: The key within the secret to retrieve the authentication value.
+ examples:
+ - OTLP_KEY
+ allOf:
+ - $ref: '#/components/schemas/TelemetryEndpointAuth'
+ description: Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header.
+ HostedAgentDefinition:
+ type: object
+ required:
+ - kind
+ - cpu
+ - memory
+ properties:
+ kind:
+ type: string
+ enum:
+ - hosted
+ cpu:
+ type: string
+ description: The CPU configuration for the hosted agent.
+ examples:
+ - '0.25'
+ memory:
+ type: string
+ description: The memory configuration for the hosted agent.
+ examples:
+ - 0.5Gi
+ environment_variables:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Environment variables to set in the hosted agent container.
+ examples:
+ - name: LOG_LEVEL
+ value: debug
+ container_configuration:
+ $ref: '#/components/schemas/ContainerConfiguration'
+ description: Container-based deployment configuration. Provide this for image-based deployments. Mutually exclusive with code_configuration — the service validates that exactly one is set.
+ protocol_versions:
+ type: array
+ items:
+ $ref: '#/components/schemas/ProtocolVersionRecord'
+ description: The protocols that the agent supports for ingress communication.
+ examples:
+ - - protocol: responses
+ version: v0.1.1
+ - protocol: a2a
+ version: v0.3.0
+ code_configuration:
+ $ref: '#/components/schemas/CodeConfiguration'
+ description: Code-based deployment configuration. Provide this for code-based deployments. Mutually exclusive with container_configuration — the service validates that exactly one is set.
+ telemetry_config:
+ $ref: '#/components/schemas/TelemetryConfig'
+ description: Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics.
+ allOf:
+ - $ref: '#/components/schemas/AgentDefinition'
+ description: The hosted agent definition.
+ HourlyRecurrenceSchedule:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - Hourly
+ allOf:
+ - $ref: '#/components/schemas/RecurrenceSchedule'
+ description: Hourly recurrence schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ HumanEvaluationPreviewRuleAction:
+ type: object
+ required:
+ - type
+ - templateId
+ properties:
+ type:
+ type: string
+ enum:
+ - humanEvaluationPreview
+ templateId:
+ $ref: '#/components/schemas/AssetId'
+ description: Human evaluation template Id.
+ allOf:
+ - $ref: '#/components/schemas/EvaluationRuleAction'
+ description: Evaluation rule action for human evaluation.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ HumanEvaluationRuleAction:
+ type: object
+ required:
+ - type
+ - templateId
+ properties:
+ type:
+ type: string
+ enum:
+ - humanEvaluation
+ templateId:
+ $ref: '#/components/schemas/AssetId'
+ description: Human evaluation template Id.
+ allOf:
+ - $ref: '#/components/schemas/EvaluationRuleAction'
+ description: Evaluation rule action for human evaluation.
+ Index:
+ type: object
+ required:
+ - type
+ - name
+ - version
+ properties:
+ type:
+ $ref: '#/components/schemas/IndexType'
+ description: Type of index
+ id:
+ type: string
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
+ name:
+ type: string
+ description: The name of the resource
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource
+ readOnly: true
+ discriminator:
+ propertyName: type
+ mapping:
+ AzureSearch: '#/components/schemas/AzureAISearchIndex'
+ ManagedAzureSearch: '#/components/schemas/ManagedAzureAISearchIndex'
+ CosmosDBNoSqlVectorStore: '#/components/schemas/CosmosDBIndex'
+ description: Index resource Definition
+ IndexType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - AzureSearch
+ - CosmosDBNoSqlVectorStore
+ - ManagedAzureSearch
+ IndexUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/IndexType'
+ description: Type of index
+ description:
+ type: string
+ description: The asset description text.
+ tags:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ discriminator:
+ propertyName: type
+ mapping:
+ AzureSearch: '#/components/schemas/AzureAISearchIndexUpdate'
+ ManagedAzureSearch: '#/components/schemas/ManagedAzureAISearchIndexUpdate'
+ CosmosDBNoSqlVectorStore: '#/components/schemas/CosmosDBIndexUpdate'
+ description: Index resource Definition
+ InputData:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ description: Type of the data
+ discriminator:
+ propertyName: type
+ mapping:
+ dataset: '#/components/schemas/InputDataset'
+ description: Abstract data class.
+ InputDataset:
+ type: object
+ required:
+ - type
+ - id
+ properties:
+ type:
+ type: string
+ enum:
+ - dataset
+ id:
+ type: string
+ description: Evaluation input data
+ allOf:
+ - $ref: '#/components/schemas/InputData'
+ description: Dataset as source for evaluation.
+ Insight:
+ type: object
+ required:
+ - id
+ - metadata
+ - state
+ - displayName
+ - request
+ properties:
+ id:
+ type: string
+ description: The unique identifier for the insights report.
+ readOnly: true
+ metadata:
+ $ref: '#/components/schemas/InsightsMetadata'
+ description: Metadata about the insights report.
+ readOnly: true
+ state:
+ $ref: '#/components/schemas/Azure.Core.Foundations.OperationState'
+ description: The current state of the insights.
+ readOnly: true
+ displayName:
+ type: string
+ description: User friendly display name for the insight.
+ request:
+ $ref: '#/components/schemas/InsightRequest'
+ description: Request for the insights analysis.
+ result:
+ $ref: '#/components/schemas/InsightResult'
+ description: The result of the insights report.
+ readOnly: true
+ description: The response body for cluster insights.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightCluster:
+ type: object
+ required:
+ - id
+ - label
+ - suggestion
+ - suggestionTitle
+ - description
+ - weight
+ properties:
+ id:
+ type: string
+ description: The id of the analysis cluster.
+ label:
+ type: string
+ description: Label for the cluster
+ suggestion:
+ type: string
+ description: Suggestion for the cluster
+ suggestionTitle:
+ type: string
+ description: The title of the suggestion for the cluster
+ description:
+ type: string
+ description: Description of the analysis cluster.
+ weight:
+ type: integer
+ format: int32
+ description: The weight of the analysis cluster. This indicate number of samples in the cluster.
+ subClusters:
+ description: List of subclusters within this cluster. Empty if no subclusters exist.
+ type: array
+ items:
+ $ref: '#/components/schemas/InsightCluster'
+ samples:
+ type: array
+ items:
+ $ref: '#/components/schemas/InsightSample'
+ description: List of samples that belong to this cluster. Empty if samples are part of subclusters.
+ description: A cluster of analysis samples.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightModelConfiguration:
+ type: object
+ required:
+ - modelDeploymentName
+ properties:
+ modelDeploymentName:
+ type: string
+ description: The model deployment to be evaluated. Accepts either the deployment name alone or with the connection name as '{connectionName}/'.
+ description: Configuration of the model used in the insight generation.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightRequest:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/InsightType'
+ description: The type of request.
+ discriminator:
+ propertyName: type
+ mapping:
+ EvaluationRunClusterInsight: '#/components/schemas/EvaluationRunClusterInsightRequest'
+ AgentClusterInsight: '#/components/schemas/AgentClusterInsightRequest'
+ EvaluationComparison: '#/components/schemas/EvaluationComparisonInsightRequest'
+ description: The request of the insights report.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightResult:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/InsightType'
+ description: The type of insights result.
+ discriminator:
+ propertyName: type
+ mapping:
+ EvaluationComparison: '#/components/schemas/EvaluationComparisonInsightResult'
+ EvaluationRunClusterInsight: '#/components/schemas/EvaluationRunClusterInsightResult'
+ AgentClusterInsight: '#/components/schemas/AgentClusterInsightResult'
+ description: The result of the insights.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightSample:
+ type: object
+ required:
+ - id
+ - type
+ - features
+ - correlationInfo
+ properties:
+ id:
+ type: string
+ description: The unique identifier for the analysis sample.
+ type:
+ $ref: '#/components/schemas/SampleType'
+ description: Sample type
+ features:
+ type: object
+ unevaluatedProperties: {}
+ description: Features to help with additional filtering of data in UX.
+ correlationInfo:
+ type: object
+ unevaluatedProperties: {}
+ description: Info about the correlation for the analysis sample.
+ discriminator:
+ propertyName: type
+ mapping:
+ EvaluationResultSample: '#/components/schemas/EvaluationResultSample'
+ description: A sample from the analysis.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightScheduleTask:
+ type: object
+ required:
+ - type
+ - insight
+ properties:
+ type:
+ type: string
+ enum:
+ - Insight
+ insight:
+ $ref: '#/components/schemas/Insight'
+ description: The insight payload.
+ allOf:
+ - $ref: '#/components/schemas/ScheduleTask'
+ description: Insight task for the schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ InsightSummary:
+ type: object
+ required:
+ - sampleCount
+ - uniqueSubclusterCount
+ - uniqueClusterCount
+ - method
+ - usage
+ properties:
+ sampleCount:
+ type: integer
+ format: int32
+ description: Total number of samples analyzed.
+ uniqueSubclusterCount:
+ type: integer
+ format: int32
+ description: Total number of unique subcluster labels.
+ uniqueClusterCount:
+ type: integer
+ format: int32
+ description: Total number of unique clusters.
+ method:
+ type: string
+ description: Method used for clustering.
+ usage:
+ $ref: '#/components/schemas/ClusterTokenUsage'
+ description: Token usage while performing clustering analysis
+ description: Summary of the error cluster analysis.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - EvaluationRunClusterInsight
+ - AgentClusterInsight
+ - EvaluationComparison
+ description: The request of the insights.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InsightsMetadata:
+ type: object
+ required:
+ - createdAt
+ properties:
+ createdAt:
+ type: string
+ format: date-time
+ description: The timestamp when the insights were created.
+ completedAt:
+ type: string
+ format: date-time
+ description: The timestamp when the insights were completed.
+ description: Metadata about the insights.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Insights=V1Preview
+ InvocationsProtocolConfiguration:
+ type: object
+ description: Configuration specific to the invocations protocol.
+ InvocationsWsProtocolConfiguration:
+ type: object
+ description: Configuration specific to the WebSocket-based invocations protocol.
+ InvokeAgentInvocationsApiDispatchPayload:
+ type: object
+ required:
+ - type
+ - input
+ properties:
+ type:
+ type: string
+ enum:
+ - invoke_agent_invocations_api
+ description: The manual dispatch payload type.
+ input:
+ description: The JSON value sent as the complete downstream invocations input. The value is passed through as-is and can be an object, string, number, boolean, array, or null.
+ allOf:
+ - $ref: '#/components/schemas/RoutineDispatchPayload'
+ description: A manual payload used to test an invocations API routine dispatch.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ InvokeAgentInvocationsApiRoutineAction:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - invoke_agent_invocations_api
+ description: The action type.
+ agent_name:
+ type: string
+ maxLength: 256
+ description: The project-scoped agent name for routine dispatch.
+ agent_endpoint_id:
+ type: string
+ maxLength: 256
+ description: Legacy endpoint-scoped agent identifier for routine dispatch.
+ input:
+ description: Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
+ session_id:
+ type: string
+ maxLength: 256
+ description: An optional existing hosted-agent session identifier to continue during the downstream dispatch.
+ allOf:
+ - $ref: '#/components/schemas/RoutineAction'
+ description: Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ InvokeAgentResponsesApiDispatchPayload:
+ type: object
+ required:
+ - type
+ - input
+ properties:
+ type:
+ type: string
+ enum:
+ - invoke_agent_responses_api
+ description: The manual dispatch payload type.
+ input:
+ description: The JSON value sent as the complete downstream responses input. The value is passed through as-is and can be an object, string, number, boolean, array, or null.
+ allOf:
+ - $ref: '#/components/schemas/RoutineDispatchPayload'
+ description: A manual payload used to test a responses API routine dispatch.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ InvokeAgentResponsesApiRoutineAction:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - invoke_agent_responses_api
+ description: The action type.
+ agent_name:
+ type: string
+ maxLength: 256
+ description: The project-scoped agent name for routine dispatch.
+ agent_endpoint_id:
+ type: string
+ maxLength: 256
+ description: Legacy endpoint-scoped agent identifier for routine dispatch.
+ input:
+ description: Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
+ conversation:
+ type: string
+ maxLength: 256
+ description: An optional existing conversation identifier to continue during the downstream dispatch.
+ allOf:
+ - $ref: '#/components/schemas/RoutineAction'
+ description: Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.
+ x-ms-foundry-meta:
+ conditional_previews:
+ - Routines=V1Preview
+ ItemGenerationParams:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/ItemGenerationParamsType'
+ description: The type of item generation parameters to use.
+ discriminator:
+ propertyName: type
+ mapping:
+ red_team: '#/components/schemas/RedTeamItemGenerationParams'
+ red_team_seed_prompts: '#/components/schemas/RedTeamSeedPromptsItemGenerationParams'
+ red_team_taxonomy: '#/components/schemas/RedTeamTaxonomyItemGenerationParams'
+ response_retrieval: '#/components/schemas/ResponseRetrievalItemGenerationParams'
+ conversation_gen_preview: '#/components/schemas/ConversationGenPreviewItemGenerationParams'
+ synthetic_data_gen_preview: '#/components/schemas/SyntheticDataGenerationPreviewItemGenerationParams'
+ description: Represents the set of parameters used to control item generation operations.
+ ItemGenerationParamsType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - red_team
+ - response_retrieval
+ - red_team_seed_prompts
+ - red_team_taxonomy
+ - synthetic_data_gen_preview
+ - conversation_gen_preview
+ description: The types of parameters for red team item generation.
+ JobStatus:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - queued
+ - in_progress
+ - succeeded
+ - failed
+ - cancelled
+ description: Extensible status values shared by Foundry jobs.
+ LoraConfig:
+ type: object
+ properties:
+ rank:
+ type: integer
+ format: int32
+ description: 'LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.'
+ alpha:
+ type: integer
+ format: int32
+ description: LoRA scaling factor (α). Positive integer; typically 2× the rank.
+ targetModules:
+ type: array
+ items:
+ type: string
+ description: Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from adapter_config.json if omitted.
+ dropout:
+ type: number
+ format: float
+ description: Dropout rate used during training. Informational — not used at serving time.
+ description: Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ MCPToolboxTool:
+ type: object
+ required:
+ - type
+ - server_label
+ properties:
+ type:
+ type: string
+ enum:
+ - mcp
+ server_label:
+ type: string
+ description: A label for this MCP server, used to identify it in tool calls.
+ server_url:
+ type: string
+ format: uri
+ description: |-
+ The URL for the MCP server. One of `server_url`, `connector_id`, or
+ `tunnel_id` must be provided.
+ connector_id:
+ type: string
+ enum:
+ - connector_dropbox
+ - connector_gmail
+ - connector_googlecalendar
+ - connector_googledrive
+ - connector_microsoftteams
+ - connector_outlookcalendar
+ - connector_outlookemail
+ - connector_sharepoint
+ description: |-
+ Identifier for service connectors, like those available in ChatGPT. One of
+ `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
+ about service connectors [here](/docs/guides/tools-remote-mcp#connectors).
+ Currently supported `connector_id` values are:
+ - Dropbox: `connector_dropbox`
+ - Gmail: `connector_gmail`
+ - Google Calendar: `connector_googlecalendar`
+ - Google Drive: `connector_googledrive`
+ - Microsoft Teams: `connector_microsoftteams`
+ - Outlook Calendar: `connector_outlookcalendar`
+ - Outlook Email: `connector_outlookemail`
+ - SharePoint: `connector_sharepoint`
+ tunnel_id:
+ type: string
+ pattern: ^tunnel_[a-z0-9]{32}$
+ description: |-
+ The Secure MCP Tunnel ID to use instead of a direct server URL. One of
+ `server_url`, `connector_id`, or `tunnel_id` must be provided.
+ authorization:
+ type: string
+ description: |-
+ An OAuth access token that can be used with a remote MCP server, either
+ with a custom MCP server URL or a service connector. Your application
+ must handle the OAuth authorization flow and provide the token here.
+ server_description:
+ type: string
+ description: Optional description of the MCP server, used to provide more context.
+ headers:
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ type: string
+ - type: 'null'
+ allowed_tools:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ - type: 'null'
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ enum:
+ - always
+ - never
+ - type: 'null'
+ default: always
+ defer_loading:
+ type: boolean
+ description: Whether this MCP tool is deferred and discovered via tool search.
+ project_connection_id:
+ type: string
+ description: The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: An MCP tool stored in a toolbox.
+ ManagedAgentIdentityBlueprint:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ readOnly: true
+ ManagedAgentIdentityBlueprintReference:
+ type: object
+ required:
+ - type
+ - blueprint_id
+ properties:
+ type:
+ type: string
+ enum:
+ - ManagedAgentIdentityBlueprint
+ blueprint_id:
+ type: string
+ description: The ID of the managed blueprint
+ allOf:
+ - $ref: '#/components/schemas/AgentBlueprintReference'
+ ManagedAzureAISearchIndex:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - ManagedAzureSearch
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/Index'
+ description: Managed Azure AI Search Index Definition
+ ManagedAzureAISearchIndexUpdate:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - ManagedAzureSearch
+ description: Type of index
+ allOf:
+ - $ref: '#/components/schemas/IndexUpdate'
+ description: Managed Azure AI Search Index Definition
+ McpProtocolConfiguration:
+ type: object
+ description: Configuration specific to the MCP protocol.
+ MemoryCommandToolCall:
+ type: object
+ required:
+ - type
+ - call_id
+ - arguments
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - memory_command_preview_call
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the tool, including `action` (`remember` or `forget`) and `content`.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A memory command tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ MemoryCommandToolCallOutput:
+ type: object
+ required:
+ - type
+ - call_id
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - memory_command_preview_call_output
+ call_id:
+ type: string
+ description: The unique ID of the tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a memory command tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ MemoryItem:
+ type: object
+ required:
+ - memory_id
+ - updated_at
+ - scope
+ - content
+ - kind
+ properties:
+ memory_id:
+ type: string
+ description: The unique ID of the memory item.
+ updated_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The last update time of the memory item.
+ scope:
+ type: string
+ description: The namespace that logically groups and isolates memories, such as a user ID.
+ content:
+ type: string
+ description: The content of the memory.
+ kind:
+ $ref: '#/components/schemas/MemoryItemKind'
+ description: The kind of the memory item.
+ discriminator:
+ propertyName: kind
+ mapping:
+ user_profile: '#/components/schemas/UserProfileMemoryItem'
+ chat_summary: '#/components/schemas/ChatSummaryMemoryItem'
+ procedural: '#/components/schemas/ProceduralMemoryItem'
+ description: A single memory item stored in the memory store, containing content and metadata.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryItemKind:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - user_profile
+ - chat_summary
+ - procedural
+ description: Memory item kind.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryOperation:
+ type: object
+ required:
+ - kind
+ - memory_item
+ properties:
+ kind:
+ $ref: '#/components/schemas/MemoryOperationKind'
+ description: The type of memory operation being performed.
+ memory_item:
+ $ref: '#/components/schemas/MemoryItem'
+ description: The memory item to create, update, or delete.
+ description: Represents a single memory operation (create, update, or delete) performed on a memory item.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryOperationKind:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - create
+ - update
+ - delete
+ description: Memory operation kind.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemorySearchItem:
+ type: object
+ required:
+ - memory_item
+ properties:
+ memory_item:
+ $ref: '#/components/schemas/MemoryItem'
+ description: Retrieved memory item.
+ description: A retrieved memory item from memory search.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemorySearchOptions:
+ type: object
+ properties:
+ max_memories:
+ type: integer
+ format: int32
+ description: Maximum number of memory items to return.
+ description: Memory search options.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemorySearchPreviewTool:
+ type: object
+ required:
+ - type
+ - memory_store_name
+ - scope
+ properties:
+ type:
+ type: string
+ enum:
+ - memory_search_preview
+ description: The type of the tool. Always `memory_search_preview`.
+ memory_store_name:
+ type: string
+ description: The name of the memory store to use.
+ scope:
+ type: string
+ description: |-
+ The namespace used to group and isolate memories, such as a user ID.
+ Limits which memories can be retrieved or updated.
+ Use special variable `{{$userId}}` to scope memories to the current signed-in user.
+ search_options:
+ $ref: '#/components/schemas/MemorySearchOptions'
+ description: Options for searching the memory store.
+ update_delay:
+ type: integer
+ format: int32
+ description: Time to wait before updating memories after inactivity (seconds). Default 300.
+ default: 300
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool for integrating memories into the agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ MemorySearchTool:
+ type: object
+ required:
+ - type
+ - memory_store_name
+ - scope
+ properties:
+ type:
+ type: string
+ enum:
+ - memory_search
+ description: The type of the tool. Always `memory_search_preview`.
+ memory_store_name:
+ type: string
+ description: The name of the memory store to use.
+ scope:
+ type: string
+ description: |-
+ The namespace used to group and isolate memories, such as a user ID.
+ Limits which memories can be retrieved or updated.
+ Use special variable `{{$userId}}` to scope memories to the current signed-in user.
+ search_options:
+ $ref: '#/components/schemas/MemorySearchOptions'
+ description: Options for searching the memory store.
+ update_delay:
+ type: integer
+ format: int32
+ description: Time to wait before updating memories after inactivity (seconds). Default 300.
+ default: 300
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool for integrating memories into the agent.
+ MemorySearchToolCall:
+ type: object
+ required:
+ - type
+ - status
+ properties:
+ type:
+ type: string
+ enum:
+ - memory_search_call
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ description: The status of the tool call.
+ memories:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/MemoryItem'
+ - type: 'null'
+ description: The results returned from the memory search.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A memory search tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ MemoryStoreDefaultDefinition:
+ type: object
+ required:
+ - kind
+ - chat_model
+ - embedding_model
+ properties:
+ kind:
+ type: string
+ enum:
+ - default
+ description: The kind of the memory store.
+ chat_model:
+ type: string
+ description: The name or identifier of the chat completion model deployment used for memory processing.
+ embedding_model:
+ type: string
+ description: The name or identifier of the embedding model deployment used for memory processing.
+ options:
+ $ref: '#/components/schemas/MemoryStoreDefaultOptions'
+ description: Default memory store options.
+ allOf:
+ - $ref: '#/components/schemas/MemoryStoreDefinition'
+ description: Default memory store implementation.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreDefaultOptions:
+ type: object
+ required:
+ - user_profile_enabled
+ - chat_summary_enabled
+ properties:
+ user_profile_enabled:
+ type: boolean
+ description: Whether to enable user profile extraction and storage. Default is true.
+ default: true
+ user_profile_details:
+ type: string
+ description: Specific categories or types of user profile information to extract and store.
+ chat_summary_enabled:
+ type: boolean
+ description: Whether to enable chat summary extraction and storage. Defaults to `true`.
+ default: true
+ procedural_memory_enabled:
+ type: boolean
+ description: Whether to enable procedural memory extraction and storage. The service defaults to `true` if a value is not specified by the caller.
+ default: true
+ default_ttl_seconds:
+ type: integer
+ format: int32
+ description: The default time-to-live for memories in seconds. A value of `0` indicates that memories do not expire. Defaults to `0`.
+ default: 0
+ description: Default memory store configurations.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreDefinition:
+ type: object
+ required:
+ - kind
+ properties:
+ kind:
+ $ref: '#/components/schemas/MemoryStoreKind'
+ description: The kind of the memory store.
+ discriminator:
+ propertyName: kind
+ mapping:
+ default: '#/components/schemas/MemoryStoreDefaultDefinition'
+ description: Base definition for memory store configurations.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreDeleteScopeResponse:
+ type: object
+ required:
+ - object
+ - name
+ - scope
+ - deleted
+ properties:
+ object:
+ type: string
+ enum:
+ - memory_store.scope.deleted
+ description: The object type. Always 'memory_store.scope.deleted'.
+ name:
+ type: string
+ description: The name of the memory store.
+ scope:
+ type: string
+ description: The scope from which memories were deleted.
+ deleted:
+ type: boolean
+ description: Whether the deletion operation was successful.
+ description: Response for deleting memories from a scope.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreKind:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - default
+ description: The type of memory store implementation to use.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreObject:
+ type: object
+ required:
+ - object
+ - id
+ - created_at
+ - updated_at
+ - name
+ - definition
+ properties:
+ object:
+ type: string
+ enum:
+ - memory_store
+ description: The object type, which is always 'memory_store'.
+ id:
+ type: string
+ description: The unique identifier of the memory store.
+ created_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The Unix timestamp (seconds) when the memory store was created.
+ updated_at:
+ $ref: '#/components/schemas/FoundryTimestamp'
+ description: The Unix timestamp (seconds) when the memory store was last updated.
+ name:
+ type: string
+ maxLength: 256
+ description: The name of the memory store.
+ description:
+ type: string
+ maxLength: 512
+ description: A human-readable description of the memory store.
+ metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Arbitrary key-value metadata to associate with the memory store.
+ definition:
+ $ref: '#/components/schemas/MemoryStoreDefinition'
+ description: The definition of the memory store.
+ description: A memory store that can store and retrieve user memories.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreOperationUsage:
+ type: object
+ required:
+ - embedding_tokens
+ - input_tokens
+ - input_tokens_details
+ - output_tokens
+ - output_tokens_details
+ - total_tokens
+ properties:
+ embedding_tokens:
+ type: integer
+ format: int32
+ description: The number of embedding tokens.
+ input_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of input tokens.
+ input_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails'
+ description: A detailed breakdown of the input tokens.
+ output_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of output tokens.
+ output_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails'
+ description: A detailed breakdown of the output tokens.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total number of tokens used.
+ description: Usage statistics of a memory store operation.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreSearchResponse:
+ type: object
+ required:
+ - search_id
+ - memories
+ - usage
+ properties:
+ search_id:
+ type: string
+ description: The unique ID of this search request. Use this value as previous_search_id in subsequent requests to perform incremental searches.
+ memories:
+ type: array
+ items:
+ $ref: '#/components/schemas/MemorySearchItem'
+ description: Related memory items found during the search operation.
+ usage:
+ $ref: '#/components/schemas/MemoryStoreOperationUsage'
+ description: Usage statistics associated with the memory search operation.
+ description: Memory search response.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreUpdateCompletedResult:
+ type: object
+ required:
+ - memory_operations
+ - usage
+ properties:
+ memory_operations:
+ type: array
+ items:
+ $ref: '#/components/schemas/MemoryOperation'
+ description: A list of individual memory operations that were performed during the update.
+ usage:
+ $ref: '#/components/schemas/MemoryStoreOperationUsage'
+ description: Usage statistics associated with the memory update operation.
+ description: Memory update result.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreUpdateResponse:
+ type: object
+ required:
+ - update_id
+ - status
+ properties:
+ update_id:
+ type: string
+ description: The unique ID of this update request. Use this value as previous_update_id in subsequent requests to perform incremental updates.
+ status:
+ $ref: '#/components/schemas/MemoryStoreUpdateStatus'
+ description: The status of the memory update operation. One of "queued", "in_progress", "completed", "failed", or "superseded".
+ superseded_by:
+ type: string
+ description: The update_id the operation was superseded by when status is "superseded".
+ result:
+ $ref: '#/components/schemas/MemoryStoreUpdateCompletedResult'
+ description: The result of memory store update operation when status is "completed".
+ error:
+ $ref: '#/components/schemas/OpenAI.Error'
+ description: Error object that describes the error when status is "failed".
+ description: Provides the status of a memory store update operation.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ MemoryStoreUpdateStatus:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - queued
+ - in_progress
+ - completed
+ - failed
+ - superseded
+ description: Status of a memory store update operation.
+ x-ms-foundry-meta:
+ required_previews:
+ - MemoryStores=V1Preview
+ Message:
+ type: object
+ required:
+ - role
+ properties:
+ role:
+ anyOf:
+ - type: string
+ enum:
+ - system
+ - assistant
+ - developer
+ - user
+ - type: string
+ description: "The role of the message author. Known values: 'system', 'assistant', 'developer', 'user'."
+ discriminator:
+ propertyName: role
+ mapping:
+ system: '#/components/schemas/SystemMessage'
+ developer: '#/components/schemas/DeveloperMessage'
+ user: '#/components/schemas/UserMessage'
+ assistant: '#/components/schemas/AssistantMessage'
+ description: Abstract base model representing a single message in a conversation.
+ MicrosoftFabricPreviewTool:
type: object
required:
- type
+ - fabric_dataagent_preview
properties:
type:
type: string
enum:
- - a2a_preview
- description: The type of the tool. Always `"a2a_preview`.
- base_url:
- type: string
- format: uri
- description: Base URL of the agent.
- agent_card_path:
- type: string
- description: |-
- The path to the agent card relative to the `base_url`.
- If not provided, defaults to `/.well-known/agent-card.json`
- project_connection_id:
- type: string
- description: |-
- The connection ID in the project for the A2A server.
- The connection stores authentication and other connection details needed to connect to the A2A server.
- send_credentials_for_agent_card:
- type: boolean
- description: |-
- When `true`, Foundry sends its credentials when fetching the remote
- agent's Agent Card. The service defaults to `false` if a value is not
- specified by the caller (anonymous fetch).
- default: false
+ - fabric_dataagent_preview
+ description: The object type, which is always 'fabric_dataagent_preview'.
+ fabric_dataagent_preview:
+ $ref: '#/components/schemas/FabricDataAgentToolParameters'
+ description: The fabric data agent tool parameters.
allOf:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: An agent implementing the A2A protocol.
- A2APreviewToolboxTool:
+ description: The input definition information for a Microsoft Fabric tool as used to configure an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ ModelCredentialRequest:
type: object
required:
- - type
+ - blobUri
properties:
- type:
- type: string
- enum:
- - a2a_preview
- base_url:
+ blobUri:
type: string
format: uri
- description: Base URL of the agent.
- agent_card_path:
- type: string
- description: |-
- The path to the agent card relative to the `base_url`.
- If not provided, defaults to `/.well-known/agent-card.json`
- project_connection_id:
- type: string
- description: |-
- The connection ID in the project for the A2A server.
- The connection stores authentication and other connection details needed to connect to the A2A server.
- send_credentials_for_agent_card:
- type: boolean
- description: |-
- When `true`, Foundry sends its credentials when fetching the remote
- agent's Agent Card. The service defaults to `false` if a value is not
- specified by the caller (anonymous fetch).
- default: false
- allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: An A2A tool stored in a toolbox.
- A2AProtocolConfiguration:
- type: object
- description: Configuration specific to the A2A protocol.
- A2AToolCall:
+ description: Blob URI of the model asset to fetch credentials for.
+ description: Request to fetch credentials for a model asset.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ ModelDeployment:
type: object
required:
- type
- - call_id
- - name
- - arguments
- - status
+ - modelName
+ - modelVersion
+ - modelPublisher
+ - capabilities
+ - sku
properties:
type:
type: string
enum:
- - a2a_preview_call
- call_id:
+ - ModelDeployment
+ description: The type of the deployment
+ modelName:
type: string
- description: The unique ID of the tool call generated by the model.
- name:
+ description: Publisher-specific name of the deployed model
+ readOnly: true
+ modelVersion:
type: string
- description: The name of the A2A agent card being called.
- arguments:
+ description: Publisher-specific version of the deployed model
+ readOnly: true
+ modelPublisher:
type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ description: Name of the deployed model's publisher
+ readOnly: true
+ capabilities:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Capabilities of deployed model
+ readOnly: true
+ sku:
+ $ref: '#/components/schemas/Sku'
+ description: Sku of the model deployment
+ readOnly: true
+ connectionName:
+ type: string
+ description: Name of the connection the deployment comes from
+ readOnly: true
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An A2A (Agent-to-Agent) tool call.
- A2AToolCallOutput:
+ - $ref: '#/components/schemas/Deployment'
+ description: Model Deployment Definition
+ ModelPendingUploadRequest:
type: object
required:
- - type
- - call_id
- - name
- - status
+ - pendingUploadType
properties:
- type:
+ pendingUploadId:
type: string
- enum:
- - a2a_preview_call_output
- call_id:
+ description: If PendingUploadId is not provided, a random GUID will be used.
+ connectionName:
type: string
- description: The unique ID of the tool call generated by the model.
- name:
+ description: Azure Storage Account connection name to use for generating temporary SAS token
+ pendingUploadType:
type: string
- description: The name of the A2A agent card that was called.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the A2A tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of an A2A (Agent-to-Agent) tool call.
- AISearchIndexResource:
+ enum:
+ - TemporaryBlobReference
+ description: The type of pending upload. Only TemporaryBlobReference is supported for models.
+ description: Represents a request for a pending upload of a model version.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ ModelPendingUploadResponse:
type: object
+ required:
+ - blobReference
+ - pendingUploadId
+ - pendingUploadType
properties:
- project_connection_id:
- type: string
- description: An index connection ID in an IndexResource attached to this agent.
- index_name:
+ blobReference:
+ $ref: '#/components/schemas/BlobReference'
+ description: Container-level read, write, list SAS.
+ pendingUploadId:
type: string
- description: The name of an index in an IndexResource attached to this agent.
- query_type:
- $ref: '#/components/schemas/AzureAISearchQueryType'
- description: Type of query in an AIIndexResource attached to this agent.
- top_k:
- type: integer
- format: int32
- description: Number of documents to retrieve from search and present to the model.
- filter:
+ description: ID for this upload request.
+ version:
type: string
- description: filter string for search resource. [Learn more here](https://learn.microsoft.com/azure/search/search-filters).
- index_asset_id:
+ description: Version of asset to be created if user did not specify version when initially creating upload
+ pendingUploadType:
type: string
- description: Index asset id for search resource.
- description: A AI Search Index resource.
- ActivityProtocolConfiguration:
+ enum:
+ - TemporaryBlobReference
+ description: The type of pending upload. Only TemporaryBlobReference is supported for models.
+ description: Represents the response for a model pending upload request.
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ ModelSamplingParams:
type: object
properties:
- enable_m365_public_endpoint:
- type: boolean
- description: Whether to enable the M365 public endpoint for the activity protocol.
- description: Configuration specific to the activity protocol.
- AgentBlueprintReference:
+ temperature:
+ type: number
+ format: float
+ description: The temperature parameter for sampling. Defaults to 1.0.
+ default: 1
+ top_p:
+ type: number
+ format: float
+ description: The top-p parameter for nucleus sampling. Defaults to 1.0.
+ default: 1
+ seed:
+ type: integer
+ format: int32
+ description: The random seed for reproducibility. Defaults to 42.
+ default: 42
+ max_completion_tokens:
+ type: integer
+ format: int32
+ description: The maximum number of tokens allowed in the completion.
+ description: Represents a set of parameters used to control the sampling behavior of a language model during text generation.
+ ModelSourceData:
type: object
- required:
- - type
properties:
- type:
- $ref: '#/components/schemas/AgentBlueprintReferenceType'
- discriminator:
- propertyName: type
- mapping:
- ManagedAgentIdentityBlueprint: '#/components/schemas/ManagedAgentIdentityBlueprintReference'
- AgentBlueprintReferenceType:
- anyOf:
- - type: string
- - type: string
- enum:
- - ManagedAgentIdentityBlueprint
- AgentCard:
+ sourceType:
+ $ref: '#/components/schemas/FoundryModelSourceType'
+ description: The source type of the model
+ jobId:
+ type: string
+ description: The job ID that produced this model
+ description: Source information for the model
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ ModelVersion:
type: object
required:
+ - blobUri
+ - name
- version
- - skills
properties:
- version:
+ blobUri:
type: string
- minLength: 1
- maxLength: 32
- description: The version of the agent card.
- description:
+ format: uri
+ description: URI of the model artifact in blob storage
+ weightType:
+ $ref: '#/components/schemas/FoundryModelWeightType'
+ description: The weight type of the model
+ baseModel:
type: string
- maxLength: 2048
- description: The description of the agent card.
- skills:
+ description: Base model asset ID
+ source:
+ $ref: '#/components/schemas/ModelSourceData'
+ description: The source of the model
+ loraConfig:
+ $ref: '#/components/schemas/LoraConfig'
+ description: Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided values take precedence over auto-detected values.
+ artifactProfile:
+ $ref: '#/components/schemas/ArtifactProfile'
+ description: The artifact profile of the model
+ readOnly: true
+ warnings:
type: array
items:
- $ref: '#/components/schemas/AgentCardSkill'
- minItems: 1
- maxItems: 16
- description: The set of skills that an agent can perform.
- AgentCardSkill:
- type: object
- required:
- - id
- - name
- properties:
+ $ref: '#/components/schemas/FoundryModelWarning'
+ description: Service-computed advisory warnings derived from the artifact profile.
+ readOnly: true
id:
type: string
- minLength: 1
- maxLength: 64
- description: a unique identifier for the skill
+ description: Asset ID, a unique identifier for the asset
+ readOnly: true
name:
type: string
- minLength: 1
- maxLength: 128
- description: The name of the skill
+ description: The name of the resource
+ readOnly: true
+ version:
+ type: string
+ description: The version of the resource
+ readOnly: true
description:
type: string
- maxLength: 2048
- description: A description of the skill
+ description: The asset description text.
tags:
- type: array
- items:
- $ref: '#/components/schemas/AgentCardSkillTag'
- maxItems: 5
- description: set of tagwords describing classes of capabilities for the skill
- examples:
- type: array
- items:
- $ref: '#/components/schemas/AgentCardSkillExample'
- maxItems: 5
- description: A list of example scenarios that the skill can perform.
- AgentCardSkillExample:
- type: string
- maxLength: 1024
- description: A skill example string with a maximum length of 1024 characters.
- AgentCardSkillTag:
- type: string
- maxLength: 32
- AgentCardUpdate:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: Tag dictionary. Tags can be added, removed, and updated.
+ description: Model Version Definition
+ x-ms-foundry-meta:
+ required_previews:
+ - Models=V1Preview
+ MonthlyRecurrenceSchedule:
type: object
+ required:
+ - type
+ - daysOfMonth
properties:
- version:
- type: string
- minLength: 1
- maxLength: 32
- description: The version of the agent card.
- description:
+ type:
type: string
- maxLength: 2048
- description: The description of the agent card.
- skills:
+ enum:
+ - Monthly
+ description: Monthly recurrence type.
+ daysOfMonth:
type: array
items:
- $ref: '#/components/schemas/AgentCardSkill'
- minItems: 1
- maxItems: 16
- description: The set of skills that an agent can perform.
- AgentClusterInsightRequest:
+ type: integer
+ format: int32
+ description: Days of the month for the recurrence schedule.
+ allOf:
+ - $ref: '#/components/schemas/RecurrenceSchedule'
+ description: Monthly recurrence schedule.
+ x-ms-foundry-meta:
+ required_previews:
+ - Schedules=V1Preview
+ NoAuthenticationCredentials:
type: object
required:
- type
- - agentName
properties:
type:
type: string
enum:
- - AgentClusterInsight
- description: The type of request.
- agentName:
+ - None
+ description: 'The credential type '
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/BaseCredentials'
+ description: Credentials that do not require authentication
+ OAuthConsentRequestOutputItem:
+ type: object
+ required:
+ - id
+ - type
+ - consent_link
+ - server_label
+ properties:
+ id:
type: string
- description: Identifier for the agent.
- modelConfiguration:
- $ref: '#/components/schemas/InsightModelConfiguration'
- description: Configuration of the model used in the insight generation.
+ type:
+ type: string
+ enum:
+ - oauth_consent_request
+ consent_link:
+ type: string
+ description: The link the user can use to perform OAuth consent.
+ server_label:
+ type: string
+ description: The server label for the OAuth consent request.
allOf:
- - $ref: '#/components/schemas/InsightRequest'
- description: Insights on set of Agent Evaluation Results
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- AgentClusterInsightResult:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: Request from the service for the user to perform OAuth consent.
+ OneTimeTrigger:
type: object
required:
- type
- - clusterInsight
+ - triggerAt
properties:
type:
type: string
enum:
- - AgentClusterInsight
- description: The type of insights result.
- clusterInsight:
- $ref: '#/components/schemas/ClusterInsightResult'
+ - OneTime
+ triggerAt:
+ type: string
+ description: Date and time for the one-time trigger in ISO 8601 format.
+ timeZone:
+ type: string
+ description: Time zone for the one-time trigger. Defaults to `UTC`.
+ default: UTC
allOf:
- - $ref: '#/components/schemas/InsightResult'
- description: Insights from the agent cluster analysis.
+ - $ref: '#/components/schemas/Trigger'
+ description: One-time trigger.
x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- AgentContainerObject:
+ required_previews:
+ - Schedules=V1Preview
+ OpenAI.AddUploadPartRequest:
type: object
+ properties:
+ data:
+ description: The chunk of bytes for this Part.
required:
- - object
- - status
- - created_at
- - updated_at
+ - data
+ OpenAI.Annotation:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.AnnotationType'
+ discriminator:
+ propertyName: type
+ mapping:
+ file_citation: '#/components/schemas/OpenAI.FileCitationBody'
+ url_citation: '#/components/schemas/OpenAI.UrlCitationBody'
+ container_file_citation: '#/components/schemas/OpenAI.ContainerFileCitationBody'
+ file_path: '#/components/schemas/OpenAI.FilePath'
+ description: An annotation that applies to a span of output text.
+ OpenAI.AnnotationType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - file_citation
+ - url_citation
+ - container_file_citation
+ - file_path
+ OpenAI.ApplyPatchCallOutputStatus:
+ type: string
+ enum:
+ - completed
+ - failed
+ OpenAI.ApplyPatchCallOutputStatusParam:
+ type: string
+ enum:
+ - completed
+ - failed
+ description: Outcome values reported for apply_patch tool call outputs.
+ title: Apply patch call output status
+ OpenAI.ApplyPatchCallStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ OpenAI.ApplyPatchCallStatusParam:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ description: Status values reported for apply_patch tool calls.
+ title: Apply patch call status
+ OpenAI.ApplyPatchCreateFileOperation:
+ type: object
+ required:
+ - type
+ - path
+ - diff
properties:
- object:
+ type:
type: string
enum:
- - agent.container
- description: The object type, which is always 'agent.container'.
- readOnly: true
- id:
- type: string
- description: The identifier of the container.
- readOnly: true
- status:
- $ref: '#/components/schemas/AgentContainerStatus'
- description: The status of the container of a specific version of an agent.
- readOnly: true
- max_replicas:
- type: integer
- format: int32
- description: The maximum number of replicas for the container. Default is 1.
- examples:
- - 10
- min_replicas:
- type: integer
- format: int32
- description: The minimum number of replicas for the container. Default is 1.
- examples:
- - 1
- error_message:
- type: string
- description: The error message if the container failed to operate, if any.
- readOnly: true
- created_at:
+ - create_file
+ description: Create a new file with the provided diff.
+ x-stainless-const: true
+ path:
type: string
- format: date-time
- description: The creation time of the container.
- readOnly: true
- updated_at:
+ description: Path of the file to create.
+ diff:
type: string
- format: date-time
- description: The last update time of the container.
- readOnly: true
- container:
- $ref: '#/components/schemas/ContainerDetails'
- description: The detailed container information.
- readOnly: true
- description: The details of the container of a specific version of an agent.
- x-ms-foundry-meta:
- required_previews:
- - ContainerAgents=V1Preview
- AgentContainerOperationError:
+ description: Diff to apply.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: Instruction describing how to create a file via the apply_patch tool.
+ title: Apply patch create file operation
+ OpenAI.ApplyPatchCreateFileOperationParam:
type: object
required:
- - code
- type
- - message
+ - path
+ - diff
properties:
- code:
- type: string
- description: The error code of the container operation.
type:
type: string
- description: The error type of the container operation.
- message:
+ enum:
+ - create_file
+ description: The operation type. Always `create_file`.
+ x-stainless-const: true
+ path:
type: string
- description: The error message of the container operation.
- description: The error details of the container operation, if any.
- x-ms-foundry-meta:
- required_previews:
- - ContainerAgents=V1Preview
- AgentContainerOperationObject:
+ minLength: 1
+ description: Path of the file to create relative to the workspace root.
+ diff:
+ type: string
+ maxLength: 10485760
+ description: Unified diff content to apply when creating the file.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: Instruction for creating a new file via the apply_patch tool.
+ title: Apply patch create file operation
+ OpenAI.ApplyPatchDeleteFileOperation:
type: object
required:
- - id
- - agent_id
- - agent_version_id
- - status
+ - type
+ - path
properties:
- id:
- type: string
- description: The ID of the container operation. This id is a globally unique identifier.
- agent_id:
- type: string
- description: The ID of the agent.
- agent_version_id:
+ type:
type: string
- description: The ID of the agent version.
- status:
- $ref: '#/components/schemas/AgentContainerOperationStatus'
- description: The status of the container operation.
- error:
- $ref: '#/components/schemas/AgentContainerOperationError'
- description: The error of the container operation, if any.
- container:
- $ref: '#/components/schemas/AgentContainerObject'
- description: The container of the specific version of an agent.
- description: The container operation for a specific version of an agent.
- x-ms-foundry-meta:
- required_previews:
- - ContainerAgents=V1Preview
- AgentContainerOperationStatus:
- type: string
- enum:
- - NotStarted
- - InProgress
- - Succeeded
- - Failed
- description: Status of the container operation for a specific version of an agent.
- x-ms-foundry-meta:
- required_previews:
- - ContainerAgents=V1Preview
- AgentContainerStatus:
- anyOf:
- - type: string
- - type: string
enum:
- - Starting
- - Running
- - Stopping
- - Stopped
- - Failed
- - Deleting
- - Deleted
- - Updating
- description: Status of the container of a specific version of an agent.
- x-ms-foundry-meta:
- required_previews:
- - ContainerAgents=V1Preview
- AgentDataGenerationJobSource:
+ - delete_file
+ description: Delete the specified file.
+ x-stainless-const: true
+ path:
+ type: string
+ description: Path of the file to delete.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: Instruction describing how to delete a file via the apply_patch tool.
+ title: Apply patch delete file operation
+ OpenAI.ApplyPatchDeleteFileOperationParam:
type: object
required:
- type
- - agent_name
+ - path
properties:
- description:
- type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
type:
type: string
enum:
- - agent
- description: The source type for this source, which is Agent.
- agent_name:
- type: string
- description: The agent name to fetch instructions from.
- agent_version:
+ - delete_file
+ description: The operation type. Always `delete_file`.
+ x-stainless-const: true
+ path:
type: string
- description: The agent version. If not specified, the latest version is used.
+ minLength: 1
+ description: Path of the file to delete relative to the workspace root.
allOf:
- - $ref: '#/components/schemas/DataGenerationJobSource'
- description: Agent source for data generation jobs — references an agent to fetch instructions and metadata from.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- AgentDefinition:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: Instruction for deleting an existing file via the apply_patch tool.
+ title: Apply patch delete file operation
+ OpenAI.ApplyPatchFileOperation:
type: object
required:
- - kind
+ - type
properties:
- kind:
- $ref: '#/components/schemas/AgentKind'
- rai_config:
- $ref: '#/components/schemas/RaiConfig'
- description: Configuration for Responsible AI (RAI) content filtering and safety features.
+ type:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperationType'
discriminator:
- propertyName: kind
+ propertyName: type
mapping:
- hosted: '#/components/schemas/HostedAgentDefinition'
- prompt: '#/components/schemas/PromptAgentDefinition'
- workflow: '#/components/schemas/WorkflowAgentDefinition'
- external: '#/components/schemas/ExternalAgentDefinition'
- container_app: '#/components/schemas/ContainerAppAgentDefinition'
- x-ms-foundry-meta:
- conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- AgentDefinitionOptInKeys:
- type: string
- enum:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- - HostedAgents=V1Preview
- - ContainerAgents=V1Preview
- description: Feature opt-in keys for agent definition operations supporting hosted or workflow agents.
- AgentEndpointAuthorizationScheme:
+ create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperation'
+ delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation'
+ update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation'
+ description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
+ title: Apply patch operation
+ OpenAI.ApplyPatchFileOperationType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - create_file
+ - delete_file
+ - update_file
+ OpenAI.ApplyPatchOperationParam:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/AgentEndpointAuthorizationSchemeType'
+ $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParamType'
discriminator:
propertyName: type
mapping:
- Entra: '#/components/schemas/EntraAuthorizationScheme'
- BotService: '#/components/schemas/BotServiceAuthorizationScheme'
- BotServiceRbac: '#/components/schemas/BotServiceRbacAuthorizationScheme'
- BotServiceTenant: '#/components/schemas/BotServiceTenantAuthorizationScheme'
- AgentEndpointAuthorizationSchemeType:
+ create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperationParam'
+ delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperationParam'
+ update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperationParam'
+ description: One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.
+ title: Apply patch operation
+ OpenAI.ApplyPatchOperationParamType:
anyOf:
- type: string
- type: string
enum:
- - Entra
- - BotService
- - BotServiceRbac
- - BotServiceTenant
- AgentEndpointConfig:
- type: object
- properties:
- version_selector:
- $ref: '#/components/schemas/VersionSelector'
- description: The version selector of the agent endpoint determines how traffic is routed to different versions of the agent.
- protocols:
- type: array
- items:
- $ref: '#/components/schemas/AgentEndpointProtocol'
- description: 'Deprecated: Use protocol_configuration instead. The presence of a key in protocol_configuration declares the protocol is enabled.'
- protocol_configuration:
- $ref: '#/components/schemas/ProtocolConfiguration'
- description: Per-protocol configuration for the agent endpoint.
- authorization_schemes:
- type: array
- items:
- $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- description: The authorization schemes supported by the agent endpoint
- AgentEndpointConfigUpdate:
+ - create_file
+ - delete_file
+ - update_file
+ OpenAI.ApplyPatchToolParam:
type: object
+ required:
+ - type
properties:
- version_selector:
- $ref: '#/components/schemas/VersionSelectorUpdate'
- description: The version selector of the agent endpoint determines how traffic is routed to different versions of the agent.
- protocols:
- type: array
- items:
- $ref: '#/components/schemas/AgentEndpointProtocol'
- description: 'Deprecated: Use protocol_configuration instead. The presence of a key in protocol_configuration declares the protocol is enabled.'
- protocol_configuration:
- $ref: '#/components/schemas/ProtocolConfiguration'
- description: Per-protocol configuration for the agent endpoint.
- authorization_schemes:
- type: array
- items:
- $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- description: The authorization schemes supported by the agent endpoint
- AgentEndpointProtocol:
- anyOf:
- - type: string
- - type: string
+ type:
+ type: string
enum:
- - activity
- - responses
- - a2a
- - mcp
- - invocations
- - invocations_ws
- AgentEvaluation:
+ - apply_patch
+ description: The type of the tool. Always `apply_patch`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: Allows the assistant to create, delete, or update files using unified diffs.
+ title: Apply patch tool
+ OpenAI.ApplyPatchUpdateFileOperation:
type: object
required:
- - id
- - status
+ - type
+ - path
+ - diff
properties:
- id:
+ type:
type: string
- description: Identifier of the agent evaluation run.
- status:
+ enum:
+ - update_file
+ description: Update an existing file with the provided diff.
+ x-stainless-const: true
+ path:
type: string
- description: 'Status of the agent evaluation. Options: Running, Completed, Failed.'
- error:
+ description: Path of the file to update.
+ diff:
type: string
- description: The reason of the request failure for the long running process, if applicable.
- result:
- type: array
- items:
- $ref: '#/components/schemas/AgentEvaluationResult'
- description: The agent evaluation result.
- description: Evaluation response for agent evaluation run.
- AgentEvaluationRedactionConfiguration:
- type: object
- properties:
- redactScoreProperties:
- type: boolean
- description: Redact score properties. If not specified, the default is to redact in production.
- description: The redaction configuration will allow the user to control what is redacted.
- AgentEvaluationRequest:
+ description: Diff to apply.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: Instruction describing how to update a file via the apply_patch tool.
+ title: Apply patch update file operation
+ OpenAI.ApplyPatchUpdateFileOperationParam:
type: object
required:
- - runId
- - evaluators
- - appInsightsConnectionString
+ - type
+ - path
+ - diff
properties:
- runId:
+ type:
type: string
- description: Identifier of the agent run.
- threadId:
+ enum:
+ - update_file
+ description: The operation type. Always `update_file`.
+ x-stainless-const: true
+ path:
type: string
- description: Identifier of the agent thread. This field is mandatory currently, but it will be optional in the future.
- evaluators:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/EvaluatorConfiguration'
- description: Evaluators to be used for the evaluation.
- samplingConfiguration:
- $ref: '#/components/schemas/AgentEvaluationSamplingConfiguration'
- description: Sampling configuration for the evaluation.
- redactionConfiguration:
- $ref: '#/components/schemas/AgentEvaluationRedactionConfiguration'
- description: Redaction configuration for the evaluation.
- appInsightsConnectionString:
+ minLength: 1
+ description: Path of the file to update relative to the workspace root.
+ diff:
type: string
- description: Pass the AppInsights connection string to the agent evaluation for the evaluation results and the errors logs.
- description: Evaluation request for agent run.
- AgentEvaluationResult:
+ maxLength: 10485760
+ description: Unified diff content to apply to the existing file.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: Instruction for updating an existing file via the apply_patch tool.
+ title: Apply patch update file operation
+ OpenAI.ApproximateLocation:
type: object
required:
- - evaluator
- - evaluatorId
- - score
- - status
- - runId
+ - type
properties:
- evaluator:
- type: string
- description: Evaluator's name. This is the name of the evaluator that was used to evaluate the agent's completion.
- evaluatorId:
- type: string
- description: Identifier of the evaluator.
- score:
- type: number
- format: float
- description: Score of the given evaluator. No restriction on range.
- status:
- type: string
- description: 'Status of the evaluator result. Options: Running, Completed, Failed, NotApplicable.'
- reason:
- type: string
- description: Reasoning for the evaluation result.
- version:
+ type:
type: string
- description: Version of the evaluator that was used to evaluate the agent's completion.
- threadId:
+ enum:
+ - approximate
+ description: The type of location approximation. Always `approximate`.
+ x-stainless-const: true
+ default: approximate
+ country:
+ anyOf:
+ - type: string
+ - type: 'null'
+ region:
+ anyOf:
+ - type: string
+ - type: 'null'
+ city:
+ anyOf:
+ - type: string
+ - type: 'null'
+ timezone:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.AssistantObject:
+ type: object
+ required:
+ - id
+ - object
+ - created_at
+ - name
+ - description
+ - model
+ - instructions
+ - tools
+ - metadata
+ properties:
+ id:
type: string
- description: The unique identifier of the thread.
- runId:
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
- description: The unique identifier of the run.
- error:
+ enum:
+ - assistant
+ description: The object type, which is always `assistant`.
+ x-stainless-const: true
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the assistant was created.
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ model:
type: string
- description: A string explaining why there was an error, if applicable.
- additionalDetails:
- type: object
- unevaluatedProperties:
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ maxItems: 128
+ description: 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`.
+ default: []
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantObjectToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ response_format:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ - type: 'null'
+ description: Represents an `assistant` that can call the model and use tools.
+ title: Assistant
+ deprecated: true
+ x-oaiMeta:
+ name: The assistant object
+ example: |
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698984975,
+ "name": "Math Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ OpenAI.AssistantObjectToolResources:
+ type: object
+ properties:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.AssistantObjectToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.AssistantObjectToolResourcesFileSearch'
+ OpenAI.AssistantObjectToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
type: string
- description: Additional properties relevant to the evaluator. These will differ between evaluators.
- description: Result for the agent evaluation evaluator run.
- AgentEvaluationSamplingConfiguration:
+ maxItems: 20
+ OpenAI.AssistantObjectToolResourcesFileSearch:
type: object
- required:
- - name
- - samplingPercent
- - maxRequestRate
properties:
- name:
- type: string
- description: Name of the sampling strategy.
- samplingPercent:
- type: number
- format: float
- description: Percentage of sampling per hour (0-100).
- maxRequestRate:
- type: number
- format: float
- description: Maximum request rate per hour (0 to 1000).
- description: Definition for sampling strategy.
- AgentEvaluationSuiteJobSource:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ OpenAI.AssistantSupportedModels:
+ type: string
+ enum:
+ - 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
+ - o3-mini
+ - o3-mini-2025-01-31
+ - o1
+ - o1-2024-12-17
+ - 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
+ OpenAI.AssistantTool:
type: object
required:
- type
- - agent_name
properties:
- description:
- type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.AssistantToolType'
+ discriminator:
+ propertyName: type
+ mapping:
+ code_interpreter: '#/components/schemas/OpenAI.AssistantToolsCode'
+ file_search: '#/components/schemas/OpenAI.AssistantToolsFileSearch'
+ function: '#/components/schemas/OpenAI.AssistantToolsFunction'
+ OpenAI.AssistantToolType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - agent
- description: The source type for this source, which is Agent.
- agent_name:
- type: string
- description: The agent name to fetch instructions from.
- agent_version:
- type: string
- description: The agent version. If not specified, the latest version is used.
- allOf:
- - $ref: '#/components/schemas/EvaluationSuiteJobSource'
- description: Agent source for evaluation suite generation jobs — references an agent to fetch instructions and metadata from.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- AgentEvaluatorGenerationJobSource:
+ - code_interpreter
+ - file_search
+ - function
+ OpenAI.AssistantToolsCode:
type: object
required:
- type
- - agent_name
properties:
- description:
- type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
type:
type: string
enum:
- - agent
- description: The source type for this source, which is Agent.
- agent_name:
- type: string
- description: The agent name to fetch instructions from.
- agent_version:
- type: string
- description: The agent version. If not specified, the latest version is used.
+ - code_interpreter
+ description: 'The type of tool being defined: `code_interpreter`'
+ x-stainless-const: true
allOf:
- - $ref: '#/components/schemas/EvaluatorGenerationJobSource'
- description: Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- AgentFilterTraceSource:
+ - $ref: '#/components/schemas/OpenAI.AssistantTool'
+ title: Code interpreter tool
+ OpenAI.AssistantToolsFileSearch:
type: object
required:
- type
@@ -13721,1654 +48676,1688 @@ components:
type:
type: string
enum:
- - agent_filter
- description: The type of trace source, always `agent_filter`.
- agent_id:
- type: string
- description: The identifier of the agent to filter traces by.
- agent_name:
- type: string
- description: The name of the agent to filter traces by.
- agent_version:
- type: string
- description: The version of the agent to filter traces by.
- start_time:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: Start time for the trace query window, expressed as a Unix timestamp (seconds).
- end_time:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: End time for the trace query window, expressed as a Unix timestamp (seconds).
- max_traces:
- type: integer
- format: int32
- description: Maximum number of traces to sample. Must be greater than 0.
- filter_strategy:
- $ref: '#/components/schemas/FilterStrategyType'
- description: The strategy used to filter traces.
+ - file_search
+ description: 'The type of tool being defined: `file_search`'
+ x-stainless-const: true
+ file_search:
+ $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchFileSearch'
+ description: Overrides for the file search tool.
allOf:
- - $ref: '#/components/schemas/TraceSource'
- description: A trace source that selects traces by agent reference with time-based filtering.
- AgentId:
+ - $ref: '#/components/schemas/OpenAI.AssistantTool'
+ title: FileSearch tool
+ OpenAI.AssistantToolsFileSearchFileSearch:
+ type: object
+ properties:
+ max_num_results:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 1
+ maximum: 50
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.FileSearchRankingOptions'
+ OpenAI.AssistantToolsFileSearchTypeOnly:
type: object
required:
- type
- - name
- - version
properties:
type:
type: string
enum:
- - agent_id
- name:
- type: string
- maxLength: 256
- description: The name of the agent.
- version:
- type: string
- description: The version identifier of the agent.
- AgentIdentity:
+ - file_search
+ description: 'The type of tool being defined: `file_search`'
+ x-stainless-const: true
+ title: FileSearch tool
+ OpenAI.AssistantToolsFunction:
type: object
required:
- - principal_id
- - client_id
+ - type
+ - function
properties:
- principal_id:
- type: string
- description: The principal ID of the agent instance
- client_id:
+ type:
type: string
- description: The client ID of the agent instance. Also referred to as the instance ID
- AgentKind:
- anyOf:
+ enum:
+ - function
+ description: 'The type of tool being defined: `function`'
+ x-stainless-const: true
+ function:
+ $ref: '#/components/schemas/OpenAI.FunctionObject'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantTool'
+ title: Function tool
+ OpenAI.AssistantsApiResponseFormatOption:
+ oneOf:
- type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatText'
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject'
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
+ description: |-
+ Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
+ 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](/docs/guides/structured-outputs).
+ Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON.
+ *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.
+ OpenAI.AssistantsApiToolChoiceOption:
+ oneOf:
- type: string
enum:
- - prompt
- - hosted
- - workflow
- - external
- - container_app
- AgentObject:
+ - none
+ - auto
+ - required
+ - $ref: '#/components/schemas/OpenAI.AssistantsNamedToolChoice'
+ description: |-
+ Controls which (if any) tool is called by the model.
+ `none` means the model will not call any tools and instead generates a message.
+ `auto` is the default value and means the model can pick between generating a message or calling one or more tools.
+ `required` means the model must call one or more tools before responding to the user.
+ Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
+ OpenAI.AssistantsNamedToolChoice:
type: object
required:
- - object
- - id
- - name
- - state
- - versions
+ - type
properties:
- object:
+ type:
type: string
enum:
- - agent
- description: The object type, which is always 'agent'.
- id:
- type: string
- description: The unique identifier of the agent.
- name:
- type: string
- maxLength: 63
- description: The name of the agent.
- state:
- $ref: '#/components/schemas/AgentState'
- description: The operational state of the agent. Controls whether the agent endpoint accepts or rejects requests.
- readOnly: true
- versions:
- type: object
- properties:
- latest:
- $ref: '#/components/schemas/AgentVersionObject'
- required:
- - latest
- description: The latest version of the agent.
- agent_endpoint:
- $ref: '#/components/schemas/AgentEndpointConfig'
- description: The endpoint configuration for the agent
- instance_identity:
- $ref: '#/components/schemas/AgentIdentity'
- description: The instance identity of the agent
- readOnly: true
- blueprint:
- $ref: '#/components/schemas/AgentIdentity'
- description: The blueprint for the agent
- readOnly: true
- blueprint_reference:
- $ref: '#/components/schemas/AgentBlueprintReference'
- description: The blueprint for the agent
- readOnly: true
- agent_card:
- $ref: '#/components/schemas/AgentCard'
- AgentReference:
+ - function
+ - code_interpreter
+ - file_search
+ description: The type of the tool. If type is `function`, the function name must be set
+ function:
+ $ref: '#/components/schemas/OpenAI.AssistantsNamedToolChoiceFunction'
+ description: Specifies a tool the model should use. Use to force the model to call a specific tool.
+ OpenAI.AssistantsNamedToolChoiceFunction:
type: object
required:
- - type
- name
properties:
- type:
- type: string
- enum:
- - agent_reference
name:
type: string
- maxLength: 256
- description: The name of the agent.
- version:
- type: string
- description: The version identifier of the agent.
- AgentSessionResource:
+ OpenAI.AudioResponseFormat:
+ type: string
+ enum:
+ - json
+ - text
+ - srt
+ - verbose_json
+ - vtt
+ - diarized_json
+ description: 'The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`. For `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and `diarized_json`, with `diarized_json` required to receive speaker annotations.'
+ OpenAI.AudioTranscription:
type: object
- required:
- - agent_session_id
- - version_indicator
- - status
- - created_at
- - last_accessed_at
- - expires_at
properties:
- agent_session_id:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - whisper-1
+ - gpt-4o-mini-transcribe
+ - gpt-4o-mini-transcribe-2025-12-15
+ - gpt-4o-transcribe
+ - gpt-4o-transcribe-diarize
+ - gpt-realtime-whisper
+ description: The model to use for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
+ language:
+ type: string
+ description: |-
+ 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.
+ prompt:
+ type: string
+ description: |-
+ 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](/docs/guides/speech-to-text#prompting).
+ For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the prompt is a free text string, for example "expect words related to technology".
+ Prompt is not supported with `gpt-realtime-whisper` in GA Realtime sessions.
+ delay:
type: string
- description: The session identifier.
- version_indicator:
- $ref: '#/components/schemas/VersionIndicator'
- description: The version indicator determining which agent version backs this session.
- status:
- $ref: '#/components/schemas/AgentSessionStatus'
- description: The current status of the session.
- created_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) when the session was created.
- readOnly: true
- last_accessed_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) when the session was last accessed.
- readOnly: true
- expires_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) when the session expires (rolling, 30 days from last activity).
- readOnly: true
- description: An agent session providing a long-lived compute sandbox for hosted agent invocations.
- AgentSessionStatus:
- anyOf:
- - type: string
- - type: string
- enum:
- - creating
- - active
- - idle
- - updating
- - failed
- - deleting
- - deleted
- - expired
- description: The status of an agent session.
- AgentState:
- anyOf:
- - type: string
- - type: string
enum:
- - enabled
- - disabled
- description: The operational state of an agent.
- AgentTaxonomyInput:
+ - minimal
+ - low
+ - medium
+ - high
+ - xhigh
+ description: |-
+ Controls how long the model waits before emitting transcription text.
+ Higher values can improve transcription accuracy at the cost of latency.
+ Only supported with `gpt-realtime-whisper` in GA Realtime sessions.
+ OpenAI.AudioTranscriptionResponse:
+ type: object
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - whisper-1
+ - gpt-4o-mini-transcribe
+ - gpt-4o-mini-transcribe-2025-12-15
+ - gpt-4o-transcribe
+ - gpt-4o-transcribe-diarize
+ - gpt-realtime-whisper
+ description: The model used for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`.
+ language:
+ type: string
+ description: The language of the input audio.
+ prompt:
+ type: string
+ description: The prompt configured for input audio transcription, when present.
+ OpenAI.AutoChunkingStrategyRequestParam:
type: object
required:
- type
- - target
- - riskCategories
properties:
type:
type: string
enum:
- - agent
- description: Input type of the evaluation taxonomy.
- target:
- $ref: '#/components/schemas/Target'
- description: Target configuration for the agent.
- riskCategories:
- type: array
- items:
- $ref: '#/components/schemas/RiskCategory'
- description: List of risk categories to evaluate against.
+ - auto
+ description: Always `auto`.
+ x-stainless-const: true
allOf:
- - $ref: '#/components/schemas/EvaluationTaxonomyInput'
- description: Input configuration for the evaluation taxonomy when the input type is agent.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- AgentTaxonomyInputUpdate:
+ - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ description: The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
+ title: Auto Chunking Strategy
+ OpenAI.AutoCodeInterpreterToolParam:
type: object
+ required:
+ - type
properties:
type:
type: string
enum:
- - agent
- description: Input type of the evaluation taxonomy.
- target:
- $ref: '#/components/schemas/TargetUpdate'
- description: Target configuration for the agent.
- riskCategories:
+ - auto
+ description: Always `auto`.
+ x-stainless-const: true
+ default: auto
+ file_ids:
type: array
items:
- $ref: '#/components/schemas/RiskCategory'
- description: List of risk categories to evaluate against.
- allOf:
- - $ref: '#/components/schemas/EvaluationTaxonomyInputUpdate'
- description: Input configuration for the evaluation taxonomy when the input type is agent.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- AgentVersionObject:
+ type: string
+ maxItems: 50
+ description: An optional list of uploaded files to make available to your code.
+ memory_limit:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit'
+ - type: 'null'
+ network_policy:
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
+ title: Automatic Code Interpreter Tool Parameters
+ OpenAI.Batch:
type: object
required:
- - metadata
- - object
- id
- - name
- - version
+ - object
+ - endpoint
+ - input_file_id
+ - completion_window
+ - status
- created_at
- - definition
properties:
- metadata:
- anyOf:
- - type: object
- unevaluatedProperties:
- type: string
- - type: 'null'
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
+ id:
+ type: string
object:
type: string
enum:
- - agent.version
- description: The object type, which is always 'agent.version'.
- id:
+ - batch
+ description: The object type, which is always `batch`.
+ x-stainless-const: true
+ endpoint:
type: string
- description: The unique identifier of the agent version.
- name:
+ description: The OpenAI API endpoint used by the batch.
+ model:
type: string
- maxLength: 256
- description: The name of the agent. Name can be used to retrieve/update/delete the agent.
- version:
+ description: |-
+ Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI
+ offers a wide range of models with different capabilities, performance
+ characteristics, and price points. Refer to the [model
+ guide](/docs/models) to browse and compare available models.
+ errors:
+ $ref: '#/components/schemas/OpenAI.BatchErrors'
+ input_file_id:
+ type: string
+ description: The ID of the input file for the batch.
+ completion_window:
+ type: string
+ description: The time frame within which the batch should be processed.
+ status:
type: string
- description: The version identifier of the agent. Agents are immutable and every update creates a new version while keeping the name same.
- description:
+ enum:
+ - validating
+ - failed
+ - in_progress
+ - finalizing
+ - completed
+ - expired
+ - cancelling
+ - cancelled
+ description: The current status of the batch.
+ output_file_id:
type: string
- maxLength: 512
- description: A human-readable description of the agent.
- created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The Unix timestamp (seconds) when the agent was created.
- definition:
- $ref: '#/components/schemas/AgentDefinition'
- draft:
- type: boolean
- description: Whether this agent version is a draft (candidate) rather than a release. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. Defaults to false.
- x-ms-foundry-meta:
- conditional_previews:
- - DraftAgents=V1Preview
- default: false
- status:
- $ref: '#/components/schemas/AgentVersionStatus'
- description: The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For hosted agents, reflects infrastructure readiness.
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error details if the agent version provisioning failed.
- instance_identity:
- $ref: '#/components/schemas/AgentIdentity'
- description: The instance identity of the agent
- readOnly: true
- blueprint:
- $ref: '#/components/schemas/AgentIdentity'
- description: The blueprint for the agent
- readOnly: true
- blueprint_reference:
- $ref: '#/components/schemas/AgentBlueprintReference'
- description: The blueprint for the agent
- readOnly: true
- agent_guid:
+ description: The ID of the file containing the outputs of successfully executed requests.
+ error_file_id:
type: string
- description: The unique GUID identifier of the agent.
- readOnly: true
- AgentVersionStatus:
- type: string
- enum:
- - creating
- - active
- - failed
- - deleting
- - deleted
- description: The provisioning status of an agent version.
- AgenticIdentityPreviewCredentials:
+ description: The ID of the file containing the outputs of requests with errors.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch was created.
+ in_progress_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch started processing.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch will expire.
+ finalizing_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch started finalizing.
+ completed_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch was completed.
+ failed_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch failed.
+ expired_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch expired.
+ cancelling_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch started cancelling.
+ cancelled_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the batch was cancelled.
+ request_counts:
+ $ref: '#/components/schemas/OpenAI.BatchRequestCounts'
+ description: The request counts for different statuses within the batch.
+ usage:
+ $ref: '#/components/schemas/OpenAI.BatchUsage'
+ description: |-
+ Represents token usage details including input tokens, output tokens, a
+ breakdown of output tokens, and the total tokens used. Only populated on
+ batches created after September 7, 2025.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ x-oaiMeta:
+ name: The batch object
+ example: |
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/completions",
+ "model": "gpt-5-2025-08-07",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "completed",
+ "output_file_id": "file-cvaTdG",
+ "error_file_id": "file-HOWS94",
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": 1711493133,
+ "completed_at": 1711493163,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 95,
+ "failed": 5
+ },
+ "usage": {
+ "input_tokens": 1500,
+ "input_tokens_details": {
+ "cached_tokens": 1024
+ },
+ "output_tokens": 500,
+ "output_tokens_details": {
+ "reasoning_tokens": 300
+ },
+ "total_tokens": 2000
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+ OpenAI.BatchError:
type: object
- required:
- - type
properties:
- type:
+ code:
type: string
- enum:
- - AgenticIdentityToken_Preview
- description: The credential type
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: Agentic identity credential definition
- ApiErrorResponse:
+ description: An error code identifying the error type.
+ message:
+ type: string
+ description: A human-readable message providing more details about the error.
+ param:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: The name of the parameter that caused the error, if applicable.
+ line:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The line number of the input file where the error occurred, if applicable.
+ OpenAI.BatchErrors:
type: object
- required:
- - error
properties:
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error response for API failures.
- ApiKeyCredentials:
+ object:
+ type: string
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.BatchError'
+ OpenAI.BatchFileExpirationAfter:
type: object
required:
- - type
+ - anchor
+ - seconds
properties:
- type:
+ anchor:
type: string
enum:
- - ApiKey
- description: The credential type
- readOnly: true
- key:
- type: string
- description: API Key
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: API Key Credential definition
- ArtifactProfile:
+ - created_at
+ description: '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.'
+ x-stainless-const: true
+ seconds:
+ type: integer
+ format: int64
+ minimum: 3600
+ maximum: 2592000
+ description: The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days).
+ description: The expiration policy for the output and/or error file that are generated for a batch.
+ title: File expiration policy
+ OpenAI.BatchRequestCounts:
type: object
required:
- - category
+ - total
+ - completed
+ - failed
properties:
- category:
- $ref: '#/components/schemas/FoundryModelArtifactProfileCategory'
- description: The category of the artifact profile
- signals:
- type: array
- items:
- $ref: '#/components/schemas/FoundryModelArtifactProfileSignal'
- description: Signals detected in the model artifact
- description: Artifact profile of the model
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- AssetCredentialResponse:
+ total:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.BatchUsage:
type: object
required:
- - blobReference
+ - input_tokens
+ - input_tokens_details
+ - output_tokens
+ - output_tokens_details
+ - total_tokens
properties:
- blobReference:
- $ref: '#/components/schemas/BlobReference'
- description: Credential info to access the storage account.
- description: Represents a reference to a blob for consumption
- AssetId:
- type: string
- description: Identifier of a saved asset.
- AssistantMessage:
+ input_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ input_tokens_details:
+ $ref: '#/components/schemas/OpenAI.BatchUsageInputTokensDetails'
+ output_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ output_tokens_details:
+ $ref: '#/components/schemas/OpenAI.BatchUsageOutputTokensDetails'
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.BatchUsageInputTokensDetails:
type: object
required:
- - role
- - content
+ - cached_tokens
properties:
- role:
- type: string
- enum:
- - assistant
- description: Indicates this is an assistant message.
- content:
- type: string
- description: Response content generated by the assistant.
- allOf:
- - $ref: '#/components/schemas/Message'
- description: A message generated by the assistant in response to previous messages.
- AttackStrategy:
- anyOf:
- - type: string
- - type: string
- enum:
- - easy
- - moderate
- - difficult
- - ascii_art
- - ascii_smuggler
- - atbash
- - base64
- - binary
- - caesar
- - character_space
- - jailbreak
- - ansi_attack
- - character_swap
- - suffix_append
- - string_join
- - unicode_confusable
- - unicode_substitution
- - diacritic
- - flip
- - leetspeak
- - rot13
- - morse
- - url
- - baseline
- - indirect_jailbreak
- - tense
- - multi_turn
- - crescendo
- description: Strategies for attacks.
- x-ms-foundry-meta:
- required_previews:
- - RedTeams=V1Preview
- Azure.Core.Foundations.Error:
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.BatchUsageOutputTokensDetails:
type: object
required:
- - code
- - message
+ - reasoning_tokens
properties:
- code:
- type: string
- description: One of a server-defined set of error codes.
- message:
- type: string
- description: A human-readable representation of the error.
- target:
+ reasoning_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.ChatCompletionAllowedTools:
+ type: object
+ required:
+ - mode
+ - tools
+ properties:
+ mode:
type: string
- description: The target of the error.
- details:
+ enum:
+ - auto
+ - required
+ description: |-
+ 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.
+ tools:
type: array
items:
- $ref: '#/components/schemas/Azure.Core.Foundations.Error'
- description: An array of details about specific errors that led to this reported error.
- innererror:
- $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
- description: An object containing more specific information than the current object about the error.
- description: The error object.
- Azure.Core.Foundations.ErrorResponse:
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ 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" } }
+ ]
+ ```
+ description: Constrains the tools available to the model to a pre-defined set.
+ title: Allowed tools
+ OpenAI.ChatCompletionAllowedToolsChoice:
type: object
required:
- - error
+ - type
+ - allowed_tools
properties:
- error:
- $ref: '#/components/schemas/Azure.Core.Foundations.Error'
- description: The error object.
- description: A response containing error details.
- Azure.Core.Foundations.InnerError:
+ type:
+ type: string
+ enum:
+ - allowed_tools
+ description: Allowed tool configuration type. Always `allowed_tools`.
+ x-stainless-const: true
+ allowed_tools:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionAllowedTools'
+ description: Constrains the tools available to the model to a pre-defined set.
+ title: Allowed tools
+ OpenAI.ChatCompletionDeleted:
type: object
+ required:
+ - object
+ - id
+ - deleted
properties:
- code:
+ object:
type: string
- description: One of a server-defined set of error codes.
- innererror:
- description: Inner error.
- $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
- description: An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.
- Azure.Core.Foundations.OperationState:
- anyOf:
- - type: string
enum:
- - NotStarted
- - Running
- - Succeeded
- - Failed
- - Canceled
- - type: string
- description: Enum describing allowed operation states.
- Azure.Core.uuid:
- type: string
- format: uuid
- description: Universally Unique Identifier
- AzureAIAgentTarget:
+ - chat.completion.deleted
+ description: The type of object being deleted.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The ID of the chat completion that was deleted.
+ deleted:
+ type: boolean
+ description: Whether the chat completion was deleted.
+ OpenAI.ChatCompletionFunctionCallOption:
type: object
required:
- - type
- name
properties:
- type:
- type: string
- enum:
- - azure_ai_agent
- description: The type of target, always `azure_ai_agent`.
name:
type: string
- description: The unique identifier of the Azure AI agent.
- version:
- type: string
- description: The version of the Azure AI agent.
- tool_descriptions:
- type: array
- items:
- $ref: '#/components/schemas/ToolDescription'
- description: The parameters used to control the sampling behavior of the agent during text generation.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- allOf:
- - $ref: '#/components/schemas/Target'
- description: Represents a target specifying an Azure AI agent.
- AzureAIAgentTargetUpdate:
+ description: The name of the function to call.
+ description: 'Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.'
+ OpenAI.ChatCompletionFunctions:
type: object
+ required:
+ - name
properties:
- type:
+ description:
type: string
- enum:
- - azure_ai_agent
- description: The type of target, always `azure_ai_agent`.
+ description: A description of what the function does, used by the model to choose when and how to call the function.
name:
type: string
- description: The unique identifier of the Azure AI agent.
- version:
- type: string
- description: The version of the Azure AI agent.
- tool_descriptions:
- type: array
- items:
- $ref: '#/components/schemas/ToolDescription'
- description: The parameters used to control the sampling behavior of the agent during text generation.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- allOf:
- - $ref: '#/components/schemas/TargetUpdate'
- description: Represents a target specifying an Azure AI agent.
- AzureAIBenchmarkDataSourceConfig:
+ description: 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.
+ parameters:
+ $ref: '#/components/schemas/OpenAI.FunctionParameters'
+ deprecated: true
+ OpenAI.ChatCompletionList:
type: object
required:
- - scenario
- - benchmark_name
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- scenario:
+ object:
type: string
enum:
- - benchmark_preview
- description: Data schema scenario, always `benchmark` for benchmark evaluations.
- benchmark_name:
- type: string
- description: The name of the benchmark specification.
- benchmark_version:
+ - list
+ description: The type of this object. It is always set to "list".
+ x-stainless-const: true
+ default: list
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponse'
+ description: An array of chat completion objects.
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The version of the benchmark specification (e.g., '0.1'). Latest version if not specified.
- grader_model:
+ description: The identifier of the first chat completion in the data array.
+ last_id:
type: string
- description: Optional grader model for benchmarks that use model graders, Required when the benchmark's testing_criteria uses a model grader type.
- allOf:
- - $ref: '#/components/schemas/AzureAIDataSourceConfig'
- description: Data source configuration for benchmark evaluations.
- AzureAIBenchmarkPreviewEvalRunDataSource:
+ description: The identifier of the last chat completion in the data array.
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ description: Indicates whether there are more Chat Completions available.
+ description: An object representing a list of Chat Completions.
+ title: ChatCompletionList
+ x-oaiMeta:
+ name: The chat completion list object
+ group: chat
+ example: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "model": "gpt-4o-2024-08-06",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {},
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "has_more": false
+ }
+ OpenAI.ChatCompletionMessageCustomToolCall:
type: object
required:
+ - id
- type
- - target
+ - custom
properties:
+ id:
+ type: string
+ description: The ID of the tool call.
type:
type: string
enum:
- - azure_ai_benchmark_preview
- description: The type of data source, always `azure_ai_benchmark_preview`.
- input_messages:
- $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
- description: Input messages configuration.
- target:
- anyOf:
- - $ref: '#/components/schemas/AzureAIModelTarget'
- - $ref: '#/components/schemas/AzureAIAgentTarget'
- description: |-
- The target model or agent to evaluate against the benchmark.
- When using `azure_ai_model` target, `sampling_params` must not be provided;
- inference parameters are auto-filled from the benchmark specification stored in eval group properties.
- allOf:
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Represents a data source for benchmark evaluation runs.
- AzureAIDataSourceConfig:
+ - custom
+ description: The type of the tool. Always `custom`.
+ x-stainless-const: true
+ custom:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCallCustom'
+ description: The custom tool that the model called.
+ description: A call to a custom tool created by the model.
+ title: Custom tool call
+ OpenAI.ChatCompletionMessageCustomToolCallCustom:
type: object
required:
- - type
- - scenario
+ - name
+ - input
properties:
- type:
+ name:
type: string
- enum:
- - azure_ai_source
- description: The object type, which is always `azure_ai_source`.
- scenario:
+ input:
type: string
- enum:
- - red_team
- - responses
- - traces_preview
- - synthetic_data_gen_preview
- - benchmark_preview
- description: Data schema scenario.
- discriminator:
- propertyName: scenario
- mapping:
- benchmark_preview: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
- allOf:
- - $ref: '#/components/schemas/DataSourceConfig'
- description: Base data source configuration for Azure AI evaluation scenarios.
- AzureAIModelTarget:
+ OpenAI.ChatCompletionMessageList:
type: object
required:
- - type
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
+ object:
type: string
enum:
- - azure_ai_model
- description: The type of target, always `azure_ai_model`.
- model:
- type: string
- description: The unique identifier of the Azure AI model.
- sampling_params:
- $ref: '#/components/schemas/ModelSamplingParams'
- description: The parameters used to control the sampling behavior of the model during text generation.
- allOf:
- - $ref: '#/components/schemas/Target'
- description: Represents a target specifying an Azure AI model for operations requiring model selection.
- AzureAIModelTargetUpdate:
- type: object
- properties:
- type:
+ - list
+ description: The type of this object. It is always set to "list".
+ x-stainless-const: true
+ default: list
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageListData'
+ description: An array of chat completion message objects.
+ x-ms-list-page-items: true
+ first_id:
type: string
- enum:
- - azure_ai_model
- description: The type of target, always `azure_ai_model`.
- model:
+ description: The identifier of the first chat message in the data array.
+ last_id:
type: string
- description: The unique identifier of the Azure AI model.
- sampling_params:
- $ref: '#/components/schemas/ModelSamplingParams'
- description: The parameters used to control the sampling behavior of the model during text generation.
- allOf:
- - $ref: '#/components/schemas/TargetUpdate'
- description: Represents a target specifying an Azure AI model for operations requiring model selection.
- AzureAIResponsesEvalRunDataSource:
+ description: The identifier of the last chat message in the data array.
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ description: Indicates whether there are more chat messages available.
+ description: An object representing a list of chat completion messages.
+ title: ChatCompletionMessageList
+ x-oaiMeta:
+ name: The chat completion message list object
+ group: chat
+ example: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "role": "user",
+ "content": "write a haiku about ai",
+ "name": null,
+ "content_parts": null
+ }
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "has_more": false
+ }
+ OpenAI.ChatCompletionMessageListData:
type: object
required:
- - type
- - item_generation_params
- - max_runs_hourly
- - event_configuration_id
+ - content
+ - refusal
+ - role
+ - id
properties:
- type:
+ content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ refusal:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tool_calls:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem'
+ annotations:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations'
+ description: |-
+ Annotations for the message, when applicable, as when using the
+ [web search tool](/docs/guides/tools-web-search?api-mode=chat).
+ role:
type: string
enum:
- - azure_ai_responses
- description: The type of data source, always `azure_ai_responses`.
- item_generation_params:
- $ref: '#/components/schemas/ResponseRetrievalItemGenerationParams'
- description: The parameters for item generation.
- max_runs_hourly:
- type: integer
- format: int32
- description: Maximum number of evaluation runs allowed per hour.
- event_configuration_id:
+ - assistant
+ description: The role of the author of this message.
+ x-stainless-const: true
+ function_call:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall'
+ description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
+ deprecated: true
+ audio:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio'
+ - type: 'null'
+ id:
type: string
- description: The event configuration name associated with this evaluation run.
- allOf:
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Represents a data source for evaluation runs that are specific to Continuous Evaluation scenarios.
- AzureAISearchIndex:
+ content_parts:
+ anyOf:
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage'
+ - type: 'null'
+ OpenAI.ChatCompletionMessageToolCall:
type: object
required:
+ - id
- type
+ - function
properties:
+ id:
+ type: string
+ description: The ID of the tool call.
type:
type: string
enum:
- - AzureSearch
- description: Type of index
- allOf:
- - $ref: '#/components/schemas/Index'
- description: Azure AI Search Index Definition
- AzureAISearchIndexUpdate:
+ - function
+ description: The type of the tool. Currently, only `function` is supported.
+ x-stainless-const: true
+ function:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallFunction'
+ description: The function that the model called.
+ description: A call to a function tool created by the model.
+ title: Function tool call
+ OpenAI.ChatCompletionMessageToolCallFunction:
type: object
required:
- - type
+ - name
+ - arguments
properties:
- type:
+ name:
type: string
- enum:
- - AzureSearch
- description: Type of index
- allOf:
- - $ref: '#/components/schemas/IndexUpdate'
- description: Azure AI Search Index Definition
- AzureAISearchQueryType:
- anyOf:
- - type: string
- - type: string
- enum:
- - simple
- - semantic
- - vector
- - vector_simple_hybrid
- - vector_semantic_hybrid
- description: Available query types for Azure AI Search tool.
- AzureAISearchTool:
+ arguments:
+ type: string
+ OpenAI.ChatCompletionMessageToolCalls:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCall'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall'
+ description: The tool calls generated by the model, such as function calls.
+ OpenAI.ChatCompletionMessageToolCallsItem:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCall'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall'
+ description: The tool calls generated by the model, such as function calls.
+ OpenAI.ChatCompletionModeration:
+ type: object
+ required:
+ - input
+ - output
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntry'
+ description: Moderation for the request input.
+ output:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntry'
+ description: Moderation for the generated output.
+ description: Moderation results or errors for the request input and generated output.
+ OpenAI.ChatCompletionModerationEntry:
type: object
required:
- type
- - azure_ai_search
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntryType'
+ discriminator:
+ propertyName: type
+ mapping:
+ moderation_results: '#/components/schemas/OpenAI.ChatCompletionModerationResults'
+ error: '#/components/schemas/OpenAI.ChatCompletionModerationError'
+ description: Moderation results or an error for a chat completion moderation check.
+ OpenAI.ChatCompletionModerationEntryType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - azure_ai_search
- description: The object type, which is always 'azure_ai_search'.
- name:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- azure_ai_search:
- $ref: '#/components/schemas/AzureAISearchToolResource'
- description: The azure ai search index resource.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for an Azure AI search tool as used to configure an agent.
- AzureAISearchToolCall:
+ - moderation_results
+ - error
+ OpenAI.ChatCompletionModerationError:
type: object
required:
- type
- - call_id
- - arguments
- - status
+ - code
+ - message
properties:
type:
type: string
enum:
- - azure_ai_search_call
- call_id:
+ - error
+ description: The object type, which is always `error`.
+ x-stainless-const: true
+ code:
type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
+ description: The error code.
+ message:
type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ description: The error message.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An Azure AI Search tool call.
- AzureAISearchToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntry'
+ description: An error produced while attempting moderation.
+ OpenAI.ChatCompletionModerationResults:
type: object
required:
- type
- - call_id
- - status
+ - model
+ - results
properties:
type:
type: string
enum:
- - azure_ai_search_call_output
- call_id:
+ - moderation_results
+ description: The object type, which is always `moderation_results`.
+ x-stainless-const: true
+ model:
type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Azure AI Search tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of an Azure AI Search tool call.
- AzureAISearchToolResource:
- type: object
- required:
- - indexes
- properties:
- indexes:
+ description: The moderation model used to generate the results.
+ results:
type: array
items:
- $ref: '#/components/schemas/AISearchIndexResource'
- maxItems: 1
- description: |-
- The indices attached to this agent. There can be a maximum of 1 index
- resource attached to the agent.
- description: A set of index resources used by the `azure_ai_search` tool.
- AzureAISearchToolboxTool:
+ $ref: '#/components/schemas/OpenAI.ModerationResultBody'
+ description: A list of moderation results.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionModerationEntry'
+ description: Successful moderation results for the request input or generated output.
+ OpenAI.ChatCompletionNamedToolChoice:
type: object
required:
- type
- - azure_ai_search
+ - function
properties:
type:
type: string
enum:
- - azure_ai_search
- azure_ai_search:
- $ref: '#/components/schemas/AzureAISearchToolResource'
- description: The azure ai search index resource.
- allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: An Azure AI Search tool stored in a toolbox.
- AzureAITraceDataSourcePreviewEvalRunDataSource:
+ - function
+ description: For function calling, the type is always `function`.
+ x-stainless-const: true
+ function:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceFunction'
+ description: Specifies a tool the model should use. Use to force the model to call a specific function.
+ title: Function tool choice
+ OpenAI.ChatCompletionNamedToolChoiceCustom:
type: object
required:
- type
+ - custom
properties:
type:
type: string
enum:
- - azure_ai_trace_data_source_preview
- description: The type of data source, always `azure_ai_trace_data_source_preview`.
- trace_source:
- $ref: '#/components/schemas/TraceSource'
- description: The trace source that defines how traces are selected for evaluation.
- allOf:
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: A wrapper data source that contains a polymorphic trace source to specify how traces are selected for evaluation.
- AzureContentFilterBlocklistIdResult:
+ - custom
+ description: For custom tool calling, the type is always `custom`.
+ x-stainless-const: true
+ custom:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustomCustom'
+ description: Specifies a tool the model should use. Use to force the model to call a specific custom tool.
+ title: Custom tool choice
+ OpenAI.ChatCompletionNamedToolChoiceCustomCustom:
type: object
required:
- - id
- - filtered
+ - name
properties:
- id:
+ name:
type: string
- description: The ID of the custom blocklist.
- filtered:
- type: boolean
- description: Whether the blocklist resulted in filtering.
- description: A content filter blocklist ID result.
- AzureContentFilterBlocklistResult:
+ OpenAI.ChatCompletionNamedToolChoiceFunction:
type: object
required:
- - filtered
- properties:
- filtered:
- type: boolean
- description: Whether any blocklist resulted in filtering.
- details:
- type: array
- items:
- $ref: '#/components/schemas/AzureContentFilterBlocklistIdResult'
- description: The pairs of individual blocklist IDs and their filtering results.
- description: A collection of filtering results for configured custom blocklists.
- AzureContentFilterCitation:
- type: object
+ - name
properties:
- license:
- type: string
- description: The license associated with the detection.
- url:
+ name:
type: string
- format: uri
- description: The URL associated with the license.
- description: Citation details for protected material detection.
- AzureContentFilterCompletionTextSpan:
- type: object
- required:
- - completion_start_offset
- - completion_end_offset
- properties:
- completion_start_offset:
- type: integer
- format: int32
- description: Offset of the UTF32 code point which begins the span.
- completion_end_offset:
- type: integer
- format: int32
- description: Offset of the first UTF32 code point which is excluded from the span.
- description: A representation of a span of completion text as used by Azure OpenAI content filter results.
- AzureContentFilterCompletionTextSpanDetectionResult:
+ OpenAI.ChatCompletionRequestAssistantMessage:
type: object
required:
- - filtered
- - detected
- - details
+ - role
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether the content category was detected.
- details:
- type: array
- items:
- $ref: '#/components/schemas/AzureContentFilterCompletionTextSpan'
- description: Detailed information about the detected completion text spans.
- description: A content filter detection result with completion text span details.
- AzureContentFilterDetectionResult:
+ content:
+ anyOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart'
+ - type: 'null'
+ refusal:
+ anyOf:
+ - type: string
+ - type: 'null'
+ role:
+ type: string
+ enum:
+ - assistant
+ description: The role of the messages author, in this case `assistant`.
+ x-stainless-const: true
+ name:
+ type: string
+ description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
+ audio:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageAudio'
+ - type: 'null'
+ tool_calls:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCalls'
+ function_call:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageFunctionCall'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ description: Messages sent by the model in response to user messages.
+ title: Assistant message
+ OpenAI.ChatCompletionRequestAssistantMessageAudio:
type: object
required:
- - filtered
- - detected
+ - id
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether the content category was detected.
- description: A content filter result indicating whether the content was detected and filtered.
- AzureContentFilterDetectionWithCitationResult:
+ id:
+ type: string
+ OpenAI.ChatCompletionRequestAssistantMessageContentPart:
type: object
required:
- - filtered
- - detected
+ - type
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether the content category was detected.
- citation:
- $ref: '#/components/schemas/AzureContentFilterCitation'
- description: Citation details describing the associated license and its location.
- description: A content filter detection result that includes citation information for protected material.
- AzureContentFilterDetectionWithReasonResult:
+ type:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartType'
+ discriminator:
+ propertyName: type
+ mapping:
+ refusal: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartRefusal'
+ text: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText'
+ OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText:
type: object
required:
- - filtered
- - detected
+ - type
+ - text
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether the content category was detected.
- reason:
+ type:
type: string
- description: A human-readable explanation of why the detection result was produced.
- description: A content filter detection result that includes a reason description.
- AzureContentFilterError:
+ enum:
+ - text
+ description: The type of the content part.
+ x-stainless-const: true
+ text:
+ type: string
+ description: The text content.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart'
+ description: Learn about [text inputs](/docs/guides/text-generation).
+ title: Text content part
+ OpenAI.ChatCompletionRequestAssistantMessageContentPartType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - text
+ - refusal
+ OpenAI.ChatCompletionRequestAssistantMessageFunctionCall:
type: object
required:
- - code
- - message
+ - arguments
+ - name
properties:
- code:
- type: integer
- format: int32
- description: A machine-readable error code.
- message:
+ arguments:
type: string
- description: A human-readable error message.
- description: Error details from the content filtering system.
- AzureContentFilterPersonallyIdentifiableInformationResult:
+ name:
+ type: string
+ OpenAI.ChatCompletionRequestDeveloperMessage:
type: object
required:
- - filtered
- - detected
+ - content
+ - role
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- detected:
- type: boolean
- description: Whether PII was detected in the content.
- sub_categories:
- type: array
- items:
- $ref: '#/components/schemas/AzureContentFilterPiiSubCategoryResult'
- description: Detailed results for individual PII subcategories.
- description: A content filter detection result for Personally Identifiable Information.
- AzureContentFilterPiiSubCategoryResult:
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ description: The contents of the developer message.
+ role:
+ type: string
+ enum:
+ - developer
+ description: The role of the messages author, in this case `developer`.
+ x-stainless-const: true
+ name:
+ type: string
+ description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ description: |-
+ Developer-provided instructions that the model should follow, regardless of
+ messages sent by the user. With o1 models and newer, `developer` messages
+ replace the previous `system` messages.
+ title: Developer message
+ OpenAI.ChatCompletionRequestFunctionMessage:
type: object
required:
- - sub_category
- - filtered
- - detected
+ - role
+ - content
+ - name
properties:
- sub_category:
+ role:
type: string
- description: The PII subcategory that was evaluated.
- filtered:
- type: boolean
- description: Whether the content was filtered for this subcategory.
- detected:
- type: boolean
- description: Whether the subcategory was detected in the content.
- description: Result details for an individual PII subcategory.
- AzureContentFilterResultsForResponses:
- type: object
- properties:
- sexual:
- $ref: '#/components/schemas/AzureContentFilterSeverityResult'
- description: Severity result for sexual content.
- hate:
- $ref: '#/components/schemas/AzureContentFilterSeverityResult'
- description: Severity result for hate content.
- violence:
- $ref: '#/components/schemas/AzureContentFilterSeverityResult'
- description: Severity result for violence content.
- self_harm:
- $ref: '#/components/schemas/AzureContentFilterSeverityResult'
- description: Severity result for self-harm content.
- profanity:
- $ref: '#/components/schemas/AzureContentFilterDetectionResult'
- description: Detection result for profanity.
- custom_blocklists:
- $ref: '#/components/schemas/AzureContentFilterBlocklistResult'
- description: Results for configured custom blocklists.
- jailbreak:
- $ref: '#/components/schemas/AzureContentFilterDetectionResult'
- description: Detection result for jailbreak attempts.
- task_adherence:
- $ref: '#/components/schemas/AzureContentFilterDetectionWithReasonResult'
- description: Detection result for task adherence evaluation.
- protected_material_text:
- $ref: '#/components/schemas/AzureContentFilterDetectionResult'
- description: Detection result for protected material text.
- protected_material_code:
- $ref: '#/components/schemas/AzureContentFilterDetectionWithCitationResult'
- description: Detection result for protected material code with citation.
- ungrounded_material:
- $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult'
- description: Detection result for ungrounded material with completion text span details.
- personally_identifiable_information:
- $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult'
- description: Detection result for Personally Identifiable Information.
- indirect_attack:
- $ref: '#/components/schemas/AzureContentFilterDetectionResult'
- description: Detection result for indirect attacks.
- error:
- $ref: '#/components/schemas/AzureContentFilterError'
- description: Error details if content filtering evaluation failed.
- description: Content filter results for the Responses API.
- AzureContentFilterSeverity:
- anyOf:
- - type: string
- - type: string
enum:
- - safe
- - low
- - medium
- - high
- description: Ratings for the intensity and risk level of harmful content.
- AzureContentFilterSeverityResult:
+ - function
+ description: The role of the messages author, in this case `function`.
+ x-stainless-const: true
+ content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ name:
+ type: string
+ description: The name of the function to call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ title: Function message
+ deprecated: true
+ OpenAI.ChatCompletionRequestMessage:
type: object
required:
- - filtered
- - severity
+ - role
properties:
- filtered:
- type: boolean
- description: Whether the content was filtered.
- severity:
- $ref: '#/components/schemas/AzureContentFilterSeverity'
- description: The severity level of the content.
- description: A content filter result indicating severity level and whether content was filtered.
- AzureFunctionBinding:
+ role:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageType'
+ discriminator:
+ propertyName: role
+ mapping:
+ assistant: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessage'
+ developer: '#/components/schemas/OpenAI.ChatCompletionRequestDeveloperMessage'
+ function: '#/components/schemas/OpenAI.ChatCompletionRequestFunctionMessage'
+ system: '#/components/schemas/OpenAI.ChatCompletionRequestSystemMessage'
+ user: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessage'
+ tool: '#/components/schemas/OpenAI.ChatCompletionRequestToolMessage'
+ OpenAI.ChatCompletionRequestMessageContentPartAudio:
type: object
required:
- type
- - storage_queue
+ - input_audio
properties:
type:
type: string
enum:
- - storage_queue
- description: The type of binding, which is always 'storage_queue'.
- storage_queue:
- $ref: '#/components/schemas/AzureFunctionStorageQueue'
- description: Storage queue.
- description: The structure for keeping storage queue name and URI.
- AzureFunctionDefinition:
- type: object
- required:
- - function
- - input_binding
- - output_binding
- properties:
- function:
- type: object
- properties:
- name:
- type: string
- description: The name of the function to be called.
- description:
- type: string
- description: A description of what the function does, used by the model to choose when and how to call the function.
- parameters:
- type: object
- unevaluatedProperties: {}
- description: The parameters the functions accepts, described as a JSON Schema object.
- required:
- - name
- - parameters
- description: The definition of azure function and its parameters.
- input_binding:
- $ref: '#/components/schemas/AzureFunctionBinding'
- description: Input storage queue. The queue storage trigger runs a function as messages are added to it.
- output_binding:
- $ref: '#/components/schemas/AzureFunctionBinding'
- description: Output storage queue. The function writes output to this queue when the input items are processed.
- description: The definition of Azure function.
- AzureFunctionStorageQueue:
- type: object
- required:
- - queue_service_endpoint
- - queue_name
- properties:
- queue_service_endpoint:
- type: string
- description: URI to the Azure Storage Queue service allowing you to manipulate a queue.
- queue_name:
- type: string
- description: The name of an Azure function storage queue.
- description: The structure for keeping storage queue name and URI.
- AzureFunctionTool:
+ - input_audio
+ description: The type of the content part. Always `input_audio`.
+ x-stainless-const: true
+ input_audio:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: Learn about [audio inputs](/docs/guides/audio).
+ title: Audio content part
+ OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio:
type: object
required:
- - type
- - azure_function
+ - data
+ - format
properties:
- type:
+ data:
+ type: string
+ format:
type: string
enum:
- - azure_function
- description: The object type, which is always 'browser_automation'.
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- azure_function:
- $ref: '#/components/schemas/AzureFunctionDefinition'
- description: The Azure Function Tool definition.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for an Azure Function Tool, as used to configure an Agent.
- AzureFunctionToolCall:
+ - wav
+ - mp3
+ OpenAI.ChatCompletionRequestMessageContentPartFile:
type: object
required:
- type
- - call_id
- - name
- - arguments
- - status
+ - file
properties:
type:
type: string
enum:
- - azure_function_call
- call_id:
+ - file
+ description: The type of the content part. Always `file`.
+ x-stainless-const: true
+ file:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFileFile'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: Learn about [file inputs](/docs/guides/text) for text generation.
+ title: File content part
+ OpenAI.ChatCompletionRequestMessageContentPartFileFile:
+ type: object
+ properties:
+ filename:
type: string
- description: The unique ID of the tool call generated by the model.
- name:
+ file_data:
type: string
- description: The name of the Azure Function being called.
- arguments:
+ file_id:
type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An Azure Function tool call.
- AzureFunctionToolCallOutput:
+ OpenAI.ChatCompletionRequestMessageContentPartImage:
type: object
required:
- type
- - call_id
- - name
- - status
+ - image_url
properties:
type:
type: string
enum:
- - azure_function_call_output
- call_id:
+ - image_url
+ description: The type of the content part.
+ x-stainless-const: true
+ image_url:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: Learn about [image inputs](/docs/guides/vision).
+ title: Image content part
+ OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl:
+ type: object
+ required:
+ - url
+ properties:
+ url:
type: string
- description: The unique ID of the tool call generated by the model.
- name:
+ format: uri
+ detail:
type: string
- description: The name of the Azure Function that was called.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Azure Function tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of an Azure Function tool call.
- AzureOpenAIModelConfiguration:
+ enum:
+ - auto
+ - low
+ - high
+ default: auto
+ OpenAI.ChatCompletionRequestMessageContentPartRefusal:
type: object
required:
- type
- - modelDeploymentName
+ - refusal
properties:
type:
type: string
enum:
- - AzureOpenAIModel
- modelDeploymentName:
+ - refusal
+ description: The type of the content part.
+ x-stainless-const: true
+ refusal:
type: string
- description: 'Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based `connection_name/deployment_name` (e.g. `my-aoai-connection/gpt-4o`).'
+ description: The refusal message generated by the model.
allOf:
- - $ref: '#/components/schemas/RedTeamTargetConfig'
- description: Azure OpenAI model configuration. The API version would be selected by the service for querying the model.
- x-ms-foundry-meta:
- required_previews:
- - RedTeams=V1Preview
- BaseCredentials:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart'
+ title: Refusal content part
+ OpenAI.ChatCompletionRequestMessageContentPartText:
type: object
required:
- type
+ - text
properties:
type:
- $ref: '#/components/schemas/CredentialType'
- description: The type of credential used by the connection
- readOnly: true
- discriminator:
- propertyName: type
- mapping:
- ApiKey: '#/components/schemas/ApiKeyCredentials'
- AAD: '#/components/schemas/EntraIDCredentials'
- CustomKeys: '#/components/schemas/CustomCredential'
- SAS: '#/components/schemas/SASCredentials'
- None: '#/components/schemas/NoAuthenticationCredentials'
- AgenticIdentityToken_Preview: '#/components/schemas/AgenticIdentityPreviewCredentials'
- description: A base class for connection credentials
- BingCustomSearchConfiguration:
- type: object
- required:
- - project_connection_id
- - instance_name
- properties:
- project_connection_id:
- type: string
- description: Project connection id for grounding with bing search
- instance_name:
- type: string
- description: Name of the custom configuration instance given to config.
- market:
- type: string
- description: The market where the results come from.
- set_lang:
type: string
- description: The language to use for user interface strings when calling Bing API.
- count:
- type: integer
- format: int64
- description: The number of search results to return in the bing api response
- freshness:
+ enum:
+ - text
+ description: The type of the content part.
+ x-stainless-const: true
+ text:
type: string
- description: Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters).
- description: A bing custom search configuration.
- BingCustomSearchPreviewTool:
+ description: The text content.
+ description: Learn about [text inputs](/docs/guides/text-generation).
+ title: Text content part
+ OpenAI.ChatCompletionRequestMessageType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - developer
+ - system
+ - user
+ - assistant
+ - tool
+ - function
+ OpenAI.ChatCompletionRequestSystemMessage:
type: object
required:
- - type
- - bing_custom_search_preview
+ - content
+ - role
properties:
- type:
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestSystemMessageContentPart'
+ description: The contents of the system message.
+ role:
type: string
enum:
- - bing_custom_search_preview
- description: The object type, which is always 'bing_custom_search_preview'.
- bing_custom_search_preview:
- $ref: '#/components/schemas/BingCustomSearchToolParameters'
- description: The bing custom search tool parameters.
+ - system
+ description: The role of the messages author, in this case `system`.
+ x-stainless-const: true
+ name:
+ type: string
+ description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for a Bing custom search tool as used to configure an agent.
- BingCustomSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ description: |-
+ Developer-provided instructions that the model should follow, regardless of
+ messages sent by the user. With o1 models and newer, use `developer` messages
+ for this purpose instead.
+ title: System message
+ OpenAI.ChatCompletionRequestSystemMessageContentPart:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ OpenAI.ChatCompletionRequestToolMessage:
type: object
required:
- - type
- - call_id
- - arguments
- - status
+ - role
+ - content
+ - tool_call_id
properties:
- type:
+ role:
type: string
enum:
- - bing_custom_search_preview_call
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
+ - tool
+ description: The role of the messages author, in this case `tool`.
+ x-stainless-const: true
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestToolMessageContentPart'
+ description: The contents of the tool message.
+ tool_call_id:
type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ description: Tool call that this message is responding to.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A Bing custom search tool call.
- BingCustomSearchToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ title: Tool message
+ OpenAI.ChatCompletionRequestToolMessageContentPart:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ OpenAI.ChatCompletionRequestUserMessage:
type: object
required:
- - type
- - call_id
- - status
+ - content
+ - role
properties:
- type:
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: The contents of the user message.
+ role:
type: string
enum:
- - bing_custom_search_preview_call_output
- call_id:
+ - user
+ description: The role of the messages author, in this case `user`.
+ x-stainless-const: true
+ name:
type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Bing custom search tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a Bing custom search tool call.
- BingCustomSearchToolParameters:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ description: |-
+ Messages sent by an end user, containing prompts or additional context
+ information.
+ title: User message
+ OpenAI.ChatCompletionRequestUserMessageContentPart:
type: object
required:
- - search_configurations
+ - type
properties:
- search_configurations:
- type: array
- items:
- $ref: '#/components/schemas/BingCustomSearchConfiguration'
- maxItems: 1
- description: |-
- The project connections attached to this tool. There can be a maximum of 1 connection
- resource attached to the tool.
- description: The bing custom search tool parameters.
- BingGroundingSearchConfiguration:
+ type:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartType'
+ discriminator:
+ propertyName: type
+ mapping:
+ image_url: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage'
+ input_audio: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudio'
+ file: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFile'
+ text: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText'
+ OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText:
type: object
required:
- - project_connection_id
+ - type
+ - text
properties:
- project_connection_id:
- type: string
- description: Project connection id for grounding with bing search
- market:
- type: string
- description: The market where the results come from.
- set_lang:
+ type:
type: string
- description: The language to use for user interface strings when calling Bing API.
- count:
- type: integer
- format: int64
- description: The number of search results to return in the bing api response
- freshness:
+ enum:
+ - text
+ description: The type of the content part.
+ x-stainless-const: true
+ text:
type: string
- description: Filter search results by a specific time range. See [accepted values here](https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters).
- description: Search configuration for Bing Grounding
- BingGroundingSearchToolParameters:
+ description: The text content.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart'
+ description: Learn about [text inputs](/docs/guides/text-generation).
+ title: Text content part
+ OpenAI.ChatCompletionRequestUserMessageContentPartType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - text
+ - image_url
+ - input_audio
+ - file
+ OpenAI.ChatCompletionResponseMessage:
type: object
required:
- - search_configurations
+ - content
+ - refusal
+ - role
properties:
- search_configurations:
+ content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ refusal:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tool_calls:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem'
+ annotations:
type: array
items:
- $ref: '#/components/schemas/BingGroundingSearchConfiguration'
- maxItems: 1
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations'
description: |-
- The search configurations attached to this tool. There can be a maximum of 1
- search configuration resource attached to the tool.
- description: The bing grounding search tool parameters.
- BingGroundingTool:
+ Annotations for the message, when applicable, as when using the
+ [web search tool](/docs/guides/tools-web-search?api-mode=chat).
+ role:
+ type: string
+ enum:
+ - assistant
+ description: The role of the author of this message.
+ x-stainless-const: true
+ function_call:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall'
+ description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
+ deprecated: true
+ audio:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio'
+ - type: 'null'
+ description: A chat completion message generated by the model.
+ OpenAI.ChatCompletionResponseMessageAnnotations:
type: object
required:
- type
- - bing_grounding
+ - url_citation
properties:
type:
type: string
enum:
- - bing_grounding
- description: The object type, which is always 'bing_grounding'.
- name:
+ - url_citation
+ x-stainless-const: true
+ url_citation:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation'
+ OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation:
+ type: object
+ required:
+ - end_index
+ - start_index
+ - url
+ - title
+ properties:
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ url:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
+ format: uri
+ title:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- bing_grounding:
- $ref: '#/components/schemas/BingGroundingSearchToolParameters'
- description: The bing grounding search tool parameters.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for a bing grounding search tool as used to configure an agent.
- BingGroundingToolCall:
+ OpenAI.ChatCompletionResponseMessageAudio:
type: object
required:
- - type
- - call_id
- - arguments
- - status
+ - id
+ - expires_at
+ - data
+ - transcript
properties:
- type:
+ id:
type: string
- enum:
- - bing_grounding_call
- call_id:
+ expires_at:
+ type: integer
+ format: unixtime
+ data:
type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
+ transcript:
type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A Bing grounding tool call.
- BingGroundingToolCallOutput:
+ OpenAI.ChatCompletionResponseMessageFunctionCall:
type: object
required:
- - type
- - call_id
- - status
+ - arguments
+ - name
properties:
- type:
+ arguments:
type: string
- enum:
- - bing_grounding_call_output
- call_id:
+ name:
type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Bing grounding tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a Bing grounding tool call.
- BlobReference:
+ OpenAI.ChatCompletionStreamOptions:
+ type: object
+ properties:
+ include_usage:
+ type: boolean
+ description: |-
+ 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_obfuscation:
+ type: boolean
+ description: |-
+ 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.
+ description: 'Options for streaming response. Only set this when you set `stream: true`.'
+ OpenAI.ChatCompletionTokenLogprob:
type: object
required:
- - blobUri
- - storageAccountArmId
- - credential
+ - token
+ - logprob
+ - bytes
+ - top_logprobs
properties:
- blobUri:
- type: string
- format: uri
- description: 'Blob URI path for client to upload data. Example: `https://blob.windows.core.net/Container/Path`'
- storageAccountArmId:
+ token:
type: string
- description: ARM ID of the storage account to use.
- credential:
- $ref: '#/components/schemas/SasCredential'
- description: Credential info to access the storage account.
- description: Blob reference details.
- BotServiceAuthorizationScheme:
+ description: The token.
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: 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.
+ bytes:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ top_logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprobTopLogprobs'
+ description: List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`.
+ OpenAI.ChatCompletionTokenLogprobTopLogprobs:
type: object
required:
- - type
+ - token
+ - logprob
+ - bytes
properties:
- type:
+ token:
type: string
- enum:
- - BotService
- allOf:
- - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- BotServiceRbacAuthorizationScheme:
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ bytes:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ OpenAI.ChatCompletionTool:
type: object
required:
- type
+ - function
properties:
type:
type: string
enum:
- - BotServiceRbac
- allOf:
- - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- BotServiceTenantAuthorizationScheme:
+ - function
+ description: The type of the tool. Currently, only `function` is supported.
+ x-stainless-const: true
+ function:
+ $ref: '#/components/schemas/OpenAI.FunctionObject'
+ description: A function tool that can be used to generate a response.
+ title: Function tool
+ OpenAI.ChatCompletionToolChoiceOption:
+ oneOf:
+ - type: string
+ enum:
+ - none
+ - auto
+ - required
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionAllowedToolsChoice'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoice'
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustom'
+ description: |-
+ Controls which (if any) tool is called by the model.
+ `none` means the model will not call any tool and instead generates a message.
+ `auto` means the model can pick between generating a message or calling one or more tools.
+ `required` means the model must call one or more tools.
+ Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
+ `none` is the default when no tools are present. `auto` is the default if tools are present.
+ OpenAI.ChunkingStrategyRequestParam:
type: object
required:
- type
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParamType'
+ discriminator:
+ propertyName: type
+ mapping:
+ auto: '#/components/schemas/OpenAI.AutoChunkingStrategyRequestParam'
+ static: '#/components/schemas/OpenAI.StaticChunkingStrategyRequestParam'
+ description: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy.
+ OpenAI.ChunkingStrategyRequestParamType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - BotServiceTenant
- allOf:
- - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- BrowserAutomationPreviewTool:
+ - auto
+ - static
+ OpenAI.ChunkingStrategyResponse:
type: object
required:
- type
- - browser_automation_preview
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponseType'
+ discriminator:
+ propertyName: type
+ mapping:
+ static: '#/components/schemas/OpenAI.StaticChunkingStrategyResponseParam'
+ other: '#/components/schemas/OpenAI.OtherChunkingStrategyResponseParam'
+ description: The strategy used to chunk the file.
+ OpenAI.ChunkingStrategyResponseType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - browser_automation_preview
- description: The object type, which is always 'browser_automation_preview'.
- browser_automation_preview:
- $ref: '#/components/schemas/BrowserAutomationToolParameters'
- description: The Browser Automation Tool parameters.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for a Browser Automation Tool, as used to configure an Agent.
- BrowserAutomationPreviewToolboxTool:
+ - static
+ - other
+ OpenAI.ClickButtonType:
+ type: string
+ enum:
+ - left
+ - right
+ - wheel
+ - back
+ - forward
+ OpenAI.ClickParam:
type: object
required:
- type
- - browser_automation_preview
+ - button
+ - x
+ - 'y'
properties:
type:
type: string
enum:
- - browser_automation_preview
- browser_automation_preview:
- $ref: '#/components/schemas/BrowserAutomationToolParameters'
- description: The Browser Automation Tool parameters.
+ - click
+ description: Specifies the event type. For a click action, this property is always `click`.
+ x-stainless-const: true
+ button:
+ $ref: '#/components/schemas/OpenAI.ClickButtonType'
+ description: Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
+ x:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The x-coordinate where the click occurred.
+ 'y':
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The y-coordinate where the click occurred.
+ keys:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: A browser automation tool stored in a toolbox.
- BrowserAutomationToolCall:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A click action.
+ title: Click
+ OpenAI.CodeInterpreterOutputImage:
type: object
required:
- type
- - call_id
- - arguments
- - status
+ - url
properties:
type:
type: string
enum:
- - browser_automation_preview_call
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
+ - image
+ description: The type of the output. Always `image`.
+ x-stainless-const: true
+ default: image
+ url:
type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A browser automation tool call.
- BrowserAutomationToolCallOutput:
+ format: uri
+ description: The URL of the image output from the code interpreter.
+ description: The image output from the code interpreter.
+ title: Code interpreter output image
+ OpenAI.CodeInterpreterOutputLogs:
type: object
required:
- type
- - call_id
- - status
+ - logs
properties:
type:
type: string
enum:
- - browser_automation_preview_call_output
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the browser automation tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a browser automation tool call.
- BrowserAutomationToolConnectionParameters:
- type: object
- required:
- - project_connection_id
- properties:
- project_connection_id:
+ - logs
+ description: The type of the output. Always `logs`.
+ x-stainless-const: true
+ default: logs
+ logs:
type: string
- description: The ID of the project connection to your Azure Playwright resource.
- description: Definition of input parameters for the connection used by the Browser Automation Tool.
- BrowserAutomationToolParameters:
- type: object
- required:
- - connection
- properties:
- connection:
- $ref: '#/components/schemas/BrowserAutomationToolConnectionParameters'
- description: The project connection parameters associated with the Browser Automation Tool.
- description: Definition of input parameters for the Browser Automation Tool.
- CaptureStructuredOutputsTool:
+ description: The logs output from the code interpreter.
+ description: The logs output from the code interpreter.
+ title: Code interpreter output logs
+ OpenAI.CodeInterpreterTool:
type: object
required:
- type
- - outputs
properties:
type:
type: string
enum:
- - capture_structured_outputs
- description: The type of the tool. Always `capture_structured_outputs`.
+ - code_interpreter
+ description: The type of the code interpreter tool. Always `code_interpreter`.
+ x-stainless-const: true
name:
type: string
description: Deprecated. This property is deprecated and will be removed in a future version.
@@ -15383,197 +50372,6 @@ components:
$ref: '#/components/schemas/ToolConfig'
description: Deprecated. This property is deprecated and will be removed in a future version.
deprecated: true
- outputs:
- $ref: '#/components/schemas/StructuredOutputDefinition'
- description: The structured outputs to capture from the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool for capturing structured outputs
- ChartCoordinate:
- type: object
- required:
- - x
- - 'y'
- - size
- properties:
- x:
- type: integer
- format: int32
- description: X-axis coordinate.
- 'y':
- type: integer
- format: int32
- description: Y-axis coordinate.
- size:
- type: integer
- format: int32
- description: Size of the chart element.
- description: Coordinates for the analysis chart.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- ChatSummaryMemoryItem:
- type: object
- required:
- - kind
- properties:
- kind:
- type: string
- enum:
- - chat_summary
- description: The kind of the memory item.
- allOf:
- - $ref: '#/components/schemas/MemoryItem'
- description: A memory item containing a summary extracted from conversations.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- ClusterInsightResult:
- type: object
- required:
- - summary
- - clusters
- properties:
- summary:
- $ref: '#/components/schemas/InsightSummary'
- description: Summary of the insights report.
- clusters:
- type: array
- items:
- $ref: '#/components/schemas/InsightCluster'
- description: List of clusters identified in the insights.
- coordinates:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ChartCoordinate'
- description: |2-
- Optional mapping of IDs to 2D coordinates used by the UX for visualization.
-
- The map keys are string identifiers (for example, a cluster id or a sample id)
- and the values are the coordinates and visual size for rendering on a 2D chart.
-
- This property is omitted unless the client requests coordinates (for example,
- by passing `includeCoordinates=true` as a query parameter).
-
- Example:
- ```
- {
- "cluster-1": { "x": 12, "y": 34, "size": 8 },
- "sample-123": { "x": 18, "y": 22, "size": 4 }
- }
- ```
-
- Coordinates are intended only for client-side visualization and do not
- modify the canonical insights results.
- description: Insights from the cluster analysis.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- ClusterTokenUsage:
- type: object
- required:
- - inputTokenUsage
- - outputTokenUsage
- - totalTokenUsage
- properties:
- inputTokenUsage:
- type: integer
- format: int32
- description: input token usage
- outputTokenUsage:
- type: integer
- format: int32
- description: output token usage
- totalTokenUsage:
- type: integer
- format: int32
- description: total token usage
- description: Token usage for cluster analysis
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- CodeBasedEvaluatorDefinition:
- type: object
- required:
- - type
- properties:
- type:
- type: string
- enum:
- - code
- code_text:
- type: string
- description: Inline code text for the evaluator
- entry_point:
- type: string
- description: The entry point Python file name for the uploaded evaluator code (e.g. 'answer_length_evaluator.py')
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- image_tag:
- type: string
- description: The container image tag to use for evaluator code execution
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- blob_uri:
- type: string
- format: uri
- description: The blob URI for the evaluator storage
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- allOf:
- - $ref: '#/components/schemas/EvaluatorDefinition'
- description: Code-based evaluator definition using python code
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- CodeConfiguration:
- type: object
- required:
- - runtime
- - entry_point
- - dependency_resolution
- properties:
- runtime:
- type: string
- description: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', 'python_3_13').
- entry_point:
- type: array
- items:
- type: string
- description: The entry point command and arguments for the code execution.
- dependency_resolution:
- $ref: '#/components/schemas/CodeDependencyResolution'
- description: |-
- How package dependencies are resolved at deployment time. Defaults to `bundled`,
- where the caller bundles all dependencies into the uploaded zip and the service
- performs no remote build. `remote_build` instructs the service to build
- dependencies remotely from the manifest included in the uploaded zip.
- default: bundled
- content_hash:
- type: string
- description: The SHA-256 hex digest of the uploaded code zip. Set by the service from the `x-ms-code-zip-sha256` request header; read-only in responses and never accepted in request payloads.
- readOnly: true
- description: Code-based deployment configuration for a hosted agent.
- CodeDependencyResolution:
- anyOf:
- - type: string
- - type: string
- enum:
- - bundled
- - remote_build
- description: How package dependencies are resolved at deployment time for a code-based hosted agent.
- CodeInterpreterToolboxTool:
- type: object
- required:
- - type
- properties:
- type:
- type: string
- enum:
- - code_interpreter
container:
anyOf:
- type: string
@@ -15584,6208 +50382,8278 @@ components:
optional `memory_limit` setting.
If not provided, the service assumes auto.
allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: A code interpreter tool stored in a toolbox.
- CompletionMessageToolCallChunk:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that runs Python code to help generate a response to a prompt.
+ title: Code interpreter
+ OpenAI.CompactResource:
type: object
required:
- id
- - type
+ - object
+ - output
+ - created_at
+ - usage
properties:
id:
type: string
- description: The Id for the tool call.
- type:
+ description: The unique identifier for the compacted response.
+ object:
type: string
enum:
- - function
- description: The type of tool call, which is always "function".
- function:
- $ref: '#/components/schemas/FunctionToolCall'
- description: Details of the function tool call, if applicable.
- description: Tool call details within a message.
- Connection:
+ - response.compaction
+ description: The object type. Always `response.compaction`.
+ x-stainless-const: true
+ default: response.compaction
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The compacted list of output items.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the compacted conversation was created.
+ usage:
+ $ref: '#/components/schemas/OpenAI.ResponseUsage'
+ description: Token accounting for the compaction pass, including cached, reasoning, and total tokens.
+ title: The compacted response object
+ OpenAI.CompactResponseMethodPublicBody:
type: object
required:
- - name
- - id
- - type
- - target
- - isDefault
- - credentials
- - metadata
+ - model
properties:
- name:
- type: string
- description: The friendly name of the connection, provided by the user.
- readOnly: true
- id:
+ model:
type: string
- description: A unique identifier for the connection, generated by the service
- readOnly: true
+ description: The model deployment to use for the compaction of this response.
+ input:
+ anyOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.InputItem'
+ - type: 'null'
+ previous_response_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ prompt_cache_key:
+ anyOf:
+ - type: string
+ - type: 'null'
+ prompt_cache_retention:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.PromptCacheRetentionEnum'
+ - type: 'null'
+ service_tier:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ServiceTierEnum'
+ - type: 'null'
+ OpenAI.ComparisonFilter:
+ type: object
+ required:
+ - type
+ - key
+ - value
+ properties:
type:
- $ref: '#/components/schemas/ConnectionType'
- description: Category of the connection
- readOnly: true
- target:
type: string
- description: The connection URL to be used for this service
- readOnly: true
- isDefault:
- type: boolean
- description: Whether the connection is tagged as the default connection of its type
- readOnly: true
- credentials:
- $ref: '#/components/schemas/BaseCredentials'
- description: The credentials used by the connection
- readOnly: true
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Metadata of the connection
- readOnly: true
- description: Response from the list and get connections operations
- ConnectionType:
- anyOf:
- - type: string
- - type: string
enum:
- - AzureOpenAI
- - AzureBlob
- - AzureStorageAccount
- - CognitiveSearch
- - CosmosDB
- - ApiKey
- - AppConfig
- - AppInsights
- - CustomKeys
- - RemoteTool_Preview
- description: The Type (or category) of the connection
- ContainerAppAgentDefinition:
+ - eq
+ - ne
+ - gt
+ - gte
+ - lt
+ - lte
+ - in
+ - nin
+ description: |-
+ Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.
+ - `eq`: equals
+ - `ne`: not equal
+ - `gt`: greater than
+ - `gte`: greater than or equal
+ - `lt`: less than
+ - `lte`: less than or equal
+ - `in`: in
+ - `nin`: not in
+ default: eq
+ key:
+ type: string
+ description: The key to compare against the value.
+ value:
+ oneOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: boolean
+ - type: array
+ items:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: The value to compare against the attribute key; supports string, number, or boolean types.
+ description: A filter used to compare a specified attribute key to a given value using a defined comparison operation.
+ title: Comparison Filter
+ x-oaiMeta:
+ name: ComparisonFilter
+ OpenAI.CompleteUploadRequest:
type: object
required:
- - kind
- - container_protocol_versions
- - container_app_resource_id
- - ingress_subdomain_suffix
+ - part_ids
properties:
- kind:
- type: string
- enum:
- - container_app
- container_protocol_versions:
+ part_ids:
type: array
items:
- $ref: '#/components/schemas/ProtocolVersionRecord'
- description: The protocols that the agent supports for ingress communication of the containers.
- examples:
- - - protocol: responses
- version: v0.1.1
- - protocol: a2a
- version: v0.3.0
- container_app_resource_id:
- type: string
- description: The resource ID of the Azure Container App that hosts this agent. Not mutable across versions.
- ingress_subdomain_suffix:
+ type: string
+ description: The ordered list of Part IDs.
+ md5:
type: string
- description: The suffix to apply to the app subdomain when sending ingress to the agent. This can be a label (e.g., '---current'), a specific revision (e.g., '--0000001'), or empty to use the default endpoint for the container app.
- examples:
- - --0000001
- - ---current
- - ''
- allOf:
- - $ref: '#/components/schemas/AgentDefinition'
- description: The container app agent definition.
- x-ms-foundry-meta:
- required_previews:
- - ContainerAgents=V1Preview
- ContainerConfiguration:
+ description: The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect.
+ OpenAI.CompletionUsage:
+ type: object
+ required:
+ - completion_tokens
+ - prompt_tokens
+ - total_tokens
+ properties:
+ completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of tokens in the generated completion.
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of tokens in the prompt.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Total number of tokens used in the request (prompt + completion).
+ completion_tokens_details:
+ $ref: '#/components/schemas/OpenAI.CompletionUsageCompletionTokensDetails'
+ description: Breakdown of tokens used in a completion.
+ prompt_tokens_details:
+ $ref: '#/components/schemas/OpenAI.CompletionUsagePromptTokensDetails'
+ description: Breakdown of tokens used in the prompt.
+ description: Usage statistics for the completion request.
+ OpenAI.CompletionUsageCompletionTokensDetails:
+ type: object
+ properties:
+ accepted_prediction_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ audio_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ reasoning_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ rejected_prediction_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CompletionUsagePromptTokensDetails:
type: object
- required:
- - image
properties:
- image:
- type: string
- description: The container image for the hosted agent.
- examples:
- - my-registry.azurecr.io/my-hosted-agent:latest
- description: Container-based deployment configuration for a hosted agent.
- ContainerDetails:
+ audio_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CompoundFilter:
type: object
required:
- - provisioning_state
- - state
- - health_state
- - replicas
- - updated_on
+ - type
+ - filters
properties:
- provisioning_state:
- type: string
- description: The provisioning state of the container.
- provisioning_error:
- type: string
- description: The provisioning error of the container, if any.
- state:
- type: string
- description: The state of the container.
- health_state:
+ type:
type: string
- description: The health state of the container.
- replicas:
+ enum:
+ - and
+ - or
+ description: 'Type of operation: `and` or `or`.'
+ filters:
type: array
items:
- $ref: '#/components/schemas/ContainerReplica'
- description: The list of replicas in the container.
- updated_on:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
+ - {}
+ description: Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
+ description: Combine multiple filters using `and` or `or`.
+ title: Compound Filter
+ x-oaiMeta:
+ name: CompoundFilter
+ OpenAI.ComputerAction:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.ComputerActionType'
+ discriminator:
+ propertyName: type
+ mapping:
+ click: '#/components/schemas/OpenAI.ClickParam'
+ double_click: '#/components/schemas/OpenAI.DoubleClickAction'
+ drag: '#/components/schemas/OpenAI.DragParam'
+ keypress: '#/components/schemas/OpenAI.KeyPressAction'
+ move: '#/components/schemas/OpenAI.MoveParam'
+ screenshot: '#/components/schemas/OpenAI.ScreenshotParam'
+ scroll: '#/components/schemas/OpenAI.ScrollParam'
+ type: '#/components/schemas/OpenAI.TypeParam'
+ wait: '#/components/schemas/OpenAI.WaitParam'
+ OpenAI.ComputerActionList:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: |-
+ Flattened batched actions for `computer_use`. Each action includes an
+ `type` discriminator and action-specific fields.
+ title: Computer Action List
+ OpenAI.ComputerActionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - click
+ - double_click
+ - drag
+ - keypress
+ - move
+ - screenshot
+ - scroll
+ - type
+ - wait
+ OpenAI.ComputerCallSafetyCheckParam:
+ type: object
+ required:
+ - id
+ properties:
+ id:
type: string
- format: date-time
- description: The last update time of the container.
- description: Detailed information about the container.
- x-ms-foundry-meta:
- required_previews:
- - ContainerAgents=V1Preview
- ContainerLogKind:
+ description: The ID of the pending safety check.
+ code:
+ anyOf:
+ - type: string
+ - type: 'null'
+ message:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: A pending safety check for the computer call.
+ OpenAI.ComputerEnvironment:
type: string
enum:
- - console
- - system
- description: The type of logs to stream from a container.
- x-ms-foundry-meta:
- required_previews:
- - ContainerAgents=V1Preview
- ContainerReplica:
+ - windows
+ - mac
+ - linux
+ - ubuntu
+ - browser
+ OpenAI.ComputerScreenshotContent:
type: object
required:
- - name
- - state
- - container_state
+ - type
+ - image_url
+ - file_id
+ - detail
properties:
- name:
- type: string
- description: The name of the replica.
- state:
- type: string
- description: The state of the replica.
- container_state:
+ type:
type: string
- description: The container state of the replica.
- description: Information about a container replica.
- x-ms-foundry-meta:
- required_previews:
- - ContainerAgents=V1Preview
- ContentFilterResult:
+ enum:
+ - computer_screenshot
+ description: Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.
+ x-stainless-const: true
+ image_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A screenshot of a computer.
+ title: Computer screenshot
+ OpenAI.ComputerScreenshotImage:
type: object
required:
- - blocked
- - source_type
- - content_filter_results
+ - type
properties:
- blocked:
- type: boolean
- description: Whether the content was blocked by the content filter.
- source_type:
+ type:
type: string
- description: The source type of the content filter evaluation (e.g., 'prompt', 'response', 'pre_tool_call', 'post_tool_call').
- content_filter_results:
- $ref: '#/components/schemas/AzureContentFilterResultsForResponses'
- description: The content filter results for this evaluation.
- tool_call_id:
+ enum:
+ - computer_screenshot
+ description: |-
+ Specifies the event type. For a computer screenshot, this property is
+ always set to `computer_screenshot`.
+ x-stainless-const: true
+ default: computer_screenshot
+ image_url:
type: string
- description: The ID of the tool call associated with this content filter result, if applicable.
- description: A content filter evaluation result for a specific source in the response.
- ContinuousEvaluationRuleAction:
+ format: uri
+ description: The URL of the screenshot image.
+ file_id:
+ type: string
+ description: The identifier of an uploaded file that contains the screenshot.
+ description: A computer screenshot image used with the computer use tool.
+ OpenAI.ComputerTool:
type: object
required:
- type
- - evalId
properties:
type:
type: string
enum:
- - continuousEvaluation
- evalId:
- type: string
- description: Eval Id to add continuous evaluation runs to.
- maxHourlyRuns:
- type: integer
- format: int32
- description: Maximum number of evaluation runs allowed per hour.
- samplingRate:
- type: number
- format: double
- maximum: 100
- description: Percentage (0-100] chance that a matching event triggers an evaluation. When omitted, the service-default is to evaluate every event, which is equivalent to setting a sampling rate of 100.
- exclusiveMinimum: 0
- default: 100
+ - computer
+ description: The type of the computer tool. Always `computer`.
+ x-stainless-const: true
allOf:
- - $ref: '#/components/schemas/EvaluationRuleAction'
- description: Evaluation rule action for continuous evaluation.
- ConversationGenPreviewItemGenerationParams:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
+ title: Computer
+ OpenAI.ComputerUsePreviewTool:
type: object
required:
- type
- - model
+ - environment
+ - display_width
+ - display_height
properties:
type:
type: string
enum:
- - conversation_gen_preview
- description: The type of item generation parameters, always `conversation_gen_preview`.
- model:
- type: string
- description: The model deployment used for simulation, in the format '{connectionName}/modelDeploymentName'.
- max_turns:
- type: integer
- format: int32
- description: Maximum number of turns per simulated conversation. Defaults to 20.
- default: 20
- num_conversations:
- type: integer
- format: int32
- description: Number of simulated conversations to generate per test scenario. Defaults to 5.
- default: 5
- data_mapping:
- type: object
- unevaluatedProperties:
- type: string
- description: Mapping from source fields to response_id field, which is required for retrieving chat history.
- sampling_params:
- $ref: '#/components/schemas/ModelSamplingParams'
- description: Sampling parameters for the conversation generation.
+ - computer_use_preview
+ description: The type of the computer use tool. Always `computer_use_preview`.
+ x-stainless-const: true
+ environment:
+ $ref: '#/components/schemas/OpenAI.ComputerEnvironment'
+ description: The type of computer environment to control.
+ display_width:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The width of the computer display.
+ display_height:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The height of the computer display.
allOf:
- - $ref: '#/components/schemas/ItemGenerationParams'
- description: Represents the parameters for conversation simulation item generation.
- ConversationIdTraceSource:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
+ title: Computer use preview
+ OpenAI.ContainerAutoParam:
type: object
required:
- type
- - conversation_ids
properties:
type:
type: string
enum:
- - conversation_id_source
- description: The type of trace source, always `conversation_id_source`.
- conversation_ids:
+ - container_auto
+ description: Automatically creates a container for this request
+ x-stainless-const: true
+ file_ids:
type: array
items:
type: string
- description: Collection of conversation identifiers to filter traces by.
+ maxItems: 50
+ description: An optional list of uploaded files to make available to your code.
+ memory_limit:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit'
+ - type: 'null'
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ContainerSkill'
+ maxItems: 200
+ description: An optional list of skills referenced by id or inline data.
+ network_policy:
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
allOf:
- - $ref: '#/components/schemas/TraceSource'
- description: A trace source that selects traces by conversation IDs.
- CosmosDBIndex:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
+ OpenAI.ContainerFileCitationBody:
type: object
required:
- type
+ - container_id
+ - file_id
+ - start_index
+ - end_index
+ - filename
properties:
type:
type: string
enum:
- - CosmosDBNoSqlVectorStore
- description: Type of index
+ - container_file_citation
+ description: The type of the container file citation. Always `container_file_citation`.
+ x-stainless-const: true
+ container_id:
+ type: string
+ description: The ID of the container file.
+ file_id:
+ type: string
+ description: The ID of the file.
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the first character of the container file citation in the message.
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the last character of the container file citation in the message.
+ filename:
+ type: string
+ description: The filename of the container file cited.
allOf:
- - $ref: '#/components/schemas/Index'
- description: CosmosDB Vector Store Index Definition
- CosmosDBIndexUpdate:
+ - $ref: '#/components/schemas/OpenAI.Annotation'
+ description: A citation for a container file used to generate a model response.
+ title: Container file citation
+ OpenAI.ContainerFileListResource:
type: object
required:
- - type
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
+ object:
type: string
enum:
- - CosmosDBNoSqlVectorStore
- description: Type of index
- allOf:
- - $ref: '#/components/schemas/IndexUpdate'
- description: CosmosDB Vector Store Index Definition
- CreateAgentFromCodeContent:
- type: object
- properties:
- metadata:
- allOf:
- - $ref: '#/components/schemas/CreateAgentVersionFromCodeMetadata'
- description: JSON metadata including description and hosted definition.
- code:
- description: The code zip file (max 250 MB).
- required:
- - metadata
- - code
- CreateAgentFromManifestRequest:
+ - list
+ description: The type of object returned, must be 'list'.
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ContainerFileResource'
+ description: A list of container files.
+ x-ms-list-page-items: true
+ first_id:
+ type: string
+ description: The ID of the first file in the list.
+ last_id:
+ type: string
+ description: The ID of the last file in the list.
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ description: Whether there are more files available.
+ OpenAI.ContainerFileResource:
type: object
required:
- - name
- - manifest_id
- - parameter_values
+ - id
+ - object
+ - container_id
+ - created_at
+ - bytes
+ - path
+ - source
properties:
- name:
+ id:
type: string
- maxLength: 63
- description: |-
- The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
- - Must start and end with alphanumeric characters,
- - Can contain hyphens in the middle
- - Must not exceed 63 characters.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- description:
+ description: Unique identifier for the file.
+ object:
type: string
- maxLength: 512
- description: A human-readable description of the agent.
- manifest_id:
+ enum:
+ - container.file
+ description: The type of this object (`container.file`).
+ container_id:
type: string
- description: The manifest ID to import the agent version from.
- parameter_values:
- type: object
- unevaluatedProperties: {}
- description: The inputs to the manifest that will result in a fully materialized Agent.
- CreateAgentRequest:
+ description: The container this file belongs to.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the file was created.
+ bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Size of the file in bytes.
+ path:
+ type: string
+ description: Path of the file in the container.
+ source:
+ type: string
+ description: Source of the file (e.g., `user`, `assistant`).
+ title: The container file object
+ x-oaiMeta:
+ name: The container file object
+ example: |
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+ OpenAI.ContainerListResource:
type: object
required:
- - name
- - definition
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- name:
+ object:
type: string
- maxLength: 63
- description: |-
- The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
- - Must start and end with alphanumeric characters,
- - Can contain hyphens in the middle
- - Must not exceed 63 characters.
- state:
- $ref: '#/components/schemas/AgentState'
- description: The initial operational state of the agent. Defaults to 'enabled' if not specified.
- default: enabled
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- description:
+ enum:
+ - list
+ description: The type of object returned, must be 'list'.
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ContainerResource'
+ description: A list of containers.
+ x-ms-list-page-items: true
+ first_id:
type: string
- maxLength: 512
- description: A human-readable description of the agent.
- definition:
- $ref: '#/components/schemas/AgentDefinition'
- description: The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
- x-ms-foundry-meta:
- conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- blueprint_reference:
- $ref: '#/components/schemas/AgentBlueprintReference'
- description: The blueprint reference for the agent.
- draft:
+ description: The ID of the first container in the list.
+ last_id:
+ type: string
+ description: The ID of the last container in the list.
+ x-ms-list-continuation-token: true
+ has_more:
type: boolean
- description: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.
- x-ms-foundry-meta:
- conditional_previews:
- - DraftAgents=V1Preview
- default: false
- agent_endpoint:
- $ref: '#/components/schemas/AgentEndpointConfig'
- description: An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent
- agent_card:
- $ref: '#/components/schemas/AgentCard'
- description: Optional agent card for the agent
- x-ms-foundry-meta:
- conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- CreateAgentSessionRequest:
+ description: Whether there are more containers available.
+ OpenAI.ContainerMemoryLimit:
+ type: string
+ enum:
+ - 1g
+ - 4g
+ - 16g
+ - 64g
+ OpenAI.ContainerNetworkPolicyAllowlistParam:
type: object
required:
- - version_indicator
+ - type
+ - allowed_domains
properties:
- agent_session_id:
+ type:
type: string
- description: Optional caller-provided session ID. If specified, it must be unique within the agent endpoint. Auto-generated if omitted.
- version_indicator:
- $ref: '#/components/schemas/VersionIndicator'
- description: Determines which agent version backs the session.
- description: Request to create a new agent session.
- CreateAgentVersionFromCodeContent:
+ enum:
+ - allowlist
+ description: Allow outbound network access only to specified domains. Always `allowlist`.
+ x-stainless-const: true
+ allowed_domains:
+ type: array
+ items:
+ type: string
+ minItems: 1
+ description: A list of allowed domains when type is `allowlist`.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ OpenAI.ContainerNetworkPolicyDisabledParam:
type: object
- properties:
- metadata:
- allOf:
- - $ref: '#/components/schemas/CreateAgentVersionFromCodeMetadata'
- description: JSON metadata including description and hosted definition.
- code:
- description: The code zip file (max 250 MB).
required:
- - metadata
- - code
- CreateAgentVersionFromCodeMetadata:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - disabled
+ description: Disable outbound network access. Always `disabled`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ OpenAI.ContainerNetworkPolicyParam:
type: object
required:
- - definition
+ - type
properties:
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the agent.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- definition:
- $ref: '#/components/schemas/HostedAgentDefinition'
- description: The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, and protocol_versions.
- description: |-
- JSON metadata for code-based agent operations (create, update, create version).
- The agent name comes from the URL path parameter or the `x-ms-agent-name` header,
- so it is not included in this model.
- The content hash (SHA-256 of the zip) is carried in the `x-ms-code-zip-sha256` header.
- CreateAgentVersionFromManifestRequest:
+ type:
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParamType'
+ discriminator:
+ propertyName: type
+ mapping:
+ disabled: '#/components/schemas/OpenAI.ContainerNetworkPolicyDisabledParam'
+ allowlist: '#/components/schemas/OpenAI.ContainerNetworkPolicyAllowlistParam'
+ description: Network access policy for the container.
+ OpenAI.ContainerNetworkPolicyParamType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - disabled
+ - allowlist
+ OpenAI.ContainerReferenceResource:
type: object
required:
- - manifest_id
- - parameter_values
+ - type
+ - container_id
properties:
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- description:
+ type:
type: string
- maxLength: 512
- description: A human-readable description of the agent.
- manifest_id:
+ enum:
+ - container_reference
+ description: The environment type. Always `container_reference`.
+ x-stainless-const: true
+ container_id:
type: string
- description: The manifest ID to import the agent version from.
- parameter_values:
- type: object
- unevaluatedProperties: {}
- description: The inputs to the manifest that will result in a fully materialized Agent.
- CreateAgentVersionRequest:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ description: Represents a container created with /v1/containers.
+ title: Container Reference
+ OpenAI.ContainerResource:
type: object
required:
- - definition
+ - id
+ - object
+ - name
+ - created_at
+ - status
properties:
- metadata:
- type: object
- unevaluatedProperties:
- type: string
+ id:
+ type: string
+ description: Unique identifier for the container.
+ object:
+ type: string
+ description: The type of this object.
+ name:
+ type: string
+ description: Name of the container.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the container was created.
+ status:
+ type: string
+ description: Status of the container (e.g., active, deleted).
+ last_active_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the container was last active.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.ContainerResourceExpiresAfter'
description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
-
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- description:
+ 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.
+ memory_limit:
type: string
- maxLength: 512
- description: A human-readable description of the agent.
- definition:
- $ref: '#/components/schemas/AgentDefinition'
- description: The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
- x-ms-foundry-meta:
- conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- blueprint_reference:
- $ref: '#/components/schemas/AgentBlueprintReference'
- description: The blueprint reference for the agent.
- draft:
- type: boolean
- description: (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.
- x-ms-foundry-meta:
- conditional_previews:
- - DraftAgents=V1Preview
- default: false
- x-ms-foundry-meta:
- conditional_previews:
- - WorkflowAgents=V1Preview
- - ExternalAgents=V1Preview
- - DraftAgents=V1Preview
- CreateEvalRequest:
+ enum:
+ - 1g
+ - 4g
+ - 16g
+ - 64g
+ description: The memory limit configured for the container.
+ network_policy:
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ title: The container object
+ x-oaiMeta:
+ name: The container object
+ example: |
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container",
+ "created_at": 1747844794,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747844794,
+ "memory_limit": "1g",
+ "name": "My Container"
+ }
+ OpenAI.ContainerResourceExpiresAfter:
type: object
- required:
- - data_source_config
- - testing_criteria
properties:
- name:
+ anchor:
type: string
- description: The name of the evaluation.
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- data_source_config:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig'
- - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig'
- - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig'
- - $ref: '#/components/schemas/AzureAIDataSourceConfig'
- - $ref: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
- description: The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation.
- testing_criteria:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
- - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
- - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
- - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
- description: 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}}`).
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- title: CreateEvalRequest
- CreateEvalRunRequest:
+ enum:
+ - last_active_at
+ minutes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.ContainerSkill:
type: object
required:
- - data_source
+ - type
properties:
- name:
+ type:
+ $ref: '#/components/schemas/OpenAI.ContainerSkillType'
+ discriminator:
+ propertyName: type
+ mapping:
+ skill_reference: '#/components/schemas/OpenAI.SkillReferenceParam'
+ inline: '#/components/schemas/OpenAI.InlineSkillParam'
+ OpenAI.ContainerSkillType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - skill_reference
+ - inline
+ OpenAI.ContextManagementParam:
+ type: object
+ required:
+ - type
+ properties:
+ type:
type: string
- description: The name of the run.
- metadata:
+ description: The context management entry type. Currently only 'compaction' is supported.
+ compact_threshold:
anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- data_source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource'
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource'
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Details about the run's data source.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- evaluation_level:
- $ref: '#/components/schemas/EvaluationLevel'
- description: The level at which evaluation is performed. Defaults to 'turn' if not specified.
- default: turn
- title: CreateEvalRunRequest
- CreateOrUpdateManagedAgentIdentityBlueprintRequest:
+ OpenAI.ConversationItem:
type: object
required:
- - name
+ - type
properties:
- name:
- type: string
- maxLength: 63
- description: |-
- The unique name that identifies the managed agent identity blueprint.
- Name can be used to retrieve/update/delete the managed agent identity blueprint.
- - Must start and end with alphanumeric characters,
- - Can contain hyphens in the middle
- - Must not exceed 63 characters.
- CreateSkillVersionFromFilesBody:
+ type:
+ $ref: '#/components/schemas/OpenAI.ConversationItemType'
+ discriminator:
+ propertyName: type
+ mapping:
+ message: '#/components/schemas/OpenAI.ConversationItemMessage'
+ function_call: '#/components/schemas/OpenAI.ConversationItemFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutput'
+ file_search_call: '#/components/schemas/OpenAI.ConversationItemFileSearchToolCall'
+ web_search_call: '#/components/schemas/OpenAI.ConversationItemWebSearchToolCall'
+ image_generation_call: '#/components/schemas/OpenAI.ConversationItemImageGenToolCall'
+ computer_call: '#/components/schemas/OpenAI.ConversationItemComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.ConversationItemComputerToolCallOutput'
+ tool_search_call: '#/components/schemas/OpenAI.ConversationItemToolSearchCall'
+ tool_search_output: '#/components/schemas/OpenAI.ConversationItemToolSearchOutput'
+ additional_tools: '#/components/schemas/OpenAI.ConversationItemAdditionalTools'
+ reasoning: '#/components/schemas/OpenAI.ConversationItemReasoningItem'
+ compaction: '#/components/schemas/OpenAI.ConversationItemCompactionBody'
+ code_interpreter_call: '#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.ConversationItemFunctionShellCall'
+ shell_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput'
+ apply_patch_call: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall'
+ apply_patch_call_output: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput'
+ mcp_list_tools: '#/components/schemas/OpenAI.ConversationItemMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource'
+ mcp_call: '#/components/schemas/OpenAI.ConversationItemMcpToolCall'
+ custom_tool_call: '#/components/schemas/OpenAI.ConversationItemCustomToolCallResource'
+ custom_tool_call_output: '#/components/schemas/OpenAI.ConversationItemCustomToolCallOutputResource'
+ description: A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](/docs/api-reference/responses/object#responses/object-output).
+ title: Conversation item
+ OpenAI.ConversationItemAdditionalTools:
type: object
- properties:
- files:
- type: array
- items: {}
- description: Skill files to upload. Upload a single zip file or multiple individual files with relative paths.
- default:
- type: boolean
- description: Whether to set this version as the default. Defaults to false.
required:
- - files
- CreatedBy:
- type: object
+ - type
+ - id
+ - role
+ - tools
properties:
- agent:
- $ref: '#/components/schemas/AgentId'
- description: The agent that created the item.
- response_id:
+ type:
type: string
- description: The response on which the item is created.
- CredentialType:
- anyOf:
- - type: string
- - type: string
enum:
- - ApiKey
- - AAD
- - SAS
- - CustomKeys
- - None
- - AgenticIdentityToken_Preview
- description: The credential type used by the connection
- CronTrigger:
+ - additional_tools
+ description: The type of the item. Always `additional_tools`.
+ x-stainless-const: true
+ default: additional_tools
+ id:
+ type: string
+ description: The unique ID of the additional tools item.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role that provided the additional tools.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The additional tool definitions made available at this item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ OpenAI.ConversationItemApplyPatchToolCall:
type: object
required:
- type
- - expression
+ - id
+ - call_id
+ - status
+ - operation
properties:
type:
type: string
enum:
- - Cron
- expression:
- type: string
- description: Cron expression that defines the schedule frequency.
- timeZone:
+ - apply_patch_call
+ description: The type of the item. Always `apply_patch_call`.
+ x-stainless-const: true
+ default: apply_patch_call
+ id:
type: string
- description: Time zone for the cron schedule. Defaults to `UTC`.
- default: UTC
- startTime:
+ description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
+ call_id:
type: string
- description: Start time for the cron schedule in ISO 8601 format.
- endTime:
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
+ description: The status of the apply patch tool call. One of `in_progress` or `completed`.
+ operation:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
+ title: Apply patch operation
+ created_by:
type: string
- description: End time for the cron schedule in ISO 8601 format.
+ description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/Trigger'
- description: Cron based trigger.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- CustomCredential:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A tool call that applies file diffs by creating, deleting, or updating files.
+ title: Apply patch tool call
+ OpenAI.ConversationItemApplyPatchToolCallOutput:
type: object
required:
- type
+ - id
+ - call_id
+ - status
properties:
type:
type: string
enum:
- - CustomKeys
- description: The credential type
- readOnly: true
- unevaluatedProperties:
- type: string
+ - apply_patch_call_output
+ description: The type of the item. Always `apply_patch_call_output`.
+ x-stainless-const: true
+ default: apply_patch_call_output
+ id:
+ type: string
+ description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
+ description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call output.
allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: Custom credential definition
- CustomRoutineTrigger:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output emitted by an apply patch tool call.
+ title: Apply patch tool call output
+ OpenAI.ConversationItemCodeInterpreterToolCall:
type: object
required:
- type
- - provider
- - parameters
+ - id
+ - status
+ - container_id
+ - code
+ - outputs
properties:
type:
type: string
enum:
- - custom
- description: The trigger type.
- provider:
+ - code_interpreter_call
+ description: The type of the code interpreter tool call. Always `code_interpreter_call`.
+ x-stainless-const: true
+ default: code_interpreter_call
+ id:
type: string
- maxLength: 128
- description: The external provider that emits the custom event.
- event_name:
+ description: The unique ID of the code interpreter tool call.
+ status:
type: string
- maxLength: 256
- description: The provider-specific event name that fires the routine.
- parameters:
- type: object
- unevaluatedProperties: {}
- description: Provider-specific trigger parameters.
- allOf:
- - $ref: '#/components/schemas/RoutineTrigger'
- description: A custom event routine trigger.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- DailyRecurrenceSchedule:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - interpreting
+ - failed
+ description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
+ container_id:
+ type: string
+ description: The ID of the container used to run the code.
+ code:
+ anyOf:
+ - type: string
+ - type: 'null'
+ outputs:
+ anyOf:
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A tool call to run code.
+ title: Code interpreter tool call
+ OpenAI.ConversationItemCompactionBody:
type: object
required:
- type
- - hours
+ - id
+ - encrypted_content
properties:
type:
type: string
enum:
- - Daily
- description: Daily recurrence type.
- hours:
- type: array
- items:
- type: integer
- format: int32
- description: Hours for the recurrence schedule.
+ - compaction
+ description: The type of the item. Always `compaction`.
+ x-stainless-const: true
+ default: compaction
+ id:
+ type: string
+ description: The unique ID of the compaction item.
+ encrypted_content:
+ type: string
+ description: The encrypted content that was produced by compaction.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/RecurrenceSchedule'
- description: Daily recurrence schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- DataGenerationJob:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
+ title: Compaction item
+ OpenAI.ConversationItemComputerToolCall:
type: object
required:
+ - type
- id
+ - call_id
+ - pending_safety_checks
- status
- - created_at
properties:
+ type:
+ type: string
+ enum:
+ - computer_call
+ description: The type of the computer call. Always `computer_call`.
+ default: computer_call
id:
type: string
- description: Server-assigned unique identifier.
- readOnly: true
- inputs:
- $ref: '#/components/schemas/DataGenerationJobInputs'
- description: Caller-supplied inputs.
- result:
- $ref: '#/components/schemas/DataGenerationJobResult'
- description: Result produced on success.
- readOnly: true
- status:
- $ref: '#/components/schemas/JobStatus'
- description: Current lifecycle status.
- readOnly: true
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error details — populated only on failure.
- readOnly: true
- created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).
- readOnly: true
- finished_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job was finished, represented in Unix time (seconds since January 1, 1970).
- readOnly: true
- description: Data Generation Job resource.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobInputs:
- type: object
- required:
- - name
- - sources
- - options
- - scenario
- properties:
- name:
+ description: The unique ID of the computer call.
+ call_id:
type: string
- description: The display name of the data generation job.
- sources:
+ description: An identifier used when responding to the tool call with output.
+ action:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ actions:
+ $ref: '#/components/schemas/OpenAI.ComputerActionList'
+ pending_safety_checks:
type: array
items:
- $ref: '#/components/schemas/DataGenerationJobSource'
- description: The sources used for the data generation job.
- options:
- $ref: '#/components/schemas/DataGenerationJobOptions'
- description: The options for the data generation job.
- scenario:
- $ref: '#/components/schemas/DataGenerationJobScenario'
- description: The scenario of the data generation job. Either for fine-tuning or evaluation.
- output_options:
- $ref: '#/components/schemas/DataGenerationJobOutputOptions'
- description: Optional caller-supplied metadata for the job's output. See individual fields for whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both.
- description: Caller-supplied inputs for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobOptions:
- type: object
- required:
- - type
- - max_samples
- properties:
- type:
- $ref: '#/components/schemas/DataGenerationJobType'
- description: The data generation job type.
- max_samples:
- type: integer
- format: int32
- description: Maximum number of samples to generate.
- train_split:
- type: number
- format: float
- minimum: 0
- maximum: 1
- description: The proportion of the generated data to be used for training when the data is used for fine-tuning. The rest will be used for validation. Value should be between 0 and 1.
- model_options:
- $ref: '#/components/schemas/DataGenerationModelOptions'
- description: The LLM model options.
- discriminator:
- propertyName: type
- mapping:
- simple_qna: '#/components/schemas/SimpleQnADataGenerationJobOptions'
- traces: '#/components/schemas/TracesDataGenerationJobOptions'
- tool_use: '#/components/schemas/ToolUseFineTuningDataGenerationJobOptions'
- description: Options for managing data generation jobs.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobOutput:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: The pending safety checks for the computer call.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ A tool call to a computer use tool. See the
+ [computer use guide](/docs/guides/tools-computer-use) for more information.
+ title: Computer tool call
+ OpenAI.ConversationItemComputerToolCallOutput:
type: object
required:
- type
+ - id
+ - call_id
+ - output
properties:
type:
- $ref: '#/components/schemas/DataGenerationJobOutputType'
- description: The type of the output.
- discriminator:
- propertyName: type
- mapping:
- file: '#/components/schemas/FileDataGenerationJobOutput'
- dataset: '#/components/schemas/DatasetDataGenerationJobOutput'
- description: Output information for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobOutputOptions:
- type: object
- properties:
- name:
- type: string
- description: Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario).
- description:
type: string
- description: Description to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI file outputs.
- description: Output options for data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobOutputType:
- anyOf:
- - type: string
- - type: string
enum:
- - file
- - dataset
- description: The supported output file types for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobResult:
- type: object
- required:
- - generated_samples
- properties:
- outputs:
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
+ x-stainless-const: true
+ default: computer_call_output
+ id:
+ type: string
+ description: The ID of the computer tool call output.
+ readOnly: true
+ call_id:
+ type: string
+ description: The ID of the computer tool call that produced the output.
+ acknowledged_safety_checks:
type: array
items:
- $ref: '#/components/schemas/DataGenerationJobOutput'
- description: 'The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation.'
- generated_samples:
- type: integer
- format: int32
- description: The number of samples actually generated.
- token_usage:
- $ref: '#/components/schemas/DataGenerationTokenUsage'
- description: The token usage information for the data generation job.
- description: Result produced by a successful data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobScenario:
- anyOf:
- - type: string
- - type: string
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: |-
+ The safety checks reported by the API that have been acknowledged by the
+ developer.
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ status:
+ type: string
enum:
- - supervised_finetuning
- - reinforcement_finetuning
- - evaluation
- description: The supported scenarios for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobSource:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.ConversationItemCustomToolCallOutputResource:
type: object
required:
- type
+ - call_id
+ - output
+ - status
properties:
type:
- $ref: '#/components/schemas/DataGenerationJobSourceType'
- description: The type of source.
- description:
type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
- discriminator:
- propertyName: type
- mapping:
- prompt: '#/components/schemas/PromptDataGenerationJobSource'
- agent: '#/components/schemas/AgentDataGenerationJobSource'
- traces: '#/components/schemas/TracesDataGenerationJobSource'
- file: '#/components/schemas/FileDataGenerationJobSource'
- description: The base source model for data generation jobs.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobSourceType:
- anyOf:
- - type: string
- - type: string
enum:
- - prompt
- - agent
- - traces
- - file
- description: The supported source types for data generation jobs.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationJobType:
- anyOf:
- - type: string
- - type: string
- enum:
- - simple_qna
- - traces
- - tool_use
- description: The supported data generation job types.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationModelOptions:
- type: object
- required:
- - model
- properties:
- model:
+ - custom_tool_call_output
+ description: The type of the custom tool call output. Always `custom_tool_call_output`.
+ x-stainless-const: true
+ id:
type: string
- description: Base model name used to generate data.
- description: LLM model options for data generation jobs.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataGenerationTokenUsage:
+ description: The unique ID of the custom tool call output in the OpenAI platform.
+ call_id:
+ type: string
+ description: The call ID, used to map this custom tool call output to a custom tool call.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the custom tool call generated by your code.
+ Can be a string or an list of output content.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ title: ResponseCustomToolCallOutputItem
+ OpenAI.ConversationItemCustomToolCallResource:
type: object
required:
- - prompt_tokens
- - completion_tokens
- - total_tokens
+ - type
+ - call_id
+ - name
+ - input
+ - status
properties:
- prompt_tokens:
- type: integer
- format: int64
- description: The number of prompt tokens used.
- readOnly: true
- completion_tokens:
- type: integer
- format: int64
- description: The number of completion tokens generated.
- readOnly: true
- total_tokens:
- type: integer
- format: int64
- description: Total number of tokens used.
- readOnly: true
- description: Token usage information for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DataSourceConfig:
+ type:
+ type: string
+ enum:
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
+ type: string
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
+ type: string
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ title: ResponseCustomToolCallItem
+ OpenAI.ConversationItemFileSearchToolCall:
type: object
required:
+ - id
- type
- - schema
+ - status
+ - queries
properties:
+ id:
+ type: string
+ description: The unique ID of the file search tool call.
type:
type: string
- description: The data source type discriminator.
- schema:
- type: object
- unevaluatedProperties: {}
- description: The overall object JSON schema for the run data source items.
- discriminator:
- propertyName: type
- mapping:
- azure_ai_source: '#/components/schemas/AzureAIDataSourceConfig'
- description: Base class for run data sources with discriminator support.
- DatasetDataGenerationJobOutput:
+ enum:
+ - file_search_call
+ description: The type of the file search tool call. Always `file_search_call`.
+ x-stainless-const: true
+ status:
+ type: string
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - incomplete
+ - failed
+ description: |-
+ The status of the file search tool call. One of `in_progress`,
+ `searching`, `incomplete` or `failed`,
+ queries:
+ type: array
+ items:
+ type: string
+ description: The queries used to search for files.
+ results:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ The results of a file search tool call. See the
+ [file search guide](/docs/guides/tools-file-search) for more information.
+ title: File search tool call
+ OpenAI.ConversationItemFunctionShellCall:
type: object
required:
- type
+ - id
+ - call_id
+ - action
+ - status
+ - environment
properties:
type:
type: string
enum:
- - dataset
- description: Dataset output.
+ - shell_call
+ description: The type of the item. Always `shell_call`.
+ x-stainless-const: true
+ default: shell_call
id:
type: string
- description: The id of the output dataset created.
- readOnly: true
- name:
- type: string
- description: The name of the output dataset.
- readOnly: true
- version:
+ description: The unique ID of the shell tool call. Populated when this item is returned via API.
+ call_id:
type: string
- description: The version of the output dataset.
- readOnly: true
- description:
+ description: The unique ID of the shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.FunctionShellAction'
+ description: The shell commands and limits that describe how to run the tool call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
+ description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
+ environment:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ - type: 'null'
+ created_by:
type: string
- description: Description of the output dataset.
- readOnly: true
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary of the output dataset.
- readOnly: true
+ description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/DataGenerationJobOutput'
- description: Dataset output for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- DatasetEvaluationSuiteJobSource:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A tool call that executes one or more shell commands in a managed environment.
+ title: Shell tool call
+ OpenAI.ConversationItemFunctionShellCallOutput:
type: object
required:
- type
- - name
+ - id
+ - call_id
+ - status
+ - output
+ - max_output_length
properties:
- description:
- type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
type:
type: string
enum:
- - dataset
- description: The source type for this source, which is Dataset.
- name:
+ - shell_call_output
+ description: The type of the shell call output. Always `shell_call_output`.
+ x-stainless-const: true
+ default: shell_call_output
+ id:
type: string
- description: The name of the dataset.
- version:
+ description: The unique ID of the shell call output. Populated when this item is returned via API.
+ call_id:
type: string
- description: The version of the dataset. If not specified, the latest version is used.
+ description: The unique ID of the shell tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
+ description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
+ description: An array of shell call output contents
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/EvaluationSuiteJobSource'
- description: Dataset source for evaluation suite generation jobs — reference to a dataset.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- DatasetEvaluatorGenerationJobSource:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output of a shell tool call that was emitted.
+ title: Shell call output
+ OpenAI.ConversationItemFunctionToolCall:
type: object
required:
+ - id
- type
+ - call_id
- name
+ - arguments
properties:
- description:
+ id:
type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ description: The unique ID of the function tool call.
+ readOnly: true
type:
type: string
enum:
- - dataset
- description: The source type for this source, which is Dataset.
- name:
+ - function_call
+ description: The type of the function tool call. Always `function_call`.
+ x-stainless-const: true
+ call_id:
type: string
- description: The name of the dataset.
- version:
+ description: The unique ID of the function tool call generated by the model.
+ namespace:
type: string
- description: The version of the dataset. If not specified, the latest version is used.
- allOf:
- - $ref: '#/components/schemas/EvaluatorGenerationJobSource'
- description: Dataset source for evaluator generation jobs — reference to a dataset.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- DatasetReference:
- type: object
- required:
- - name
- - version
- properties:
+ description: The namespace of the function to run.
name:
type: string
- description: Dataset name.
- version:
+ description: The name of the function to run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the function.
+ status:
type: string
- description: Dataset version.
- description: Reference to a versioned Foundry Dataset.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- DatasetType:
- anyOf:
- - type: string
- - type: string
enum:
- - uri_file
- - uri_folder
- description: Enum to determine the type of data.
- DatasetVersion:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ A tool call to run a function. See the
+ [function calling guide](/docs/guides/function-calling) for more information.
+ title: Function tool call
+ OpenAI.ConversationItemFunctionToolCallOutput:
type: object
required:
- - dataUri
+ - id
- type
- - name
- - version
+ - call_id
+ - output
properties:
- dataUri:
- type: string
- minLength: 1
- pattern: '[a-zA-Z0-9_]'
- description: URI of the data ([example](https://go.microsoft.com/fwlink/?linkid=2202330))
- type:
- $ref: '#/components/schemas/DatasetType'
- description: Dataset type
- isReference:
- type: boolean
- description: Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted
- readOnly: true
- connectionName:
- type: string
- description: The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset
id:
type: string
- description: Asset ID, a unique identifier for the asset
+ description: |-
+ The unique ID of the function tool call output. Populated when this item
+ is returned via API.
readOnly: true
- name:
+ type:
type: string
- description: The name of the resource
- readOnly: true
- version:
+ enum:
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
+ x-stainless-const: true
+ call_id:
type: string
- description: The version of the resource
- readOnly: true
- discriminator:
- propertyName: type
- mapping:
- uri_file: '#/components/schemas/FileDatasetVersion'
- uri_folder: '#/components/schemas/FolderDatasetVersion'
- description: DatasetVersion Definition
- DatasetVersionUpdate:
+ description: The unique ID of the function tool call generated by the model.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the function call generated by your code.
+ Can be a string or an list of output content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.ConversationItemImageGenToolCall:
type: object
required:
- type
+ - id
+ - status
+ - result
properties:
type:
- $ref: '#/components/schemas/DatasetType'
- description: Dataset type
- description:
type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- discriminator:
- propertyName: type
- mapping:
- uri_file: '#/components/schemas/FileDatasetVersionUpdate'
- uri_folder: '#/components/schemas/FolderDatasetVersionUpdate'
- description: DatasetVersion Definition
- DayOfWeek:
- anyOf:
- - type: string
- - type: string
enum:
- - Sunday
- - Monday
- - Tuesday
- - Wednesday
- - Thursday
- - Friday
- - Saturday
- description: Days of the week for recurrence schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- DeleteAgentResponse:
- type: object
- required:
- - object
- - name
- - deleted
- properties:
- object:
+ - image_generation_call
+ description: The type of the image generation call. Always `image_generation_call`.
+ x-stainless-const: true
+ id:
type: string
- enum:
- - agent.deleted
- description: The object type. Always 'agent.deleted'.
- name:
+ description: The unique ID of the image generation call.
+ status:
type: string
- description: The name of the agent.
- deleted:
- type: boolean
- description: Whether the agent was successfully deleted.
- description: A deleted agent Object
- DeleteAgentVersionResponse:
+ enum:
+ - in_progress
+ - completed
+ - generating
+ - failed
+ description: The status of the image generation call.
+ result:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: An image generation request made by the model.
+ title: Image generation call
+ OpenAI.ConversationItemList:
type: object
required:
- object
- - name
- - version
- - deleted
+ - data
+ - has_more
+ - first_id
+ - last_id
properties:
object:
type: string
enum:
- - agent.version.deleted
- description: The object type. Always 'agent.version.deleted'.
- name:
+ - list
+ description: The type of object returned, must be `list`.
+ x-stainless-const: true
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A list of conversation items.
+ x-ms-list-page-items: true
+ has_more:
+ type: boolean
+ description: Whether there are more items available.
+ first_id:
type: string
- description: The name of the agent.
- version:
+ description: The ID of the first item in the list.
+ last_id:
type: string
- description: The version identifier of the agent.
- deleted:
- type: boolean
- description: Whether the agent was successfully deleted.
- description: A deleted agent version Object
- DeleteEvalResponse:
+ description: The ID of the last item in the list.
+ x-ms-list-continuation-token: true
+ description: A list of Conversation items.
+ title: The conversation item list
+ x-oaiMeta:
+ name: The item list
+ group: conversations
+ OpenAI.ConversationItemLocalShellToolCall:
type: object
required:
- - object
- - eval_id
- - deleted
+ - type
+ - id
+ - call_id
+ - action
+ - status
properties:
- object:
+ type:
type: string
enum:
- - eval.deleted
- description: The object type. Always 'eval.deleted'.
- eval_id:
+ - local_shell_call
+ description: The type of the local shell call. Always `local_shell_call`.
+ x-stainless-const: true
+ id:
type: string
- description: id of the eval.
- deleted:
- type: boolean
- description: Whether the eval was successfully deleted.
- description: A deleted evaluation Object
- DeleteEvalRunResponse:
- type: object
- properties:
- object:
+ description: The unique ID of the local shell call.
+ call_id:
type: string
- enum:
- - eval.deleted
- description: The object type. Always 'eval.deleted'.
- run_id:
+ description: The unique ID of the local shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
+ status:
type: string
- description: id of the eval.
- deleted:
- type: boolean
- description: Whether the eval was successfully deleted.
- description: A deleted evaluation run Object.
- DeleteMemoryResponse:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: The status of the local shell call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A tool call to run a command on the local shell.
+ title: Local shell call
+ OpenAI.ConversationItemLocalShellToolCallOutput:
type: object
required:
- - object
- - memory_id
- - deleted
+ - type
+ - id
+ - output
properties:
- object:
+ type:
type: string
enum:
- - memory_store.item.deleted
- description: The object type. Always 'memory_store.item.deleted'.
- memory_id:
+ - local_shell_call_output
+ description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ x-stainless-const: true
+ id:
type: string
- description: The unique ID of the deleted memory item.
- deleted:
- type: boolean
- description: Whether the memory item was successfully deleted.
- description: Response for deleting a memory item from a memory store.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- DeleteMemoryStoreResponse:
+ description: The unique ID of the local shell tool call generated by the model.
+ output:
+ type: string
+ description: A JSON string of the output of the local shell tool call.
+ status:
+ anyOf:
+ - type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: The output of a local shell tool call.
+ title: Local shell call output
+ OpenAI.ConversationItemMcpApprovalRequest:
type: object
required:
- - object
+ - type
+ - id
+ - server_label
- name
- - deleted
+ - arguments
properties:
- object:
+ type:
type: string
enum:
- - memory_store.deleted
- description: The object type. Always 'memory_store.deleted'.
+ - mcp_approval_request
+ description: The type of the item. Always `mcp_approval_request`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the approval request.
+ server_label:
+ type: string
+ description: The label of the MCP server making the request.
name:
type: string
- description: The name of the memory store.
- deleted:
- type: boolean
- description: Whether the memory store was successfully deleted.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- DeleteResponseResult:
+ description: The name of the tool to run.
+ arguments:
+ type: string
+ description: A JSON string of arguments for the tool.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A request for human approval of a tool invocation.
+ title: MCP approval request
+ OpenAI.ConversationItemMcpApprovalResponseResource:
type: object
required:
+ - type
- id
- - object
- - deleted
+ - approval_request_id
+ - approve
properties:
- id:
- type: string
- description: The operation ID.
- object:
+ type:
type: string
enum:
- - response
- description: Always return 'response'.
- deleted:
- type: boolean
- enum:
- - true
- description: Always return true
- description: The result of a delete response operation.
- DeleteSkillResponse:
- type: object
- required:
- - id
- - name
- - deleted
- properties:
+ - mcp_approval_response
+ description: The type of the item. Always `mcp_approval_response`.
+ x-stainless-const: true
id:
type: string
- description: The unique identifier of the deleted skill.
- name:
- $ref: '#/components/schemas/SkillName'
- description: The unique name of the skill.
- deleted:
+ description: The unique ID of the approval response
+ approval_request_id:
+ type: string
+ description: The ID of the approval request being answered.
+ approve:
type: boolean
- description: Whether the skill was successfully deleted.
- description: A deleted skill.
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- DeleteSkillVersionResponse:
+ description: Whether the request was approved.
+ reason:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A response to an MCP approval request.
+ title: MCP approval response
+ OpenAI.ConversationItemMcpListTools:
type: object
required:
+ - type
- id
- - name
- - deleted
- - version
+ - server_label
+ - tools
properties:
+ type:
+ type: string
+ enum:
+ - mcp_list_tools
+ description: The type of the item. Always `mcp_list_tools`.
+ x-stainless-const: true
id:
type: string
- description: The unique identifier of the deleted skill version.
- name:
- $ref: '#/components/schemas/SkillName'
- description: The name of the skill.
- deleted:
- type: boolean
- description: Whether the skill version was successfully deleted.
- version:
+ description: The unique ID of the list.
+ server_label:
type: string
- description: The version that was deleted.
- description: A deleted skill version.
- x-ms-foundry-meta:
- required_previews:
- - Skills=V1Preview
- Deployment:
+ description: The label of the MCP server.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
+ description: The tools available on the server.
+ error:
+ $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A list of tools available on an MCP server.
+ title: MCP list tools
+ OpenAI.ConversationItemMcpToolCall:
type: object
required:
- type
+ - id
+ - server_label
- name
+ - arguments
properties:
type:
- $ref: '#/components/schemas/DeploymentType'
- description: The type of the deployment
- name:
type: string
- description: Name of the deployment
- readOnly: true
- discriminator:
- propertyName: type
- mapping:
- ModelDeployment: '#/components/schemas/ModelDeployment'
- description: Model Deployment Definition
- DeploymentType:
- anyOf:
- - type: string
- - type: string
enum:
- - ModelDeployment
- DeveloperMessage:
+ - mcp_call
+ description: The type of the item. Always `mcp_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the tool call.
+ server_label:
+ type: string
+ description: The label of the MCP server running the tool.
+ name:
+ type: string
+ description: The name of the tool that was run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments passed to the tool.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ error:
+ type: object
+ unevaluatedProperties: {}
+ status:
+ $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
+ description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
+ approval_request_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: An invocation of a tool on an MCP server.
+ title: MCP tool call
+ OpenAI.ConversationItemMessage:
type: object
required:
+ - type
+ - id
+ - status
- role
- content
properties:
- role:
+ type:
type: string
enum:
- - developer
- description: Indicates this is a developer message.
- content:
+ - message
+ description: The type of the message. Always set to `message`.
+ x-stainless-const: true
+ default: message
+ id:
type: string
- description: Content provided by a developer to guide model behavior in an evaluation context.
+ description: The unique ID of the message.
+ status:
+ $ref: '#/components/schemas/OpenAI.MessageStatus'
+ description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: The content of the message
+ phase:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/Message'
- description: A message authored by a developer to guide the model during evaluation.
- Dimension:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: A message to or from the model.
+ title: Message
+ OpenAI.ConversationItemReasoningItem:
type: object
required:
+ - type
- id
- - description
- - weight
+ - summary
properties:
+ type:
+ type: string
+ enum:
+ - reasoning
+ description: The type of the object. Always `reasoning`.
+ x-stainless-const: true
id:
type: string
- description: Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. Provided by the user when manually creating a rubric evaluator or during human-in-the-loop review of a generated set; the generation pipeline produces an initial value the user can edit. Editable when saving new versions.
- description:
+ description: The unique identifier of the reasoning content.
+ encrypted_content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ summary:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: Reasoning summary content.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
+ description: Reasoning text content.
+ status:
type: string
- description: What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and pursues the appropriate workflow').
- weight:
- type: integer
- format: int32
- minimum: 1
- maximum: 10
- description: Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension weight 8-10; all others use 1-6. User edits are not constrained by this heuristic.
- always_applicable:
- type: boolean
- description: When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is not specified by the caller.
- default: false
- description: A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- DispatchRoutineRequest:
- type: object
- properties:
- payload:
- $ref: '#/components/schemas/RoutineDispatchPayload'
- description: A direct action-input override sent downstream when testing a routine.
- description: Request body for the public dispatch_async route.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- DispatchRoutineResponse:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ A description of the chain of thought used by a reasoning model while generating
+ a response. Be sure to include these items in your `input` to the Responses API
+ for subsequent turns of a conversation if you are manually
+ [managing context](/docs/guides/conversation-state).
+ title: Reasoning
+ OpenAI.ConversationItemToolSearchCall:
type: object
+ required:
+ - type
+ - id
+ - call_id
+ - execution
+ - arguments
+ - status
properties:
- dispatch_id:
+ type:
type: string
- description: The dispatch identifier created for the routine dispatch.
- action_correlation_id:
+ enum:
+ - tool_search_call
+ description: The type of the item. Always `tool_search_call`.
+ x-stainless-const: true
+ default: tool_search_call
+ id:
type: string
- description: A downstream action correlation identifier, when available.
- task_id:
+ description: The unique ID of the tool search call item.
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ arguments:
+ description: Arguments used for the tool search call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: The status of the tool search call item that was recorded.
+ created_by:
type: string
- description: A workspace task identifier created for the dispatch, when available.
- description: Identifiers returned after a routine dispatch is queued.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- EndpointBasedEvaluatorDefinition:
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ OpenAI.ConversationItemToolSearchOutput:
type: object
required:
- type
- - connection_name
+ - id
+ - call_id
+ - execution
+ - tools
+ - status
properties:
type:
type: string
enum:
- - endpoint
- connection_name:
+ - tool_search_output
+ description: The type of the item. Always `tool_search_output`.
+ x-stainless-const: true
+ default: tool_search_output
+ id:
type: string
- minLength: 1
- description: "Name of the Project Connection that stores the endpoint URL and credentials. The connection must exist on the project and have a non-empty target URL. Supported auth types: ApiKey (sends `api-key` header) and AAD/Entra ID (acquires a bearer token via the project's Managed Identity)."
+ description: The unique ID of the tool search output item.
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The loaded tool definitions returned by tool search.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: The status of the tool search output item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/EvaluatorDefinition'
- description: Endpoint-based evaluator definition. The customer owns and hosts an HTTP endpoint that implements the evaluation contract. The evaluator references a Project Connection by name; the connection stores the endpoint URL and credentials (API Key or Entra ID). At execution time, the service resolves the connection to obtain the endpoint URL and authentication details, then calls the endpoint for each evaluation row.
- EntraAuthorizationScheme:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ OpenAI.ConversationItemType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - message
+ - function_call
+ - function_call_output
+ - file_search_call
+ - web_search_call
+ - image_generation_call
+ - computer_call
+ - computer_call_output
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - reasoning
+ - compaction
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - mcp_call
+ - custom_tool_call
+ - custom_tool_call_output
+ OpenAI.ConversationItemWebSearchToolCall:
type: object
required:
+ - id
- type
+ - status
+ - action
properties:
+ id:
+ type: string
+ description: The unique ID of the web search tool call.
type:
type: string
enum:
- - Entra
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
+ x-stainless-const: true
+ status:
+ type: string
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - failed
+ - incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ description: |-
+ 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_in_page).
allOf:
- - $ref: '#/components/schemas/AgentEndpointAuthorizationScheme'
- EntraIDCredentials:
+ - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ description: |-
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.ConversationParam:
+ oneOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.ConversationParam-2'
+ description: |-
+ The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.
+ Input items and output items from this response are automatically added to this conversation after this response completes.
+ OpenAI.ConversationParam-2:
type: object
required:
- - type
+ - id
properties:
- type:
+ id:
type: string
- enum:
- - AAD
- description: The credential type
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: Entra ID credential definition
- Eval:
+ description: The unique ID of the conversation.
+ description: The conversation that this response belongs to.
+ title: Conversation object
+ OpenAI.ConversationReference:
type: object
required:
- - object
- id
- - name
- - data_source_config
- - testing_criteria
- - created_at
+ properties:
+ id:
+ type: string
+ description: The unique ID of the conversation that this response was associated with.
+ description: The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
+ title: Conversation
+ OpenAI.ConversationResource:
+ type: object
+ required:
+ - id
+ - object
- metadata
+ - created_at
properties:
+ id:
+ type: string
+ description: The unique ID of the conversation.
object:
type: string
enum:
- - eval
- description: The object type.
+ - conversation
+ description: The object type, which is always `conversation`.
x-stainless-const: true
- default: eval
- id:
- type: string
- description: Unique identifier for the evaluation.
- name:
- type: string
- description: The name of the evaluation.
- data_source_config:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig'
- - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig'
- - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig'
- - $ref: '#/components/schemas/AzureAIDataSourceConfig'
- - $ref: '#/components/schemas/AzureAIBenchmarkDataSourceConfig'
- description: Configuration of data sources used in runs of the evaluation.
- testing_criteria:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
- - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
- - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
- - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
- description: A list of testing criteria.
+ default: conversation
+ metadata:
+ $ref: '#/components/schemas/OpenAI.Metadata'
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
created_at:
type: integer
format: unixtime
- description: The Unix timestamp (in seconds) for when the eval was created.
+ description: The time at which the conversation was created, measured in seconds since the Unix epoch.
+ OpenAI.CoordParam:
+ type: object
+ required:
+ - x
+ - 'y'
+ properties:
+ x:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The x-coordinate.
+ 'y':
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The y-coordinate.
+ description: 'An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.'
+ title: Coordinate
+ OpenAI.CreateAssistantRequest:
+ type: object
+ required:
+ - model
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.AssistantSupportedModels'
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ x-oaiTypeLabel: string
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ maxItems: 128
+ description: 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`.
+ default: []
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResources'
+ - type: 'null'
metadata:
anyOf:
- $ref: '#/components/schemas/OpenAI.Metadata'
- type: 'null'
- modified_at:
- $ref: '#/components/schemas/integer'
- description: Unix timestamp (in seconds) when the evaluation run was last modified.
- created_by:
- type: string
- description: the name of the person who created the run.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- description: |-
- 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
- title: Eval
- x-oaiMeta:
- name: The eval object
- group: evals
- example: |
- {
- "object": "eval",
- "id": "eval_67abd54d9b0081909a86353f6fb9317a",
- "data_source_config": {
- "type": "custom",
- "item_schema": {
- "type": "object",
- "properties": {
- "label": {"type": "string"},
- },
- "required": ["label"]
- },
- "include_sample_schema": true
- },
- "testing_criteria": [
- {
- "name": "My string check grader",
- "type": "string_check",
- "input": "{{sample.output_text}}",
- "reference": "{{item.label}}",
- "operation": "eq",
- }
- ],
- "name": "External Data Eval",
- "created_at": 1739314509,
- "metadata": {
- "test": "synthetics",
- }
- }
- EvalCsvFileIdSource:
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ response_format:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ - type: 'null'
+ OpenAI.CreateAssistantRequestToolResources:
+ type: object
+ properties:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearch'
+ OpenAI.CreateAssistantRequestToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 20
+ OpenAI.CreateAssistantRequestToolResourcesFileSearch:
+ type: object
+ properties:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ vector_stores:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStores'
+ maxItems: 1
+ OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStores:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 100000000
+ chunking_strategy:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto'
+ - $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto:
type: object
required:
- type
- - id
properties:
type:
type: string
enum:
- - file_id
- description: The type of source, always `file_id`.
- id:
- type: string
- description: The identifier of the uploaded CSV file.
- description: Represents a reference to an uploaded CSV file used as a source for evaluation data.
- EvalCsvRunDataSource:
+ - auto
+ x-stainless-const: true
+ OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic:
type: object
required:
- type
- - source
+ - static
properties:
type:
type: string
enum:
- - csv
- description: The type of data source, always `csv`.
- source:
- $ref: '#/components/schemas/EvalCsvFileIdSource'
- description: The source of the CSV data, either inline content or a file reference.
- allOf:
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Represents a CSV data source for evaluation runs.
- EvalResult:
+ - static
+ x-stainless-const: true
+ static:
+ $ref: '#/components/schemas/OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic'
+ OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic:
type: object
required:
- - name
- - type
- - score
- - passed
+ - max_chunk_size_tokens
+ - chunk_overlap_tokens
properties:
- name:
+ max_chunk_size_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 100
+ maximum: 4096
+ chunk_overlap_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CreateBatchParametersBody:
+ type: object
+ required:
+ - input_file_id
+ - endpoint
+ - completion_window
+ properties:
+ input_file_id:
type: string
- description: name of the check
- type:
+ endpoint:
type: string
- description: type of the check
- score:
- type: number
- format: float
- description: score
- passed:
- type: boolean
- description: indicates if the check passed or failed
- description: Result of the evaluation.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvalRun:
+ enum:
+ - /v1/responses
+ - /v1/chat/completions
+ - /v1/embeddings
+ - /v1/completions
+ - /v1/moderations
+ - /v1/images/generations
+ - /v1/images/edits
+ - /v1/videos
+ completion_window:
+ type: string
+ enum:
+ - 24h
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ output_expires_after:
+ $ref: '#/components/schemas/OpenAI.BatchFileExpirationAfter'
+ OpenAI.CreateChatCompletionRequest:
type: object
required:
- - object
- - id
- - eval_id
- - status
+ - messages
- model
- - name
- - created_at
- - report_url
- - result_counts
- - per_model_usage
- - per_testing_criteria_results
- - data_source
- - metadata
- - error
properties:
- object:
- type: string
- enum:
- - eval.run
- description: The type of the object. Always "eval.run".
- x-stainless-const: true
- default: eval.run
- id:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ top_logprobs:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ user:
type: string
- description: Unique identifier for the evaluation run.
- eval_id:
+ description: |-
+ 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](/docs/guides/safety-best-practices#safety-identifiers).
+ deprecated: true
+ safety_identifier:
type: string
- description: The identifier of the associated evaluation.
- status:
+ maxLength: 64
+ description: |-
+ 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
+ prompt_cache_key:
type: string
- description: The status of the evaluation run.
+ description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
+ service_tier:
+ $ref: '#/components/schemas/OpenAI.ServiceTier'
+ prompt_cache_retention:
+ anyOf:
+ - type: string
+ enum:
+ - in_memory
+ - 24h
+ - type: 'null'
+ messages:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage'
+ minItems: 1
+ description: |-
+ A list of messages comprising the conversation so far. Depending on the
+ [model](/docs/models) you use, different message types (modalities) are
+ supported, like [text](/docs/guides/text-generation),
+ [images](/docs/guides/vision), and [audio](/docs/guides/audio).
model:
type: string
- description: The model that is evaluated, if applicable.
- name:
- type: string
- description: The name of the evaluation run.
- created_at:
- type: integer
- format: unixtime
- description: Unix timestamp (in seconds) when the evaluation run was created.
- report_url:
- type: string
- format: uri
- description: The URL to the rendered evaluation run report on the UI dashboard.
- result_counts:
- $ref: '#/components/schemas/OpenAI.EvalRunResultCounts'
- description: Counters summarizing the outcomes of the evaluation run.
- per_model_usage:
+ description: The model deployment to use for this chat completion.
+ modalities:
+ $ref: '#/components/schemas/OpenAI.ResponseModalities'
+ verbosity:
+ $ref: '#/components/schemas/OpenAI.Verbosity'
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ max_completion_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).
+ frequency_penalty:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: -2
+ maximum: 2
+ description: |-
+ 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.
+ presence_penalty:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: -2
+ maximum: 2
+ description: |-
+ 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.
+ web_search_options:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestWebSearchOptions'
+ description: |-
+ This tool searches the web for relevant results to use in a response.
+ Learn more about the [web search tool](/docs/guides/tools-web-search?api-mode=chat).
+ title: Web search
+ response_format:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
+ description: |-
+ 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](/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.
+ audio:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestAudio'
+ - type: 'null'
+ description: |-
+ Parameters for audio output. Required when audio output is requested with
+ `modalities: ["audio"]`. [Learn more](/docs/guides/audio).
+ store:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: |-
+ Whether or not to store the output of this chat completion request for
+ use in our [model distillation](/docs/guides/distillation) or
+ [evals](/docs/guides/evals) products.
+ Supports text and image inputs. Note: image inputs over 8MB will be dropped.
+ moderation:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ModerationParam'
+ - type: 'null'
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: |-
+ 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](/docs/api-reference/chat/streaming)
+ for more information, along with the [streaming responses](/docs/guides/streaming-responses)
+ guide for more information on how to handle the streaming events.
+ stop:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.StopConfiguration'
+ - type: 'null'
+ logit_bias:
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: |-
+ 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.
+ x-oaiTypeLabel: map
+ logprobs:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: |-
+ 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`.
+ max_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: |-
+ 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](/docs/guides/reasoning).
+ deprecated: true
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 1
+ maximum: 128
+ description: 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.
+ default: 1
+ prediction:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.PredictionContent'
+ - type: 'null'
+ description: |-
+ Configuration for a [Predicted Output](/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.
+ seed:
+ anyOf:
+ - type: integer
+ format: int64
+ - type: 'null'
+ description: |-
+ 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: true
+ x-oaiMeta:
+ beta: true
+ stream_options:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamOptions'
+ - type: 'null'
+ tools:
type: array
items:
- $ref: '#/components/schemas/OpenAI.EvalRunPerModelUsage'
- description: Usage statistics for each model during the evaluation run.
- per_testing_criteria_results:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionTool'
+ - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletions'
+ description: |-
+ A list of tools the model may call. You can provide either
+ [custom tools](/docs/guides/function-calling#custom-tools) or
+ [function tools](/docs/guides/function-calling).
+ tool_choice:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionToolChoiceOption'
+ parallel_tool_calls:
+ type: boolean
+ description: Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
+ default: true
+ function_call:
+ oneOf:
+ - type: string
+ enum:
+ - none
+ - auto
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionFunctionCallOption'
+ description: |-
+ 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: true
+ functions:
type: array
items:
- $ref: '#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults'
- description: Results per testing criteria applied during the evaluation run.
- data_source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource'
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource'
- - $ref: '#/components/schemas/EvalRunDataSource'
- description: Information about the run's data source.
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- error:
- $ref: '#/components/schemas/OpenAI.EvalApiError'
- modified_at:
- $ref: '#/components/schemas/integer'
- description: Unix timestamp (in seconds) when the evaluation run was last modified.
- created_by:
- type: string
- description: the name of the person who created the run.
- properties:
- type: object
- unevaluatedProperties:
- type: string
+ $ref: '#/components/schemas/OpenAI.ChatCompletionFunctions'
+ minItems: 1
+ maxItems: 128
description: |-
- Set of immutable 16 key-value pairs that can be attached to an object for storing additional information.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- evaluation_level:
- $ref: '#/components/schemas/EvaluationLevel'
- description: The level at which evaluation is performed. Defaults to 'turn' if not specified.
- default: turn
- description: A schema representing an evaluation run.
- title: EvalRun
- x-oaiMeta:
- name: The eval run object
- group: evals
- example: |
- {
- "object": "eval.run",
- "id": "evalrun_67e57965b480819094274e3a32235e4c",
- "eval_id": "eval_67e579652b548190aaa83ada4b125f47",
- "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c",
- "status": "queued",
- "model": "gpt-4o-mini",
- "name": "gpt-4o-mini",
- "created_at": 1743092069,
- "result_counts": {
- "total": 0,
- "errored": 0,
- "failed": 0,
- "passed": 0
- },
- "per_model_usage": null,
- "per_testing_criteria_results": null,
- "data_source": {
- "type": "completions",
- "source": {
- "type": "file_content",
- "content": [
- {
- "item": {
- "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
- "ground_truth": "Technology"
- }
- },
- {
- "item": {
- "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
- "ground_truth": "Markets"
- }
- },
- {
- "item": {
- "input": "International Summit Addresses Climate Change Strategies",
- "ground_truth": "World"
- }
- },
- {
- "item": {
- "input": "Major Retailer Reports Record-Breaking Holiday Sales",
- "ground_truth": "Business"
- }
- },
- {
- "item": {
- "input": "National Team Qualifies for World Championship Finals",
- "ground_truth": "Sports"
- }
- },
- {
- "item": {
- "input": "Stock Markets Rally After Positive Economic Data Released",
- "ground_truth": "Markets"
- }
- },
- {
- "item": {
- "input": "Global Manufacturer Announces Merger with Competitor",
- "ground_truth": "Business"
- }
- },
- {
- "item": {
- "input": "Breakthrough in Renewable Energy Technology Unveiled",
- "ground_truth": "Technology"
- }
- },
- {
- "item": {
- "input": "World Leaders Sign Historic Climate Agreement",
- "ground_truth": "World"
- }
- },
- {
- "item": {
- "input": "Professional Athlete Sets New Record in Championship Event",
- "ground_truth": "Sports"
- }
- },
- {
- "item": {
- "input": "Financial Institutions Adapt to New Regulatory Requirements",
- "ground_truth": "Business"
- }
- },
- {
- "item": {
- "input": "Tech Conference Showcases Advances in Artificial Intelligence",
- "ground_truth": "Technology"
- }
- },
- {
- "item": {
- "input": "Global Markets Respond to Oil Price Fluctuations",
- "ground_truth": "Markets"
- }
- },
- {
- "item": {
- "input": "International Cooperation Strengthened Through New Treaty",
- "ground_truth": "World"
- }
- },
- {
- "item": {
- "input": "Sports League Announces Revised Schedule for Upcoming Season",
- "ground_truth": "Sports"
- }
- }
- ]
- },
- "input_messages": {
- "type": "template",
- "template": [
- {
- "type": "message",
- "role": "developer",
- "content": {
- "type": "input_text",
- "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
-
- # Steps
-
- 1. Analyze the content of the news headline to understand its primary focus.
- 2. Extract the subject matter, identifying any key indicators or keywords.
- 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
- 4. Ensure only one category is selected per headline.
-
- # Output Format
-
- Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
-
- # Examples
-
- **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
- **Output**: "Technology"
-
- **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
- **Output**: "Markets"
-
- **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
- **Output**: "World"
-
- **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
- **Output**: "Business"
-
- **Input**: "Manchester United Secures Win in Premier League Football Match"
- **Output**: "Sports"
-
- # Notes
-
- - If the headline appears to fit into more than one category, choose the most dominant theme.
- - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
- "
- }
- },
- {
- "type": "message",
- "role": "user",
- "content": {
- "type": "input_text",
- "text": "{{item.input}}"
- }
- }
- ]
- },
- "model": "gpt-4o-mini",
- "sampling_params": {
- "seed": 42,
- "temperature": 1.0,
- "top_p": 1.0,
- "max_completions_tokens": 2048
- }
- },
- "error": null,
- "metadata": {}
- }
- EvalRunDataSource:
+ Deprecated in favor of `tools`.
+ A list of functions the model may generate JSON inputs for.
+ deprecated: true
+ user_security_context:
+ $ref: '#/components/schemas/AzureUserSecurityContext'
+ description: User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.
+ OpenAI.CreateChatCompletionRequestAudio:
+ type: object
+ required:
+ - voice
+ - format
+ properties:
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsOrCustomVoice'
+ format:
+ type: string
+ enum:
+ - wav
+ - aac
+ - mp3
+ - flac
+ - opus
+ - pcm16
+ OpenAI.CreateChatCompletionRequestResponseFormat:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType'
+ discriminator:
+ propertyName: type
+ mapping:
+ text: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText'
+ json_object: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject'
+ json_schema: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
+ description: |-
+ 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](/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.
+ OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - json_object
+ description: The type of response format being defined. Always `json_object`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
+ description: |-
+ JSON object response format. An older method of generating JSON responses.
+ Using `json_schema` is recommended for models that support it. Note that the
+ model will not generate JSON without a system or user message instructing it
+ to do so.
+ title: JSON object
+ OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText:
type: object
required:
- type
properties:
type:
type: string
- description: The data source type discriminator.
- discriminator:
- propertyName: type
- mapping:
- azure_ai_traces_preview: '#/components/schemas/TracesPreviewEvalRunDataSource'
- azure_ai_synthetic_data_gen_preview: '#/components/schemas/SyntheticDataGenerationPreviewEvalRunDataSource'
- azure_ai_responses: '#/components/schemas/AzureAIResponsesEvalRunDataSource'
- azure_ai_target_completions: '#/components/schemas/TargetCompletionEvalRunDataSource'
- csv: '#/components/schemas/EvalCsvRunDataSource'
- azure_ai_red_team: '#/components/schemas/RedTeamEvalRunDataSource'
- azure_ai_trace_data_source_preview: '#/components/schemas/AzureAITraceDataSourcePreviewEvalRunDataSource'
- azure_ai_benchmark_preview: '#/components/schemas/AzureAIBenchmarkPreviewEvalRunDataSource'
- description: Base class for run data sources with discriminator support.
- EvalRunOutputItem:
+ enum:
+ - text
+ description: The type of response format being defined. Always `text`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
+ description: Default response format. Used to generate text responses.
+ title: Text
+ OpenAI.CreateChatCompletionRequestResponseFormatType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - text
+ - json_schema
+ - json_object
+ OpenAI.CreateChatCompletionRequestWebSearchOptions:
+ type: object
+ properties:
+ user_location:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestWebSearchOptionsUserLocation'
+ - type: 'null'
+ search_context_size:
+ $ref: '#/components/schemas/OpenAI.WebSearchContextSize'
+ OpenAI.CreateChatCompletionRequestWebSearchOptionsUserLocation:
type: object
required:
- - object
- - id
- - run_id
- - eval_id
- - created_at
- - status
- - datasource_item_id
- - datasource_item
- - results
- - sample
+ - type
+ - approximate
properties:
- object:
+ type:
type: string
enum:
- - eval.run.output_item
- description: The type of the object. Always "eval.run.output_item".
+ - approximate
x-stainless-const: true
- default: eval.run.output_item
+ approximate:
+ $ref: '#/components/schemas/OpenAI.WebSearchLocation'
+ OpenAI.CreateChatCompletionResponse:
+ type: object
+ required:
+ - id
+ - choices
+ - created
+ - model
+ - object
+ properties:
id:
type: string
- description: Unique identifier for the evaluation run output item.
- run_id:
- type: string
- description: The identifier of the evaluation run associated with this output item.
- eval_id:
- type: string
- description: The identifier of the evaluation group.
- created_at:
+ description: A unique identifier for the chat completion.
+ choices:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponseChoices'
+ description: A list of chat completion choices. Can be more than one if `n` is greater than 1.
+ created:
type: integer
format: unixtime
- description: Unix timestamp (in seconds) when the evaluation run was created.
- status:
+ description: The Unix timestamp (in seconds) of when the chat completion was created.
+ model:
type: string
- description: The status of the evaluation run.
- datasource_item_id:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The identifier for the data source item.
- datasource_item:
- type: object
- unevaluatedProperties: {}
- description: Details of the input data source item.
- results:
- type: array
- items:
- $ref: '#/components/schemas/EvalRunOutputItemResult'
- description: A list of grader results for this output item.
- sample:
- $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSample'
- description: A sample containing the input and output of the evaluation run.
- description: A schema representing an evaluation run output item.
- title: EvalRunOutputItem
+ description: The model deployment used for the creation of this chat completion.
+ service_tier:
+ $ref: '#/components/schemas/OpenAI.ServiceTier'
+ system_fingerprint:
+ type: string
+ description: |-
+ 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: true
+ object:
+ type: string
+ enum:
+ - chat.completion
+ description: The object type, which is always `chat.completion`.
+ x-stainless-const: true
+ usage:
+ $ref: '#/components/schemas/OpenAI.CompletionUsage'
+ moderation:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionModeration'
+ - type: 'null'
+ description: Represents a chat completion response returned by model, based on the provided input.
x-oaiMeta:
- name: The eval run output item object
- group: evals
+ name: The chat completion object
+ group: chat
example: |
{
- "object": "eval.run.output_item",
- "id": "outputitem_67abd55eb6548190bb580745d5644a33",
- "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
- "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
- "created_at": 1739314509,
- "status": "pass",
- "datasource_item_id": 137,
- "datasource_item": {
- "teacher": "To grade essays, I only check for style, content, and grammar.",
- "student": "I am a student who is trying to write the best essay."
- },
- "results": [
+ "id": "chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG",
+ "object": "chat.completion",
+ "created": 1741570283,
+ "model": "gpt-4o-2024-08-06",
+ "choices": [
{
- "name": "String Check Grader",
- "type": "string-check-grader",
- "score": 1.0,
- "passed": true,
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.",
+ "refusal": null,
+ "annotations": []
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
}
],
- "sample": {
- "input": [
- {
- "role": "system",
- "content": "You are an evaluator bot..."
- },
- {
- "role": "user",
- "content": "You are assessing..."
- }
- ],
- "output": [
- {
- "role": "assistant",
- "content": "The rubric is not clear nor concise."
- }
- ],
- "finish_reason": "stop",
- "model": "gpt-4o-2024-08-06",
- "usage": {
- "total_tokens": 521,
- "completion_tokens": 2,
- "prompt_tokens": 519,
- "cached_tokens": 0
+ "usage": {
+ "prompt_tokens": 1117,
+ "completion_tokens": 46,
+ "total_tokens": 1163,
+ "prompt_tokens_details": {
+ "cached_tokens": 0,
+ "audio_tokens": 0
},
- "error": null,
- "temperature": 1.0,
- "max_completion_tokens": 2048,
- "top_p": 1.0,
- "seed": 42
- }
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "audio_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "service_tier": "default",
+ "system_fingerprint": "fp_fc9f1d7035"
}
- EvalRunOutputItemResult:
+ OpenAI.CreateChatCompletionResponseChoices:
type: object
required:
- - name
- - score
- - passed
+ - finish_reason
+ - index
+ - message
+ - logprobs
properties:
- name:
- type: string
- description: The name of the grader.
- type:
+ finish_reason:
type: string
- description: The grader type (for example, "string-check-grader").
- score:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The numeric score produced by the grader.
- passed:
- type: boolean
- description: Whether the grader considered the output a pass.
- sample:
+ enum:
+ - stop
+ - length
+ - tool_calls
+ - content_filter
+ - function_call
+ index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ message:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessage'
+ logprobs:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponseChoicesLogprobs'
+ - type: 'null'
+ OpenAI.CreateChatCompletionResponseChoicesLogprobs:
+ type: object
+ required:
+ - content
+ - refusal
+ properties:
+ content:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob'
+ - type: 'null'
+ refusal:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob'
+ - type: 'null'
+ OpenAI.CreateCompletionRequest:
+ type: object
+ required:
+ - model
+ - prompt
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - gpt-3.5-turbo-instruct
+ - davinci-002
+ - babbage-002
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ x-oaiTypeLabel: string
+ prompt:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: array
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: |-
+ 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.
+ default: <|endoftext|>
+ best_of:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ maximum: 20
+ description: |-
+ 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`.
+ default: 1
+ echo:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: Echo back the prompt in addition to the completion
+ frequency_penalty:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: -2
+ maximum: 2
+ description: |-
+ 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.](/docs/guides/text-generation)
+ logit_bias:
anyOf:
- type: object
- unevaluatedProperties: {}
+ unevaluatedProperties:
+ $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- description: Optional sample or intermediate data produced by the grader.
- status:
- $ref: '#/components/schemas/EvalRunOutputItemResultStatus'
- description: 'The evaluation status for this result item. Values: "completed", "errored", "skipped". Null if not provided by evaluator. When status is skipped, passed/score can be ignored.'
- metric:
+ description: |-
+ 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.
+ x-oaiTypeLabel: map
+ logprobs:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ maximum: 5
+ description: |-
+ 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.
+ max_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ description: |-
+ 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.
+ default: 16
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 1
+ maximum: 128
+ description: |-
+ 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`.
+ default: 1
+ presence_penalty:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: -2
+ maximum: 2
+ description: |-
+ 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.](/docs/guides/text-generation)
+ seed:
+ anyOf:
+ - type: integer
+ format: int64
+ - type: 'null'
+ description: |-
+ 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.
+ stop:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.StopConfiguration'
+ - type: 'null'
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: '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_options:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamOptions'
+ - type: 'null'
+ suffix:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: |-
+ The suffix that comes after a completion of inserted text.
+ This parameter is only supported for `gpt-3.5-turbo-instruct`.
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 2
+ description: |-
+ 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.
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 1
+ description: |-
+ 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.
+ default: 1
+ user:
type: string
- description: The name of the metric (e.g., "fluency", "f1_score").
- label:
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ OpenAI.CreateCompletionResponse:
+ type: object
+ required:
+ - id
+ - choices
+ - created
+ - model
+ - object
+ properties:
+ id:
type: string
- description: The label associated with the test criteria metric (e.g., "pass", "fail", "good", "bad").
- threshold:
- type: number
- format: float
- description: The threshold used to determine pass/fail for this test criteria, if it is numerical.
- reason:
+ description: A unique identifier for the completion.
+ choices:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateCompletionResponseChoices'
+ description: The list of completion choices the model generated for the input prompt.
+ created:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) of when the completion was created.
+ model:
+ type: string
+ description: The model used for completion.
+ system_fingerprint:
+ type: string
+ description: |-
+ 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.
+ object:
type: string
- description: The reason for the test criteria metric.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: Additional details about the test criteria metric.
- unevaluatedProperties: {}
- description: A single grader result for an evaluation run output item.
- title: EvalRunOutputItemResult
- EvalRunOutputItemResultStatus:
- anyOf:
- - type: string
- - type: string
enum:
- - completed
- - errored
- - skipped
- description: The evaluation status for an evaluation run output item result.
- EvalRunOutputItemSampleInput:
+ - text_completion
+ description: The object type, which is always "text_completion"
+ x-stainless-const: true
+ usage:
+ $ref: '#/components/schemas/OpenAI.CompletionUsage'
+ description: 'Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).'
+ x-oaiMeta:
+ name: The completion object
+ legacy: true
+ example: |
+ {
+ "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
+ "object": "text_completion",
+ "created": 1589478378,
+ "model": "gpt-4-turbo",
+ "choices": [
+ {
+ "text": "
+
+ This is indeed a test",
+ "index": 0,
+ "logprobs": null,
+ "finish_reason": "length"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 5,
+ "completion_tokens": 7,
+ "total_tokens": 12
+ }
+ }
+ OpenAI.CreateCompletionResponseChoices:
type: object
required:
- - role
- - content
- - tool_calls
+ - finish_reason
+ - index
+ - logprobs
+ - text
properties:
- role:
+ finish_reason:
type: string
- content:
+ enum:
+ - stop
+ - length
+ - content_filter
+ index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ logprobs:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateCompletionResponseChoicesLogprobs'
+ - type: 'null'
+ text:
type: string
- tool_calls:
+ OpenAI.CreateCompletionResponseChoicesLogprobs:
+ type: object
+ properties:
+ text_offset:
type: array
items:
- $ref: '#/components/schemas/CompletionMessageToolCallChunk'
- description: Tool calls made within the message, if any.
- description: A message in the evaluation run.
- EvalRunOutputItemSampleOutput:
+ $ref: '#/components/schemas/OpenAI.integer'
+ token_logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ tokens:
+ type: array
+ items:
+ type: string
+ top_logprobs:
+ type: array
+ items:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.CreateContainerBody:
type: object
required:
- - tool_calls
+ - name
properties:
- role:
- type: string
- content:
+ name:
type: string
- tool_calls:
+ description: Name of the container to create.
+ file_ids:
type: array
items:
- $ref: '#/components/schemas/CompletionMessageToolCallChunk'
- description: Tool calls made within the message, if any.
- description: A message in the evaluation run.
- EvalRunResultCompareItem:
+ type: string
+ description: IDs of files to copy to the container.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.CreateContainerBodyExpiresAfter'
+ description: Container expiration time in seconds relative to the 'anchor' time.
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ContainerSkill'
+ description: An optional list of skills referenced by id or inline data.
+ memory_limit:
+ type: string
+ enum:
+ - 1g
+ - 4g
+ - 16g
+ - 64g
+ description: Optional memory limit for the container. Defaults to "1g".
+ network_policy:
+ $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
+ OpenAI.CreateContainerBodyExpiresAfter:
type: object
required:
- - treatmentRunId
- - treatmentRunSummary
- - deltaEstimate
- - pValue
- - treatmentEffect
+ - anchor
+ - minutes
properties:
- treatmentRunId:
+ anchor:
type: string
- description: The treatment run ID.
- treatmentRunSummary:
- $ref: '#/components/schemas/EvalRunResultSummary'
- description: Summary statistics of the treatment run.
- deltaEstimate:
- type: number
- format: float
- description: Estimated difference between treatment and baseline.
- pValue:
- type: number
- format: float
- description: P-value for the treatment effect.
- treatmentEffect:
- $ref: '#/components/schemas/TreatmentEffectType'
- description: Type of treatment effect.
- description: Metric comparison for a treatment against the baseline.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvalRunResultComparison:
+ enum:
+ - last_active_at
+ minutes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CreateContainerFileBody:
+ type: object
+ properties:
+ file_id:
+ type: object
+ description: Name of the file to create.
+ file:
+ type: object
+ description: The File object (not file name) to be uploaded.
+ OpenAI.CreateConversationBody:
+ type: object
+ properties:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ items:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.InputItem'
+ - type: 'null'
+ OpenAI.CreateEmbeddingRequest:
type: object
required:
- - testingCriteria
- - metric
- - evaluator
- - baselineRunSummary
- - compareItems
+ - input
+ - model
properties:
- testingCriteria:
- type: string
- description: Name of the testing criteria.
- metric:
- type: string
- description: Metric being evaluated.
- evaluator:
+ input:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ - type: array
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: 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.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - text-embedding-ada-002
+ - text-embedding-3-small
+ - text-embedding-3-large
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ x-oaiTypeLabel: string
+ encoding_format:
type: string
- description: Name of the evaluator for this testing criteria.
- baselineRunSummary:
- $ref: '#/components/schemas/EvalRunResultSummary'
- description: Summary statistics of the baseline run.
- compareItems:
+ enum:
+ - float
+ - base64
+ description: The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).
+ default: float
+ dimensions:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 1
+ description: The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.
+ user:
+ type: string
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ OpenAI.CreateEmbeddingResponse:
+ type: object
+ required:
+ - data
+ - model
+ - object
+ - usage
+ properties:
+ data:
type: array
items:
- $ref: '#/components/schemas/EvalRunResultCompareItem'
- description: List of comparison results for each treatment run.
- description: Comparison results for treatment runs against the baseline.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvalRunResultSummary:
+ $ref: '#/components/schemas/OpenAI.Embedding'
+ description: The list of embeddings generated by the model.
+ model:
+ type: string
+ description: The name of the model used to generate the embedding.
+ object:
+ type: string
+ enum:
+ - list
+ description: The object type, which is always "list".
+ x-stainless-const: true
+ usage:
+ $ref: '#/components/schemas/OpenAI.CreateEmbeddingResponseUsage'
+ description: The usage information for the request.
+ OpenAI.CreateEmbeddingResponseUsage:
type: object
required:
- - runId
- - sampleCount
- - average
- - standardDeviation
+ - prompt_tokens
+ - total_tokens
properties:
- runId:
- type: string
- description: The evaluation run ID.
- sampleCount:
- type: integer
- format: int32
- description: Number of samples in the evaluation run.
- average:
- type: number
- format: float
- description: Average value of the metric in the evaluation run.
- standardDeviation:
- type: number
- format: float
- description: Standard deviation of the metric in the evaluation run.
- description: Summary statistics of a metric in an evaluation run.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- Evaluation:
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CreateEvalCompletionsRunDataSource:
type: object
required:
- - id
- - data
- - evaluators
+ - type
+ - source
properties:
- id:
- type: string
- description: Identifier of the evaluation.
- readOnly: true
- data:
- $ref: '#/components/schemas/InputData'
- description: Data for evaluation.
- displayName:
- type: string
- description: Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique.
- description:
+ type:
type: string
- description: Description of the evaluation. It can be used to store additional information about the evaluation and is mutable.
- status:
+ enum:
+ - completions
+ description: The type of run data source. Always `completions`.
+ default: completions
+ input_messages:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ description: 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.
+ sampling_params:
+ $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams'
+ model:
type: string
- description: Status of the evaluation. It is set by service and is read-only.
- readOnly: true
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Evaluation's tags. Unlike properties, tags are fully mutable.
- properties:
- type: object
- unevaluatedProperties:
- type: string
- description: Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.
- evaluators:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/EvaluatorConfiguration'
- description: Evaluators to be used for the evaluation.
- target:
- $ref: '#/components/schemas/EvaluationTarget'
- description: Specifies the type and configuration of the entity used for this evaluation.
- description: Evaluation Definition
- EvaluationComparisonInsightRequest:
+ description: The name of the model to use for generating completions (e.g. "o3-mini").
+ source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
+ - $ref: '#/components/schemas/OpenAI.EvalStoredCompletionsSource'
+ description: Determines what populates the `item` namespace in this run's data source.
+ description: A CompletionsRunDataSource object describing a model sampling configuration.
+ title: CompletionsRunDataSource
+ x-oaiMeta:
+ name: The completions data source object used to configure an individual run
+ group: eval runs
+ example: |
+ {
+ "name": "gpt-4o-mini-2024-07-18",
+ "data_source": {
+ "type": "completions",
+ "input_messages": {
+ "type": "item_reference",
+ "item_reference": "item.input"
+ },
+ "model": "gpt-4o-mini-2024-07-18",
+ "source": {
+ "type": "stored_completions",
+ "model": "gpt-4o-mini-2024-07-18"
+ }
+ }
+ }
+ OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference:
type: object
required:
- type
- - evalId
- - baselineRunId
- - treatmentRunIds
+ - item_reference
properties:
type:
type: string
enum:
- - EvaluationComparison
- description: The type of request.
- evalId:
- type: string
- description: Identifier for the evaluation.
- baselineRunId:
+ - item_reference
+ item_reference:
type: string
- description: The baseline run ID for comparison.
- treatmentRunIds:
- type: array
- items:
- type: string
- description: List of treatment run IDs for comparison.
- allOf:
- - $ref: '#/components/schemas/InsightRequest'
- description: Evaluation Comparison Request
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationComparisonInsightResult:
+ OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate:
type: object
required:
- type
- - comparisons
- - method
+ - template
properties:
type:
type: string
enum:
- - EvaluationComparison
- description: The type of insights result.
- comparisons:
+ - template
+ template:
type: array
items:
- $ref: '#/components/schemas/EvalRunResultComparison'
- description: Comparison results for each treatment run against the baseline.
- method:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EasyInputMessage'
+ - $ref: '#/components/schemas/OpenAI.EvalItem'
+ OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams:
+ type: object
+ properties:
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ temperature:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ default: 1
+ max_completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ top_p:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ default: 1
+ seed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ default: 42
+ response_format:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatText'
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
+ - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject'
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionTool'
+ OpenAI.CreateEvalCustomDataSourceConfig:
+ type: object
+ required:
+ - type
+ - item_schema
+ properties:
+ type:
type: string
- description: The statistical method used for comparison.
- allOf:
- - $ref: '#/components/schemas/InsightResult'
- description: Insights from the evaluation comparison.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationDataGenerationType:
- anyOf:
- - type: string
- - type: string
enum:
- - simple_qna
- - traces
- - tool_use
- - task
- description: The data generation type.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationDatasetReference:
+ - custom
+ description: The type of data source. Always `custom`.
+ x-stainless-const: true
+ default: custom
+ item_schema:
+ type: object
+ unevaluatedProperties: {}
+ description: The json schema for each row in the data source.
+ include_sample_schema:
+ type: boolean
+ description: Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)
+ description: |-
+ 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
+ title: CustomDataSourceConfig
+ x-oaiMeta:
+ name: The eval file data source config object
+ group: evals
+ example: |
+ {
+ "type": "custom",
+ "item_schema": {
+ "type": "object",
+ "properties": {
+ "name": {"type": "string"},
+ "age": {"type": "integer"}
+ },
+ "required": ["name", "age"]
+ },
+ "include_sample_schema": true
+ }
+ OpenAI.CreateEvalJsonlRunDataSource:
type: object
required:
- - name
+ - type
+ - source
properties:
- name:
- type: string
- description: Dataset name.
- version:
- type: string
- description: Dataset version. If not provided, resolves to the latest version.
- schema_file_name:
+ type:
type: string
- description: |-
- Name of the schema file within the dataset's blob folder (e.g., "a3f2b1c4_schema.json").
- Optional — if not provided, schema is inferred at runtime from the data.
- Only applicable for uri_folder datasets.
- description: Reference to a dataset by name and version.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationLevel:
- anyOf:
- - type: string
enum:
- - turn
- - conversation
- - type: string
- description: The level at which evaluation is performed.
- EvaluationResultSample:
+ - jsonl
+ description: The type of data source. Always `jsonl`.
+ x-stainless-const: true
+ default: jsonl
+ source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
+ description: Determines what populates the `item` namespace in the data source.
+ description: A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
+ title: JsonlRunDataSource
+ x-oaiMeta:
+ name: The file data source object for the eval run configuration
+ group: evals
+ example: |
+ {
+ "type": "jsonl",
+ "source": {
+ "type": "file_id",
+ "id": "file-9GYS6xbkWgWhmE7VoLUWFg"
+ }
+ }
+ OpenAI.CreateEvalLogsDataSourceConfig:
type: object
required:
- type
- - evaluationResult
properties:
type:
type: string
enum:
- - EvaluationResultSample
- description: Evaluation Result Sample Type
- evaluationResult:
- $ref: '#/components/schemas/EvalResult'
- description: Evaluation result for the analysis sample.
- allOf:
- - $ref: '#/components/schemas/InsightSample'
- description: A sample from the evaluation result.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationRule:
+ - logs
+ description: The type of data source. Always `logs`.
+ x-stainless-const: true
+ default: logs
+ metadata:
+ type: object
+ unevaluatedProperties: {}
+ description: Metadata filters for the logs data source.
+ description: |-
+ 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.
+ title: LogsDataSourceConfig
+ x-oaiMeta:
+ name: The logs data source object for evals
+ group: evals
+ example: |
+ {
+ "type": "logs",
+ "metadata": {
+ "use_case": "customer_support_agent"
+ }
+ }
+ OpenAI.CreateEvalResponsesRunDataSource:
type: object
required:
- - id
- - action
- - eventType
- - enabled
- - systemData
+ - type
+ - source
properties:
- id:
- type: string
- description: Unique identifier for the evaluation rule.
- readOnly: true
- displayName:
+ type:
type: string
- description: Display Name for the evaluation rule.
- description:
+ enum:
+ - responses
+ description: The type of run data source. Always `responses`.
+ default: responses
+ input_messages:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
+ - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference'
+ description: 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.
+ sampling_params:
+ $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams'
+ model:
type: string
- description: Description for the evaluation rule.
- action:
- $ref: '#/components/schemas/EvaluationRuleAction'
- description: Definition of the evaluation rule action.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- filter:
- $ref: '#/components/schemas/EvaluationRuleFilter'
- description: Filter condition of the evaluation rule.
- eventType:
- $ref: '#/components/schemas/EvaluationRuleEventType'
- description: Event type that the evaluation rule applies to.
- enabled:
- type: boolean
- description: Indicates whether the evaluation rule is enabled. Default is true.
- systemData:
- type: object
- unevaluatedProperties:
- type: string
- description: System metadata for the evaluation rule.
- readOnly: true
- description: Evaluation rule model.
- EvaluationRuleAction:
+ description: The name of the model to use for generating completions (e.g. "o3-mini").
+ source:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
+ - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
+ - $ref: '#/components/schemas/OpenAI.EvalResponsesSource'
+ description: Determines what populates the `item` namespace in this run's data source.
+ description: A ResponsesRunDataSource object describing a model sampling configuration.
+ title: ResponsesRunDataSource
+ x-oaiMeta:
+ name: The completions data source object used to configure an individual run
+ group: eval runs
+ example: |
+ {
+ "name": "gpt-4o-mini-2024-07-18",
+ "data_source": {
+ "type": "responses",
+ "input_messages": {
+ "type": "item_reference",
+ "item_reference": "item.input"
+ },
+ "model": "gpt-4o-mini-2024-07-18",
+ "source": {
+ "type": "responses",
+ "model": "gpt-4o-mini-2024-07-18"
+ }
+ }
+ }
+ OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference:
type: object
required:
- type
+ - item_reference
properties:
type:
- $ref: '#/components/schemas/EvaluationRuleActionType'
- description: Type of the evaluation action.
- discriminator:
- propertyName: type
- mapping:
- continuousEvaluation: '#/components/schemas/ContinuousEvaluationRuleAction'
- humanEvaluation: '#/components/schemas/HumanEvaluationRuleAction'
- humanEvaluationPreview: '#/components/schemas/HumanEvaluationPreviewRuleAction'
- description: Evaluation action model.
- EvaluationRuleActionType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - continuousEvaluation
- - humanEvaluation
- - humanEvaluationPreview
- description: Type of the evaluation action.
- EvaluationRuleEventType:
- anyOf:
- - type: string
- - type: string
+ - item_reference
+ item_reference:
+ type: string
+ OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate:
+ type: object
+ required:
+ - type
+ - template
+ properties:
+ type:
+ type: string
enum:
- - responseCompleted
- - manual
- description: Type of the evaluation rule event.
- EvaluationRuleFilter:
+ - template
+ template:
+ type: array
+ items:
+ anyOf:
+ - type: object
+ properties:
+ role:
+ type: string
+ content:
+ type: string
+ required:
+ - role
+ - content
+ - $ref: '#/components/schemas/OpenAI.EvalItem'
+ OpenAI.CreateEvalResponsesRunDataSourceSamplingParams:
+ type: object
+ properties:
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ temperature:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ default: 1
+ max_completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ top_p:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ default: 1
+ seed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ default: 42
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ text:
+ $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText'
+ OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText:
type: object
- required:
- - agentName
properties:
- agentName:
- type: string
- description: Filter by agent name.
- description: Evaluation filter model.
- EvaluationRunClusterInsightRequest:
+ format:
+ $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
+ OpenAI.CreateEvalStoredCompletionsDataSourceConfig:
type: object
required:
- type
- - evalId
- - runIds
properties:
type:
type: string
enum:
- - EvaluationRunClusterInsight
- description: The type of insights request.
- evalId:
- type: string
- description: Evaluation Id for the insights.
- runIds:
+ - stored_completions
+ description: The type of data source. Always `stored_completions`.
+ x-stainless-const: true
+ default: stored_completions
+ metadata:
+ type: object
+ unevaluatedProperties: {}
+ description: Metadata filters for the stored completions data source.
+ description: Deprecated in favor of LogsDataSourceConfig.
+ title: StoredCompletionsDataSourceConfig
+ deprecated: true
+ x-oaiMeta:
+ name: The stored completions data source object for evals
+ group: evals
+ example: |
+ {
+ "type": "stored_completions",
+ "metadata": {
+ "use_case": "customer_support_agent"
+ }
+ }
+ OpenAI.CreateFileRequest:
+ type: object
+ properties:
+ file:
+ description: The File object (not file name) to be uploaded.
+ purpose:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FilePurpose'
+ description: |-
+ 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
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.FileExpirationAfter'
+ required:
+ - file
+ - purpose
+ OpenAI.CreateFineTuningCheckpointPermissionRequest:
+ type: object
+ required:
+ - project_ids
+ properties:
+ project_ids:
type: array
items:
type: string
- description: List of evaluation run IDs for the insights.
- modelConfiguration:
- $ref: '#/components/schemas/InsightModelConfiguration'
- description: Configuration of the model used in the insight generation.
- allOf:
- - $ref: '#/components/schemas/InsightRequest'
- description: Insights on set of Evaluation Results
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationRunClusterInsightResult:
+ description: The project identifiers to grant access to.
+ OpenAI.CreateFineTuningJobRequest:
type: object
required:
- - type
- - clusterInsight
+ - model
+ - training_file
properties:
- type:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - babbage-002
+ - davinci-002
+ - gpt-3.5-turbo
+ - gpt-4o-mini
+ description: |-
+ The name of the model to fine-tune. You can select one of the
+ [supported models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned).
+ x-oaiTypeLabel: string
+ training_file:
type: string
- enum:
- - EvaluationRunClusterInsight
- description: The type of insights result.
- clusterInsight:
- $ref: '#/components/schemas/ClusterInsightResult'
- allOf:
- - $ref: '#/components/schemas/InsightResult'
- description: Insights from the evaluation run cluster analysis.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- EvaluationScheduleTask:
+ description: |-
+ The ID of an uploaded file that contains training data.
+ See [upload file](/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](/docs/api-reference/fine-tuning/chat-input), [completions](/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](/docs/api-reference/fine-tuning/preference-input) format.
+ See the [fine-tuning guide](/docs/guides/model-optimization) for more details.
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters'
+ description: |-
+ 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: true
+ suffix:
+ anyOf:
+ - type: string
+ - type: 'null'
+ minLength: 1
+ maxLength: 64
+ description: |-
+ 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`.
+ validation_file:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: |-
+ 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](/docs/guides/model-optimization) for more details.
+ integrations:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations'
+ - type: 'null'
+ description: A list of integrations to enable for your fine-tuning job.
+ seed:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ maximum: 2147483647
+ description: |-
+ 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.
+ method:
+ $ref: '#/components/schemas/OpenAI.FineTuneMethod'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateFineTuningJobRequestHyperparameters:
+ type: object
+ properties:
+ batch_size:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ default: auto
+ OpenAI.CreateFineTuningJobRequestIntegrations:
type: object
required:
- type
- - evalId
- - evalRun
+ - wandb
properties:
type:
type: string
enum:
- - Evaluation
- evalId:
- type: string
- description: Identifier of the evaluation group.
- evalRun:
- type: object
- unevaluatedProperties: {}
- description: The evaluation run payload.
- allOf:
- - $ref: '#/components/schemas/ScheduleTask'
- description: Evaluation task for the schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- EvaluationSuiteDataGenerationOptions:
- type: object
- properties:
- type:
- $ref: '#/components/schemas/EvaluationDataGenerationType'
- description: The data generation type. Defaults to 'simple_qna' if not specified.
- max_samples:
- type: integer
- format: int32
- minimum: 15
- maximum: 1000
- description: 'Maximum number of samples to generate. Valid range: 15-1000.'
- description: Options for dataset generation within an evaluation suite generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteGenerationCategory:
- anyOf:
- - type: string
- - type: string
- enum:
- - quality
- - safety
- description: The category of evaluator generation.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteGenerationJob:
+ - wandb
+ x-stainless-const: true
+ wandb:
+ $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb'
+ OpenAI.CreateFineTuningJobRequestIntegrationsWandb:
type: object
required:
- - id
- - status
- - created_at
+ - project
properties:
- id:
+ project:
type: string
- description: Server-assigned unique identifier.
- readOnly: true
- inputs:
- $ref: '#/components/schemas/EvaluationSuiteGenerationJobInputs'
- description: Caller-supplied inputs.
- result:
- $ref: '#/components/schemas/EvaluationSuiteVersion'
- description: Result produced on success.
- readOnly: true
- status:
- $ref: '#/components/schemas/JobStatus'
- description: Current lifecycle status.
- readOnly: true
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error details — populated only on failure.
- readOnly: true
- created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job was created, represented in Unix time.
- readOnly: true
- finished_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job finished, represented in Unix time.
- readOnly: true
- usage:
- $ref: '#/components/schemas/EvaluationSuiteGenerationTokenUsage'
- description: Token consumption summary. Populated on terminal states.
- readOnly: true
- description: Evaluation suite generation job resource — a long-running job that generates testing criteria and optionally a dataset from source materials. On success, the result is the persisted EvaluationSuiteVersion.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteGenerationJobCreate:
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ entity:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tags:
+ type: array
+ items:
+ type: string
+ OpenAI.CreateImageEditRequest:
type: object
properties:
- inputs:
- $ref: '#/components/schemas/EvaluationSuiteGenerationJobInputs'
- description: Caller-supplied inputs.
- description: Evaluation suite generation job resource — a long-running job that generates testing criteria and optionally a dataset from source materials. On success, the result is the persisted EvaluationSuiteVersion.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteGenerationJobInputs:
+ image:
+ anyOf:
+ - {}
+ - type: array
+ items:
+ type: string
+ contentEncoding: base64
+ description: |-
+ The image(s) to edit. Must be a supported image file or an array of images.
+ For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`
+ file less than 50MB. You can provide up to 16 images.
+ `chatgpt-image-latest` follows the same input constraints as GPT image models.
+ For `dall-e-2`, you can only provide one image, and it should be a square
+ `png` file less than 4MB.
+ prompt:
+ type: string
+ description: A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models.
+ mask:
+ description: 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`.
+ background:
+ anyOf:
+ - type: string
+ enum:
+ - transparent
+ - opaque
+ - auto
+ - type: 'null'
+ description: |-
+ Allows to set transparency for the background of the generated image(s).
+ This parameter is only supported for the GPT image models. 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`.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - gpt-image-1.5
+ - dall-e-2
+ - gpt-image-1
+ - gpt-image-1-mini
+ - chatgpt-image-latest
+ - type: 'null'
+ description: The model to use for image generation. Defaults to `gpt-image-1.5`.
+ x-oaiTypeLabel: string
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The number of images to generate. Must be between 1 and 10.
+ size:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - 256x256
+ - 512x512
+ - 1024x1024
+ - 1536x1024
+ - 1024x1536
+ - auto
+ - type: 'null'
+ description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ response_format:
+ anyOf:
+ - type: string
+ enum:
+ - url
+ - b64_json
+ - type: 'null'
+ description: 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` (default is `url` for `dall-e-2`), as GPT image models always return base64-encoded images.
+ output_format:
+ anyOf:
+ - type: string
+ enum:
+ - png
+ - jpeg
+ - webp
+ - type: 'null'
+ description: |-
+ The format in which the generated images are returned. This parameter is
+ only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
+ The default value is `png`.
+ output_compression:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: |-
+ The compression level (0-100%) for the generated images. This parameter
+ is only supported for the GPT image models with the `webp` or `jpeg` output
+ formats, and defaults to 100.
+ user:
+ type: string
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ input_fidelity:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.InputFidelity'
+ - type: 'null'
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: |-
+ Edit the image in streaming mode. Defaults to `false`. See the
+ [Image generation guide](/docs/guides/image-generation) for more information.
+ partial_images:
+ $ref: '#/components/schemas/OpenAI.PartialImages'
+ quality:
+ anyOf:
+ - type: string
+ enum:
+ - standard
+ - low
+ - medium
+ - high
+ - auto
+ - type: 'null'
+ description: The quality of the image that will be generated for GPT image models. Defaults to `auto`.
+ required:
+ - image
+ - prompt
+ OpenAI.CreateImageRequest:
type: object
required:
- - evaluation_suite_name
- - sources
- - generation_model
+ - prompt
properties:
- evaluation_suite_name:
- type: string
- description: The evaluation suite name to create.
- sources:
- type: array
- items:
- $ref: '#/components/schemas/EvaluationSuiteJobSource'
- description: Source materials for generation — agent context, prompts, traces, or datasets.
- generation_model:
+ prompt:
type: string
- description: The LLM model to use for rubric and data generation (e.g., 'gpt-4o').
- category:
- $ref: '#/components/schemas/EvaluationSuiteGenerationCategory'
- description: 'Category determines the generation focus. Default: quality.'
- default: quality
- initialization_parameters:
- type: object
- unevaluatedProperties: {}
- description: |-
- Optional initialization parameters applied to all generated evaluators.
- For example, deployment_name for LLM judge model, default threshold.
- data_generation_options:
- $ref: '#/components/schemas/EvaluationSuiteDataGenerationOptions'
+ description: A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - gpt-image-1.5
+ - dall-e-2
+ - dall-e-3
+ - gpt-image-1
+ - gpt-image-1-mini
+ - type: 'null'
+ description: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
+ x-oaiTypeLabel: string
+ default: dall-e-2
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 1
+ maximum: 10
+ description: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
+ default: 1
+ quality:
+ anyOf:
+ - type: string
+ enum:
+ - standard
+ - hd
+ - low
+ - medium
+ - high
+ - auto
+ - type: 'null'
description: |-
- Data generation options. Controls how the evaluation dataset is generated.
- If omitted, defaults are used (simple_qna, 100 max_samples).
- target:
- $ref: '#/components/schemas/Target'
+ 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 the GPT image models.
+ - `hd` and `standard` are supported for `dall-e-3`.
+ - `standard` is the only option for `dall-e-2`.
+ default: auto
+ response_format:
+ anyOf:
+ - type: string
+ enum:
+ - url
+ - b64_json
+ - type: 'null'
+ description: 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 the GPT image models, which always return base64-encoded images.
+ default: url
+ output_format:
+ anyOf:
+ - type: string
+ enum:
+ - png
+ - jpeg
+ - webp
+ - type: 'null'
+ description: The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
+ default: png
+ output_compression:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100.
+ default: 100
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
description: |-
- Target for the generated suite. Stored on the suite so it can be run
- immediately after generation completes.
- Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.
- input_messages:
+ Generate the image in streaming mode. Defaults to `false`. See the
+ [Image generation guide](/docs/guides/image-generation) for more information.
+ This parameter is only supported for the GPT image models.
+ partial_images:
+ $ref: '#/components/schemas/OpenAI.PartialImages'
+ size:
anyOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ - type: string
+ - type: string
+ enum:
+ - auto
+ - 1024x1024
+ - 1536x1024
+ - 1024x1536
+ - 256x256
+ - 512x512
+ - 1792x1024
+ - 1024x1792
+ - type: 'null'
+ description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ default: auto
+ moderation:
+ anyOf:
+ - type: string
+ enum:
+ - low
+ - auto
+ - type: 'null'
+ description: Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value).
+ default: auto
+ background:
+ anyOf:
+ - type: string
+ enum:
+ - transparent
+ - opaque
+ - auto
+ - type: 'null'
description: |-
- How to send dataset rows to the target.
- If omitted and target is provided, defaults to a template using item.query.
- evaluation_level:
- $ref: '#/components/schemas/EvaluationLevel'
+ Allows to set transparency for the background of the generated image(s).
+ This parameter is only supported for the GPT image models. 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`.
+ default: auto
+ style:
+ anyOf:
+ - type: string
+ enum:
+ - vivid
+ - natural
+ - type: 'null'
+ description: 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.
+ default: vivid
+ user:
+ type: string
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ OpenAI.CreateImageVariationRequest:
+ type: object
+ properties:
+ image:
+ description: The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - dall-e-2
+ - type: 'null'
+ description: The model to use for image generation. Only `dall-e-2` is supported at this time.
+ x-oaiTypeLabel: string
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The number of images to generate. Must be between 1 and 10.
+ response_format:
+ anyOf:
+ - type: string
+ enum:
+ - url
+ - b64_json
+ - type: 'null'
+ description: 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.
+ size:
+ anyOf:
+ - type: string
+ enum:
+ - 256x256
+ - 512x512
+ - 1024x1024
+ - type: 'null'
+ description: The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
+ user:
+ type: string
+ description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
+ required:
+ - image
+ OpenAI.CreateMessageRequest:
+ type: object
+ required:
+ - role
+ - content
+ properties:
+ role:
+ type: string
+ enum:
+ - user
+ - assistant
description: |-
- Evaluation level for the generated suite.
- Default: turn (single-turn evaluation).
- Use conversation for multi-turn evaluation.
- description: Caller-supplied inputs for an evaluation suite generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteGenerationTokenUsage:
+ 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.
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessageContentImageFileObject'
+ - $ref: '#/components/schemas/OpenAI.MessageContentImageUrlObject'
+ - $ref: '#/components/schemas/OpenAI.MessageRequestContentTextObject'
+ attachments:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateMessageRequestAttachments'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateMessageRequestAttachments:
type: object
properties:
- input_tokens:
- type: integer
- format: int64
- description: Number of input tokens consumed.
- output_tokens:
- type: integer
- format: int64
- description: Number of output tokens consumed.
- total_tokens:
- type: integer
- format: int64
- description: Total tokens consumed.
- description: Token usage summary for an evaluation suite generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteJobSource:
+ file_id:
+ type: string
+ tools:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantToolsCode'
+ - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly'
+ OpenAI.CreateModerationRequest:
+ type: object
+ required:
+ - input
+ properties:
+ input:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateModerationRequestInput'
+ description: |-
+ 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.
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - omni-moderation-latest
+ - omni-moderation-2024-09-26
+ - text-moderation-latest
+ - text-moderation-stable
+ description: |-
+ The content moderation model you would like to use. Learn more in
+ [the moderation guide](/docs/guides/moderation), and learn about
+ available models [here](/docs/models#moderation).
+ x-oaiTypeLabel: string
+ default: omni-moderation-latest
+ OpenAI.CreateModerationRequestInput:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/EvaluationSuiteJobSourceType'
- description: The type of source.
- description:
- type: string
- description: Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities').
+ $ref: '#/components/schemas/OpenAI.CreateModerationRequestInputType'
discriminator:
propertyName: type
mapping:
- prompt: '#/components/schemas/PromptEvaluationSuiteJobSource'
- agent: '#/components/schemas/AgentEvaluationSuiteJobSource'
- traces: '#/components/schemas/TracesEvaluationSuiteJobSource'
- dataset: '#/components/schemas/DatasetEvaluationSuiteJobSource'
- description: The base source model for evaluation suite generation jobs. Polymorphic over `type`.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteJobSourceType:
+ image_url: '#/components/schemas/OpenAI.ModerationImageURLInput'
+ text: '#/components/schemas/OpenAI.ModerationTextInput'
+ OpenAI.CreateModerationRequestInputType:
anyOf:
- type: string
- type: string
enum:
- - prompt
- - agent
- - traces
- - dataset
- description: The supported source types for evaluation suite generation jobs.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteRunRequest:
- type: object
- properties:
- evaluation_name:
- type: string
- description: "Name for the evaluation. Default: '{suiteName}-runs'."
- evaluation_suite_version:
- type: string
- description: 'Evaluation suite version to run. Default: latest.'
- evaluation_level:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Overrides the suite's default evaluation level. If omitted, uses the level from the suite.
- description: Request body for running an evaluation from a suite.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteRunResponse:
+ - image_url
+ - text
+ OpenAI.CreateModerationResponse:
type: object
required:
- - evaluation_suite_name
- - evaluation_suite_version
+ - id
+ - model
- results
properties:
- evaluation_suite_name:
+ id:
type: string
- description: The evaluation suite name used.
- evaluation_suite_version:
+ description: The unique identifier for the moderation request.
+ model:
type: string
- description: The evaluation suite version resolved.
+ description: The model used to generate the moderation results.
results:
type: array
items:
- $ref: '#/components/schemas/EvaluationSuiteRunResult'
- description: The run results. Currently a single-element array; will support multiple runs in the future.
- description: Response from running an evaluation suite.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteRunResult:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponseResults'
+ description: A list of moderation objects.
+ description: Represents if a given text input is potentially harmful.
+ x-oaiMeta:
+ name: The moderation object
+ example: |
+ {
+ "id": "modr-0d9740456c391e43c445bf0f010940c7",
+ "model": "omni-moderation-latest",
+ "results": [
+ {
+ "flagged": true,
+ "categories": {
+ "harassment": true,
+ "harassment/threatening": true,
+ "sexual": false,
+ "hate": false,
+ "hate/threatening": false,
+ "illicit": false,
+ "illicit/violent": false,
+ "self-harm/intent": false,
+ "self-harm/instructions": false,
+ "self-harm": false,
+ "sexual/minors": false,
+ "violence": true,
+ "violence/graphic": true
+ },
+ "category_scores": {
+ "harassment": 0.8189693396524255,
+ "harassment/threatening": 0.804985420696006,
+ "sexual": 1.573112165348997e-6,
+ "hate": 0.007562942636942845,
+ "hate/threatening": 0.004208854591835476,
+ "illicit": 0.030535955153511665,
+ "illicit/violent": 0.008925306722380033,
+ "self-harm/intent": 0.00023023930975076432,
+ "self-harm/instructions": 0.0002293869201073356,
+ "self-harm": 0.012598046106750154,
+ "sexual/minors": 2.212566909570261e-8,
+ "violence": 0.9999992735124786,
+ "violence/graphic": 0.843064871157054
+ },
+ "category_applied_input_types": {
+ "harassment": [
+ "text"
+ ],
+ "harassment/threatening": [
+ "text"
+ ],
+ "sexual": [
+ "text",
+ "image"
+ ],
+ "hate": [
+ "text"
+ ],
+ "hate/threatening": [
+ "text"
+ ],
+ "illicit": [
+ "text"
+ ],
+ "illicit/violent": [
+ "text"
+ ],
+ "self-harm/intent": [
+ "text",
+ "image"
+ ],
+ "self-harm/instructions": [
+ "text",
+ "image"
+ ],
+ "self-harm": [
+ "text",
+ "image"
+ ],
+ "sexual/minors": [
+ "text"
+ ],
+ "violence": [
+ "text",
+ "image"
+ ],
+ "violence/graphic": [
+ "text",
+ "image"
+ ]
+ }
+ }
+ ]
+ }
+ OpenAI.CreateModerationResponseResults:
type: object
required:
- - eval_id
- - run_id
- - status
- - created_at
+ - flagged
+ - categories
+ - category_scores
+ - category_applied_input_types
properties:
- eval_id:
- type: string
- description: The evaluation ID created.
- run_id:
- type: string
- description: The eval run ID created.
- status:
- $ref: '#/components/schemas/JobStatus'
- description: Status of the run.
- created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: Timestamp when the run was created.
- description: Result of a single evaluation run within a suite execution.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteSubtype:
+ flagged:
+ type: boolean
+ categories:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponseResultsCategories'
+ category_scores:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponseResultsCategoryScores'
+ category_applied_input_types:
+ $ref: '#/components/schemas/OpenAI.CreateModerationResponseResultsCategoryAppliedInputTypes'
+ OpenAI.CreateModerationResponseResultsCategories:
+ type: object
+ required:
+ - hate
+ - hate/threatening
+ - harassment
+ - harassment/threatening
+ - illicit
+ - illicit/violent
+ - self-harm
+ - self-harm/intent
+ - self-harm/instructions
+ - sexual
+ - sexual/minors
+ - violence
+ - violence/graphic
+ properties:
+ hate:
+ type: boolean
+ hate/threatening:
+ type: boolean
+ harassment:
+ type: boolean
+ harassment/threatening:
+ type: boolean
+ illicit:
+ type: boolean
+ illicit/violent:
+ type: boolean
+ self-harm:
+ type: boolean
+ self-harm/intent:
+ type: boolean
+ self-harm/instructions:
+ type: boolean
+ sexual:
+ type: boolean
+ sexual/minors:
+ type: boolean
+ violence:
+ type: boolean
+ violence/graphic:
+ type: boolean
+ OpenAI.CreateModerationResponseResultsCategoryAppliedInputTypes:
+ type: object
+ required:
+ - hate
+ - hate/threatening
+ - harassment
+ - harassment/threatening
+ - illicit
+ - illicit/violent
+ - self-harm
+ - self-harm/intent
+ - self-harm/instructions
+ - sexual
+ - sexual/minors
+ - violence
+ - violence/graphic
+ properties:
+ hate:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ hate/threatening:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ harassment:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ harassment/threatening:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ illicit:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ illicit/violent:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ self-harm:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ self-harm/intent:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ self-harm/instructions:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ sexual:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ sexual/minors:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ violence:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ violence/graphic:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationCategoryInputType'
+ OpenAI.CreateModerationResponseResultsCategoryScores:
+ type: object
+ required:
+ - hate
+ - hate/threatening
+ - harassment
+ - harassment/threatening
+ - illicit
+ - illicit/violent
+ - self-harm
+ - self-harm/intent
+ - self-harm/instructions
+ - sexual
+ - sexual/minors
+ - violence
+ - violence/graphic
+ properties:
+ hate:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ hate/threatening:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ harassment:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ harassment/threatening:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ illicit:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ illicit/violent:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ self-harm:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ self-harm/intent:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ self-harm/instructions:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ sexual:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ sexual/minors:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ violence:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ violence/graphic:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.CreateResponseStreamingResponse:
anyOf:
- - type: string
- - type: string
- enum:
- - default
- - benchmark
- description: The subtype of an evaluation suite.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteVersion:
+ - $ref: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCreatedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseErrorEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFailedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseIncompleteEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseTextDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseQueuedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseAudioDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseContentPartDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseOutputItemDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseRefusalDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseTextDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent'
+ - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent'
+ OpenAI.CreateRunRequest:
type: object
required:
- - testing_criteria
- - name
- - version
+ - assistant_id
properties:
- display_name:
+ assistant_id:
type: string
- description: |-
- Human-readable display name.
- Does not need to be unique. Shown in Foundry portal list views and eval reports.
- subtype:
- $ref: '#/components/schemas/EvaluationSuiteSubtype'
- description: Subtype of the evaluation suite.
- dataset:
- $ref: '#/components/schemas/EvaluationDatasetReference'
- description: |-
- Dataset reference for evaluation.
- Optional — omit for evaluator-only suites where data comes from
- live production traces or is provided at run time.
- The referenced dataset must exist in the project's dataset registry.
- testing_criteria:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
- - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
- - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
- - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
- minItems: 1
- description: |-
- Testing criteria — the evaluator configurations for this suite.
- Supports all grader types: azure_ai_evaluator, string_check, label_model,
- score_model, text_similarity, python, etc.
- At least one entry is required.
- target:
- $ref: '#/components/schemas/Target'
- description: |-
- Target for this evaluation suite. Uses the existing Target discriminated type
- from eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.
- Optional — allows suites to exist without a target.
- input_messages:
+ description: The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run.
+ model:
anyOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.AssistantSupportedModels'
+ - type: 'null'
+ description: The ID of the [Model](/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.
+ x-oaiTypeLabel: string
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis.
+ additional_instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: 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_messages:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateMessageRequest'
+ - type: 'null'
+ description: Adds additional messages to the thread before creating the run.
+ tools:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ - type: 'null'
+ maxItems: 20
+ description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 2
+ description: 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.
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 1
description: |-
- How to send dataset rows to the target (agent or model).
- Supports template type (prompt with column placeholders) and
- item_reference type (column containing pre-built messages).
- evaluation_level:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Default evaluation level for this suite. Can be overridden at run time.
- name:
- type: string
- description: The name of the resource.
- readOnly: true
- version:
- type: string
- description: The version of the resource.
- readOnly: true
- description: |-
- An evaluation suite bundles testing criteria — an optional dataset, one or more
- evaluator configs with thresholds and init params — into a reusable, named artifact that
- can gate agent changes across batch, scheduled, continuous, and CI/CD evals.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteVersionCreate:
+ 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.
+ default: 1
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: '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.'
+ max_prompt_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: 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_completion_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: 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.
+ truncation_strategy:
+ $ref: '#/components/schemas/OpenAI.TruncationObject'
+ tool_choice:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption'
+ parallel_tool_calls:
+ type: boolean
+ description: Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
+ default: true
+ response_format:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ OpenAI.CreateSpeechRequest:
type: object
required:
- - testing_criteria
+ - model
+ - input
+ - voice
properties:
- display_name:
- type: string
- description: |-
- Human-readable display name.
- Does not need to be unique. Shown in Foundry portal list views and eval reports.
- subtype:
- $ref: '#/components/schemas/EvaluationSuiteSubtype'
- description: Subtype of the evaluation suite.
- dataset:
- $ref: '#/components/schemas/EvaluationDatasetReference'
- description: |-
- Dataset reference for evaluation.
- Optional — omit for evaluator-only suites where data comes from
- live production traces or is provided at run time.
- The referenced dataset must exist in the project's dataset registry.
- testing_criteria:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
- - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
- - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
- - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
- minItems: 1
- description: |-
- Testing criteria — the evaluator configurations for this suite.
- Supports all grader types: azure_ai_evaluator, string_check, label_model,
- score_model, text_similarity, python, etc.
- At least one entry is required.
- target:
- $ref: '#/components/schemas/Target'
- description: |-
- Target for this evaluation suite. Uses the existing Target discriminated type
- from eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.
- Optional — allows suites to exist without a target.
- input_messages:
+ model:
anyOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
- description: |-
- How to send dataset rows to the target (agent or model).
- Supports template type (prompt with column placeholders) and
- item_reference type (column containing pre-built messages).
- evaluation_level:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Default evaluation level for this suite. Can be overridden at run time.
- description:
+ - type: string
+ - type: string
+ enum:
+ - tts-1
+ - tts-1-hd
+ - gpt-4o-mini-tts
+ - gpt-4o-mini-tts-2025-12-15
+ description: 'One of the available [TTS models](/docs/models#tts): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.'
+ x-oaiTypeLabel: string
+ input:
type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- description: |-
- An evaluation suite bundles testing criteria — an optional dataset, one or more
- evaluator configs with thresholds and init params — into a reusable, named artifact that
- can gate agent changes across batch, scheduled, continuous, and CI/CD evals.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationSuiteVersionUpdate:
+ maxLength: 4096
+ description: The text to generate audio for. The maximum length is 4096 characters.
+ instructions:
+ type: string
+ maxLength: 4096
+ description: Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`.
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsOrCustomVoice'
+ description: 'The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech#voice-options).'
+ response_format:
+ type: string
+ enum:
+ - mp3
+ - opus
+ - aac
+ - flac
+ - wav
+ - pcm
+ description: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.
+ default: mp3
+ speed:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0.25
+ maximum: 4
+ description: The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.
+ default: 1
+ stream_format:
+ type: string
+ enum:
+ - sse
+ - audio
+ description: The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.
+ default: audio
+ OpenAI.CreateThreadAndRunRequest:
type: object
required:
- - testing_criteria
+ - assistant_id
properties:
- display_name:
+ assistant_id:
type: string
- description: |-
- Human-readable display name.
- Does not need to be unique. Shown in Foundry portal list views and eval reports.
- subtype:
- $ref: '#/components/schemas/EvaluationSuiteSubtype'
- description: Subtype of the evaluation suite.
- dataset:
- $ref: '#/components/schemas/EvaluationDatasetReference'
- description: |-
- Dataset reference for evaluation.
- Optional — omit for evaluator-only suites where data comes from
- live production traces or is provided at run time.
- The referenced dataset must exist in the project's dataset registry.
- testing_criteria:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EvalGraderLabelModel'
- - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.EvalGraderPython'
- - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel'
- - $ref: '#/components/schemas/TestingCriterionAzureAIEvaluator'
- minItems: 1
- description: |-
- Testing criteria — the evaluator configurations for this suite.
- Supports all grader types: azure_ai_evaluator, string_check, label_model,
- score_model, text_similarity, python, etc.
- At least one entry is required.
- target:
- $ref: '#/components/schemas/Target'
- description: |-
- Target for this evaluation suite. Uses the existing Target discriminated type
- from eval runs. Supports azure_ai_agent, azure_ai_model, azure_ai_assistant.
- Optional — allows suites to exist without a target.
- input_messages:
+ description: The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run.
+ thread:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequest'
+ model:
anyOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
+ - type: string
+ - type: string
+ enum:
+ - 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
+ - type: 'null'
+ description: The ID of the [Model](/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.
+ x-oaiTypeLabel: string
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.
+ tools:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ - type: 'null'
+ maxItems: 20
+ description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResources'
+ - type: 'null'
+ description: 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.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 2
+ description: 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.
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ minimum: 0
+ maximum: 1
description: |-
- How to send dataset rows to the target (agent or model).
- Supports template type (prompt with column placeholders) and
- item_reference type (column containing pre-built messages).
- evaluation_level:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Default evaluation level for this suite. Can be overridden at run time.
- description:
- type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- description: |-
- An evaluation suite bundles testing criteria — an optional dataset, one or more
- evaluator configs with thresholds and init params — into a reusable, named artifact that
- can gate agent changes across batch, scheduled, continuous, and CI/CD evals.
- x-ms-foundry-meta:
- conditional_previews:
- - Evaluations=V1Preview
- EvaluationTarget:
+ 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.
+ default: 1
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: '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.'
+ max_prompt_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: 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_completion_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: 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.
+ truncation_strategy:
+ $ref: '#/components/schemas/OpenAI.TruncationObject'
+ tool_choice:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption'
+ parallel_tool_calls:
+ type: boolean
+ description: Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
+ default: true
+ response_format:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ OpenAI.CreateThreadAndRunRequestToolResources:
type: object
- required:
- - type
properties:
- type:
- $ref: '#/components/schemas/EvaluationTargetType'
- description: Discriminator that defines the type of the evaluation target.
- discriminator:
- propertyName: type
- mapping:
- modelResponseGeneration: '#/components/schemas/modelResponseGenerationTarget'
- description: Abstract base model for defining evaluation targets.
- EvaluationTargetType:
- anyOf:
- - type: string
- enum:
- - modelResponseGeneration
- - type: string
- description: Allowed types of evaluation targets.
- EvaluationTaxonomy:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch'
+ OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter:
type: object
- required:
- - name
- - version
- - taxonomyInput
properties:
- id:
- type: string
- description: Asset ID, a unique identifier for the asset
- readOnly: true
- name:
- type: string
- description: The name of the resource
- readOnly: true
- version:
- type: string
- description: The version of the resource
- readOnly: true
- taxonomyInput:
- $ref: '#/components/schemas/EvaluationTaxonomyInput'
- description: Input configuration for the evaluation taxonomy.
- taxonomyCategories:
+ file_ids:
type: array
items:
- $ref: '#/components/schemas/TaxonomyCategory'
- description: List of taxonomy categories.
- properties:
- type: object
- unevaluatedProperties:
type: string
- description: Additional properties for the evaluation taxonomy.
- description: Evaluation Taxonomy Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyCreateOrUpdate:
+ maxItems: 20
+ default: []
+ OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch:
type: object
- required:
- - taxonomyInput
properties:
- description:
- type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- taxonomyInput:
- $ref: '#/components/schemas/EvaluationTaxonomyInput'
- description: Input configuration for the evaluation taxonomy.
- taxonomyCategories:
+ vector_store_ids:
type: array
items:
- $ref: '#/components/schemas/TaxonomyCategory'
- description: List of taxonomy categories.
- properties:
- type: object
- unevaluatedProperties:
type: string
- description: Additional properties for the evaluation taxonomy.
- description: Evaluation Taxonomy Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyInput:
+ maxItems: 1
+ OpenAI.CreateThreadRequest:
type: object
- required:
- - type
properties:
- type:
- $ref: '#/components/schemas/EvaluationTaxonomyInputType'
- description: Input type of the evaluation taxonomy.
- discriminator:
- propertyName: type
- mapping:
- agent: '#/components/schemas/AgentTaxonomyInput'
- description: Input configuration for the evaluation taxonomy.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyInputType:
- anyOf:
- - type: string
- - type: string
- enum:
- - agent
- - policy
- description: Type of the evaluation taxonomy input.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyInputUpdate:
+ messages:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateMessageRequest'
+ description: A list of [messages](/docs/api-reference/messages) to start the thread with.
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: |-
+ Options to create a new thread. If no thread is provided when running a
+ request, an empty thread will be created.
+ OpenAI.CreateThreadRequestToolResources:
type: object
- required:
- - type
properties:
- type:
- $ref: '#/components/schemas/EvaluationTaxonomyInputType'
- description: Input type of the evaluation taxonomy.
- discriminator:
- propertyName: type
- mapping:
- agent: '#/components/schemas/AgentTaxonomyInputUpdate'
- description: Input configuration for the evaluation taxonomy.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluationTaxonomyUpdate:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearch'
+ OpenAI.CreateThreadRequestToolResourcesCodeInterpreter:
type: object
properties:
- description:
- type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
+ file_ids:
+ type: array
+ items:
type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- taxonomyInput:
- $ref: '#/components/schemas/EvaluationTaxonomyInputUpdate'
- description: Input configuration for the evaluation taxonomy.
- taxonomyCategories:
+ maxItems: 20
+ OpenAI.CreateThreadRequestToolResourcesFileSearch:
+ type: object
+ properties:
+ vector_store_ids:
type: array
items:
- $ref: '#/components/schemas/TaxonomyCategory'
- description: List of taxonomy categories.
- properties:
- type: object
- unevaluatedProperties:
type: string
- description: Additional properties for the evaluation taxonomy.
- description: Evaluation Taxonomy Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorCategory:
- anyOf:
- - type: string
- - type: string
- enum:
- - quality
- - safety
- - agents
- description: The category of the evaluator
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorConfiguration:
+ maxItems: 1
+ vector_stores:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores'
+ maxItems: 1
+ OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores:
type: object
- required:
- - id
properties:
- id:
- type: string
- description: Identifier of the evaluator.
- initParams:
- type: object
- unevaluatedProperties: {}
- description: Initialization parameters of the evaluator.
- dataMapping:
- type: object
- unevaluatedProperties:
+ file_ids:
+ type: array
+ items:
type: string
- description: Data parameters of the evaluator.
- description: Evaluator Configuration
- EvaluatorCredentialRequest:
+ maxItems: 100000000
+ chunking_strategy:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto'
+ - $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto:
type: object
required:
- - blob_uri
+ - type
properties:
- blob_uri:
+ type:
type: string
- format: uri
- description: 'The blob URI for the evaluator storage. Example: `https://account.blob.core.windows.net:443/container`'
- description: Request body for getting evaluator credentials
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorDefinition:
+ enum:
+ - auto
+ x-stainless-const: true
+ OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic:
type: object
required:
- type
+ - static
properties:
type:
- $ref: '#/components/schemas/EvaluatorDefinitionType'
- description: The type of evaluator definition
- init_parameters:
- type: object
- unevaluatedProperties: {}
- description: The JSON schema (Draft 2020-12) for the evaluator's input parameters. This includes parameters like type, properties, required.
- data_schema:
- type: object
- unevaluatedProperties: {}
- description: The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like type, properties, required.
- metrics:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/EvaluatorMetric'
- description: List of output metrics produced by this evaluator
- discriminator:
- propertyName: type
- mapping:
- code: '#/components/schemas/CodeBasedEvaluatorDefinition'
- prompt: '#/components/schemas/PromptBasedEvaluatorDefinition'
- rubric: '#/components/schemas/RubricBasedEvaluatorDefinition'
- endpoint: '#/components/schemas/EndpointBasedEvaluatorDefinition'
- description: Base evaluator configuration with discriminator
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorDefinitionType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - prompt
- - code
- - prompt_and_code
- - service
- - openai_graders
- - rubric
- - endpoint
- description: The type of evaluator definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationArtifacts:
+ - static
+ x-stainless-const: true
+ static:
+ $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic'
+ OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic:
type: object
required:
- - dataset
- - kinds
+ - max_chunk_size_tokens
+ - chunk_overlap_tokens
properties:
- dataset:
- $ref: '#/components/schemas/DatasetReference'
- description: Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to `EvaluatorVersion.version`) holding all artifacts produced by the generation pipeline. Each row in the JSONL carries a `kind` field discriminating its content (e.g. `spec`, `tools`, `context`).
- kinds:
+ max_chunk_size_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 100
+ maximum: 4096
+ chunk_overlap_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.CreateTranscriptionRequest:
+ type: object
+ properties:
+ file:
+ description: 'The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.'
+ x-oaiTypeLabel: file
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - whisper-1
+ - gpt-4o-transcribe
+ - gpt-4o-mini-transcribe
+ - gpt-4o-mini-transcribe-2025-12-15
+ - gpt-4o-transcribe-diarize
+ description: ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`.
+ x-oaiTypeLabel: string
+ language:
+ type: string
+ description: 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.
+ prompt:
+ type: string
+ description: An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`.
+ response_format:
+ $ref: '#/components/schemas/OpenAI.AudioResponseFormat'
+ temperature:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: 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.
+ include:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionInclude'
+ description: |-
+ 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`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`.
+ timestamp_granularities:
type: array
items:
type: string
- description: The kinds of rows present in `dataset`. Always contains `"spec"` (the generated evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain `"tools"` (when the generation pipeline produced or inferred OpenAI tool schemas) and/or `"context"` (when supplementary materials such as file uploads or trace samples were used during generation).
- description: Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a versioned dataset in a service-reserved namespace.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationInputs:
- type: object
+ enum:
+ - word
+ - segment
+ description: |-
+ 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.
+ This option is not available for `gpt-4o-transcribe-diarize`.
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ chunking_strategy:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.VadConfig'
+ - type: 'null'
+ known_speaker_names:
+ $ref: '#/components/schemas/OpenAI.KnownSpeakerNames'
+ known_speaker_references:
+ $ref: '#/components/schemas/OpenAI.KnownSpeakerReferences'
required:
- - sources
+ - file
- model
- - evaluator_name
+ OpenAI.CreateTranscriptionResponseDiarizedJson:
+ type: object
+ required:
+ - task
+ - duration
+ - text
+ - segments
properties:
- sources:
- type: array
- items:
- $ref: '#/components/schemas/EvaluatorGenerationJobSource'
- description: Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry is an `EvaluatorGenerationJobSource` variant discriminated by `type`.
- model:
- type: string
- description: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide their own model rather than relying on service-owned capacity.
- evaluator_name:
- type: string
- minLength: 1
- maxLength: 256
- pattern: ^[A-Za-z0-9_.~-]+$
- description: The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII letters, digits, underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` is reserved for system-managed evaluators and is rejected by the service. If an evaluator with this name already exists in the project (and is rubric-subtype), the service creates a new version under the same name and uses the prior version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive loop). Old versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`.
- evaluator_display_name:
+ task:
type: string
- description: Optional human-friendly display name for the resulting evaluator. Surfaced as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier.
- evaluator_description:
+ enum:
+ - transcribe
+ description: The type of task that was run. Always `transcribe`.
+ x-stainless-const: true
+ duration:
+ type: integer
+ format: int64
+ description: Duration of the input audio in seconds.
+ x-ms-duration: seconds
+ text:
type: string
- description: Optional human-friendly description for the resulting evaluator. Surfaced as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related models.
- description: Caller-supplied inputs for an evaluator generation job.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationJob:
+ description: The concatenated transcript text for the entire audio input.
+ segments:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionDiarizedSegment'
+ description: Segments of the transcript annotated with timestamps and speaker labels.
+ usage:
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage'
+ description: Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.
+ x-oaiMeta:
+ name: The transcription object (Diarized JSON)
+ group: audio
+ example: |
+ {
+ "task": "transcribe",
+ "duration": 42.7,
+ "text": "Agent: Thanks for calling OpenAI support.
+ Customer: Hi, I need help with diarization.",
+ "segments": [
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_001",
+ "start": 0.0,
+ "end": 5.2,
+ "text": "Thanks for calling OpenAI support.",
+ "speaker": "agent"
+ },
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_002",
+ "start": 5.2,
+ "end": 12.8,
+ "text": "Hi, I need help with diarization.",
+ "speaker": "A"
+ }
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 43
+ }
+ }
+ OpenAI.CreateTranscriptionResponseJson:
type: object
required:
- - id
- - status
- - created_at
+ - text
properties:
- id:
+ text:
type: string
- description: Server-assigned unique identifier.
- readOnly: true
- inputs:
- $ref: '#/components/schemas/EvaluatorGenerationInputs'
- description: Caller-supplied inputs.
- result:
- $ref: '#/components/schemas/EvaluatorVersion'
- description: Result produced on success.
- readOnly: true
- status:
- $ref: '#/components/schemas/JobStatus'
- description: Current lifecycle status.
- readOnly: true
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error details — populated only on failure.
- readOnly: true
- created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970).
- readOnly: true
- finished_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970).
- readOnly: true
+ description: The transcribed text.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonLogprobs'
+ description: 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.
usage:
- $ref: '#/components/schemas/EvaluatorGenerationTokenUsage'
- description: Token consumption summary. Populated when the job reaches a terminal state.
- readOnly: true
- description: Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationJobCreate:
- type: object
- properties:
- inputs:
- $ref: '#/components/schemas/EvaluatorGenerationInputs'
- description: Caller-supplied inputs.
- description: Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationJobSource:
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage'
+ description: Represents a transcription response returned by model, based on the provided input.
+ x-oaiMeta:
+ name: The transcription object (JSON)
+ group: audio
+ example: |
+ {
+ "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.",
+ "usage": {
+ "type": "tokens",
+ "input_tokens": 14,
+ "input_token_details": {
+ "text_tokens": 10,
+ "audio_tokens": 4
+ },
+ "output_tokens": 101,
+ "total_tokens": 115
+ }
+ }
+ OpenAI.CreateTranscriptionResponseJsonLogprobs:
+ type: object
+ properties:
+ token:
+ type: string
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ bytes:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.CreateTranscriptionResponseJsonUsage:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/EvaluatorGenerationJobSourceType'
- description: The type of source.
+ $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsageType'
discriminator:
propertyName: type
mapping:
- prompt: '#/components/schemas/PromptEvaluatorGenerationJobSource'
- agent: '#/components/schemas/AgentEvaluatorGenerationJobSource'
- traces: '#/components/schemas/TracesEvaluatorGenerationJobSource'
- dataset: '#/components/schemas/DatasetEvaluatorGenerationJobSource'
- description: The base source model for evaluator generation jobs. Polymorphic over `type`.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationJobSourceType:
+ duration: '#/components/schemas/OpenAI.TranscriptTextUsageDuration'
+ tokens: '#/components/schemas/OpenAI.TranscriptTextUsageTokens'
+ description: Token usage statistics for the request.
+ OpenAI.CreateTranscriptionResponseJsonUsageType:
anyOf:
- type: string
- type: string
enum:
- - prompt
- - agent
- - traces
- - dataset
- description: The supported source types for evaluator generation jobs.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorGenerationTokenUsage:
+ - tokens
+ - duration
+ OpenAI.CreateTranscriptionResponseVerboseJson:
type: object
required:
- - input_tokens
- - output_tokens
- - total_tokens
+ - language
+ - duration
+ - text
properties:
- input_tokens:
- type: integer
- format: int64
- description: Number of input (prompt) tokens consumed.
- output_tokens:
- type: integer
- format: int64
- description: Number of output (completion) tokens generated.
- total_tokens:
+ language:
+ type: string
+ description: The language of the input audio.
+ duration:
type: integer
format: int64
- description: Total tokens consumed (input + output).
- description: Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state.
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorMetric:
+ description: The duration of the input audio.
+ x-ms-duration: seconds
+ text:
+ type: string
+ description: The transcribed text.
+ words:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionWord'
+ description: Extracted words and their corresponding timestamps.
+ segments:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionSegment'
+ description: Segments of the transcribed text and their corresponding details.
+ usage:
+ $ref: '#/components/schemas/OpenAI.TranscriptTextUsageDuration'
+ description: Represents a verbose json transcription response returned by model, based on the provided input.
+ x-oaiMeta:
+ name: The transcription object (Verbose JSON)
+ group: audio
+ example: |
+ {
+ "task": "transcribe",
+ "language": "english",
+ "duration": 8.470000267028809,
+ "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
+ "segments": [
+ {
+ "id": 0,
+ "seek": 0,
+ "start": 0.0,
+ "end": 3.319999933242798,
+ "text": " The beach was a popular spot on a hot summer day.",
+ "tokens": [
+ 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530
+ ],
+ "temperature": 0.0,
+ "avg_logprob": -0.2860786020755768,
+ "compression_ratio": 1.2363636493682861,
+ "no_speech_prob": 0.00985979475080967
+ },
+ ...
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 9
+ }
+ }
+ OpenAI.CreateTranslationRequest:
type: object
properties:
- type:
- $ref: '#/components/schemas/EvaluatorMetricType'
- description: Type of the metric.
- desirable_direction:
- $ref: '#/components/schemas/EvaluatorMetricDirection'
- description: It indicates whether a higher value is better or a lower value is better for this metric.
- min_value:
- type: number
- format: float
- description: Minimum value for the metric
- max_value:
- type: number
- format: float
- description: Maximum value for the metric. If not specified, it is assumed to be unbounded.
- threshold:
- type: number
- format: float
- description: Default pass/fail threshold for this metric.
- is_primary:
- type: boolean
- description: Indicates if this metric is primary when there are multiple metrics.
- description: Evaluator Metric
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorMetricDirection:
- anyOf:
- - type: string
- - type: string
- enum:
- - increase
- - decrease
- - neutral
- description: The direction of the metric indicating whether a higher value is better, a lower value is better, or neutral
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorMetricType:
- anyOf:
- - type: string
- - type: string
- enum:
- - ordinal
- - continuous
- - boolean
- description: The type of the evaluator
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorType:
- anyOf:
- - type: string
- - type: string
+ file:
+ description: 'The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.'
+ x-oaiTypeLabel: file
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - whisper-1
+ description: ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available.
+ x-oaiTypeLabel: string
+ prompt:
+ type: string
+ description: An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should be in English.
+ response_format:
+ type: string
enum:
- - builtin
- - custom
- description: The type of the evaluator
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorVersion:
+ - json
+ - text
+ - srt
+ - verbose_json
+ - vtt
+ description: 'The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.'
+ temperature:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: 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.
+ required:
+ - file
+ - model
+ OpenAI.CreateTranslationResponseJson:
type: object
required:
- - evaluator_type
- - categories
- - definition
- - created_by
- - created_at
- - modified_at
- - name
- - version
+ - text
properties:
- display_name:
+ text:
type: string
- description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
- metadata:
- type: object
- unevaluatedProperties:
+ OpenAI.CreateTranslationResponseVerboseJson:
+ type: object
+ required:
+ - language
+ - duration
+ - text
+ properties:
+ language:
+ type: string
+ description: The language of the output translation (always `english`).
+ duration:
+ type: integer
+ format: int64
+ description: The duration of the input audio.
+ x-ms-duration: seconds
+ text:
+ type: string
+ description: The translated text.
+ segments:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TranscriptionSegment'
+ description: Segments of the translated text and their corresponding details.
+ OpenAI.CreateUploadRequest:
+ type: object
+ required:
+ - filename
+ - purpose
+ - bytes
+ - mime_type
+ properties:
+ filename:
+ type: string
+ description: The name of the file to upload.
+ purpose:
+ type: string
+ enum:
+ - assistants
+ - batch
+ - fine-tune
+ - vision
+ description: |-
+ The intended purpose of the uploaded file.
+ See the [documentation on File
+ purposes](/docs/api-reference/files/create#files-create-purpose).
+ bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of bytes in the file you are uploading.
+ mime_type:
+ type: string
+ description: |-
+ 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.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.FileExpirationAfter'
+ OpenAI.CreateVectorStoreFileBatchRequest:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
type: string
- description: Metadata about the evaluator
- evaluator_type:
- $ref: '#/components/schemas/EvaluatorType'
- description: The type of the evaluator
- categories:
+ minItems: 1
+ maxItems: 2000
+ description: A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied to all files in the batch. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `files`.
+ files:
type: array
items:
- $ref: '#/components/schemas/EvaluatorCategory'
- description: The categories of the evaluator
- supported_evaluation_levels:
+ $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileRequest'
+ minItems: 1
+ maxItems: 2000
+ description: A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must be specified for each file. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with `file_ids`.
+ chunking_strategy:
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ OpenAI.CreateVectorStoreFileRequest:
+ type: object
+ required:
+ - file_id
+ properties:
+ file_id:
+ type: string
+ description: A [File](/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. For multi-file ingestion, we recommend [`file_batches`](/docs/api-reference/vector-stores-file-batches/createBatch) to minimize per-vector-store write requests.
+ chunking_strategy:
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ OpenAI.CreateVectorStoreRequest:
+ type: object
+ properties:
+ file_ids:
type: array
items:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
- default:
- - turn
- definition:
- $ref: '#/components/schemas/EvaluatorDefinition'
- description: Definition of the evaluator
- generation_artifacts:
- $ref: '#/components/schemas/EvaluatorGenerationArtifacts'
- description: Provenance artifacts from the generation pipeline. Read-only; present only on evaluator versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry Dataset.
- readOnly: true
- created_by:
+ type: string
+ maxItems: 500
+ description: A list of [File](/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files.
+ name:
type: string
- description: Creator of the evaluator
- readOnly: true
- created_at:
+ description: The name of the vector store.
+ description:
type: string
- description: Creation date/time of the evaluator
- readOnly: true
- modified_at:
+ description: A description for the vector store. Can be used to describe the vector store's purpose.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter'
+ chunking_strategy:
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ description: 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.
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.CreateVideoCharacterBody:
+ type: object
+ properties:
+ video:
+ description: Video file used to create a character.
+ name:
type: string
- description: Last modified date/time of the evaluator
- readOnly: true
- id:
+ description: Display name for this API character.
+ required:
+ - video
+ - name
+ OpenAI.CreateVideoEditJsonBody:
+ type: object
+ required:
+ - video
+ - prompt
+ properties:
+ video:
+ $ref: '#/components/schemas/OpenAI.VideoReferenceInputParam'
+ description: Reference to the completed video to edit.
+ prompt:
type: string
- description: Asset ID, a unique identifier for the asset
- readOnly: true
- name:
+ minLength: 1
+ maxLength: 32000
+ description: Text prompt that describes how to edit the source video.
+ description: JSON parameters for editing an existing generated video.
+ title: Create video edit JSON request
+ OpenAI.CreateVideoEditMultipartBody:
+ type: object
+ properties:
+ video:
+ $ref: '#/components/schemas/OpenAI.CreateVideoEditMultipartBodyVideo'
+ prompt:
type: string
- description: The name of the resource
- readOnly: true
- version:
+ description: Text prompt that describes how to edit the source video.
+ required:
+ - video
+ - prompt
+ OpenAI.CreateVideoEditMultipartBodyVideo:
+ oneOf:
+ - {}
+ - $ref: '#/components/schemas/OpenAI.VideoReferenceInputParam'
+ OpenAI.CreateVideoExtendJsonBody:
+ type: object
+ required:
+ - video
+ - prompt
+ - seconds
+ properties:
+ video:
+ $ref: '#/components/schemas/OpenAI.VideoReferenceInputParam'
+ description: Reference to the completed video to extend.
+ prompt:
type: string
- description: The version of the resource
- readOnly: true
- description: Evaluator Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorVersionCreate:
+ minLength: 1
+ maxLength: 32000
+ description: Updated text prompt that directs the extension generation.
+ seconds:
+ $ref: '#/components/schemas/OpenAI.VideoSeconds'
+ description: 'Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).'
+ description: JSON parameters for extending an existing generated video.
+ title: Create video extension JSON request
+ OpenAI.CreateVideoExtendMultipartBody:
+ type: object
+ properties:
+ video:
+ $ref: '#/components/schemas/OpenAI.CreateVideoExtendMultipartBodyVideo'
+ prompt:
+ type: string
+ description: Updated text prompt that directs the extension generation.
+ seconds:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoSeconds'
+ description: 'Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).'
+ required:
+ - video
+ - prompt
+ - seconds
+ OpenAI.CreateVideoExtendMultipartBodyVideo:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.VideoReferenceInputParam'
+ - {}
+ OpenAI.CreateVideoMultipartBody:
+ type: object
+ properties:
+ model:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoModel'
+ description: 'The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to `sora-2`.'
+ prompt:
+ type: string
+ description: Text prompt that describes the video to generate.
+ input_reference:
+ $ref: '#/components/schemas/OpenAI.CreateVideoMultipartBodyInputReference'
+ seconds:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoSeconds'
+ description: 'Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.'
+ size:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoSize'
+ description: 'Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.'
+ required:
+ - prompt
+ OpenAI.CreateVideoMultipartBodyInputReference:
+ oneOf:
+ - {}
+ - $ref: '#/components/schemas/OpenAI.ImageRefParam'
+ OpenAI.CreateVideoRemixBody:
type: object
+ properties:
+ prompt:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.VideoPrompt'
+ description: Updated text prompt that directs the remix generation.
required:
- - evaluator_type
- - categories
+ - prompt
+ OpenAI.CustomGrammarFormatParam:
+ type: object
+ required:
+ - type
+ - syntax
- definition
properties:
- display_name:
+ type:
type: string
- description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Metadata about the evaluator
- evaluator_type:
- $ref: '#/components/schemas/EvaluatorType'
- description: The type of the evaluator
- categories:
- type: array
- items:
- $ref: '#/components/schemas/EvaluatorCategory'
- description: The categories of the evaluator
- supported_evaluation_levels:
- type: array
- items:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
- default:
- - turn
+ enum:
+ - grammar
+ description: Grammar format. Always `grammar`.
+ x-stainless-const: true
+ syntax:
+ $ref: '#/components/schemas/OpenAI.GrammarSyntax1'
+ description: The syntax of the grammar definition. One of `lark` or `regex`.
definition:
- $ref: '#/components/schemas/EvaluatorDefinition'
- description: Definition of the evaluator
- description:
type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- description: Evaluator Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- EvaluatorVersionUpdate:
+ description: The grammar definition.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
+ description: A grammar defined by the user.
+ title: Grammar format
+ OpenAI.CustomTextFormatParam:
type: object
+ required:
+ - type
properties:
- display_name:
+ type:
+ type: string
+ enum:
+ - text
+ description: Unconstrained text format. Always `text`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
+ description: Unconstrained free-form text.
+ title: Text format
+ OpenAI.CustomToolChatCompletions:
+ type: object
+ required:
+ - type
+ - custom
+ properties:
+ type:
+ type: string
+ enum:
+ - custom
+ description: The type of the custom tool. Always `custom`.
+ x-stainless-const: true
+ custom:
+ $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustom'
+ description: Properties of the custom tool.
+ title: Custom tool properties
+ description: A custom tool that processes input using a specified format.
+ title: Custom tool
+ OpenAI.CustomToolChatCompletionsCustom:
+ type: object
+ required:
+ - name
+ properties:
+ name:
type: string
- description: Display Name for evaluator. It helps to find the evaluator easily in AI Foundry. It does not need to be unique.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Metadata about the evaluator
- categories:
- type: array
- items:
- $ref: '#/components/schemas/EvaluatorCategory'
- description: The categories of the evaluator
- supported_evaluation_levels:
- type: array
- items:
- $ref: '#/components/schemas/EvaluationLevel'
- description: Evaluation levels this evaluator supports (e.g., `turn`, `conversation`). When omitted on create, the service defaults to `["turn"]`. On update, omitting this field leaves it unchanged; an empty list is rejected. Custom code-based evaluators support only `turn`; custom prompt-based evaluators support exactly one level (`turn` or `conversation`).
- default:
- - turn
description:
type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- description: Evaluator Definition
- x-ms-foundry-meta:
- required_previews:
- - Evaluations=V1Preview
- ExternalAgentDefinition:
+ format:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatText'
+ - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammar'
+ OpenAI.CustomToolChatCompletionsCustomFormatGrammar:
type: object
required:
- - kind
+ - type
+ - grammar
properties:
- kind:
+ type:
type: string
enum:
- - external
- otel_agent_id:
+ - grammar
+ x-stainless-const: true
+ grammar:
+ $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar'
+ title: Grammar format
+ OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar:
+ type: object
+ required:
+ - definition
+ - syntax
+ properties:
+ definition:
type: string
- description: |-
- The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry agent.
- Spans must include the attribute `gen_ai.agent.id = ` to appear under this registration.
- Defaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios
- where the running external agent already emits a stable id that differs from the Foundry agent name.
- The resolved value is always echoed on read.
- allOf:
- - $ref: '#/components/schemas/AgentDefinition'
- description: |-
- The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS).
- Registration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, evaluations)
- over customer-emitted OpenTelemetry data.
- x-ms-foundry-meta:
- required_previews:
- - ExternalAgents=V1Preview
- FabricDataAgentToolCall:
+ syntax:
+ type: string
+ enum:
+ - lark
+ - regex
+ OpenAI.CustomToolChatCompletionsCustomFormatText:
type: object
required:
- type
- - call_id
- - arguments
- - status
properties:
type:
type: string
enum:
- - fabric_dataagent_preview_call
- call_id:
+ - text
+ x-stainless-const: true
+ OpenAI.CustomToolParam:
+ type: object
+ required:
+ - type
+ - name
+ properties:
+ type:
type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
+ enum:
+ - custom
+ description: The type of the custom tool. Always `custom`.
+ x-stainless-const: true
+ name:
type: string
- description: A JSON string of the arguments to pass to the tool.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ description: The name of the custom tool, used to identify it in tool calls.
+ description:
+ type: string
+ description: Optional description of the custom tool, used to provide more context.
+ format:
+ $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
+ description: The input format for the custom tool. Default is unconstrained text.
+ defer_loading:
+ type: boolean
+ description: Whether this tool should be deferred and discovered via tool search.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A Fabric data agent tool call.
- FabricDataAgentToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)
+ title: Custom tool
+ OpenAI.CustomToolParamFormat:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.CustomToolParamFormatType'
+ discriminator:
+ propertyName: type
+ mapping:
+ text: '#/components/schemas/OpenAI.CustomTextFormatParam'
+ grammar: '#/components/schemas/OpenAI.CustomGrammarFormatParam'
+ description: The input format for the custom tool. Default is unconstrained text.
+ OpenAI.CustomToolParamFormatType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - text
+ - grammar
+ OpenAI.DeleteAssistantResponse:
type: object
required:
- - type
- - call_id
- - status
+ - id
+ - deleted
+ - object
properties:
- type:
+ id:
type: string
- enum:
- - fabric_dataagent_preview_call_output
- call_id:
+ deleted:
+ type: boolean
+ object:
type: string
- description: The unique ID of the tool call generated by the model.
- output:
- $ref: '#/components/schemas/ToolCallOutputContent'
- description: The output from the Fabric data agent tool call.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a Fabric data agent tool call.
- FabricDataAgentToolParameters:
- type: object
- properties:
- project_connections:
- type: array
- items:
- $ref: '#/components/schemas/ToolProjectConnection'
- maxItems: 1
- description: |-
- The project connections attached to this tool. There can be a maximum of 1 connection
- resource attached to the tool.
- description: The fabric data agent tool parameters.
- FabricIQPreviewTool:
+ enum:
+ - assistant.deleted
+ x-stainless-const: true
+ OpenAI.DeleteFileResponse:
type: object
required:
- - type
- - project_connection_id
+ - id
+ - object
+ - deleted
properties:
- type:
+ id:
type: string
- enum:
- - fabric_iq_preview
- description: The object type, which is always 'fabric_iq_preview'.
- project_connection_id:
+ object:
type: string
- description: The ID of the FabricIQ project connection.
- server_label:
+ enum:
+ - file
+ x-stainless-const: true
+ deleted:
+ type: boolean
+ OpenAI.DeleteFineTuningCheckpointPermissionResponse:
+ type: object
+ required:
+ - id
+ - object
+ - deleted
+ properties:
+ id:
type: string
- description: (Optional) The label of the FabricIQ MCP server to connect to.
- server_url:
+ description: The ID of the fine-tuned model checkpoint permission that was deleted.
+ object:
type: string
- format: uri
- description: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used.
- require_approval:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
- - type: string
- - type: 'null'
- description: (Optional) Whether the agent requires approval before executing actions. Default is always.
- default: always
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A FabricIQ server-side tool.
- FabricIQPreviewToolboxTool:
+ enum:
+ - checkpoint.permission
+ description: The object type, which is always "checkpoint.permission".
+ x-stainless-const: true
+ deleted:
+ type: boolean
+ description: Whether the fine-tuned model checkpoint permission was successfully deleted.
+ OpenAI.DeleteMessageResponse:
type: object
required:
- - type
- - project_connection_id
+ - id
+ - deleted
+ - object
properties:
- type:
+ id:
type: string
- enum:
- - fabric_iq_preview
- project_connection_id:
+ deleted:
+ type: boolean
+ object:
type: string
- description: The ID of the FabricIQ project connection.
- server_label:
+ enum:
+ - thread.message.deleted
+ x-stainless-const: true
+ OpenAI.DeleteModelResponse:
+ type: object
+ required:
+ - id
+ - deleted
+ - object
+ properties:
+ id:
type: string
- description: (Optional) The label of the FabricIQ MCP server to connect to.
- server_url:
+ deleted:
+ type: boolean
+ object:
type: string
- format: uri
- description: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used.
- require_approval:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
- - type: string
- - type: 'null'
- description: (Optional) Whether the agent requires approval before executing actions. Default is always.
- default: always
- allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: A FabricIQ tool stored in a toolbox.
- FileDataGenerationJobOutput:
+ OpenAI.DeleteThreadResponse:
type: object
required:
- - type
- id
- - filename
+ - deleted
+ - object
properties:
- type:
- type: string
- enum:
- - file
- description: Azure OpenAI file output.
id:
type: string
- description: The id of the output Azure OpenAI file.
- readOnly: true
- filename:
+ deleted:
+ type: boolean
+ object:
type: string
- description: The filename of the output Azure OpenAI file.
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/DataGenerationJobOutput'
- description: Azure OpenAI file output for a data generation job.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- FileDataGenerationJobSource:
+ enum:
+ - thread.deleted
+ x-stainless-const: true
+ OpenAI.DeleteVectorStoreFileResponse:
type: object
required:
- - type
- id
+ - deleted
+ - object
properties:
- type:
+ id:
+ type: string
+ deleted:
+ type: boolean
+ object:
type: string
enum:
- - file
- description: The source type for this job, which is File.
+ - vector_store.file.deleted
+ x-stainless-const: true
+ OpenAI.DeleteVectorStoreResponse:
+ type: object
+ required:
+ - id
+ - deleted
+ - object
+ properties:
id:
type: string
- description: Input Azure Open AI file id used for data generation.
- allOf:
- - $ref: '#/components/schemas/DataGenerationJobSource'
- description: File source for data generation jobs — Azure OpenAI file input.
- x-ms-foundry-meta:
- conditional_previews:
- - DataGenerationJobs=V1Preview
- FileDatasetVersion:
+ deleted:
+ type: boolean
+ object:
+ type: string
+ enum:
+ - vector_store.deleted
+ x-stainless-const: true
+ OpenAI.DeletedConversationResource:
type: object
required:
- - type
+ - object
+ - deleted
+ - id
properties:
- type:
+ object:
type: string
enum:
- - uri_file
- description: Dataset type
- allOf:
- - $ref: '#/components/schemas/DatasetVersion'
- description: FileDatasetVersion Definition
- FileDatasetVersionUpdate:
+ - conversation.deleted
+ x-stainless-const: true
+ default: conversation.deleted
+ deleted:
+ type: boolean
+ id:
+ type: string
+ OpenAI.DeletedVideoResource:
type: object
required:
- - type
+ - object
+ - deleted
+ - id
properties:
- type:
+ object:
type: string
enum:
- - uri_file
- description: Dataset type
- allOf:
- - $ref: '#/components/schemas/DatasetVersionUpdate'
- description: FileDatasetVersion Definition
- FileSearchToolboxTool:
+ - video.deleted
+ description: The object type that signals the deletion response.
+ x-stainless-const: true
+ default: video.deleted
+ deleted:
+ type: boolean
+ description: Indicates that the video resource was deleted.
+ id:
+ type: string
+ description: Identifier of the deleted video.
+ description: Confirmation payload returned after deleting a video.
+ title: Deleted video response
+ OpenAI.DetailEnum:
+ type: string
+ enum:
+ - low
+ - high
+ - auto
+ - original
+ OpenAI.DoubleClickAction:
type: object
required:
- type
+ - x
+ - 'y'
+ - keys
properties:
type:
type: string
enum:
- - file_search
- max_num_results:
+ - double_click
+ description: Specifies the event type. For a double click action, this property is always set to `double_click`.
+ x-stainless-const: true
+ x:
$ref: '#/components/schemas/OpenAI.integer'
- description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
- ranking_options:
- $ref: '#/components/schemas/OpenAI.RankingOptions'
- description: Ranking options for search.
- filters:
+ description: The x-coordinate where the double click occurred.
+ 'y':
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The y-coordinate where the double click occurred.
+ keys:
anyOf:
- - $ref: '#/components/schemas/OpenAI.Filters'
+ - type: array
+ items:
+ type: string
- type: 'null'
- vector_store_ids:
- type: array
- items:
- type: string
- description: The IDs of the vector stores to search.
allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: A file search tool stored in a toolbox.
- FilterStrategyType:
- anyOf:
- - type: string
- - type: string
- enum:
- - random_sampling
- - smart_filtering
- description: Specifies the type of filter strategy used to select traces for evaluation.
- FixedRatioVersionSelectionRule:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A double click action.
+ title: DoubleClick
+ OpenAI.DragParam:
type: object
required:
- type
- - traffic_percentage
+ - path
properties:
type:
type: string
enum:
- - FixedRatio
- traffic_percentage:
- type: integer
- format: int32
- minimum: 0
- maximum: 100
- description: The percentage of traffic to route to the version. Must be between 0 and 100.
+ - drag
+ description: Specifies the event type. For a drag action, this property is always set to `drag`.
+ x-stainless-const: true
+ path:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.CoordParam'
+ description: |-
+ 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 }
+ ]
+ ```
+ keys:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/VersionSelectionRule'
- FolderDatasetVersion:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A drag action.
+ title: Drag
+ OpenAI.EasyInputMessage:
type: object
required:
+ - role
+ - content
- type
properties:
- type:
+ role:
type: string
enum:
- - uri_folder
- description: Dataset type
- allOf:
- - $ref: '#/components/schemas/DatasetVersion'
- description: FileDatasetVersion Definition
- FolderDatasetVersionUpdate:
- type: object
- required:
- - type
- properties:
+ - user
+ - assistant
+ - system
+ - developer
+ description: |-
+ The role of the message input. One of `user`, `assistant`, `system`, or
+ `developer`.
+ content:
+ oneOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.InputMessageContentList'
+ description: |-
+ Text, image, or audio input to the model, used to generate a response.
+ Can also contain previous assistant responses.
+ phase:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
+ - type: 'null'
type:
type: string
enum:
- - uri_folder
- description: Dataset type
- allOf:
- - $ref: '#/components/schemas/DatasetVersionUpdate'
- description: FileDatasetVersion Definition
- FoundryModelArtifactProfileCategory:
- anyOf:
- - type: string
- - type: string
- enum:
- - DataOnly
- - RuntimeDependent
- - Unknown
- description: The artifact profile category.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelArtifactProfileSignal:
- anyOf:
- - type: string
- - type: string
- enum:
- - PickleDeserialization
- - CustomPythonCode
- - DynamicOps
- - NativeBinary
- - UnknownFormat
- description: Signals detected in the model artifact.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelSourceType:
- anyOf:
- - type: string
- - type: string
+ - message
+ description: The type of the message input. Always `message`.
+ x-stainless-const: true
+ status:
+ type: string
enum:
- - LocalUpload
- - TrainingJob
- description: The source type of the model.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelWarning:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ 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.
+ title: Input message
+ OpenAI.EditImageBodyJsonParam:
type: object
+ required:
+ - images
+ - prompt
properties:
- code:
- $ref: '#/components/schemas/FoundryModelWarningCode'
- description: The warning code.
- message:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - gpt-image-1.5
+ - gpt-image-1
+ - gpt-image-1-mini
+ - chatgpt-image-latest
+ - type: 'null'
+ description: The model to use for image editing.
+ x-oaiTypeLabel: string
+ default: gpt-image-1.5
+ images:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ImageRefParam'
+ minItems: 1
+ maxItems: 16
+ description: |-
+ Input image references to edit.
+ For GPT image models, you can provide up to 16 images.
+ mask:
+ $ref: '#/components/schemas/OpenAI.ImageRefParam'
+ prompt:
type: string
- description: The warning message.
- description: A warning associated with a model.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelWarningCode:
- anyOf:
- - type: string
- - type: string
- enum:
- - RuntimeDependentArtifact
- - UnclassifiedArtifact
- description: Warning code for model artifacts.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryModelWeightType:
- anyOf:
- - type: string
- - type: string
- enum:
- - FullWeight
- - LoRA
- - DraftModel
- description: The weight type of the model.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- FoundryTimestamp:
- type: integer
- format: unixtime
- FunctionToolCall:
+ minLength: 1
+ maxLength: 32000
+ description: A text description of the desired image edit.
+ 'n':
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: The number of edited images to generate.
+ default: 1
+ quality:
+ anyOf:
+ - type: string
+ enum:
+ - low
+ - medium
+ - high
+ - auto
+ - type: 'null'
+ description: Output quality for GPT image models.
+ default: auto
+ input_fidelity:
+ anyOf:
+ - type: string
+ enum:
+ - high
+ - low
+ - type: 'null'
+ description: Controls fidelity to the original input image(s).
+ size:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - 1024x1024
+ - 1536x1024
+ - 1024x1536
+ - type: 'null'
+ description: Requested output image size.
+ default: auto
+ user:
+ type: string
+ description: |-
+ A unique identifier representing your end-user, which can help OpenAI
+ monitor and detect abuse.
+ output_format:
+ anyOf:
+ - type: string
+ enum:
+ - png
+ - jpeg
+ - webp
+ - type: 'null'
+ description: Output image format. Supported for GPT image models.
+ default: png
+ output_compression:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: Compression level for `jpeg` or `webp` output.
+ moderation:
+ anyOf:
+ - type: string
+ enum:
+ - low
+ - auto
+ - type: 'null'
+ description: Moderation level for GPT image models.
+ default: auto
+ background:
+ anyOf:
+ - type: string
+ enum:
+ - transparent
+ - opaque
+ - auto
+ - type: 'null'
+ description: Background behavior for generated image output.
+ default: auto
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ description: Stream partial image results as events.
+ partial_images:
+ $ref: '#/components/schemas/OpenAI.PartialImages'
+ description: |-
+ JSON request body for image edits.
+ Use `images` (array of `ImageRefParam`) instead of multipart `image` uploads.
+ You can reference images via external URLs, data URLs, or uploaded file IDs.
+ JSON edits support GPT image models only; DALL-E edits require multipart (`dall-e-2` only).
+ OpenAI.Embedding:
type: object
required:
- - name
- - arguments
+ - index
+ - embedding
+ - object
properties:
- name:
- type: string
- description: The name of the function to call.
- arguments:
+ index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the embedding in the list of embeddings.
+ embedding:
+ type: array
+ items:
+ type: number
+ format: float
+ description: The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings).
+ object:
type: string
- description: The arguments to call the function with, as generated by the model in JSON format.
- description: Details of a function tool call.
- GitHubIssueEvent:
- anyOf:
- - type: string
- - type: string
enum:
- - opened
- - closed
- description: Known GitHub issue events that can fire a routine.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- GitHubIssueRoutineTrigger:
+ - embedding
+ description: The object type, which is always "embedding".
+ x-stainless-const: true
+ description: Represents an embedding vector returned by embedding endpoint.
+ x-oaiMeta:
+ name: The embedding object
+ example: |
+ {
+ "object": "embedding",
+ "embedding": [
+ 0.0023064255,
+ -0.009327292,
+ .... (1536 floats total for ada-002)
+ -0.0028842222,
+ ],
+ "index": 0
+ }
+ OpenAI.EmptyModelParam:
+ type: object
+ OpenAI.Error:
type: object
required:
- - type
- - connection_id
- - owner
- - repository
- - issue_event
+ - code
+ - message
properties:
- type:
- type: string
- enum:
- - github_issue
- description: The trigger type.
- connection_id:
- type: string
- maxLength: 256
- description: The workspace connection identifier that resolves the GitHub configuration for the trigger.
- owner:
+ code:
+ anyOf:
+ - type: string
+ - type: 'null'
+ message:
type: string
- maxLength: 128
- description: The GitHub owner or organization that scopes which issues can fire the trigger.
- repository:
+ param:
+ anyOf:
+ - type: string
+ - type: 'null'
+ type:
type: string
- maxLength: 128
- description: The GitHub repository filter that scopes which issues can fire the trigger.
- issue_event:
- $ref: '#/components/schemas/GitHubIssueEvent'
- description: The GitHub issue event that fires the routine.
- allOf:
- - $ref: '#/components/schemas/RoutineTrigger'
- description: A GitHub issue routine trigger.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- HeaderTelemetryEndpointAuth:
+ details:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Error'
+ additionalInfo:
+ type: object
+ unevaluatedProperties: {}
+ debugInfo:
+ type: object
+ unevaluatedProperties: {}
+ OpenAI.Error-2:
type: object
required:
- - type
- - header_name
- - secret_id
- - secret_key
+ - code
+ - message
properties:
- type:
+ code:
type: string
- enum:
- - header
- description: The authentication type, always 'header' for header-based secret authentication.
- header_name:
+ description: A machine-readable error code that was returned.
+ message:
type: string
- description: The name of the HTTP header to inject the secret value into.
- examples:
- - X-Otlp-Api-Key
- secret_id:
+ description: A human-readable description of the error that was returned.
+ description: An error that occurred while generating the response.
+ title: Error
+ OpenAI.EvalApiError:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
type: string
- description: The identifier of the secret store or connection.
- examples:
- - my-secret-store
- secret_key:
+ description: The error code.
+ message:
type: string
- description: The key within the secret to retrieve the authentication value.
- examples:
- - OTLP_KEY
- allOf:
- - $ref: '#/components/schemas/TelemetryEndpointAuth'
- description: Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header.
- HostedAgentDefinition:
+ description: The error message.
+ description: An object representing an error response from the Eval API.
+ title: EvalApiError
+ x-oaiMeta:
+ name: The API error object
+ group: evals
+ example: |
+ {
+ "code": "internal_error",
+ "message": "The eval run failed due to an internal error."
+ }
+ OpenAI.EvalGraderLabelModel:
type: object
required:
- - kind
- - cpu
- - memory
+ - type
+ - name
+ - model
+ - input
+ - labels
+ - passing_labels
properties:
- kind:
+ type:
type: string
enum:
- - hosted
- cpu:
+ - label_model
+ description: The object type, which is always `label_model`.
+ x-stainless-const: true
+ name:
type: string
- description: The CPU configuration for the hosted agent.
- examples:
- - '0.25'
- memory:
+ description: The name of the grader.
+ model:
type: string
- description: The memory configuration for the hosted agent.
- examples:
- - 0.5Gi
- environment_variables:
- type: object
- unevaluatedProperties:
+ description: The model to use for the evaluation. Must support structured outputs.
+ input:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalItem'
+ labels:
+ type: array
+ items:
type: string
- description: Environment variables to set in the hosted agent container.
- examples:
- - name: LOG_LEVEL
- value: debug
- container_configuration:
- $ref: '#/components/schemas/ContainerConfiguration'
- description: Container-based deployment configuration. Provide this for image-based deployments. Mutually exclusive with code_configuration — the service validates that exactly one is set.
- protocol_versions:
+ description: The labels to assign to each item in the evaluation.
+ passing_labels:
type: array
items:
- $ref: '#/components/schemas/ProtocolVersionRecord'
- description: The protocols that the agent supports for ingress communication.
- examples:
- - - protocol: responses
- version: v0.1.1
- - protocol: a2a
- version: v0.3.0
- code_configuration:
- $ref: '#/components/schemas/CodeConfiguration'
- description: Code-based deployment configuration. Provide this for code-based deployments. Mutually exclusive with container_configuration — the service validates that exactly one is set.
- telemetry_config:
- $ref: '#/components/schemas/TelemetryConfig'
- description: Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics.
- allOf:
- - $ref: '#/components/schemas/AgentDefinition'
- description: The hosted agent definition.
- HourlyRecurrenceSchedule:
+ type: string
+ description: The labels that indicate a passing result. Must be a subset of labels.
+ title: LabelModelGrader
+ OpenAI.EvalGraderPython:
type: object
required:
- type
+ - name
+ - source
properties:
type:
type: string
enum:
- - Hourly
- allOf:
- - $ref: '#/components/schemas/RecurrenceSchedule'
- description: Hourly recurrence schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- HumanEvaluationPreviewRuleAction:
- type: object
- required:
- - type
- - templateId
- properties:
- type:
+ - python
+ description: The object type, which is always `python`.
+ x-stainless-const: true
+ name:
type: string
- enum:
- - humanEvaluationPreview
- templateId:
- $ref: '#/components/schemas/AssetId'
- description: Human evaluation template Id.
- allOf:
- - $ref: '#/components/schemas/EvaluationRuleAction'
- description: Evaluation rule action for human evaluation.
- HumanEvaluationRuleAction:
- type: object
- required:
- - type
- - templateId
- properties:
- type:
+ description: The name of the grader.
+ source:
type: string
- enum:
- - humanEvaluation
- templateId:
- $ref: '#/components/schemas/AssetId'
- description: Human evaluation template Id.
- allOf:
- - $ref: '#/components/schemas/EvaluationRuleAction'
- description: Evaluation rule action for human evaluation.
- Index:
+ description: The source code of the python script.
+ image_tag:
+ type: string
+ description: The image tag to use for the python script.
+ pass_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The threshold for the score.
+ title: PythonGrader
+ OpenAI.EvalGraderScoreModel:
type: object
required:
- type
- name
- - version
+ - model
+ - input
properties:
type:
- $ref: '#/components/schemas/IndexType'
- description: Type of index
- id:
type: string
- description: Asset ID, a unique identifier for the asset
- readOnly: true
+ enum:
+ - score_model
+ description: The object type, which is always `score_model`.
+ x-stainless-const: true
name:
type: string
- description: The name of the resource
- readOnly: true
- version:
- type: string
- description: The version of the resource
- readOnly: true
- discriminator:
- propertyName: type
- mapping:
- AzureSearch: '#/components/schemas/AzureAISearchIndex'
- ManagedAzureSearch: '#/components/schemas/ManagedAzureAISearchIndex'
- CosmosDBNoSqlVectorStore: '#/components/schemas/CosmosDBIndex'
- description: Index resource Definition
- IndexType:
- anyOf:
- - type: string
- - type: string
- enum:
- - AzureSearch
- - CosmosDBNoSqlVectorStore
- - ManagedAzureSearch
- IndexUpdate:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/IndexType'
- description: Type of index
- description:
+ description: The name of the grader.
+ model:
type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- discriminator:
- propertyName: type
- mapping:
- AzureSearch: '#/components/schemas/AzureAISearchIndexUpdate'
- ManagedAzureSearch: '#/components/schemas/ManagedAzureAISearchIndexUpdate'
- CosmosDBNoSqlVectorStore: '#/components/schemas/CosmosDBIndexUpdate'
- description: Index resource Definition
- InputData:
+ description: The model to use for the evaluation.
+ sampling_params:
+ $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams'
+ description: The sampling parameters for the model.
+ input:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalItem'
+ description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
+ range:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The range of the score. Defaults to `[0, 1]`.
+ pass_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The threshold for the score.
+ title: ScoreModelGrader
+ OpenAI.EvalGraderScoreModelSamplingParams:
type: object
- required:
- - type
properties:
- type:
- type: string
- description: Type of the data
- discriminator:
- propertyName: type
- mapping:
- dataset: '#/components/schemas/InputDataset'
- description: Abstract data class.
- InputDataset:
+ seed:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ max_completions_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ OpenAI.EvalGraderStringCheck:
type: object
required:
- type
- - id
+ - name
+ - input
+ - reference
+ - operation
properties:
type:
type: string
enum:
- - dataset
- id:
+ - string_check
+ description: The object type, which is always `string_check`.
+ x-stainless-const: true
+ name:
type: string
- description: Evaluation input data
- allOf:
- - $ref: '#/components/schemas/InputData'
- description: Dataset as source for evaluation.
- Insight:
- type: object
- required:
- - id
- - metadata
- - state
- - displayName
- - request
- properties:
- id:
+ description: The name of the grader.
+ input:
type: string
- description: The unique identifier for the insights report.
- readOnly: true
- metadata:
- $ref: '#/components/schemas/InsightsMetadata'
- description: Metadata about the insights report.
- readOnly: true
- state:
- $ref: '#/components/schemas/Azure.Core.Foundations.OperationState'
- description: The current state of the insights.
- readOnly: true
- displayName:
+ description: The input text. This may include template strings.
+ reference:
type: string
- description: User friendly display name for the insight.
- request:
- $ref: '#/components/schemas/InsightRequest'
- description: Request for the insights analysis.
- result:
- $ref: '#/components/schemas/InsightResult'
- description: The result of the insights report.
- readOnly: true
- description: The response body for cluster insights.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightCluster:
+ description: The reference text. This may include template strings.
+ operation:
+ type: string
+ enum:
+ - eq
+ - ne
+ - like
+ - ilike
+ description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
+ title: StringCheckGrader
+ OpenAI.EvalGraderTextSimilarity:
type: object
required:
- - id
- - label
- - suggestion
- - suggestionTitle
- - description
- - weight
+ - type
+ - name
+ - input
+ - reference
+ - evaluation_metric
+ - pass_threshold
properties:
- id:
+ type:
type: string
- description: The id of the analysis cluster.
- label:
+ enum:
+ - text_similarity
+ description: The type of grader.
+ x-stainless-const: true
+ default: text_similarity
+ name:
type: string
- description: Label for the cluster
- suggestion:
+ description: The name of the grader.
+ input:
type: string
- description: Suggestion for the cluster
- suggestionTitle:
+ description: The text being graded.
+ reference:
type: string
- description: The title of the suggestion for the cluster
- description:
+ description: The text being graded against.
+ evaluation_metric:
type: string
- description: Description of the analysis cluster.
- weight:
- type: integer
- format: int32
- description: The weight of the analysis cluster. This indicate number of samples in the cluster.
- subClusters:
- description: List of subclusters within this cluster. Empty if no subclusters exist.
- type: array
- items:
- $ref: '#/components/schemas/InsightCluster'
- samples:
- type: array
- items:
- $ref: '#/components/schemas/InsightSample'
- description: List of samples that belong to this cluster. Empty if samples are part of subclusters.
- description: A cluster of analysis samples.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightModelConfiguration:
+ enum:
+ - cosine
+ - fuzzy_match
+ - bleu
+ - gleu
+ - meteor
+ - rouge_1
+ - rouge_2
+ - rouge_3
+ - rouge_4
+ - rouge_5
+ - rouge_l
+ description: |-
+ 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`.
+ pass_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The threshold for the score.
+ title: TextSimilarityGrader
+ OpenAI.EvalItem:
type: object
required:
- - modelDeploymentName
+ - role
+ - content
properties:
- modelDeploymentName:
+ role:
type: string
- description: The model deployment to be evaluated. Accepts either the deployment name alone or with the connection name as '{connectionName}/'.
- description: Configuration of the model used in the insight generation.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightRequest:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/InsightType'
- description: The type of request.
- discriminator:
- propertyName: type
- mapping:
- EvaluationRunClusterInsight: '#/components/schemas/EvaluationRunClusterInsightRequest'
- AgentClusterInsight: '#/components/schemas/AgentClusterInsightRequest'
- EvaluationComparison: '#/components/schemas/EvaluationComparisonInsightRequest'
- description: The request of the insights report.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightResult:
- type: object
- required:
- - type
- properties:
+ enum:
+ - user
+ - assistant
+ - system
+ - developer
+ description: |-
+ The role of the message input. One of `user`, `assistant`, `system`, or
+ `developer`.
+ content:
+ $ref: '#/components/schemas/OpenAI.EvalItemContent'
type:
- $ref: '#/components/schemas/InsightType'
- description: The type of insights result.
- discriminator:
- propertyName: type
- mapping:
- EvaluationComparison: '#/components/schemas/EvaluationComparisonInsightResult'
- EvaluationRunClusterInsight: '#/components/schemas/EvaluationRunClusterInsightResult'
- AgentClusterInsight: '#/components/schemas/AgentClusterInsightResult'
- description: The result of the insights.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightSample:
+ type: string
+ enum:
+ - message
+ description: The type of the message input. Always `message`.
+ x-stainless-const: true
+ description: |-
+ 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.
+ title: Eval message object
+ OpenAI.EvalItemContent:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItem'
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentArray'
+ description: Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
+ title: Eval content
+ OpenAI.EvalItemContentArray:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalItemContentItem'
+ description: |-
+ A list of inputs, each of which may be either an input text, output text, input
+ image, or input audio object.
+ title: An array of Input text, Output text, Input image, and Input audio
+ OpenAI.EvalItemContentItem:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentText'
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: 'A single content item: input text, output text, input image, or input audio.'
+ title: Eval content item
+ OpenAI.EvalItemContentItemObject:
type: object
required:
- - id
- type
- - features
- - correlationInfo
properties:
- id:
- type: string
- description: The unique identifier for the analysis sample.
type:
- $ref: '#/components/schemas/SampleType'
- description: Sample type
- features:
- type: object
- unevaluatedProperties: {}
- description: Features to help with additional filtering of data in UX.
- correlationInfo:
- type: object
- unevaluatedProperties: {}
- description: Info about the correlation for the analysis sample.
+ $ref: '#/components/schemas/OpenAI.EvalItemContentItemObjectType'
discriminator:
propertyName: type
mapping:
- EvaluationResultSample: '#/components/schemas/EvaluationResultSample'
- description: A sample from the analysis.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightScheduleTask:
+ output_text: '#/components/schemas/OpenAI.EvalItemContentOutputText'
+ input_image: '#/components/schemas/OpenAI.EvalItemInputImage'
+ input_audio: '#/components/schemas/OpenAI.InputAudio'
+ input_text: '#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent'
+ description: 'A single content item: input text, output text, input image, or input audio.'
+ title: Eval content item
+ OpenAI.EvalItemContentItemObjectInputTextContent:
type: object
required:
- type
- - insight
+ - text
properties:
type:
type: string
enum:
- - Insight
- insight:
- $ref: '#/components/schemas/Insight'
- description: The insight payload.
- allOf:
- - $ref: '#/components/schemas/ScheduleTask'
- description: Insight task for the schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- InsightSummary:
- type: object
- required:
- - sampleCount
- - uniqueSubclusterCount
- - uniqueClusterCount
- - method
- - usage
- properties:
- sampleCount:
- type: integer
- format: int32
- description: Total number of samples analyzed.
- uniqueSubclusterCount:
- type: integer
- format: int32
- description: Total number of unique subcluster labels.
- uniqueClusterCount:
- type: integer
- format: int32
- description: Total number of unique clusters.
- method:
+ - input_text
+ description: The type of the input item. Always `input_text`.
+ x-stainless-const: true
+ default: input_text
+ text:
type: string
- description: Method used for clustering.
- usage:
- $ref: '#/components/schemas/ClusterTokenUsage'
- description: Token usage while performing clustering analysis
- description: Summary of the error cluster analysis.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightType:
+ description: The text input to the model.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: A text input to the model.
+ title: Input text
+ OpenAI.EvalItemContentItemObjectType:
anyOf:
- type: string
- type: string
enum:
- - EvaluationRunClusterInsight
- - AgentClusterInsight
- - EvaluationComparison
- description: The request of the insights.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InsightsMetadata:
- type: object
- required:
- - createdAt
- properties:
- createdAt:
- type: string
- format: date-time
- description: The timestamp when the insights were created.
- completedAt:
- type: string
- format: date-time
- description: The timestamp when the insights were completed.
- description: Metadata about the insights.
- x-ms-foundry-meta:
- conditional_previews:
- - Insights=V1Preview
- InvocationsProtocolConfiguration:
- type: object
- description: Configuration specific to the invocations protocol.
- InvocationsWsProtocolConfiguration:
- type: object
- description: Configuration specific to the WebSocket-based invocations protocol.
- InvokeAgentInvocationsApiDispatchPayload:
+ - input_text
+ - output_text
+ - input_image
+ - input_audio
+ OpenAI.EvalItemContentOutputText:
type: object
required:
- type
- - input
+ - text
properties:
type:
type: string
enum:
- - invoke_agent_invocations_api
- description: The manual dispatch payload type.
- input:
- description: The JSON value sent as the complete downstream invocations input. The value is passed through as-is and can be an object, string, number, boolean, array, or null.
+ - output_text
+ description: The type of the output text. Always `output_text`.
+ x-stainless-const: true
+ text:
+ type: string
+ description: The text output from the model.
allOf:
- - $ref: '#/components/schemas/RoutineDispatchPayload'
- description: A manual payload used to test an invocations API routine dispatch.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- InvokeAgentInvocationsApiRoutineAction:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: A text output from the model.
+ title: Output text
+ OpenAI.EvalItemContentText:
+ type: string
+ description: A text input to the model.
+ title: Text input
+ OpenAI.EvalItemInputImage:
type: object
required:
- type
+ - image_url
properties:
type:
type: string
enum:
- - invoke_agent_invocations_api
- description: The action type.
- agent_name:
- type: string
- maxLength: 256
- description: The project-scoped agent name for routine dispatch.
- agent_endpoint_id:
+ - input_image
+ description: The type of the image input. Always `input_image`.
+ x-stainless-const: true
+ image_url:
type: string
- maxLength: 256
- description: Legacy endpoint-scoped agent identifier for routine dispatch.
- input:
- description: Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
- session_id:
+ format: uri
+ description: The URL of the image input.
+ detail:
type: string
- maxLength: 256
- description: An optional existing hosted-agent session identifier to continue during the downstream dispatch.
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/RoutineAction'
- description: Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- InvokeAgentResponsesApiDispatchPayload:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: An image input block used within EvalItem content arrays.
+ title: Input image
+ OpenAI.EvalJsonlFileContentSource:
type: object
required:
- type
- - input
+ - content
properties:
type:
type: string
enum:
- - invoke_agent_responses_api
- description: The manual dispatch payload type.
- input:
- description: The JSON value sent as the complete downstream responses input. The value is passed through as-is and can be an object, string, number, boolean, array, or null.
- allOf:
- - $ref: '#/components/schemas/RoutineDispatchPayload'
- description: A manual payload used to test a responses API routine dispatch.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- InvokeAgentResponsesApiRoutineAction:
+ - file_content
+ description: The type of jsonl source. Always `file_content`.
+ x-stainless-const: true
+ default: file_content
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent'
+ description: The content of the jsonl file.
+ title: EvalJsonlFileContentSource
+ OpenAI.EvalJsonlFileContentSourceContent:
+ type: object
+ required:
+ - item
+ properties:
+ item:
+ type: object
+ unevaluatedProperties: {}
+ sample:
+ type: object
+ unevaluatedProperties: {}
+ OpenAI.EvalJsonlFileIdSource:
type: object
required:
- type
+ - id
properties:
type:
type: string
enum:
- - invoke_agent_responses_api
- description: The action type.
- agent_name:
- type: string
- maxLength: 256
- description: The project-scoped agent name for routine dispatch.
- agent_endpoint_id:
- type: string
- maxLength: 256
- description: Legacy endpoint-scoped agent identifier for routine dispatch.
- input:
- description: Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
- conversation:
+ - file_id
+ description: The type of jsonl source. Always `file_id`.
+ x-stainless-const: true
+ default: file_id
+ id:
type: string
- maxLength: 256
- description: An optional existing conversation identifier to continue during the downstream dispatch.
- allOf:
- - $ref: '#/components/schemas/RoutineAction'
- description: Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.
- x-ms-foundry-meta:
- conditional_previews:
- - Routines=V1Preview
- ItemGenerationParams:
+ description: The identifier of the file.
+ title: EvalJsonlFileIdSource
+ OpenAI.EvalResponsesSource:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/ItemGenerationParamsType'
- description: The type of item generation parameters to use.
- discriminator:
- propertyName: type
- mapping:
- red_team: '#/components/schemas/RedTeamItemGenerationParams'
- red_team_seed_prompts: '#/components/schemas/RedTeamSeedPromptsItemGenerationParams'
- red_team_taxonomy: '#/components/schemas/RedTeamTaxonomyItemGenerationParams'
- response_retrieval: '#/components/schemas/ResponseRetrievalItemGenerationParams'
- conversation_gen_preview: '#/components/schemas/ConversationGenPreviewItemGenerationParams'
- synthetic_data_gen_preview: '#/components/schemas/SyntheticDataGenerationPreviewItemGenerationParams'
- description: Represents the set of parameters used to control item generation operations.
- ItemGenerationParamsType:
- anyOf:
- - type: string
- - type: string
- enum:
- - red_team
- - response_retrieval
- - red_team_seed_prompts
- - red_team_taxonomy
- - synthetic_data_gen_preview
- - conversation_gen_preview
- description: The types of parameters for red team item generation.
- JobStatus:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - queued
- - in_progress
- - succeeded
- - failed
- - cancelled
- description: Extensible status values shared by Foundry jobs.
- LoraConfig:
+ - responses
+ description: The type of run data source. Always `responses`.
+ metadata:
+ anyOf:
+ - type: object
+ unevaluatedProperties: {}
+ - type: 'null'
+ model:
+ anyOf:
+ - type: string
+ - type: 'null'
+ instructions_search:
+ anyOf:
+ - type: string
+ - type: 'null'
+ created_after:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ created_before:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ description: Optional reasoning effort parameter. This is a query parameter used to select responses.
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ users:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: 'null'
+ tools:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: 'null'
+ description: A EvalResponsesSource object describing a run data source configuration.
+ title: EvalResponsesSource
+ x-oaiMeta:
+ name: The run data source object used to configure an individual run
+ group: eval runs
+ example: |
+ {
+ "type": "responses",
+ "model": "gpt-4o-mini-2024-07-18",
+ "temperature": 0.7,
+ "top_p": 1.0,
+ "users": ["user1", "user2"],
+ "tools": ["tool1", "tool2"],
+ "instructions_search": "You are a coding assistant"
+ }
+ OpenAI.EvalRunOutputItemSample:
+ type: object
+ required:
+ - input
+ - output
+ - finish_reason
+ - model
+ - usage
+ - error
+ - temperature
+ - max_completion_tokens
+ - top_p
+ - seed
+ properties:
+ input:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunOutputItemSampleInput'
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/EvalRunOutputItemSampleOutput'
+ finish_reason:
+ type: string
+ model:
+ type: string
+ usage:
+ $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage'
+ error:
+ $ref: '#/components/schemas/OpenAI.EvalApiError'
+ temperature:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ max_completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ top_p:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ seed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.EvalRunOutputItemSampleUsage:
+ type: object
+ required:
+ - total_tokens
+ - completion_tokens
+ - prompt_tokens
+ - cached_tokens
+ properties:
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.EvalRunPerModelUsage:
+ type: object
+ required:
+ - model_name
+ - invocation_count
+ - prompt_tokens
+ - completion_tokens
+ - total_tokens
+ - cached_tokens
+ properties:
+ model_name:
+ type: string
+ invocation_count:
+ $ref: '#/components/schemas/OpenAI.integer'
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.EvalRunPerTestingCriteriaResults:
+ type: object
+ required:
+ - testing_criteria
+ - passed
+ - failed
+ properties:
+ testing_criteria:
+ type: string
+ passed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ errored:
+ $ref: '#/components/schemas/integer'
+ description: Number of tests that errored for this criteria.
+ skipped:
+ $ref: '#/components/schemas/integer'
+ description: Number of tests that were skipped for this criteria.
+ OpenAI.EvalRunResultCounts:
type: object
+ required:
+ - total
+ - errored
+ - failed
+ - passed
properties:
- rank:
- type: integer
- format: int32
- description: 'LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64.'
- alpha:
- type: integer
- format: int32
- description: LoRA scaling factor (α). Positive integer; typically 2× the rank.
- targetModules:
- type: array
- items:
- type: string
- description: Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from adapter_config.json if omitted.
- dropout:
- type: number
- format: float
- description: Dropout rate used during training. Informational — not used at serving time.
- description: Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- MCPToolboxTool:
+ total:
+ $ref: '#/components/schemas/OpenAI.integer'
+ errored:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ passed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ skipped:
+ $ref: '#/components/schemas/integer'
+ description: Number of output items that were skipped during the evaluation.
+ OpenAI.EvalStoredCompletionsSource:
type: object
required:
- type
- - server_label
properties:
type:
type: string
enum:
- - mcp
- server_label:
- type: string
- description: A label for this MCP server, used to identify it in tool calls.
- server_url:
- type: string
- format: uri
- description: |-
- The URL for the MCP server. One of `server_url`, `connector_id`, or
- `tunnel_id` must be provided.
- connector_id:
- type: string
- enum:
- - connector_dropbox
- - connector_gmail
- - connector_googlecalendar
- - connector_googledrive
- - connector_microsoftteams
- - connector_outlookcalendar
- - connector_outlookemail
- - connector_sharepoint
- description: |-
- Identifier for service connectors, like those available in ChatGPT. One of
- `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
- about service connectors [here](/docs/guides/tools-remote-mcp#connectors).
- Currently supported `connector_id` values are:
- - Dropbox: `connector_dropbox`
- - Gmail: `connector_gmail`
- - Google Calendar: `connector_googlecalendar`
- - Google Drive: `connector_googledrive`
- - Microsoft Teams: `connector_microsoftteams`
- - Outlook Calendar: `connector_outlookcalendar`
- - Outlook Email: `connector_outlookemail`
- - SharePoint: `connector_sharepoint`
- tunnel_id:
- type: string
- pattern: ^tunnel_[a-z0-9]{32}$
- description: |-
- The Secure MCP Tunnel ID to use instead of a direct server URL. One of
- `server_url`, `connector_id`, or `tunnel_id` must be provided.
- authorization:
- type: string
- description: |-
- An OAuth access token that can be used with a remote MCP server, either
- with a custom MCP server URL or a service connector. Your application
- must handle the OAuth authorization flow and provide the token here.
- server_description:
- type: string
- description: Optional description of the MCP server, used to provide more context.
- headers:
+ - stored_completions
+ description: The type of source. Always `stored_completions`.
+ x-stainless-const: true
+ default: stored_completions
+ metadata:
anyOf:
- - type: object
- unevaluatedProperties:
- type: string
+ - $ref: '#/components/schemas/OpenAI.Metadata'
- type: 'null'
- allowed_tools:
+ model:
anyOf:
- - type: array
- items:
- type: string
- - $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ - type: string
- type: 'null'
- require_approval:
+ created_after:
anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
- - type: string
- enum:
- - always
- - never
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- default: always
- defer_loading:
- type: boolean
- description: Whether this MCP tool is deferred and discovered via tool search.
- project_connection_id:
- type: string
- description: The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server.
- allOf:
- - $ref: '#/components/schemas/ToolboxTool'
- description: An MCP tool stored in a toolbox.
- ManagedAgentIdentityBlueprint:
- type: object
- required:
- - name
- properties:
- name:
- type: string
- readOnly: true
- ManagedAgentIdentityBlueprintReference:
+ created_before:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ limit:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: A StoredCompletionsRunDataSource configuration describing a set of filters
+ title: StoredCompletionsRunDataSource
+ x-oaiMeta:
+ name: The stored completions data source object used to configure an individual run
+ group: eval runs
+ example: |
+ {
+ "type": "stored_completions",
+ "model": "gpt-4o",
+ "created_after": 1668124800,
+ "created_before": 1668124900,
+ "limit": 100,
+ "metadata": {}
+ }
+ OpenAI.FileCitationBody:
type: object
required:
- type
- - blueprint_id
+ - file_id
+ - index
+ - filename
properties:
type:
type: string
enum:
- - ManagedAgentIdentityBlueprint
- blueprint_id:
+ - file_citation
+ description: The type of the file citation. Always `file_citation`.
+ x-stainless-const: true
+ file_id:
type: string
- description: The ID of the managed blueprint
+ description: The ID of the file.
+ index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the file in the list of files.
+ filename:
+ type: string
+ description: The filename of the file cited.
allOf:
- - $ref: '#/components/schemas/AgentBlueprintReference'
- ManagedAzureAISearchIndex:
+ - $ref: '#/components/schemas/OpenAI.Annotation'
+ description: A citation to a file.
+ title: File citation
+ OpenAI.FileExpirationAfter:
type: object
required:
- - type
+ - anchor
+ - seconds
properties:
- type:
+ anchor:
type: string
enum:
- - ManagedAzureSearch
- description: Type of index
- allOf:
- - $ref: '#/components/schemas/Index'
- description: Managed Azure AI Search Index Definition
- ManagedAzureAISearchIndexUpdate:
+ - created_at
+ description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`.'
+ x-stainless-const: true
+ seconds:
+ type: integer
+ format: int64
+ minimum: 3600
+ maximum: 2592000
+ description: The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days).
+ description: 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.
+ title: File expiration policy
+ OpenAI.FileInputDetail:
+ type: string
+ enum:
+ - low
+ - high
+ OpenAI.FilePath:
type: object
required:
- type
+ - file_id
+ - index
properties:
type:
type: string
enum:
- - ManagedAzureSearch
- description: Type of index
+ - file_path
+ description: The type of the file path. Always `file_path`.
+ x-stainless-const: true
+ file_id:
+ type: string
+ description: The ID of the file.
+ index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the file in the list of files.
allOf:
- - $ref: '#/components/schemas/IndexUpdate'
- description: Managed Azure AI Search Index Definition
- McpProtocolConfiguration:
+ - $ref: '#/components/schemas/OpenAI.Annotation'
+ description: A path to a file.
+ title: File path
+ OpenAI.FilePurpose:
+ type: string
+ enum:
+ - assistants
+ - batch
+ - fine-tune
+ - vision
+ - user_data
+ - evals
+ description: |-
+ 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
+ OpenAI.FileSearchRanker:
+ type: string
+ enum:
+ - auto
+ - default_2024_08_21
+ description: The ranker to use for the file search. If not specified will use the `auto` ranker.
+ OpenAI.FileSearchRankingOptions:
type: object
- description: Configuration specific to the MCP protocol.
- MemoryCommandToolCall:
+ required:
+ - score_threshold
+ properties:
+ ranker:
+ $ref: '#/components/schemas/OpenAI.FileSearchRanker'
+ score_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ description: The score threshold for the file search. All values must be a floating point number between 0 and 1.
+ description: |-
+ 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.
+ title: File search tool call ranking options
+ OpenAI.FileSearchTool:
type: object
required:
- type
- - call_id
- - arguments
- - status
+ - vector_store_ids
properties:
type:
type: string
enum:
- - memory_command_preview_call
- call_id:
+ - file_search
+ description: The type of the file search tool. Always `file_search`.
+ x-stainless-const: true
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ description: The IDs of the vector stores to search.
+ max_num_results:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.RankingOptions'
+ description: Ranking options for search.
+ filters:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Filters'
+ - type: 'null'
+ name:
type: string
- description: The unique ID of the tool call generated by the model.
- arguments:
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
type: string
- description: A JSON string of the arguments to pass to the tool, including `action` (`remember` or `forget`) and `content`.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A memory command tool call.
- MemoryCommandToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: 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).
+ title: File search
+ OpenAI.FileSearchToolCallResults:
+ type: object
+ properties:
+ file_id:
+ type: string
+ text:
+ type: string
+ filename:
+ type: string
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ score:
+ type: number
+ format: float
+ OpenAI.Filters:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
+ - $ref: '#/components/schemas/OpenAI.CompoundFilter'
+ OpenAI.FineTuneDPOHyperparameters:
+ type: object
+ properties:
+ beta:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
+ default: auto
+ batch_size:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
+ default: auto
+ description: The hyperparameters used for the DPO fine-tuning job.
+ OpenAI.FineTuneDPOMethod:
+ type: object
+ properties:
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.FineTuneDPOHyperparameters'
+ description: Configuration for the DPO fine-tuning method.
+ OpenAI.FineTuneMethod:
type: object
required:
- type
- - call_id
- - status
properties:
type:
type: string
enum:
- - memory_command_preview_call_output
- call_id:
- type: string
- description: The unique ID of the tool call generated by the model.
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a memory command tool call.
- MemoryItem:
+ - supervised
+ - dpo
+ - reinforcement
+ description: The type of method. Is either `supervised`, `dpo`, or `reinforcement`.
+ supervised:
+ $ref: '#/components/schemas/OpenAI.FineTuneSupervisedMethod'
+ dpo:
+ $ref: '#/components/schemas/OpenAI.FineTuneDPOMethod'
+ reinforcement:
+ $ref: '#/components/schemas/OpenAI.FineTuneReinforcementMethod'
+ description: The method used for fine-tuning.
+ OpenAI.FineTuneReinforcementHyperparameters:
type: object
- required:
- - memory_id
- - updated_at
- - scope
- - content
- - kind
properties:
- memory_id:
- type: string
- description: The unique ID of the memory item.
- updated_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The last update time of the memory item.
- scope:
- type: string
- description: The namespace that logically groups and isolates memories, such as a user ID.
- content:
+ batch_size:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
+ default: auto
+ reasoning_effort:
type: string
- description: The content of the memory.
- kind:
- $ref: '#/components/schemas/MemoryItemKind'
- description: The kind of the memory item.
- discriminator:
- propertyName: kind
- mapping:
- user_profile: '#/components/schemas/UserProfileMemoryItem'
- chat_summary: '#/components/schemas/ChatSummaryMemoryItem'
- procedural: '#/components/schemas/ProceduralMemoryItem'
- description: A single memory item stored in the memory store, containing content and metadata.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryItemKind:
- anyOf:
- - type: string
- - type: string
enum:
- - user_profile
- - chat_summary
- - procedural
- description: Memory item kind.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryOperation:
+ - default
+ - low
+ - medium
+ - high
+ description: Level of reasoning effort.
+ default: default
+ compute_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: Multiplier on amount of compute used for exploring search space during training.
+ default: auto
+ eval_interval:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of training steps between evaluation runs.
+ default: auto
+ eval_samples:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of evaluation samples to generate per training step.
+ default: auto
+ description: The hyperparameters used for the reinforcement fine-tuning job.
+ OpenAI.FineTuneReinforcementMethod:
type: object
required:
- - kind
- - memory_item
- properties:
- kind:
- $ref: '#/components/schemas/MemoryOperationKind'
- description: The type of memory operation being performed.
- memory_item:
- $ref: '#/components/schemas/MemoryItem'
- description: The memory item to create, update, or delete.
- description: Represents a single memory operation (create, update, or delete) performed on a memory item.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryOperationKind:
- anyOf:
- - type: string
- - type: string
- enum:
- - create
- - update
- - delete
- description: Memory operation kind.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemorySearchItem:
+ - grader
+ properties:
+ grader:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderMulti'
+ description: The grader used for the fine-tuning job.
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters'
+ description: Configuration for the reinforcement fine-tuning method.
+ OpenAI.FineTuneSupervisedHyperparameters:
type: object
- required:
- - memory_item
properties:
- memory_item:
- $ref: '#/components/schemas/MemoryItem'
- description: Retrieved memory item.
- description: A retrieved memory item from memory search.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemorySearchOptions:
+ batch_size:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
+ default: auto
+ description: The hyperparameters used for the fine-tuning job.
+ OpenAI.FineTuneSupervisedMethod:
type: object
properties:
- max_memories:
- type: integer
- format: int32
- description: Maximum number of memory items to return.
- description: Memory search options.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemorySearchPreviewTool:
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters'
+ description: Configuration for the supervised fine-tuning method.
+ OpenAI.FineTuningCheckpointPermission:
type: object
required:
- - type
- - memory_store_name
- - scope
+ - id
+ - created_at
+ - project_id
+ - object
properties:
- type:
+ id:
type: string
- enum:
- - memory_search_preview
- description: The type of the tool. Always `memory_search_preview`.
- memory_store_name:
+ description: The permission identifier, which can be referenced in the API endpoints.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the permission was created.
+ project_id:
type: string
- description: The name of the memory store to use.
- scope:
+ description: The project identifier that the permission is for.
+ object:
type: string
- description: |-
- The namespace used to group and isolate memories, such as a user ID.
- Limits which memories can be retrieved or updated.
- Use special variable `{{$userId}}` to scope memories to the current signed-in user.
- search_options:
- $ref: '#/components/schemas/MemorySearchOptions'
- description: Options for searching the memory store.
- update_delay:
- type: integer
- format: int32
- description: Time to wait before updating memories after inactivity (seconds). Default 300.
- default: 300
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool for integrating memories into the agent.
- MemorySearchTool:
+ enum:
+ - checkpoint.permission
+ description: The object type, which is always "checkpoint.permission".
+ x-stainless-const: true
+ description: The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.
+ title: FineTuningCheckpointPermission
+ x-oaiMeta:
+ name: The fine-tuned model checkpoint permission object
+ example: |
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1712211699,
+ "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"
+ }
+ OpenAI.FineTuningIntegration:
type: object
required:
- type
- - memory_store_name
- - scope
+ - wandb
properties:
type:
type: string
enum:
- - memory_search
- description: The type of the tool. Always `memory_search_preview`.
- memory_store_name:
- type: string
- description: The name of the memory store to use.
- scope:
- type: string
+ - wandb
+ description: The type of the integration being enabled for the fine-tuning job
+ x-stainless-const: true
+ wandb:
+ $ref: '#/components/schemas/OpenAI.FineTuningIntegrationWandb'
description: |-
- The namespace used to group and isolate memories, such as a user ID.
- Limits which memories can be retrieved or updated.
- Use special variable `{{$userId}}` to scope memories to the current signed-in user.
- search_options:
- $ref: '#/components/schemas/MemorySearchOptions'
- description: Options for searching the memory store.
- update_delay:
- type: integer
- format: int32
- description: Time to wait before updating memories after inactivity (seconds). Default 300.
- default: 300
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool for integrating memories into the agent.
- MemorySearchToolCall:
+ 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.
+ title: Fine-Tuning Job Integration
+ OpenAI.FineTuningIntegrationWandb:
type: object
required:
- - type
- - status
+ - project
properties:
- type:
+ project:
type: string
- enum:
- - memory_search_call
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- description: The status of the tool call.
- memories:
+ name:
anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/MemoryItem'
+ - type: string
- type: 'null'
- description: The results returned from the memory search.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A memory search tool call.
- MemoryStoreDefaultDefinition:
- type: object
- required:
- - kind
- - chat_model
- - embedding_model
- properties:
- kind:
- type: string
- enum:
- - default
- description: The kind of the memory store.
- chat_model:
- type: string
- description: The name or identifier of the chat completion model deployment used for memory processing.
- embedding_model:
- type: string
- description: The name or identifier of the embedding model deployment used for memory processing.
- options:
- $ref: '#/components/schemas/MemoryStoreDefaultOptions'
- description: Default memory store options.
- allOf:
- - $ref: '#/components/schemas/MemoryStoreDefinition'
- description: Default memory store implementation.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreDefaultOptions:
+ entity:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tags:
+ type: array
+ items:
+ type: string
+ OpenAI.FineTuningJob:
type: object
required:
- - user_profile_enabled
- - chat_summary_enabled
+ - id
+ - created_at
+ - error
+ - fine_tuned_model
+ - finished_at
+ - hyperparameters
+ - model
+ - object
+ - organization_id
+ - result_files
+ - status
+ - trained_tokens
+ - training_file
+ - validation_file
+ - seed
properties:
- user_profile_enabled:
- type: boolean
- description: Whether to enable user profile extraction and storage. Default is true.
- default: true
- user_profile_details:
+ id:
type: string
- description: Specific categories or types of user profile information to extract and store.
- chat_summary_enabled:
- type: boolean
- description: Whether to enable chat summary extraction and storage. Defaults to `true`.
- default: true
- procedural_memory_enabled:
- type: boolean
- description: Whether to enable procedural memory extraction and storage. The service defaults to `true` if a value is not specified by the caller.
- default: true
- default_ttl_seconds:
+ description: The object identifier, which can be referenced in the API endpoints.
+ created_at:
type: integer
- format: int32
- description: The default time-to-live for memories in seconds. A value of `0` indicates that memories do not expire. Defaults to `0`.
- default: 0
- description: Default memory store configurations.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreDefinition:
- type: object
- required:
- - kind
- properties:
- kind:
- $ref: '#/components/schemas/MemoryStoreKind'
- description: The kind of the memory store.
- discriminator:
- propertyName: kind
- mapping:
- default: '#/components/schemas/MemoryStoreDefaultDefinition'
- description: Base definition for memory store configurations.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreDeleteScopeResponse:
- type: object
- required:
- - object
- - name
- - scope
- - deleted
- properties:
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the fine-tuning job was created.
+ error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FineTuningJobError'
+ - type: 'null'
+ fine_tuned_model:
+ anyOf:
+ - type: string
+ - type: 'null'
+ finished_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ hyperparameters:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobHyperparameters'
+ description: The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.
+ model:
+ type: string
+ description: The base model that is being fine-tuned.
object:
type: string
enum:
- - memory_store.scope.deleted
- description: The object type. Always 'memory_store.scope.deleted'.
- name:
+ - fine_tuning.job
+ description: The object type, which is always "fine_tuning.job".
+ x-stainless-const: true
+ organization_id:
type: string
- description: The name of the memory store.
- scope:
+ description: The organization that owns the fine-tuning job.
+ result_files:
+ type: array
+ items:
+ type: string
+ description: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents).
+ status:
type: string
- description: The scope from which memories were deleted.
- deleted:
- type: boolean
- description: Whether the deletion operation was successful.
- description: Response for deleting memories from a scope.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreKind:
- anyOf:
- - type: string
- - type: string
enum:
- - default
- description: The type of memory store implementation to use.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreObject:
+ - validating_files
+ - queued
+ - running
+ - succeeded
+ - failed
+ - cancelled
+ description: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.
+ trained_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ training_file:
+ type: string
+ description: The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents).
+ validation_file:
+ anyOf:
+ - type: string
+ - type: 'null'
+ integrations:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FineTuningIntegration'
+ - type: 'null'
+ seed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The seed used for the fine-tuning job.
+ estimated_finish:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ method:
+ $ref: '#/components/schemas/OpenAI.FineTuneMethod'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.
+ title: FineTuningJob
+ x-oaiMeta:
+ name: The fine-tuning job object
+ example: |
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "davinci-002",
+ "created_at": 1692661014,
+ "finished_at": 1692661190,
+ "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
+ "organization_id": "org-123",
+ "result_files": [
+ "file-abc123"
+ ],
+ "status": "succeeded",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ },
+ "trained_tokens": 5768,
+ "integrations": [],
+ "seed": 0,
+ "estimated_finish": 0,
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ }
+ }
+ },
+ "metadata": {
+ "key": "value"
+ }
+ }
+ OpenAI.FineTuningJobCheckpoint:
type: object
required:
- - object
- id
- created_at
- - updated_at
- - name
- - definition
+ - fine_tuned_model_checkpoint
+ - step_number
+ - metrics
+ - fine_tuning_job_id
+ - object
properties:
- object:
- type: string
- enum:
- - memory_store
- description: The object type, which is always 'memory_store'.
id:
type: string
- description: The unique identifier of the memory store.
+ description: The checkpoint identifier, which can be referenced in the API endpoints.
created_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The Unix timestamp (seconds) when the memory store was created.
- updated_at:
- $ref: '#/components/schemas/FoundryTimestamp'
- description: The Unix timestamp (seconds) when the memory store was last updated.
- name:
- type: string
- maxLength: 256
- description: The name of the memory store.
- description:
- type: string
- maxLength: 512
- description: A human-readable description of the memory store.
- metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: Arbitrary key-value metadata to associate with the memory store.
- definition:
- $ref: '#/components/schemas/MemoryStoreDefinition'
- description: The definition of the memory store.
- description: A memory store that can store and retrieve user memories.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreOperationUsage:
- type: object
- required:
- - embedding_tokens
- - input_tokens
- - input_tokens_details
- - output_tokens
- - output_tokens_details
- - total_tokens
- properties:
- embedding_tokens:
type: integer
- format: int32
- description: The number of embedding tokens.
- input_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The number of input tokens.
- input_tokens_details:
- $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails'
- description: A detailed breakdown of the input tokens.
- output_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The number of output tokens.
- output_tokens_details:
- $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails'
- description: A detailed breakdown of the output tokens.
- total_tokens:
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the checkpoint was created.
+ fine_tuned_model_checkpoint:
+ type: string
+ description: The name of the fine-tuned checkpoint model that is created.
+ step_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The total number of tokens used.
- description: Usage statistics of a memory store operation.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreSearchResponse:
+ description: The step number that the checkpoint was created at.
+ metrics:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics'
+ description: Metrics at the step number during the fine-tuning job.
+ fine_tuning_job_id:
+ type: string
+ description: The name of the fine-tuning job that this checkpoint was created from.
+ object:
+ type: string
+ enum:
+ - fine_tuning.job.checkpoint
+ description: The object type, which is always "fine_tuning.job.checkpoint".
+ x-stainless-const: true
+ description: The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.
+ title: FineTuningJobCheckpoint
+ x-oaiMeta:
+ name: The fine-tuning job checkpoint object
+ example: |
+ {
+ "object": "fine_tuning.job.checkpoint",
+ "id": "ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P",
+ "created_at": 1712211699,
+ "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88",
+ "fine_tuning_job_id": "ftjob-fpbNQ3H1GrMehXRf8cO97xTN",
+ "metrics": {
+ "step": 88,
+ "train_loss": 0.478,
+ "train_mean_token_accuracy": 0.924,
+ "valid_loss": 10.112,
+ "valid_mean_token_accuracy": 0.145,
+ "full_valid_loss": 0.567,
+ "full_valid_mean_token_accuracy": 0.944
+ },
+ "step_number": 88
+ }
+ OpenAI.FineTuningJobCheckpointMetrics:
type: object
- required:
- - search_id
- - memories
- - usage
properties:
- search_id:
- type: string
- description: The unique ID of this search request. Use this value as previous_search_id in subsequent requests to perform incremental searches.
- memories:
- type: array
- items:
- $ref: '#/components/schemas/MemorySearchItem'
- description: Related memory items found during the search operation.
- usage:
- $ref: '#/components/schemas/MemoryStoreOperationUsage'
- description: Usage statistics associated with the memory search operation.
- description: Memory search response.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreUpdateCompletedResult:
+ step:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ train_loss:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ train_mean_token_accuracy:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ valid_loss:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ valid_mean_token_accuracy:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ full_valid_loss:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ full_valid_mean_token_accuracy:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.FineTuningJobError:
type: object
required:
- - memory_operations
- - usage
+ - code
+ - message
+ - param
properties:
- memory_operations:
- type: array
- items:
- $ref: '#/components/schemas/MemoryOperation'
- description: A list of individual memory operations that were performed during the update.
- usage:
- $ref: '#/components/schemas/MemoryStoreOperationUsage'
- description: Usage statistics associated with the memory update operation.
- description: Memory update result.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreUpdateResponse:
+ code:
+ type: string
+ message:
+ type: string
+ param:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.FineTuningJobEvent:
type: object
required:
- - update_id
- - status
+ - object
+ - id
+ - created_at
+ - level
+ - message
properties:
- update_id:
+ object:
type: string
- description: The unique ID of this update request. Use this value as previous_update_id in subsequent requests to perform incremental updates.
- status:
- $ref: '#/components/schemas/MemoryStoreUpdateStatus'
- description: The status of the memory update operation. One of "queued", "in_progress", "completed", "failed", or "superseded".
- superseded_by:
+ enum:
+ - fine_tuning.job.event
+ description: The object type, which is always "fine_tuning.job.event".
+ x-stainless-const: true
+ id:
+ type: string
+ description: The object identifier.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the fine-tuning job was created.
+ level:
type: string
- description: The update_id the operation was superseded by when status is "superseded".
- result:
- $ref: '#/components/schemas/MemoryStoreUpdateCompletedResult'
- description: The result of memory store update operation when status is "completed".
- error:
- $ref: '#/components/schemas/OpenAI.Error'
- description: Error object that describes the error when status is "failed".
- description: Provides the status of a memory store update operation.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- MemoryStoreUpdateStatus:
- anyOf:
- - type: string
- - type: string
enum:
- - queued
- - in_progress
- - completed
- - failed
- - superseded
- description: Status of a memory store update operation.
- x-ms-foundry-meta:
- required_previews:
- - MemoryStores=V1Preview
- Message:
+ - info
+ - warn
+ - error
+ description: The log level of the event.
+ message:
+ type: string
+ description: The message of the event.
+ type:
+ type: string
+ enum:
+ - message
+ - metrics
+ description: The type of event.
+ data:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobEventData'
+ description: The data associated with the event.
+ description: Fine-tuning job event object
+ x-oaiMeta:
+ name: The fine-tuning job event object
+ example: |
+ {
+ "object": "fine_tuning.job.event",
+ "id": "ftevent-abc123"
+ "created_at": 1677610602,
+ "level": "info",
+ "message": "Created fine-tuning job",
+ "data": {},
+ "type": "message"
+ }
+ OpenAI.FineTuningJobEventData:
+ type: object
+ OpenAI.FineTuningJobHyperparameters:
type: object
- required:
- - role
properties:
- role:
+ batch_size:
anyOf:
- type: string
enum:
- - system
- - assistant
- - developer
- - user
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ default: auto
+ learning_rate_multiplier:
+ oneOf:
- type: string
- description: "The role of the message author. Known values: 'system', 'assistant', 'developer', 'user'."
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ default: auto
+ n_epochs:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.integer'
+ default: auto
+ OpenAI.FunctionAndCustomToolCallOutput:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType'
discriminator:
- propertyName: role
+ propertyName: type
mapping:
- system: '#/components/schemas/SystemMessage'
- developer: '#/components/schemas/DeveloperMessage'
- user: '#/components/schemas/UserMessage'
- assistant: '#/components/schemas/AssistantMessage'
- description: Abstract base model representing a single message in a conversation.
- MicrosoftFabricPreviewTool:
+ input_text: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent'
+ input_image: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent'
+ input_file: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent'
+ OpenAI.FunctionAndCustomToolCallOutputInputFileContent:
type: object
required:
- type
- - fabric_dataagent_preview
properties:
type:
type: string
enum:
- - fabric_dataagent_preview
- description: The object type, which is always 'fabric_dataagent_preview'.
- fabric_dataagent_preview:
- $ref: '#/components/schemas/FabricDataAgentToolParameters'
- description: The fabric data agent tool parameters.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: The input definition information for a Microsoft Fabric tool as used to configure an agent.
- ModelCredentialRequest:
- type: object
- required:
- - blobUri
- properties:
- blobUri:
+ - input_file
+ description: The type of the input item. Always `input_file`.
+ x-stainless-const: true
+ default: input_file
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ filename:
+ type: string
+ description: The name of the file to be sent to the model.
+ file_data:
+ type: string
+ description: The content of the file to be sent to the model.
+ file_url:
type: string
format: uri
- description: Blob URI of the model asset to fetch credentials for.
- description: Request to fetch credentials for a model asset.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- ModelDeployment:
+ description: The URL of the file to be sent to the model.
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: A file input to the model.
+ title: Input file
+ OpenAI.FunctionAndCustomToolCallOutputInputImageContent:
type: object
required:
- type
- - modelName
- - modelVersion
- - modelPublisher
- - capabilities
- - sku
+ - detail
properties:
type:
type: string
enum:
- - ModelDeployment
- description: The type of the deployment
- modelName:
- type: string
- description: Publisher-specific name of the deployed model
- readOnly: true
- modelVersion:
- type: string
- description: Publisher-specific version of the deployed model
- readOnly: true
- modelPublisher:
- type: string
- description: Name of the deployed model's publisher
- readOnly: true
- capabilities:
- type: object
- unevaluatedProperties:
- type: string
- description: Capabilities of deployed model
- readOnly: true
- sku:
- $ref: '#/components/schemas/Sku'
- description: Sku of the model deployment
- readOnly: true
- connectionName:
- type: string
- description: Name of the connection the deployment comes from
- readOnly: true
+ - input_image
+ description: The type of the input item. Always `input_image`.
+ x-stainless-const: true
+ default: input_image
+ image_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/Deployment'
- description: Model Deployment Definition
- ModelPendingUploadRequest:
+ - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
+ title: Input image
+ OpenAI.FunctionAndCustomToolCallOutputInputTextContent:
type: object
required:
- - pendingUploadType
+ - type
+ - text
properties:
- pendingUploadId:
- type: string
- description: If PendingUploadId is not provided, a random GUID will be used.
- connectionName:
+ type:
type: string
- description: Azure Storage Account connection name to use for generating temporary SAS token
- pendingUploadType:
+ enum:
+ - input_text
+ description: The type of the input item. Always `input_text`.
+ x-stainless-const: true
+ default: input_text
+ text:
type: string
+ description: The text input to the model.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: A text input to the model.
+ title: Input text
+ OpenAI.FunctionAndCustomToolCallOutputType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - TemporaryBlobReference
- description: The type of pending upload. Only TemporaryBlobReference is supported for models.
- description: Represents a request for a pending upload of a model version.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- ModelPendingUploadResponse:
+ - input_text
+ - input_image
+ - input_file
+ OpenAI.FunctionCallItemStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.FunctionCallOutputStatusEnum:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.FunctionCallStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.FunctionObject:
type: object
required:
- - blobReference
- - pendingUploadId
- - pendingUploadType
+ - name
properties:
- blobReference:
- $ref: '#/components/schemas/BlobReference'
- description: Container-level read, write, list SAS.
- pendingUploadId:
- type: string
- description: ID for this upload request.
- version:
+ description:
type: string
- description: Version of asset to be created if user did not specify version when initially creating upload
- pendingUploadType:
+ description: A description of what the function does, used by the model to choose when and how to call the function.
+ name:
type: string
- enum:
- - TemporaryBlobReference
- description: The type of pending upload. Only TemporaryBlobReference is supported for models.
- description: Represents the response for a model pending upload request.
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- ModelSamplingParams:
+ description: 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.
+ parameters:
+ $ref: '#/components/schemas/OpenAI.FunctionParameters'
+ strict:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ OpenAI.FunctionParameters:
type: object
- properties:
- temperature:
- type: number
- format: float
- description: The temperature parameter for sampling. Defaults to 1.0.
- default: 1
- top_p:
- type: number
- format: float
- description: The top-p parameter for nucleus sampling. Defaults to 1.0.
- default: 1
- seed:
- type: integer
- format: int32
- description: The random seed for reproducibility. Defaults to 42.
- default: 42
- max_completion_tokens:
- type: integer
- format: int32
- description: The maximum number of tokens allowed in the completion.
- description: Represents a set of parameters used to control the sampling behavior of a language model during text generation.
- ModelSourceData:
+ unevaluatedProperties: {}
+ description: |-
+ The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
+ Omitting `parameters` defines a function with an empty parameter list.
+ OpenAI.FunctionShellAction:
type: object
+ required:
+ - commands
+ - timeout_ms
+ - max_output_length
properties:
- sourceType:
- $ref: '#/components/schemas/FoundryModelSourceType'
- description: The source type of the model
- jobId:
- type: string
- description: The job ID that produced this model
- description: Source information for the model
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- ModelVersion:
+ commands:
+ type: array
+ items:
+ type: string
+ timeout_ms:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: Execute a shell command.
+ title: Shell exec action
+ OpenAI.FunctionShellActionParam:
type: object
required:
- - blobUri
- - name
- - version
+ - commands
properties:
- blobUri:
- type: string
- format: uri
- description: URI of the model artifact in blob storage
- weightType:
- $ref: '#/components/schemas/FoundryModelWeightType'
- description: The weight type of the model
- baseModel:
- type: string
- description: Base model asset ID
- source:
- $ref: '#/components/schemas/ModelSourceData'
- description: The source of the model
- loraConfig:
- $ref: '#/components/schemas/LoraConfig'
- description: Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided values take precedence over auto-detected values.
- artifactProfile:
- $ref: '#/components/schemas/ArtifactProfile'
- description: The artifact profile of the model
- readOnly: true
- warnings:
+ commands:
type: array
items:
- $ref: '#/components/schemas/FoundryModelWarning'
- description: Service-computed advisory warnings derived from the artifact profile.
- readOnly: true
- id:
- type: string
- description: Asset ID, a unique identifier for the asset
- readOnly: true
- name:
- type: string
- description: The name of the resource
- readOnly: true
- version:
+ type: string
+ description: Ordered shell commands for the execution environment to run.
+ timeout_ms:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ description: Commands and limits describing how to run the shell tool call.
+ title: Shell action
+ OpenAI.FunctionShellCallEnvironment:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironmentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ local: '#/components/schemas/OpenAI.LocalEnvironmentResource'
+ container_reference: '#/components/schemas/OpenAI.ContainerReferenceResource'
+ OpenAI.FunctionShellCallEnvironmentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - local
+ - container_reference
+ OpenAI.FunctionShellCallItemParamEnvironment:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ local: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam'
+ container_reference: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam'
+ description: The environment to execute the shell commands in.
+ OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam:
+ type: object
+ required:
+ - type
+ - container_id
+ properties:
+ type:
type: string
- description: The version of the resource
- readOnly: true
- description:
+ enum:
+ - container_reference
+ description: References a container created with the /v1/containers endpoint
+ x-stainless-const: true
+ default: container_reference
+ container_id:
type: string
- description: The asset description text.
- tags:
- type: object
- unevaluatedProperties:
- type: string
- description: Tag dictionary. Tags can be added, removed, and updated.
- description: Model Version Definition
- x-ms-foundry-meta:
- required_previews:
- - Models=V1Preview
- MonthlyRecurrenceSchedule:
+ description: The ID of the referenced container.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
+ OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam:
type: object
required:
- type
- - daysOfMonth
properties:
type:
type: string
enum:
- - Monthly
- description: Monthly recurrence type.
- daysOfMonth:
+ - local
+ description: Use a local computer environment.
+ x-stainless-const: true
+ default: local
+ skills:
type: array
items:
- type: integer
- format: int32
- description: Days of the month for the recurrence schedule.
+ $ref: '#/components/schemas/OpenAI.LocalSkillParam'
+ maxItems: 200
+ description: An optional list of skills.
allOf:
- - $ref: '#/components/schemas/RecurrenceSchedule'
- description: Monthly recurrence schedule.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- NoAuthenticationCredentials:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
+ OpenAI.FunctionShellCallItemParamEnvironmentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - local
+ - container_reference
+ OpenAI.FunctionShellCallItemStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: Status values reported for shell tool calls.
+ title: Shell call status
+ OpenAI.FunctionShellCallOutputContent:
+ type: object
+ required:
+ - stdout
+ - stderr
+ - outcome
+ properties:
+ stdout:
+ type: string
+ description: The standard output that was captured.
+ stderr:
+ type: string
+ description: The standard error output that was captured.
+ outcome:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
+ description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
+ title: Shell call outcome
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ description: The content of a shell tool call output that was emitted.
+ title: Shell call output content
+ OpenAI.FunctionShellCallOutputContentParam:
+ type: object
+ required:
+ - stdout
+ - stderr
+ - outcome
+ properties:
+ stdout:
+ type: string
+ maxLength: 10485760
+ description: Captured stdout output for the shell call.
+ stderr:
+ type: string
+ maxLength: 10485760
+ description: Captured stderr output for the shell call.
+ outcome:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
+ description: The exit or timeout outcome associated with this shell call.
+ description: Captured stdout and stderr for a portion of a shell tool call output.
+ title: Shell output content
+ OpenAI.FunctionShellCallOutputExitOutcome:
type: object
required:
- type
+ - exit_code
properties:
type:
type: string
enum:
- - None
- description: 'The credential type '
- readOnly: true
+ - exit
+ description: The outcome type. Always `exit`.
+ x-stainless-const: true
+ exit_code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Exit code from the shell process.
allOf:
- - $ref: '#/components/schemas/BaseCredentials'
- description: Credentials that do not require authentication
- OAuthConsentRequestOutputItem:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
+ description: Indicates that the shell commands finished and returned an exit code.
+ title: Shell call exit outcome
+ OpenAI.FunctionShellCallOutputExitOutcomeParam:
type: object
required:
- - id
- type
- - consent_link
- - server_label
+ - exit_code
properties:
- id:
- type: string
type:
type: string
enum:
- - oauth_consent_request
- consent_link:
- type: string
- description: The link the user can use to perform OAuth consent.
- server_label:
- type: string
- description: The server label for the OAuth consent request.
+ - exit
+ description: The outcome type. Always `exit`.
+ x-stainless-const: true
+ exit_code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The exit code returned by the shell process.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: Request from the service for the user to perform OAuth consent.
- OneTimeTrigger:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
+ description: Indicates that the shell commands finished and returned an exit code.
+ title: Shell call exit outcome
+ OpenAI.FunctionShellCallOutputOutcome:
type: object
required:
- type
- - triggerAt
properties:
type:
- type: string
- enum:
- - OneTime
- triggerAt:
- type: string
- description: Date and time for the one-time trigger in ISO 8601 format.
- timeZone:
- type: string
- description: Time zone for the one-time trigger. Defaults to `UTC`.
- default: UTC
- allOf:
- - $ref: '#/components/schemas/Trigger'
- description: One-time trigger.
- x-ms-foundry-meta:
- required_previews:
- - Schedules=V1Preview
- OpenAI.Annotation:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType'
+ discriminator:
+ propertyName: type
+ mapping:
+ timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome'
+ exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome'
+ description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
+ title: Shell call outcome
+ OpenAI.FunctionShellCallOutputOutcomeParam:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.AnnotationType'
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParamType'
discriminator:
propertyName: type
mapping:
- file_citation: '#/components/schemas/OpenAI.FileCitationBody'
- url_citation: '#/components/schemas/OpenAI.UrlCitationBody'
- container_file_citation: '#/components/schemas/OpenAI.ContainerFileCitationBody'
- file_path: '#/components/schemas/OpenAI.FilePath'
- description: An annotation that applies to a span of output text.
- OpenAI.AnnotationType:
+ timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcomeParam'
+ exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcomeParam'
+ description: The exit or timeout outcome associated with this shell call.
+ title: Shell call outcome
+ OpenAI.FunctionShellCallOutputOutcomeParamType:
anyOf:
- type: string
- type: string
enum:
- - file_citation
- - url_citation
- - container_file_citation
- - file_path
- OpenAI.ApplyPatchCallOutputStatus:
- type: string
- enum:
- - completed
- - failed
- OpenAI.ApplyPatchCallOutputStatusParam:
- type: string
- enum:
- - completed
- - failed
- description: Outcome values reported for apply_patch tool call outputs.
- title: Apply patch call output status
- OpenAI.ApplyPatchCallStatus:
+ - timeout
+ - exit
+ OpenAI.FunctionShellCallOutputOutcomeType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - timeout
+ - exit
+ OpenAI.FunctionShellCallOutputStatusEnum:
type: string
enum:
- in_progress
- completed
- OpenAI.ApplyPatchCallStatusParam:
+ - incomplete
+ OpenAI.FunctionShellCallOutputTimeoutOutcome:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - timeout
+ description: The outcome type. Always `timeout`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
+ description: Indicates that the shell call exceeded its configured time limit.
+ title: Shell call timeout outcome
+ OpenAI.FunctionShellCallOutputTimeoutOutcomeParam:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - timeout
+ description: The outcome type. Always `timeout`.
+ x-stainless-const: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
+ description: Indicates that the shell call exceeded its configured time limit.
+ title: Shell call timeout outcome
+ OpenAI.FunctionShellCallStatus:
type: string
enum:
- in_progress
- completed
- description: Status values reported for apply_patch tool calls.
- title: Apply patch call status
- OpenAI.ApplyPatchCreateFileOperation:
+ - incomplete
+ OpenAI.FunctionShellToolParam:
type: object
required:
- type
- - path
- - diff
properties:
type:
type: string
enum:
- - create_file
- description: Create a new file with the provided diff.
+ - shell
+ description: The type of the shell tool. Always `shell`.
x-stainless-const: true
- path:
+ environment:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
+ - type: 'null'
+ name:
type: string
- description: Path of the file to create.
- diff:
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
type: string
- description: Diff to apply.
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: Instruction describing how to create a file via the apply_patch tool.
- title: Apply patch create file operation
- OpenAI.ApplyPatchCreateFileOperationParam:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that allows the model to execute shell commands.
+ title: Shell tool
+ OpenAI.FunctionShellToolParamEnvironment:
type: object
required:
- type
- - path
- - diff
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ local: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam'
+ container_reference: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam'
+ container_auto: '#/components/schemas/OpenAI.ContainerAutoParam'
+ OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam:
+ type: object
+ required:
+ - type
+ - container_id
properties:
type:
type: string
enum:
- - create_file
- description: The operation type. Always `create_file`.
+ - container_reference
+ description: References a container created with the /v1/containers endpoint
x-stainless-const: true
- path:
- type: string
- minLength: 1
- description: Path of the file to create relative to the workspace root.
- diff:
+ default: container_reference
+ container_id:
type: string
- maxLength: 10485760
- description: Unified diff content to apply when creating the file.
+ description: The ID of the referenced container.
allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: Instruction for creating a new file via the apply_patch tool.
- title: Apply patch create file operation
- OpenAI.ApplyPatchDeleteFileOperation:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
+ OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam:
type: object
required:
- type
- - path
properties:
type:
type: string
enum:
- - delete_file
- description: Delete the specified file.
+ - local
+ description: Use a local computer environment.
x-stainless-const: true
- path:
- type: string
- description: Path of the file to delete.
+ default: local
+ skills:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.LocalSkillParam'
+ maxItems: 200
+ description: An optional list of skills.
allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: Instruction describing how to delete a file via the apply_patch tool.
- title: Apply patch delete file operation
- OpenAI.ApplyPatchDeleteFileOperationParam:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
+ OpenAI.FunctionShellToolParamEnvironmentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - container_auto
+ - local
+ - container_reference
+ OpenAI.FunctionTool:
type: object
required:
- type
- - path
+ - name
+ - parameters
+ - strict
properties:
type:
type: string
enum:
- - delete_file
- description: The operation type. Always `delete_file`.
+ - function
+ description: The type of the function tool. Always `function`.
x-stainless-const: true
- path:
+ name:
type: string
- minLength: 1
- description: Path of the file to delete relative to the workspace root.
+ description: The name of the function to call.
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ parameters:
+ anyOf:
+ - type: object
+ unevaluatedProperties: {}
+ - type: 'null'
+ strict:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ defer_loading:
+ type: boolean
+ description: Whether this function is deferred and loaded via tool search.
allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: Instruction for deleting an existing file via the apply_patch tool.
- title: Apply patch delete file operation
- OpenAI.ApplyPatchFileOperation:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: 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).
+ title: Function
+ OpenAI.FunctionToolParam:
type: object
required:
+ - name
- type
properties:
+ name:
+ type: string
+ minLength: 1
+ maxLength: 128
+ pattern: ^[a-zA-Z0-9_-]+$
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ parameters:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EmptyModelParam'
+ - type: 'null'
+ strict:
+ anyOf:
+ - type: boolean
+ - type: 'null'
type:
- $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperationType'
- discriminator:
- propertyName: type
- mapping:
- create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperation'
- delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation'
- update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation'
- description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
- title: Apply patch operation
- OpenAI.ApplyPatchFileOperationType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - create_file
- - delete_file
- - update_file
- OpenAI.ApplyPatchOperationParam:
+ - function
+ x-stainless-const: true
+ default: function
+ defer_loading:
+ type: boolean
+ description: Whether this function should be deferred and discovered via tool search.
+ OpenAI.GraderLabelModel:
type: object
required:
- type
+ - name
+ - model
+ - input
+ - labels
+ - passing_labels
properties:
type:
- $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParamType'
- discriminator:
- propertyName: type
- mapping:
- create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperationParam'
- delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperationParam'
- update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperationParam'
- description: One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.
- title: Apply patch operation
- OpenAI.ApplyPatchOperationParamType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - create_file
- - delete_file
- - update_file
- OpenAI.ApplyPatchToolParam:
+ - label_model
+ description: The object type, which is always `label_model`.
+ x-stainless-const: true
+ name:
+ type: string
+ description: The name of the grader.
+ model:
+ type: string
+ description: The model to use for the evaluation. Must support structured outputs.
+ input:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalItem'
+ labels:
+ type: array
+ items:
+ type: string
+ description: The labels to assign to each item in the evaluation.
+ passing_labels:
+ type: array
+ items:
+ type: string
+ description: The labels that indicate a passing result. Must be a subset of labels.
+ description: |-
+ A LabelModelGrader object which uses a model to assign labels to each item
+ in the evaluation.
+ title: LabelModelGrader
+ x-oaiMeta:
+ name: Label Model Grader
+ group: graders
+ example: |
+ {
+ "name": "First label grader",
+ "type": "label_model",
+ "model": "gpt-4o-2024-08-06",
+ "input": [
+ {
+ "type": "message",
+ "role": "system",
+ "content": {
+ "type": "input_text",
+ "text": "Classify the sentiment of the following statement as one of positive, neutral, or negative"
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "Statement: {{item.response}}"
+ }
+ }
+ ],
+ "passing_labels": [
+ "positive"
+ ],
+ "labels": [
+ "positive",
+ "neutral",
+ "negative"
+ ]
+ }
+ OpenAI.GraderMulti:
type: object
required:
- type
+ - name
+ - graders
+ - calculate_output
properties:
type:
type: string
enum:
- - apply_patch
- description: The type of the tool. Always `apply_patch`.
+ - multi
+ description: The object type, which is always `multi`.
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: Allows the assistant to create, delete, or update files using unified diffs.
- title: Apply patch tool
- OpenAI.ApplyPatchUpdateFileOperation:
+ default: multi
+ name:
+ type: string
+ description: The name of the grader.
+ graders:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderLabelModel'
+ calculate_output:
+ type: string
+ description: A formula to calculate the output based on grader results.
+ description: A MultiGrader object combines the output of multiple graders to produce a single score.
+ title: MultiGrader
+ x-oaiMeta:
+ name: Multi Grader
+ group: graders
+ example: |
+ {
+ "type": "multi",
+ "name": "example multi grader",
+ "graders": [
+ {
+ "type": "text_similarity",
+ "name": "example text similarity grader",
+ "input": "The graded text",
+ "reference": "The reference text",
+ "evaluation_metric": "fuzzy_match"
+ },
+ {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ }
+ ],
+ "calculate_output": "0.5 * text_similarity_score + 0.5 * string_check_score)"
+ }
+ OpenAI.GraderPython:
type: object
required:
- type
- - path
- - diff
+ - name
+ - source
properties:
type:
type: string
enum:
- - update_file
- description: Update an existing file with the provided diff.
+ - python
+ description: The object type, which is always `python`.
x-stainless-const: true
- path:
+ name:
type: string
- description: Path of the file to update.
- diff:
+ description: The name of the grader.
+ source:
type: string
- description: Diff to apply.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: Instruction describing how to update a file via the apply_patch tool.
- title: Apply patch update file operation
- OpenAI.ApplyPatchUpdateFileOperationParam:
+ description: The source code of the python script.
+ image_tag:
+ type: string
+ description: The image tag to use for the python script.
+ description: A PythonGrader object that runs a python script on the input.
+ title: PythonGrader
+ x-oaiMeta:
+ name: Python Grader
+ group: graders
+ example: |
+ {
+ "type": "python",
+ "name": "Example python grader",
+ "image_tag": "2025-05-08",
+ "source": """
+ def grade(sample: dict, item: dict) -> float:
+ """
+ Returns 1.0 if `output_text` equals `label`, otherwise 0.0.
+ """
+ output = sample.get("output_text")
+ label = item.get("label")
+ return 1.0 if output == label else 0.0
+ """,
+ }
+ OpenAI.GraderScoreModel:
type: object
required:
- type
- - path
- - diff
+ - name
+ - model
+ - input
properties:
type:
type: string
enum:
- - update_file
- description: The operation type. Always `update_file`.
+ - score_model
+ description: The object type, which is always `score_model`.
x-stainless-const: true
- path:
+ name:
type: string
- minLength: 1
- description: Path of the file to update relative to the workspace root.
- diff:
+ description: The name of the grader.
+ model:
type: string
- maxLength: 10485760
- description: Unified diff content to apply to the existing file.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: Instruction for updating an existing file via the apply_patch tool.
- title: Apply patch update file operation
- OpenAI.ApproximateLocation:
+ description: The model to use for the evaluation.
+ sampling_params:
+ $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams'
+ description: The sampling parameters for the model.
+ input:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.EvalItem'
+ description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
+ range:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The range of the score. Defaults to `[0, 1]`.
+ description: A ScoreModelGrader object that uses a model to assign a score to the input.
+ title: ScoreModelGrader
+ x-oaiMeta:
+ name: Score Model Grader
+ group: graders
+ example: |
+ {
+ "type": "score_model",
+ "name": "Example score model grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": (
+ "Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different."
+ " Return just a floating point score
+
+ "
+ " Reference answer: {{item.label}}
+
+ "
+ " Model answer: {{sample.output_text}}"
+ )
+ },
+ {
+ "type": "input_image",
+ "image_url": "https://example.com/reference.png",
+ "file_id": null,
+ "detail": "auto"
+ }
+ ],
+ }
+ ],
+ "model": "gpt-5-mini",
+ "sampling_params": {
+ "temperature": 1,
+ "top_p": 1,
+ "seed": 42,
+ "max_completions_tokens": 32768,
+ "reasoning_effort": "medium"
+ },
+ }
+ OpenAI.GraderStringCheck:
type: object
required:
- type
+ - name
+ - input
+ - reference
+ - operation
properties:
type:
type: string
enum:
- - approximate
- description: The type of location approximation. Always `approximate`.
+ - string_check
+ description: The object type, which is always `string_check`.
x-stainless-const: true
- default: approximate
- country:
- anyOf:
- - type: string
- - type: 'null'
- region:
- anyOf:
- - type: string
- - type: 'null'
- city:
- anyOf:
- - type: string
- - type: 'null'
- timezone:
- anyOf:
- - type: string
- - type: 'null'
- OpenAI.AutoCodeInterpreterToolParam:
+ name:
+ type: string
+ description: The name of the grader.
+ input:
+ type: string
+ description: The input text. This may include template strings.
+ reference:
+ type: string
+ description: The reference text. This may include template strings.
+ operation:
+ type: string
+ enum:
+ - eq
+ - ne
+ - like
+ - ilike
+ description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
+ description: A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
+ title: StringCheckGrader
+ x-oaiMeta:
+ name: String Check Grader
+ group: graders
+ example: |
+ {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ }
+ OpenAI.GraderTextSimilarity:
type: object
required:
- type
+ - name
+ - input
+ - reference
+ - evaluation_metric
properties:
type:
type: string
enum:
- - auto
- description: Always `auto`.
+ - text_similarity
+ description: The type of grader.
x-stainless-const: true
- default: auto
- file_ids:
- type: array
- items:
- type: string
- maxItems: 50
- description: An optional list of uploaded files to make available to your code.
- memory_limit:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit'
- - type: 'null'
- network_policy:
- $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
- description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
- title: Automatic Code Interpreter Tool Parameters
- OpenAI.ChatCompletionTool:
+ default: text_similarity
+ name:
+ type: string
+ description: The name of the grader.
+ input:
+ type: string
+ description: The text being graded.
+ reference:
+ type: string
+ description: The text being graded against.
+ evaluation_metric:
+ type: string
+ enum:
+ - cosine
+ - fuzzy_match
+ - bleu
+ - gleu
+ - meteor
+ - rouge_1
+ - rouge_2
+ - rouge_3
+ - rouge_4
+ - rouge_5
+ - rouge_l
+ description: |-
+ 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`.
+ description: A TextSimilarityGrader object which grades text based on similarity metrics.
+ title: TextSimilarityGrader
+ x-oaiMeta:
+ name: Text Similarity Grader
+ group: graders
+ example: |
+ {
+ "type": "text_similarity",
+ "name": "Example text similarity grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "evaluation_metric": "fuzzy_match"
+ }
+ OpenAI.GrammarSyntax1:
+ type: string
+ enum:
+ - lark
+ - regex
+ OpenAI.HybridSearchOptions:
type: object
required:
- - type
- - function
+ - embedding_weight
+ - text_weight
properties:
- type:
+ embedding_weight:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The weight of the embedding in the reciprocal ranking fusion.
+ text_weight:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The weight of the text in the reciprocal ranking fusion.
+ OpenAI.Image:
+ type: object
+ properties:
+ b64_json:
type: string
- enum:
- - function
- description: The type of the tool. Currently, only `function` is supported.
- x-stainless-const: true
- function:
- $ref: '#/components/schemas/OpenAI.FunctionObject'
- description: A function tool that can be used to generate a response.
- title: Function tool
- OpenAI.ChatModel:
+ contentEncoding: base64
+ description: The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`.
+ url:
+ type: string
+ format: uri
+ description: 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 the GPT image models.
+ revised_prompt:
+ type: string
+ description: For `dall-e-3` only, the revised prompt that was used to generate the image.
+ description: Represents the content or the URL of an image generated by the OpenAI API.
+ OpenAI.ImageDetail:
type: string
enum:
- - gpt-5.4
- - gpt-5.4-mini
- - gpt-5.4-nano
- - gpt-5.4-mini-2026-03-17
- - gpt-5.4-nano-2026-03-17
- - gpt-5.3-chat-latest
- - gpt-5.2
- - gpt-5.2-2025-12-11
- - gpt-5.2-chat-latest
- - gpt-5.2-pro
- - gpt-5.2-pro-2025-12-11
- - gpt-5.1
- - gpt-5.1-2025-11-13
- - gpt-5.1-codex
- - gpt-5.1-mini
- - gpt-5.1-chat-latest
- - 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-5-chat-latest
- - 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
- - o4-mini
- - o4-mini-2025-04-16
- - o3
- - o3-2025-04-16
- - o3-mini
- - o3-mini-2025-01-31
- - o1
- - o1-2024-12-17
- - o1-preview
- - o1-preview-2024-09-12
- - o1-mini
- - o1-mini-2024-09-12
- - gpt-4o
- - gpt-4o-2024-11-20
- - gpt-4o-2024-08-06
- - gpt-4o-2024-05-13
- - gpt-4o-audio-preview
- - gpt-4o-audio-preview-2024-10-01
- - gpt-4o-audio-preview-2024-12-17
- - gpt-4o-audio-preview-2025-06-03
- - gpt-4o-mini-audio-preview
- - gpt-4o-mini-audio-preview-2024-12-17
- - gpt-4o-search-preview
- - gpt-4o-mini-search-preview
- - gpt-4o-search-preview-2025-03-11
- - gpt-4o-mini-search-preview-2025-03-11
- - chatgpt-4o-latest
- - codex-mini-latest
- - gpt-4o-mini
- - gpt-4o-mini-2024-07-18
- - 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-0301
- - gpt-3.5-turbo-0613
- - gpt-3.5-turbo-1106
- - gpt-3.5-turbo-0125
- - gpt-3.5-turbo-16k-0613
- OpenAI.ClickButtonType:
+ - low
+ - high
+ - auto
+ - original
+ OpenAI.ImageGenActionEnum:
type: string
enum:
- - left
- - right
- - wheel
- - back
- - forward
- OpenAI.ClickParam:
+ - generate
+ - edit
+ - auto
+ OpenAI.ImageGenInputUsageDetails:
type: object
required:
- - type
- - button
- - x
- - 'y'
+ - text_tokens
+ - image_tokens
properties:
- type:
- type: string
- enum:
- - click
- description: Specifies the event type. For a click action, this property is always `click`.
- x-stainless-const: true
- button:
- $ref: '#/components/schemas/OpenAI.ClickButtonType'
- description: Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
- x:
+ text_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate where the click occurred.
- 'y':
+ description: The number of text tokens in the input prompt.
+ image_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate where the click occurred.
- keys:
- anyOf:
- - type: array
- items:
- type: string
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A click action.
- title: Click
- OpenAI.CodeInterpreterOutputImage:
+ description: The number of image tokens in the input prompt.
+ description: The input tokens detailed information for the image generation.
+ title: Input usage details
+ OpenAI.ImageGenOutputTokensDetails:
type: object
required:
- - type
- - url
+ - image_tokens
+ - text_tokens
properties:
- type:
- type: string
- enum:
- - image
- description: The type of the output. Always `image`.
- x-stainless-const: true
- default: image
- url:
- type: string
- format: uri
- description: The URL of the image output from the code interpreter.
- description: The image output from the code interpreter.
- title: Code interpreter output image
- OpenAI.CodeInterpreterOutputLogs:
+ image_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of image output tokens generated by the model.
+ text_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of text output tokens generated by the model.
+ description: The output token details for the image generation.
+ title: Image generation output token details
+ OpenAI.ImageGenTool:
type: object
required:
- type
- - logs
properties:
type:
type: string
enum:
- - logs
- description: The type of the output. Always `logs`.
+ - image_generation
+ description: The type of the image generation tool. Always `image_generation`.
x-stainless-const: true
- default: logs
- logs:
+ model:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - gpt-image-1
+ - gpt-image-1-mini
+ - gpt-image-1.5
+ default: gpt-image-1
+ quality:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ - auto
+ description: |-
+ The quality of the generated image. One of `low`, `medium`, `high`,
+ or `auto`. Default: `auto`.
+ default: auto
+ size:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - 1024x1024
+ - 1024x1536
+ - 1536x1024
+ - auto
+ description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
+ default: auto
+ output_format:
+ type: string
+ enum:
+ - png
+ - webp
+ - jpeg
+ description: |-
+ The output format of the generated image. One of `png`, `webp`, or
+ `jpeg`. Default: `png`.
+ default: png
+ output_compression:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
+ maximum: 100
+ description: 'Compression level for the output image. Default: 100.'
+ default: 100
+ moderation:
type: string
- description: The logs output from the code interpreter.
- description: The logs output from the code interpreter.
- title: Code interpreter output logs
- OpenAI.CodeInterpreterTool:
- type: object
- required:
- - type
- properties:
- type:
+ enum:
+ - auto
+ - low
+ description: 'Moderation level for the generated image. Default: `auto`.'
+ default: auto
+ background:
type: string
enum:
- - code_interpreter
- description: The type of the code interpreter tool. Always `code_interpreter`.
- x-stainless-const: true
+ - transparent
+ - opaque
+ - auto
+ description: |-
+ Background type for the generated image. One of `transparent`,
+ `opaque`, or `auto`. Default: `auto`.
+ default: auto
+ input_fidelity:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.InputFidelity'
+ - type: 'null'
+ input_image_mask:
+ $ref: '#/components/schemas/OpenAI.ImageGenToolInputImageMask'
+ description: |-
+ Optional mask for inpainting. Contains `image_url`
+ (string, optional) and `file_id` (string, optional).
+ partial_images:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
+ maximum: 3
+ description: Number of partial images to generate in streaming mode, from 0 (default value) to 3.
+ action:
+ $ref: '#/components/schemas/OpenAI.ImageGenActionEnum'
+ description: 'Whether to generate a new image or edit an existing image. Default: `auto`.'
name:
type: string
description: Deprecated. This property is deprecated and will be removed in a future version.
@@ -21800,561 +58668,543 @@ components:
$ref: '#/components/schemas/ToolConfig'
description: Deprecated. This property is deprecated and will be removed in a future version.
deprecated: true
- container:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.AutoCodeInterpreterToolParam'
- description: |-
- The code interpreter container. Can be a container ID or an object that
- specifies uploaded file IDs to make available to your code, along with an
- optional `memory_limit` setting.
- If not provided, the service assumes auto.
allOf:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that runs Python code to help generate a response to a prompt.
- title: Code interpreter
- OpenAI.CompactResource:
+ description: A tool that generates images using the GPT image models.
+ title: Image generation tool
+ OpenAI.ImageGenToolInputImageMask:
type: object
- required:
- - id
- - object
- - output
- - created_at
- - usage
properties:
- id:
+ image_url:
type: string
- description: The unique identifier for the compacted response.
- object:
+ format: uri
+ file_id:
type: string
- enum:
- - response.compaction
- description: The object type. Always `response.compaction`.
- x-stainless-const: true
- default: response.compaction
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ItemField'
- description: The compacted list of output items.
- created_at:
- type: integer
- format: unixtime
- description: Unix timestamp (in seconds) when the compacted conversation was created.
- usage:
- $ref: '#/components/schemas/OpenAI.ResponseUsage'
- description: Token accounting for the compaction pass, including cached, reasoning, and total tokens.
- title: The compacted response object
- OpenAI.CompactResponseMethodPublicBody:
+ OpenAI.ImageGenUsage:
type: object
required:
- - model
+ - input_tokens
+ - total_tokens
+ - output_tokens
+ - input_tokens_details
properties:
- model:
- $ref: '#/components/schemas/OpenAI.ModelIdsCompaction'
- input:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputItem'
- - type: 'null'
- previous_response_id:
- anyOf:
- - type: string
- - type: 'null'
- instructions:
- anyOf:
- - type: string
- - type: 'null'
- prompt_cache_key:
- anyOf:
- - type: string
- - type: 'null'
- prompt_cache_retention:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.PromptCacheRetentionEnum'
- - type: 'null'
- service_tier:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ServiceTierEnum'
- - type: 'null'
- OpenAI.ComparisonFilter:
+ input_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of tokens (images and text) in the input prompt.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total number of tokens (images and text) used for the image generation.
+ output_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of output tokens generated by the model.
+ output_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ImageGenOutputTokensDetails'
+ input_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ImageGenInputUsageDetails'
+ description: For `gpt-image-1` only, the token usage information for the image generation.
+ title: Image generation usage
+ OpenAI.ImageRefParam:
+ anyOf:
+ - type: object
+ properties:
+ image_url:
+ type: string
+ format: uri
+ maxLength: 20971520
+ required:
+ - image_url
+ - type: object
+ properties:
+ file_id:
+ type: string
+ required:
+ - file_id
+ description: |-
+ Reference an input image by either URL or uploaded file ID.
+ Provide exactly one of `image_url` or `file_id`.
+ OpenAI.ImagesResponse:
type: object
required:
- - type
- - key
- - value
+ - created
properties:
- type:
+ created:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) of when the image was created.
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Image'
+ description: The list of generated images.
+ background:
type: string
enum:
- - eq
- - ne
- - gt
- - gte
- - lt
- - lte
- - in
- - nin
- description: |-
- Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.
- - `eq`: equals
- - `ne`: not equal
- - `gt`: greater than
- - `gte`: greater than or equal
- - `lt`: less than
- - `lte`: less than or equal
- - `in`: in
- - `nin`: not in
- default: eq
- key:
+ - transparent
+ - opaque
+ description: The background parameter used for the image generation. Either `transparent` or `opaque`.
+ output_format:
type: string
- description: The key to compare against the value.
- value:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: boolean
- - type: array
- items:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: The value to compare against the attribute key; supports string, number, or boolean types.
- description: A filter used to compare a specified attribute key to a given value using a defined comparison operation.
- title: Comparison Filter
- x-oaiMeta:
- name: ComparisonFilter
- OpenAI.CompoundFilter:
- type: object
- required:
- - type
- - filters
- properties:
- type:
+ enum:
+ - png
+ - webp
+ - jpeg
+ description: The output format of the image generation. Either `png`, `webp`, or `jpeg`.
+ size:
type: string
enum:
- - and
- - or
- description: 'Type of operation: `and` or `or`.'
- filters:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
- - {}
- description: Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
- description: Combine multiple filters using `and` or `or`.
- title: Compound Filter
+ - 1024x1024
+ - 1024x1536
+ - 1536x1024
+ description: The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`.
+ quality:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ description: The quality of the image generated. Either `low`, `medium`, or `high`.
+ usage:
+ $ref: '#/components/schemas/OpenAI.ImageGenUsage'
+ description: The response from the image generation endpoint.
+ title: Image generation response
x-oaiMeta:
- name: CompoundFilter
- OpenAI.ComputerAction:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.ComputerActionType'
- discriminator:
- propertyName: type
- mapping:
- click: '#/components/schemas/OpenAI.ClickParam'
- double_click: '#/components/schemas/OpenAI.DoubleClickAction'
- drag: '#/components/schemas/OpenAI.DragParam'
- keypress: '#/components/schemas/OpenAI.KeyPressAction'
- move: '#/components/schemas/OpenAI.MoveParam'
- screenshot: '#/components/schemas/OpenAI.ScreenshotParam'
- scroll: '#/components/schemas/OpenAI.ScrollParam'
- type: '#/components/schemas/OpenAI.TypeParam'
- wait: '#/components/schemas/OpenAI.WaitParam'
- OpenAI.ComputerActionList:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: |-
- Flattened batched actions for `computer_use`. Each action includes an
- `type` discriminator and action-specific fields.
- title: Computer Action List
- OpenAI.ComputerActionType:
+ name: The image generation response
+ group: images
+ example: |
+ {
+ "created": 1713833628,
+ "data": [
+ {
+ "b64_json": "..."
+ }
+ ],
+ "background": "transparent",
+ "output_format": "png",
+ "size": "1024x1024",
+ "quality": "high",
+ "usage": {
+ "total_tokens": 100,
+ "input_tokens": 50,
+ "output_tokens": 50,
+ "input_tokens_details": {
+ "text_tokens": 10,
+ "image_tokens": 40
+ }
+ }
+ }
+ OpenAI.IncludeEnum:
anyOf:
- type: string
- type: string
enum:
- - click
- - double_click
- - drag
- - keypress
- - move
- - screenshot
- - scroll
- - type
- - wait
- OpenAI.ComputerCallSafetyCheckParam:
- type: object
- required:
- - id
- properties:
- id:
- type: string
- description: The ID of the pending safety check.
- code:
- anyOf:
- - type: string
- - type: 'null'
- message:
- anyOf:
- - type: string
- - type: 'null'
- description: A pending safety check for the computer call.
- OpenAI.ComputerEnvironment:
- type: string
- enum:
- - windows
- - mac
- - linux
- - ubuntu
- - browser
- OpenAI.ComputerScreenshotContent:
+ - file_search_call.results
+ - web_search_call.results
+ - web_search_call.action.sources
+ - message.input_image.image_url
+ - computer_call_output.output.image_url
+ - code_interpreter_call.outputs
+ - reasoning.encrypted_content
+ - message.output_text.logprobs
+ - memory_search_call.results
+ description: |-
+ Specify additional output data to include in the model response. Currently supported values are:
+ - `web_search_call.results`: Include the search results of the web search tool call.
+ - `web_search_call.action.sources`: Include the sources of the web search tool call.
+ - `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).
+ OpenAI.InlineSkillParam:
type: object
required:
- type
- - image_url
- - file_id
- - detail
+ - name
+ - description
+ - source
properties:
type:
type: string
enum:
- - computer_screenshot
- description: Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.
+ - inline
+ description: Defines an inline skill for this request.
x-stainless-const: true
- image_url:
- anyOf:
- - type: string
- format: uri
- - type: 'null'
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
+ name:
+ type: string
+ description: The name of the skill.
+ description:
+ type: string
+ description: The description of the skill.
+ source:
+ $ref: '#/components/schemas/OpenAI.InlineSkillSourceParam'
+ description: Inline skill payload
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A screenshot of a computer.
- title: Computer screenshot
- OpenAI.ComputerScreenshotImage:
+ - $ref: '#/components/schemas/OpenAI.ContainerSkill'
+ OpenAI.InlineSkillSourceParam:
type: object
required:
- type
+ - media_type
+ - data
properties:
type:
type: string
enum:
- - computer_screenshot
- description: |-
- Specifies the event type. For a computer screenshot, this property is
- always set to `computer_screenshot`.
+ - base64
+ description: The type of the inline skill source. Must be `base64`.
x-stainless-const: true
- default: computer_screenshot
- image_url:
+ default: base64
+ media_type:
type: string
- format: uri
- description: The URL of the screenshot image.
- file_id:
+ enum:
+ - application/zip
+ description: The media type of the inline skill payload. Must be `application/zip`.
+ x-stainless-const: true
+ default: application/zip
+ data:
type: string
- description: The identifier of an uploaded file that contains the screenshot.
- description: A computer screenshot image used with the computer use tool.
- OpenAI.ComputerTool:
+ minLength: 1
+ maxLength: 70254592
+ description: Base64-encoded skill zip bundle.
+ description: Inline skill payload
+ OpenAI.InputAudio:
type: object
required:
- type
+ - input_audio
properties:
type:
type: string
enum:
- - computer
- description: The type of the computer tool. Always `computer`.
+ - input_audio
+ description: The type of the input item. Always `input_audio`.
x-stainless-const: true
+ input_audio:
+ $ref: '#/components/schemas/OpenAI.InputAudioInputAudio'
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
- title: Computer
- OpenAI.ComputerUsePreviewTool:
+ - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
+ description: An audio input to the model.
+ title: Input audio
+ OpenAI.InputAudioInputAudio:
type: object
required:
- - type
- - environment
- - display_width
- - display_height
+ - data
+ - format
properties:
- type:
+ data:
+ type: string
+ format:
type: string
enum:
- - computer_use_preview
- description: The type of the computer use tool. Always `computer_use_preview`.
- x-stainless-const: true
- environment:
- $ref: '#/components/schemas/OpenAI.ComputerEnvironment'
- description: The type of computer environment to control.
- display_width:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The width of the computer display.
- display_height:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The height of the computer display.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
- title: Computer use preview
- OpenAI.ContainerAutoParam:
+ - mp3
+ - wav
+ OpenAI.InputContent:
type: object
required:
- type
properties:
type:
- type: string
- enum:
- - container_auto
- description: Automatically creates a container for this request
- x-stainless-const: true
- file_ids:
- type: array
- items:
- type: string
- maxItems: 50
- description: An optional list of uploaded files to make available to your code.
- memory_limit:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit'
- - type: 'null'
- skills:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ContainerSkill'
- maxItems: 200
- description: An optional list of skills referenced by id or inline data.
- network_policy:
- $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
- allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
- OpenAI.ContainerFileCitationBody:
+ $ref: '#/components/schemas/OpenAI.InputContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ input_text: '#/components/schemas/OpenAI.InputContentInputTextContent'
+ input_image: '#/components/schemas/OpenAI.InputContentInputImageContent'
+ input_file: '#/components/schemas/OpenAI.InputContentInputFileContent'
+ OpenAI.InputContentInputFileContent:
type: object
required:
- type
- - container_id
- - file_id
- - start_index
- - end_index
- - filename
properties:
type:
type: string
enum:
- - container_file_citation
- description: The type of the container file citation. Always `container_file_citation`.
+ - input_file
+ description: The type of the input item. Always `input_file`.
x-stainless-const: true
- container_id:
- type: string
- description: The ID of the container file.
+ default: input_file
file_id:
- type: string
- description: The ID of the file.
- start_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the first character of the container file citation in the message.
- end_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the last character of the container file citation in the message.
+ anyOf:
+ - type: string
+ - type: 'null'
filename:
type: string
- description: The filename of the container file cited.
+ description: The name of the file to be sent to the model.
+ file_data:
+ type: string
+ description: The content of the file to be sent to the model.
+ file_url:
+ type: string
+ format: uri
+ description: The URL of the file to be sent to the model.
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
allOf:
- - $ref: '#/components/schemas/OpenAI.Annotation'
- description: A citation for a container file used to generate a model response.
- title: Container file citation
- OpenAI.ContainerMemoryLimit:
- type: string
- enum:
- - 1g
- - 4g
- - 16g
- - 64g
- OpenAI.ContainerNetworkPolicyAllowlistParam:
+ - $ref: '#/components/schemas/OpenAI.InputContent'
+ description: A file input to the model.
+ title: Input file
+ OpenAI.InputContentInputImageContent:
type: object
required:
- type
- - allowed_domains
+ - detail
properties:
type:
type: string
enum:
- - allowlist
- description: Allow outbound network access only to specified domains. Always `allowlist`.
+ - input_image
+ description: The type of the input item. Always `input_image`.
x-stainless-const: true
- allowed_domains:
- type: array
- items:
- type: string
- minItems: 1
- description: A list of allowed domains when type is `allowlist`.
+ default: input_image
+ image_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
- OpenAI.ContainerNetworkPolicyDisabledParam:
+ - $ref: '#/components/schemas/OpenAI.InputContent'
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
+ title: Input image
+ OpenAI.InputContentInputTextContent:
type: object
required:
- type
+ - text
properties:
type:
type: string
enum:
- - disabled
- description: Disable outbound network access. Always `disabled`.
+ - input_text
+ description: The type of the input item. Always `input_text`.
x-stainless-const: true
+ default: input_text
+ text:
+ type: string
+ description: The text input to the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParam'
- OpenAI.ContainerNetworkPolicyParam:
+ - $ref: '#/components/schemas/OpenAI.InputContent'
+ description: A text input to the model.
+ title: Input text
+ OpenAI.InputContentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - input_text
+ - input_image
+ - input_file
+ OpenAI.InputFidelity:
+ type: string
+ enum:
+ - high
+ - low
+ description: Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.
+ OpenAI.InputFileContent:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.ContainerNetworkPolicyParamType'
- discriminator:
- propertyName: type
- mapping:
- disabled: '#/components/schemas/OpenAI.ContainerNetworkPolicyDisabledParam'
- allowlist: '#/components/schemas/OpenAI.ContainerNetworkPolicyAllowlistParam'
- description: Network access policy for the container.
- OpenAI.ContainerNetworkPolicyParamType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - disabled
- - allowlist
- OpenAI.ContainerReferenceResource:
+ - input_file
+ description: The type of the input item. Always `input_file`.
+ x-stainless-const: true
+ default: input_file
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ filename:
+ type: string
+ description: The name of the file to be sent to the model.
+ file_data:
+ type: string
+ description: The content of the file to be sent to the model.
+ file_url:
+ type: string
+ format: uri
+ description: The URL of the file to be sent to the model.
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
+ description: A file input to the model.
+ title: Input file
+ OpenAI.InputFileContentParam:
type: object
required:
- type
- - container_id
properties:
type:
type: string
enum:
- - container_reference
- description: The environment type. Always `container_reference`.
+ - input_file
+ description: The type of the input item. Always `input_file`.
x-stainless-const: true
- container_id:
- type: string
- allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
- description: Represents a container created with /v1/containers.
- title: Container Reference
- OpenAI.ContainerSkill:
+ default: input_file
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ filename:
+ anyOf:
+ - type: string
+ - type: 'null'
+ file_data:
+ anyOf:
+ - type: string
+ - type: 'null'
+ file_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
+ description: A file input to the model.
+ title: Input file
+ OpenAI.InputImageContent:
type: object
required:
- type
+ - detail
properties:
type:
- $ref: '#/components/schemas/OpenAI.ContainerSkillType'
- discriminator:
- propertyName: type
- mapping:
- skill_reference: '#/components/schemas/OpenAI.SkillReferenceParam'
- inline: '#/components/schemas/OpenAI.InlineSkillParam'
- OpenAI.ContainerSkillType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - skill_reference
- - inline
- OpenAI.ContextManagementParam:
+ - input_image
+ description: The type of the input item. Always `input_image`.
+ x-stainless-const: true
+ default: input_image
+ image_url:
+ anyOf:
+ - type: string
+ format: uri
+ - type: 'null'
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
+ title: Input image
+ OpenAI.InputImageContentParamAutoParam:
type: object
required:
- type
properties:
type:
type: string
- description: The context management entry type. Currently only 'compaction' is supported.
- compact_threshold:
+ enum:
+ - input_image
+ description: The type of the input item. Always `input_image`.
+ x-stainless-const: true
+ default: input_image
+ image_url:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
+ format: uri
- type: 'null'
- OpenAI.ConversationItem:
+ file_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ detail:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.DetailEnum'
+ - type: 'null'
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision)
+ title: Input image
+ OpenAI.InputItem:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.ConversationItemType'
+ $ref: '#/components/schemas/OpenAI.InputItemType'
discriminator:
propertyName: type
mapping:
- message: '#/components/schemas/OpenAI.ConversationItemMessage'
- function_call: '#/components/schemas/OpenAI.ConversationItemFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutput'
- file_search_call: '#/components/schemas/OpenAI.ConversationItemFileSearchToolCall'
- web_search_call: '#/components/schemas/OpenAI.ConversationItemWebSearchToolCall'
- image_generation_call: '#/components/schemas/OpenAI.ConversationItemImageGenToolCall'
- computer_call: '#/components/schemas/OpenAI.ConversationItemComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.ConversationItemComputerToolCallOutput'
- tool_search_call: '#/components/schemas/OpenAI.ConversationItemToolSearchCall'
- tool_search_output: '#/components/schemas/OpenAI.ConversationItemToolSearchOutput'
- additional_tools: '#/components/schemas/OpenAI.ConversationItemAdditionalTools'
- reasoning: '#/components/schemas/OpenAI.ConversationItemReasoningItem'
- compaction: '#/components/schemas/OpenAI.ConversationItemCompactionBody'
- code_interpreter_call: '#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.ConversationItemFunctionShellCall'
- shell_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput'
- apply_patch_call: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall'
- apply_patch_call_output: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput'
- mcp_list_tools: '#/components/schemas/OpenAI.ConversationItemMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource'
- mcp_call: '#/components/schemas/OpenAI.ConversationItemMcpToolCall'
- custom_tool_call: '#/components/schemas/OpenAI.ConversationItemCustomToolCallResource'
- custom_tool_call_output: '#/components/schemas/OpenAI.ConversationItemCustomToolCallOutputResource'
- description: A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](/docs/api-reference/responses/object#responses/object-output).
- title: Conversation item
- OpenAI.ConversationItemAdditionalTools:
+ message: '#/components/schemas/OpenAI.EasyInputMessage'
+ item_reference: '#/components/schemas/OpenAI.ItemReferenceParam'
+ output_message: '#/components/schemas/OpenAI.InputItemOutputMessage'
+ file_search_call: '#/components/schemas/OpenAI.InputItemFileSearchToolCall'
+ computer_call: '#/components/schemas/OpenAI.InputItemComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.InputItemComputerCallOutputItemParam'
+ web_search_call: '#/components/schemas/OpenAI.InputItemWebSearchToolCall'
+ function_call: '#/components/schemas/OpenAI.InputItemFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.InputItemFunctionCallOutputItemParam'
+ tool_search_call: '#/components/schemas/OpenAI.InputItemToolSearchCallItemParam'
+ tool_search_output: '#/components/schemas/OpenAI.InputItemToolSearchOutputItemParam'
+ additional_tools: '#/components/schemas/OpenAI.InputItemAdditionalToolsItemParam'
+ reasoning: '#/components/schemas/OpenAI.InputItemReasoningItem'
+ compaction: '#/components/schemas/OpenAI.InputItemCompactionSummaryItemParam'
+ image_generation_call: '#/components/schemas/OpenAI.InputItemImageGenToolCall'
+ code_interpreter_call: '#/components/schemas/OpenAI.InputItemCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.InputItemLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.InputItemLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.InputItemFunctionShellCallItemParam'
+ shell_call_output: '#/components/schemas/OpenAI.InputItemFunctionShellCallOutputItemParam'
+ apply_patch_call: '#/components/schemas/OpenAI.InputItemApplyPatchToolCallItemParam'
+ apply_patch_call_output: '#/components/schemas/OpenAI.InputItemApplyPatchToolCallOutputItemParam'
+ mcp_list_tools: '#/components/schemas/OpenAI.InputItemMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.InputItemMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.InputItemMcpApprovalResponse'
+ mcp_call: '#/components/schemas/OpenAI.InputItemMcpToolCall'
+ custom_tool_call_output: '#/components/schemas/OpenAI.InputItemCustomToolCallOutput'
+ custom_tool_call: '#/components/schemas/OpenAI.InputItemCustomToolCall'
+ description: |-
+ An item representing part of the context for the response to be
+ generated by the model. Can contain text, images, and audio inputs,
+ as well as previous assistant responses and tool call outputs.
+ OpenAI.InputItemAdditionalToolsItemParam:
type: object
required:
- type
- - id
- role
- tools
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- additional_tools
- description: The type of the item. Always `additional_tools`.
+ description: The item type. Always `additional_tools`.
x-stainless-const: true
default: additional_tools
- id:
- type: string
- description: The unique ID of the additional tools item.
role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role that provided the additional tools.
+ type: string
+ enum:
+ - developer
+ description: The role that provided the additional tools. Only `developer` is supported.
+ x-stainless-const: true
+ default: developer
tools:
type: array
items:
$ref: '#/components/schemas/OpenAI.Tool'
- description: The additional tool definitions made available at this item.
+ description: A list of additional tools made available at this item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- OpenAI.ConversationItemApplyPatchToolCall:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ OpenAI.InputItemApplyPatchToolCallItemParam:
type: object
required:
- type
- - id
- call_id
- status
- operation
@@ -22367,30 +59217,28 @@ components:
x-stainless-const: true
default: apply_patch_call
id:
- type: string
- description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
+ anyOf:
+ - type: string
+ - type: 'null'
call_id:
type: string
+ minLength: 1
+ maxLength: 64
description: The unique ID of the apply patch tool call generated by the model.
status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatusParam'
description: The status of the apply patch tool call. One of `in_progress` or `completed`.
operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
- title: Apply patch operation
- created_by:
- type: string
- description: The ID of the entity that created this tool call.
+ $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: The specific create, delete, or update instruction for the apply_patch tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A tool call that applies file diffs by creating, deleting, or updating files.
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A tool call representing a request to create, delete, or update files using diff patches.
title: Apply patch tool call
- OpenAI.ConversationItemApplyPatchToolCallOutput:
+ OpenAI.InputItemApplyPatchToolCallOutputItemParam:
type: object
required:
- type
- - id
- call_id
- status
properties:
@@ -22402,26 +59250,26 @@ components:
x-stainless-const: true
default: apply_patch_call_output
id:
- type: string
- description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
+ anyOf:
+ - type: string
+ - type: 'null'
call_id:
type: string
+ minLength: 1
+ maxLength: 64
description: The unique ID of the apply patch tool call generated by the model.
status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam'
description: The status of the apply patch tool call output. One of `completed` or `failed`.
output:
anyOf:
- type: string
- type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call output.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: The output emitted by an apply patch tool call.
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The streamed output emitted by an apply patch tool call.
title: Apply patch tool call output
- OpenAI.ConversationItemCodeInterpreterToolCall:
+ OpenAI.InputItemCodeInterpreterToolCall:
type: object
required:
- type
@@ -22466,16 +59314,19 @@ components:
- $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: A tool call to run code.
title: Code interpreter tool call
- OpenAI.ConversationItemCompactionBody:
+ OpenAI.InputItemCompactionSummaryItemParam:
type: object
required:
- type
- - id
- encrypted_content
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
@@ -22483,20 +59334,54 @@ components:
description: The type of the item. Always `compaction`.
x-stainless-const: true
default: compaction
- id:
- type: string
- description: The unique ID of the compaction item.
encrypted_content:
type: string
- description: The encrypted content that was produced by compaction.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
+ maxLength: 10485760
+ description: The encrypted content of the compaction summary.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
title: Compaction item
- OpenAI.ConversationItemComputerToolCall:
+ OpenAI.InputItemComputerCallOutputItemParam:
+ type: object
+ required:
+ - call_id
+ - type
+ - output
+ properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The ID of the computer tool call that produced the output.
+ type:
+ type: string
+ enum:
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
+ x-stainless-const: true
+ default: computer_call_output
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ acknowledged_safety_checks:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ - type: 'null'
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.InputItemComputerToolCall:
type: object
required:
- type
@@ -22536,62 +59421,50 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: |-
A tool call to a computer use tool. See the
[computer use guide](/docs/guides/tools-computer-use) for more information.
title: Computer tool call
- OpenAI.ConversationItemComputerToolCallOutput:
+ OpenAI.InputItemCustomToolCall:
type: object
required:
- type
- - id
- call_id
- - output
+ - name
+ - input
properties:
type:
type: string
enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
x-stainless-const: true
- default: computer_call_output
id:
type: string
- description: The ID of the computer tool call output.
- readOnly: true
+ description: The unique ID of the custom tool call in the OpenAI platform.
call_id:
type: string
- description: The ID of the computer tool call that produced the output.
- acknowledged_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: |-
- The safety checks reported by the API that have been acknowledged by the
- developer.
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- status:
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.ConversationItemCustomToolCallOutputResource:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A call to a custom tool created by the model.
+ title: Custom tool call
+ OpenAI.InputItemCustomToolCallOutput:
type: object
required:
- type
- call_id
- output
- - status
properties:
type:
type: string
@@ -22614,59 +59487,11 @@ components:
description: |-
The output from the custom tool call generated by your code.
Can be a string or an list of output content.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- title: ResponseCustomToolCallOutputItem
- OpenAI.ConversationItemCustomToolCallResource:
- type: object
- required:
- - type
- - call_id
- - name
- - input
- - status
- properties:
- type:
- type: string
- enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
- type: string
- description: The name of the custom tool being called.
- input:
- type: string
- description: The input for the custom tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- title: ResponseCustomToolCallItem
- OpenAI.ConversationItemFileSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The output of a custom tool call from your code, being sent back to the model.
+ title: Custom tool call output
+ OpenAI.InputItemFileSearchToolCall:
type: object
required:
- id
@@ -22703,24 +59528,71 @@ components:
anyOf:
- type: array
items:
- $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ The results of a file search tool call. See the
+ [file search guide](/docs/guides/tools-file-search) for more information.
+ title: File search tool call
+ OpenAI.InputItemFunctionCallOutputItemParam:
+ type: object
+ required:
+ - call_id
+ - type
+ - output
+ properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the function tool call generated by the model.
+ type:
+ type: string
+ enum:
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
+ x-stainless-const: true
+ default: function_call_output
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.InputTextContentParam'
+ - $ref: '#/components/schemas/OpenAI.InputImageContentParamAutoParam'
+ - $ref: '#/components/schemas/OpenAI.InputFileContentParam'
+ description: Text, image, or file output of the function tool call.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: |-
- The results of a file search tool call. See the
- [file search guide](/docs/guides/tools-file-search) for more information.
- title: File search tool call
- OpenAI.ConversationItemFunctionShellCall:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.InputItemFunctionShellCallItemParam:
type: object
required:
- - type
- - id
- call_id
+ - type
- action
- - status
- - environment
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the shell tool call generated by the model.
type:
type: string
enum:
@@ -22728,72 +59600,62 @@ components:
description: The type of the item. Always `shell_call`.
x-stainless-const: true
default: shell_call
- id:
- type: string
- description: The unique ID of the shell tool call. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
action:
- $ref: '#/components/schemas/OpenAI.FunctionShellAction'
+ $ref: '#/components/schemas/OpenAI.FunctionShellActionParam'
description: The shell commands and limits that describe how to run the tool call.
status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
- description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
+ - type: 'null'
environment:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
- type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A tool call that executes one or more shell commands in a managed environment.
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: A tool representing a request to execute one or more shell commands.
title: Shell tool call
- OpenAI.ConversationItemFunctionShellCallOutput:
+ OpenAI.InputItemFunctionShellCallOutputItemParam:
type: object
required:
- - type
- - id
- call_id
- - status
+ - type
- output
- - max_output_length
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the shell tool call generated by the model.
type:
type: string
enum:
- shell_call_output
- description: The type of the shell call output. Always `shell_call_output`.
+ description: The type of the item. Always `shell_call_output`.
x-stainless-const: true
default: shell_call_output
- id:
- type: string
- description: The unique ID of the shell call output. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
- description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
output:
type: array
items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
- description: An array of shell call output contents
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContentParam'
+ description: Captured chunks of stdout and stderr output, along with their associated outcomes.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
+ - type: 'null'
max_output_length:
anyOf:
- $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- created_by:
- type: string
- description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: The output of a shell tool call that was emitted.
- title: Shell call output
- OpenAI.ConversationItemFunctionToolCall:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: The streamed output items emitted by a shell tool call.
+ title: Shell tool call output
+ OpenAI.InputItemFunctionToolCall:
type: object
required:
- id
@@ -22834,57 +59696,12 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: |-
A tool call to run a function. See the
[function calling guide](/docs/guides/function-calling) for more information.
title: Function tool call
- OpenAI.ConversationItemFunctionToolCallOutput:
- type: object
- required:
- - id
- - type
- - call_id
- - output
- properties:
- id:
- type: string
- description: |-
- The unique ID of the function tool call output. Populated when this item
- is returned via API.
- readOnly: true
- type:
- type: string
- enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
- x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the function call generated by your code.
- Can be a string or an list of output content.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.ConversationItemImageGenToolCall:
+ OpenAI.InputItemImageGenToolCall:
type: object
required:
- type
@@ -22914,46 +59731,10 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: An image generation request made by the model.
title: Image generation call
- OpenAI.ConversationItemList:
- type: object
- required:
- - object
- - data
- - has_more
- - first_id
- - last_id
- properties:
- object:
- type: string
- enum:
- - list
- description: The type of object returned, must be `list`.
- x-stainless-const: true
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A list of conversation items.
- x-ms-list-page-items: true
- has_more:
- type: boolean
- description: Whether there are more items available.
- first_id:
- type: string
- description: The ID of the first item in the list.
- last_id:
- type: string
- description: The ID of the last item in the list.
- x-ms-list-continuation-token: true
- description: A list of Conversation items.
- title: The conversation item list
- x-oaiMeta:
- name: The item list
- group: conversations
- OpenAI.ConversationItemLocalShellToolCall:
+ OpenAI.InputItemLocalShellToolCall:
type: object
required:
- type
@@ -22984,10 +59765,10 @@ components:
- incomplete
description: The status of the local shell call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: A tool call to run a command on the local shell.
title: Local shell call
- OpenAI.ConversationItemLocalShellToolCallOutput:
+ OpenAI.InputItemLocalShellToolCallOutput:
type: object
required:
- type
@@ -23015,10 +59796,10 @@ components:
- incomplete
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: The output of a local shell tool call.
title: Local shell call output
- OpenAI.ConversationItemMcpApprovalRequest:
+ OpenAI.InputItemMcpApprovalRequest:
type: object
required:
- type
@@ -23046,14 +59827,13 @@ components:
type: string
description: A JSON string of arguments for the tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: A request for human approval of a tool invocation.
title: MCP approval request
- OpenAI.ConversationItemMcpApprovalResponseResource:
+ OpenAI.InputItemMcpApprovalResponse:
type: object
required:
- type
- - id
- approval_request_id
- approve
properties:
@@ -23064,8 +59844,9 @@ components:
description: The type of the item. Always `mcp_approval_response`.
x-stainless-const: true
id:
- type: string
- description: The unique ID of the approval response
+ anyOf:
+ - type: string
+ - type: 'null'
approval_request_id:
type: string
description: The ID of the approval request being answered.
@@ -23077,10 +59858,10 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: A response to an MCP approval request.
title: MCP approval response
- OpenAI.ConversationItemMcpListTools:
+ OpenAI.InputItemMcpListTools:
type: object
required:
- type
@@ -23108,10 +59889,10 @@ components:
error:
$ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: A list of tools available on an MCP server.
title: MCP list tools
- OpenAI.ConversationItemMcpToolCall:
+ OpenAI.InputItemMcpToolCall:
type: object
required:
- type
@@ -23153,48 +59934,56 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: An invocation of a tool on an MCP server.
title: MCP tool call
- OpenAI.ConversationItemMessage:
+ OpenAI.InputItemOutputMessage:
type: object
required:
- - type
- id
- - status
+ - type
- role
- content
+ - status
properties:
+ id:
+ type: string
+ description: The unique ID of the output message.
type:
type: string
enum:
- - message
- description: The type of the message. Always set to `message`.
+ - output_message
+ description: The type of the output message. Always `message`.
x-stainless-const: true
- default: message
- id:
- type: string
- description: The unique ID of the message.
- status:
- $ref: '#/components/schemas/OpenAI.MessageStatus'
- description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`.
+ type: string
+ enum:
+ - assistant
+ description: The role of the output message. Always `assistant`.
+ x-stainless-const: true
content:
type: array
items:
- $ref: '#/components/schemas/OpenAI.MessageContent'
- description: The content of the message
+ $ref: '#/components/schemas/OpenAI.OutputMessageContent'
+ description: The content of the output message.
phase:
anyOf:
- $ref: '#/components/schemas/OpenAI.MessagePhase'
- type: 'null'
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: A message to or from the model.
- title: Message
- OpenAI.ConversationItemReasoningItem:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: An output message from the model.
+ title: Output message
+ OpenAI.InputItemReasoningItem:
type: object
required:
- type
@@ -23234,74 +60023,67 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
+ - $ref: '#/components/schemas/OpenAI.InputItem'
description: |-
A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your `input` to the Responses API
for subsequent turns of a conversation if you are manually
[managing context](/docs/guides/conversation-state).
title: Reasoning
- OpenAI.ConversationItemToolSearchCall:
+ OpenAI.InputItemToolSearchCallItemParam:
type: object
required:
- type
- - id
- - call_id
- - execution
- arguments
- - status
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- tool_search_call
- description: The type of the item. Always `tool_search_call`.
+ description: The item type. Always `tool_search_call`.
x-stainless-const: true
default: tool_search_call
- id:
- type: string
- description: The unique ID of the tool search call item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
execution:
$ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
description: Whether tool search was executed by the server or by the client.
arguments:
- description: Arguments used for the tool search call.
+ $ref: '#/components/schemas/OpenAI.EmptyModelParam'
+ description: The arguments supplied to the tool search call.
status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: The status of the tool search call item that was recorded.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- OpenAI.ConversationItemToolSearchOutput:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ OpenAI.InputItemToolSearchOutputItemParam:
type: object
required:
- type
- - id
- - call_id
- - execution
- tools
- - status
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- tool_search_output
- description: The type of the item. Always `tool_search_output`.
+ description: The item type. Always `tool_search_output`.
x-stainless-const: true
default: tool_search_output
- id:
- type: string
- description: The unique ID of the tool search output item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
execution:
$ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
description: Whether tool search was executed by the server or by the client.
@@ -23309,976 +60091,746 @@ components:
type: array
items:
$ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by tool search.
+ description: The loaded tool definitions returned by the tool search output.
status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: The status of the tool search output item that was recorded.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- OpenAI.ConversationItemType:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ OpenAI.InputItemType:
anyOf:
- type: string
- type: string
enum:
- message
- - function_call
- - function_call_output
+ - output_message
- file_search_call
- - web_search_call
- - image_generation_call
- computer_call
- computer_call_output
- - tool_search_call
- - tool_search_output
- - additional_tools
- - reasoning
- - compaction
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - mcp_call
- - custom_tool_call
- - custom_tool_call_output
- OpenAI.ConversationItemWebSearchToolCall:
- type: object
- required:
- - id
- - type
- - status
- - action
- properties:
- id:
- type: string
- description: The unique ID of the web search tool call.
- type:
- type: string
- enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
- x-stainless-const: true
- status:
- type: string
- enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
- description: |-
- 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_in_page).
- allOf:
- - $ref: '#/components/schemas/OpenAI.ConversationItem'
- description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.ConversationParam:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.ConversationParam-2'
- description: |-
- The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.
- Input items and output items from this response are automatically added to this conversation after this response completes.
- OpenAI.ConversationParam-2:
- type: object
- required:
- - id
- properties:
- id:
- type: string
- description: The unique ID of the conversation.
- description: The conversation that this response belongs to.
- title: Conversation object
- OpenAI.ConversationReference:
- type: object
- required:
- - id
- properties:
- id:
- type: string
- description: The unique ID of the conversation that this response was associated with.
- description: The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
- title: Conversation
- OpenAI.ConversationResource:
- type: object
- required:
- - id
- - object
- - metadata
- - created_at
- properties:
- id:
- type: string
- description: The unique ID of the conversation.
- object:
- type: string
- enum:
- - conversation
- description: The object type, which is always `conversation`.
- x-stainless-const: true
- default: conversation
- metadata:
- $ref: '#/components/schemas/OpenAI.Metadata'
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- created_at:
- type: integer
- format: unixtime
- description: The time at which the conversation was created, measured in seconds since the Unix epoch.
- OpenAI.CoordParam:
- type: object
- required:
- - x
- - 'y'
- properties:
- x:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate.
- 'y':
- $ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate.
- description: 'An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.'
- title: Coordinate
- OpenAI.CreateChatCompletionRequestResponseFormat:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType'
- discriminator:
- propertyName: type
- mapping:
- text: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText'
- json_object: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject'
- json_schema: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
- description: |-
- 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](/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.
- OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject:
+ - web_search_call
+ - function_call
+ - function_call_output
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - reasoning
+ - compaction
+ - image_generation_call
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - mcp_call
+ - custom_tool_call_output
+ - custom_tool_call
+ - item_reference
+ OpenAI.InputItemWebSearchToolCall:
type: object
required:
+ - id
- type
+ - status
+ - action
properties:
+ id:
+ type: string
+ description: The unique ID of the web search tool call.
type:
type: string
enum:
- - json_object
- description: The type of response format being defined. Always `json_object`.
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
- description: |-
- JSON object response format. An older method of generating JSON responses.
- Using `json_schema` is recommended for models that support it. Note that the
- model will not generate JSON without a system or user message instructing it
- to do so.
- title: JSON object
- OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText:
- type: object
- required:
- - type
- properties:
- type:
+ status:
type: string
enum:
- - text
- description: The type of response format being defined. Always `text`.
- x-stainless-const: true
+ - in_progress
+ - searching
+ - completed
+ - failed
+ - incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ description: |-
+ 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_in_page).
allOf:
- - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
- description: Default response format. Used to generate text responses.
- title: Text
- OpenAI.CreateChatCompletionRequestResponseFormatType:
- anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.InputMessageContentList:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.InputContent'
+ description: |-
+ A list of one or many input items to the model, containing different content
+ types.
+ title: Input item content list
+ OpenAI.InputParam:
+ oneOf:
- type: string
- enum:
- - text
- - json_schema
- - json_object
- OpenAI.CreateConversationBody:
- type: object
- properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- items:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputItem'
- - type: 'null'
- OpenAI.CreateEvalCompletionsRunDataSource:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.InputItem'
+ description: |-
+ Text, image, or file inputs to the model, used to generate a response.
+ Learn more:
+ - [Text inputs and outputs](/docs/guides/text)
+ - [Image inputs](/docs/guides/images)
+ - [File inputs](/docs/guides/pdf-files)
+ - [Conversation state](/docs/guides/conversation-state)
+ - [Function calling](/docs/guides/function-calling)
+ OpenAI.InputTextContent:
type: object
required:
- type
- - source
+ - text
properties:
type:
type: string
enum:
- - completions
- description: The type of run data source. Always `completions`.
- default: completions
- input_messages:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate'
- - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference'
- description: 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.
- sampling_params:
- $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams'
- model:
+ - input_text
+ description: The type of the input item. Always `input_text`.
+ x-stainless-const: true
+ default: input_text
+ text:
type: string
- description: The name of the model to use for generating completions (e.g. "o3-mini").
- source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
- - $ref: '#/components/schemas/OpenAI.EvalStoredCompletionsSource'
- description: Determines what populates the `item` namespace in this run's data source.
- description: A CompletionsRunDataSource object describing a model sampling configuration.
- title: CompletionsRunDataSource
- x-oaiMeta:
- name: The completions data source object used to configure an individual run
- group: eval runs
- example: |
- {
- "name": "gpt-4o-mini-2024-07-18",
- "data_source": {
- "type": "completions",
- "input_messages": {
- "type": "item_reference",
- "item_reference": "item.input"
- },
- "model": "gpt-4o-mini-2024-07-18",
- "source": {
- "type": "stored_completions",
- "model": "gpt-4o-mini-2024-07-18"
- }
- }
- }
- OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference:
+ description: The text input to the model.
+ description: A text input to the model.
+ title: Input text
+ OpenAI.InputTextContentParam:
type: object
required:
- type
- - item_reference
+ - text
properties:
type:
type: string
enum:
- - item_reference
- item_reference:
+ - input_text
+ description: The type of the input item. Always `input_text`.
+ x-stainless-const: true
+ default: input_text
+ text:
type: string
- OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate:
+ maxLength: 10485760
+ description: The text input to the model.
+ description: A text input to the model.
+ title: Input text
+ OpenAI.Item:
type: object
required:
- type
- - template
properties:
type:
- type: string
- enum:
- - template
- template:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EasyInputMessage'
- - $ref: '#/components/schemas/OpenAI.EvalItem'
- OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams:
- type: object
- properties:
- reasoning_effort:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
- - type: 'null'
- temperature:
- $ref: '#/components/schemas/OpenAI.numeric'
- default: 1
- max_completion_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- top_p:
- $ref: '#/components/schemas/OpenAI.numeric'
- default: 1
- seed:
- $ref: '#/components/schemas/OpenAI.integer'
- default: 42
- response_format:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.ResponseFormatText'
- - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema'
- - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject'
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ChatCompletionTool'
- OpenAI.CreateEvalCustomDataSourceConfig:
+ $ref: '#/components/schemas/OpenAI.ItemType'
+ discriminator:
+ propertyName: type
+ mapping:
+ message: '#/components/schemas/OpenAI.ItemInputMessage'
+ output_message: '#/components/schemas/OpenAI.ItemOutputMessage'
+ file_search_call: '#/components/schemas/OpenAI.ItemFileSearchToolCall'
+ computer_call: '#/components/schemas/OpenAI.ItemComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.ItemComputerCallOutputItemParam'
+ web_search_call: '#/components/schemas/OpenAI.ItemWebSearchToolCall'
+ function_call: '#/components/schemas/OpenAI.ItemFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.ItemFunctionCallOutputItemParam'
+ tool_search_call: '#/components/schemas/OpenAI.ItemToolSearchCallItemParam'
+ tool_search_output: '#/components/schemas/OpenAI.ItemToolSearchOutputItemParam'
+ additional_tools: '#/components/schemas/OpenAI.ItemAdditionalToolsItemParam'
+ reasoning: '#/components/schemas/OpenAI.ItemReasoningItem'
+ compaction: '#/components/schemas/OpenAI.ItemCompactionSummaryItemParam'
+ image_generation_call: '#/components/schemas/OpenAI.ItemImageGenToolCall'
+ code_interpreter_call: '#/components/schemas/OpenAI.ItemCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.ItemLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.ItemLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.ItemFunctionShellCallItemParam'
+ shell_call_output: '#/components/schemas/OpenAI.ItemFunctionShellCallOutputItemParam'
+ apply_patch_call: '#/components/schemas/OpenAI.ItemApplyPatchToolCallItemParam'
+ apply_patch_call_output: '#/components/schemas/OpenAI.ItemApplyPatchToolCallOutputItemParam'
+ mcp_list_tools: '#/components/schemas/OpenAI.ItemMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.ItemMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.ItemMcpApprovalResponse'
+ mcp_call: '#/components/schemas/OpenAI.ItemMcpToolCall'
+ custom_tool_call_output: '#/components/schemas/OpenAI.ItemCustomToolCallOutput'
+ custom_tool_call: '#/components/schemas/OpenAI.ItemCustomToolCall'
+ description: Content item used to generate a response.
+ OpenAI.ItemAdditionalToolsItemParam:
type: object
required:
- type
- - item_schema
+ - role
+ - tools
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- - custom
- description: The type of data source. Always `custom`.
+ - additional_tools
+ description: The item type. Always `additional_tools`.
x-stainless-const: true
- default: custom
- item_schema:
- type: object
- unevaluatedProperties: {}
- description: The json schema for each row in the data source.
- include_sample_schema:
- type: boolean
- description: Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)
- description: |-
- 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
- title: CustomDataSourceConfig
- x-oaiMeta:
- name: The eval file data source config object
- group: evals
- example: |
- {
- "type": "custom",
- "item_schema": {
- "type": "object",
- "properties": {
- "name": {"type": "string"},
- "age": {"type": "integer"}
- },
- "required": ["name", "age"]
- },
- "include_sample_schema": true
- }
- OpenAI.CreateEvalJsonlRunDataSource:
- type: object
- required:
- - type
- - source
- properties:
- type:
+ default: additional_tools
+ role:
type: string
enum:
- - jsonl
- description: The type of data source. Always `jsonl`.
+ - developer
+ description: The role that provided the additional tools. Only `developer` is supported.
x-stainless-const: true
- default: jsonl
- source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
- description: Determines what populates the `item` namespace in the data source.
- description: A JsonlRunDataSource object with that specifies a JSONL file that matches the eval
- title: JsonlRunDataSource
- x-oaiMeta:
- name: The file data source object for the eval run configuration
- group: evals
- example: |
- {
- "type": "jsonl",
- "source": {
- "type": "file_id",
- "id": "file-9GYS6xbkWgWhmE7VoLUWFg"
- }
- }
- OpenAI.CreateEvalLogsDataSourceConfig:
+ default: developer
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: A list of additional tools made available at this item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ OpenAI.ItemApplyPatchToolCallItemParam:
type: object
required:
- type
+ - call_id
+ - status
+ - operation
properties:
type:
type: string
enum:
- - logs
- description: The type of data source. Always `logs`.
+ - apply_patch_call
+ description: The type of the item. Always `apply_patch_call`.
x-stainless-const: true
- default: logs
- metadata:
- type: object
- unevaluatedProperties: {}
- description: Metadata filters for the logs data source.
- description: |-
- 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.
- title: LogsDataSourceConfig
- x-oaiMeta:
- name: The logs data source object for evals
- group: evals
- example: |
- {
- "type": "logs",
- "metadata": {
- "use_case": "customer_support_agent"
- }
- }
- OpenAI.CreateEvalResponsesRunDataSource:
+ default: apply_patch_call
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatusParam'
+ description: The status of the apply patch tool call. One of `in_progress` or `completed`.
+ operation:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
+ description: The specific create, delete, or update instruction for the apply_patch tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A tool call representing a request to create, delete, or update files using diff patches.
+ title: Apply patch tool call
+ OpenAI.ItemApplyPatchToolCallOutputItemParam:
type: object
required:
- type
- - source
+ - call_id
+ - status
properties:
type:
type: string
enum:
- - responses
- description: The type of run data source. Always `responses`.
- default: responses
- input_messages:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate'
- - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference'
- description: 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.
- sampling_params:
- $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams'
- model:
+ - apply_patch_call_output
+ description: The type of the item. Always `apply_patch_call_output`.
+ x-stainless-const: true
+ default: apply_patch_call_output
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
type: string
- description: The name of the model to use for generating completions (e.g. "o3-mini").
- source:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource'
- - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource'
- - $ref: '#/components/schemas/OpenAI.EvalResponsesSource'
- description: Determines what populates the `item` namespace in this run's data source.
- description: A ResponsesRunDataSource object describing a model sampling configuration.
- title: ResponsesRunDataSource
- x-oaiMeta:
- name: The completions data source object used to configure an individual run
- group: eval runs
- example: |
- {
- "name": "gpt-4o-mini-2024-07-18",
- "data_source": {
- "type": "responses",
- "input_messages": {
- "type": "item_reference",
- "item_reference": "item.input"
- },
- "model": "gpt-4o-mini-2024-07-18",
- "source": {
- "type": "responses",
- "model": "gpt-4o-mini-2024-07-18"
- }
- }
- }
- OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference:
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam'
+ description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The streamed output emitted by an apply patch tool call.
+ title: Apply patch tool call output
+ OpenAI.ItemCodeInterpreterToolCall:
type: object
required:
- type
- - item_reference
+ - id
+ - status
+ - container_id
+ - code
+ - outputs
properties:
type:
type: string
enum:
- - item_reference
- item_reference:
+ - code_interpreter_call
+ description: The type of the code interpreter tool call. Always `code_interpreter_call`.
+ x-stainless-const: true
+ default: code_interpreter_call
+ id:
type: string
- OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate:
- type: object
- required:
- - type
- - template
- properties:
- type:
+ description: The unique ID of the code interpreter tool call.
+ status:
type: string
enum:
- - template
- template:
- type: array
- items:
- anyOf:
- - type: object
- properties:
- role:
- type: string
- content:
- type: string
- required:
- - role
- - content
- - $ref: '#/components/schemas/OpenAI.EvalItem'
- OpenAI.CreateEvalResponsesRunDataSourceSamplingParams:
- type: object
- properties:
- reasoning_effort:
+ - in_progress
+ - completed
+ - incomplete
+ - interpreting
+ - failed
+ description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
+ container_id:
+ type: string
+ description: The ID of the container used to run the code.
+ code:
anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: string
+ - type: 'null'
+ outputs:
+ anyOf:
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- type: 'null'
- temperature:
- $ref: '#/components/schemas/OpenAI.numeric'
- default: 1
- max_completion_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- top_p:
- $ref: '#/components/schemas/OpenAI.numeric'
- default: 1
- seed:
- $ref: '#/components/schemas/OpenAI.integer'
- default: 42
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- text:
- $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText'
- OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText:
- type: object
- properties:
- format:
- $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- OpenAI.CreateEvalStoredCompletionsDataSourceConfig:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A tool call to run code.
+ title: Code interpreter tool call
+ OpenAI.ItemCompactionSummaryItemParam:
type: object
required:
- type
+ - encrypted_content
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- - stored_completions
- description: The type of data source. Always `stored_completions`.
+ - compaction
+ description: The type of the item. Always `compaction`.
x-stainless-const: true
- default: stored_completions
- metadata:
- type: object
- unevaluatedProperties: {}
- description: Metadata filters for the stored completions data source.
- description: Deprecated in favor of LogsDataSourceConfig.
- title: StoredCompletionsDataSourceConfig
- deprecated: true
- x-oaiMeta:
- name: The stored completions data source object for evals
- group: evals
- example: |
- {
- "type": "stored_completions",
- "metadata": {
- "use_case": "customer_support_agent"
- }
- }
- OpenAI.CreateFineTuningJobRequest:
+ default: compaction
+ encrypted_content:
+ type: string
+ maxLength: 10485760
+ description: The encrypted content of the compaction summary.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
+ title: Compaction item
+ OpenAI.ItemComputerCallOutputItemParam:
type: object
required:
- - model
- - training_file
+ - call_id
+ - type
+ - output
properties:
- model:
- anyOf:
- - type: string
- - type: string
- enum:
- - babbage-002
- - davinci-002
- - gpt-3.5-turbo
- - gpt-4o-mini
- description: |-
- The name of the model to fine-tune. You can select one of the
- [supported models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned).
- x-oaiTypeLabel: string
- training_file:
- type: string
- description: |-
- The ID of an uploaded file that contains training data.
- See [upload file](/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](/docs/api-reference/fine-tuning/chat-input), [completions](/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](/docs/api-reference/fine-tuning/preference-input) format.
- See the [fine-tuning guide](/docs/guides/model-optimization) for more details.
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters'
- description: |-
- 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: true
- suffix:
+ id:
anyOf:
- type: string
- type: 'null'
+ call_id:
+ type: string
minLength: 1
maxLength: 64
- description: |-
- 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`.
- validation_file:
- anyOf:
- - type: string
- - type: 'null'
- description: |-
- 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](/docs/guides/model-optimization) for more details.
- integrations:
+ description: The ID of the computer tool call that produced the output.
+ type:
+ type: string
+ enum:
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
+ x-stainless-const: true
+ default: computer_call_output
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ acknowledged_safety_checks:
anyOf:
- type: array
items:
- $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations'
- - type: 'null'
- description: A list of integrations to enable for your fine-tuning job.
- seed:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- type: 'null'
- minimum: 0
- maximum: 2147483647
- description: |-
- 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.
- method:
- $ref: '#/components/schemas/OpenAI.FineTuneMethod'
- metadata:
+ status:
anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- type: 'null'
- OpenAI.CreateFineTuningJobRequestHyperparameters:
- type: object
- properties:
- batch_size:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- default: auto
- learning_rate_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- default: auto
- n_epochs:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- default: auto
- OpenAI.CreateFineTuningJobRequestIntegrations:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.ItemComputerToolCall:
type: object
required:
- type
- - wandb
+ - id
+ - call_id
+ - pending_safety_checks
+ - status
properties:
type:
type: string
enum:
- - wandb
- x-stainless-const: true
- wandb:
- $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb'
- OpenAI.CreateFineTuningJobRequestIntegrationsWandb:
- type: object
- required:
- - project
- properties:
- project:
+ - computer_call
+ description: The type of the computer call. Always `computer_call`.
+ default: computer_call
+ id:
type: string
- name:
- anyOf:
- - type: string
- - type: 'null'
- entity:
- anyOf:
- - type: string
- - type: 'null'
- tags:
+ description: The unique ID of the computer call.
+ call_id:
+ type: string
+ description: An identifier used when responding to the tool call with output.
+ action:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ actions:
+ $ref: '#/components/schemas/OpenAI.ComputerActionList'
+ pending_safety_checks:
type: array
items:
- type: string
- OpenAI.CreateResponseStreamingResponse:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCreatedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseErrorEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFailedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseIncompleteEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseTextDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseQueuedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseAudioDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseContentPartDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseOutputItemDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseRefusalDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseTextDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent'
- - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent'
- OpenAI.CustomGrammarFormatParam:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: The pending safety checks for the computer call.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: |-
+ A tool call to a computer use tool. See the
+ [computer use guide](/docs/guides/tools-computer-use) for more information.
+ title: Computer tool call
+ OpenAI.ItemCustomToolCall:
type: object
required:
- type
- - syntax
- - definition
+ - call_id
+ - name
+ - input
properties:
type:
type: string
enum:
- - grammar
- description: Grammar format. Always `grammar`.
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
x-stainless-const: true
- syntax:
- $ref: '#/components/schemas/OpenAI.GrammarSyntax1'
- description: The syntax of the grammar definition. One of `lark` or `regex`.
- definition:
+ id:
type: string
- description: The grammar definition.
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
+ type: string
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
+ type: string
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
- description: A grammar defined by the user.
- title: Grammar format
- OpenAI.CustomTextFormatParam:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A call to a custom tool created by the model.
+ title: Custom tool call
+ OpenAI.ItemCustomToolCallOutput:
type: object
required:
- type
+ - call_id
+ - output
properties:
type:
type: string
enum:
- - text
- description: Unconstrained text format. Always `text`.
+ - custom_tool_call_output
+ description: The type of the custom tool call output. Always `custom_tool_call_output`.
x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the custom tool call output in the OpenAI platform.
+ call_id:
+ type: string
+ description: The call ID, used to map this custom tool call output to a custom tool call.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the custom tool call generated by your code.
+ Can be a string or an list of output content.
allOf:
- - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
- description: Unconstrained free-form text.
- title: Text format
- OpenAI.CustomToolParam:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The output of a custom tool call from your code, being sent back to the model.
+ title: Custom tool call output
+ OpenAI.ItemField:
type: object
required:
- type
- - name
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.ItemFieldType'
+ discriminator:
+ propertyName: type
+ mapping:
+ message: '#/components/schemas/OpenAI.ItemFieldMessage'
+ function_call: '#/components/schemas/OpenAI.ItemFieldFunctionToolCall'
+ tool_search_call: '#/components/schemas/OpenAI.ItemFieldToolSearchCall'
+ tool_search_output: '#/components/schemas/OpenAI.ItemFieldToolSearchOutput'
+ additional_tools: '#/components/schemas/OpenAI.ItemFieldAdditionalTools'
+ function_call_output: '#/components/schemas/OpenAI.ItemFieldFunctionToolCallOutput'
+ file_search_call: '#/components/schemas/OpenAI.ItemFieldFileSearchToolCall'
+ web_search_call: '#/components/schemas/OpenAI.ItemFieldWebSearchToolCall'
+ image_generation_call: '#/components/schemas/OpenAI.ItemFieldImageGenToolCall'
+ computer_call: '#/components/schemas/OpenAI.ItemFieldComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.ItemFieldComputerToolCallOutput'
+ reasoning: '#/components/schemas/OpenAI.ItemFieldReasoningItem'
+ compaction: '#/components/schemas/OpenAI.ItemFieldCompactionBody'
+ code_interpreter_call: '#/components/schemas/OpenAI.ItemFieldCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.ItemFieldLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.ItemFieldLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.ItemFieldFunctionShellCall'
+ shell_call_output: '#/components/schemas/OpenAI.ItemFieldFunctionShellCallOutput'
+ apply_patch_call: '#/components/schemas/OpenAI.ItemFieldApplyPatchToolCall'
+ apply_patch_call_output: '#/components/schemas/OpenAI.ItemFieldApplyPatchToolCallOutput'
+ mcp_list_tools: '#/components/schemas/OpenAI.ItemFieldMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.ItemFieldMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.ItemFieldMcpApprovalResponseResource'
+ mcp_call: '#/components/schemas/OpenAI.ItemFieldMcpToolCall'
+ custom_tool_call: '#/components/schemas/OpenAI.ItemFieldCustomToolCall'
+ custom_tool_call_output: '#/components/schemas/OpenAI.ItemFieldCustomToolCallOutput'
+ description: An item representing a message, tool call, tool output, reasoning, or other response element.
+ OpenAI.ItemFieldAdditionalTools:
+ type: object
+ required:
+ - type
+ - id
+ - role
+ - tools
properties:
type:
type: string
enum:
- - custom
- description: The type of the custom tool. Always `custom`.
+ - additional_tools
+ description: The type of the item. Always `additional_tools`.
x-stainless-const: true
- name:
- type: string
- description: The name of the custom tool, used to identify it in tool calls.
- description:
+ default: additional_tools
+ id:
type: string
- description: Optional description of the custom tool, used to provide more context.
- format:
- $ref: '#/components/schemas/OpenAI.CustomToolParamFormat'
- description: The input format for the custom tool. Default is unconstrained text.
- defer_loading:
- type: boolean
- description: Whether this tool should be deferred and discovered via tool search.
+ description: The unique ID of the additional tools item.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role that provided the additional tools.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The additional tool definitions made available at this item.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools)
- title: Custom tool
- OpenAI.CustomToolParamFormat:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ OpenAI.ItemFieldApplyPatchToolCall:
type: object
required:
- type
+ - id
+ - call_id
+ - status
+ - operation
properties:
type:
- $ref: '#/components/schemas/OpenAI.CustomToolParamFormatType'
- discriminator:
- propertyName: type
- mapping:
- text: '#/components/schemas/OpenAI.CustomTextFormatParam'
- grammar: '#/components/schemas/OpenAI.CustomGrammarFormatParam'
- description: The input format for the custom tool. Default is unconstrained text.
- OpenAI.CustomToolParamFormatType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - text
- - grammar
- OpenAI.DeletedConversationResource:
+ - apply_patch_call
+ description: The type of the item. Always `apply_patch_call`.
+ x-stainless-const: true
+ default: apply_patch_call
+ id:
+ type: string
+ description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
+ description: The status of the apply patch tool call. One of `in_progress` or `completed`.
+ operation:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
+ title: Apply patch operation
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A tool call that applies file diffs by creating, deleting, or updating files.
+ title: Apply patch tool call
+ OpenAI.ItemFieldApplyPatchToolCallOutput:
type: object
required:
- - object
- - deleted
+ - type
- id
+ - call_id
+ - status
properties:
- object:
+ type:
type: string
enum:
- - conversation.deleted
+ - apply_patch_call_output
+ description: The type of the item. Always `apply_patch_call_output`.
x-stainless-const: true
- default: conversation.deleted
- deleted:
- type: boolean
+ default: apply_patch_call_output
id:
type: string
- OpenAI.DetailEnum:
- type: string
- enum:
- - low
- - high
- - auto
- - original
- OpenAI.DoubleClickAction:
+ description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
+ description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call output.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output emitted by an apply patch tool call.
+ title: Apply patch tool call output
+ OpenAI.ItemFieldCodeInterpreterToolCall:
type: object
required:
- type
- - x
- - 'y'
- - keys
+ - id
+ - status
+ - container_id
+ - code
+ - outputs
properties:
type:
type: string
enum:
- - double_click
- description: Specifies the event type. For a double click action, this property is always set to `double_click`.
+ - code_interpreter_call
+ description: The type of the code interpreter tool call. Always `code_interpreter_call`.
x-stainless-const: true
- x:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate where the double click occurred.
- 'y':
- $ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate where the double click occurred.
- keys:
+ default: code_interpreter_call
+ id:
+ type: string
+ description: The unique ID of the code interpreter tool call.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - interpreting
+ - failed
+ description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
+ container_id:
+ type: string
+ description: The ID of the container used to run the code.
+ code:
+ anyOf:
+ - type: string
+ - type: 'null'
+ outputs:
anyOf:
- type: array
items:
- type: string
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A double click action.
- title: DoubleClick
- OpenAI.DragParam:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A tool call to run code.
+ title: Code interpreter tool call
+ OpenAI.ItemFieldCompactionBody:
type: object
required:
- type
- - path
+ - id
+ - encrypted_content
properties:
type:
type: string
enum:
- - drag
- description: Specifies the event type. For a drag action, this property is always set to `drag`.
+ - compaction
+ description: The type of the item. Always `compaction`.
x-stainless-const: true
- path:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.CoordParam'
- description: |-
- 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 }
- ]
- ```
- keys:
- anyOf:
- - type: array
- items:
- type: string
- - type: 'null'
+ default: compaction
+ id:
+ type: string
+ description: The unique ID of the compaction item.
+ encrypted_content:
+ type: string
+ description: The encrypted content that was produced by compaction.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A drag action.
- title: Drag
- OpenAI.EasyInputMessage:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
+ title: Compaction item
+ OpenAI.ItemFieldComputerToolCall:
type: object
required:
- - role
- - content
- type
+ - id
+ - call_id
+ - pending_safety_checks
+ - status
properties:
- role:
- type: string
- enum:
- - user
- - assistant
- - system
- - developer
- description: |-
- The role of the message input. One of `user`, `assistant`, `system`, or
- `developer`.
- content:
- oneOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.InputMessageContentList'
- description: |-
- Text, image, or audio input to the model, used to generate a response.
- Can also contain previous assistant responses.
- phase:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
- - type: 'null'
type:
type: string
enum:
- - message
- description: The type of the message input. Always `message`.
- x-stainless-const: true
+ - computer_call
+ description: The type of the computer call. Always `computer_call`.
+ default: computer_call
+ id:
+ type: string
+ description: The unique ID of the computer call.
+ call_id:
+ type: string
+ description: An identifier used when responding to the tool call with output.
+ action:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ actions:
+ $ref: '#/components/schemas/OpenAI.ComputerActionList'
+ pending_safety_checks:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: The pending safety checks for the computer call.
status:
type: string
enum:
@@ -24286,5119 +60838,4836 @@ components:
- completed
- incomplete
description: |-
- The status of item. One of `in_progress`, `completed`, or
+ The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.ItemField'
description: |-
- 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.
- title: Input message
- OpenAI.EmptyModelParam:
- type: object
- OpenAI.Error:
+ A tool call to a computer use tool. See the
+ [computer use guide](/docs/guides/tools-computer-use) for more information.
+ title: Computer tool call
+ OpenAI.ItemFieldComputerToolCallOutput:
type: object
required:
- - code
- - message
+ - type
+ - id
+ - call_id
+ - output
properties:
- code:
- anyOf:
- - type: string
- - type: 'null'
- message:
- type: string
- param:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
- details:
+ enum:
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
+ x-stainless-const: true
+ default: computer_call_output
+ id:
+ type: string
+ description: The ID of the computer tool call output.
+ readOnly: true
+ call_id:
+ type: string
+ description: The ID of the computer tool call that produced the output.
+ acknowledged_safety_checks:
type: array
items:
- $ref: '#/components/schemas/OpenAI.Error'
- additionalInfo:
- type: object
- unevaluatedProperties: {}
- debugInfo:
- type: object
- unevaluatedProperties: {}
- OpenAI.EvalApiError:
- type: object
- required:
- - code
- - message
- properties:
- code:
- type: string
- description: The error code.
- message:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: |-
+ The safety checks reported by the API that have been acknowledged by the
+ developer.
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ status:
type: string
- description: The error message.
- description: An object representing an error response from the Eval API.
- title: EvalApiError
- x-oaiMeta:
- name: The API error object
- group: evals
- example: |
- {
- "code": "internal_error",
- "message": "The eval run failed due to an internal error."
- }
- OpenAI.EvalGraderLabelModel:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.ItemFieldCustomToolCall:
type: object
required:
- type
+ - call_id
- name
- - model
- input
- - labels
- - passing_labels
properties:
type:
type: string
enum:
- - label_model
- description: The object type, which is always `label_model`.
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
x-stainless-const: true
- name:
+ id:
type: string
- description: The name of the grader.
- model:
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
type: string
- description: The model to use for the evaluation. Must support structured outputs.
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
+ type: string
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
input:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalItem'
- labels:
- type: array
- items:
- type: string
- description: The labels to assign to each item in the evaluation.
- passing_labels:
- type: array
- items:
- type: string
- description: The labels that indicate a passing result. Must be a subset of labels.
- title: LabelModelGrader
- OpenAI.EvalGraderPython:
+ type: string
+ description: The input for the custom tool call generated by the model.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A call to a custom tool created by the model.
+ title: Custom tool call
+ OpenAI.ItemFieldCustomToolCallOutput:
type: object
required:
- type
- - name
- - source
+ - call_id
+ - output
properties:
type:
type: string
enum:
- - python
- description: The object type, which is always `python`.
+ - custom_tool_call_output
+ description: The type of the custom tool call output. Always `custom_tool_call_output`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- source:
+ id:
type: string
- description: The source code of the python script.
- image_tag:
+ description: The unique ID of the custom tool call output in the OpenAI platform.
+ call_id:
type: string
- description: The image tag to use for the python script.
- pass_threshold:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The threshold for the score.
- title: PythonGrader
- OpenAI.EvalGraderScoreModel:
+ description: The call ID, used to map this custom tool call output to a custom tool call.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the custom tool call generated by your code.
+ Can be a string or an list of output content.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a custom tool call from your code, being sent back to the model.
+ title: Custom tool call output
+ OpenAI.ItemFieldFileSearchToolCall:
type: object
required:
+ - id
- type
- - name
- - model
- - input
+ - status
+ - queries
properties:
+ id:
+ type: string
+ description: The unique ID of the file search tool call.
type:
type: string
enum:
- - score_model
- description: The object type, which is always `score_model`.
+ - file_search_call
+ description: The type of the file search tool call. Always `file_search_call`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- model:
+ status:
type: string
- description: The model to use for the evaluation.
- sampling_params:
- $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams'
- description: The sampling parameters for the model.
- input:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalItem'
- description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
- range:
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - incomplete
+ - failed
+ description: |-
+ The status of the file search tool call. One of `in_progress`,
+ `searching`, `incomplete` or `failed`,
+ queries:
type: array
items:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The range of the score. Defaults to `[0, 1]`.
- pass_threshold:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The threshold for the score.
- title: ScoreModelGrader
- OpenAI.EvalGraderScoreModelSamplingParams:
- type: object
- properties:
- seed:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- max_completions_tokens:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- reasoning_effort:
+ type: string
+ description: The queries used to search for files.
+ results:
anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
- type: 'null'
- OpenAI.EvalGraderStringCheck:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: |-
+ The results of a file search tool call. See the
+ [file search guide](/docs/guides/tools-file-search) for more information.
+ title: File search tool call
+ OpenAI.ItemFieldFunctionShellCall:
type: object
required:
- type
- - name
- - input
- - reference
- - operation
+ - id
+ - call_id
+ - action
+ - status
+ - environment
properties:
type:
type: string
enum:
- - string_check
- description: The object type, which is always `string_check`.
+ - shell_call
+ description: The type of the item. Always `shell_call`.
x-stainless-const: true
- name:
+ default: shell_call
+ id:
type: string
- description: The name of the grader.
- input:
+ description: The unique ID of the shell tool call. Populated when this item is returned via API.
+ call_id:
type: string
- description: The input text. This may include template strings.
- reference:
+ description: The unique ID of the shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.FunctionShellAction'
+ description: The shell commands and limits that describe how to run the tool call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
+ description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
+ environment:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ - type: 'null'
+ created_by:
type: string
- description: The reference text. This may include template strings.
- operation:
+ description: The ID of the entity that created this tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A tool call that executes one or more shell commands in a managed environment.
+ title: Shell tool call
+ OpenAI.ItemFieldFunctionShellCallOutput:
+ type: object
+ required:
+ - type
+ - id
+ - call_id
+ - status
+ - output
+ - max_output_length
+ properties:
+ type:
type: string
enum:
- - eq
- - ne
- - like
- - ilike
- description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
- title: StringCheckGrader
- OpenAI.EvalGraderTextSimilarity:
+ - shell_call_output
+ description: The type of the shell call output. Always `shell_call_output`.
+ x-stainless-const: true
+ default: shell_call_output
+ id:
+ type: string
+ description: The unique ID of the shell call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the shell tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
+ description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
+ description: An array of shell call output contents
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a shell tool call that was emitted.
+ title: Shell call output
+ OpenAI.ItemFieldFunctionToolCall:
type: object
required:
+ - id
- type
+ - call_id
- name
- - input
- - reference
- - evaluation_metric
- - pass_threshold
+ - arguments
properties:
+ id:
+ type: string
+ description: The unique ID of the function tool call.
+ readOnly: true
type:
type: string
enum:
- - text_similarity
- description: The type of grader.
+ - function_call
+ description: The type of the function tool call. Always `function_call`.
x-stainless-const: true
- default: text_similarity
+ call_id:
+ type: string
+ description: The unique ID of the function tool call generated by the model.
+ namespace:
+ type: string
+ description: The namespace of the function to run.
name:
type: string
- description: The name of the grader.
- input:
- type: string
- description: The text being graded.
- reference:
+ description: The name of the function to run.
+ arguments:
type: string
- description: The text being graded against.
- evaluation_metric:
+ description: A JSON string of the arguments to pass to the function.
+ status:
type: string
enum:
- - cosine
- - fuzzy_match
- - bleu
- - gleu
- - meteor
- - rouge_1
- - rouge_2
- - rouge_3
- - rouge_4
- - rouge_5
- - rouge_l
+ - in_progress
+ - completed
+ - incomplete
description: |-
- 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`.
- pass_threshold:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The threshold for the score.
- title: TextSimilarityGrader
- OpenAI.EvalItem:
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: |-
+ A tool call to run a function. See the
+ [function calling guide](/docs/guides/function-calling) for more information.
+ title: Function tool call
+ OpenAI.ItemFieldFunctionToolCallOutput:
type: object
required:
- - role
- - content
+ - id
+ - type
+ - call_id
+ - output
properties:
- role:
+ id:
type: string
- enum:
- - user
- - assistant
- - system
- - developer
description: |-
- The role of the message input. One of `user`, `assistant`, `system`, or
- `developer`.
- content:
- $ref: '#/components/schemas/OpenAI.EvalItemContent'
+ The unique ID of the function tool call output. Populated when this item
+ is returned via API.
+ readOnly: true
type:
type: string
enum:
- - message
- description: The type of the message input. Always `message`.
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
x-stainless-const: true
- description: |-
- 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.
- title: Eval message object
- OpenAI.EvalItemContent:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItem'
- - $ref: '#/components/schemas/OpenAI.EvalItemContentArray'
- description: Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
- title: Eval content
- OpenAI.EvalItemContentArray:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalItemContentItem'
- description: |-
- A list of inputs, each of which may be either an input text, output text, input
- image, or input audio object.
- title: An array of Input text, Output text, Input image, and Input audio
- OpenAI.EvalItemContentItem:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentText'
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: 'A single content item: input text, output text, input image, or input audio.'
- title: Eval content item
- OpenAI.EvalItemContentItemObject:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.EvalItemContentItemObjectType'
- discriminator:
- propertyName: type
- mapping:
- output_text: '#/components/schemas/OpenAI.EvalItemContentOutputText'
- input_image: '#/components/schemas/OpenAI.EvalItemInputImage'
- input_audio: '#/components/schemas/OpenAI.InputAudio'
- input_text: '#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent'
- description: 'A single content item: input text, output text, input image, or input audio.'
- title: Eval content item
- OpenAI.EvalItemContentItemObjectInputTextContent:
+ call_id:
+ type: string
+ description: The unique ID of the function tool call generated by the model.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the function call generated by your code.
+ Can be a string or an list of output content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.ItemFieldImageGenToolCall:
type: object
required:
- type
- - text
+ - id
+ - status
+ - result
properties:
type:
type: string
enum:
- - input_text
- description: The type of the input item. Always `input_text`.
+ - image_generation_call
+ description: The type of the image generation call. Always `image_generation_call`.
x-stainless-const: true
- default: input_text
- text:
+ id:
+ type: string
+ description: The unique ID of the image generation call.
+ status:
type: string
- description: The text input to the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: A text input to the model.
- title: Input text
- OpenAI.EvalItemContentItemObjectType:
- anyOf:
- - type: string
- - type: string
enum:
- - input_text
- - output_text
- - input_image
- - input_audio
- OpenAI.EvalItemContentOutputText:
+ - in_progress
+ - completed
+ - generating
+ - failed
+ description: The status of the image generation call.
+ result:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: An image generation request made by the model.
+ title: Image generation call
+ OpenAI.ItemFieldLocalShellToolCall:
type: object
required:
- type
- - text
+ - id
+ - call_id
+ - action
+ - status
properties:
type:
type: string
enum:
- - output_text
- description: The type of the output text. Always `output_text`.
+ - local_shell_call
+ description: The type of the local shell call. Always `local_shell_call`.
x-stainless-const: true
- text:
+ id:
type: string
- description: The text output from the model.
+ description: The unique ID of the local shell call.
+ call_id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: The status of the local shell call.
allOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: A text output from the model.
- title: Output text
- OpenAI.EvalItemContentText:
- type: string
- description: A text input to the model.
- title: Text input
- OpenAI.EvalItemInputImage:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A tool call to run a command on the local shell.
+ title: Local shell call
+ OpenAI.ItemFieldLocalShellToolCallOutput:
type: object
required:
- type
- - image_url
+ - id
+ - output
properties:
type:
type: string
enum:
- - input_image
- description: The type of the image input. Always `input_image`.
+ - local_shell_call_output
+ description: The type of the local shell tool call output. Always `local_shell_call_output`.
x-stainless-const: true
- image_url:
+ id:
type: string
- format: uri
- description: The URL of the image input.
- detail:
+ description: The unique ID of the local shell tool call generated by the model.
+ output:
type: string
- description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
+ description: A JSON string of the output of the local shell tool call.
+ status:
+ anyOf:
+ - type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: An image input block used within EvalItem content arrays.
- title: Input image
- OpenAI.EvalJsonlFileContentSource:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: The output of a local shell tool call.
+ title: Local shell call output
+ OpenAI.ItemFieldMcpApprovalRequest:
type: object
required:
- type
- - content
+ - id
+ - server_label
+ - name
+ - arguments
properties:
type:
type: string
enum:
- - file_content
- description: The type of jsonl source. Always `file_content`.
+ - mcp_approval_request
+ description: The type of the item. Always `mcp_approval_request`.
x-stainless-const: true
- default: file_content
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent'
- description: The content of the jsonl file.
- title: EvalJsonlFileContentSource
- OpenAI.EvalJsonlFileContentSourceContent:
- type: object
- required:
- - item
- properties:
- item:
- type: object
- unevaluatedProperties: {}
- sample:
- type: object
- unevaluatedProperties: {}
- OpenAI.EvalJsonlFileIdSource:
+ id:
+ type: string
+ description: The unique ID of the approval request.
+ server_label:
+ type: string
+ description: The label of the MCP server making the request.
+ name:
+ type: string
+ description: The name of the tool to run.
+ arguments:
+ type: string
+ description: A JSON string of arguments for the tool.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A request for human approval of a tool invocation.
+ title: MCP approval request
+ OpenAI.ItemFieldMcpApprovalResponseResource:
type: object
required:
- type
- id
+ - approval_request_id
+ - approve
properties:
type:
type: string
enum:
- - file_id
- description: The type of jsonl source. Always `file_id`.
+ - mcp_approval_response
+ description: The type of the item. Always `mcp_approval_response`.
x-stainless-const: true
- default: file_id
id:
type: string
- description: The identifier of the file.
- title: EvalJsonlFileIdSource
- OpenAI.EvalResponsesSource:
+ description: The unique ID of the approval response
+ approval_request_id:
+ type: string
+ description: The ID of the approval request being answered.
+ approve:
+ type: boolean
+ description: Whether the request was approved.
+ reason:
+ anyOf:
+ - type: string
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A response to an MCP approval request.
+ title: MCP approval response
+ OpenAI.ItemFieldMcpListTools:
type: object
required:
- type
+ - id
+ - server_label
+ - tools
properties:
type:
type: string
enum:
- - responses
- description: The type of run data source. Always `responses`.
- metadata:
- anyOf:
- - type: object
- unevaluatedProperties: {}
- - type: 'null'
- model:
- anyOf:
- - type: string
- - type: 'null'
- instructions_search:
- anyOf:
- - type: string
- - type: 'null'
- created_after:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- created_before:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- reasoning_effort:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
- - type: 'null'
- description: Optional reasoning effort parameter. This is a query parameter used to select responses.
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- users:
- anyOf:
- - type: array
- items:
- type: string
- - type: 'null'
+ - mcp_list_tools
+ description: The type of the item. Always `mcp_list_tools`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the list.
+ server_label:
+ type: string
+ description: The label of the MCP server.
tools:
- anyOf:
- - type: array
- items:
- type: string
- - type: 'null'
- description: A EvalResponsesSource object describing a run data source configuration.
- title: EvalResponsesSource
- x-oaiMeta:
- name: The run data source object used to configure an individual run
- group: eval runs
- example: |
- {
- "type": "responses",
- "model": "gpt-4o-mini-2024-07-18",
- "temperature": 0.7,
- "top_p": 1.0,
- "users": ["user1", "user2"],
- "tools": ["tool1", "tool2"],
- "instructions_search": "You are a coding assistant"
- }
- OpenAI.EvalRunOutputItemSample:
- type: object
- required:
- - input
- - output
- - finish_reason
- - model
- - usage
- - error
- - temperature
- - max_completion_tokens
- - top_p
- - seed
- properties:
- input:
- type: array
- items:
- $ref: '#/components/schemas/EvalRunOutputItemSampleInput'
- output:
type: array
items:
- $ref: '#/components/schemas/EvalRunOutputItemSampleOutput'
- finish_reason:
- type: string
- model:
- type: string
- usage:
- $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage'
+ $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
+ description: The tools available on the server.
error:
- $ref: '#/components/schemas/OpenAI.EvalApiError'
- temperature:
- $ref: '#/components/schemas/OpenAI.numeric'
- max_completion_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- top_p:
- $ref: '#/components/schemas/OpenAI.numeric'
- seed:
- $ref: '#/components/schemas/OpenAI.integer'
- OpenAI.EvalRunOutputItemSampleUsage:
- type: object
- required:
- - total_tokens
- - completion_tokens
- - prompt_tokens
- - cached_tokens
- properties:
- total_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- completion_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- prompt_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- cached_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- OpenAI.EvalRunPerModelUsage:
- type: object
- required:
- - model_name
- - invocation_count
- - prompt_tokens
- - completion_tokens
- - total_tokens
- - cached_tokens
- properties:
- model_name:
- type: string
- invocation_count:
- $ref: '#/components/schemas/OpenAI.integer'
- prompt_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- completion_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- total_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- cached_tokens:
- $ref: '#/components/schemas/OpenAI.integer'
- OpenAI.EvalRunPerTestingCriteriaResults:
- type: object
- required:
- - testing_criteria
- - passed
- - failed
- properties:
- testing_criteria:
- type: string
- passed:
- $ref: '#/components/schemas/OpenAI.integer'
- failed:
- $ref: '#/components/schemas/OpenAI.integer'
- errored:
- $ref: '#/components/schemas/integer'
- description: Number of tests that errored for this criteria.
- skipped:
- $ref: '#/components/schemas/integer'
- description: Number of tests that were skipped for this criteria.
- OpenAI.EvalRunResultCounts:
- type: object
- required:
- - total
- - errored
- - failed
- - passed
- properties:
- total:
- $ref: '#/components/schemas/OpenAI.integer'
- errored:
- $ref: '#/components/schemas/OpenAI.integer'
- failed:
- $ref: '#/components/schemas/OpenAI.integer'
- passed:
- $ref: '#/components/schemas/OpenAI.integer'
- skipped:
- $ref: '#/components/schemas/integer'
- description: Number of output items that were skipped during the evaluation.
- OpenAI.EvalStoredCompletionsSource:
+ $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A list of tools available on an MCP server.
+ title: MCP list tools
+ OpenAI.ItemFieldMcpToolCall:
type: object
required:
- type
+ - id
+ - server_label
+ - name
+ - arguments
properties:
type:
type: string
enum:
- - stored_completions
- description: The type of source. Always `stored_completions`.
+ - mcp_call
+ description: The type of the item. Always `mcp_call`.
x-stainless-const: true
- default: stored_completions
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- model:
+ id:
+ type: string
+ description: The unique ID of the tool call.
+ server_label:
+ type: string
+ description: The label of the MCP server running the tool.
+ name:
+ type: string
+ description: The name of the tool that was run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments passed to the tool.
+ output:
anyOf:
- type: string
- type: 'null'
- created_after:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- created_before:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- limit:
+ error:
+ type: object
+ unevaluatedProperties: {}
+ status:
+ $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
+ description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
+ approval_request_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
- type: 'null'
- description: A StoredCompletionsRunDataSource configuration describing a set of filters
- title: StoredCompletionsRunDataSource
- x-oaiMeta:
- name: The stored completions data source object used to configure an individual run
- group: eval runs
- example: |
- {
- "type": "stored_completions",
- "model": "gpt-4o",
- "created_after": 1668124800,
- "created_before": 1668124900,
- "limit": 100,
- "metadata": {}
- }
- OpenAI.FileCitationBody:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: An invocation of a tool on an MCP server.
+ title: MCP tool call
+ OpenAI.ItemFieldMessage:
type: object
required:
- type
- - file_id
- - index
- - filename
+ - id
+ - status
+ - role
+ - content
properties:
type:
type: string
enum:
- - file_citation
- description: The type of the file citation. Always `file_citation`.
+ - message
+ description: The type of the message. Always set to `message`.
x-stainless-const: true
- file_id:
- type: string
- description: The ID of the file.
- index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the file in the list of files.
- filename:
+ default: message
+ id:
type: string
- description: The filename of the file cited.
+ description: The unique ID of the message.
+ status:
+ $ref: '#/components/schemas/OpenAI.MessageStatus'
+ description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: The content of the message
+ phase:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Annotation'
- description: A citation to a file.
- title: File citation
- OpenAI.FileInputDetail:
- type: string
- enum:
- - low
- - high
- OpenAI.FilePath:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: A message to or from the model.
+ title: Message
+ OpenAI.ItemFieldReasoningItem:
type: object
required:
- type
- - file_id
- - index
+ - id
+ - summary
properties:
type:
type: string
enum:
- - file_path
- description: The type of the file path. Always `file_path`.
+ - reasoning
+ description: The type of the object. Always `reasoning`.
x-stainless-const: true
- file_id:
+ id:
type: string
- description: The ID of the file.
- index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the file in the list of files.
+ description: The unique identifier of the reasoning content.
+ encrypted_content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ summary:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: Reasoning summary content.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
+ description: Reasoning text content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.Annotation'
- description: A path to a file.
- title: File path
- OpenAI.FileSearchTool:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: |-
+ A description of the chain of thought used by a reasoning model while generating
+ a response. Be sure to include these items in your `input` to the Responses API
+ for subsequent turns of a conversation if you are manually
+ [managing context](/docs/guides/conversation-state).
+ title: Reasoning
+ OpenAI.ItemFieldToolSearchCall:
type: object
required:
- type
- - vector_store_ids
+ - id
+ - call_id
+ - execution
+ - arguments
+ - status
properties:
type:
type: string
enum:
- - file_search
- description: The type of the file search tool. Always `file_search`.
+ - tool_search_call
+ description: The type of the item. Always `tool_search_call`.
x-stainless-const: true
- vector_store_ids:
- type: array
- items:
- type: string
- description: The IDs of the vector stores to search.
- max_num_results:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
- ranking_options:
- $ref: '#/components/schemas/OpenAI.RankingOptions'
- description: Ranking options for search.
- filters:
+ default: tool_search_call
+ id:
+ type: string
+ description: The unique ID of the tool search call item.
+ call_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.Filters'
+ - type: string
- type: 'null'
- name:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ arguments:
+ description: Arguments used for the tool search call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: The status of the tool search call item that was recorded.
+ created_by:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: 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).
- title: File search
- OpenAI.FileSearchToolCallResults:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ OpenAI.ItemFieldToolSearchOutput:
type: object
+ required:
+ - type
+ - id
+ - call_id
+ - execution
+ - tools
+ - status
properties:
- file_id:
- type: string
- text:
+ type:
type: string
- filename:
+ enum:
+ - tool_search_output
+ description: The type of the item. Always `tool_search_output`.
+ x-stainless-const: true
+ default: tool_search_output
+ id:
type: string
- attributes:
+ description: The unique ID of the tool search output item.
+ call_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: string
- type: 'null'
- score:
- type: number
- format: float
- OpenAI.Filters:
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The loaded tool definitions returned by tool search.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: The status of the tool search output item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ OpenAI.ItemFieldType:
anyOf:
- - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
- - $ref: '#/components/schemas/OpenAI.CompoundFilter'
- OpenAI.FineTuneDPOHyperparameters:
- type: object
- properties:
- beta:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
- default: auto
- batch_size:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
- default: auto
- learning_rate_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
- default: auto
- n_epochs:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
- default: auto
- description: The hyperparameters used for the DPO fine-tuning job.
- OpenAI.FineTuneDPOMethod:
- type: object
- properties:
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.FineTuneDPOHyperparameters'
- description: Configuration for the DPO fine-tuning method.
- OpenAI.FineTuneMethod:
+ - type: string
+ - type: string
+ enum:
+ - message
+ - function_call
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - function_call_output
+ - file_search_call
+ - web_search_call
+ - image_generation_call
+ - computer_call
+ - computer_call_output
+ - reasoning
+ - compaction
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - mcp_call
+ - custom_tool_call
+ - custom_tool_call_output
+ OpenAI.ItemFieldWebSearchToolCall:
type: object
required:
+ - id
- type
+ - status
+ - action
properties:
+ id:
+ type: string
+ description: The unique ID of the web search tool call.
type:
type: string
enum:
- - supervised
- - dpo
- - reinforcement
- description: The type of method. Is either `supervised`, `dpo`, or `reinforcement`.
- supervised:
- $ref: '#/components/schemas/OpenAI.FineTuneSupervisedMethod'
- dpo:
- $ref: '#/components/schemas/OpenAI.FineTuneDPOMethod'
- reinforcement:
- $ref: '#/components/schemas/OpenAI.FineTuneReinforcementMethod'
- description: The method used for fine-tuning.
- OpenAI.FineTuneReinforcementHyperparameters:
- type: object
- properties:
- batch_size:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
- default: auto
- learning_rate_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
- default: auto
- n_epochs:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
- default: auto
- reasoning_effort:
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
+ x-stainless-const: true
+ status:
type: string
enum:
- - default
- - low
- - medium
- - high
- description: Level of reasoning effort.
- default: default
- compute_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: Multiplier on amount of compute used for exploring search space during training.
- default: auto
- eval_interval:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: The number of training steps between evaluation runs.
- default: auto
- eval_samples:
+ - in_progress
+ - searching
+ - completed
+ - failed
+ - incomplete
+ description: The status of the web search tool call.
+ action:
oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: Number of evaluation samples to generate per training step.
- default: auto
- description: The hyperparameters used for the reinforcement fine-tuning job.
- OpenAI.FineTuneReinforcementMethod:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ description: |-
+ 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_in_page).
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemField'
+ description: |-
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.ItemFileSearchToolCall:
type: object
required:
- - grader
- properties:
- grader:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.GraderPython'
- - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
- - $ref: '#/components/schemas/OpenAI.GraderMulti'
- description: The grader used for the fine-tuning job.
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters'
- description: Configuration for the reinforcement fine-tuning method.
- OpenAI.FineTuneSupervisedHyperparameters:
- type: object
- properties:
- batch_size:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
- default: auto
- learning_rate_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
- default: auto
- n_epochs:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
- default: auto
- description: The hyperparameters used for the fine-tuning job.
- OpenAI.FineTuneSupervisedMethod:
- type: object
+ - id
+ - type
+ - status
+ - queries
properties:
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters'
- description: Configuration for the supervised fine-tuning method.
- OpenAI.FineTuningIntegration:
+ id:
+ type: string
+ description: The unique ID of the file search tool call.
+ type:
+ type: string
+ enum:
+ - file_search_call
+ description: The type of the file search tool call. Always `file_search_call`.
+ x-stainless-const: true
+ status:
+ type: string
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - incomplete
+ - failed
+ description: |-
+ The status of the file search tool call. One of `in_progress`,
+ `searching`, `incomplete` or `failed`,
+ queries:
+ type: array
+ items:
+ type: string
+ description: The queries used to search for files.
+ results:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: |-
+ The results of a file search tool call. See the
+ [file search guide](/docs/guides/tools-file-search) for more information.
+ title: File search tool call
+ OpenAI.ItemFunctionCallOutputItemParam:
type: object
required:
+ - call_id
- type
- - wandb
+ - output
properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
+ type: string
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the function tool call generated by the model.
type:
type: string
enum:
- - wandb
- description: The type of the integration being enabled for the fine-tuning job
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
x-stainless-const: true
- wandb:
- $ref: '#/components/schemas/OpenAI.FineTuningIntegrationWandb'
- description: |-
- 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.
- title: Fine-Tuning Job Integration
- OpenAI.FineTuningIntegrationWandb:
- type: object
- required:
- - project
- properties:
- project:
- type: string
- name:
- anyOf:
+ default: function_call_output
+ output:
+ oneOf:
- type: string
- - type: 'null'
- entity:
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.InputTextContentParam'
+ - $ref: '#/components/schemas/OpenAI.InputImageContentParamAutoParam'
+ - $ref: '#/components/schemas/OpenAI.InputFileContentParam'
+ description: Text, image, or file output of the function tool call.
+ status:
anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- type: 'null'
- tags:
- type: array
- items:
- type: string
- OpenAI.FineTuningJob:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.ItemFunctionShellCallItemParam:
type: object
required:
- - id
- - created_at
- - error
- - fine_tuned_model
- - finished_at
- - hyperparameters
- - model
- - object
- - organization_id
- - result_files
- - status
- - trained_tokens
- - training_file
- - validation_file
- - seed
+ - call_id
+ - type
+ - action
properties:
id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ call_id:
type: string
- description: The object identifier, which can be referenced in the API endpoints.
- created_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) for when the fine-tuning job was created.
- error:
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the shell tool call generated by the model.
+ type:
+ type: string
+ enum:
+ - shell_call
+ description: The type of the item. Always `shell_call`.
+ x-stainless-const: true
+ default: shell_call
+ action:
+ $ref: '#/components/schemas/OpenAI.FunctionShellActionParam'
+ description: The shell commands and limits that describe how to run the tool call.
+ status:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FineTuningJobError'
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- type: 'null'
- fine_tuned_model:
+ environment:
anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
- type: 'null'
- finished_at:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A tool representing a request to execute one or more shell commands.
+ title: Shell tool call
+ OpenAI.ItemFunctionShellCallOutputItemParam:
+ type: object
+ required:
+ - call_id
+ - type
+ - output
+ properties:
+ id:
anyOf:
- type: string
- format: date-time
- type: 'null'
- type: integer
- format: unixTimestamp
- hyperparameters:
- $ref: '#/components/schemas/OpenAI.FineTuningJobHyperparameters'
- description: The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.
- model:
+ call_id:
type: string
- description: The base model that is being fine-tuned.
- object:
+ minLength: 1
+ maxLength: 64
+ description: The unique ID of the shell tool call generated by the model.
+ type:
type: string
enum:
- - fine_tuning.job
- description: The object type, which is always "fine_tuning.job".
+ - shell_call_output
+ description: The type of the item. Always `shell_call_output`.
x-stainless-const: true
- organization_id:
- type: string
- description: The organization that owns the fine-tuning job.
- result_files:
+ default: shell_call_output
+ output:
type: array
items:
- type: string
- description: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents).
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContentParam'
+ description: Captured chunks of stdout and stderr output, along with their associated outcomes.
status:
- type: string
- enum:
- - validating_files
- - queued
- - running
- - succeeded
- - failed
- - cancelled
- description: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.
- trained_tokens:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- training_file:
- type: string
- description: The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents).
- validation_file:
- anyOf:
- - type: string
- - type: 'null'
- integrations:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FineTuningIntegration'
- - type: 'null'
- seed:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The seed used for the fine-tuning job.
- estimated_finish:
anyOf:
- - type: string
- format: date-time
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- type: 'null'
- type: integer
- format: unixTimestamp
- method:
- $ref: '#/components/schemas/OpenAI.FineTuneMethod'
- metadata:
+ max_output_length:
anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- description: The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.
- title: FineTuningJob
- x-oaiMeta:
- name: The fine-tuning job object
- example: |
- {
- "object": "fine_tuning.job",
- "id": "ftjob-abc123",
- "model": "davinci-002",
- "created_at": 1692661014,
- "finished_at": 1692661190,
- "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
- "organization_id": "org-123",
- "result_files": [
- "file-abc123"
- ],
- "status": "succeeded",
- "validation_file": null,
- "training_file": "file-abc123",
- "hyperparameters": {
- "n_epochs": 4,
- "batch_size": 1,
- "learning_rate_multiplier": 1.0
- },
- "trained_tokens": 5768,
- "integrations": [],
- "seed": 0,
- "estimated_finish": 0,
- "method": {
- "type": "supervised",
- "supervised": {
- "hyperparameters": {
- "n_epochs": 4,
- "batch_size": 1,
- "learning_rate_multiplier": 1.0
- }
- }
- },
- "metadata": {
- "key": "value"
- }
- }
- OpenAI.FineTuningJobCheckpoint:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The streamed output items emitted by a shell tool call.
+ title: Shell tool call output
+ OpenAI.ItemFunctionToolCall:
type: object
required:
- id
- - created_at
- - fine_tuned_model_checkpoint
- - step_number
- - metrics
- - fine_tuning_job_id
- - object
+ - type
+ - call_id
+ - name
+ - arguments
properties:
id:
type: string
- description: The checkpoint identifier, which can be referenced in the API endpoints.
- created_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) for when the checkpoint was created.
- fine_tuned_model_checkpoint:
+ description: The unique ID of the function tool call.
+ readOnly: true
+ type:
type: string
- description: The name of the fine-tuned checkpoint model that is created.
- step_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The step number that the checkpoint was created at.
- metrics:
- $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics'
- description: Metrics at the step number during the fine-tuning job.
- fine_tuning_job_id:
+ enum:
+ - function_call
+ description: The type of the function tool call. Always `function_call`.
+ x-stainless-const: true
+ call_id:
type: string
- description: The name of the fine-tuning job that this checkpoint was created from.
- object:
+ description: The unique ID of the function tool call generated by the model.
+ namespace:
+ type: string
+ description: The namespace of the function to run.
+ name:
+ type: string
+ description: The name of the function to run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the function.
+ status:
type: string
enum:
- - fine_tuning.job.checkpoint
- description: The object type, which is always "fine_tuning.job.checkpoint".
- x-stainless-const: true
- description: The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.
- title: FineTuningJobCheckpoint
- x-oaiMeta:
- name: The fine-tuning job checkpoint object
- example: |
- {
- "object": "fine_tuning.job.checkpoint",
- "id": "ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P",
- "created_at": 1712211699,
- "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88",
- "fine_tuning_job_id": "ftjob-fpbNQ3H1GrMehXRf8cO97xTN",
- "metrics": {
- "step": 88,
- "train_loss": 0.478,
- "train_mean_token_accuracy": 0.924,
- "valid_loss": 10.112,
- "valid_mean_token_accuracy": 0.145,
- "full_valid_loss": 0.567,
- "full_valid_mean_token_accuracy": 0.944
- },
- "step_number": 88
- }
- OpenAI.FineTuningJobCheckpointMetrics:
- type: object
- properties:
- step:
- $ref: '#/components/schemas/OpenAI.numeric'
- train_loss:
- $ref: '#/components/schemas/OpenAI.numeric'
- train_mean_token_accuracy:
- $ref: '#/components/schemas/OpenAI.numeric'
- valid_loss:
- $ref: '#/components/schemas/OpenAI.numeric'
- valid_mean_token_accuracy:
- $ref: '#/components/schemas/OpenAI.numeric'
- full_valid_loss:
- $ref: '#/components/schemas/OpenAI.numeric'
- full_valid_mean_token_accuracy:
- $ref: '#/components/schemas/OpenAI.numeric'
- OpenAI.FineTuningJobError:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: |-
+ A tool call to run a function. See the
+ [function calling guide](/docs/guides/function-calling) for more information.
+ title: Function tool call
+ OpenAI.ItemImageGenToolCall:
type: object
required:
- - code
- - message
- - param
+ - type
+ - id
+ - status
+ - result
properties:
- code:
+ type:
type: string
- message:
+ enum:
+ - image_generation_call
+ description: The type of the image generation call. Always `image_generation_call`.
+ x-stainless-const: true
+ id:
type: string
- param:
+ description: The unique ID of the image generation call.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - generating
+ - failed
+ description: The status of the image generation call.
+ result:
anyOf:
- type: string
- type: 'null'
- OpenAI.FineTuningJobEvent:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: An image generation request made by the model.
+ title: Image generation call
+ OpenAI.ItemInputMessage:
type: object
required:
- - object
+ - type
+ - role
+ - content
- id
- - created_at
- - level
- - message
properties:
- object:
+ type:
type: string
enum:
- - fine_tuning.job.event
- description: The object type, which is always "fine_tuning.job.event".
+ - message
+ description: The type of the message input. Always set to `message`.
x-stainless-const: true
- id:
+ default: message
+ role:
type: string
- description: The object identifier.
- created_at:
- type: integer
- format: unixtime
- description: The Unix timestamp (in seconds) for when the fine-tuning job was created.
- level:
+ enum:
+ - user
+ - system
+ - developer
+ description: The role of the message input. One of `user`, `system`, or `developer`.
+ status:
type: string
enum:
- - info
- - warn
- - error
- description: The log level of the event.
- message:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ content:
+ $ref: '#/components/schemas/OpenAI.InputMessageContentList'
+ id:
type: string
- description: The message of the event.
+ description: The unique ID of the message input.
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: |-
+ 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.
+ title: Input message
+ OpenAI.ItemLocalShellToolCall:
+ type: object
+ required:
+ - type
+ - id
+ - call_id
+ - action
+ - status
+ properties:
type:
type: string
enum:
- - message
- - metrics
- description: The type of event.
- data:
- $ref: '#/components/schemas/OpenAI.FineTuningJobEventData'
- description: The data associated with the event.
- description: Fine-tuning job event object
- x-oaiMeta:
- name: The fine-tuning job event object
- example: |
- {
- "object": "fine_tuning.job.event",
- "id": "ftevent-abc123"
- "created_at": 1677610602,
- "level": "info",
- "message": "Created fine-tuning job",
- "data": {},
- "type": "message"
- }
- OpenAI.FineTuningJobEventData:
- type: object
- OpenAI.FineTuningJobHyperparameters:
- type: object
- properties:
- batch_size:
- anyOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- default: auto
- learning_rate_multiplier:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.numeric'
- default: auto
- n_epochs:
- oneOf:
- - type: string
- enum:
- - auto
- - $ref: '#/components/schemas/OpenAI.integer'
- default: auto
- OpenAI.FunctionAndCustomToolCallOutput:
+ - local_shell_call
+ description: The type of the local shell call. Always `local_shell_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the local shell call.
+ call_id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: The status of the local shell call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A tool call to run a command on the local shell.
+ title: Local shell call
+ OpenAI.ItemLocalShellToolCallOutput:
type: object
required:
- type
+ - id
+ - output
properties:
type:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType'
- discriminator:
- propertyName: type
- mapping:
- input_text: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent'
- input_image: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent'
- input_file: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent'
- OpenAI.FunctionAndCustomToolCallOutputInputFileContent:
+ type: string
+ enum:
+ - local_shell_call_output
+ description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ output:
+ type: string
+ description: A JSON string of the output of the local shell tool call.
+ status:
+ anyOf:
+ - type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: The output of a local shell tool call.
+ title: Local shell call output
+ OpenAI.ItemMcpApprovalRequest:
type: object
required:
- type
+ - id
+ - server_label
+ - name
+ - arguments
properties:
type:
type: string
enum:
- - input_file
- description: The type of the input item. Always `input_file`.
+ - mcp_approval_request
+ description: The type of the item. Always `mcp_approval_request`.
x-stainless-const: true
- default: input_file
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- filename:
+ id:
type: string
- description: The name of the file to be sent to the model.
- file_data:
+ description: The unique ID of the approval request.
+ server_label:
type: string
- description: The content of the file to be sent to the model.
- file_url:
+ description: The label of the MCP server making the request.
+ name:
type: string
- format: uri
- description: The URL of the file to be sent to the model.
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
+ description: The name of the tool to run.
+ arguments:
+ type: string
+ description: A JSON string of arguments for the tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: A file input to the model.
- title: Input file
- OpenAI.FunctionAndCustomToolCallOutputInputImageContent:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A request for human approval of a tool invocation.
+ title: MCP approval request
+ OpenAI.ItemMcpApprovalResponse:
type: object
required:
- type
- - detail
+ - approval_request_id
+ - approve
properties:
type:
type: string
enum:
- - input_image
- description: The type of the input item. Always `input_image`.
+ - mcp_approval_response
+ description: The type of the item. Always `mcp_approval_response`.
x-stainless-const: true
- default: input_image
- image_url:
+ id:
anyOf:
- type: string
- format: uri
- type: 'null'
- file_id:
+ approval_request_id:
+ type: string
+ description: The ID of the approval request being answered.
+ approve:
+ type: boolean
+ description: Whether the request was approved.
+ reason:
anyOf:
- type: string
- type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
- title: Input image
- OpenAI.FunctionAndCustomToolCallOutputInputTextContent:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A response to an MCP approval request.
+ title: MCP approval response
+ OpenAI.ItemMcpListTools:
type: object
required:
- type
- - text
+ - id
+ - server_label
+ - tools
properties:
type:
type: string
enum:
- - input_text
- description: The type of the input item. Always `input_text`.
+ - mcp_list_tools
+ description: The type of the item. Always `mcp_list_tools`.
x-stainless-const: true
- default: input_text
- text:
+ id:
type: string
- description: The text input to the model.
+ description: The unique ID of the list.
+ server_label:
+ type: string
+ description: The label of the MCP server.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
+ description: The tools available on the server.
+ error:
+ $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: A text input to the model.
- title: Input text
- OpenAI.FunctionAndCustomToolCallOutputType:
- anyOf:
- - type: string
- - type: string
- enum:
- - input_text
- - input_image
- - input_file
- OpenAI.FunctionCallItemStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionCallOutputStatusEnum:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionCallStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionObject:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: A list of tools available on an MCP server.
+ title: MCP list tools
+ OpenAI.ItemMcpToolCall:
type: object
required:
+ - type
+ - id
+ - server_label
- name
+ - arguments
properties:
- description:
+ type:
type: string
- description: A description of what the function does, used by the model to choose when and how to call the function.
+ enum:
+ - mcp_call
+ description: The type of the item. Always `mcp_call`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the tool call.
+ server_label:
+ type: string
+ description: The label of the MCP server running the tool.
name:
type: string
- description: 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.
- parameters:
- $ref: '#/components/schemas/OpenAI.FunctionParameters'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
- OpenAI.FunctionParameters:
- type: object
- unevaluatedProperties: {}
- description: |-
- The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
- Omitting `parameters` defines a function with an empty parameter list.
- OpenAI.FunctionShellAction:
- type: object
- required:
- - commands
- - timeout_ms
- - max_output_length
- properties:
- commands:
- type: array
- items:
- type: string
- timeout_ms:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- max_output_length:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- description: Execute a shell command.
- title: Shell exec action
- OpenAI.FunctionShellActionParam:
- type: object
- required:
- - commands
- properties:
- commands:
- type: array
- items:
- type: string
- description: Ordered shell commands for the execution environment to run.
- timeout_ms:
+ description: The name of the tool that was run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments passed to the tool.
+ output:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
- type: 'null'
- max_output_length:
+ error:
+ type: object
+ unevaluatedProperties: {}
+ status:
+ $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
+ description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
+ approval_request_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
- type: 'null'
- description: Commands and limits describing how to run the shell tool call.
- title: Shell action
- OpenAI.FunctionShellCallEnvironment:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: An invocation of a tool on an MCP server.
+ title: MCP tool call
+ OpenAI.ItemOutputMessage:
type: object
required:
+ - id
- type
+ - role
+ - content
+ - status
properties:
+ id:
+ type: string
+ description: The unique ID of the output message.
type:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironmentType'
- discriminator:
- propertyName: type
- mapping:
- local: '#/components/schemas/OpenAI.LocalEnvironmentResource'
- container_reference: '#/components/schemas/OpenAI.ContainerReferenceResource'
- OpenAI.FunctionShellCallEnvironmentType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - local
- - container_reference
- OpenAI.FunctionShellCallItemParamEnvironment:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentType'
- discriminator:
- propertyName: type
- mapping:
- local: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam'
- container_reference: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam'
- description: The environment to execute the shell commands in.
- OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam:
- type: object
- required:
- - type
- - container_id
- properties:
- type:
+ - output_message
+ description: The type of the output message. Always `message`.
+ x-stainless-const: true
+ role:
type: string
enum:
- - container_reference
- description: References a container created with the /v1/containers endpoint
+ - assistant
+ description: The role of the output message. Always `assistant`.
x-stainless-const: true
- default: container_reference
- container_id:
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.OutputMessageContent'
+ description: The content of the output message.
+ phase:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
+ - type: 'null'
+ status:
type: string
- description: The ID of the referenced container.
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
- OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: An output message from the model.
+ title: Output message
+ OpenAI.ItemReasoningItem:
type: object
required:
- type
+ - id
+ - summary
properties:
type:
type: string
enum:
- - local
- description: Use a local computer environment.
+ - reasoning
+ description: The type of the object. Always `reasoning`.
x-stainless-const: true
- default: local
- skills:
+ id:
+ type: string
+ description: The unique identifier of the reasoning content.
+ encrypted_content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ summary:
type: array
items:
- $ref: '#/components/schemas/OpenAI.LocalSkillParam'
- maxItems: 200
- description: An optional list of skills.
- allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
- OpenAI.FunctionShellCallItemParamEnvironmentType:
- anyOf:
- - type: string
- - type: string
- enum:
- - local
- - container_reference
- OpenAI.FunctionShellCallItemStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: Status values reported for shell tool calls.
- title: Shell call status
- OpenAI.FunctionShellCallOutputContent:
- type: object
- required:
- - stdout
- - stderr
- - outcome
- properties:
- stdout:
- type: string
- description: The standard output that was captured.
- stderr:
- type: string
- description: The standard error output that was captured.
- outcome:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
- description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
- title: Shell call outcome
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- description: The content of a shell tool call output that was emitted.
- title: Shell call output content
- OpenAI.FunctionShellCallOutputContentParam:
- type: object
- required:
- - stdout
- - stderr
- - outcome
- properties:
- stdout:
- type: string
- maxLength: 10485760
- description: Captured stdout output for the shell call.
- stderr:
- type: string
- maxLength: 10485760
- description: Captured stderr output for the shell call.
- outcome:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
- description: The exit or timeout outcome associated with this shell call.
- description: Captured stdout and stderr for a portion of a shell tool call output.
- title: Shell output content
- OpenAI.FunctionShellCallOutputExitOutcome:
- type: object
- required:
- - type
- - exit_code
- properties:
- type:
+ $ref: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: Reasoning summary content.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
+ description: Reasoning text content.
+ status:
type: string
enum:
- - exit
- description: The outcome type. Always `exit`.
- x-stainless-const: true
- exit_code:
- $ref: '#/components/schemas/OpenAI.integer'
- description: Exit code from the shell process.
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
- description: Indicates that the shell commands finished and returned an exit code.
- title: Shell call exit outcome
- OpenAI.FunctionShellCallOutputExitOutcomeParam:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ description: |-
+ A description of the chain of thought used by a reasoning model while generating
+ a response. Be sure to include these items in your `input` to the Responses API
+ for subsequent turns of a conversation if you are manually
+ [managing context](/docs/guides/conversation-state).
+ title: Reasoning
+ OpenAI.ItemReferenceParam:
type: object
required:
- type
- - exit_code
+ - id
properties:
type:
type: string
enum:
- - exit
- description: The outcome type. Always `exit`.
+ - item_reference
+ description: The type of item to reference. Always `item_reference`.
x-stainless-const: true
- exit_code:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The exit code returned by the shell process.
+ id:
+ type: string
+ description: The ID of the item to reference.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
- description: Indicates that the shell commands finished and returned an exit code.
- title: Shell call exit outcome
- OpenAI.FunctionShellCallOutputOutcome:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType'
- discriminator:
- propertyName: type
- mapping:
- timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome'
- exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome'
- description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
- title: Shell call outcome
- OpenAI.FunctionShellCallOutputOutcomeParam:
+ - $ref: '#/components/schemas/OpenAI.InputItem'
+ description: An internal identifier for an item to reference.
+ title: Item reference
+ OpenAI.ItemResource:
type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParamType'
- discriminator:
- propertyName: type
- mapping:
- timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcomeParam'
- exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcomeParam'
- description: The exit or timeout outcome associated with this shell call.
- title: Shell call outcome
- OpenAI.FunctionShellCallOutputOutcomeParamType:
- anyOf:
- - type: string
- - type: string
- enum:
- - timeout
- - exit
- OpenAI.FunctionShellCallOutputOutcomeType:
- anyOf:
- - type: string
- - type: string
- enum:
- - timeout
- - exit
- OpenAI.FunctionShellCallOutputStatusEnum:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionShellCallOutputTimeoutOutcome:
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.ItemResourceType'
+ discriminator:
+ propertyName: type
+ mapping:
+ message: '#/components/schemas/OpenAI.ItemResourceInputMessage'
+ output_message: '#/components/schemas/OpenAI.ItemResourceOutputMessage'
+ file_search_call: '#/components/schemas/OpenAI.ItemResourceFileSearchToolCall'
+ computer_call: '#/components/schemas/OpenAI.ItemResourceComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.ItemResourceComputerToolCallOutput'
+ web_search_call: '#/components/schemas/OpenAI.ItemResourceWebSearchToolCall'
+ function_call: '#/components/schemas/OpenAI.ItemResourceFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutput'
+ tool_search_call: '#/components/schemas/OpenAI.ItemResourceToolSearchCall'
+ tool_search_output: '#/components/schemas/OpenAI.ItemResourceToolSearchOutput'
+ additional_tools: '#/components/schemas/OpenAI.ItemResourceAdditionalTools'
+ reasoning: '#/components/schemas/OpenAI.ItemResourceReasoningItem'
+ compaction: '#/components/schemas/OpenAI.ItemResourceCompactionBody'
+ image_generation_call: '#/components/schemas/OpenAI.ItemResourceImageGenToolCall'
+ code_interpreter_call: '#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.ItemResourceFunctionShellCall'
+ shell_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput'
+ apply_patch_call: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall'
+ apply_patch_call_output: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput'
+ mcp_list_tools: '#/components/schemas/OpenAI.ItemResourceMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource'
+ mcp_call: '#/components/schemas/OpenAI.ItemResourceMcpToolCall'
+ custom_tool_call: '#/components/schemas/OpenAI.ItemResourceCustomToolCallResource'
+ custom_tool_call_output: '#/components/schemas/OpenAI.ItemResourceCustomToolCallOutputResource'
+ description: Content item used to generate a response.
+ OpenAI.ItemResourceAdditionalTools:
type: object
required:
- type
+ - id
+ - role
+ - tools
properties:
type:
type: string
enum:
- - timeout
- description: The outcome type. Always `timeout`.
+ - additional_tools
+ description: The type of the item. Always `additional_tools`.
x-stainless-const: true
+ default: additional_tools
+ id:
+ type: string
+ description: The unique ID of the additional tools item.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role that provided the additional tools.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The additional tool definitions made available at this item.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome'
- description: Indicates that the shell call exceeded its configured time limit.
- title: Shell call timeout outcome
- OpenAI.FunctionShellCallOutputTimeoutOutcomeParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ OpenAI.ItemResourceApplyPatchToolCall:
type: object
required:
- type
+ - id
+ - call_id
+ - status
+ - operation
properties:
type:
type: string
enum:
- - timeout
- description: The outcome type. Always `timeout`.
+ - apply_patch_call
+ description: The type of the item. Always `apply_patch_call`.
x-stainless-const: true
+ default: apply_patch_call
+ id:
+ type: string
+ description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
+ description: The status of the apply patch tool call. One of `in_progress` or `completed`.
+ operation:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
+ title: Apply patch operation
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeParam'
- description: Indicates that the shell call exceeded its configured time limit.
- title: Shell call timeout outcome
- OpenAI.FunctionShellCallStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.FunctionShellToolParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A tool call that applies file diffs by creating, deleting, or updating files.
+ title: Apply patch tool call
+ OpenAI.ItemResourceApplyPatchToolCallOutput:
type: object
required:
- type
+ - id
+ - call_id
+ - status
properties:
type:
type: string
enum:
- - shell
- description: The type of the shell tool. Always `shell`.
+ - apply_patch_call_output
+ description: The type of the item. Always `apply_patch_call_output`.
x-stainless-const: true
- environment:
+ default: apply_patch_call_output
+ id:
+ type: string
+ description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
+ description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ output:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
+ - type: string
- type: 'null'
- name:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
+ created_by:
type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
+ description: The ID of the entity that created this tool call output.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that allows the model to execute shell commands.
- title: Shell tool
- OpenAI.FunctionShellToolParamEnvironment:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentType'
- discriminator:
- propertyName: type
- mapping:
- local: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam'
- container_reference: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam'
- container_auto: '#/components/schemas/OpenAI.ContainerAutoParam'
- OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The output emitted by an apply patch tool call.
+ title: Apply patch tool call output
+ OpenAI.ItemResourceCodeInterpreterToolCall:
type: object
required:
- type
+ - id
+ - status
- container_id
+ - code
+ - outputs
properties:
type:
type: string
enum:
- - container_reference
- description: References a container created with the /v1/containers endpoint
+ - code_interpreter_call
+ description: The type of the code interpreter tool call. Always `code_interpreter_call`.
x-stainless-const: true
- default: container_reference
+ default: code_interpreter_call
+ id:
+ type: string
+ description: The unique ID of the code interpreter tool call.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - interpreting
+ - failed
+ description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
container_id:
type: string
- description: The ID of the referenced container.
+ description: The ID of the container used to run the code.
+ code:
+ anyOf:
+ - type: string
+ - type: 'null'
+ outputs:
+ anyOf:
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
- OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A tool call to run code.
+ title: Code interpreter tool call
+ OpenAI.ItemResourceCompactionBody:
type: object
required:
- type
+ - id
+ - encrypted_content
properties:
type:
type: string
enum:
- - local
- description: Use a local computer environment.
+ - compaction
+ description: The type of the item. Always `compaction`.
x-stainless-const: true
- default: local
- skills:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.LocalSkillParam'
- maxItems: 200
- description: An optional list of skills.
+ default: compaction
+ id:
+ type: string
+ description: The unique ID of the compaction item.
+ encrypted_content:
+ type: string
+ description: The encrypted content that was produced by compaction.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellToolParamEnvironment'
- OpenAI.FunctionShellToolParamEnvironmentType:
- anyOf:
- - type: string
- - type: string
- enum:
- - container_auto
- - local
- - container_reference
- OpenAI.FunctionTool:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
+ title: Compaction item
+ OpenAI.ItemResourceComputerToolCall:
type: object
required:
- type
- - name
- - parameters
- - strict
+ - id
+ - call_id
+ - pending_safety_checks
+ - status
properties:
type:
type: string
enum:
- - function
- description: The type of the function tool. Always `function`.
- x-stainless-const: true
- name:
+ - computer_call
+ description: The type of the computer call. Always `computer_call`.
+ default: computer_call
+ id:
type: string
- description: The name of the function to call.
- description:
- anyOf:
- - type: string
- - type: 'null'
- parameters:
- anyOf:
- - type: object
- unevaluatedProperties: {}
- - type: 'null'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
- defer_loading:
- type: boolean
- description: Whether this function is deferred and loaded via tool search.
+ description: The unique ID of the computer call.
+ call_id:
+ type: string
+ description: An identifier used when responding to the tool call with output.
+ action:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ actions:
+ $ref: '#/components/schemas/OpenAI.ComputerActionList'
+ pending_safety_checks:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: The pending safety checks for the computer call.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: 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).
- title: Function
- OpenAI.FunctionToolParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: |-
+ A tool call to a computer use tool. See the
+ [computer use guide](/docs/guides/tools-computer-use) for more information.
+ title: Computer tool call
+ OpenAI.ItemResourceComputerToolCallOutput:
type: object
required:
- - name
- type
+ - id
+ - call_id
+ - output
properties:
- name:
- type: string
- minLength: 1
- maxLength: 128
- pattern: ^[a-zA-Z0-9_-]+$
- description:
- anyOf:
- - type: string
- - type: 'null'
- parameters:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.EmptyModelParam'
- - type: 'null'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
type:
type: string
enum:
- - function
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
x-stainless-const: true
- default: function
- defer_loading:
- type: boolean
- description: Whether this function should be deferred and discovered via tool search.
- OpenAI.GraderLabelModel:
+ default: computer_call_output
+ id:
+ type: string
+ description: The ID of the computer tool call output.
+ readOnly: true
+ call_id:
+ type: string
+ description: The ID of the computer tool call that produced the output.
+ acknowledged_safety_checks:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: |-
+ The safety checks reported by the API that have been acknowledged by the
+ developer.
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.ItemResourceCustomToolCallOutputResource:
type: object
required:
- type
- - name
- - model
- - input
- - labels
- - passing_labels
+ - call_id
+ - output
+ - status
properties:
type:
type: string
enum:
- - label_model
- description: The object type, which is always `label_model`.
+ - custom_tool_call_output
+ description: The type of the custom tool call output. Always `custom_tool_call_output`.
x-stainless-const: true
- name:
+ id:
type: string
- description: The name of the grader.
- model:
+ description: The unique ID of the custom tool call output in the OpenAI platform.
+ call_id:
type: string
- description: The model to use for the evaluation. Must support structured outputs.
- input:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalItem'
- labels:
- type: array
- items:
- type: string
- description: The labels to assign to each item in the evaluation.
- passing_labels:
- type: array
- items:
- type: string
- description: The labels that indicate a passing result. Must be a subset of labels.
- description: |-
- A LabelModelGrader object which uses a model to assign labels to each item
- in the evaluation.
- title: LabelModelGrader
- x-oaiMeta:
- name: Label Model Grader
- group: graders
- example: |
- {
- "name": "First label grader",
- "type": "label_model",
- "model": "gpt-4o-2024-08-06",
- "input": [
- {
- "type": "message",
- "role": "system",
- "content": {
- "type": "input_text",
- "text": "Classify the sentiment of the following statement as one of positive, neutral, or negative"
- }
- },
- {
- "type": "message",
- "role": "user",
- "content": {
- "type": "input_text",
- "text": "Statement: {{item.response}}"
- }
- }
- ],
- "passing_labels": [
- "positive"
- ],
- "labels": [
- "positive",
- "neutral",
- "negative"
- ]
- }
- OpenAI.GraderMulti:
+ description: The call ID, used to map this custom tool call output to a custom tool call.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the custom tool call generated by your code.
+ Can be a string or an list of output content.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ title: ResponseCustomToolCallOutputItem
+ OpenAI.ItemResourceCustomToolCallResource:
type: object
required:
- type
+ - call_id
- name
- - graders
- - calculate_output
+ - input
+ - status
properties:
type:
type: string
enum:
- - multi
- description: The object type, which is always `multi`.
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
x-stainless-const: true
- default: multi
- name:
+ id:
type: string
- description: The name of the grader.
- graders:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
- - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
- - $ref: '#/components/schemas/OpenAI.GraderPython'
- - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
- - $ref: '#/components/schemas/OpenAI.GraderLabelModel'
- calculate_output:
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
type: string
- description: A formula to calculate the output based on grader results.
- description: A MultiGrader object combines the output of multiple graders to produce a single score.
- title: MultiGrader
- x-oaiMeta:
- name: Multi Grader
- group: graders
- example: |
- {
- "type": "multi",
- "name": "example multi grader",
- "graders": [
- {
- "type": "text_similarity",
- "name": "example text similarity grader",
- "input": "The graded text",
- "reference": "The reference text",
- "evaluation_metric": "fuzzy_match"
- },
- {
- "type": "string_check",
- "name": "Example string check grader",
- "input": "{{sample.output_text}}",
- "reference": "{{item.label}}",
- "operation": "eq"
- }
- ],
- "calculate_output": "0.5 * text_similarity_score + 0.5 * string_check_score)"
- }
- OpenAI.GraderPython:
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
+ type: string
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ title: ResponseCustomToolCallItem
+ OpenAI.ItemResourceFileSearchToolCall:
type: object
required:
+ - id
- type
- - name
- - source
+ - status
+ - queries
properties:
+ id:
+ type: string
+ description: The unique ID of the file search tool call.
type:
type: string
enum:
- - python
- description: The object type, which is always `python`.
+ - file_search_call
+ description: The type of the file search tool call. Always `file_search_call`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- source:
- type: string
- description: The source code of the python script.
- image_tag:
+ status:
type: string
- description: The image tag to use for the python script.
- description: A PythonGrader object that runs a python script on the input.
- title: PythonGrader
- x-oaiMeta:
- name: Python Grader
- group: graders
- example: |
- {
- "type": "python",
- "name": "Example python grader",
- "image_tag": "2025-05-08",
- "source": """
- def grade(sample: dict, item: dict) -> float:
- """
- Returns 1.0 if `output_text` equals `label`, otherwise 0.0.
- """
- output = sample.get("output_text")
- label = item.get("label")
- return 1.0 if output == label else 0.0
- """,
- }
- OpenAI.GraderScoreModel:
+ enum:
+ - in_progress
+ - searching
+ - completed
+ - incomplete
+ - failed
+ description: |-
+ The status of the file search tool call. One of `in_progress`,
+ `searching`, `incomplete` or `failed`,
+ queries:
+ type: array
+ items:
+ type: string
+ description: The queries used to search for files.
+ results:
+ anyOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: |-
+ The results of a file search tool call. See the
+ [file search guide](/docs/guides/tools-file-search) for more information.
+ title: File search tool call
+ OpenAI.ItemResourceFunctionShellCall:
type: object
required:
- type
- - name
- - model
- - input
+ - id
+ - call_id
+ - action
+ - status
+ - environment
properties:
type:
type: string
enum:
- - score_model
- description: The object type, which is always `score_model`.
+ - shell_call
+ description: The type of the item. Always `shell_call`.
x-stainless-const: true
- name:
+ default: shell_call
+ id:
type: string
- description: The name of the grader.
- model:
+ description: The unique ID of the shell tool call. Populated when this item is returned via API.
+ call_id:
type: string
- description: The model to use for the evaluation.
- sampling_params:
- $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams'
- description: The sampling parameters for the model.
- input:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.EvalItem'
- description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
- range:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The range of the score. Defaults to `[0, 1]`.
- description: A ScoreModelGrader object that uses a model to assign a score to the input.
- title: ScoreModelGrader
- x-oaiMeta:
- name: Score Model Grader
- group: graders
- example: |
- {
- "type": "score_model",
- "name": "Example score model grader",
- "input": [
- {
- "role": "user",
- "content": [
- {
- "type": "input_text",
- "text": (
- "Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different."
- " Return just a floating point score
-
- "
- " Reference answer: {{item.label}}
-
- "
- " Model answer: {{sample.output_text}}"
- )
- },
- {
- "type": "input_image",
- "image_url": "https://example.com/reference.png",
- "file_id": null,
- "detail": "auto"
- }
- ],
- }
- ],
- "model": "gpt-5-mini",
- "sampling_params": {
- "temperature": 1,
- "top_p": 1,
- "seed": 42,
- "max_completions_tokens": 32768,
- "reasoning_effort": "medium"
- },
- }
- OpenAI.GraderStringCheck:
+ description: The unique ID of the shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.FunctionShellAction'
+ description: The shell commands and limits that describe how to run the tool call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
+ description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
+ environment:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ - type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A tool call that executes one or more shell commands in a managed environment.
+ title: Shell tool call
+ OpenAI.ItemResourceFunctionShellCallOutput:
type: object
required:
- type
- - name
- - input
- - reference
- - operation
+ - id
+ - call_id
+ - status
+ - output
+ - max_output_length
properties:
type:
type: string
enum:
- - string_check
- description: The object type, which is always `string_check`.
+ - shell_call_output
+ description: The type of the shell call output. Always `shell_call_output`.
x-stainless-const: true
- name:
- type: string
- description: The name of the grader.
- input:
+ default: shell_call_output
+ id:
type: string
- description: The input text. This may include template strings.
- reference:
+ description: The unique ID of the shell call output. Populated when this item is returned via API.
+ call_id:
type: string
- description: The reference text. This may include template strings.
- operation:
+ description: The unique ID of the shell tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
+ description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
+ description: An array of shell call output contents
+ max_output_length:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ created_by:
type: string
- enum:
- - eq
- - ne
- - like
- - ilike
- description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
- description: A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
- title: StringCheckGrader
- x-oaiMeta:
- name: String Check Grader
- group: graders
- example: |
- {
- "type": "string_check",
- "name": "Example string check grader",
- "input": "{{sample.output_text}}",
- "reference": "{{item.label}}",
- "operation": "eq"
- }
- OpenAI.GraderTextSimilarity:
+ description: The identifier of the actor that created the item.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The output of a shell tool call that was emitted.
+ title: Shell call output
+ OpenAI.ItemResourceFunctionToolCall:
type: object
required:
+ - id
- type
+ - call_id
- name
- - input
- - reference
- - evaluation_metric
+ - arguments
properties:
+ id:
+ type: string
+ description: The unique ID of the function tool call.
+ readOnly: true
type:
type: string
enum:
- - text_similarity
- description: The type of grader.
+ - function_call
+ description: The type of the function tool call. Always `function_call`.
x-stainless-const: true
- default: text_similarity
- name:
+ call_id:
type: string
- description: The name of the grader.
- input:
+ description: The unique ID of the function tool call generated by the model.
+ namespace:
type: string
- description: The text being graded.
- reference:
+ description: The namespace of the function to run.
+ name:
type: string
- description: The text being graded against.
- evaluation_metric:
+ description: The name of the function to run.
+ arguments:
+ type: string
+ description: A JSON string of the arguments to pass to the function.
+ status:
type: string
enum:
- - cosine
- - fuzzy_match
- - bleu
- - gleu
- - meteor
- - rouge_1
- - rouge_2
- - rouge_3
- - rouge_4
- - rouge_5
- - rouge_l
+ - in_progress
+ - completed
+ - incomplete
description: |-
- 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`.
- description: A TextSimilarityGrader object which grades text based on similarity metrics.
- title: TextSimilarityGrader
- x-oaiMeta:
- name: Text Similarity Grader
- group: graders
- example: |
- {
- "type": "text_similarity",
- "name": "Example text similarity grader",
- "input": "{{sample.output_text}}",
- "reference": "{{item.label}}",
- "evaluation_metric": "fuzzy_match"
- }
- OpenAI.GrammarSyntax1:
- type: string
- enum:
- - lark
- - regex
- OpenAI.HybridSearchOptions:
- type: object
- required:
- - embedding_weight
- - text_weight
- properties:
- embedding_weight:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The weight of the embedding in the reciprocal ranking fusion.
- text_weight:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The weight of the text in the reciprocal ranking fusion.
- OpenAI.ImageDetail:
- type: string
- enum:
- - low
- - high
- - auto
- - original
- OpenAI.ImageGenActionEnum:
- type: string
- enum:
- - generate
- - edit
- - auto
- OpenAI.ImageGenTool:
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: |-
+ A tool call to run a function. See the
+ [function calling guide](/docs/guides/function-calling) for more information.
+ title: Function tool call
+ OpenAI.ItemResourceFunctionToolCallOutput:
type: object
required:
+ - id
- type
+ - call_id
+ - output
properties:
+ id:
+ type: string
+ description: |-
+ The unique ID of the function tool call output. Populated when this item
+ is returned via API.
+ readOnly: true
type:
type: string
enum:
- - image_generation
- description: The type of the image generation tool. Always `image_generation`.
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
x-stainless-const: true
- model:
- anyOf:
- - type: string
- - type: string
- enum:
- - gpt-image-1
- - gpt-image-1-mini
- - gpt-image-1.5
- default: gpt-image-1
- quality:
+ call_id:
type: string
- enum:
- - low
- - medium
- - high
- - auto
- description: |-
- The quality of the generated image. One of `low`, `medium`, `high`,
- or `auto`. Default: `auto`.
- default: auto
- size:
- anyOf:
- - type: string
+ description: The unique ID of the function tool call generated by the model.
+ output:
+ oneOf:
- type: string
- enum:
- - 1024x1024
- - 1024x1536
- - 1536x1024
- - auto
- description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`.
- default: auto
- output_format:
- type: string
- enum:
- - png
- - webp
- - jpeg
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
description: |-
- The output format of the generated image. One of `png`, `webp`, or
- `jpeg`. Default: `png`.
- default: png
- output_compression:
- $ref: '#/components/schemas/OpenAI.integer'
- minimum: 0
- maximum: 100
- description: 'Compression level for the output image. Default: 100.'
- default: 100
- moderation:
- type: string
- enum:
- - auto
- - low
- description: 'Moderation level for the generated image. Default: `auto`.'
- default: auto
- background:
+ The output from the function call generated by your code.
+ Can be a string or an list of output content.
+ status:
type: string
enum:
- - transparent
- - opaque
- - auto
- description: |-
- Background type for the generated image. One of `transparent`,
- `opaque`, or `auto`. Default: `auto`.
- default: auto
- input_fidelity:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.InputFidelity'
- - type: 'null'
- input_image_mask:
- $ref: '#/components/schemas/OpenAI.ImageGenToolInputImageMask'
+ - in_progress
+ - completed
+ - incomplete
description: |-
- Optional mask for inpainting. Contains `image_url`
- (string, optional) and `file_id` (string, optional).
- partial_images:
- $ref: '#/components/schemas/OpenAI.integer'
- minimum: 0
- maximum: 3
- description: Number of partial images to generate in streaming mode, from 0 (default value) to 3.
- action:
- $ref: '#/components/schemas/OpenAI.ImageGenActionEnum'
- description: 'Whether to generate a new image or edit an existing image. Default: `auto`.'
- name:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that generates images using the GPT image models.
- title: Image generation tool
- OpenAI.ImageGenToolInputImageMask:
- type: object
- properties:
- image_url:
- type: string
- format: uri
- file_id:
- type: string
- OpenAI.IncludeEnum:
- anyOf:
- - type: string
- - type: string
- enum:
- - file_search_call.results
- - web_search_call.results
- - web_search_call.action.sources
- - message.input_image.image_url
- - computer_call_output.output.image_url
- - code_interpreter_call.outputs
- - reasoning.encrypted_content
- - message.output_text.logprobs
- - memory_search_call.results
- description: |-
- Specify additional output data to include in the model response. Currently supported values are:
- - `web_search_call.results`: Include the search results of the web search tool call.
- - `web_search_call.action.sources`: Include the sources of the web search tool call.
- - `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).
- OpenAI.InlineSkillParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.ItemResourceImageGenToolCall:
type: object
required:
- - type
- - name
- - description
- - source
+ - type
+ - id
+ - status
+ - result
properties:
type:
type: string
enum:
- - inline
- description: Defines an inline skill for this request.
+ - image_generation_call
+ description: The type of the image generation call. Always `image_generation_call`.
x-stainless-const: true
- name:
+ id:
type: string
- description: The name of the skill.
- description:
+ description: The unique ID of the image generation call.
+ status:
type: string
- description: The description of the skill.
- source:
- $ref: '#/components/schemas/OpenAI.InlineSkillSourceParam'
- description: Inline skill payload
+ enum:
+ - in_progress
+ - completed
+ - generating
+ - failed
+ description: The status of the image generation call.
+ result:
+ anyOf:
+ - type: string
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ContainerSkill'
- OpenAI.InlineSkillSourceParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: An image generation request made by the model.
+ title: Image generation call
+ OpenAI.ItemResourceInputMessage:
type: object
required:
- type
- - media_type
- - data
+ - role
+ - content
+ - id
properties:
type:
type: string
enum:
- - base64
- description: The type of the inline skill source. Must be `base64`.
+ - message
+ description: The type of the message input. Always set to `message`.
x-stainless-const: true
- default: base64
- media_type:
+ default: message
+ role:
type: string
enum:
- - application/zip
- description: The media type of the inline skill payload. Must be `application/zip`.
- x-stainless-const: true
- default: application/zip
- data:
+ - user
+ - system
+ - developer
+ description: The role of the message input. One of `user`, `system`, or `developer`.
+ status:
type: string
- minLength: 1
- maxLength: 70254592
- description: Base64-encoded skill zip bundle.
- description: Inline skill payload
- OpenAI.InputAudio:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ content:
+ $ref: '#/components/schemas/OpenAI.InputMessageContentList'
+ id:
+ type: string
+ description: The unique ID of the message input.
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: |-
+ 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.
+ title: Input message
+ OpenAI.ItemResourceLocalShellToolCall:
type: object
required:
- type
- - input_audio
+ - id
+ - call_id
+ - action
+ - status
properties:
type:
type: string
enum:
- - input_audio
- description: The type of the input item. Always `input_audio`.
+ - local_shell_call
+ description: The type of the local shell call. Always `local_shell_call`.
x-stainless-const: true
- input_audio:
- $ref: '#/components/schemas/OpenAI.InputAudioInputAudio'
- allOf:
- - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject'
- description: An audio input to the model.
- title: Input audio
- OpenAI.InputAudioInputAudio:
- type: object
- required:
- - data
- - format
- properties:
- data:
+ id:
type: string
- format:
+ description: The unique ID of the local shell call.
+ call_id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ action:
+ $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
+ status:
type: string
enum:
- - mp3
- - wav
- OpenAI.InputContent:
+ - in_progress
+ - completed
+ - incomplete
+ description: The status of the local shell call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A tool call to run a command on the local shell.
+ title: Local shell call
+ OpenAI.ItemResourceLocalShellToolCallOutput:
type: object
required:
- type
+ - id
+ - output
properties:
type:
- $ref: '#/components/schemas/OpenAI.InputContentType'
- discriminator:
- propertyName: type
- mapping:
- input_text: '#/components/schemas/OpenAI.InputContentInputTextContent'
- input_image: '#/components/schemas/OpenAI.InputContentInputImageContent'
- input_file: '#/components/schemas/OpenAI.InputContentInputFileContent'
- OpenAI.InputContentInputFileContent:
+ type: string
+ enum:
+ - local_shell_call_output
+ description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ x-stainless-const: true
+ id:
+ type: string
+ description: The unique ID of the local shell tool call generated by the model.
+ output:
+ type: string
+ description: A JSON string of the output of the local shell tool call.
+ status:
+ anyOf:
+ - type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: The output of a local shell tool call.
+ title: Local shell call output
+ OpenAI.ItemResourceMcpApprovalRequest:
type: object
required:
- type
+ - id
+ - server_label
+ - name
+ - arguments
properties:
type:
type: string
enum:
- - input_file
- description: The type of the input item. Always `input_file`.
+ - mcp_approval_request
+ description: The type of the item. Always `mcp_approval_request`.
x-stainless-const: true
- default: input_file
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- filename:
+ id:
type: string
- description: The name of the file to be sent to the model.
- file_data:
+ description: The unique ID of the approval request.
+ server_label:
type: string
- description: The content of the file to be sent to the model.
- file_url:
+ description: The label of the MCP server making the request.
+ name:
type: string
- format: uri
- description: The URL of the file to be sent to the model.
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
+ description: The name of the tool to run.
+ arguments:
+ type: string
+ description: A JSON string of arguments for the tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputContent'
- description: A file input to the model.
- title: Input file
- OpenAI.InputContentInputImageContent:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A request for human approval of a tool invocation.
+ title: MCP approval request
+ OpenAI.ItemResourceMcpApprovalResponseResource:
type: object
required:
- type
- - detail
+ - id
+ - approval_request_id
+ - approve
properties:
type:
type: string
enum:
- - input_image
- description: The type of the input item. Always `input_image`.
+ - mcp_approval_response
+ description: The type of the item. Always `mcp_approval_response`.
x-stainless-const: true
- default: input_image
- image_url:
- anyOf:
- - type: string
- format: uri
- - type: 'null'
- file_id:
+ id:
+ type: string
+ description: The unique ID of the approval response
+ approval_request_id:
+ type: string
+ description: The ID of the approval request being answered.
+ approve:
+ type: boolean
+ description: Whether the request was approved.
+ reason:
anyOf:
- type: string
- type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputContent'
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
- title: Input image
- OpenAI.InputContentInputTextContent:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A response to an MCP approval request.
+ title: MCP approval response
+ OpenAI.ItemResourceMcpListTools:
type: object
required:
- type
- - text
+ - id
+ - server_label
+ - tools
properties:
type:
type: string
enum:
- - input_text
- description: The type of the input item. Always `input_text`.
+ - mcp_list_tools
+ description: The type of the item. Always `mcp_list_tools`.
x-stainless-const: true
- default: input_text
- text:
+ id:
type: string
- description: The text input to the model.
+ description: The unique ID of the list.
+ server_label:
+ type: string
+ description: The label of the MCP server.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
+ description: The tools available on the server.
+ error:
+ $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputContent'
- description: A text input to the model.
- title: Input text
- OpenAI.InputContentType:
- anyOf:
- - type: string
- - type: string
- enum:
- - input_text
- - input_image
- - input_file
- OpenAI.InputFidelity:
- type: string
- enum:
- - high
- - low
- description: Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`.
- OpenAI.InputFileContent:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: A list of tools available on an MCP server.
+ title: MCP list tools
+ OpenAI.ItemResourceMcpToolCall:
type: object
required:
- type
+ - id
+ - server_label
+ - name
+ - arguments
properties:
type:
type: string
enum:
- - input_file
- description: The type of the input item. Always `input_file`.
+ - mcp_call
+ description: The type of the item. Always `mcp_call`.
x-stainless-const: true
- default: input_file
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- filename:
+ id:
type: string
- description: The name of the file to be sent to the model.
- file_data:
+ description: The unique ID of the tool call.
+ server_label:
type: string
- description: The content of the file to be sent to the model.
- file_url:
+ description: The label of the MCP server running the tool.
+ name:
type: string
- format: uri
- description: The URL of the file to be sent to the model.
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
- description: A file input to the model.
- title: Input file
- OpenAI.InputFileContentParam:
- type: object
- required:
- - type
- properties:
- type:
+ description: The name of the tool that was run.
+ arguments:
type: string
- enum:
- - input_file
- description: The type of the input item. Always `input_file`.
- x-stainless-const: true
- default: input_file
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- filename:
- anyOf:
- - type: string
- - type: 'null'
- file_data:
+ description: A JSON string of the arguments passed to the tool.
+ output:
anyOf:
- type: string
- type: 'null'
- file_url:
+ error:
+ type: object
+ unevaluatedProperties: {}
+ status:
+ $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
+ description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
+ approval_request_id:
anyOf:
- type: string
- format: uri
- type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
- description: A file input to the model.
- title: Input file
- OpenAI.InputImageContent:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: An invocation of a tool on an MCP server.
+ title: MCP tool call
+ OpenAI.ItemResourceOutputMessage:
type: object
required:
+ - id
- type
- - detail
+ - role
+ - content
+ - status
properties:
+ id:
+ type: string
+ description: The unique ID of the output message.
type:
type: string
enum:
- - input_image
- description: The type of the input item. Always `input_image`.
+ - output_message
+ description: The type of the output message. Always `message`.
x-stainless-const: true
- default: input_image
- image_url:
- anyOf:
- - type: string
- format: uri
- - type: 'null'
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
- title: Input image
- OpenAI.InputImageContentParamAutoParam:
- type: object
- required:
- - type
- properties:
- type:
+ role:
type: string
enum:
- - input_image
- description: The type of the input item. Always `input_image`.
+ - assistant
+ description: The role of the output message. Always `assistant`.
x-stainless-const: true
- default: input_image
- image_url:
- anyOf:
- - type: string
- format: uri
- - type: 'null'
- file_id:
- anyOf:
- - type: string
- - type: 'null'
- detail:
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.OutputMessageContent'
+ description: The content of the output message.
+ phase:
anyOf:
- - $ref: '#/components/schemas/OpenAI.DetailEnum'
+ - $ref: '#/components/schemas/OpenAI.MessagePhase'
- type: 'null'
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision)
- title: Input image
- OpenAI.InputItem:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.InputItemType'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OpenAI.EasyInputMessage'
- item_reference: '#/components/schemas/OpenAI.ItemReferenceParam'
- output_message: '#/components/schemas/OpenAI.InputItemOutputMessage'
- file_search_call: '#/components/schemas/OpenAI.InputItemFileSearchToolCall'
- computer_call: '#/components/schemas/OpenAI.InputItemComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.InputItemComputerCallOutputItemParam'
- web_search_call: '#/components/schemas/OpenAI.InputItemWebSearchToolCall'
- function_call: '#/components/schemas/OpenAI.InputItemFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.InputItemFunctionCallOutputItemParam'
- tool_search_call: '#/components/schemas/OpenAI.InputItemToolSearchCallItemParam'
- tool_search_output: '#/components/schemas/OpenAI.InputItemToolSearchOutputItemParam'
- additional_tools: '#/components/schemas/OpenAI.InputItemAdditionalToolsItemParam'
- reasoning: '#/components/schemas/OpenAI.InputItemReasoningItem'
- compaction: '#/components/schemas/OpenAI.InputItemCompactionSummaryItemParam'
- image_generation_call: '#/components/schemas/OpenAI.InputItemImageGenToolCall'
- code_interpreter_call: '#/components/schemas/OpenAI.InputItemCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.InputItemLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.InputItemLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.InputItemFunctionShellCallItemParam'
- shell_call_output: '#/components/schemas/OpenAI.InputItemFunctionShellCallOutputItemParam'
- apply_patch_call: '#/components/schemas/OpenAI.InputItemApplyPatchToolCallItemParam'
- apply_patch_call_output: '#/components/schemas/OpenAI.InputItemApplyPatchToolCallOutputItemParam'
- mcp_list_tools: '#/components/schemas/OpenAI.InputItemMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.InputItemMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.InputItemMcpApprovalResponse'
- mcp_call: '#/components/schemas/OpenAI.InputItemMcpToolCall'
- custom_tool_call_output: '#/components/schemas/OpenAI.InputItemCustomToolCallOutput'
- custom_tool_call: '#/components/schemas/OpenAI.InputItemCustomToolCall'
- description: |-
- An item representing part of the context for the response to be
- generated by the model. Can contain text, images, and audio inputs,
- as well as previous assistant responses and tool call outputs.
- OpenAI.InputItemAdditionalToolsItemParam:
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: An output message from the model.
+ title: Output message
+ OpenAI.ItemResourceReasoningItem:
type: object
required:
- type
- - role
- - tools
+ - id
+ - summary
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
enum:
- - additional_tools
- description: The item type. Always `additional_tools`.
+ - reasoning
+ description: The type of the object. Always `reasoning`.
x-stainless-const: true
- default: additional_tools
- role:
+ id:
type: string
- enum:
- - developer
- description: The role that provided the additional tools. Only `developer` is supported.
- x-stainless-const: true
- default: developer
- tools:
+ description: The unique identifier of the reasoning content.
+ encrypted_content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ summary:
type: array
items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: A list of additional tools made available at this item.
+ $ref: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: Reasoning summary content.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
+ description: Reasoning text content.
+ status:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- OpenAI.InputItemApplyPatchToolCallItemParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: |-
+ A description of the chain of thought used by a reasoning model while generating
+ a response. Be sure to include these items in your `input` to the Responses API
+ for subsequent turns of a conversation if you are manually
+ [managing context](/docs/guides/conversation-state).
+ title: Reasoning
+ OpenAI.ItemResourceToolSearchCall:
type: object
required:
- type
+ - id
- call_id
+ - execution
+ - arguments
- status
- - operation
properties:
type:
type: string
enum:
- - apply_patch_call
- description: The type of the item. Always `apply_patch_call`.
+ - tool_search_call
+ description: The type of the item. Always `tool_search_call`.
x-stainless-const: true
- default: apply_patch_call
+ default: tool_search_call
id:
+ type: string
+ description: The unique ID of the tool search call item.
+ call_id:
anyOf:
- type: string
- type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the apply patch tool call generated by the model.
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ arguments:
+ description: Arguments used for the tool search call.
status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatusParam'
- description: The status of the apply patch tool call. One of `in_progress` or `completed`.
- operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: The specific create, delete, or update instruction for the apply_patch tool call.
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: The status of the tool search call item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A tool call representing a request to create, delete, or update files using diff patches.
- title: Apply patch tool call
- OpenAI.InputItemApplyPatchToolCallOutputItemParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ OpenAI.ItemResourceToolSearchOutput:
type: object
required:
- type
+ - id
- call_id
+ - execution
+ - tools
- status
properties:
type:
type: string
enum:
- - apply_patch_call_output
- description: The type of the item. Always `apply_patch_call_output`.
+ - tool_search_output
+ description: The type of the item. Always `tool_search_output`.
x-stainless-const: true
- default: apply_patch_call_output
+ default: tool_search_output
id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam'
- description: The status of the apply patch tool call output. One of `completed` or `failed`.
- output:
+ description: The unique ID of the tool search output item.
+ call_id:
anyOf:
- type: string
- type: 'null'
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The loaded tool definitions returned by tool search.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: The status of the tool search output item that was recorded.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The streamed output emitted by an apply patch tool call.
- title: Apply patch tool call output
- OpenAI.InputItemCodeInterpreterToolCall:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ OpenAI.ItemResourceType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - message
+ - output_message
+ - file_search_call
+ - computer_call
+ - computer_call_output
+ - web_search_call
+ - function_call
+ - function_call_output
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - reasoning
+ - compaction
+ - image_generation_call
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - mcp_call
+ - custom_tool_call
+ - custom_tool_call_output
+ - structured_outputs
+ - oauth_consent_request
+ - memory_search_call
+ - memory_command_preview_call
+ - memory_command_preview_call_output
+ - workflow_action
+ - a2a_preview_call
+ - a2a_preview_call_output
+ - bing_grounding_call
+ - bing_grounding_call_output
+ - sharepoint_grounding_preview_call
+ - sharepoint_grounding_preview_call_output
+ - azure_ai_search_call
+ - azure_ai_search_call_output
+ - bing_custom_search_preview_call
+ - bing_custom_search_preview_call_output
+ - openapi_call
+ - openapi_call_output
+ - browser_automation_preview_call
+ - browser_automation_preview_call_output
+ - fabric_dataagent_preview_call
+ - fabric_dataagent_preview_call_output
+ - azure_function_call
+ - azure_function_call_output
+ OpenAI.ItemResourceWebSearchToolCall:
type: object
required:
- - type
- id
+ - type
- status
- - container_id
- - code
- - outputs
+ - action
properties:
+ id:
+ type: string
+ description: The unique ID of the web search tool call.
type:
type: string
enum:
- - code_interpreter_call
- description: The type of the code interpreter tool call. Always `code_interpreter_call`.
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
x-stainless-const: true
- default: code_interpreter_call
- id:
- type: string
- description: The unique ID of the code interpreter tool call.
status:
type: string
enum:
- in_progress
+ - searching
- completed
- - incomplete
- - interpreting
- failed
- description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
- container_id:
- type: string
- description: The ID of the container used to run the code.
- code:
- anyOf:
- - type: string
- - type: 'null'
- outputs:
- anyOf:
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- - type: 'null'
+ - incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ description: |-
+ 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_in_page).
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A tool call to run code.
- title: Code interpreter tool call
- OpenAI.InputItemCompactionSummaryItemParam:
+ - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: |-
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.ItemToolSearchCallItemParam:
type: object
required:
- type
- - encrypted_content
+ - arguments
properties:
id:
anyOf:
- type: string
- type: 'null'
+ call_id:
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- - compaction
- description: The type of the item. Always `compaction`.
+ - tool_search_call
+ description: The item type. Always `tool_search_call`.
x-stainless-const: true
- default: compaction
- encrypted_content:
- type: string
- maxLength: 10485760
- description: The encrypted content of the compaction summary.
+ default: tool_search_call
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ arguments:
+ $ref: '#/components/schemas/OpenAI.EmptyModelParam'
+ description: The arguments supplied to the tool search call.
+ status:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
- title: Compaction item
- OpenAI.InputItemComputerCallOutputItemParam:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ OpenAI.ItemToolSearchOutputItemParam:
type: object
required:
- - call_id
- type
- - output
+ - tools
properties:
id:
anyOf:
- type: string
- type: 'null'
call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The ID of the computer tool call that produced the output.
+ anyOf:
+ - type: string
+ - type: 'null'
type:
type: string
enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
+ - tool_search_output
+ description: The item type. Always `tool_search_output`.
x-stainless-const: true
- default: computer_call_output
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- acknowledged_safety_checks:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- - type: 'null'
+ default: tool_search_output
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The loaded tool definitions returned by the tool search output.
status:
anyOf:
- $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.InputItemComputerToolCall:
+ - $ref: '#/components/schemas/OpenAI.Item'
+ OpenAI.ItemType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - message
+ - output_message
+ - file_search_call
+ - computer_call
+ - computer_call_output
+ - web_search_call
+ - function_call
+ - function_call_output
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - reasoning
+ - compaction
+ - image_generation_call
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - mcp_call
+ - custom_tool_call_output
+ - custom_tool_call
+ - structured_outputs
+ - oauth_consent_request
+ - memory_search_call
+ - memory_command_preview_call
+ - memory_command_preview_call_output
+ - workflow_action
+ - a2a_preview_call
+ - a2a_preview_call_output
+ - bing_grounding_call
+ - bing_grounding_call_output
+ - sharepoint_grounding_preview_call
+ - sharepoint_grounding_preview_call_output
+ - azure_ai_search_call
+ - azure_ai_search_call_output
+ - bing_custom_search_preview_call
+ - bing_custom_search_preview_call_output
+ - openapi_call
+ - openapi_call_output
+ - browser_automation_preview_call
+ - browser_automation_preview_call_output
+ - fabric_dataagent_preview_call
+ - fabric_dataagent_preview_call_output
+ - azure_function_call
+ - azure_function_call_output
+ OpenAI.ItemWebSearchToolCall:
type: object
required:
- - type
- id
- - call_id
- - pending_safety_checks
+ - type
- status
+ - action
properties:
- type:
- type: string
- enum:
- - computer_call
- description: The type of the computer call. Always `computer_call`.
- default: computer_call
id:
type: string
- description: The unique ID of the computer call.
- call_id:
+ description: The unique ID of the web search tool call.
+ type:
type: string
- description: An identifier used when responding to the tool call with output.
- action:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- actions:
- $ref: '#/components/schemas/OpenAI.ComputerActionList'
- pending_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: The pending safety checks for the computer call.
+ enum:
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
+ x-stainless-const: true
status:
type: string
enum:
- in_progress
+ - searching
- completed
+ - failed
- incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ 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_in_page).
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
+ - $ref: '#/components/schemas/OpenAI.Item'
description: |-
- A tool call to a computer use tool. See the
- [computer use guide](/docs/guides/tools-computer-use) for more information.
- title: Computer tool call
- OpenAI.InputItemCustomToolCall:
- type: object
- required:
- - type
- - call_id
- - name
- - input
- properties:
- type:
- type: string
- enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
- type: string
- description: The name of the custom tool being called.
- input:
- type: string
- description: The input for the custom tool call generated by the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A call to a custom tool created by the model.
- title: Custom tool call
- OpenAI.InputItemCustomToolCallOutput:
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.KeyPressAction:
type: object
required:
- type
- - call_id
- - output
+ - keys
properties:
type:
type: string
enum:
- - custom_tool_call_output
- description: The type of the custom tool call output. Always `custom_tool_call_output`.
+ - keypress
+ description: Specifies the event type. For a keypress action, this property is always set to `keypress`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call output in the OpenAI platform.
- call_id:
- type: string
- description: The call ID, used to map this custom tool call output to a custom tool call.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the custom tool call generated by your code.
- Can be a string or an list of output content.
+ keys:
+ type: array
+ items:
+ type: string
+ description: The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The output of a custom tool call from your code, being sent back to the model.
- title: Custom tool call output
- OpenAI.InputItemFileSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A collection of keypresses the model would like to perform.
+ title: KeyPress
+ OpenAI.KnownSpeakerNames:
+ type: array
+ items:
+ type: string
+ maxItems: 4
+ description: Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported.
+ OpenAI.KnownSpeakerReferences:
+ type: array
+ items:
+ type: string
+ maxItems: 4
+ description: Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)) that contain known speaker references matching `known_speaker_names[]`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by `file`.
+ OpenAI.ListAssistantsResponse:
type: object
required:
- - id
- - type
- - status
- - queries
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- id:
- type: string
- description: The unique ID of the file search tool call.
- type:
- type: string
- enum:
- - file_search_call
- description: The type of the file search tool call. Always `file_search_call`.
- x-stainless-const: true
- status:
+ object:
type: string
- enum:
- - in_progress
- - searching
- - completed
- - incomplete
- - failed
- description: |-
- The status of the file search tool call. One of `in_progress`,
- `searching`, `incomplete` or `failed`,
- queries:
+ data:
type: array
items:
- type: string
- description: The queries used to search for files.
- results:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: |-
- The results of a file search tool call. See the
- [file search guide](/docs/guides/tools-file-search) for more information.
- title: File search tool call
- OpenAI.InputItemFunctionCallOutputItemParam:
+ $ref: '#/components/schemas/OpenAI.AssistantObject'
+ x-ms-list-page-items: true
+ first_id:
+ type: string
+ last_id:
+ type: string
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ x-oaiMeta:
+ name: List assistants response object
+ group: chat
+ example: |
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698982736,
+ "name": "Coding Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc456",
+ "object": "assistant",
+ "created_at": 1698982718,
+ "name": "My Assistant",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc789",
+ "object": "assistant",
+ "created_at": 1698982643,
+ "name": null,
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ ],
+ "first_id": "asst_abc123",
+ "last_id": "asst_abc789",
+ "has_more": false
+ }
+ OpenAI.ListBatchesResponse:
type: object
required:
- - call_id
- - type
- - output
+ - data
+ - has_more
+ - object
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Batch'
+ x-ms-list-page-items: true
+ first_id:
type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the function tool call generated by the model.
- type:
+ last_id:
+ type: string
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ object:
type: string
enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
+ - list
x-stainless-const: true
- default: function_call_output
- output:
- oneOf:
- - type: string
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.InputTextContentParam'
- - $ref: '#/components/schemas/OpenAI.InputImageContentParamAutoParam'
- - $ref: '#/components/schemas/OpenAI.InputFileContentParam'
- description: Text, image, or file output of the function tool call.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.InputItemFunctionShellCallItemParam:
+ OpenAI.ListFilesResponse:
type: object
required:
- - call_id
- - type
- - action
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
+ object:
type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the shell tool call generated by the model.
- type:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.OpenAIFile'
+ x-ms-list-page-items: true
+ first_id:
+ type: string
+ last_id:
+ type: string
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListFineTuningCheckpointPermissionResponse:
+ type: object
+ required:
+ - data
+ - object
+ - has_more
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FineTuningCheckpointPermission'
+ x-ms-list-page-items: true
+ object:
type: string
enum:
- - shell_call
- description: The type of the item. Always `shell_call`.
+ - list
x-stainless-const: true
- default: shell_call
- action:
- $ref: '#/components/schemas/OpenAI.FunctionShellActionParam'
- description: The shell commands and limits that describe how to run the tool call.
- status:
+ first_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
+ - type: string
- type: 'null'
- environment:
+ last_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
+ - type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A tool representing a request to execute one or more shell commands.
- title: Shell tool call
- OpenAI.InputItemFunctionShellCallOutputItemParam:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListFineTuningJobCheckpointsResponse:
type: object
required:
- - call_id
- - type
- - output
+ - data
+ - object
+ - has_more
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the shell tool call generated by the model.
- type:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpoint'
+ x-ms-list-page-items: true
+ object:
type: string
enum:
- - shell_call_output
- description: The type of the item. Always `shell_call_output`.
+ - list
x-stainless-const: true
- default: shell_call_output
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContentParam'
- description: Captured chunks of stdout and stderr output, along with their associated outcomes.
- status:
+ first_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
+ - type: string
- type: 'null'
- max_output_length:
+ last_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The streamed output items emitted by a shell tool call.
- title: Shell tool call output
- OpenAI.InputItemFunctionToolCall:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListFineTuningJobEventsResponse:
type: object
required:
- - id
- - type
- - call_id
- - name
- - arguments
+ - data
+ - object
+ - has_more
properties:
- id:
- type: string
- description: The unique ID of the function tool call.
- readOnly: true
- type:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FineTuningJobEvent'
+ x-ms-list-page-items: true
+ object:
type: string
enum:
- - function_call
- description: The type of the function tool call. Always `function_call`.
+ - list
x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- namespace:
- type: string
- description: The namespace of the function to run.
- name:
+ has_more:
+ type: boolean
+ OpenAI.ListMessagesResponse:
+ type: object
+ required:
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
+ properties:
+ object:
type: string
- description: The name of the function to run.
- arguments:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MessageObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: A JSON string of the arguments to pass to the function.
- status:
+ last_id:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: |-
- A tool call to run a function. See the
- [function calling guide](/docs/guides/function-calling) for more information.
- title: Function tool call
- OpenAI.InputItemImageGenToolCall:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListModelsResponse:
type: object
required:
- - type
- - id
- - status
- - result
+ - object
+ - data
properties:
- type:
+ object:
type: string
enum:
- - image_generation_call
- description: The type of the image generation call. Always `image_generation_call`.
+ - list
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the image generation call.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - generating
- - failed
- description: The status of the image generation call.
- result:
- anyOf:
- - type: string
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: An image generation request made by the model.
- title: Image generation call
- OpenAI.InputItemLocalShellToolCall:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Model'
+ x-ms-list-page-items: true
+ OpenAI.ListPaginatedFineTuningJobsResponse:
type: object
required:
- - type
- - id
- - call_id
- - action
- - status
+ - data
+ - has_more
+ - object
properties:
- type:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FineTuningJob'
+ x-ms-list-page-items: true
+ has_more:
+ type: boolean
+ object:
type: string
enum:
- - local_shell_call
- description: The type of the local shell call. Always `local_shell_call`.
+ - list
x-stainless-const: true
- id:
+ OpenAI.ListRunStepsResponse:
+ type: object
+ required:
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
+ properties:
+ object:
type: string
- description: The unique ID of the local shell call.
- call_id:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunStepObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The unique ID of the local shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
- status:
+ last_id:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: The status of the local shell call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A tool call to run a command on the local shell.
- title: Local shell call
- OpenAI.InputItemLocalShellToolCallOutput:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListRunsResponse:
type: object
required:
- - type
- - id
- - output
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
+ object:
type: string
- enum:
- - local_shell_call_output
- description: The type of the local shell tool call output. Always `local_shell_call_output`.
- x-stainless-const: true
- id:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The unique ID of the local shell tool call generated by the model.
- output:
+ last_id:
type: string
- description: A JSON string of the output of the local shell tool call.
- status:
- anyOf:
- - type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: The output of a local shell tool call.
- title: Local shell call output
- OpenAI.InputItemMcpApprovalRequest:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListVectorStoreFilesFilter:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - failed
+ - cancelled
+ OpenAI.ListVectorStoreFilesResponse:
type: object
required:
- - type
- - id
- - server_label
- - name
- - arguments
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
- type: string
- enum:
- - mcp_approval_request
- description: The type of the item. Always `mcp_approval_request`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval request.
- server_label:
+ object:
type: string
- description: The label of the MCP server making the request.
- name:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The name of the tool to run.
- arguments:
+ last_id:
type: string
- description: A JSON string of arguments for the tool.
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A request for human approval of a tool invocation.
- title: MCP approval request
- OpenAI.InputItemMcpApprovalResponse:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ OpenAI.ListVectorStoresResponse:
type: object
required:
- - type
- - approval_request_id
- - approve
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
+ object:
type: string
- enum:
- - mcp_approval_response
- description: The type of the item. Always `mcp_approval_response`.
- x-stainless-const: true
- id:
- anyOf:
- - type: string
- - type: 'null'
- approval_request_id:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObject'
+ x-ms-list-page-items: true
+ first_id:
type: string
- description: The ID of the approval request being answered.
- approve:
+ last_id:
+ type: string
+ x-ms-list-continuation-token: true
+ has_more:
type: boolean
- description: Whether the request was approved.
- reason:
- anyOf:
- - type: string
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A response to an MCP approval request.
- title: MCP approval response
- OpenAI.InputItemMcpListTools:
+ OpenAI.LocalEnvironmentResource:
type: object
required:
- type
- - id
- - server_label
- - tools
properties:
type:
type: string
enum:
- - mcp_list_tools
- description: The type of the item. Always `mcp_list_tools`.
+ - local
+ description: The environment type. Always `local`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the list.
- server_label:
- type: string
- description: The label of the MCP server.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
- description: The tools available on the server.
- error:
- $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: A list of tools available on an MCP server.
- title: MCP list tools
- OpenAI.InputItemMcpToolCall:
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ description: Represents the use of a local environment to perform shell actions.
+ title: Local Environment
+ OpenAI.LocalShellExecAction:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
+ - command
+ - env
properties:
type:
type: string
enum:
- - mcp_call
- description: The type of the item. Always `mcp_call`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the tool call.
- server_label:
- type: string
- description: The label of the MCP server running the tool.
- name:
- type: string
- description: The name of the tool that was run.
- arguments:
- type: string
- description: A JSON string of the arguments passed to the tool.
- output:
+ - exec
+ description: The type of the local shell action. Always `exec`.
+ x-stainless-const: true
+ default: exec
+ command:
+ type: array
+ items:
+ type: string
+ description: The command to run.
+ timeout_ms:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ working_directory:
anyOf:
- type: string
- type: 'null'
- error:
+ env:
type: object
- unevaluatedProperties: {}
- status:
- $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
- description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
- approval_request_id:
+ unevaluatedProperties:
+ type: string
+ description: Environment variables to set for the command.
+ x-oaiTypeLabel: map
+ user:
anyOf:
- type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: An invocation of a tool on an MCP server.
- title: MCP tool call
- OpenAI.InputItemOutputMessage:
+ description: Execute a shell command on the server.
+ title: Local shell exec action
+ OpenAI.LocalShellToolParam:
type: object
required:
- - id
- type
- - role
- - content
- - status
properties:
- id:
- type: string
- description: The unique ID of the output message.
type:
type: string
enum:
- - output_message
- description: The type of the output message. Always `message`.
+ - local_shell
+ description: The type of the local shell tool. Always `local_shell`.
x-stainless-const: true
- role:
+ name:
type: string
- enum:
- - assistant
- description: The role of the output message. Always `assistant`.
- x-stainless-const: true
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.OutputMessageContent'
- description: The content of the output message.
- phase:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
- - type: 'null'
- status:
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ description:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: An output message from the model.
- title: Output message
- OpenAI.InputItemReasoningItem:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A tool that allows the model to execute shell commands in a local environment.
+ title: Local shell tool
+ OpenAI.LocalSkillParam:
type: object
required:
- - type
- - id
- - summary
+ - name
+ - description
+ - path
properties:
- type:
+ name:
type: string
- enum:
- - reasoning
- description: The type of the object. Always `reasoning`.
- x-stainless-const: true
- id:
+ description: The name of the skill.
+ description:
type: string
- description: The unique identifier of the reasoning content.
- encrypted_content:
- anyOf:
- - type: string
- - type: 'null'
- summary:
+ description: The description of the skill.
+ path:
+ type: string
+ description: The path to the directory containing the skill.
+ OpenAI.LogProb:
+ type: object
+ required:
+ - token
+ - logprob
+ - bytes
+ - top_logprobs
+ properties:
+ token:
+ type: string
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ bytes:
type: array
items:
- $ref: '#/components/schemas/OpenAI.SummaryTextContent'
- description: Reasoning summary content.
- content:
+ $ref: '#/components/schemas/OpenAI.integer'
+ top_logprobs:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
- description: Reasoning text content.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: |-
- A description of the chain of thought used by a reasoning model while generating
- a response. Be sure to include these items in your `input` to the Responses API
- for subsequent turns of a conversation if you are manually
- [managing context](/docs/guides/conversation-state).
- title: Reasoning
- OpenAI.InputItemToolSearchCallItemParam:
+ $ref: '#/components/schemas/OpenAI.TopLogProb'
+ description: The log probability of a token.
+ title: Log probability
+ OpenAI.MCPListToolsTool:
type: object
required:
- - type
- - arguments
+ - name
+ - input_schema
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
+ name:
+ type: string
+ description: The name of the tool.
+ description:
anyOf:
- type: string
- type: 'null'
- type:
- type: string
- enum:
- - tool_search_call
- description: The item type. Always `tool_search_call`.
- x-stainless-const: true
- default: tool_search_call
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- arguments:
- $ref: '#/components/schemas/OpenAI.EmptyModelParam'
- description: The arguments supplied to the tool search call.
- status:
+ input_schema:
+ $ref: '#/components/schemas/OpenAI.MCPListToolsToolInputSchema'
+ description: The JSON schema describing the tool's input.
+ annotations:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
+ - $ref: '#/components/schemas/OpenAI.MCPListToolsToolAnnotations'
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- OpenAI.InputItemToolSearchOutputItemParam:
+ description: A tool available on an MCP server.
+ title: MCP list tools tool
+ OpenAI.MCPListToolsToolAnnotations:
+ type: object
+ OpenAI.MCPListToolsToolInputSchema:
+ type: object
+ OpenAI.MCPTool:
type: object
required:
- type
- - tools
+ - server_label
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
enum:
- - tool_search_output
- description: The item type. Always `tool_search_output`.
+ - mcp
+ description: The type of the MCP tool. Always `mcp`.
x-stainless-const: true
- default: tool_search_output
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by the tool search output.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- OpenAI.InputItemType:
- anyOf:
- - type: string
- - type: string
- enum:
- - message
- - output_message
- - file_search_call
- - computer_call
- - computer_call_output
- - web_search_call
- - function_call
- - function_call_output
- - tool_search_call
- - tool_search_output
- - additional_tools
- - reasoning
- - compaction
- - image_generation_call
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - mcp_call
- - custom_tool_call_output
- - custom_tool_call
- - item_reference
- OpenAI.InputItemWebSearchToolCall:
- type: object
- required:
- - id
- - type
- - status
- - action
- properties:
- id:
+ server_label:
type: string
- description: The unique ID of the web search tool call.
- type:
+ description: A label for this MCP server, used to identify it in tool calls.
+ server_url:
type: string
- enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
- x-stainless-const: true
- status:
+ format: uri
+ description: |-
+ The URL for the MCP server. One of `server_url`, `connector_id`, or
+ `tunnel_id` must be provided.
+ connector_id:
type: string
enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ - connector_dropbox
+ - connector_gmail
+ - connector_googlecalendar
+ - connector_googledrive
+ - connector_microsoftteams
+ - connector_outlookcalendar
+ - connector_outlookemail
+ - connector_sharepoint
description: |-
- 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_in_page).
+ Identifier for service connectors, like those available in ChatGPT. One of
+ `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
+ about service connectors [here](/docs/guides/tools-remote-mcp#connectors).
+ Currently supported `connector_id` values are:
+ - Dropbox: `connector_dropbox`
+ - Gmail: `connector_gmail`
+ - Google Calendar: `connector_googlecalendar`
+ - Google Drive: `connector_googledrive`
+ - Microsoft Teams: `connector_microsoftteams`
+ - Outlook Calendar: `connector_outlookcalendar`
+ - Outlook Email: `connector_outlookemail`
+ - SharePoint: `connector_sharepoint`
+ tunnel_id:
+ type: string
+ pattern: ^tunnel_[a-z0-9]{32}$
+ description: |-
+ The Secure MCP Tunnel ID to use instead of a direct server URL. One of
+ `server_url`, `connector_id`, or `tunnel_id` must be provided.
+ authorization:
+ type: string
+ description: |-
+ An OAuth access token that can be used with a remote MCP server, either
+ with a custom MCP server URL or a service connector. Your application
+ must handle the OAuth authorization flow and provide the token here.
+ server_description:
+ type: string
+ description: Optional description of the MCP server, used to provide more context.
+ headers:
+ anyOf:
+ - type: object
+ unevaluatedProperties:
+ type: string
+ - type: 'null'
+ allowed_tools:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ - type: 'null'
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ enum:
+ - always
+ - never
+ - type: 'null'
+ default: always
+ defer_loading:
+ type: boolean
+ description: Whether this MCP tool is deferred and discovered via tool search.
+ project_connection_id:
+ type: string
+ description: The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server.
+ tool_configs:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/ToolConfig'
+ description: Deprecated. This property is deprecated and will be removed in a future version.
+ deprecated: true
allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.InputMessageContentList:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputContent'
+ - $ref: '#/components/schemas/OpenAI.Tool'
description: |-
- A list of one or many input items to the model, containing different content
- types.
- title: Input item content list
- OpenAI.InputParam:
- oneOf:
- - type: string
- - type: array
+ Give the model access to additional tools via remote Model Context Protocol
+ (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).
+ title: MCP tool
+ OpenAI.MCPToolCallStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - calling
+ - failed
+ OpenAI.MCPToolFilter:
+ type: object
+ properties:
+ tool_names:
+ type: array
items:
- $ref: '#/components/schemas/OpenAI.InputItem'
- description: |-
- Text, image, or file inputs to the model, used to generate a response.
- Learn more:
- - [Text inputs and outputs](/docs/guides/text)
- - [Image inputs](/docs/guides/images)
- - [File inputs](/docs/guides/pdf-files)
- - [Conversation state](/docs/guides/conversation-state)
- - [Function calling](/docs/guides/function-calling)
- OpenAI.InputTextContent:
+ type: string
+ description: List of allowed tool names.
+ title: MCP allowed tools
+ read_only:
+ type: boolean
+ description: |-
+ Indicates whether or not a tool modifies data or is read-only. If an
+ MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
+ it will match this filter.
+ description: A filter object to specify which tools are allowed.
+ title: MCP tool filter
+ OpenAI.MCPToolRequireApproval:
+ type: object
+ properties:
+ always:
+ $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ never:
+ $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ OpenAI.MessageContent:
type: object
required:
- type
- - text
properties:
type:
- type: string
- enum:
- - input_text
- description: The type of the input item. Always `input_text`.
- x-stainless-const: true
- default: input_text
- text:
- type: string
- description: The text input to the model.
- description: A text input to the model.
- title: Input text
- OpenAI.InputTextContentParam:
+ $ref: '#/components/schemas/OpenAI.MessageContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ text: '#/components/schemas/OpenAI.TextContent'
+ computer_screenshot: '#/components/schemas/OpenAI.ComputerScreenshotContent'
+ input_text: '#/components/schemas/OpenAI.MessageContentInputTextContent'
+ output_text: '#/components/schemas/OpenAI.MessageContentOutputTextContent'
+ reasoning_text: '#/components/schemas/OpenAI.MessageContentReasoningTextContent'
+ refusal: '#/components/schemas/OpenAI.MessageContentRefusalContent'
+ input_image: '#/components/schemas/OpenAI.MessageContentInputImageContent'
+ input_file: '#/components/schemas/OpenAI.MessageContentInputFileContent'
+ summary_text: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: A content part that makes up an input or output item.
+ OpenAI.MessageContentImageFileObject:
type: object
required:
- type
- - text
+ - image_file
properties:
type:
type: string
enum:
- - input_text
- description: The type of the input item. Always `input_text`.
+ - image_file
+ description: Always `image_file`.
x-stainless-const: true
- default: input_text
- text:
- type: string
- maxLength: 10485760
- description: The text input to the model.
- description: A text input to the model.
- title: Input text
- OpenAI.Item:
+ image_file:
+ $ref: '#/components/schemas/OpenAI.MessageContentImageFileObjectImageFile'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: References an image [File](/docs/api-reference/files) in the content of a message.
+ title: Image file
+ OpenAI.MessageContentImageFileObjectImageFile:
type: object
required:
- - type
+ - file_id
properties:
- type:
- $ref: '#/components/schemas/OpenAI.ItemType'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OpenAI.ItemInputMessage'
- output_message: '#/components/schemas/OpenAI.ItemOutputMessage'
- file_search_call: '#/components/schemas/OpenAI.ItemFileSearchToolCall'
- computer_call: '#/components/schemas/OpenAI.ItemComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.ItemComputerCallOutputItemParam'
- web_search_call: '#/components/schemas/OpenAI.ItemWebSearchToolCall'
- function_call: '#/components/schemas/OpenAI.ItemFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.ItemFunctionCallOutputItemParam'
- tool_search_call: '#/components/schemas/OpenAI.ItemToolSearchCallItemParam'
- tool_search_output: '#/components/schemas/OpenAI.ItemToolSearchOutputItemParam'
- additional_tools: '#/components/schemas/OpenAI.ItemAdditionalToolsItemParam'
- reasoning: '#/components/schemas/OpenAI.ItemReasoningItem'
- compaction: '#/components/schemas/OpenAI.ItemCompactionSummaryItemParam'
- image_generation_call: '#/components/schemas/OpenAI.ItemImageGenToolCall'
- code_interpreter_call: '#/components/schemas/OpenAI.ItemCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.ItemLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.ItemLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.ItemFunctionShellCallItemParam'
- shell_call_output: '#/components/schemas/OpenAI.ItemFunctionShellCallOutputItemParam'
- apply_patch_call: '#/components/schemas/OpenAI.ItemApplyPatchToolCallItemParam'
- apply_patch_call_output: '#/components/schemas/OpenAI.ItemApplyPatchToolCallOutputItemParam'
- mcp_list_tools: '#/components/schemas/OpenAI.ItemMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.ItemMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.ItemMcpApprovalResponse'
- mcp_call: '#/components/schemas/OpenAI.ItemMcpToolCall'
- custom_tool_call_output: '#/components/schemas/OpenAI.ItemCustomToolCallOutput'
- custom_tool_call: '#/components/schemas/OpenAI.ItemCustomToolCall'
- description: Content item used to generate a response.
- OpenAI.ItemAdditionalToolsItemParam:
+ file_id:
+ type: string
+ detail:
+ type: string
+ enum:
+ - auto
+ - low
+ - high
+ default: auto
+ OpenAI.MessageContentImageUrlObject:
type: object
required:
- type
- - role
- - tools
+ - image_url
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
enum:
- - additional_tools
- description: The item type. Always `additional_tools`.
+ - image_url
+ description: The type of the content part.
x-stainless-const: true
- default: additional_tools
- role:
+ image_url:
+ $ref: '#/components/schemas/OpenAI.MessageContentImageUrlObjectImageUrl'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: References an image URL in the content of a message.
+ title: Image URL
+ OpenAI.MessageContentImageUrlObjectImageUrl:
+ type: object
+ required:
+ - url
+ properties:
+ url:
+ type: string
+ format: uri
+ detail:
type: string
enum:
- - developer
- description: The role that provided the additional tools. Only `developer` is supported.
- x-stainless-const: true
- default: developer
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: A list of additional tools made available at this item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- OpenAI.ItemApplyPatchToolCallItemParam:
+ - auto
+ - low
+ - high
+ default: auto
+ OpenAI.MessageContentInputFileContent:
type: object
required:
- type
- - call_id
- - status
- - operation
properties:
type:
type: string
enum:
- - apply_patch_call
- description: The type of the item. Always `apply_patch_call`.
+ - input_file
+ description: The type of the input item. Always `input_file`.
x-stainless-const: true
- default: apply_patch_call
- id:
+ default: input_file
+ file_id:
anyOf:
- type: string
- type: 'null'
- call_id:
+ filename:
type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatusParam'
- description: The status of the apply patch tool call. One of `in_progress` or `completed`.
- operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchOperationParam'
- description: The specific create, delete, or update instruction for the apply_patch tool call.
+ description: The name of the file to be sent to the model.
+ file_data:
+ type: string
+ description: The content of the file to be sent to the model.
+ file_url:
+ type: string
+ format: uri
+ description: The URL of the file to be sent to the model.
+ detail:
+ $ref: '#/components/schemas/OpenAI.FileInputDetail'
+ description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A tool call representing a request to create, delete, or update files using diff patches.
- title: Apply patch tool call
- OpenAI.ItemApplyPatchToolCallOutputItemParam:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A file input to the model.
+ title: Input file
+ OpenAI.MessageContentInputImageContent:
type: object
required:
- type
- - call_id
- - status
+ - detail
properties:
type:
type: string
enum:
- - apply_patch_call_output
- description: The type of the item. Always `apply_patch_call_output`.
+ - input_image
+ description: The type of the input item. Always `input_image`.
x-stainless-const: true
- default: apply_patch_call_output
- id:
+ default: input_image
+ image_url:
anyOf:
- type: string
+ format: uri
- type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatusParam'
- description: The status of the apply patch tool call output. One of `completed` or `failed`.
- output:
+ file_id:
anyOf:
- type: string
- type: 'null'
+ detail:
+ $ref: '#/components/schemas/OpenAI.ImageDetail'
+ description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The streamed output emitted by an apply patch tool call.
- title: Apply patch tool call output
- OpenAI.ItemCodeInterpreterToolCall:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
+ title: Input image
+ OpenAI.MessageContentInputTextContent:
type: object
required:
- type
- - id
- - status
- - container_id
- - code
- - outputs
+ - text
properties:
type:
type: string
enum:
- - code_interpreter_call
- description: The type of the code interpreter tool call. Always `code_interpreter_call`.
+ - input_text
+ description: The type of the input item. Always `input_text`.
x-stainless-const: true
- default: code_interpreter_call
- id:
- type: string
- description: The unique ID of the code interpreter tool call.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - interpreting
- - failed
- description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
- container_id:
+ default: input_text
+ text:
type: string
- description: The ID of the container used to run the code.
- code:
- anyOf:
- - type: string
- - type: 'null'
- outputs:
- anyOf:
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- - type: 'null'
+ description: The text input to the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A tool call to run code.
- title: Code interpreter tool call
- OpenAI.ItemCompactionSummaryItemParam:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A text input to the model.
+ title: Input text
+ OpenAI.MessageContentOutputTextContent:
type: object
required:
- type
- - encrypted_content
+ - text
+ - annotations
+ - logprobs
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
enum:
- - compaction
- description: The type of the item. Always `compaction`.
+ - output_text
+ description: The type of the output text. Always `output_text`.
x-stainless-const: true
- default: compaction
- encrypted_content:
+ default: output_text
+ text:
type: string
- maxLength: 10485760
- description: The encrypted content of the compaction summary.
+ description: The text output from the model.
+ annotations:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Annotation'
+ description: The annotations of the text output.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.LogProb'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
- title: Compaction item
- OpenAI.ItemComputerCallOutputItemParam:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A text output from the model.
+ title: Output text
+ OpenAI.MessageContentReasoningTextContent:
type: object
required:
- - call_id
- type
- - output
+ - text
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The ID of the computer tool call that produced the output.
type:
type: string
enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
+ - reasoning_text
+ description: The type of the reasoning text. Always `reasoning_text`.
x-stainless-const: true
- default: computer_call_output
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- acknowledged_safety_checks:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- - type: 'null'
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
+ default: reasoning_text
+ text:
+ type: string
+ description: The reasoning text from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.ItemComputerToolCall:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: Reasoning text from the model.
+ title: Reasoning text
+ OpenAI.MessageContentRefusalContent:
type: object
required:
- type
- - id
- - call_id
- - pending_safety_checks
- - status
+ - refusal
properties:
type:
type: string
enum:
- - computer_call
- description: The type of the computer call. Always `computer_call`.
- default: computer_call
- id:
- type: string
- description: The unique ID of the computer call.
- call_id:
- type: string
- description: An identifier used when responding to the tool call with output.
- action:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- actions:
- $ref: '#/components/schemas/OpenAI.ComputerActionList'
- pending_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: The pending safety checks for the computer call.
- status:
+ - refusal
+ description: The type of the refusal. Always `refusal`.
+ x-stainless-const: true
+ default: refusal
+ refusal:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ description: The refusal explanation from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: |-
- A tool call to a computer use tool. See the
- [computer use guide](/docs/guides/tools-computer-use) for more information.
- title: Computer tool call
- OpenAI.ItemCustomToolCall:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A refusal from the model.
+ title: Refusal
+ OpenAI.MessageContentRefusalObject:
type: object
required:
- type
- - call_id
- - name
- - input
+ - refusal
properties:
type:
type: string
enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
+ - refusal
+ description: Always `refusal`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
- type: string
- description: The name of the custom tool being called.
- input:
+ refusal:
type: string
- description: The input for the custom tool call generated by the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A call to a custom tool created by the model.
- title: Custom tool call
- OpenAI.ItemCustomToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: The refusal content generated by the assistant.
+ title: Refusal
+ OpenAI.MessageContentTextAnnotationsFileCitationObject:
type: object
required:
- type
- - call_id
- - output
+ - text
+ - file_citation
+ - start_index
+ - end_index
properties:
type:
type: string
enum:
- - custom_tool_call_output
- description: The type of the custom tool call output. Always `custom_tool_call_output`.
+ - file_citation
+ description: Always `file_citation`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call output in the OpenAI platform.
- call_id:
+ text:
type: string
- description: The call ID, used to map this custom tool call output to a custom tool call.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the custom tool call generated by your code.
- Can be a string or an list of output content.
+ description: The text in the message content that needs to be replaced.
+ file_citation:
+ $ref: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation'
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The output of a custom tool call from your code, being sent back to the model.
- title: Custom tool call output
- OpenAI.ItemField:
+ - $ref: '#/components/schemas/OpenAI.TextAnnotation'
+ description: 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.
+ title: File citation
+ OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation:
type: object
required:
- - type
+ - file_id
properties:
- type:
- $ref: '#/components/schemas/OpenAI.ItemFieldType'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OpenAI.ItemFieldMessage'
- function_call: '#/components/schemas/OpenAI.ItemFieldFunctionToolCall'
- tool_search_call: '#/components/schemas/OpenAI.ItemFieldToolSearchCall'
- tool_search_output: '#/components/schemas/OpenAI.ItemFieldToolSearchOutput'
- additional_tools: '#/components/schemas/OpenAI.ItemFieldAdditionalTools'
- function_call_output: '#/components/schemas/OpenAI.ItemFieldFunctionToolCallOutput'
- file_search_call: '#/components/schemas/OpenAI.ItemFieldFileSearchToolCall'
- web_search_call: '#/components/schemas/OpenAI.ItemFieldWebSearchToolCall'
- image_generation_call: '#/components/schemas/OpenAI.ItemFieldImageGenToolCall'
- computer_call: '#/components/schemas/OpenAI.ItemFieldComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.ItemFieldComputerToolCallOutput'
- reasoning: '#/components/schemas/OpenAI.ItemFieldReasoningItem'
- compaction: '#/components/schemas/OpenAI.ItemFieldCompactionBody'
- code_interpreter_call: '#/components/schemas/OpenAI.ItemFieldCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.ItemFieldLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.ItemFieldLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.ItemFieldFunctionShellCall'
- shell_call_output: '#/components/schemas/OpenAI.ItemFieldFunctionShellCallOutput'
- apply_patch_call: '#/components/schemas/OpenAI.ItemFieldApplyPatchToolCall'
- apply_patch_call_output: '#/components/schemas/OpenAI.ItemFieldApplyPatchToolCallOutput'
- mcp_list_tools: '#/components/schemas/OpenAI.ItemFieldMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.ItemFieldMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.ItemFieldMcpApprovalResponseResource'
- mcp_call: '#/components/schemas/OpenAI.ItemFieldMcpToolCall'
- custom_tool_call: '#/components/schemas/OpenAI.ItemFieldCustomToolCall'
- custom_tool_call_output: '#/components/schemas/OpenAI.ItemFieldCustomToolCallOutput'
- description: An item representing a message, tool call, tool output, reasoning, or other response element.
- OpenAI.ItemFieldAdditionalTools:
+ file_id:
+ type: string
+ OpenAI.MessageContentTextAnnotationsFilePathObject:
type: object
required:
- type
- - id
- - role
- - tools
+ - text
+ - file_path
+ - start_index
+ - end_index
properties:
type:
type: string
enum:
- - additional_tools
- description: The type of the item. Always `additional_tools`.
+ - file_path
+ description: Always `file_path`.
x-stainless-const: true
- default: additional_tools
- id:
+ text:
type: string
- description: The unique ID of the additional tools item.
- role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role that provided the additional tools.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The additional tool definitions made available at this item.
+ description: The text in the message content that needs to be replaced.
+ file_path:
+ $ref: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath'
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- OpenAI.ItemFieldApplyPatchToolCall:
+ - $ref: '#/components/schemas/OpenAI.TextAnnotation'
+ description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.
+ title: File path
+ OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath:
+ type: object
+ required:
+ - file_id
+ properties:
+ file_id:
+ type: string
+ OpenAI.MessageContentTextObject:
type: object
required:
- type
- - id
- - call_id
- - status
- - operation
+ - text
properties:
type:
type: string
enum:
- - apply_patch_call
- description: The type of the item. Always `apply_patch_call`.
+ - text
+ description: Always `text`.
x-stainless-const: true
- default: apply_patch_call
- id:
- type: string
- description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
- description: The status of the apply patch tool call. One of `in_progress` or `completed`.
- operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
- title: Apply patch operation
- created_by:
- type: string
- description: The ID of the entity that created this tool call.
+ text:
+ $ref: '#/components/schemas/OpenAI.MessageContentTextObjectText'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A tool call that applies file diffs by creating, deleting, or updating files.
- title: Apply patch tool call
- OpenAI.ItemFieldApplyPatchToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: The text content that is part of a message.
+ title: Text
+ OpenAI.MessageContentTextObjectText:
type: object
required:
- - type
- - id
- - call_id
- - status
+ - value
+ - annotations
properties:
- type:
+ value:
type: string
+ annotations:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.TextAnnotation'
+ OpenAI.MessageContentType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - apply_patch_call_output
- description: The type of the item. Always `apply_patch_call_output`.
- x-stainless-const: true
- default: apply_patch_call_output
- id:
- type: string
- description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
- description: The status of the apply patch tool call output. One of `completed` or `failed`.
- output:
- anyOf:
- - type: string
- - type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call output.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output emitted by an apply patch tool call.
- title: Apply patch tool call output
- OpenAI.ItemFieldCodeInterpreterToolCall:
+ - input_text
+ - output_text
+ - text
+ - summary_text
+ - reasoning_text
+ - refusal
+ - input_image
+ - computer_screenshot
+ - input_file
+ OpenAI.MessageObject:
type: object
required:
- - type
- id
+ - object
+ - created_at
+ - thread_id
- status
- - container_id
- - code
- - outputs
+ - incomplete_details
+ - completed_at
+ - incomplete_at
+ - role
+ - content
+ - assistant_id
+ - run_id
+ - attachments
+ - metadata
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - code_interpreter_call
- description: The type of the code interpreter tool call. Always `code_interpreter_call`.
+ - thread.message
+ description: The object type, which is always `thread.message`.
x-stainless-const: true
- default: code_interpreter_call
- id:
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the message was created.
+ thread_id:
type: string
- description: The unique ID of the code interpreter tool call.
+ description: The [thread](/docs/api-reference/threads) ID that this message belongs to.
status:
type: string
enum:
- in_progress
- - completed
- incomplete
- - interpreting
- - failed
- description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
- container_id:
+ - completed
+ description: The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.
+ incomplete_details:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MessageObjectIncompleteDetails'
+ - type: 'null'
+ completed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ incomplete_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ role:
type: string
- description: The ID of the container used to run the code.
- code:
+ enum:
+ - user
+ - assistant
+ description: The entity that produced the message. One of `user` or `assistant`.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.MessageObjectContent'
+ description: The content of the message in array of text and/or images.
+ assistant_id:
anyOf:
- type: string
- type: 'null'
- outputs:
+ run_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ attachments:
anyOf:
- type: array
items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
+ $ref: '#/components/schemas/OpenAI.MessageObjectAttachments'
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A tool call to run code.
- title: Code interpreter tool call
- OpenAI.ItemFieldCompactionBody:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: Represents a message within a [thread](/docs/api-reference/threads).
+ title: The message object
+ x-oaiMeta:
+ name: The message object
+ beta: true
+ example: |
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1698983503,
+ "thread_id": "thread_abc123",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "Hi! How can I help you today?",
+ "annotations": []
+ }
+ }
+ ],
+ "assistant_id": "asst_abc123",
+ "run_id": "run_abc123",
+ "attachments": [],
+ "metadata": {}
+ }
+ OpenAI.MessageObjectAttachments:
+ type: object
+ properties:
+ file_id:
+ type: string
+ tools:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantToolsCode'
+ - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly'
+ OpenAI.MessageObjectContent:
type: object
required:
- type
- - id
- - encrypted_content
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.MessageObjectContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ image_url: '#/components/schemas/OpenAI.MessageContentImageUrlObject'
+ text: '#/components/schemas/OpenAI.MessageContentTextObject'
+ refusal: '#/components/schemas/OpenAI.MessageContentRefusalObject'
+ image_file: '#/components/schemas/OpenAI.MessageContentImageFileObject'
+ OpenAI.MessageObjectContentType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - compaction
- description: The type of the item. Always `compaction`.
- x-stainless-const: true
- default: compaction
- id:
- type: string
- description: The unique ID of the compaction item.
- encrypted_content:
- type: string
- description: The encrypted content that was produced by compaction.
- created_by:
+ - image_file
+ - image_url
+ - text
+ - refusal
+ OpenAI.MessageObjectIncompleteDetails:
+ type: object
+ required:
+ - reason
+ properties:
+ reason:
type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
- title: Compaction item
- OpenAI.ItemFieldComputerToolCall:
+ enum:
+ - content_filter
+ - max_tokens
+ - run_cancelled
+ - run_expired
+ - run_failed
+ OpenAI.MessagePhase:
+ type: string
+ enum:
+ - commentary
+ - final_answer
+ description: |-
+ Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
+ For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
+ phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
+ OpenAI.MessageRequestContentTextObject:
type: object
required:
- type
- - id
- - call_id
- - pending_safety_checks
- - status
+ - text
properties:
type:
type: string
enum:
- - computer_call
- description: The type of the computer call. Always `computer_call`.
- default: computer_call
+ - text
+ description: Always `text`.
+ x-stainless-const: true
+ text:
+ type: string
+ description: Text content to be sent to the model
+ description: The text content that is part of a message.
+ title: Text
+ OpenAI.MessageRole:
+ type: string
+ enum:
+ - unknown
+ - user
+ - assistant
+ - system
+ - critic
+ - discriminator
+ - developer
+ - tool
+ OpenAI.MessageStatus:
+ type: string
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ OpenAI.Metadata:
+ type: object
+ unevaluatedProperties:
+ type: string
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard.
+ Keys are strings with a maximum length of 64 characters. Values are strings
+ with a maximum length of 512 characters.
+ x-oaiTypeLabel: map
+ OpenAI.Model:
+ type: object
+ required:
+ - id
+ - created
+ - object
+ - owned_by
+ properties:
id:
type: string
- description: The unique ID of the computer call.
- call_id:
+ description: The model identifier, which can be referenced in the API endpoints.
+ created:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) when the model was created.
+ object:
type: string
- description: An identifier used when responding to the tool call with output.
- action:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- actions:
- $ref: '#/components/schemas/OpenAI.ComputerActionList'
- pending_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: The pending safety checks for the computer call.
- status:
+ enum:
+ - model
+ description: The object type, which is always "model".
+ x-stainless-const: true
+ owned_by:
type: string
+ description: The organization that owns the model.
+ description: Describes an OpenAI model offering that can be used with the API.
+ title: Model
+ x-oaiMeta:
+ name: The model object
+ example: |
+ {
+ "id": "VAR_chat_model_id",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "openai"
+ }
+ OpenAI.Moderation:
+ type: object
+ required:
+ - input
+ - output
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.ModerationEntry'
+ description: Moderation for the response input.
+ output:
+ $ref: '#/components/schemas/OpenAI.ModerationEntry'
+ description: Moderation for the response output.
+ description: Moderation results or errors for the response input and output.
+ title: Moderation
+ OpenAI.ModerationCategoryInputType:
+ type: string
+ enum:
+ - text
+ - image
+ description: The applied input type(s) for the category.
+ OpenAI.ModerationEntry:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.ModerationEntryType'
+ discriminator:
+ propertyName: type
+ mapping:
+ error: '#/components/schemas/OpenAI.ModerationErrorBody'
+ moderation_result: '#/components/schemas/OpenAI.ModerationResultBody'
+ description: Moderation results or an error for a response moderation check.
+ OpenAI.ModerationEntryType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: |-
- A tool call to a computer use tool. See the
- [computer use guide](/docs/guides/tools-computer-use) for more information.
- title: Computer tool call
- OpenAI.ItemFieldComputerToolCallOutput:
+ - moderation_result
+ - error
+ OpenAI.ModerationErrorBody:
type: object
required:
- type
- - id
- - call_id
- - output
+ - code
+ - message
properties:
type:
type: string
enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
+ - error
+ description: The object type, which was always `error` for moderation failures.
x-stainless-const: true
- default: computer_call_output
- id:
- type: string
- description: The ID of the computer tool call output.
- readOnly: true
- call_id:
+ code:
type: string
- description: The ID of the computer tool call that produced the output.
- acknowledged_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: |-
- The safety checks reported by the API that have been acknowledged by the
- developer.
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- status:
+ description: The error code.
+ message:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
+ description: The error message.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.ItemFieldCustomToolCall:
+ - $ref: '#/components/schemas/OpenAI.ModerationEntry'
+ description: An error produced while attempting moderation for the response input or output.
+ title: Moderation error
+ OpenAI.ModerationImageURLInput:
type: object
required:
- type
- - call_id
- - name
- - input
+ - image_url
properties:
type:
type: string
enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
+ - image_url
+ description: Always `image_url`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
+ image_url:
+ $ref: '#/components/schemas/OpenAI.ModerationImageURLInputImageUrl'
+ description: Contains either an image URL or a data URL for a base64 encoded image.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CreateModerationRequestInput'
+ description: An object describing an image to classify.
+ OpenAI.ModerationImageURLInputImageUrl:
+ type: object
+ required:
+ - url
+ properties:
+ url:
type: string
- description: The name of the custom tool being called.
- input:
+ format: uri
+ OpenAI.ModerationInputType:
+ type: string
+ enum:
+ - text
+ - image
+ OpenAI.ModerationParam:
+ type: object
+ required:
+ - model
+ properties:
+ model:
type: string
- description: The input for the custom tool call generated by the model.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A call to a custom tool created by the model.
- title: Custom tool call
- OpenAI.ItemFieldCustomToolCallOutput:
+ description: The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.
+ description: Configuration for running moderation on the input and output of this response.
+ OpenAI.ModerationResultBody:
type: object
required:
- type
- - call_id
- - output
+ - model
+ - flagged
+ - categories
+ - category_scores
+ - category_applied_input_types
properties:
type:
type: string
enum:
- - custom_tool_call_output
- description: The type of the custom tool call output. Always `custom_tool_call_output`.
+ - moderation_result
+ description: The object type, which was always `moderation_result` for successful moderation results.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call output in the OpenAI platform.
- call_id:
+ model:
type: string
- description: The call ID, used to map this custom tool call output to a custom tool call.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the custom tool call generated by your code.
- Can be a string or an list of output content.
+ description: The moderation model that produced this result.
+ flagged:
+ type: boolean
+ description: A boolean indicating whether the content was flagged by any category.
+ categories:
+ type: object
+ unevaluatedProperties:
+ type: boolean
+ description: A dictionary of moderation categories to booleans, True if the input is flagged under this category.
+ x-oaiTypeLabel: map
+ category_scores:
+ type: object
+ unevaluatedProperties:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: A dictionary of moderation categories to scores.
+ x-oaiTypeLabel: map
+ category_applied_input_types:
+ type: object
+ unevaluatedProperties:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ModerationInputType'
+ description: Which modalities of input are reflected by the score for each category.
+ x-oaiTypeLabel: map
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a custom tool call from your code, being sent back to the model.
- title: Custom tool call output
- OpenAI.ItemFieldFileSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.ModerationEntry'
+ description: A moderation result produced for the response input or output.
+ title: Moderation result
+ OpenAI.ModerationTextInput:
type: object
required:
- - id
- type
- - status
- - queries
+ - text
properties:
- id:
- type: string
- description: The unique ID of the file search tool call.
type:
type: string
enum:
- - file_search_call
- description: The type of the file search tool call. Always `file_search_call`.
+ - text
+ description: Always `text`.
x-stainless-const: true
- status:
+ text:
type: string
- enum:
- - in_progress
- - searching
- - completed
- - incomplete
- - failed
- description: |-
- The status of the file search tool call. One of `in_progress`,
- `searching`, `incomplete` or `failed`,
- queries:
+ description: A string of text to classify.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CreateModerationRequestInput'
+ description: An object describing text to classify.
+ OpenAI.ModifyAssistantRequest:
+ type: object
+ properties:
+ model:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.AssistantSupportedModels'
+ description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.
+ reasoning_effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ instructions:
+ anyOf:
+ - type: string
+ - type: 'null'
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ maxItems: 128
+ description: 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`.
+ default: []
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ModifyAssistantRequestToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ response_format:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ - type: 'null'
+ OpenAI.ModifyAssistantRequestToolResources:
+ type: object
+ properties:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.ModifyAssistantRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.ModifyAssistantRequestToolResourcesFileSearch'
+ OpenAI.ModifyAssistantRequestToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
type: array
items:
type: string
- description: The queries used to search for files.
- results:
+ maxItems: 20
+ OpenAI.ModifyAssistantRequestToolResourcesFileSearch:
+ type: object
+ properties:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ OpenAI.ModifyMessageRequest:
+ type: object
+ properties:
+ metadata:
anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
+ - $ref: '#/components/schemas/OpenAI.Metadata'
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: |-
- The results of a file search tool call. See the
- [file search guide](/docs/guides/tools-file-search) for more information.
- title: File search tool call
- OpenAI.ItemFieldFunctionShellCall:
+ OpenAI.ModifyRunRequest:
+ type: object
+ properties:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.ModifyThreadRequest:
+ type: object
+ properties:
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.ModifyThreadRequestToolResources:
+ type: object
+ properties:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesFileSearch'
+ OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 20
+ OpenAI.ModifyThreadRequestToolResourcesFileSearch:
+ type: object
+ properties:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ OpenAI.MoveParam:
type: object
required:
- type
- - id
- - call_id
- - action
- - status
- - environment
+ - x
+ - 'y'
properties:
type:
type: string
enum:
- - shell_call
- description: The type of the item. Always `shell_call`.
+ - move
+ description: Specifies the event type. For a move action, this property is always set to `move`.
x-stainless-const: true
- default: shell_call
- id:
- type: string
- description: The unique ID of the shell tool call. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.FunctionShellAction'
- description: The shell commands and limits that describe how to run the tool call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
- description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
- environment:
+ x:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The x-coordinate to move to.
+ 'y':
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The y-coordinate to move to.
+ keys:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ - type: array
+ items:
+ type: string
- type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A tool call that executes one or more shell commands in a managed environment.
- title: Shell tool call
- OpenAI.ItemFieldFunctionShellCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A mouse move action.
+ title: Move
+ OpenAI.NamespaceToolParam:
type: object
required:
- type
- - id
- - call_id
- - status
- - output
- - max_output_length
+ - name
+ - description
+ - tools
properties:
type:
type: string
enum:
- - shell_call_output
- description: The type of the shell call output. Always `shell_call_output`.
+ - namespace
+ description: The type of the tool. Always `namespace`.
x-stainless-const: true
- default: shell_call_output
- id:
+ name:
type: string
- description: The unique ID of the shell call output. Populated when this item is returned via API.
- call_id:
+ minLength: 1
+ description: The namespace name used in tool calls (for example, `crm`).
+ description:
type: string
- description: The unique ID of the shell tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
- description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
- output:
+ minLength: 1
+ description: A description of the namespace shown to the model.
+ tools:
type: array
items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
- description: An array of shell call output contents
- max_output_length:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- created_by:
- type: string
- description: The identifier of the actor that created the item.
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.FunctionToolParam'
+ - $ref: '#/components/schemas/OpenAI.CustomToolParam'
+ minItems: 1
+ description: The function/custom tools available inside this namespace.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a shell tool call that was emitted.
- title: Shell call output
- OpenAI.ItemFieldFunctionToolCall:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: Groups function/custom tools under a shared namespace.
+ title: Namespace
+ OpenAI.NoiseReductionType:
+ type: string
+ enum:
+ - near_field
+ - far_field
+ description: 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.
+ OpenAI.OpenAIFile:
type: object
required:
- id
- - type
- - call_id
- - name
- - arguments
+ - bytes
+ - created_at
+ - filename
+ - object
+ - purpose
+ - status
properties:
id:
type: string
- description: The unique ID of the function tool call.
- readOnly: true
- type:
+ description: The file identifier, which can be referenced in the API endpoints.
+ bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The size of the file, in bytes.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the file was created.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the file will expire.
+ filename:
+ type: string
+ description: The name of the file.
+ object:
type: string
enum:
- - function_call
- description: The type of the function tool call. Always `function_call`.
+ - file
+ description: The object type, which is always `file`.
x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- namespace:
- type: string
- description: The namespace of the function to run.
- name:
- type: string
- description: The name of the function to run.
- arguments:
- type: string
- description: A JSON string of the arguments to pass to the function.
+ purpose:
+ type: string
+ enum:
+ - assistants
+ - assistants_output
+ - batch
+ - batch_output
+ - fine-tune
+ - fine-tune-results
+ - vision
+ - user_data
+ description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
status:
type: string
enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: |-
- A tool call to run a function. See the
- [function calling guide](/docs/guides/function-calling) for more information.
- title: Function tool call
- OpenAI.ItemFieldFunctionToolCallOutput:
+ - uploaded
+ - processed
+ - error
+ description: Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
+ deprecated: true
+ status_details:
+ type: string
+ description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.
+ deprecated: true
+ description: The `File` object represents a document that has been uploaded to OpenAI.
+ title: OpenAIFile
+ x-oaiMeta:
+ name: The file object
+ example: |
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 120000,
+ "created_at": 1677610602,
+ "expires_at": 1680202602,
+ "filename": "salesOverview.pdf",
+ "purpose": "assistants",
+ }
+ OpenAI.OrderEnum:
+ type: string
+ enum:
+ - asc
+ - desc
+ OpenAI.OtherChunkingStrategyResponseParam:
type: object
required:
- - id
- type
- - call_id
- - output
properties:
- id:
- type: string
- description: |-
- The unique ID of the function tool call output. Populated when this item
- is returned via API.
- readOnly: true
type:
type: string
enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
+ - other
+ description: Always `other`.
x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the function call generated by your code.
- Can be a string or an list of output content.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.ItemFieldImageGenToolCall:
+ - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse'
+ description: 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.
+ title: Other Chunking Strategy
+ OpenAI.OutputContent:
type: object
required:
- type
- - id
- - status
- - result
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.OutputContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ output_text: '#/components/schemas/OpenAI.OutputContentOutputTextContent'
+ refusal: '#/components/schemas/OpenAI.OutputContentRefusalContent'
+ reasoning_text: '#/components/schemas/OpenAI.OutputContentReasoningTextContent'
+ OpenAI.OutputContentOutputTextContent:
+ type: object
+ required:
+ - type
+ - text
+ - annotations
+ - logprobs
properties:
type:
type: string
enum:
- - image_generation_call
- description: The type of the image generation call. Always `image_generation_call`.
+ - output_text
+ description: The type of the output text. Always `output_text`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the image generation call.
- status:
+ default: output_text
+ text:
type: string
- enum:
- - in_progress
- - completed
- - generating
- - failed
- description: The status of the image generation call.
- result:
- anyOf:
- - type: string
- - type: 'null'
+ description: The text output from the model.
+ annotations:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Annotation'
+ description: The annotations of the text output.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.LogProb'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: An image generation request made by the model.
- title: Image generation call
- OpenAI.ItemFieldLocalShellToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: A text output from the model.
+ title: Output text
+ OpenAI.OutputContentReasoningTextContent:
type: object
required:
- type
- - id
- - call_id
- - action
- - status
+ - text
properties:
type:
type: string
enum:
- - local_shell_call
- description: The type of the local shell call. Always `local_shell_call`.
+ - reasoning_text
+ description: The type of the reasoning text. Always `reasoning_text`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell call.
- call_id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
- status:
+ default: reasoning_text
+ text:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: The status of the local shell call.
+ description: The reasoning text from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A tool call to run a command on the local shell.
- title: Local shell call
- OpenAI.ItemFieldLocalShellToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: Reasoning text from the model.
+ title: Reasoning text
+ OpenAI.OutputContentRefusalContent:
type: object
required:
- type
- - id
- - output
+ - refusal
properties:
type:
type: string
enum:
- - local_shell_call_output
- description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ - refusal
+ description: The type of the refusal. Always `refusal`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- output:
+ default: refusal
+ refusal:
type: string
- description: A JSON string of the output of the local shell tool call.
- status:
+ description: The refusal explanation from the model.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: A refusal from the model.
+ title: Refusal
+ OpenAI.OutputContentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - output_text
+ - refusal
+ - reasoning_text
+ OpenAI.OutputItem:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.OutputItemType'
+ created_by:
anyOf:
+ - $ref: '#/components/schemas/CreatedBy'
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: The output of a local shell tool call.
- title: Local shell call output
- OpenAI.ItemFieldMcpApprovalRequest:
+ description: The information about the creator of the item
+ agent_reference:
+ $ref: '#/components/schemas/AgentReference'
+ description: The agent that created the item.
+ response_id:
+ type: string
+ description: The response on which the item is created.
+ discriminator:
+ propertyName: type
+ mapping:
+ structured_outputs: '#/components/schemas/StructuredOutputsOutputItem'
+ workflow_action: '#/components/schemas/WorkflowActionOutputItem'
+ oauth_consent_request: '#/components/schemas/OAuthConsentRequestOutputItem'
+ bing_grounding_call: '#/components/schemas/BingGroundingToolCall'
+ bing_grounding_call_output: '#/components/schemas/BingGroundingToolCallOutput'
+ sharepoint_grounding_preview_call: '#/components/schemas/SharepointGroundingToolCall'
+ sharepoint_grounding_preview_call_output: '#/components/schemas/SharepointGroundingToolCallOutput'
+ azure_ai_search_call: '#/components/schemas/AzureAISearchToolCall'
+ azure_ai_search_call_output: '#/components/schemas/AzureAISearchToolCallOutput'
+ bing_custom_search_preview_call: '#/components/schemas/BingCustomSearchToolCall'
+ bing_custom_search_preview_call_output: '#/components/schemas/BingCustomSearchToolCallOutput'
+ openapi_call: '#/components/schemas/OpenApiToolCall'
+ openapi_call_output: '#/components/schemas/OpenApiToolCallOutput'
+ browser_automation_preview_call: '#/components/schemas/BrowserAutomationToolCall'
+ browser_automation_preview_call_output: '#/components/schemas/BrowserAutomationToolCallOutput'
+ fabric_dataagent_preview_call: '#/components/schemas/FabricDataAgentToolCall'
+ fabric_dataagent_preview_call_output: '#/components/schemas/FabricDataAgentToolCallOutput'
+ azure_function_call: '#/components/schemas/AzureFunctionToolCall'
+ azure_function_call_output: '#/components/schemas/AzureFunctionToolCallOutput'
+ a2a_preview_call: '#/components/schemas/A2AToolCall'
+ a2a_preview_call_output: '#/components/schemas/A2AToolCallOutput'
+ memory_search_call: '#/components/schemas/MemorySearchToolCall'
+ memory_command_preview_call: '#/components/schemas/MemoryCommandToolCall'
+ memory_command_preview_call_output: '#/components/schemas/MemoryCommandToolCallOutput'
+ output_message: '#/components/schemas/OpenAI.OutputItemOutputMessage'
+ file_search_call: '#/components/schemas/OpenAI.OutputItemFileSearchToolCall'
+ function_call: '#/components/schemas/OpenAI.OutputItemFunctionToolCall'
+ function_call_output: '#/components/schemas/OpenAI.OutputItemFunctionToolCallOutput'
+ web_search_call: '#/components/schemas/OpenAI.OutputItemWebSearchToolCall'
+ computer_call: '#/components/schemas/OpenAI.OutputItemComputerToolCall'
+ computer_call_output: '#/components/schemas/OpenAI.OutputItemComputerToolCallOutput'
+ reasoning: '#/components/schemas/OpenAI.OutputItemReasoningItem'
+ tool_search_call: '#/components/schemas/OpenAI.OutputItemToolSearchCall'
+ tool_search_output: '#/components/schemas/OpenAI.OutputItemToolSearchOutput'
+ additional_tools: '#/components/schemas/OpenAI.OutputItemAdditionalTools'
+ compaction: '#/components/schemas/OpenAI.OutputItemCompactionBody'
+ image_generation_call: '#/components/schemas/OpenAI.OutputItemImageGenToolCall'
+ code_interpreter_call: '#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall'
+ local_shell_call: '#/components/schemas/OpenAI.OutputItemLocalShellToolCall'
+ local_shell_call_output: '#/components/schemas/OpenAI.OutputItemLocalShellToolCallOutput'
+ shell_call: '#/components/schemas/OpenAI.OutputItemFunctionShellCall'
+ shell_call_output: '#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput'
+ apply_patch_call: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCall'
+ apply_patch_call_output: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput'
+ mcp_call: '#/components/schemas/OpenAI.OutputItemMcpToolCall'
+ mcp_list_tools: '#/components/schemas/OpenAI.OutputItemMcpListTools'
+ mcp_approval_request: '#/components/schemas/OpenAI.OutputItemMcpApprovalRequest'
+ mcp_approval_response: '#/components/schemas/OpenAI.OutputItemMcpApprovalResponseResource'
+ custom_tool_call: '#/components/schemas/OpenAI.OutputItemCustomToolCallResource'
+ custom_tool_call_output: '#/components/schemas/OpenAI.OutputItemCustomToolCallOutputResource'
+ OpenAI.OutputItemAdditionalTools:
type: object
required:
- type
- id
- - server_label
- - name
- - arguments
+ - role
+ - tools
properties:
type:
type: string
enum:
- - mcp_approval_request
- description: The type of the item. Always `mcp_approval_request`.
+ - additional_tools
+ description: The type of the item. Always `additional_tools`.
x-stainless-const: true
+ default: additional_tools
id:
type: string
- description: The unique ID of the approval request.
- server_label:
- type: string
- description: The label of the MCP server making the request.
- name:
- type: string
- description: The name of the tool to run.
- arguments:
- type: string
- description: A JSON string of arguments for the tool.
+ description: The unique ID of the additional tools item.
+ role:
+ $ref: '#/components/schemas/OpenAI.MessageRole'
+ description: The role that provided the additional tools.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The additional tool definitions made available at this item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A request for human approval of a tool invocation.
- title: MCP approval request
- OpenAI.ItemFieldMcpApprovalResponseResource:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ OpenAI.OutputItemApplyPatchToolCall:
type: object
required:
- type
- id
- - approval_request_id
- - approve
+ - call_id
+ - status
+ - operation
properties:
type:
type: string
enum:
- - mcp_approval_response
- description: The type of the item. Always `mcp_approval_response`.
+ - apply_patch_call
+ description: The type of the item. Always `apply_patch_call`.
x-stainless-const: true
+ default: apply_patch_call
id:
type: string
- description: The unique ID of the approval response
- approval_request_id:
+ description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
+ call_id:
type: string
- description: The ID of the approval request being answered.
- approve:
- type: boolean
- description: Whether the request was approved.
- reason:
- anyOf:
- - type: string
- - type: 'null'
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
+ description: The status of the apply patch tool call. One of `in_progress` or `completed`.
+ operation:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
+ description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
+ title: Apply patch operation
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A response to an MCP approval request.
- title: MCP approval response
- OpenAI.ItemFieldMcpListTools:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A tool call that applies file diffs by creating, deleting, or updating files.
+ title: Apply patch tool call
+ OpenAI.OutputItemApplyPatchToolCallOutput:
type: object
required:
- type
- id
- - server_label
- - tools
+ - call_id
+ - status
properties:
type:
type: string
enum:
- - mcp_list_tools
- description: The type of the item. Always `mcp_list_tools`.
+ - apply_patch_call_output
+ description: The type of the item. Always `apply_patch_call_output`.
x-stainless-const: true
+ default: apply_patch_call_output
id:
type: string
- description: The unique ID of the list.
- server_label:
+ description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
+ call_id:
type: string
- description: The label of the MCP server.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
- description: The tools available on the server.
- error:
- $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ description: The unique ID of the apply patch tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
+ description: The status of the apply patch tool call output. One of `completed` or `failed`.
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call output.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A list of tools available on an MCP server.
- title: MCP list tools
- OpenAI.ItemFieldMcpToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output emitted by an apply patch tool call.
+ title: Apply patch tool call output
+ OpenAI.OutputItemCodeInterpreterToolCall:
type: object
required:
- - type
- - id
- - server_label
- - name
- - arguments
+ - type
+ - id
+ - status
+ - container_id
+ - code
+ - outputs
properties:
type:
type: string
enum:
- - mcp_call
- description: The type of the item. Always `mcp_call`.
+ - code_interpreter_call
+ description: The type of the code interpreter tool call. Always `code_interpreter_call`.
x-stainless-const: true
+ default: code_interpreter_call
id:
type: string
- description: The unique ID of the tool call.
- server_label:
- type: string
- description: The label of the MCP server running the tool.
- name:
+ description: The unique ID of the code interpreter tool call.
+ status:
type: string
- description: The name of the tool that was run.
- arguments:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ - interpreting
+ - failed
+ description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
+ container_id:
type: string
- description: A JSON string of the arguments passed to the tool.
- output:
+ description: The ID of the container used to run the code.
+ code:
anyOf:
- type: string
- type: 'null'
- error:
- type: object
- unevaluatedProperties: {}
- status:
- $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
- description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
- approval_request_id:
+ outputs:
anyOf:
- - type: string
+ - type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
+ - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: An invocation of a tool on an MCP server.
- title: MCP tool call
- OpenAI.ItemFieldMessage:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A tool call to run code.
+ title: Code interpreter tool call
+ OpenAI.OutputItemCompactionBody:
type: object
required:
- type
- id
- - status
- - role
- - content
+ - encrypted_content
properties:
type:
type: string
enum:
- - message
- description: The type of the message. Always set to `message`.
+ - compaction
+ description: The type of the item. Always `compaction`.
x-stainless-const: true
- default: message
+ default: compaction
id:
type: string
- description: The unique ID of the message.
- status:
- $ref: '#/components/schemas/OpenAI.MessageStatus'
- description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
- role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`.
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.MessageContent'
- description: The content of the message
- phase:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
- - type: 'null'
+ description: The unique ID of the compaction item.
+ encrypted_content:
+ type: string
+ description: The encrypted content that was produced by compaction.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: A message to or from the model.
- title: Message
- OpenAI.ItemFieldReasoningItem:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
+ title: Compaction item
+ OpenAI.OutputItemComputerToolCall:
type: object
required:
- type
- id
- - summary
+ - call_id
+ - pending_safety_checks
+ - status
properties:
type:
type: string
enum:
- - reasoning
- description: The type of the object. Always `reasoning`.
- x-stainless-const: true
+ - computer_call
+ description: The type of the computer call. Always `computer_call`.
+ default: computer_call
id:
type: string
- description: The unique identifier of the reasoning content.
- encrypted_content:
- anyOf:
- - type: string
- - type: 'null'
- summary:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.SummaryTextContent'
- description: Reasoning summary content.
- content:
+ description: The unique ID of the computer call.
+ call_id:
+ type: string
+ description: An identifier used when responding to the tool call with output.
+ action:
+ $ref: '#/components/schemas/OpenAI.ComputerAction'
+ actions:
+ $ref: '#/components/schemas/OpenAI.ComputerActionList'
+ pending_safety_checks:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
- description: Reasoning text content.
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: The pending safety checks for the computer call.
status:
type: string
enum:
@@ -29409,162 +65678,137 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: |-
- A description of the chain of thought used by a reasoning model while generating
- a response. Be sure to include these items in your `input` to the Responses API
- for subsequent turns of a conversation if you are manually
- [managing context](/docs/guides/conversation-state).
- title: Reasoning
- OpenAI.ItemFieldToolSearchCall:
+ A tool call to a computer use tool. See the
+ [computer use guide](/docs/guides/tools-computer-use) for more information.
+ title: Computer tool call
+ OpenAI.OutputItemComputerToolCallOutput:
type: object
required:
- type
- id
- call_id
- - execution
- - arguments
- - status
+ - output
properties:
type:
type: string
enum:
- - tool_search_call
- description: The type of the item. Always `tool_search_call`.
+ - computer_call_output
+ description: The type of the computer tool call output. Always `computer_call_output`.
x-stainless-const: true
- default: tool_search_call
+ default: computer_call_output
id:
type: string
- description: The unique ID of the tool search call item.
+ description: The ID of the computer tool call output.
+ readOnly: true
call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- arguments:
- description: Arguments used for the tool search call.
+ type: string
+ description: The ID of the computer tool call that produced the output.
+ acknowledged_safety_checks:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
+ description: |-
+ The safety checks reported by the API that have been acknowledged by the
+ developer.
+ output:
+ $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: The status of the tool search call item that was recorded.
- created_by:
type: string
- description: The identifier of the actor that created the item.
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ description: |-
+ The status of the message input. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when input items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- OpenAI.ItemFieldToolSearchOutput:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a computer tool call.
+ title: Computer tool call output
+ OpenAI.OutputItemCustomToolCallOutputResource:
type: object
required:
- type
- - id
- call_id
- - execution
- - tools
+ - output
- status
properties:
type:
type: string
enum:
- - tool_search_output
- description: The type of the item. Always `tool_search_output`.
+ - custom_tool_call_output
+ description: The type of the custom tool call output. Always `custom_tool_call_output`.
x-stainless-const: true
- default: tool_search_output
id:
type: string
- description: The unique ID of the tool search output item.
+ description: The unique ID of the custom tool call output in the OpenAI platform.
call_id:
- anyOf:
+ type: string
+ description: The call ID, used to map this custom tool call output to a custom tool call.
+ output:
+ oneOf:
- type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by tool search.
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the custom tool call generated by your code.
+ Can be a string or an list of output content.
status:
$ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: The status of the tool search output item that was recorded.
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
created_by:
type: string
description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- OpenAI.ItemFieldType:
- anyOf:
- - type: string
- - type: string
- enum:
- - message
- - function_call
- - tool_search_call
- - tool_search_output
- - additional_tools
- - function_call_output
- - file_search_call
- - web_search_call
- - image_generation_call
- - computer_call
- - computer_call_output
- - reasoning
- - compaction
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - mcp_call
- - custom_tool_call
- - custom_tool_call_output
- OpenAI.ItemFieldWebSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ title: ResponseCustomToolCallOutputItem
+ OpenAI.OutputItemCustomToolCallResource:
type: object
required:
- - id
- type
+ - call_id
+ - name
+ - input
- status
- - action
properties:
- id:
- type: string
- description: The unique ID of the web search tool call.
type:
type: string
enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
+ - custom_tool_call
+ description: The type of the custom tool call. Always `custom_tool_call`.
x-stainless-const: true
- status:
+ id:
type: string
- enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ description: The unique ID of the custom tool call in the OpenAI platform.
+ call_id:
+ type: string
+ description: An identifier used to map this custom tool call to a tool call output.
+ namespace:
+ type: string
+ description: The namespace of the custom tool being called.
+ name:
+ type: string
+ description: The name of the custom tool being called.
+ input:
+ type: string
+ description: The input for the custom tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
description: |-
- 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_in_page).
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemField'
- description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.ItemFileSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ title: ResponseCustomToolCallItem
+ OpenAI.OutputItemFileSearchToolCall:
type: object
required:
- id
@@ -29604,68 +65848,21 @@ components:
$ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: |-
The results of a file search tool call. See the
[file search guide](/docs/guides/tools-file-search) for more information.
title: File search tool call
- OpenAI.ItemFunctionCallOutputItemParam:
+ OpenAI.OutputItemFunctionShellCall:
type: object
required:
- - call_id
- type
- - output
- properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the function tool call generated by the model.
- type:
- type: string
- enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
- x-stainless-const: true
- default: function_call_output
- output:
- oneOf:
- - type: string
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.InputTextContentParam'
- - $ref: '#/components/schemas/OpenAI.InputImageContentParamAutoParam'
- - $ref: '#/components/schemas/OpenAI.InputFileContentParam'
- description: Text, image, or file output of the function tool call.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.ItemFunctionShellCallItemParam:
- type: object
- required:
+ - id
- call_id
- - type
- action
+ - status
+ - environment
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the shell tool call generated by the model.
type:
type: string
enum:
@@ -29673,62 +65870,72 @@ components:
description: The type of the item. Always `shell_call`.
x-stainless-const: true
default: shell_call
+ id:
+ type: string
+ description: The unique ID of the shell tool call. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the shell tool call generated by the model.
action:
- $ref: '#/components/schemas/OpenAI.FunctionShellActionParam'
+ $ref: '#/components/schemas/OpenAI.FunctionShellAction'
description: The shell commands and limits that describe how to run the tool call.
status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- - type: 'null'
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
+ description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
environment:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemParamEnvironment'
+ - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
- type: 'null'
+ created_by:
+ type: string
+ description: The ID of the entity that created this tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: A tool representing a request to execute one or more shell commands.
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: A tool call that executes one or more shell commands in a managed environment.
title: Shell tool call
- OpenAI.ItemFunctionShellCallOutputItemParam:
+ OpenAI.OutputItemFunctionShellCallOutput:
type: object
required:
- - call_id
- type
+ - id
+ - call_id
+ - status
- output
+ - max_output_length
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The unique ID of the shell tool call generated by the model.
type:
type: string
enum:
- shell_call_output
- description: The type of the item. Always `shell_call_output`.
+ description: The type of the shell call output. Always `shell_call_output`.
x-stainless-const: true
default: shell_call_output
+ id:
+ type: string
+ description: The unique ID of the shell call output. Populated when this item is returned via API.
+ call_id:
+ type: string
+ description: The unique ID of the shell tool call generated by the model.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
+ description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
output:
type: array
items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContentParam'
- description: Captured chunks of stdout and stderr output, along with their associated outcomes.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallItemStatus'
- - type: 'null'
+ $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
+ description: An array of shell call output contents
max_output_length:
anyOf:
- $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
+ created_by:
+ type: string
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: The streamed output items emitted by a shell tool call.
- title: Shell tool call output
- OpenAI.ItemFunctionToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a shell tool call that was emitted.
+ title: Shell call output
+ OpenAI.OutputItemFunctionToolCall:
type: object
required:
- id
@@ -29769,89 +65976,90 @@ components:
The status of the item. One of `in_progress`, `completed`, or
`incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: |-
A tool call to run a function. See the
[function calling guide](/docs/guides/function-calling) for more information.
title: Function tool call
- OpenAI.ItemImageGenToolCall:
+ OpenAI.OutputItemFunctionToolCallOutput:
type: object
required:
- - type
- id
- - status
- - result
+ - type
+ - call_id
+ - output
properties:
+ id:
+ type: string
+ description: |-
+ The unique ID of the function tool call output. Populated when this item
+ is returned via API.
+ readOnly: true
type:
type: string
enum:
- - image_generation_call
- description: The type of the image generation call. Always `image_generation_call`.
+ - function_call_output
+ description: The type of the function tool call output. Always `function_call_output`.
x-stainless-const: true
- id:
+ call_id:
type: string
- description: The unique ID of the image generation call.
+ description: The unique ID of the function tool call generated by the model.
+ output:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
+ description: |-
+ The output from the function call generated by your code.
+ Can be a string or an list of output content.
status:
type: string
enum:
- in_progress
- completed
- - generating
- - failed
- description: The status of the image generation call.
- result:
- anyOf:
- - type: string
- - type: 'null'
+ - incomplete
+ description: |-
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: An image generation request made by the model.
- title: Image generation call
- OpenAI.ItemInputMessage:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output of a function tool call.
+ title: Function tool call output
+ OpenAI.OutputItemImageGenToolCall:
type: object
required:
- type
- - role
- - content
- id
+ - status
+ - result
properties:
type:
type: string
enum:
- - message
- description: The type of the message input. Always set to `message`.
+ - image_generation_call
+ description: The type of the image generation call. Always `image_generation_call`.
x-stainless-const: true
- default: message
- role:
- type: string
- enum:
- - user
- - system
- - developer
- description: The role of the message input. One of `user`, `system`, or `developer`.
+ id:
+ type: string
+ description: The unique ID of the image generation call.
status:
type: string
enum:
- in_progress
- completed
- - incomplete
- description: |-
- The status of item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- content:
- $ref: '#/components/schemas/OpenAI.InputMessageContentList'
- id:
- type: string
- description: The unique ID of the message input.
- readOnly: true
+ - generating
+ - failed
+ description: The status of the image generation call.
+ result:
+ anyOf:
+ - type: string
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: |-
- 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.
- title: Input message
- OpenAI.ItemLocalShellToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: An image generation request made by the model.
+ title: Image generation call
+ OpenAI.OutputItemLocalShellToolCall:
type: object
required:
- type
@@ -29882,10 +66090,10 @@ components:
- incomplete
description: The status of the local shell call.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A tool call to run a command on the local shell.
title: Local shell call
- OpenAI.ItemLocalShellToolCallOutput:
+ OpenAI.OutputItemLocalShellToolCallOutput:
type: object
required:
- type
@@ -29913,10 +66121,10 @@ components:
- incomplete
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: The output of a local shell tool call.
title: Local shell call output
- OpenAI.ItemMcpApprovalRequest:
+ OpenAI.OutputItemMcpApprovalRequest:
type: object
required:
- type
@@ -29944,13 +66152,14 @@ components:
type: string
description: A JSON string of arguments for the tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A request for human approval of a tool invocation.
title: MCP approval request
- OpenAI.ItemMcpApprovalResponse:
+ OpenAI.OutputItemMcpApprovalResponseResource:
type: object
required:
- type
+ - id
- approval_request_id
- approve
properties:
@@ -29961,9 +66170,8 @@ components:
description: The type of the item. Always `mcp_approval_response`.
x-stainless-const: true
id:
- anyOf:
- - type: string
- - type: 'null'
+ type: string
+ description: The unique ID of the approval response
approval_request_id:
type: string
description: The ID of the approval request being answered.
@@ -29975,10 +66183,10 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A response to an MCP approval request.
title: MCP approval response
- OpenAI.ItemMcpListTools:
+ OpenAI.OutputItemMcpListTools:
type: object
required:
- type
@@ -30006,10 +66214,10 @@ components:
error:
$ref: '#/components/schemas/OpenAI.RealtimeMCPError'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: A list of tools available on an MCP server.
title: MCP list tools
- OpenAI.ItemMcpToolCall:
+ OpenAI.OutputItemMcpToolCall:
type: object
required:
- type
@@ -30051,10 +66259,10 @@ components:
- type: string
- type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: An invocation of a tool on an MCP server.
title: MCP tool call
- OpenAI.ItemOutputMessage:
+ OpenAI.OutputItemOutputMessage:
type: object
required:
- id
@@ -30097,1473 +66305,1754 @@ components:
The status of the message input. One of `in_progress`, `completed`, or
`incomplete`. Populated when input items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: An output message from the model.
- title: Output message
- OpenAI.ItemReasoningItem:
- type: object
- required:
- - type
- - id
- - summary
- properties:
- type:
- type: string
- enum:
- - reasoning
- description: The type of the object. Always `reasoning`.
- x-stainless-const: true
- id:
- type: string
- description: The unique identifier of the reasoning content.
- encrypted_content:
- anyOf:
- - type: string
- - type: 'null'
- summary:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.SummaryTextContent'
- description: Reasoning summary content.
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
- description: Reasoning text content.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- description: |-
- A description of the chain of thought used by a reasoning model while generating
- a response. Be sure to include these items in your `input` to the Responses API
- for subsequent turns of a conversation if you are manually
- [managing context](/docs/guides/conversation-state).
- title: Reasoning
- OpenAI.ItemReferenceParam:
- type: object
- required:
- - type
- - id
- properties:
- type:
- type: string
- enum:
- - item_reference
- description: The type of item to reference. Always `item_reference`.
- x-stainless-const: true
- id:
- type: string
- description: The ID of the item to reference.
- allOf:
- - $ref: '#/components/schemas/OpenAI.InputItem'
- description: An internal identifier for an item to reference.
- title: Item reference
- OpenAI.ItemResource:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.ItemResourceType'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OpenAI.ItemResourceInputMessage'
- output_message: '#/components/schemas/OpenAI.ItemResourceOutputMessage'
- file_search_call: '#/components/schemas/OpenAI.ItemResourceFileSearchToolCall'
- computer_call: '#/components/schemas/OpenAI.ItemResourceComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.ItemResourceComputerToolCallOutput'
- web_search_call: '#/components/schemas/OpenAI.ItemResourceWebSearchToolCall'
- function_call: '#/components/schemas/OpenAI.ItemResourceFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutput'
- tool_search_call: '#/components/schemas/OpenAI.ItemResourceToolSearchCall'
- tool_search_output: '#/components/schemas/OpenAI.ItemResourceToolSearchOutput'
- additional_tools: '#/components/schemas/OpenAI.ItemResourceAdditionalTools'
- reasoning: '#/components/schemas/OpenAI.ItemResourceReasoningItem'
- compaction: '#/components/schemas/OpenAI.ItemResourceCompactionBody'
- image_generation_call: '#/components/schemas/OpenAI.ItemResourceImageGenToolCall'
- code_interpreter_call: '#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.ItemResourceFunctionShellCall'
- shell_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput'
- apply_patch_call: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall'
- apply_patch_call_output: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput'
- mcp_list_tools: '#/components/schemas/OpenAI.ItemResourceMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource'
- mcp_call: '#/components/schemas/OpenAI.ItemResourceMcpToolCall'
- custom_tool_call: '#/components/schemas/OpenAI.ItemResourceCustomToolCallResource'
- custom_tool_call_output: '#/components/schemas/OpenAI.ItemResourceCustomToolCallOutputResource'
- description: Content item used to generate a response.
- OpenAI.ItemResourceAdditionalTools:
- type: object
- required:
- - type
- - id
- - role
- - tools
- properties:
- type:
- type: string
- enum:
- - additional_tools
- description: The type of the item. Always `additional_tools`.
- x-stainless-const: true
- default: additional_tools
- id:
- type: string
- description: The unique ID of the additional tools item.
- role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role that provided the additional tools.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The additional tool definitions made available at this item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- OpenAI.ItemResourceApplyPatchToolCall:
- type: object
- required:
- - type
- - id
- - call_id
- - status
- - operation
- properties:
- type:
- type: string
- enum:
- - apply_patch_call
- description: The type of the item. Always `apply_patch_call`.
- x-stainless-const: true
- default: apply_patch_call
- id:
- type: string
- description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
- description: The status of the apply patch tool call. One of `in_progress` or `completed`.
- operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
- title: Apply patch operation
- created_by:
- type: string
- description: The ID of the entity that created this tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: A tool call that applies file diffs by creating, deleting, or updating files.
- title: Apply patch tool call
- OpenAI.ItemResourceApplyPatchToolCallOutput:
- type: object
- required:
- - type
- - id
- - call_id
- - status
- properties:
- type:
- type: string
- enum:
- - apply_patch_call_output
- description: The type of the item. Always `apply_patch_call_output`.
- x-stainless-const: true
- default: apply_patch_call_output
- id:
- type: string
- description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
- description: The status of the apply patch tool call output. One of `completed` or `failed`.
- output:
- anyOf:
- - type: string
- - type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call output.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: The output emitted by an apply patch tool call.
- title: Apply patch tool call output
- OpenAI.ItemResourceCodeInterpreterToolCall:
- type: object
- required:
- - type
- - id
- - status
- - container_id
- - code
- - outputs
- properties:
- type:
- type: string
- enum:
- - code_interpreter_call
- description: The type of the code interpreter tool call. Always `code_interpreter_call`.
- x-stainless-const: true
- default: code_interpreter_call
- id:
- type: string
- description: The unique ID of the code interpreter tool call.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - interpreting
- - failed
- description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
- container_id:
- type: string
- description: The ID of the container used to run the code.
- code:
- anyOf:
- - type: string
- - type: 'null'
- outputs:
- anyOf:
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: A tool call to run code.
- title: Code interpreter tool call
- OpenAI.ItemResourceCompactionBody:
- type: object
- required:
- - type
- - id
- - encrypted_content
- properties:
- type:
- type: string
- enum:
- - compaction
- description: The type of the item. Always `compaction`.
- x-stainless-const: true
- default: compaction
- id:
- type: string
- description: The unique ID of the compaction item.
- encrypted_content:
- type: string
- description: The encrypted content that was produced by compaction.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
- title: Compaction item
- OpenAI.ItemResourceComputerToolCall:
- type: object
- required:
- - type
- - id
- - call_id
- - pending_safety_checks
- - status
- properties:
- type:
- type: string
- enum:
- - computer_call
- description: The type of the computer call. Always `computer_call`.
- default: computer_call
- id:
- type: string
- description: The unique ID of the computer call.
- call_id:
- type: string
- description: An identifier used when responding to the tool call with output.
- action:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- actions:
- $ref: '#/components/schemas/OpenAI.ComputerActionList'
- pending_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: The pending safety checks for the computer call.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: |-
- A tool call to a computer use tool. See the
- [computer use guide](/docs/guides/tools-computer-use) for more information.
- title: Computer tool call
- OpenAI.ItemResourceComputerToolCallOutput:
- type: object
- required:
- - type
- - id
- - call_id
- - output
- properties:
- type:
- type: string
- enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
- x-stainless-const: true
- default: computer_call_output
- id:
- type: string
- description: The ID of the computer tool call output.
- readOnly: true
- call_id:
- type: string
- description: The ID of the computer tool call that produced the output.
- acknowledged_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: |-
- The safety checks reported by the API that have been acknowledged by the
- developer.
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.ItemResourceCustomToolCallOutputResource:
- type: object
- required:
- - type
- - call_id
- - output
- - status
- properties:
- type:
- type: string
- enum:
- - custom_tool_call_output
- description: The type of the custom tool call output. Always `custom_tool_call_output`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call output in the OpenAI platform.
- call_id:
- type: string
- description: The call ID, used to map this custom tool call output to a custom tool call.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the custom tool call generated by your code.
- Can be a string or an list of output content.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- title: ResponseCustomToolCallOutputItem
- OpenAI.ItemResourceCustomToolCallResource:
- type: object
- required:
- - type
- - call_id
- - name
- - input
- - status
- properties:
- type:
- type: string
- enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
- type: string
- description: The name of the custom tool being called.
- input:
- type: string
- description: The input for the custom tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- title: ResponseCustomToolCallItem
- OpenAI.ItemResourceFileSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: An output message from the model.
+ title: Output message
+ OpenAI.OutputItemReasoningItem:
type: object
required:
- - id
- type
- - status
- - queries
+ - id
+ - summary
properties:
- id:
- type: string
- description: The unique ID of the file search tool call.
type:
type: string
enum:
- - file_search_call
- description: The type of the file search tool call. Always `file_search_call`.
+ - reasoning
+ description: The type of the object. Always `reasoning`.
x-stainless-const: true
+ id:
+ type: string
+ description: The unique identifier of the reasoning content.
+ encrypted_content:
+ anyOf:
+ - type: string
+ - type: 'null'
+ summary:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.SummaryTextContent'
+ description: Reasoning summary content.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
+ description: Reasoning text content.
status:
type: string
enum:
- in_progress
- - searching
- completed
- incomplete
- - failed
description: |-
- The status of the file search tool call. One of `in_progress`,
- `searching`, `incomplete` or `failed`,
- queries:
- type: array
- items:
- type: string
- description: The queries used to search for files.
- results:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
- - type: 'null'
+ The status of the item. One of `in_progress`, `completed`, or
+ `incomplete`. Populated when items are returned via API.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: |-
- The results of a file search tool call. See the
- [file search guide](/docs/guides/tools-file-search) for more information.
- title: File search tool call
- OpenAI.ItemResourceFunctionShellCall:
+ A description of the chain of thought used by a reasoning model while generating
+ a response. Be sure to include these items in your `input` to the Responses API
+ for subsequent turns of a conversation if you are manually
+ [managing context](/docs/guides/conversation-state).
+ title: Reasoning
+ OpenAI.OutputItemToolSearchCall:
type: object
required:
- type
- id
- call_id
- - action
+ - execution
+ - arguments
- status
- - environment
properties:
type:
type: string
enum:
- - shell_call
- description: The type of the item. Always `shell_call`.
+ - tool_search_call
+ description: The type of the item. Always `tool_search_call`.
x-stainless-const: true
- default: shell_call
+ default: tool_search_call
id:
type: string
- description: The unique ID of the shell tool call. Populated when this item is returned via API.
+ description: The unique ID of the tool search call item.
call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.FunctionShellAction'
- description: The shell commands and limits that describe how to run the tool call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
- description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
- environment:
anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
+ - type: string
- type: 'null'
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ arguments:
+ description: Arguments used for the tool search call.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
+ description: The status of the tool search call item that was recorded.
created_by:
type: string
- description: The ID of the entity that created this tool call.
+ description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: A tool call that executes one or more shell commands in a managed environment.
- title: Shell tool call
- OpenAI.ItemResourceFunctionShellCallOutput:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ OpenAI.OutputItemToolSearchOutput:
type: object
required:
- type
- id
- call_id
+ - execution
+ - tools
- status
- - output
- - max_output_length
properties:
type:
type: string
enum:
- - shell_call_output
- description: The type of the shell call output. Always `shell_call_output`.
+ - tool_search_output
+ description: The type of the item. Always `tool_search_output`.
x-stainless-const: true
- default: shell_call_output
+ default: tool_search_output
id:
type: string
- description: The unique ID of the shell call output. Populated when this item is returned via API.
+ description: The unique ID of the tool search output item.
call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
- description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
- description: An array of shell call output contents
- max_output_length:
anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
- type: 'null'
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search was executed by the server or by the client.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: The loaded tool definitions returned by tool search.
+ status:
+ $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
+ description: The status of the tool search output item that was recorded.
created_by:
type: string
description: The identifier of the actor that created the item.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: The output of a shell tool call that was emitted.
- title: Shell call output
- OpenAI.ItemResourceFunctionToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
+ OpenAI.OutputItemType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - output_message
+ - file_search_call
+ - function_call
+ - function_call_output
+ - web_search_call
+ - computer_call
+ - computer_call_output
+ - reasoning
+ - tool_search_call
+ - tool_search_output
+ - additional_tools
+ - compaction
+ - image_generation_call
+ - code_interpreter_call
+ - local_shell_call
+ - local_shell_call_output
+ - shell_call
+ - shell_call_output
+ - apply_patch_call
+ - apply_patch_call_output
+ - mcp_call
+ - mcp_list_tools
+ - mcp_approval_request
+ - mcp_approval_response
+ - custom_tool_call
+ - custom_tool_call_output
+ - structured_outputs
+ - oauth_consent_request
+ - memory_search_call
+ - memory_command_preview_call
+ - memory_command_preview_call_output
+ - workflow_action
+ - a2a_preview_call
+ - a2a_preview_call_output
+ - bing_grounding_call
+ - bing_grounding_call_output
+ - sharepoint_grounding_preview_call
+ - sharepoint_grounding_preview_call_output
+ - azure_ai_search_call
+ - azure_ai_search_call_output
+ - bing_custom_search_preview_call
+ - bing_custom_search_preview_call_output
+ - openapi_call
+ - openapi_call_output
+ - browser_automation_preview_call
+ - browser_automation_preview_call_output
+ - fabric_dataagent_preview_call
+ - fabric_dataagent_preview_call_output
+ - azure_function_call
+ - azure_function_call_output
+ OpenAI.OutputItemWebSearchToolCall:
type: object
required:
- id
- type
- - call_id
- - name
- - arguments
+ - status
+ - action
properties:
id:
type: string
- description: The unique ID of the function tool call.
- readOnly: true
+ description: The unique ID of the web search tool call.
type:
type: string
enum:
- - function_call
- description: The type of the function tool call. Always `function_call`.
+ - web_search_call
+ description: The type of the web search tool call. Always `web_search_call`.
x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- namespace:
- type: string
- description: The namespace of the function to run.
- name:
- type: string
- description: The name of the function to run.
- arguments:
- type: string
- description: A JSON string of the arguments to pass to the function.
status:
type: string
enum:
- in_progress
+ - searching
- completed
+ - failed
- incomplete
+ description: The status of the web search tool call.
+ action:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
+ - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ 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_in_page).
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ - $ref: '#/components/schemas/OpenAI.OutputItem'
description: |-
- A tool call to run a function. See the
- [function calling guide](/docs/guides/function-calling) for more information.
- title: Function tool call
- OpenAI.ItemResourceFunctionToolCallOutput:
+ The results of a web search tool call. See the
+ [web search guide](/docs/guides/tools-web-search) for more information.
+ title: Web search tool call
+ OpenAI.OutputMessageContent:
type: object
required:
- - id
- type
- - call_id
- - output
properties:
- id:
- type: string
- description: |-
- The unique ID of the function tool call output. Populated when this item
- is returned via API.
- readOnly: true
+ type:
+ $ref: '#/components/schemas/OpenAI.OutputMessageContentType'
+ discriminator:
+ propertyName: type
+ mapping:
+ output_text: '#/components/schemas/OpenAI.OutputMessageContentOutputTextContent'
+ refusal: '#/components/schemas/OpenAI.OutputMessageContentRefusalContent'
+ OpenAI.OutputMessageContentOutputTextContent:
+ type: object
+ required:
+ - type
+ - text
+ - annotations
+ - logprobs
+ properties:
type:
type: string
enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
+ - output_text
+ description: The type of the output text. Always `output_text`.
x-stainless-const: true
- call_id:
+ default: output_text
+ text:
type: string
- description: The unique ID of the function tool call generated by the model.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the function call generated by your code.
- Can be a string or an list of output content.
- status:
+ description: The text output from the model.
+ annotations:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Annotation'
+ description: The annotations of the text output.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.LogProb'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.OutputMessageContent'
+ description: A text output from the model.
+ title: Output text
+ OpenAI.OutputMessageContentRefusalContent:
+ type: object
+ required:
+ - type
+ - refusal
+ properties:
+ type:
type: string
enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ - refusal
+ description: The type of the refusal. Always `refusal`.
+ x-stainless-const: true
+ default: refusal
+ refusal:
+ type: string
+ description: The refusal explanation from the model.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.ItemResourceImageGenToolCall:
+ - $ref: '#/components/schemas/OpenAI.OutputMessageContent'
+ description: A refusal from the model.
+ title: Refusal
+ OpenAI.OutputMessageContentType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - output_text
+ - refusal
+ OpenAI.PartialImages:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 0
+ maximum: 3
+ description: |-
+ The number of partial images to generate. This parameter is used for
+ streaming responses that return partial images. Value must be between 0 and 3.
+ When set to 0, the response will be a single image sent in one streaming event.
+ Note that the final image may be sent before the full number of partial images
+ are generated if the full image is generated more quickly.
+ OpenAI.PredictionContent:
type: object
required:
- type
- - id
- - status
- - result
+ - content
properties:
type:
type: string
enum:
- - image_generation_call
- description: The type of the image generation call. Always `image_generation_call`.
+ - content
+ description: |-
+ The type of the predicted content you want to provide. This type is
+ currently always `content`.
x-stainless-const: true
+ content:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText'
+ description: |-
+ 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.
+ description: |-
+ Static predicted output content, such as the content of a text file that is
+ being regenerated.
+ title: Static Content
+ OpenAI.Prompt:
+ type: object
+ required:
+ - id
+ properties:
id:
type: string
- description: The unique ID of the image generation call.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - generating
- - failed
- description: The status of the image generation call.
- result:
+ description: The unique identifier of the prompt template to use.
+ version:
anyOf:
- type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: An image generation request made by the model.
- title: Image generation call
- OpenAI.ItemResourceInputMessage:
+ variables:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ResponsePromptVariables'
+ - type: 'null'
+ description: |-
+ Reference to a prompt template and its variables.
+ [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts).
+ OpenAI.PromptCacheRetentionEnum:
+ type: string
+ enum:
+ - in_memory
+ - 24h
+ OpenAI.RankerVersionType:
+ type: string
+ enum:
+ - auto
+ - default-2024-11-15
+ OpenAI.RankingOptions:
+ type: object
+ properties:
+ ranker:
+ $ref: '#/components/schemas/OpenAI.RankerVersionType'
+ description: The ranker to use for the file search.
+ score_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: 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.
+ hybrid_search:
+ $ref: '#/components/schemas/OpenAI.HybridSearchOptions'
+ description: Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
+ OpenAI.RealtimeAudioFormats:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormatsType'
+ discriminator:
+ propertyName: type
+ mapping:
+ audio/pcm: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcm'
+ audio/pcmu: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcmu'
+ audio/pcma: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcma'
+ OpenAI.RealtimeAudioFormatsAudioPcm:
type: object
required:
- type
- - role
- - content
- - id
properties:
type:
type: string
enum:
- - message
- description: The type of the message input. Always set to `message`.
- x-stainless-const: true
- default: message
- role:
+ - audio/pcm
+ rate:
+ type: number
+ enum:
+ - 24000
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ OpenAI.RealtimeAudioFormatsAudioPcma:
+ type: object
+ required:
+ - type
+ properties:
+ type:
type: string
enum:
- - user
- - system
- - developer
- description: The role of the message input. One of `user`, `system`, or `developer`.
- status:
+ - audio/pcma
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ OpenAI.RealtimeAudioFormatsAudioPcmu:
+ type: object
+ required:
+ - type
+ properties:
+ type:
type: string
enum:
- - in_progress
- - completed
- - incomplete
+ - audio/pcmu
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ OpenAI.RealtimeAudioFormatsType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - audio/pcm
+ - audio/pcmu
+ - audio/pcma
+ OpenAI.RealtimeCallCreateRequest:
+ type: object
+ properties:
+ sdp:
+ type: string
+ description: WebRTC Session Description Protocol (SDP) offer generated by the caller.
+ session:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA'
description: |-
- The status of item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- content:
- $ref: '#/components/schemas/OpenAI.InputMessageContentList'
- id:
+ Optional session configuration to apply before the realtime session is
+ created. Use the same parameters you would send in a [`create client secret`](/docs/api-reference/realtime-sessions/create-realtime-client-secret)
+ request.
+ required:
+ - sdp
+ OpenAI.RealtimeCallReferRequest:
+ type: object
+ required:
+ - target_uri
+ properties:
+ target_uri:
type: string
- description: The unique ID of the message input.
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
+ description: |-
+ URI that should appear in the SIP Refer-To header. Supports values like
+ `tel:+14155550123` or `sip:agent\@example.com`.
description: |-
- 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.
- title: Input message
- OpenAI.ItemResourceLocalShellToolCall:
+ Parameters required to transfer a SIP call to a new destination using the
+ Realtime API.
+ title: Realtime call refer request
+ OpenAI.RealtimeCallRejectRequest:
+ type: object
+ properties:
+ status_code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: |-
+ SIP response code to send back to the caller. Defaults to `603` (Decline)
+ when omitted.
+ description: Parameters used to decline an incoming SIP call handled by the Realtime API.
+ title: Realtime call reject request
+ OpenAI.RealtimeCreateClientSecretRequest:
+ type: object
+ properties:
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.RealtimeCreateClientSecretRequestExpiresAfter'
+ description: |-
+ Configuration for the client secret expiration. Expiration refers to the time after which
+ a client secret will no longer be valid for creating sessions. The session itself may
+ continue after that time once started. A secret can be used to create multiple sessions
+ until it expires.
+ title: Client secret expiration
+ session:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion'
+ description: |-
+ Session configuration to use for the client secret. Choose either a realtime
+ session or a transcription session.
+ title: Session configuration
+ description: |-
+ Create a session and client secret for the Realtime API. The request can specify
+ either a realtime or a transcription session configuration.
+ [Learn more about the Realtime API](/docs/guides/realtime).
+ title: Realtime client secret creation request
+ OpenAI.RealtimeCreateClientSecretRequestExpiresAfter:
+ type: object
+ properties:
+ anchor:
+ type: string
+ enum:
+ - created_at
+ x-stainless-const: true
+ default: created_at
+ seconds:
+ type: integer
+ format: int64
+ minimum: 10
+ maximum: 7200
+ default: 600
+ OpenAI.RealtimeCreateClientSecretResponse:
type: object
required:
- - type
- - id
- - call_id
- - action
- - status
+ - value
+ - expires_at
+ - session
+ properties:
+ value:
+ type: string
+ description: The generated client secret value.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: Expiration timestamp for the client secret, in seconds since epoch.
+ session:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion'
+ description: The session configuration for either a realtime or transcription session.
+ title: Session configuration
+ description: Response from creating a session and client secret for the Realtime API.
+ title: Realtime session and client secret
+ x-oaiMeta:
+ name: Session response object
+ group: realtime
+ example: |
+ {
+ "value": "ek_68af296e8e408191a1120ab6383263c2",
+ "expires_at": 1756310470,
+ "session": {
+ "type": "realtime",
+ "object": "realtime.session",
+ "id": "sess_C9CiUVUzUzYIssh3ELY1d",
+ "model": "gpt-realtime-2025-08-25",
+ "output_modalities": [
+ "audio"
+ ],
+ "instructions": "You are a friendly assistant.",
+ "tools": [],
+ "tool_choice": "auto",
+ "max_output_tokens": "inf",
+ "tracing": null,
+ "truncation": "auto",
+ "prompt": null,
+ "expires_at": 0,
+ "audio": {
+ "input": {
+ "format": {
+ "type": "audio/pcm",
+ "rate": 24000
+ },
+ "transcription": null,
+ "noise_reduction": null,
+ "turn_detection": {
+ "type": "server_vad",
+ "threshold": 0.5,
+ "prefix_padding_ms": 300,
+ "silence_duration_ms": 200,
+ "idle_timeout_ms": null,
+ "create_response": true,
+ "interrupt_response": true
+ }
+ },
+ "output": {
+ "format": {
+ "type": "audio/pcm",
+ "rate": 24000
+ },
+ "voice": "alloy",
+ "speed": 1.0
+ }
+ },
+ "include": null
+ }
+ }
+ OpenAI.RealtimeFunctionTool:
+ type: object
properties:
type:
type: string
enum:
- - local_shell_call
- description: The type of the local shell call. Always `local_shell_call`.
+ - function
+ description: The type of the tool, i.e. `function`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell call.
- call_id:
+ name:
type: string
- description: The unique ID of the local shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
- status:
+ description: The name of the function.
+ description:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: The status of the local shell call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: A tool call to run a command on the local shell.
- title: Local shell call
- OpenAI.ItemResourceLocalShellToolCallOutput:
+ description: |-
+ 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).
+ parameters:
+ $ref: '#/components/schemas/OpenAI.RealtimeFunctionToolParameters'
+ description: Parameters of the function in JSON Schema.
+ title: Function tool
+ OpenAI.RealtimeFunctionToolParameters:
+ type: object
+ OpenAI.RealtimeMCPError:
type: object
required:
- type
- - id
- - output
properties:
type:
- type: string
- enum:
- - local_shell_call_output
- description: The type of the local shell tool call output. Always `local_shell_call_output`.
- x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- output:
- type: string
- description: A JSON string of the output of the local shell tool call.
- status:
- anyOf:
- - type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: The output of a local shell tool call.
- title: Local shell call output
- OpenAI.ItemResourceMcpApprovalRequest:
+ $ref: '#/components/schemas/OpenAI.RealtimeMcpErrorType'
+ discriminator:
+ propertyName: type
+ mapping:
+ protocol_error: '#/components/schemas/OpenAI.RealtimeMCPProtocolError'
+ tool_execution_error: '#/components/schemas/OpenAI.RealtimeMCPToolExecutionError'
+ http_error: '#/components/schemas/OpenAI.RealtimeMCPHTTPError'
+ OpenAI.RealtimeMCPHTTPError:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
+ - code
+ - message
properties:
type:
type: string
enum:
- - mcp_approval_request
- description: The type of the item. Always `mcp_approval_request`.
+ - http_error
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval request.
- server_label:
- type: string
- description: The label of the MCP server making the request.
- name:
- type: string
- description: The name of the tool to run.
- arguments:
+ code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ message:
type: string
- description: A JSON string of arguments for the tool.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: A request for human approval of a tool invocation.
- title: MCP approval request
- OpenAI.ItemResourceMcpApprovalResponseResource:
+ - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ title: Realtime MCP HTTP error
+ OpenAI.RealtimeMCPProtocolError:
type: object
required:
- type
- - id
- - approval_request_id
- - approve
+ - code
+ - message
properties:
type:
type: string
enum:
- - mcp_approval_response
- description: The type of the item. Always `mcp_approval_response`.
+ - protocol_error
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval response
- approval_request_id:
+ code:
+ $ref: '#/components/schemas/OpenAI.integer'
+ message:
type: string
- description: The ID of the approval request being answered.
- approve:
- type: boolean
- description: Whether the request was approved.
- reason:
- anyOf:
- - type: string
- - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: A response to an MCP approval request.
- title: MCP approval response
- OpenAI.ItemResourceMcpListTools:
+ - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ title: Realtime MCP protocol error
+ OpenAI.RealtimeMCPToolExecutionError:
type: object
required:
- type
- - id
- - server_label
- - tools
+ - message
properties:
type:
type: string
enum:
- - mcp_list_tools
- description: The type of the item. Always `mcp_list_tools`.
+ - tool_execution_error
x-stainless-const: true
- id:
+ message:
type: string
- description: The unique ID of the list.
- server_label:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ title: Realtime MCP tool execution error
+ OpenAI.RealtimeMcpErrorType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - protocol_error
+ - tool_execution_error
+ - http_error
+ OpenAI.RealtimeReasoning:
+ type: object
+ properties:
+ effort:
+ $ref: '#/components/schemas/OpenAI.RealtimeReasoningEffort'
+ description: Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
+ title: Realtime reasoning configuration
+ OpenAI.RealtimeReasoningEffort:
+ type: string
+ enum:
+ - minimal
+ - low
+ - medium
+ - high
+ - xhigh
+ description: |-
+ Constrains effort on reasoning for reasoning-capable Realtime models such as
+ `gpt-realtime-2`.
+ OpenAI.RealtimeSessionCreateRequest:
+ type: object
+ required:
+ - client_secret
+ properties:
+ client_secret:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestClientSecret'
+ description: Ephemeral key returned by the API.
+ modalities:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ - audio
+ description: |-
+ The set of modalities the model can respond with. To disable audio,
+ set this to ["text"].
+ default:
+ - text
+ - audio
+ instructions:
type: string
- description: The label of the MCP server.
+ description: |-
+ 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.
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsOrCustomVoice'
+ description: |-
+ The voice the model uses to respond. Supported built-in voices are
+ `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`,
+ `marin`, and `cedar`. You may also provide a custom voice object with an
+ `id`, for example `{ "id": "voice_1234" }`. Voice cannot be changed during
+ the session once the model has responded with audio at least once.
+ input_audio_format:
+ type: string
+ description: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
+ output_audio_format:
+ type: string
+ description: The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
+ input_audio_transcription:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestInputAudioTranscription'
+ description: |-
+ 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.
+ speed:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0.25
+ maximum: 1.5
+ description: |-
+ 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.
+ default: 1
+ tracing:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - type: object
+ properties:
+ workflow_name:
+ type: string
+ group_id:
+ type: string
+ metadata:
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ 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.
+ title: Tracing Configuration
+ default: auto
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestTurnDetection'
+ description: |-
+ 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.
tools:
type: array
items:
- $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
- description: The tools available on the server.
- error:
- $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: A list of tools available on an MCP server.
- title: MCP list tools
- OpenAI.ItemResourceMcpToolCall:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestTools'
+ description: Tools (functions) available to the model.
+ tool_choice:
+ type: string
+ description: |-
+ How the model chooses tools. Options are `auto`, `none`, `required`, or
+ specify a function.
+ temperature:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
+ max_response_output_tokens:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
+ enum:
+ - inf
+ description: |-
+ 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`.
+ truncation:
+ $ref: '#/components/schemas/OpenAI.RealtimeTruncation'
+ prompt:
+ $ref: '#/components/schemas/OpenAI.Prompt'
+ description: |-
+ A new Realtime session configuration, with an ephemeral key. Default TTL
+ for keys is one minute.
+ x-oaiMeta:
+ name: The session object
+ group: realtime
+ example: |
+ {
+ "id": "sess_001",
+ "object": "realtime.session",
+ "model": "gpt-realtime-2025-08-25",
+ "modalities": ["audio", "text"],
+ "instructions": "You are a friendly assistant.",
+ "voice": "alloy",
+ "input_audio_format": "pcm16",
+ "output_audio_format": "pcm16",
+ "input_audio_transcription": {
+ "model": "whisper-1"
+ },
+ "turn_detection": null,
+ "tools": [],
+ "tool_choice": "none",
+ "temperature": 0.7,
+ "speed": 1.1,
+ "tracing": "auto",
+ "max_response_output_tokens": 200,
+ "truncation": "auto",
+ "prompt": null,
+ "client_secret": {
+ "value": "ek_abc123",
+ "expires_at": 1234567890
+ }
+ }
+ OpenAI.RealtimeSessionCreateRequestClientSecret:
+ type: object
+ required:
+ - value
+ - expires_at
+ properties:
+ value:
+ type: string
+ expires_at:
+ type: integer
+ format: unixtime
+ OpenAI.RealtimeSessionCreateRequestGA:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
properties:
type:
type: string
enum:
- - mcp_call
- description: The type of the item. Always `mcp_call`.
+ - realtime
+ description: The type of session to create. Always `realtime` for the Realtime API.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the tool call.
- server_label:
- type: string
- description: The label of the MCP server running the tool.
- name:
- type: string
- description: The name of the tool that was run.
- arguments:
- type: string
- description: A JSON string of the arguments passed to the tool.
- output:
+ output_modalities:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ - audio
+ description: |-
+ The set of modalities the model can respond with. It defaults to `["audio"]`, indicating
+ that the model will respond with audio plus a transcript. `["text"]` can be used to make
+ the model respond with text only. It is not possible to request both `text` and `audio` at the same time.
+ default:
+ - audio
+ model:
anyOf:
- type: string
- - type: 'null'
- error:
- type: object
- unevaluatedProperties: {}
- status:
- $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
- description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
- approval_request_id:
- anyOf:
- type: string
+ enum:
+ - gpt-realtime
+ - gpt-realtime-1.5
+ - gpt-realtime-2
+ - gpt-realtime-2025-08-28
+ - 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
+ - gpt-realtime-mini
+ - gpt-realtime-mini-2025-10-06
+ - gpt-realtime-mini-2025-12-15
+ - gpt-audio-1.5
+ - gpt-audio-mini
+ - gpt-audio-mini-2025-10-06
+ - gpt-audio-mini-2025-12-15
+ description: The Realtime model used for this session.
+ instructions:
+ type: string
+ description: |-
+ 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.
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudio'
+ description: Configuration for input and output audio.
+ include:
+ type: array
+ items:
+ type: string
+ enum:
+ - item.input_audio_transcription.logprobs
+ description: |-
+ Additional fields to include in server outputs.
+ `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.
+ tracing:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGATracing'
- type: 'null'
+ description: |-
+ Realtime API can write session traces to the [Traces Dashboard](https://platform.openai.com/logs?api=traces). 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.
+ title: Tracing Configuration
+ default: auto
+ tools:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeFunctionTool'
+ - $ref: '#/components/schemas/OpenAI.MCPTool'
+ description: Tools available to the model.
+ tool_choice:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceFunction'
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceMCP'
+ description: |-
+ How the model chooses tools. Provide one of the string modes or force a specific
+ function/MCP tool.
+ default: auto
+ parallel_tool_calls:
+ type: boolean
+ description: |-
+ Whether the model may call multiple tools in parallel. Only supported by
+ reasoning Realtime models such as `gpt-realtime-2`.
+ reasoning:
+ $ref: '#/components/schemas/OpenAI.RealtimeReasoning'
+ max_output_tokens:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
+ enum:
+ - inf
+ description: |-
+ 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`.
+ truncation:
+ $ref: '#/components/schemas/OpenAI.RealtimeTruncation'
+ prompt:
+ $ref: '#/components/schemas/OpenAI.Prompt'
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: An invocation of a tool on an MCP server.
- title: MCP tool call
- OpenAI.ItemResourceOutputMessage:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion'
+ description: Realtime session object configuration.
+ title: Realtime session configuration
+ OpenAI.RealtimeSessionCreateRequestGAAudio:
type: object
- required:
- - id
- - type
- - role
- - content
- - status
properties:
- id:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInput'
+ output:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioOutput'
+ OpenAI.RealtimeSessionCreateRequestGAAudioInput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscription'
+ noise_reduction:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction'
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection'
+ OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeSessionCreateRequestGAAudioOutput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsOrCustomVoice'
+ default: alloy
+ speed:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0.25
+ maximum: 1.5
+ default: 1
+ OpenAI.RealtimeSessionCreateRequestGATracing:
+ type: object
+ properties:
+ workflow_name:
type: string
- description: The unique ID of the output message.
+ group_id:
+ type: string
+ metadata:
+ type: object
+ unevaluatedProperties: {}
+ OpenAI.RealtimeSessionCreateRequestInputAudioTranscription:
+ type: object
+ properties:
+ model:
+ type: string
+ OpenAI.RealtimeSessionCreateRequestTools:
+ type: object
+ properties:
type:
type: string
enum:
- - output_message
- description: The type of the output message. Always `message`.
+ - function
x-stainless-const: true
- role:
+ name:
type: string
- enum:
- - assistant
- description: The role of the output message. Always `assistant`.
- x-stainless-const: true
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.OutputMessageContent'
- description: The content of the output message.
- phase:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
- - type: 'null'
- status:
+ description:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: An output message from the model.
- title: Output message
- OpenAI.ItemResourceReasoningItem:
+ parameters:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestToolsParameters'
+ OpenAI.RealtimeSessionCreateRequestToolsParameters:
+ type: object
+ OpenAI.RealtimeSessionCreateRequestTurnDetection:
+ type: object
+ properties:
+ type:
+ type: string
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeSessionCreateRequestUnion:
type: object
required:
- type
- - id
- - summary
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnionType'
+ discriminator:
+ propertyName: type
+ mapping:
+ transcription: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGA'
+ realtime: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA'
+ OpenAI.RealtimeSessionCreateRequestUnionType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - reasoning
- description: The type of the object. Always `reasoning`.
- x-stainless-const: true
+ - realtime
+ - transcription
+ OpenAI.RealtimeSessionCreateResponse:
+ type: object
+ required:
+ - type
+ properties:
id:
type: string
- description: The unique identifier of the reasoning content.
- encrypted_content:
- anyOf:
- - type: string
- - type: 'null'
- summary:
+ description: Unique identifier for the session that looks like `sess_1234567890abcdef`.
+ object:
+ type: string
+ description: The object type. Always `realtime.session`.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: Expiration timestamp for the session, in seconds since epoch.
+ include:
type: array
items:
- $ref: '#/components/schemas/OpenAI.SummaryTextContent'
- description: Reasoning summary content.
- content:
+ type: string
+ enum:
+ - item.input_audio_transcription.logprobs
+ description: |-
+ Additional fields to include in server outputs.
+ - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.
+ model:
+ type: string
+ description: The Realtime model used for this session.
+ output_modalities:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
- description: Reasoning text content.
- status:
+ type: string
+ enum:
+ - text
+ - audio
+ description: |-
+ The set of modalities the model can respond with. To disable audio,
+ set this to ["text"].
+ instructions:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ 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.
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudio'
+ description: Configuration for input and output audio for the session.
+ tracing:
+ oneOf:
+ - type: string
+ enum:
+ - auto
+ - type: object
+ properties:
+ workflow_name:
+ type: string
+ group_id:
+ type: string
+ metadata:
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ 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.
+ title: Tracing Configuration
+ default: auto
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseTurnDetection'
+ description: |-
+ 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.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RealtimeFunctionTool'
+ description: Tools (functions) available to the model.
+ tool_choice:
+ type: string
+ description: |-
+ How the model chooses tools. Options are `auto`, `none`, `required`, or
+ specify a function.
+ max_output_tokens:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: string
+ enum:
+ - inf
+ description: |-
+ 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:
+ type: string
+ enum:
+ - realtime
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: |-
- A description of the chain of thought used by a reasoning model while generating
- a response. Be sure to include these items in your `input` to the Responses API
- for subsequent turns of a conversation if you are manually
- [managing context](/docs/guides/conversation-state).
- title: Reasoning
- OpenAI.ItemResourceToolSearchCall:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion'
+ description: A Realtime session configuration object.
+ title: Realtime session configuration object
+ x-oaiMeta:
+ name: The session object
+ group: realtime
+ example: |
+ {
+ "id": "sess_001",
+ "object": "realtime.session",
+ "expires_at": 1742188264,
+ "model": "gpt-realtime",
+ "output_modalities": ["audio"],
+ "instructions": "You are a friendly assistant.",
+ "tools": [],
+ "tool_choice": "none",
+ "max_output_tokens": "inf",
+ "tracing": "auto",
+ "truncation": "auto",
+ "prompt": null,
+ "audio": {
+ "input": {
+ "format": {
+ "type": "audio/pcm",
+ "rate": 24000
+ },
+ "transcription": { "model": "whisper-1" },
+ "noise_reduction": null,
+ "turn_detection": null
+ },
+ "output": {
+ "format": {
+ "type": "audio/pcm",
+ "rate": 24000
+ },
+ "voice": "alloy",
+ "speed": 1.0
+ }
+ }
+ }
+ OpenAI.RealtimeSessionCreateResponseAudio:
+ type: object
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInput'
+ output:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioOutput'
+ OpenAI.RealtimeSessionCreateResponseAudioInput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscriptionResponse'
+ noise_reduction:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction'
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection'
+ OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection:
type: object
- required:
- - type
- - id
- - call_id
- - execution
- - arguments
- - status
properties:
type:
type: string
- enum:
- - tool_search_call
- description: The type of the item. Always `tool_search_call`.
- x-stainless-const: true
- default: tool_search_call
- id:
- type: string
- description: The unique ID of the tool search call item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- arguments:
- description: Arguments used for the tool search call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: The status of the tool search call item that was recorded.
- created_by:
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeSessionCreateResponseAudioOutput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ voice:
+ $ref: '#/components/schemas/OpenAI.VoiceIdsShared'
+ speed:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.RealtimeSessionCreateResponseTurnDetection:
+ type: object
+ properties:
+ type:
type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- OpenAI.ItemResourceToolSearchOutput:
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeSessionCreateResponseUnion:
type: object
required:
- type
- - id
- - call_id
- - execution
- - tools
- - status
properties:
type:
- type: string
- enum:
- - tool_search_output
- description: The type of the item. Always `tool_search_output`.
- x-stainless-const: true
- default: tool_search_output
- id:
- type: string
- description: The unique ID of the tool search output item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by tool search.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: The status of the tool search output item that was recorded.
- created_by:
- type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- OpenAI.ItemResourceType:
+ $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnionType'
+ discriminator:
+ propertyName: type
+ mapping:
+ transcription: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse'
+ realtime: '#/components/schemas/OpenAI.RealtimeSessionCreateResponse'
+ OpenAI.RealtimeSessionCreateResponseUnionType:
anyOf:
- type: string
- type: string
enum:
- - message
- - output_message
- - file_search_call
- - computer_call
- - computer_call_output
- - web_search_call
- - function_call
- - function_call_output
- - tool_search_call
- - tool_search_output
- - additional_tools
- - reasoning
- - compaction
- - image_generation_call
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - mcp_call
- - custom_tool_call
- - custom_tool_call_output
- - structured_outputs
- - oauth_consent_request
- - memory_search_call
- - memory_command_preview_call
- - memory_command_preview_call_output
- - workflow_action
- - a2a_preview_call
- - a2a_preview_call_output
- - bing_grounding_call
- - bing_grounding_call_output
- - sharepoint_grounding_preview_call
- - sharepoint_grounding_preview_call_output
- - azure_ai_search_call
- - azure_ai_search_call_output
- - bing_custom_search_preview_call
- - bing_custom_search_preview_call_output
- - openapi_call
- - openapi_call_output
- - browser_automation_preview_call
- - browser_automation_preview_call_output
- - fabric_dataagent_preview_call
- - fabric_dataagent_preview_call_output
- - azure_function_call
- - azure_function_call_output
- OpenAI.ItemResourceWebSearchToolCall:
+ - realtime
+ - transcription
+ OpenAI.RealtimeTranscriptionSessionCreateRequest:
+ type: object
+ properties:
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection'
+ description: 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.
+ input_audio_noise_reduction:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction'
+ description: |-
+ 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_format:
+ type: string
+ enum:
+ - pcm16
+ - g711_ulaw
+ - g711_alaw
+ description: |-
+ 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.
+ default: pcm16
+ input_audio_transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscription'
+ description: Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.
+ include:
+ type: array
+ items:
+ type: string
+ enum:
+ - item.input_audio_transcription.logprobs
+ description: |-
+ The set of items to include in the transcription. Current available items are:
+ `item.input_audio_transcription.logprobs`
+ description: Realtime transcription session object configuration.
+ title: Realtime transcription session configuration
+ OpenAI.RealtimeTranscriptionSessionCreateRequestGA:
type: object
required:
- - id
- type
- - status
- - action
properties:
- id:
- type: string
- description: The unique ID of the web search tool call.
type:
type: string
enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
+ - transcription
+ description: The type of session to create. Always `transcription` for transcription sessions.
x-stainless-const: true
- status:
- type: string
- enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudio'
+ description: Configuration for input and output audio.
+ include:
+ type: array
+ items:
+ type: string
+ enum:
+ - item.input_audio_transcription.logprobs
description: |-
- 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_in_page).
+ Additional fields to include in server outputs.
+ `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.
allOf:
- - $ref: '#/components/schemas/OpenAI.ItemResource'
- description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.ItemToolSearchCallItemParam:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion'
+ description: Realtime transcription session object configuration.
+ title: Realtime transcription session configuration
+ OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudio:
+ type: object
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInput'
+ OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInput:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats'
+ transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscription'
+ noise_reduction:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInputNoiseReduction'
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection'
+ OpenAI.RealtimeTranscriptionSessionCreateRequestGAAudioInputNoiseReduction:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction:
+ type: object
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - server_vad
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeTranscriptionSessionCreateResponse:
type: object
required:
+ - client_secret
- type
- - arguments
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- anyOf:
- - type: string
- - type: 'null'
+ client_secret:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret'
+ description: |-
+ Ephemeral key returned by the API. Only present when the session is
+ created on the server via REST API.
+ modalities:
+ type: array
+ items:
+ type: string
+ enum:
+ - text
+ - audio
+ description: |-
+ The set of modalities the model can respond with. To disable audio,
+ set this to ["text"].
+ input_audio_format:
+ type: string
+ description: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
+ input_audio_transcription:
+ $ref: '#/components/schemas/OpenAI.AudioTranscriptionResponse'
+ description: Configuration of the transcription model.
+ turn_detection:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection'
+ description: |-
+ Configuration for turn detection. Can be set to `null` to turn off. Server
+ VAD means that the model will detect the start and end of speech based on
+ audio volume and respond at the end of user speech.
type:
type: string
enum:
- - tool_search_call
- description: The item type. Always `tool_search_call`.
+ - transcription
x-stainless-const: true
- default: tool_search_call
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- arguments:
- $ref: '#/components/schemas/OpenAI.EmptyModelParam'
- description: The arguments supplied to the tool search call.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- OpenAI.ItemToolSearchOutputItemParam:
+ - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion'
+ description: |-
+ A new Realtime transcription session configuration.
+ When a session is created on the server via REST API, the session object
+ also contains an ephemeral key. Default TTL for keys is 10 minutes. This
+ property is not present when a session is updated via the WebSocket API.
+ x-oaiMeta:
+ name: The transcription session object
+ group: realtime
+ example: |
+ {
+ "id": "sess_BBwZc7cFV3XizEyKGDCGL",
+ "object": "realtime.transcription_session",
+ "expires_at": 1742188264,
+ "modalities": ["audio", "text"],
+ "turn_detection": {
+ "type": "server_vad",
+ "threshold": 0.5,
+ "prefix_padding_ms": 300,
+ "silence_duration_ms": 200
+ },
+ "input_audio_format": "pcm16",
+ "input_audio_transcription": {
+ "model": "gpt-4o-transcribe",
+ "language": null,
+ "prompt": ""
+ },
+ "client_secret": null
+ }
+ OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret:
type: object
required:
- - type
- - tools
+ - value
+ - expires_at
+ properties:
+ value:
+ type: string
+ expires_at:
+ type: integer
+ format: unixtime
+ OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection:
+ type: object
properties:
- id:
- anyOf:
- - type: string
- - type: 'null'
- call_id:
- anyOf:
- - type: string
- - type: 'null'
type:
type: string
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.RealtimeTranslationClientSecretCreateRequest:
+ type: object
+ required:
+ - session
+ properties:
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationClientSecretCreateRequestExpiresAfter'
+ description: |-
+ Configuration for the client secret expiration. Expiration refers to the time after which
+ a client secret will no longer be valid for creating sessions. The session itself may
+ continue after that time once started. A secret can be used to create multiple sessions
+ until it expires.
+ title: Client secret expiration
+ session:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequest'
+ description: Create a translation session and client secret for the Realtime API.
+ title: Realtime translation client secret creation request
+ OpenAI.RealtimeTranslationClientSecretCreateRequestExpiresAfter:
+ type: object
+ properties:
+ anchor:
+ type: string
enum:
- - tool_search_output
- description: The item type. Always `tool_search_output`.
+ - created_at
x-stainless-const: true
- default: tool_search_output
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by the tool search output.
- status:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionCallItemStatus'
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
- OpenAI.ItemType:
- anyOf:
- - type: string
- - type: string
- enum:
- - message
- - output_message
- - file_search_call
- - computer_call
- - computer_call_output
- - web_search_call
- - function_call
- - function_call_output
- - tool_search_call
- - tool_search_output
- - additional_tools
- - reasoning
- - compaction
- - image_generation_call
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - mcp_call
- - custom_tool_call_output
- - custom_tool_call
- - structured_outputs
- - oauth_consent_request
- - memory_search_call
- - memory_command_preview_call
- - memory_command_preview_call_output
- - workflow_action
- - a2a_preview_call
- - a2a_preview_call_output
- - bing_grounding_call
- - bing_grounding_call_output
- - sharepoint_grounding_preview_call
- - sharepoint_grounding_preview_call_output
- - azure_ai_search_call
- - azure_ai_search_call_output
- - bing_custom_search_preview_call
- - bing_custom_search_preview_call_output
- - openapi_call
- - openapi_call_output
- - browser_automation_preview_call
- - browser_automation_preview_call_output
- - fabric_dataagent_preview_call
- - fabric_dataagent_preview_call_output
- - azure_function_call
- - azure_function_call_output
- OpenAI.ItemWebSearchToolCall:
+ default: created_at
+ seconds:
+ type: integer
+ format: int64
+ minimum: 10
+ maximum: 7200
+ default: 600
+ OpenAI.RealtimeTranslationClientSecretCreateResponse:
+ type: object
+ required:
+ - value
+ - expires_at
+ - session
+ properties:
+ value:
+ type: string
+ description: The generated client secret value.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: Expiration timestamp for the client secret, in seconds since epoch.
+ session:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSession'
+ description: Response from creating a translation session and client secret for the Realtime API.
+ title: Realtime translation session and client secret
+ x-oaiMeta:
+ name: Translation session response object
+ group: realtime
+ example: |
+ {
+ "value": "ek_68af296e8e408191a1120ab6383263c2",
+ "expires_at": 1756310470,
+ "session": {
+ "id": "sess_C9CiUVUzUzYIssh3ELY1d",
+ "type": "translation",
+ "expires_at": 1756310470,
+ "model": "gpt-realtime-translate",
+ "audio": {
+ "input": {
+ "transcription": null,
+ "noise_reduction": null
+ },
+ "output": {
+ "language": "es"
+ }
+ }
+ }
+ }
+ OpenAI.RealtimeTranslationSession:
type: object
required:
- id
- type
- - status
- - action
+ - expires_at
+ - model
+ - audio
properties:
id:
type: string
- description: The unique ID of the web search tool call.
+ description: Unique identifier for the session that looks like `sess_1234567890abcdef`.
type:
type: string
enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
+ - translation
+ description: The session type. Always `translation` for Realtime translation sessions.
x-stainless-const: true
- status:
+ expires_at:
+ type: integer
+ format: unixtime
+ description: Expiration timestamp for the session, in seconds since epoch.
+ model:
type: string
- enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
description: |-
- 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_in_page).
- allOf:
- - $ref: '#/components/schemas/OpenAI.Item'
+ The Realtime translation model used for this session. This field is set at
+ session creation and cannot be changed with `session.update`.
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudio'
+ description: Configuration for translation input and output audio.
description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.KeyPressAction:
+ A Realtime translation session. Translation sessions continuously translate input
+ audio into the configured output language.
+ title: Realtime translation session
+ x-oaiMeta:
+ name: The translation session object
+ group: realtime
+ example: |
+ {
+ "id": "sess_C9G5QPteg4UIbotdKLoYQ",
+ "type": "translation",
+ "expires_at": 1756324625,
+ "model": "gpt-realtime-translate",
+ "audio": {
+ "input": {
+ "transcription": {
+ "model": "gpt-realtime-whisper"
+ },
+ "noise_reduction": null
+ },
+ "output": {
+ "language": "es"
+ }
+ }
+ }
+ OpenAI.RealtimeTranslationSessionAudio:
+ type: object
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInput'
+ output:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudioOutput'
+ OpenAI.RealtimeTranslationSessionAudioInput:
+ type: object
+ properties:
+ transcription:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInputTranscription'
+ - type: 'null'
+ noise_reduction:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionAudioInputNoiseReduction'
+ - type: 'null'
+ OpenAI.RealtimeTranslationSessionAudioInputNoiseReduction:
type: object
required:
- type
- - keys
properties:
type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeTranslationSessionAudioInputTranscription:
+ type: object
+ required:
+ - model
+ properties:
+ model:
type: string
- enum:
- - keypress
- description: Specifies the event type. For a keypress action, this property is always set to `keypress`.
- x-stainless-const: true
- keys:
- type: array
- items:
- type: string
- description: The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A collection of keypresses the model would like to perform.
- title: KeyPress
- OpenAI.ListFineTuningJobCheckpointsResponse:
+ OpenAI.RealtimeTranslationSessionAudioOutput:
+ type: object
+ properties:
+ language:
+ type: string
+ OpenAI.RealtimeTranslationSessionCreateRequest:
type: object
required:
- - data
- - object
- - has_more
+ - model
properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpoint'
- x-ms-list-page-items: true
- object:
+ model:
type: string
- enum:
- - list
- x-stainless-const: true
- first_id:
+ description: The Realtime translation model used for this session.
+ audio:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudio'
+ description: Configuration for translation input and output audio.
+ description: |-
+ Realtime translation session configuration. Translation sessions stream source
+ audio in and translated audio plus transcript deltas out continuously.
+ title: Realtime translation session configuration
+ OpenAI.RealtimeTranslationSessionCreateRequestAudio:
+ type: object
+ properties:
+ input:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInput'
+ output:
+ $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioOutput'
+ OpenAI.RealtimeTranslationSessionCreateRequestAudioInput:
+ type: object
+ properties:
+ transcription:
anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInputTranscription'
- type: 'null'
- last_id:
+ noise_reduction:
anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.RealtimeTranslationSessionCreateRequestAudioInputNoiseReduction'
- type: 'null'
- x-ms-list-continuation-token: true
- has_more:
- type: boolean
- OpenAI.ListFineTuningJobEventsResponse:
+ OpenAI.RealtimeTranslationSessionCreateRequestAudioInputNoiseReduction:
type: object
required:
- - data
- - object
- - has_more
+ - type
properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FineTuningJobEvent'
- x-ms-list-page-items: true
- object:
- type: string
- enum:
- - list
- x-stainless-const: true
- has_more:
- type: boolean
- OpenAI.ListPaginatedFineTuningJobsResponse:
+ type:
+ $ref: '#/components/schemas/OpenAI.NoiseReductionType'
+ OpenAI.RealtimeTranslationSessionCreateRequestAudioInputTranscription:
type: object
required:
- - data
- - has_more
- - object
+ - model
properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FineTuningJob'
- x-ms-list-page-items: true
- has_more:
- type: boolean
- object:
+ model:
type: string
+ OpenAI.RealtimeTranslationSessionCreateRequestAudioOutput:
+ type: object
+ properties:
+ language:
+ type: string
+ OpenAI.RealtimeTruncation:
+ oneOf:
+ - type: string
enum:
- - list
- x-stainless-const: true
- OpenAI.LocalEnvironmentResource:
+ - auto
+ - disabled
+ - type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - retention_ratio
+ x-stainless-const: true
+ retention_ratio:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ token_limits:
+ $ref: '#/components/schemas/OpenAI.TokenLimits'
+ required:
+ - type
+ - retention_ratio
+ description: |-
+ When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs.
+ Clients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost.
+ Truncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate.
+ Truncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit.
+ title: Realtime Truncation Controls
+ OpenAI.RealtimeTurnDetection:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.RealtimeTurnDetectionType'
+ discriminator:
+ propertyName: type
+ mapping:
+ server_vad: '#/components/schemas/OpenAI.RealtimeTurnDetectionServerVad'
+ semantic_vad: '#/components/schemas/OpenAI.RealtimeTurnDetectionSemanticVad'
+ description: |-
+ 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.
+ For `gpt-realtime-whisper` transcription sessions, turn detection must be
+ set to `null`; VAD is not supported.
+ title: Realtime Turn Detection
+ OpenAI.RealtimeTurnDetectionSemanticVad:
type: object
required:
- type
@@ -31571,5845 +68060,5852 @@ components:
type:
type: string
enum:
- - local
- description: The environment type. Always `local`.
- x-stainless-const: true
+ - semantic_vad
+ eagerness:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ - auto
+ default: auto
+ create_response:
+ type: boolean
+ default: true
+ interrupt_response:
+ type: boolean
+ default: true
allOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
- description: Represents the use of a local environment to perform shell actions.
- title: Local Environment
- OpenAI.LocalShellExecAction:
+ - $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection'
+ OpenAI.RealtimeTurnDetectionServerVad:
type: object
required:
- type
- - command
- - env
properties:
type:
type: string
enum:
- - exec
- description: The type of the local shell action. Always `exec`.
- x-stainless-const: true
- default: exec
- command:
- type: array
- items:
- type: string
- description: The command to run.
- timeout_ms:
+ - server_vad
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ create_response:
+ type: boolean
+ default: true
+ interrupt_response:
+ type: boolean
+ default: true
+ idle_timeout_ms:
anyOf:
- $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- working_directory:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection'
+ OpenAI.RealtimeTurnDetectionType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - server_vad
+ - semantic_vad
+ OpenAI.Reasoning:
+ type: object
+ properties:
+ effort:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
+ - type: 'null'
+ summary:
anyOf:
- type: string
+ enum:
+ - auto
+ - concise
+ - detailed
- type: 'null'
- env:
- type: object
- unevaluatedProperties:
- type: string
- description: Environment variables to set for the command.
- x-oaiTypeLabel: map
- user:
+ context:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - current_turn
+ - all_turns
+ - type: 'null'
+ generate_summary:
anyOf:
- type: string
+ enum:
+ - auto
+ - concise
+ - detailed
- type: 'null'
- description: Execute a shell command on the server.
- title: Local shell exec action
- OpenAI.LocalShellToolParam:
+ description: |-
+ **gpt-5 and o-series models only**
+ Configuration options for
+ [reasoning models](https://platform.openai.com/docs/guides/reasoning).
+ title: Reasoning
+ OpenAI.ReasoningEffort:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - none
+ - minimal
+ - low
+ - medium
+ - high
+ - xhigh
+ description: |-
+ Constrains effort on reasoning for
+ [reasoning models](https://platform.openai.com/docs/guides/reasoning).
+ Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used
+ on reasoning in a response.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
+ - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
+ OpenAI.ReasoningTextContent:
type: object
required:
- type
+ - text
properties:
type:
type: string
enum:
- - local_shell
- description: The type of the local shell tool. Always `local_shell`.
+ - reasoning_text
+ description: The type of the reasoning text. Always `reasoning_text`.
x-stainless-const: true
- name:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- description:
- type: string
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: A tool that allows the model to execute shell commands in a local environment.
- title: Local shell tool
- OpenAI.LocalSkillParam:
- type: object
- required:
- - name
- - description
- - path
- properties:
- name:
- type: string
- description: The name of the skill.
- description:
- type: string
- description: The description of the skill.
- path:
+ default: reasoning_text
+ text:
type: string
- description: The path to the directory containing the skill.
- OpenAI.LogProb:
+ description: The reasoning text from the model.
+ description: Reasoning text from the model.
+ title: Reasoning text
+ OpenAI.Response:
type: object
required:
- - token
- - logprob
- - bytes
- - top_logprobs
+ - id
+ - object
+ - created_at
+ - error
+ - incomplete_details
+ - output
+ - instructions
+ - parallel_tool_calls
+ - agent_reference
properties:
- token:
- type: string
- logprob:
- $ref: '#/components/schemas/OpenAI.numeric'
- bytes:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.integer'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
top_logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.TopLogProb'
- description: The log probability of a token.
- title: Log probability
- OpenAI.MCPListToolsTool:
- type: object
- required:
- - name
- - input_schema
- properties:
- name:
- type: string
- description: The name of the tool.
- description:
anyOf:
- - type: string
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- input_schema:
- $ref: '#/components/schemas/OpenAI.MCPListToolsToolInputSchema'
- description: The JSON schema describing the tool's input.
- annotations:
+ temperature:
anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPListToolsToolAnnotations'
+ - $ref: '#/components/schemas/OpenAI.numeric'
- type: 'null'
- description: A tool available on an MCP server.
- title: MCP list tools tool
- OpenAI.MCPListToolsToolAnnotations:
- type: object
- OpenAI.MCPListToolsToolInputSchema:
- type: object
- OpenAI.MCPTool:
- type: object
- required:
- - type
- - server_label
- properties:
- type:
- type: string
- enum:
- - mcp
- description: The type of the MCP tool. Always `mcp`.
- x-stainless-const: true
- server_label:
- type: string
- description: A label for this MCP server, used to identify it in tool calls.
- server_url:
- type: string
- format: uri
- description: |-
- The URL for the MCP server. One of `server_url`, `connector_id`, or
- `tunnel_id` must be provided.
- connector_id:
+ default: 1
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ default: 1
+ user:
type: string
- enum:
- - connector_dropbox
- - connector_gmail
- - connector_googlecalendar
- - connector_googledrive
- - connector_microsoftteams
- - connector_outlookcalendar
- - connector_outlookemail
- - connector_sharepoint
description: |-
- Identifier for service connectors, like those available in ChatGPT. One of
- `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
- about service connectors [here](/docs/guides/tools-remote-mcp#connectors).
- Currently supported `connector_id` values are:
- - Dropbox: `connector_dropbox`
- - Gmail: `connector_gmail`
- - Google Calendar: `connector_googlecalendar`
- - Google Drive: `connector_googledrive`
- - Microsoft Teams: `connector_microsoftteams`
- - Outlook Calendar: `connector_outlookcalendar`
- - Outlook Email: `connector_outlookemail`
- - SharePoint: `connector_sharepoint`
- tunnel_id:
+ 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](/docs/guides/safety-best-practices#safety-identifiers).
+ deprecated: true
+ safety_identifier:
type: string
- pattern: ^tunnel_[a-z0-9]{32}$
+ maxLength: 64
description: |-
- The Secure MCP Tunnel ID to use instead of a direct server URL. One of
- `server_url`, `connector_id`, or `tunnel_id` must be provided.
- authorization:
+ 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
+ prompt_cache_key:
type: string
- description: |-
- An OAuth access token that can be used with a remote MCP server, either
- with a custom MCP server URL or a service connector. Your application
- must handle the OAuth authorization flow and provide the token here.
- server_description:
+ description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
+ service_tier:
+ $ref: '#/components/schemas/OpenAI.ServiceTier'
+ prompt_cache_retention:
+ anyOf:
+ - type: string
+ enum:
+ - in_memory
+ - 24h
+ - type: 'null'
+ previous_response_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ model:
type: string
- description: Optional description of the MCP server, used to provide more context.
- headers:
+ description: The model deployment to use for the creation of this response.
+ background:
anyOf:
- - type: object
- unevaluatedProperties:
- type: string
+ - type: boolean
- type: 'null'
- allowed_tools:
+ max_tool_calls:
anyOf:
- - type: array
- items:
- type: string
- - $ref: '#/components/schemas/OpenAI.MCPToolFilter'
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- require_approval:
+ text:
+ $ref: '#/components/schemas/OpenAI.ResponseTextParam'
+ tools:
+ $ref: '#/components/schemas/OpenAI.ToolsArray'
+ tool_choice:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ prompt:
+ $ref: '#/components/schemas/OpenAI.Prompt'
+ truncation:
anyOf:
- - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
- type: string
enum:
- - always
- - never
+ - auto
+ - disabled
- type: 'null'
- default: always
- defer_loading:
- type: boolean
- description: Whether this MCP tool is deferred and discovered via tool search.
- project_connection_id:
+ default: disabled
+ id:
type: string
- description: The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server.
- tool_configs:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/ToolConfig'
- description: Deprecated. This property is deprecated and will be removed in a future version.
- deprecated: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: |-
- Give the model access to additional tools via remote Model Context Protocol
- (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp).
- title: MCP tool
- OpenAI.MCPToolCallStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - calling
- - failed
- OpenAI.MCPToolFilter:
- type: object
- properties:
- tool_names:
- type: array
- items:
- type: string
- description: List of allowed tool names.
- title: MCP allowed tools
- read_only:
- type: boolean
- description: |-
- Indicates whether or not a tool modifies data or is read-only. If an
- MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
- it will match this filter.
- description: A filter object to specify which tools are allowed.
- title: MCP tool filter
- OpenAI.MCPToolRequireApproval:
- type: object
- properties:
- always:
- $ref: '#/components/schemas/OpenAI.MCPToolFilter'
- never:
- $ref: '#/components/schemas/OpenAI.MCPToolFilter'
- OpenAI.MessageContent:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.MessageContentType'
- discriminator:
- propertyName: type
- mapping:
- text: '#/components/schemas/OpenAI.TextContent'
- computer_screenshot: '#/components/schemas/OpenAI.ComputerScreenshotContent'
- input_text: '#/components/schemas/OpenAI.MessageContentInputTextContent'
- output_text: '#/components/schemas/OpenAI.MessageContentOutputTextContent'
- reasoning_text: '#/components/schemas/OpenAI.MessageContentReasoningTextContent'
- refusal: '#/components/schemas/OpenAI.MessageContentRefusalContent'
- input_image: '#/components/schemas/OpenAI.MessageContentInputImageContent'
- input_file: '#/components/schemas/OpenAI.MessageContentInputFileContent'
- summary_text: '#/components/schemas/OpenAI.SummaryTextContent'
- description: A content part that makes up an input or output item.
- OpenAI.MessageContentInputFileContent:
- type: object
- required:
- - type
- properties:
- type:
+ description: Unique identifier for this Response.
+ object:
type: string
enum:
- - input_file
- description: The type of the input item. Always `input_file`.
+ - response
+ description: The object type of this resource - always set to `response`.
x-stainless-const: true
- default: input_file
- file_id:
+ status:
+ type: string
+ enum:
+ - completed
+ - failed
+ - in_progress
+ - cancelled
+ - queued
+ - incomplete
+ description: |-
+ The status of the response generation. One of `completed`, `failed`,
+ `in_progress`, `cancelled`, `queued`, or `incomplete`.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) of when this Response was created.
+ completed_at:
anyOf:
- type: string
+ format: date-time
- type: 'null'
- filename:
- type: string
- description: The name of the file to be sent to the model.
- file_data:
- type: string
- description: The content of the file to be sent to the model.
- file_url:
- type: string
- format: uri
- description: The URL of the file to be sent to the model.
- detail:
- $ref: '#/components/schemas/OpenAI.FileInputDetail'
- description: The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`.
- allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A file input to the model.
- title: Input file
- OpenAI.MessageContentInputImageContent:
- type: object
- required:
- - type
- - detail
- properties:
- type:
- type: string
- enum:
- - input_image
- description: The type of the input item. Always `input_image`.
- x-stainless-const: true
- default: input_image
- image_url:
+ type: integer
+ format: unixTimestamp
+ error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseError'
+ - type: 'null'
+ incomplete_details:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails'
+ - type: 'null'
+ output:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: |-
+ An array of content items generated by the model.
+ - The length and order of items in the `output` array is dependent
+ on the model's response.
+ - Rather than accessing the first item in the `output` array and
+ assuming it's an `assistant` message with the content generated by
+ the model, you might consider using the `output_text` property where
+ supported in SDKs.
+ reasoning:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Reasoning'
+ - type: 'null'
+ instructions:
anyOf:
- type: string
- format: uri
+ - type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.InputItem'
- type: 'null'
- file_id:
+ output_text:
anyOf:
- type: string
- type: 'null'
- detail:
- $ref: '#/components/schemas/OpenAI.ImageDetail'
- description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`.
- allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: An image input to the model. Learn about [image inputs](/docs/guides/vision).
- title: Input image
- OpenAI.MessageContentInputTextContent:
+ usage:
+ $ref: '#/components/schemas/OpenAI.ResponseUsage'
+ moderation:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Moderation'
+ - type: 'null'
+ parallel_tool_calls:
+ type: boolean
+ description: Whether to allow the model to run tool calls in parallel.
+ default: true
+ conversation:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ConversationReference'
+ - type: 'null'
+ max_output_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ agent:
+ $ref: '#/components/schemas/AgentId'
+ description: |-
+ (Deprecated) Use agent_reference instead.
+ The agent used for this response
+ agent_session_id:
+ type: string
+ description: |-
+ The session identifier for this response. Currently only relevant for hosted agents.
+ Always returned for hosted agents — either the caller-provided value, the auto-derived value,
+ or an auto-generated UUID. Use for session-scoped operations and to maintain sandbox
+ affinity in follow-up calls.
+ agent_reference:
+ anyOf:
+ - $ref: '#/components/schemas/AgentReference'
+ - type: 'null'
+ description: The agent used for this response
+ content_filters:
+ type: array
+ items:
+ $ref: '#/components/schemas/ContentFilterResult'
+ description: The content filter evaluation results.
+ title: The response object
+ OpenAI.ResponseAudioDeltaEvent:
type: object
required:
- type
- - text
+ - sequence_number
+ - delta
properties:
type:
type: string
enum:
- - input_text
- description: The type of the input item. Always `input_text`.
+ - response.audio.delta
+ description: The type of the event. Always `response.audio.delta`.
x-stainless-const: true
- default: input_text
- text:
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: A sequence number for this chunk of the stream response.
+ delta:
type: string
- description: The text input to the model.
+ contentEncoding: base64
+ description: A chunk of Base64 encoded response audio bytes.
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A text input to the model.
- title: Input text
- OpenAI.MessageContentOutputTextContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when there is a partial audio response.
+ x-oaiMeta:
+ name: response.audio.delta
+ group: responses
+ example: |
+ {
+ "type": "response.audio.delta",
+ "response_id": "resp_123",
+ "delta": "base64encoded...",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseAudioDoneEvent:
type: object
required:
- type
- - text
- - annotations
- - logprobs
+ - sequence_number
properties:
type:
type: string
enum:
- - output_text
- description: The type of the output text. Always `output_text`.
+ - response.audio.done
+ description: The type of the event. Always `response.audio.done`.
x-stainless-const: true
- default: output_text
- text:
- type: string
- description: The text output from the model.
- annotations:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Annotation'
- description: The annotations of the text output.
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.LogProb'
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the delta.
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A text output from the model.
- title: Output text
- OpenAI.MessageContentReasoningTextContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the audio response is complete.
+ x-oaiMeta:
+ name: response.audio.done
+ group: responses
+ example: |
+ {
+ "type": "response.audio.done",
+ "response_id": "resp-123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseAudioTranscriptDeltaEvent:
type: object
required:
- type
- - text
+ - delta
+ - sequence_number
properties:
type:
type: string
enum:
- - reasoning_text
- description: The type of the reasoning text. Always `reasoning_text`.
+ - response.audio.transcript.delta
+ description: The type of the event. Always `response.audio.transcript.delta`.
x-stainless-const: true
- default: reasoning_text
- text:
+ delta:
type: string
- description: The reasoning text from the model.
+ description: The partial transcript of the audio response.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: Reasoning text from the model.
- title: Reasoning text
- OpenAI.MessageContentRefusalContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when there is a partial transcript of audio.
+ x-oaiMeta:
+ name: response.audio.transcript.delta
+ group: responses
+ example: |
+ {
+ "type": "response.audio.transcript.delta",
+ "response_id": "resp_123",
+ "delta": " ... partial transcript ... ",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseAudioTranscriptDoneEvent:
type: object
required:
- type
- - refusal
+ - sequence_number
properties:
type:
type: string
enum:
- - refusal
- description: The type of the refusal. Always `refusal`.
+ - response.audio.transcript.done
+ description: The type of the event. Always `response.audio.transcript.done`.
x-stainless-const: true
- default: refusal
- refusal:
- type: string
- description: The refusal explanation from the model.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A refusal from the model.
- title: Refusal
- OpenAI.MessageContentType:
- anyOf:
- - type: string
- - type: string
- enum:
- - input_text
- - output_text
- - text
- - summary_text
- - reasoning_text
- - refusal
- - input_image
- - computer_screenshot
- - input_file
- OpenAI.MessagePhase:
- type: string
- enum:
- - commentary
- - final_answer
- description: |-
- Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).
- For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend
- phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
- OpenAI.MessageRole:
- type: string
- enum:
- - unknown
- - user
- - assistant
- - system
- - critic
- - discriminator
- - developer
- - tool
- OpenAI.MessageStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- OpenAI.Metadata:
- type: object
- unevaluatedProperties:
- type: string
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard.
- Keys are strings with a maximum length of 64 characters. Values are strings
- with a maximum length of 512 characters.
- x-oaiTypeLabel: map
- OpenAI.ModelIdsCompaction:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ModelIdsResponses'
- - type: string
- - type: 'null'
- description: Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/docs/models) to browse and compare available models.
- OpenAI.ModelIdsResponses:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ModelIdsShared'
- - type: string
- enum:
- - 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
- - gpt-5-codex
- - gpt-5-pro
- - gpt-5-pro-2025-10-06
- - gpt-5.1-codex-max
- OpenAI.ModelIdsShared:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.ChatModel'
- OpenAI.Moderation:
- type: object
- required:
- - input
- - output
- properties:
- input:
- $ref: '#/components/schemas/OpenAI.ModerationEntry'
- description: Moderation for the response input.
- output:
- $ref: '#/components/schemas/OpenAI.ModerationEntry'
- description: Moderation for the response output.
- description: Moderation results or errors for the response input and output.
- title: Moderation
- OpenAI.ModerationEntry:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.ModerationEntryType'
- discriminator:
- propertyName: type
- mapping:
- moderation_result: '#/components/schemas/OpenAI.ModerationResultBody'
- error: '#/components/schemas/OpenAI.ModerationErrorBody'
- description: Moderation results or an error for a response moderation check.
- OpenAI.ModerationEntryType:
- anyOf:
- - type: string
- - type: string
- enum:
- - moderation_result
- - error
- OpenAI.ModerationErrorBody:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the full audio transcript is completed.
+ x-oaiMeta:
+ name: response.audio.transcript.done
+ group: responses
+ example: |
+ {
+ "type": "response.audio.transcript.done",
+ "response_id": "resp_123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent:
type: object
required:
- type
- - code
- - message
+ - output_index
+ - item_id
+ - delta
+ - sequence_number
properties:
type:
type: string
enum:
- - error
- description: The object type, which was always `error` for moderation failures.
+ - response.code_interpreter_call_code.delta
+ description: The type of the event. Always `response.code_interpreter_call_code.delta`.
x-stainless-const: true
- code:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response for which the code is being streamed.
+ item_id:
type: string
- description: The error code.
- message:
+ description: The unique identifier of the code interpreter tool call item.
+ delta:
type: string
- description: The error message.
+ description: The partial code snippet being streamed by the code interpreter.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.ModerationEntry'
- description: An error produced while attempting moderation for the response input or output.
- title: Moderation error
- OpenAI.ModerationInputType:
- type: string
- enum:
- - text
- - image
- OpenAI.ModerationParam:
- type: object
- required:
- - model
- properties:
- model:
- type: string
- description: The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.
- description: Configuration for running moderation on the input and output of this response.
- OpenAI.ModerationResultBody:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a partial code snippet is streamed by the code interpreter.
+ x-oaiMeta:
+ name: response.code_interpreter_call_code.delta
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call_code.delta",
+ "output_index": 0,
+ "item_id": "ci_12345",
+ "delta": "print('Hello, world')",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallCodeDoneEvent:
type: object
required:
- type
- - model
- - flagged
- - categories
- - category_scores
- - category_applied_input_types
+ - output_index
+ - item_id
+ - code
+ - sequence_number
properties:
type:
type: string
enum:
- - moderation_result
- description: The object type, which was always `moderation_result` for successful moderation results.
+ - response.code_interpreter_call_code.done
+ description: The type of the event. Always `response.code_interpreter_call_code.done`.
x-stainless-const: true
- model:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response for which the code is finalized.
+ item_id:
type: string
- description: The moderation model that produced this result.
- flagged:
- type: boolean
- description: A boolean indicating whether the content was flagged by any category.
- categories:
- type: object
- unevaluatedProperties:
- type: boolean
- description: A dictionary of moderation categories to booleans, True if the input is flagged under this category.
- x-oaiTypeLabel: map
- category_scores:
- type: object
- unevaluatedProperties:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: A dictionary of moderation categories to scores.
- x-oaiTypeLabel: map
- category_applied_input_types:
- type: object
- unevaluatedProperties:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ModerationInputType'
- description: Which modalities of input are reflected by the score for each category.
- x-oaiTypeLabel: map
+ description: The unique identifier of the code interpreter tool call item.
+ code:
+ type: string
+ description: The final code snippet output by the code interpreter.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.ModerationEntry'
- description: A moderation result produced for the response input or output.
- title: Moderation result
- OpenAI.MoveParam:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the code snippet is finalized by the code interpreter.
+ x-oaiMeta:
+ name: response.code_interpreter_call_code.done
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call_code.done",
+ "output_index": 3,
+ "item_id": "ci_12345",
+ "code": "print('done')",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallCompletedEvent:
type: object
required:
- type
- - x
- - 'y'
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - move
- description: Specifies the event type. For a move action, this property is always set to `move`.
+ - response.code_interpreter_call.completed
+ description: The type of the event. Always `response.code_interpreter_call.completed`.
x-stainless-const: true
- x:
+ output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate to move to.
- 'y':
+ description: The index of the output item in the response for which the code interpreter call is completed.
+ item_id:
+ type: string
+ description: The unique identifier of the code interpreter tool call item.
+ sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate to move to.
- keys:
- anyOf:
- - type: array
- items:
- type: string
- - type: 'null'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A mouse move action.
- title: Move
- OpenAI.NamespaceToolParam:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the code interpreter call is completed.
+ x-oaiMeta:
+ name: response.code_interpreter_call.completed
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call.completed",
+ "output_index": 5,
+ "item_id": "ci_12345",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallInProgressEvent:
type: object
required:
- type
- - name
- - description
- - tools
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - namespace
- description: The type of the tool. Always `namespace`.
+ - response.code_interpreter_call.in_progress
+ description: The type of the event. Always `response.code_interpreter_call.in_progress`.
x-stainless-const: true
- name:
- type: string
- minLength: 1
- description: The namespace name used in tool calls (for example, `crm`).
- description:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response for which the code interpreter call is in progress.
+ item_id:
type: string
- minLength: 1
- description: A description of the namespace shown to the model.
- tools:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionToolParam'
- - $ref: '#/components/schemas/OpenAI.CustomToolParam'
- minItems: 1
- description: The function/custom tools available inside this namespace.
+ description: The unique identifier of the code interpreter tool call item.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: Groups function/custom tools under a shared namespace.
- title: Namespace
- OpenAI.OutputContent:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.OutputContentType'
- discriminator:
- propertyName: type
- mapping:
- output_text: '#/components/schemas/OpenAI.OutputContentOutputTextContent'
- refusal: '#/components/schemas/OpenAI.OutputContentRefusalContent'
- reasoning_text: '#/components/schemas/OpenAI.OutputContentReasoningTextContent'
- OpenAI.OutputContentOutputTextContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a code interpreter call is in progress.
+ x-oaiMeta:
+ name: response.code_interpreter_call.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call.in_progress",
+ "output_index": 0,
+ "item_id": "ci_12345",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCodeInterpreterCallInterpretingEvent:
type: object
required:
- type
- - text
- - annotations
- - logprobs
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - output_text
- description: The type of the output text. Always `output_text`.
+ - response.code_interpreter_call.interpreting
+ description: The type of the event. Always `response.code_interpreter_call.interpreting`.
x-stainless-const: true
- default: output_text
- text:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response for which the code interpreter is interpreting code.
+ item_id:
type: string
- description: The text output from the model.
- annotations:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Annotation'
- description: The annotations of the text output.
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.LogProb'
+ description: The unique identifier of the code interpreter tool call item.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event, used to order streaming events.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputContent'
- description: A text output from the model.
- title: Output text
- OpenAI.OutputContentReasoningTextContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the code interpreter is actively interpreting the code snippet.
+ x-oaiMeta:
+ name: response.code_interpreter_call.interpreting
+ group: responses
+ example: |
+ {
+ "type": "response.code_interpreter_call.interpreting",
+ "output_index": 4,
+ "item_id": "ci_12345",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCompletedEvent:
type: object
required:
- type
- - text
+ - response
+ - sequence_number
properties:
type:
type: string
enum:
- - reasoning_text
- description: The type of the reasoning text. Always `reasoning_text`.
+ - response.completed
+ description: The type of the event. Always `response.completed`.
x-stainless-const: true
- default: reasoning_text
- text:
- type: string
- description: The reasoning text from the model.
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: Properties of the completed response.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number for this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputContent'
- description: Reasoning text from the model.
- title: Reasoning text
- OpenAI.OutputContentRefusalContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the model response is complete.
+ x-oaiMeta:
+ name: response.completed
+ group: responses
+ example: |
+ {
+ "type": "response.completed",
+ "response": {
+ "id": "resp_123",
+ "object": "response",
+ "created_at": 1740855869,
+ "status": "completed",
+ "completed_at": 1740855870,
+ "error": null,
+ "incomplete_details": null,
+ "input": [],
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-mini-2024-07-18",
+ "output": [
+ {
+ "id": "msg_123",
+ "type": "message",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "previous_response_id": null,
+ "reasoning_effort": null,
+ "store": false,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 0,
+ "output_tokens": 0,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 0
+ },
+ "user": null,
+ "metadata": {}
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseContentPartAddedEvent:
type: object
required:
- type
- - refusal
+ - item_id
+ - output_index
+ - content_index
+ - part
+ - sequence_number
properties:
type:
type: string
enum:
- - refusal
- description: The type of the refusal. Always `refusal`.
+ - response.content_part.added
+ description: The type of the event. Always `response.content_part.added`.
x-stainless-const: true
- default: refusal
- refusal:
+ item_id:
type: string
- description: The refusal explanation from the model.
+ description: The ID of the output item that the content part was added to.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the content part was added to.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the content part that was added.
+ part:
+ $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: The content part that was added.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputContent'
- description: A refusal from the model.
- title: Refusal
- OpenAI.OutputContentType:
- anyOf:
- - type: string
- - type: string
- enum:
- - output_text
- - refusal
- - reasoning_text
- OpenAI.OutputItem:
- type: object
- required:
- - type
- properties:
- type:
- $ref: '#/components/schemas/OpenAI.OutputItemType'
- created_by:
- anyOf:
- - $ref: '#/components/schemas/CreatedBy'
- - type: string
- description: The information about the creator of the item
- agent_reference:
- $ref: '#/components/schemas/AgentReference'
- description: The agent that created the item.
- response_id:
- type: string
- description: The response on which the item is created.
- discriminator:
- propertyName: type
- mapping:
- structured_outputs: '#/components/schemas/StructuredOutputsOutputItem'
- workflow_action: '#/components/schemas/WorkflowActionOutputItem'
- oauth_consent_request: '#/components/schemas/OAuthConsentRequestOutputItem'
- bing_grounding_call: '#/components/schemas/BingGroundingToolCall'
- bing_grounding_call_output: '#/components/schemas/BingGroundingToolCallOutput'
- sharepoint_grounding_preview_call: '#/components/schemas/SharepointGroundingToolCall'
- sharepoint_grounding_preview_call_output: '#/components/schemas/SharepointGroundingToolCallOutput'
- azure_ai_search_call: '#/components/schemas/AzureAISearchToolCall'
- azure_ai_search_call_output: '#/components/schemas/AzureAISearchToolCallOutput'
- bing_custom_search_preview_call: '#/components/schemas/BingCustomSearchToolCall'
- bing_custom_search_preview_call_output: '#/components/schemas/BingCustomSearchToolCallOutput'
- openapi_call: '#/components/schemas/OpenApiToolCall'
- openapi_call_output: '#/components/schemas/OpenApiToolCallOutput'
- browser_automation_preview_call: '#/components/schemas/BrowserAutomationToolCall'
- browser_automation_preview_call_output: '#/components/schemas/BrowserAutomationToolCallOutput'
- fabric_dataagent_preview_call: '#/components/schemas/FabricDataAgentToolCall'
- fabric_dataagent_preview_call_output: '#/components/schemas/FabricDataAgentToolCallOutput'
- azure_function_call: '#/components/schemas/AzureFunctionToolCall'
- azure_function_call_output: '#/components/schemas/AzureFunctionToolCallOutput'
- a2a_preview_call: '#/components/schemas/A2AToolCall'
- a2a_preview_call_output: '#/components/schemas/A2AToolCallOutput'
- memory_search_call: '#/components/schemas/MemorySearchToolCall'
- memory_command_preview_call: '#/components/schemas/MemoryCommandToolCall'
- memory_command_preview_call_output: '#/components/schemas/MemoryCommandToolCallOutput'
- output_message: '#/components/schemas/OpenAI.OutputItemOutputMessage'
- file_search_call: '#/components/schemas/OpenAI.OutputItemFileSearchToolCall'
- function_call: '#/components/schemas/OpenAI.OutputItemFunctionToolCall'
- function_call_output: '#/components/schemas/OpenAI.OutputItemFunctionToolCallOutput'
- web_search_call: '#/components/schemas/OpenAI.OutputItemWebSearchToolCall'
- computer_call: '#/components/schemas/OpenAI.OutputItemComputerToolCall'
- computer_call_output: '#/components/schemas/OpenAI.OutputItemComputerToolCallOutput'
- reasoning: '#/components/schemas/OpenAI.OutputItemReasoningItem'
- tool_search_call: '#/components/schemas/OpenAI.OutputItemToolSearchCall'
- tool_search_output: '#/components/schemas/OpenAI.OutputItemToolSearchOutput'
- additional_tools: '#/components/schemas/OpenAI.OutputItemAdditionalTools'
- compaction: '#/components/schemas/OpenAI.OutputItemCompactionBody'
- image_generation_call: '#/components/schemas/OpenAI.OutputItemImageGenToolCall'
- code_interpreter_call: '#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall'
- local_shell_call: '#/components/schemas/OpenAI.OutputItemLocalShellToolCall'
- local_shell_call_output: '#/components/schemas/OpenAI.OutputItemLocalShellToolCallOutput'
- shell_call: '#/components/schemas/OpenAI.OutputItemFunctionShellCall'
- shell_call_output: '#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput'
- apply_patch_call: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCall'
- apply_patch_call_output: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput'
- mcp_call: '#/components/schemas/OpenAI.OutputItemMcpToolCall'
- mcp_list_tools: '#/components/schemas/OpenAI.OutputItemMcpListTools'
- mcp_approval_request: '#/components/schemas/OpenAI.OutputItemMcpApprovalRequest'
- mcp_approval_response: '#/components/schemas/OpenAI.OutputItemMcpApprovalResponseResource'
- custom_tool_call: '#/components/schemas/OpenAI.OutputItemCustomToolCallResource'
- custom_tool_call_output: '#/components/schemas/OpenAI.OutputItemCustomToolCallOutputResource'
- OpenAI.OutputItemAdditionalTools:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a new content part is added.
+ x-oaiMeta:
+ name: response.content_part.added
+ group: responses
+ example: |
+ {
+ "type": "response.content_part.added",
+ "item_id": "msg_123",
+ "output_index": 0,
+ "content_index": 0,
+ "part": {
+ "type": "output_text",
+ "text": "",
+ "annotations": []
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseContentPartDoneEvent:
type: object
required:
- type
- - id
- - role
- - tools
+ - item_id
+ - output_index
+ - content_index
+ - sequence_number
+ - part
properties:
type:
type: string
enum:
- - additional_tools
- description: The type of the item. Always `additional_tools`.
+ - response.content_part.done
+ description: The type of the event. Always `response.content_part.done`.
x-stainless-const: true
- default: additional_tools
- id:
+ item_id:
type: string
- description: The unique ID of the additional tools item.
- role:
- $ref: '#/components/schemas/OpenAI.MessageRole'
- description: The role that provided the additional tools.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The additional tool definitions made available at this item.
+ description: The ID of the output item that the content part was added to.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the content part was added to.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the content part that is done.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ part:
+ $ref: '#/components/schemas/OpenAI.OutputContent'
+ description: The content part that is done.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- OpenAI.OutputItemApplyPatchToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a content part is done.
+ x-oaiMeta:
+ name: response.content_part.done
+ group: responses
+ example: |
+ {
+ "type": "response.content_part.done",
+ "item_id": "msg_123",
+ "output_index": 0,
+ "content_index": 0,
+ "sequence_number": 1,
+ "part": {
+ "type": "output_text",
+ "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
+ "annotations": []
+ }
+ }
+ OpenAI.ResponseCreatedEvent:
type: object
required:
- type
- - id
- - call_id
- - status
- - operation
+ - response
+ - sequence_number
properties:
type:
type: string
enum:
- - apply_patch_call
- description: The type of the item. Always `apply_patch_call`.
+ - response.created
+ description: The type of the event. Always `response.created`.
x-stainless-const: true
- default: apply_patch_call
- id:
- type: string
- description: The unique ID of the apply patch tool call. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus'
- description: The status of the apply patch tool call. One of `in_progress` or `completed`.
- operation:
- $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation'
- description: One of the create_file, delete_file, or update_file operations applied via apply_patch.
- title: Apply patch operation
- created_by:
- type: string
- description: The ID of the entity that created this tool call.
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The response that was created.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number for this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A tool call that applies file diffs by creating, deleting, or updating files.
- title: Apply patch tool call
- OpenAI.OutputItemApplyPatchToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: An event that is emitted when a response is created.
+ x-oaiMeta:
+ name: response.created
+ group: responses
+ example: |
+ {
+ "type": "response.created",
+ "response": {
+ "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
+ "object": "response",
+ "created_at": 1741487325,
+ "status": "in_progress",
+ "completed_at": null,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseCustomToolCallInputDeltaEvent:
type: object
required:
- type
- - id
- - call_id
- - status
+ - sequence_number
+ - output_index
+ - item_id
+ - delta
properties:
type:
type: string
enum:
- - apply_patch_call_output
- description: The type of the item. Always `apply_patch_call_output`.
+ - response.custom_tool_call_input.delta
+ description: The event type identifier.
x-stainless-const: true
- default: apply_patch_call_output
- id:
- type: string
- description: The unique ID of the apply patch tool call output. Populated when this item is returned via API.
- call_id:
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output this delta applies to.
+ item_id:
type: string
- description: The unique ID of the apply patch tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus'
- description: The status of the apply patch tool call output. One of `completed` or `failed`.
- output:
- anyOf:
- - type: string
- - type: 'null'
- created_by:
+ description: Unique identifier for the API item associated with this event.
+ delta:
type: string
- description: The ID of the entity that created this tool call output.
+ description: The incremental input data (delta) for the custom tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output emitted by an apply patch tool call.
- title: Apply patch tool call output
- OpenAI.OutputItemCodeInterpreterToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Event representing a delta (partial update) to the input of a custom tool call.
+ title: ResponseCustomToolCallInputDelta
+ x-oaiMeta:
+ name: response.custom_tool_call_input.delta
+ group: responses
+ example: |
+ {
+ "type": "response.custom_tool_call_input.delta",
+ "output_index": 0,
+ "item_id": "ctc_1234567890abcdef",
+ "delta": "partial input text"
+ }
+ OpenAI.ResponseCustomToolCallInputDoneEvent:
type: object
required:
- type
- - id
- - status
- - container_id
- - code
- - outputs
+ - sequence_number
+ - output_index
+ - item_id
+ - input
properties:
type:
type: string
enum:
- - code_interpreter_call
- description: The type of the code interpreter tool call. Always `code_interpreter_call`.
+ - response.custom_tool_call_input.done
+ description: The event type identifier.
x-stainless-const: true
- default: code_interpreter_call
- id:
- type: string
- description: The unique ID of the code interpreter tool call.
- status:
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output this event applies to.
+ item_id:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - interpreting
- - failed
- description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
- container_id:
+ description: Unique identifier for the API item associated with this event.
+ input:
type: string
- description: The ID of the container used to run the code.
- code:
- anyOf:
- - type: string
- - type: 'null'
- outputs:
- anyOf:
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs'
- - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage'
- - type: 'null'
+ description: The complete input data for the custom tool call.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A tool call to run code.
- title: Code interpreter tool call
- OpenAI.OutputItemCompactionBody:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Event indicating that input for a custom tool call is complete.
+ title: ResponseCustomToolCallInputDone
+ x-oaiMeta:
+ name: response.custom_tool_call_input.done
+ group: responses
+ example: |
+ {
+ "type": "response.custom_tool_call_input.done",
+ "output_index": 0,
+ "item_id": "ctc_1234567890abcdef",
+ "input": "final complete input text"
+ }
+ OpenAI.ResponseError:
type: object
required:
- - type
- - id
- - encrypted_content
+ - code
+ - message
properties:
- type:
- type: string
- enum:
- - compaction
- description: The type of the item. Always `compaction`.
- x-stainless-const: true
- default: compaction
- id:
- type: string
- description: The unique ID of the compaction item.
- encrypted_content:
- type: string
- description: The encrypted content that was produced by compaction.
- created_by:
+ code:
+ $ref: '#/components/schemas/OpenAI.ResponseErrorCode'
+ message:
type: string
- description: The identifier of the actor that created the item.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact).
- title: Compaction item
- OpenAI.OutputItemComputerToolCall:
+ description: A human-readable description of the error.
+ description: An error object returned when the model fails to generate a Response.
+ OpenAI.ResponseErrorCode:
+ type: string
+ enum:
+ - server_error
+ - rate_limit_exceeded
+ - invalid_prompt
+ - vector_store_timeout
+ - invalid_image
+ - invalid_image_format
+ - invalid_base64_image
+ - invalid_image_url
+ - image_too_large
+ - image_too_small
+ - image_parse_error
+ - image_content_policy_violation
+ - invalid_image_mode
+ - image_file_too_large
+ - unsupported_image_media_type
+ - empty_image_file
+ - failed_to_download_image
+ - image_file_not_found
+ description: The error code for the response.
+ OpenAI.ResponseErrorEvent:
type: object
required:
- type
- - id
- - call_id
- - pending_safety_checks
- - status
+ - code
+ - message
+ - param
+ - sequence_number
properties:
type:
type: string
enum:
- - computer_call
- description: The type of the computer call. Always `computer_call`.
- default: computer_call
- id:
- type: string
- description: The unique ID of the computer call.
- call_id:
- type: string
- description: An identifier used when responding to the tool call with output.
- action:
- $ref: '#/components/schemas/OpenAI.ComputerAction'
- actions:
- $ref: '#/components/schemas/OpenAI.ComputerActionList'
- pending_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: The pending safety checks for the computer call.
- status:
+ - error
+ description: The type of the event. Always `error`.
+ x-stainless-const: true
+ code:
+ anyOf:
+ - type: string
+ - type: 'null'
+ message:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ description: The error message.
+ param:
+ anyOf:
+ - type: string
+ - type: 'null'
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- A tool call to a computer use tool. See the
- [computer use guide](/docs/guides/tools-computer-use) for more information.
- title: Computer tool call
- OpenAI.OutputItemComputerToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an error occurs.
+ x-oaiMeta:
+ name: error
+ group: responses
+ example: |
+ {
+ "type": "error",
+ "code": "ERR_SOMETHING",
+ "message": "Something went wrong",
+ "param": null,
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFailedEvent:
type: object
required:
- type
- - id
- - call_id
- - output
+ - sequence_number
+ - response
properties:
type:
type: string
enum:
- - computer_call_output
- description: The type of the computer tool call output. Always `computer_call_output`.
+ - response.failed
+ description: The type of the event. Always `response.failed`.
x-stainless-const: true
- default: computer_call_output
- id:
- type: string
- description: The ID of the computer tool call output.
- readOnly: true
- call_id:
- type: string
- description: The ID of the computer tool call that produced the output.
- acknowledged_safety_checks:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam'
- description: |-
- The safety checks reported by the API that have been acknowledged by the
- developer.
- output:
- $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage'
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The response that failed.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a computer tool call.
- title: Computer tool call output
- OpenAI.OutputItemCustomToolCallOutputResource:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: An event that is emitted when a response fails.
+ x-oaiMeta:
+ name: response.failed
+ group: responses
+ example: |
+ {
+ "type": "response.failed",
+ "response": {
+ "id": "resp_123",
+ "object": "response",
+ "created_at": 1740855869,
+ "status": "failed",
+ "completed_at": null,
+ "error": {
+ "code": "server_error",
+ "message": "The model failed to generate a response."
+ },
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-mini-2024-07-18",
+ "output": [],
+ "previous_response_id": null,
+ "reasoning_effort": null,
+ "store": false,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ }
+ }
+ OpenAI.ResponseFileSearchCallCompletedEvent:
type: object
required:
- type
- - call_id
- - output
- - status
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - custom_tool_call_output
- description: The type of the custom tool call output. Always `custom_tool_call_output`.
+ - response.file_search_call.completed
+ description: The type of the event. Always `response.file_search_call.completed`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call output in the OpenAI platform.
- call_id:
- type: string
- description: The call ID, used to map this custom tool call output to a custom tool call.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the custom tool call generated by your code.
- Can be a string or an list of output content.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the file search call is initiated.
+ item_id:
type: string
- description: The identifier of the actor that created the item.
+ description: The ID of the output item that the file search call is initiated.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- title: ResponseCustomToolCallOutputItem
- OpenAI.OutputItemCustomToolCallResource:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a file search call is completed (results found).
+ x-oaiMeta:
+ name: response.file_search_call.completed
+ group: responses
+ example: |
+ {
+ "type": "response.file_search_call.completed",
+ "output_index": 0,
+ "item_id": "fs_123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFileSearchCallInProgressEvent:
type: object
required:
- type
- - call_id
- - name
- - input
- - status
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - custom_tool_call
- description: The type of the custom tool call. Always `custom_tool_call`.
+ - response.file_search_call.in_progress
+ description: The type of the event. Always `response.file_search_call.in_progress`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the custom tool call in the OpenAI platform.
- call_id:
- type: string
- description: An identifier used to map this custom tool call to a tool call output.
- namespace:
- type: string
- description: The namespace of the custom tool being called.
- name:
- type: string
- description: The name of the custom tool being called.
- input:
- type: string
- description: The input for the custom tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- created_by:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the file search call is initiated.
+ item_id:
type: string
- description: The identifier of the actor that created the item.
+ description: The ID of the output item that the file search call is initiated.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- title: ResponseCustomToolCallItem
- OpenAI.OutputItemFileSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a file search call is initiated.
+ x-oaiMeta:
+ name: response.file_search_call.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.file_search_call.in_progress",
+ "output_index": 0,
+ "item_id": "fs_123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFileSearchCallSearchingEvent:
type: object
required:
- - id
- type
- - status
- - queries
+ - output_index
+ - item_id
+ - sequence_number
properties:
- id:
- type: string
- description: The unique ID of the file search tool call.
type:
type: string
enum:
- - file_search_call
- description: The type of the file search tool call. Always `file_search_call`.
+ - response.file_search_call.searching
+ description: The type of the event. Always `response.file_search_call.searching`.
x-stainless-const: true
- status:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the file search call is searching.
+ item_id:
type: string
- enum:
- - in_progress
- - searching
- - completed
- - incomplete
- - failed
- description: |-
- The status of the file search tool call. One of `in_progress`,
- `searching`, `incomplete` or `failed`,
- queries:
- type: array
- items:
- type: string
- description: The queries used to search for files.
- results:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults'
- - type: 'null'
+ description: The ID of the output item that the file search call is initiated.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- The results of a file search tool call. See the
- [file search guide](/docs/guides/tools-file-search) for more information.
- title: File search tool call
- OpenAI.OutputItemFunctionShellCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a file search is currently searching.
+ x-oaiMeta:
+ name: response.file_search_call.searching
+ group: responses
+ example: |
+ {
+ "type": "response.file_search_call.searching",
+ "output_index": 0,
+ "item_id": "fs_123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFormatJsonObject:
type: object
required:
- type
- - id
- - call_id
- - action
- - status
- - environment
properties:
type:
type: string
enum:
- - shell_call
- description: The type of the item. Always `shell_call`.
+ - json_object
+ description: The type of response format being defined. Always `json_object`.
x-stainless-const: true
- default: shell_call
- id:
- type: string
- description: The unique ID of the shell tool call. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.FunctionShellAction'
- description: The shell commands and limits that describe how to run the tool call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallStatus'
- description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`.
- environment:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.FunctionShellCallEnvironment'
- - type: 'null'
- created_by:
- type: string
- description: The ID of the entity that created this tool call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A tool call that executes one or more shell commands in a managed environment.
- title: Shell tool call
- OpenAI.OutputItemFunctionShellCallOutput:
+ description: |-
+ JSON object response format. An older method of generating JSON responses.
+ Using `json_schema` is recommended for models that support it. Note that the
+ model will not generate JSON without a system or user message instructing it
+ to do so.
+ title: JSON object
+ OpenAI.ResponseFormatJsonSchema:
type: object
required:
- type
- - id
- - call_id
- - status
- - output
- - max_output_length
+ - json_schema
properties:
type:
type: string
enum:
- - shell_call_output
- description: The type of the shell call output. Always `shell_call_output`.
+ - json_schema
+ description: The type of response format being defined. Always `json_schema`.
x-stainless-const: true
- default: shell_call_output
- id:
- type: string
- description: The unique ID of the shell call output. Populated when this item is returned via API.
- call_id:
- type: string
- description: The unique ID of the shell tool call generated by the model.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputStatusEnum'
- description: The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`.
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent'
- description: An array of shell call output contents
- max_output_length:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- created_by:
- type: string
- description: The identifier of the actor that created the item.
+ json_schema:
+ $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema'
+ description: Structured Outputs configuration options, including a JSON Schema.
+ title: JSON schema
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a shell tool call that was emitted.
- title: Shell call output
- OpenAI.OutputItemFunctionToolCall:
+ - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
+ description: |-
+ JSON Schema response format. Used to generate structured JSON responses.
+ Learn more about [Structured Outputs](/docs/guides/structured-outputs).
+ title: JSON schema
+ OpenAI.ResponseFormatJsonSchemaJsonSchema:
type: object
required:
- - id
- - type
- - call_id
- name
- - arguments
properties:
- id:
- type: string
- description: The unique ID of the function tool call.
- readOnly: true
- type:
- type: string
- enum:
- - function_call
- description: The type of the function tool call. Always `function_call`.
- x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- namespace:
+ description:
type: string
- description: The namespace of the function to run.
name:
type: string
- description: The name of the function to run.
- arguments:
- type: string
- description: A JSON string of the arguments to pass to the function.
- status:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
+ schema:
+ $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema'
+ strict:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ OpenAI.ResponseFormatJsonSchemaSchema:
+ type: object
+ unevaluatedProperties: {}
description: |-
- A tool call to run a function. See the
- [function calling guide](/docs/guides/function-calling) for more information.
- title: Function tool call
- OpenAI.OutputItemFunctionToolCallOutput:
+ The schema for the response format, described as a JSON Schema object.
+ Learn how to build JSON schemas [here](https://json-schema.org/).
+ title: JSON schema
+ OpenAI.ResponseFormatText:
type: object
- required:
- - id
- - type
- - call_id
- - output
- properties:
- id:
- type: string
- description: |-
- The unique ID of the function tool call output. Populated when this item
- is returned via API.
- readOnly: true
- type:
- type: string
- enum:
- - function_call_output
- description: The type of the function tool call output. Always `function_call_output`.
- x-stainless-const: true
- call_id:
- type: string
- description: The unique ID of the function tool call generated by the model.
- output:
- oneOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput'
- description: |-
- The output from the function call generated by your code.
- Can be a string or an list of output content.
- status:
+ required:
+ - type
+ properties:
+ type:
type: string
enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a function tool call.
- title: Function tool call output
- OpenAI.OutputItemImageGenToolCall:
+ - text
+ description: The type of response format being defined. Always `text`.
+ x-stainless-const: true
+ description: Default response format. Used to generate text responses.
+ title: Text
+ OpenAI.ResponseFunctionCallArgumentsDeltaEvent:
type: object
required:
- type
- - id
- - status
- - result
+ - item_id
+ - output_index
+ - sequence_number
+ - delta
properties:
type:
type: string
enum:
- - image_generation_call
- description: The type of the image generation call. Always `image_generation_call`.
+ - response.function_call_arguments.delta
+ description: The type of the event. Always `response.function_call_arguments.delta`.
x-stainless-const: true
- id:
+ item_id:
type: string
- description: The unique ID of the image generation call.
- status:
+ description: The ID of the output item that the function-call arguments delta is added to.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the function-call arguments delta is added to.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ delta:
type: string
- enum:
- - in_progress
- - completed
- - generating
- - failed
- description: The status of the image generation call.
- result:
- anyOf:
- - type: string
- - type: 'null'
+ description: The function-call arguments delta that is added.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An image generation request made by the model.
- title: Image generation call
- OpenAI.OutputItemLocalShellToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when there is a partial function-call arguments delta.
+ x-oaiMeta:
+ name: response.function_call_arguments.delta
+ group: responses
+ example: |
+ {
+ "type": "response.function_call_arguments.delta",
+ "item_id": "item-abc",
+ "output_index": 0,
+ "delta": "{ "arg":"
+ "sequence_number": 1
+ }
+ OpenAI.ResponseFunctionCallArgumentsDoneEvent:
type: object
required:
- type
- - id
- - call_id
- - action
- - status
+ - item_id
+ - name
+ - output_index
+ - sequence_number
+ - arguments
properties:
type:
type: string
enum:
- - local_shell_call
- description: The type of the local shell call. Always `local_shell_call`.
+ - response.function_call_arguments.done
x-stainless-const: true
- id:
+ item_id:
type: string
- description: The unique ID of the local shell call.
- call_id:
+ description: The ID of the item.
+ name:
type: string
- description: The unique ID of the local shell tool call generated by the model.
- action:
- $ref: '#/components/schemas/OpenAI.LocalShellExecAction'
- status:
+ description: The name of the function that was called.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ arguments:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: The status of the local shell call.
+ description: The function-call arguments.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A tool call to run a command on the local shell.
- title: Local shell call
- OpenAI.OutputItemLocalShellToolCallOutput:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when function-call arguments are finalized.
+ x-oaiMeta:
+ name: response.function_call_arguments.done
+ group: responses
+ example: |
+ {
+ "type": "response.function_call_arguments.done",
+ "item_id": "item-abc",
+ "name": "get_weather",
+ "output_index": 1,
+ "arguments": "{ "arg": 123 }",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseImageGenCallCompletedEvent:
type: object
required:
- type
- - id
- - output
+ - output_index
+ - sequence_number
+ - item_id
properties:
type:
type: string
enum:
- - local_shell_call_output
- description: The type of the local shell tool call output. Always `local_shell_call_output`.
+ - response.image_generation_call.completed
+ description: The type of the event. Always 'response.image_generation_call.completed'.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the local shell tool call generated by the model.
- output:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ item_id:
type: string
- description: A JSON string of the output of the local shell tool call.
- status:
- anyOf:
- - type: string
- enum:
- - in_progress
- - completed
- - incomplete
- - type: 'null'
+ description: The unique identifier of the image generation item being processed.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output of a local shell tool call.
- title: Local shell call output
- OpenAI.OutputItemMcpApprovalRequest:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an image generation tool call has completed and the final image is available.
+ title: ResponseImageGenCallCompletedEvent
+ x-oaiMeta:
+ name: response.image_generation_call.completed
+ group: responses
+ example: |
+ {
+ "type": "response.image_generation_call.completed",
+ "output_index": 0,
+ "item_id": "item-123",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseImageGenCallGeneratingEvent:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - mcp_approval_request
- description: The type of the item. Always `mcp_approval_request`.
+ - response.image_generation_call.generating
+ description: The type of the event. Always 'response.image_generation_call.generating'.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval request.
- server_label:
- type: string
- description: The label of the MCP server making the request.
- name:
- type: string
- description: The name of the tool to run.
- arguments:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
type: string
- description: A JSON string of arguments for the tool.
+ description: The unique identifier of the image generation item being processed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the image generation item being processed.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A request for human approval of a tool invocation.
- title: MCP approval request
- OpenAI.OutputItemMcpApprovalResponseResource:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an image generation tool call is actively generating an image (intermediate state).
+ title: ResponseImageGenCallGeneratingEvent
+ x-oaiMeta:
+ name: response.image_generation_call.generating
+ group: responses
+ example: |
+ {
+ "type": "response.image_generation_call.generating",
+ "output_index": 0,
+ "item_id": "item-123",
+ "sequence_number": 0
+ }
+ OpenAI.ResponseImageGenCallInProgressEvent:
type: object
required:
- type
- - id
- - approval_request_id
- - approve
+ - output_index
+ - item_id
+ - sequence_number
properties:
type:
type: string
enum:
- - mcp_approval_response
- description: The type of the item. Always `mcp_approval_response`.
+ - response.image_generation_call.in_progress
+ description: The type of the event. Always 'response.image_generation_call.in_progress'.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the approval response
- approval_request_id:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
type: string
- description: The ID of the approval request being answered.
- approve:
- type: boolean
- description: Whether the request was approved.
- reason:
- anyOf:
- - type: string
- - type: 'null'
+ description: The unique identifier of the image generation item being processed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the image generation item being processed.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A response to an MCP approval request.
- title: MCP approval response
- OpenAI.OutputItemMcpListTools:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an image generation tool call is in progress.
+ title: ResponseImageGenCallInProgressEvent
+ x-oaiMeta:
+ name: response.image_generation_call.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.image_generation_call.in_progress",
+ "output_index": 0,
+ "item_id": "item-123",
+ "sequence_number": 0
+ }
+ OpenAI.ResponseImageGenCallPartialImageEvent:
type: object
required:
- type
- - id
- - server_label
- - tools
+ - output_index
+ - item_id
+ - sequence_number
+ - partial_image_index
+ - partial_image_b64
properties:
type:
type: string
enum:
- - mcp_list_tools
- description: The type of the item. Always `mcp_list_tools`.
+ - response.image_generation_call.partial_image
+ description: The type of the event. Always 'response.image_generation_call.partial_image'.
x-stainless-const: true
- id:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
type: string
- description: The unique ID of the list.
- server_label:
+ description: The unique identifier of the image generation item being processed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the image generation item being processed.
+ partial_image_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: 0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
+ partial_image_b64:
type: string
- description: The label of the MCP server.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.MCPListToolsTool'
- description: The tools available on the server.
- error:
- $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
+ description: Base64-encoded partial image data, suitable for rendering as an image.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: A list of tools available on an MCP server.
- title: MCP list tools
- OpenAI.OutputItemMcpToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a partial image is available during image generation streaming.
+ title: ResponseImageGenCallPartialImageEvent
+ x-oaiMeta:
+ name: response.image_generation_call.partial_image
+ group: responses
+ example: |
+ {
+ "type": "response.image_generation_call.partial_image",
+ "output_index": 0,
+ "item_id": "item-123",
+ "sequence_number": 0,
+ "partial_image_index": 0,
+ "partial_image_b64": "..."
+ }
+ OpenAI.ResponseInProgressEvent:
type: object
required:
- type
- - id
- - server_label
- - name
- - arguments
+ - response
+ - sequence_number
properties:
type:
type: string
enum:
- - mcp_call
- description: The type of the item. Always `mcp_call`.
+ - response.in_progress
+ description: The type of the event. Always `response.in_progress`.
x-stainless-const: true
- id:
- type: string
- description: The unique ID of the tool call.
- server_label:
- type: string
- description: The label of the MCP server running the tool.
- name:
- type: string
- description: The name of the tool that was run.
- arguments:
- type: string
- description: A JSON string of the arguments passed to the tool.
- output:
- anyOf:
- - type: string
- - type: 'null'
- error:
- type: object
- unevaluatedProperties: {}
- status:
- $ref: '#/components/schemas/OpenAI.MCPToolCallStatus'
- description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.
- approval_request_id:
- anyOf:
- - type: string
- - type: 'null'
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The response that is in progress.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An invocation of a tool on an MCP server.
- title: MCP tool call
- OpenAI.OutputItemOutputMessage:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the response is in progress.
+ x-oaiMeta:
+ name: response.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.in_progress",
+ "response": {
+ "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
+ "object": "response",
+ "created_at": 1741487325,
+ "status": "in_progress",
+ "completed_at": null,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseIncompleteDetails:
+ type: object
+ properties:
+ reason:
+ type: string
+ enum:
+ - max_output_tokens
+ - content_filter
+ OpenAI.ResponseIncompleteEvent:
type: object
required:
- - id
- type
- - role
- - content
- - status
+ - response
+ - sequence_number
properties:
- id:
- type: string
- description: The unique ID of the output message.
type:
type: string
enum:
- - output_message
- description: The type of the output message. Always `message`.
+ - response.incomplete
+ description: The type of the event. Always `response.incomplete`.
x-stainless-const: true
- role:
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The response that was incomplete.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: An event that is emitted when a response finishes as incomplete.
+ x-oaiMeta:
+ name: response.incomplete
+ group: responses
+ example: |
+ {
+ "type": "response.incomplete",
+ "response": {
+ "id": "resp_123",
+ "object": "response",
+ "created_at": 1740855869,
+ "status": "incomplete",
+ "completed_at": null,
+ "error": null,
+ "incomplete_details": {
+ "reason": "max_tokens"
+ },
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-mini-2024-07-18",
+ "output": [],
+ "previous_response_id": null,
+ "reasoning_effort": null,
+ "store": false,
+ "temperature": 1,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseLogProb:
+ type: object
+ required:
+ - token
+ - logprob
+ properties:
+ token:
type: string
- enum:
- - assistant
- description: The role of the output message. Always `assistant`.
- x-stainless-const: true
- content:
+ description: A possible text token.
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: The log probability of this token.
+ top_logprobs:
type: array
items:
- $ref: '#/components/schemas/OpenAI.OutputMessageContent'
- description: The content of the output message.
- phase:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.MessagePhase'
- - type: 'null'
- status:
+ $ref: '#/components/schemas/OpenAI.ResponseLogProbTopLogprobs'
+ description: The log probabilities of up to 20 of the most likely tokens.
+ description: |-
+ A logprob is the logarithmic probability that the model assigns to producing
+ a particular token at a given position in the sequence. Less-negative (higher)
+ logprob values indicate greater model confidence in that token choice.
+ OpenAI.ResponseLogProbTopLogprobs:
+ type: object
+ properties:
+ token:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the message input. One of `in_progress`, `completed`, or
- `incomplete`. Populated when input items are returned via API.
- allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: An output message from the model.
- title: Output message
- OpenAI.OutputItemReasoningItem:
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ OpenAI.ResponseMCPCallArgumentsDeltaEvent:
type: object
required:
- type
- - id
- - summary
+ - output_index
+ - item_id
+ - delta
+ - sequence_number
properties:
type:
type: string
enum:
- - reasoning
- description: The type of the object. Always `reasoning`.
+ - response.mcp_call_arguments.delta
+ description: The type of the event. Always 'response.mcp_call_arguments.delta'.
x-stainless-const: true
- id:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
type: string
- description: The unique identifier of the reasoning content.
- encrypted_content:
- anyOf:
- - type: string
- - type: 'null'
- summary:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.SummaryTextContent'
- description: Reasoning summary content.
- content:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ReasoningTextContent'
- description: Reasoning text content.
- status:
+ description: The unique identifier of the MCP tool call item being processed.
+ delta:
type: string
- enum:
- - in_progress
- - completed
- - incomplete
- description: |-
- The status of the item. One of `in_progress`, `completed`, or
- `incomplete`. Populated when items are returned via API.
+ description: A JSON string containing the partial update to the arguments for the MCP tool call.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- A description of the chain of thought used by a reasoning model while generating
- a response. Be sure to include these items in your `input` to the Responses API
- for subsequent turns of a conversation if you are manually
- [managing context](/docs/guides/conversation-state).
- title: Reasoning
- OpenAI.OutputItemToolSearchCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
+ title: ResponseMCPCallArgumentsDeltaEvent
+ x-oaiMeta:
+ name: response.mcp_call_arguments.delta
+ group: responses
+ example: |
+ {
+ "type": "response.mcp_call_arguments.delta",
+ "output_index": 0,
+ "item_id": "item-abc",
+ "delta": "{",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseMCPCallArgumentsDoneEvent:
type: object
required:
- type
- - id
- - call_id
- - execution
+ - output_index
+ - item_id
- arguments
- - status
+ - sequence_number
properties:
type:
type: string
enum:
- - tool_search_call
- description: The type of the item. Always `tool_search_call`.
+ - response.mcp_call_arguments.done
+ description: The type of the event. Always 'response.mcp_call_arguments.done'.
x-stainless-const: true
- default: tool_search_call
- id:
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
type: string
- description: The unique ID of the tool search call item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
+ description: The unique identifier of the MCP tool call item being processed.
arguments:
- description: Arguments used for the tool search call.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallStatus'
- description: The status of the tool search call item that was recorded.
- created_by:
type: string
- description: The identifier of the actor that created the item.
+ description: A JSON string containing the finalized arguments for the MCP tool call.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- OpenAI.OutputItemToolSearchOutput:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the arguments for an MCP tool call are finalized.
+ title: ResponseMCPCallArgumentsDoneEvent
+ x-oaiMeta:
+ name: response.mcp_call_arguments.done
+ group: responses
+ example: |
+ {
+ "type": "response.mcp_call_arguments.done",
+ "output_index": 0,
+ "item_id": "item-abc",
+ "arguments": "{"arg1": "value1", "arg2": "value2"}",
+ "sequence_number": 1
+ }
+ OpenAI.ResponseMCPCallCompletedEvent:
type: object
required:
- type
- - id
- - call_id
- - execution
- - tools
- - status
+ - item_id
+ - output_index
+ - sequence_number
properties:
type:
type: string
enum:
- - tool_search_output
- description: The type of the item. Always `tool_search_output`.
+ - response.mcp_call.completed
+ description: The type of the event. Always 'response.mcp_call.completed'.
x-stainless-const: true
- default: tool_search_output
- id:
- type: string
- description: The unique ID of the tool search output item.
- call_id:
- anyOf:
- - type: string
- - type: 'null'
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search was executed by the server or by the client.
- tools:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: The loaded tool definitions returned by tool search.
- status:
- $ref: '#/components/schemas/OpenAI.FunctionCallOutputStatusEnum'
- description: The status of the tool search output item that was recorded.
- created_by:
+ item_id:
type: string
- description: The identifier of the actor that created the item.
+ description: The ID of the MCP tool call item that completed.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that completed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- OpenAI.OutputItemType:
- anyOf:
- - type: string
- - type: string
- enum:
- - output_message
- - file_search_call
- - function_call
- - function_call_output
- - web_search_call
- - computer_call
- - computer_call_output
- - reasoning
- - tool_search_call
- - tool_search_output
- - additional_tools
- - compaction
- - image_generation_call
- - code_interpreter_call
- - local_shell_call
- - local_shell_call_output
- - shell_call
- - shell_call_output
- - apply_patch_call
- - apply_patch_call_output
- - mcp_call
- - mcp_list_tools
- - mcp_approval_request
- - mcp_approval_response
- - custom_tool_call
- - custom_tool_call_output
- - structured_outputs
- - oauth_consent_request
- - memory_search_call
- - memory_command_preview_call
- - memory_command_preview_call_output
- - workflow_action
- - a2a_preview_call
- - a2a_preview_call_output
- - bing_grounding_call
- - bing_grounding_call_output
- - sharepoint_grounding_preview_call
- - sharepoint_grounding_preview_call_output
- - azure_ai_search_call
- - azure_ai_search_call_output
- - bing_custom_search_preview_call
- - bing_custom_search_preview_call_output
- - openapi_call
- - openapi_call_output
- - browser_automation_preview_call
- - browser_automation_preview_call_output
- - fabric_dataagent_preview_call
- - fabric_dataagent_preview_call_output
- - azure_function_call
- - azure_function_call_output
- OpenAI.OutputItemWebSearchToolCall:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an MCP tool call has completed successfully.
+ title: ResponseMCPCallCompletedEvent
+ x-oaiMeta:
+ name: response.mcp_call.completed
+ group: responses
+ example: |
+ {
+ "type": "response.mcp_call.completed",
+ "sequence_number": 1,
+ "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90",
+ "output_index": 0
+ }
+ OpenAI.ResponseMCPCallFailedEvent:
type: object
required:
- - id
- type
- - status
- - action
+ - item_id
+ - output_index
+ - sequence_number
properties:
- id:
- type: string
- description: The unique ID of the web search tool call.
type:
type: string
enum:
- - web_search_call
- description: The type of the web search tool call. Always `web_search_call`.
+ - response.mcp_call.failed
+ description: The type of the event. Always 'response.mcp_call.failed'.
x-stainless-const: true
- status:
+ item_id:
type: string
- enum:
- - in_progress
- - searching
- - completed
- - failed
- - incomplete
- description: The status of the web search tool call.
- action:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage'
- - $ref: '#/components/schemas/OpenAI.WebSearchActionFind'
- description: |-
- 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_in_page).
+ description: The ID of the MCP tool call item that failed.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that failed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- The results of a web search tool call. See the
- [web search guide](/docs/guides/tools-web-search) for more information.
- title: Web search tool call
- OpenAI.OutputMessageContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an MCP tool call has failed.
+ title: ResponseMCPCallFailedEvent
+ x-oaiMeta:
+ name: response.mcp_call.failed
+ group: responses
+ example: |
+ {
+ "type": "response.mcp_call.failed",
+ "sequence_number": 1,
+ "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90",
+ "output_index": 0
+ }
+ OpenAI.ResponseMCPCallInProgressEvent:
type: object
required:
- type
+ - sequence_number
+ - output_index
+ - item_id
properties:
type:
- $ref: '#/components/schemas/OpenAI.OutputMessageContentType'
- discriminator:
- propertyName: type
- mapping:
- output_text: '#/components/schemas/OpenAI.OutputMessageContentOutputTextContent'
- refusal: '#/components/schemas/OpenAI.OutputMessageContentRefusalContent'
- OpenAI.OutputMessageContentOutputTextContent:
+ type: string
+ enum:
+ - response.mcp_call.in_progress
+ description: The type of the event. Always 'response.mcp_call.in_progress'.
+ x-stainless-const: true
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ item_id:
+ type: string
+ description: The unique identifier of the MCP tool call item being processed.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an MCP tool call is in progress.
+ title: ResponseMCPCallInProgressEvent
+ x-oaiMeta:
+ name: response.mcp_call.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.mcp_call.in_progress",
+ "sequence_number": 1,
+ "output_index": 0,
+ "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90"
+ }
+ OpenAI.ResponseMCPListToolsCompletedEvent:
type: object
required:
- type
- - text
- - annotations
- - logprobs
+ - item_id
+ - output_index
+ - sequence_number
properties:
type:
type: string
enum:
- - output_text
- description: The type of the output text. Always `output_text`.
+ - response.mcp_list_tools.completed
+ description: The type of the event. Always 'response.mcp_list_tools.completed'.
x-stainless-const: true
- default: output_text
- text:
+ item_id:
type: string
- description: The text output from the model.
- annotations:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Annotation'
- description: The annotations of the text output.
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.LogProb'
+ description: The ID of the MCP tool call item that produced this output.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that was processed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputMessageContent'
- description: A text output from the model.
- title: Output text
- OpenAI.OutputMessageContentRefusalContent:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the list of available MCP tools has been successfully retrieved.
+ title: ResponseMCPListToolsCompletedEvent
+ x-oaiMeta:
+ name: response.mcp_list_tools.completed
+ group: responses
+ example: |
+ {
+ "type": "response.mcp_list_tools.completed",
+ "sequence_number": 1,
+ "output_index": 0,
+ "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
+ }
+ OpenAI.ResponseMCPListToolsFailedEvent:
type: object
required:
- type
- - refusal
+ - item_id
+ - output_index
+ - sequence_number
properties:
type:
type: string
enum:
- - refusal
- description: The type of the refusal. Always `refusal`.
+ - response.mcp_list_tools.failed
+ description: The type of the event. Always 'response.mcp_list_tools.failed'.
x-stainless-const: true
- default: refusal
- refusal:
+ item_id:
type: string
- description: The refusal explanation from the model.
+ description: The ID of the MCP tool call item that failed.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that failed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.OutputMessageContent'
- description: A refusal from the model.
- title: Refusal
- OpenAI.OutputMessageContentType:
- anyOf:
- - type: string
- - type: string
- enum:
- - output_text
- - refusal
- OpenAI.Prompt:
- type: object
- required:
- - id
- properties:
- id:
- type: string
- description: The unique identifier of the prompt template to use.
- version:
- anyOf:
- - type: string
- - type: 'null'
- variables:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponsePromptVariables'
- - type: 'null'
- description: |-
- Reference to a prompt template and its variables.
- [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts).
- OpenAI.PromptCacheRetentionEnum:
- type: string
- enum:
- - in_memory
- - 24h
- OpenAI.RankerVersionType:
- type: string
- enum:
- - auto
- - default-2024-11-15
- OpenAI.RankingOptions:
- type: object
- properties:
- ranker:
- $ref: '#/components/schemas/OpenAI.RankerVersionType'
- description: The ranker to use for the file search.
- score_threshold:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: 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.
- hybrid_search:
- $ref: '#/components/schemas/OpenAI.HybridSearchOptions'
- description: Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
- OpenAI.RealtimeMCPError:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the attempt to list available MCP tools has failed.
+ title: ResponseMCPListToolsFailedEvent
+ x-oaiMeta:
+ name: response.mcp_list_tools.failed
+ group: responses
+ example: |
+ {
+ "type": "response.mcp_list_tools.failed",
+ "sequence_number": 1,
+ "output_index": 0,
+ "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
+ }
+ OpenAI.ResponseMCPListToolsInProgressEvent:
type: object
required:
- type
+ - item_id
+ - output_index
+ - sequence_number
properties:
type:
- $ref: '#/components/schemas/OpenAI.RealtimeMcpErrorType'
- discriminator:
- propertyName: type
- mapping:
- protocol_error: '#/components/schemas/OpenAI.RealtimeMCPProtocolError'
- tool_execution_error: '#/components/schemas/OpenAI.RealtimeMCPToolExecutionError'
- http_error: '#/components/schemas/OpenAI.RealtimeMCPHTTPError'
- OpenAI.RealtimeMCPHTTPError:
+ type: string
+ enum:
+ - response.mcp_list_tools.in_progress
+ description: The type of the event. Always 'response.mcp_list_tools.in_progress'.
+ x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the MCP tool call item that is being processed.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that is being processed.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when the system is in the process of retrieving the list of available MCP tools.
+ title: ResponseMCPListToolsInProgressEvent
+ x-oaiMeta:
+ name: response.mcp_list_tools.in_progress
+ group: responses
+ example: |
+ {
+ "type": "response.mcp_list_tools.in_progress",
+ "sequence_number": 1,
+ "output_index": 0,
+ "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
+ }
+ OpenAI.ResponseModalities:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ enum:
+ - text
+ - audio
+ - type: 'null'
+ description: |-
+ Output types that you would like the model to generate.
+ Most models are capable of generating text, which is the default:
+ `["text"]`
+ The `gpt-4o-audio-preview` model can also be used to
+ [generate audio](/docs/guides/audio). To request that this model generate
+ both text and audio responses, you can use:
+ `["text", "audio"]`
+ OpenAI.ResponseOutputItemAddedEvent:
type: object
required:
- type
- - code
- - message
+ - output_index
+ - sequence_number
+ - item
properties:
type:
type: string
enum:
- - http_error
+ - response.output_item.added
+ description: The type of the event. Always `response.output_item.added`.
x-stainless-const: true
- code:
+ output_index:
$ref: '#/components/schemas/OpenAI.integer'
- message:
- type: string
+ description: The index of the output item that was added.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ item:
+ $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output item that was added.
allOf:
- - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
- title: Realtime MCP HTTP error
- OpenAI.RealtimeMCPProtocolError:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a new output item is added.
+ x-oaiMeta:
+ name: response.output_item.added
+ group: responses
+ example: |
+ {
+ "type": "response.output_item.added",
+ "output_index": 0,
+ "item": {
+ "id": "msg_123",
+ "status": "in_progress",
+ "type": "message",
+ "role": "assistant",
+ "content": []
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseOutputItemDoneEvent:
type: object
required:
- type
- - code
- - message
+ - output_index
+ - sequence_number
+ - item
properties:
type:
type: string
enum:
- - protocol_error
+ - response.output_item.done
+ description: The type of the event. Always `response.output_item.done`.
x-stainless-const: true
- code:
+ output_index:
$ref: '#/components/schemas/OpenAI.integer'
- message:
- type: string
+ description: The index of the output item that was marked done.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ item:
+ $ref: '#/components/schemas/OpenAI.OutputItem'
+ description: The output item that was marked done.
allOf:
- - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
- title: Realtime MCP protocol error
- OpenAI.RealtimeMCPToolExecutionError:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an output item is marked done.
+ x-oaiMeta:
+ name: response.output_item.done
+ group: responses
+ example: |
+ {
+ "type": "response.output_item.done",
+ "output_index": 0,
+ "item": {
+ "id": "msg_123",
+ "status": "completed",
+ "type": "message",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
+ "annotations": []
+ }
+ ]
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseOutputTextAnnotationAddedEvent:
type: object
required:
- type
- - message
+ - item_id
+ - output_index
+ - content_index
+ - annotation_index
+ - sequence_number
+ - annotation
properties:
type:
type: string
enum:
- - tool_execution_error
+ - response.output_text.annotation.added
+ description: The type of the event. Always 'response.output_text.annotation.added'.
x-stainless-const: true
- message:
+ item_id:
type: string
+ description: The unique identifier of the item to which the annotation is being added.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item in the response's output array.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the content part within the output item.
+ annotation_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the annotation within the content part.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of this event.
+ annotation:
+ $ref: '#/components/schemas/OpenAI.Annotation'
+ description: The annotation object being added. (See annotation schema for details.)
allOf:
- - $ref: '#/components/schemas/OpenAI.RealtimeMCPError'
- title: Realtime MCP tool execution error
- OpenAI.RealtimeMcpErrorType:
- anyOf:
- - type: string
- - type: string
- enum:
- - protocol_error
- - tool_execution_error
- - http_error
- OpenAI.Reasoning:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when an annotation is added to output text content.
+ title: ResponseOutputTextAnnotationAddedEvent
+ x-oaiMeta:
+ name: response.output_text.annotation.added
+ group: responses
+ example: |
+ {
+ "type": "response.output_text.annotation.added",
+ "item_id": "item-abc",
+ "output_index": 0,
+ "content_index": 0,
+ "annotation_index": 0,
+ "annotation": {
+ "type": "text_annotation",
+ "text": "This is a test annotation",
+ "start": 0,
+ "end": 10
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponsePromptVariables:
type: object
- properties:
- effort:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ReasoningEffort'
- - type: 'null'
- summary:
- anyOf:
- - type: string
- enum:
- - auto
- - concise
- - detailed
- - type: 'null'
- context:
- anyOf:
- - type: string
- enum:
- - auto
- - current_turn
- - all_turns
- - type: 'null'
- generate_summary:
- anyOf:
- - type: string
- enum:
- - auto
- - concise
- - detailed
- - type: 'null'
- description: |-
- **gpt-5 and o-series models only**
- Configuration options for
- [reasoning models](https://platform.openai.com/docs/guides/reasoning).
- title: Reasoning
- OpenAI.ReasoningEffort:
- anyOf:
- - type: string
- - type: string
- enum:
- - none
- - minimal
- - low
- - medium
- - high
- - xhigh
+ unevaluatedProperties:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.InputTextContent'
+ - $ref: '#/components/schemas/OpenAI.InputImageContent'
+ - $ref: '#/components/schemas/OpenAI.InputFileContent'
description: |-
- Constrains effort on reasoning for
- [reasoning models](https://platform.openai.com/docs/guides/reasoning).
- Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing
- reasoning effort can result in faster responses and fewer tokens used
- on reasoning in a response.
- - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
- - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
- - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
- - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
- OpenAI.ReasoningTextContent:
+ Optional map of values to substitute in for variables in your
+ prompt. The substitution values can either be strings, or other
+ Response input types like images or files.
+ title: Prompt Variables
+ x-oaiExpandable: true
+ x-oaiTypeLabel: map
+ OpenAI.ResponseQueuedEvent:
type: object
required:
- type
- - text
+ - response
+ - sequence_number
properties:
type:
type: string
enum:
- - reasoning_text
- description: The type of the reasoning text. Always `reasoning_text`.
- x-stainless-const: true
- default: reasoning_text
- text:
- type: string
- description: The reasoning text from the model.
- description: Reasoning text from the model.
- title: Reasoning text
- OpenAI.Response:
- type: object
- required:
- - id
- - object
- - created_at
- - error
- - incomplete_details
- - output
- - instructions
- - parallel_tool_calls
- - agent_reference
- properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- top_logprobs:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- temperature:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- top_p:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: 'null'
- default: 1
- user:
- type: string
- description: |-
- 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](/docs/guides/safety-best-practices#safety-identifiers).
- deprecated: true
- safety_identifier:
- type: string
- maxLength: 64
- description: |-
- 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, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
- prompt_cache_key:
- type: string
- description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
- service_tier:
- $ref: '#/components/schemas/OpenAI.ServiceTier'
- prompt_cache_retention:
- anyOf:
- - type: string
- enum:
- - in_memory
- - 24h
- - type: 'null'
- previous_response_id:
- anyOf:
- - type: string
- - type: 'null'
- model:
- type: string
- description: The model deployment to use for the creation of this response.
- background:
- anyOf:
- - type: boolean
- - type: 'null'
- max_tool_calls:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- text:
- $ref: '#/components/schemas/OpenAI.ResponseTextParam'
- tools:
- $ref: '#/components/schemas/OpenAI.ToolsArray'
- tool_choice:
- oneOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions'
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- prompt:
- $ref: '#/components/schemas/OpenAI.Prompt'
- truncation:
- anyOf:
- - type: string
- enum:
- - auto
- - disabled
- - type: 'null'
- default: disabled
- id:
- type: string
- description: Unique identifier for this Response.
- object:
- type: string
- enum:
- - response
- description: The object type of this resource - always set to `response`.
+ - response.queued
+ description: The type of the event. Always 'response.queued'.
x-stainless-const: true
- status:
- type: string
- enum:
- - completed
- - failed
- - in_progress
- - cancelled
- - queued
- - incomplete
- description: |-
- The status of the response generation. One of `completed`, `failed`,
- `in_progress`, `cancelled`, `queued`, or `incomplete`.
- created_at:
- type: integer
- format: unixtime
- description: Unix timestamp (in seconds) of when this Response was created.
- completed_at:
- anyOf:
- - type: string
- format: date-time
- - type: 'null'
- type: integer
- format: unixTimestamp
- error:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseError'
- - type: 'null'
- incomplete_details:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails'
- - type: 'null'
- output:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: |-
- An array of content items generated by the model.
- - The length and order of items in the `output` array is dependent
- on the model's response.
- - Rather than accessing the first item in the `output` array and
- assuming it's an `assistant` message with the content generated by
- the model, you might consider using the `output_text` property where
- supported in SDKs.
- reasoning:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Reasoning'
- - type: 'null'
- instructions:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/OpenAI.InputItem'
- - type: 'null'
- output_text:
- anyOf:
- - type: string
- - type: 'null'
- usage:
- $ref: '#/components/schemas/OpenAI.ResponseUsage'
- moderation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Moderation'
- - type: 'null'
- parallel_tool_calls:
- type: boolean
- description: Whether to allow the model to run tool calls in parallel.
- default: true
- conversation:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.ConversationReference'
- - type: 'null'
- max_output_tokens:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.integer'
- - type: 'null'
- agent:
- $ref: '#/components/schemas/AgentId'
- description: |-
- (Deprecated) Use agent_reference instead.
- The agent used for this response
- agent_session_id:
- type: string
- description: |-
- The session identifier for this response. Currently only relevant for hosted agents.
- Always returned for hosted agents — either the caller-provided value, the auto-derived value,
- or an auto-generated UUID. Use for session-scoped operations and to maintain sandbox
- affinity in follow-up calls.
- agent_reference:
- anyOf:
- - $ref: '#/components/schemas/AgentReference'
- - type: 'null'
- description: The agent used for this response
- content_filters:
- type: array
- items:
- $ref: '#/components/schemas/ContentFilterResult'
- description: The content filter evaluation results.
- title: The response object
- OpenAI.ResponseAudioDeltaEvent:
+ response:
+ $ref: '#/components/schemas/OpenAI.Response'
+ description: The full response object that is queued.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number for this event.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
+ description: Emitted when a response is queued and waiting to be processed.
+ title: ResponseQueuedEvent
+ x-oaiMeta:
+ name: response.queued
+ group: responses
+ example: |
+ {
+ "type": "response.queued",
+ "response": {
+ "id": "res_123",
+ "status": "queued",
+ "created_at": "2021-01-01T00:00:00Z",
+ "updated_at": "2021-01-01T00:00:00Z"
+ },
+ "sequence_number": 1
+ }
+ OpenAI.ResponseReasoningSummaryPartAddedEvent:
type: object
required:
- type
+ - item_id
+ - output_index
+ - summary_index
- sequence_number
- - delta
+ - part
properties:
type:
type: string
enum:
- - response.audio.delta
- description: The type of the event. Always `response.audio.delta`.
+ - response.reasoning_summary_part.added
+ description: The type of the event. Always `response.reasoning_summary_part.added`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the item this summary part is associated with.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item this summary part is associated with.
+ summary_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the summary part within the reasoning summary.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: A sequence number for this chunk of the stream response.
- delta:
- type: string
- contentEncoding: base64
- description: A chunk of Base64 encoded response audio bytes.
+ description: The sequence number of this event.
+ part:
+ $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart'
+ description: The summary part that was added.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a partial audio response.
+ description: Emitted when a new reasoning summary part is added.
x-oaiMeta:
- name: response.audio.delta
+ name: response.reasoning_summary_part.added
group: responses
example: |
{
- "type": "response.audio.delta",
- "response_id": "resp_123",
- "delta": "base64encoded...",
+ "type": "response.reasoning_summary_part.added",
+ "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
+ "output_index": 0,
+ "summary_index": 0,
+ "part": {
+ "type": "summary_text",
+ "text": ""
+ },
"sequence_number": 1
}
- OpenAI.ResponseAudioDoneEvent:
+ OpenAI.ResponseReasoningSummaryPartAddedEventPart:
type: object
required:
- type
- - sequence_number
+ - text
properties:
type:
type: string
enum:
- - response.audio.done
- description: The type of the event. Always `response.audio.done`.
+ - summary_text
x-stainless-const: true
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the delta.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the audio response is complete.
- x-oaiMeta:
- name: response.audio.done
- group: responses
- example: |
- {
- "type": "response.audio.done",
- "response_id": "resp-123",
- "sequence_number": 1
- }
- OpenAI.ResponseAudioTranscriptDeltaEvent:
+ text:
+ type: string
+ OpenAI.ResponseReasoningSummaryPartDoneEvent:
type: object
required:
- type
- - delta
+ - item_id
+ - output_index
+ - summary_index
- sequence_number
+ - part
properties:
type:
type: string
enum:
- - response.audio.transcript.delta
- description: The type of the event. Always `response.audio.transcript.delta`.
+ - response.reasoning_summary_part.done
+ description: The type of the event. Always `response.reasoning_summary_part.done`.
x-stainless-const: true
- delta:
+ item_id:
type: string
- description: The partial transcript of the audio response.
+ description: The ID of the item this summary part is associated with.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item this summary part is associated with.
+ summary_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the summary part within the reasoning summary.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
description: The sequence number of this event.
+ part:
+ $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEventPart'
+ description: The completed summary part.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a partial transcript of audio.
+ description: Emitted when a reasoning summary part is completed.
x-oaiMeta:
- name: response.audio.transcript.delta
+ name: response.reasoning_summary_part.done
group: responses
example: |
{
- "type": "response.audio.transcript.delta",
- "response_id": "resp_123",
- "delta": " ... partial transcript ... ",
+ "type": "response.reasoning_summary_part.done",
+ "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
+ "output_index": 0,
+ "summary_index": 0,
+ "part": {
+ "type": "summary_text",
+ "text": "**Responding to a greeting**
+
+ The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!"
+ },
"sequence_number": 1
}
- OpenAI.ResponseAudioTranscriptDoneEvent:
+ OpenAI.ResponseReasoningSummaryPartDoneEventPart:
type: object
required:
- type
- - sequence_number
+ - text
properties:
type:
type: string
enum:
- - response.audio.transcript.done
- description: The type of the event. Always `response.audio.transcript.done`.
+ - summary_text
x-stainless-const: true
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the full audio transcript is completed.
- x-oaiMeta:
- name: response.audio.transcript.done
- group: responses
- example: |
- {
- "type": "response.audio.transcript.done",
- "response_id": "resp_123",
- "sequence_number": 1
- }
- OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent:
+ text:
+ type: string
+ OpenAI.ResponseReasoningSummaryTextDeltaEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
+ - summary_index
- delta
- sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call_code.delta
- description: The type of the event. Always `response.code_interpreter_call_code.delta`.
+ - response.reasoning_summary_text.delta
+ description: The type of the event. Always `response.reasoning_summary_text.delta`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code is being streamed.
item_id:
type: string
- description: The unique identifier of the code interpreter tool call item.
+ description: The ID of the item this summary text delta is associated with.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item this summary text delta is associated with.
+ summary_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the summary part within the reasoning summary.
delta:
type: string
- description: The partial code snippet being streamed by the code interpreter.
+ description: The text delta that was added to the summary.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a partial code snippet is streamed by the code interpreter.
+ description: Emitted when a delta is added to a reasoning summary text.
x-oaiMeta:
- name: response.code_interpreter_call_code.delta
+ name: response.reasoning_summary_text.delta
group: responses
example: |
{
- "type": "response.code_interpreter_call_code.delta",
+ "type": "response.reasoning_summary_text.delta",
+ "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
"output_index": 0,
- "item_id": "ci_12345",
- "delta": "print('Hello, world')",
+ "summary_index": 0,
+ "delta": "**Responding to a greeting**
+
+ The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
"sequence_number": 1
}
- OpenAI.ResponseCodeInterpreterCallCodeDoneEvent:
+ OpenAI.ResponseReasoningSummaryTextDoneEvent:
type: object
required:
- type
- - output_index
- item_id
- - code
+ - output_index
+ - summary_index
+ - text
- sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call_code.done
- description: The type of the event. Always `response.code_interpreter_call_code.done`.
+ - response.reasoning_summary_text.done
+ description: The type of the event. Always `response.reasoning_summary_text.done`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code is finalized.
item_id:
type: string
- description: The unique identifier of the code interpreter tool call item.
- code:
+ description: The ID of the item this summary text is associated with.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item this summary text is associated with.
+ summary_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the summary part within the reasoning summary.
+ text:
type: string
- description: The final code snippet output by the code interpreter.
+ description: The full text of the completed reasoning summary.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the code snippet is finalized by the code interpreter.
+ description: Emitted when a reasoning summary text is completed.
x-oaiMeta:
- name: response.code_interpreter_call_code.done
+ name: response.reasoning_summary_text.done
group: responses
example: |
{
- "type": "response.code_interpreter_call_code.done",
- "output_index": 3,
- "item_id": "ci_12345",
- "code": "print('done')",
+ "type": "response.reasoning_summary_text.done",
+ "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
+ "output_index": 0,
+ "summary_index": 0,
+ "text": "**Responding to a greeting**
+
+ The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
"sequence_number": 1
}
- OpenAI.ResponseCodeInterpreterCallCompletedEvent:
+ OpenAI.ResponseReasoningTextDeltaEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
+ - content_index
+ - delta
- sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call.completed
- description: The type of the event. Always `response.code_interpreter_call.completed`.
+ - response.reasoning_text.delta
+ description: The type of the event. Always `response.reasoning_text.delta`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the item this reasoning text delta is associated with.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code interpreter call is completed.
- item_id:
+ description: The index of the output item this reasoning text delta is associated with.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the reasoning content part this delta is associated with.
+ delta:
type: string
- description: The unique identifier of the code interpreter tool call item.
+ description: The text delta that was added to the reasoning content.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the code interpreter call is completed.
+ description: Emitted when a delta is added to a reasoning text.
x-oaiMeta:
- name: response.code_interpreter_call.completed
+ name: response.reasoning_text.delta
group: responses
example: |
{
- "type": "response.code_interpreter_call.completed",
- "output_index": 5,
- "item_id": "ci_12345",
+ "type": "response.reasoning_text.delta",
+ "item_id": "rs_123",
+ "output_index": 0,
+ "content_index": 0,
+ "delta": "The",
"sequence_number": 1
}
- OpenAI.ResponseCodeInterpreterCallInProgressEvent:
+ OpenAI.ResponseReasoningTextDoneEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
+ - content_index
+ - text
- sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call.in_progress
- description: The type of the event. Always `response.code_interpreter_call.in_progress`.
+ - response.reasoning_text.done
+ description: The type of the event. Always `response.reasoning_text.done`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the item this reasoning text is associated with.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code interpreter call is in progress.
- item_id:
+ description: The index of the output item this reasoning text is associated with.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the reasoning content part.
+ text:
type: string
- description: The unique identifier of the code interpreter tool call item.
+ description: The full text of the completed reasoning content.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a code interpreter call is in progress.
+ description: Emitted when a reasoning text is completed.
x-oaiMeta:
- name: response.code_interpreter_call.in_progress
+ name: response.reasoning_text.done
group: responses
example: |
{
- "type": "response.code_interpreter_call.in_progress",
+ "type": "response.reasoning_text.done",
+ "item_id": "rs_123",
"output_index": 0,
- "item_id": "ci_12345",
- "sequence_number": 1
+ "content_index": 0,
+ "text": "The user is asking...",
+ "sequence_number": 4
}
- OpenAI.ResponseCodeInterpreterCallInterpretingEvent:
+ OpenAI.ResponseRefusalDeltaEvent:
type: object
required:
- type
- - output_index
- item_id
+ - output_index
+ - content_index
+ - delta
- sequence_number
properties:
type:
type: string
enum:
- - response.code_interpreter_call.interpreting
- description: The type of the event. Always `response.code_interpreter_call.interpreting`.
+ - response.refusal.delta
+ description: The type of the event. Always `response.refusal.delta`.
x-stainless-const: true
+ item_id:
+ type: string
+ description: The ID of the output item that the refusal text is added to.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response for which the code interpreter is interpreting code.
- item_id:
+ description: The index of the output item that the refusal text is added to.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the content part that the refusal text is added to.
+ delta:
type: string
- description: The unique identifier of the code interpreter tool call item.
+ description: The refusal text that is added.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event, used to order streaming events.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the code interpreter is actively interpreting the code snippet.
+ description: Emitted when there is a partial refusal text.
x-oaiMeta:
- name: response.code_interpreter_call.interpreting
+ name: response.refusal.delta
group: responses
example: |
{
- "type": "response.code_interpreter_call.interpreting",
- "output_index": 4,
- "item_id": "ci_12345",
+ "type": "response.refusal.delta",
+ "item_id": "msg_123",
+ "output_index": 0,
+ "content_index": 0,
+ "delta": "refusal text so far",
"sequence_number": 1
}
- OpenAI.ResponseCompletedEvent:
+ OpenAI.ResponseRefusalDoneEvent:
type: object
required:
- type
- - response
+ - item_id
+ - output_index
+ - content_index
+ - refusal
- sequence_number
properties:
type:
type: string
enum:
- - response.completed
- description: The type of the event. Always `response.completed`.
+ - response.refusal.done
+ description: The type of the event. Always `response.refusal.done`.
x-stainless-const: true
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: Properties of the completed response.
+ item_id:
+ type: string
+ description: The ID of the output item that the refusal text is finalized.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the refusal text is finalized.
+ content_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the content part that the refusal text is finalized.
+ refusal:
+ type: string
+ description: The refusal text that is finalized.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number for this event.
+ description: The sequence number of this event.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the model response is complete.
+ description: Emitted when refusal text is finalized.
x-oaiMeta:
- name: response.completed
+ name: response.refusal.done
group: responses
example: |
{
- "type": "response.completed",
- "response": {
- "id": "resp_123",
- "object": "response",
- "created_at": 1740855869,
- "status": "completed",
- "completed_at": 1740855870,
- "error": null,
- "incomplete_details": null,
- "input": [],
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-mini-2024-07-18",
- "output": [
- {
- "id": "msg_123",
- "type": "message",
- "role": "assistant",
- "content": [
- {
- "type": "output_text",
- "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
- "annotations": []
- }
- ]
- }
- ],
- "previous_response_id": null,
- "reasoning_effort": null,
- "store": false,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "output_tokens_details": {
- "reasoning_tokens": 0
- },
- "total_tokens": 0
- },
- "user": null,
- "metadata": {}
- },
+ "type": "response.refusal.done",
+ "item_id": "item-abc",
+ "output_index": 1,
+ "content_index": 2,
+ "refusal": "final refusal text",
"sequence_number": 1
}
- OpenAI.ResponseContentPartAddedEvent:
+ OpenAI.ResponseStreamEvent:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.ResponseStreamEventType'
+ discriminator:
+ propertyName: type
+ mapping:
+ response.audio.done: '#/components/schemas/OpenAI.ResponseAudioDoneEvent'
+ response.audio.transcript.delta: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent'
+ response.audio.transcript.done: '#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent'
+ response.code_interpreter_call_code.delta: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent'
+ response.code_interpreter_call_code.done: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent'
+ response.code_interpreter_call.completed: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent'
+ response.code_interpreter_call.in_progress: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent'
+ response.code_interpreter_call.interpreting: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent'
+ response.completed: '#/components/schemas/OpenAI.ResponseCompletedEvent'
+ response.content_part.added: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent'
+ response.content_part.done: '#/components/schemas/OpenAI.ResponseContentPartDoneEvent'
+ response.created: '#/components/schemas/OpenAI.ResponseCreatedEvent'
+ response.custom_tool_call_input.delta: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent'
+ response.custom_tool_call_input.done: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent'
+ error: '#/components/schemas/OpenAI.ResponseErrorEvent'
+ response.failed: '#/components/schemas/OpenAI.ResponseFailedEvent'
+ response.file_search_call.completed: '#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent'
+ response.file_search_call.in_progress: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent'
+ response.file_search_call.searching: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent'
+ response.function_call_arguments.delta: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent'
+ response.function_call_arguments.done: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent'
+ response.image_generation_call.completed: '#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent'
+ response.image_generation_call.generating: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent'
+ response.image_generation_call.in_progress: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent'
+ response.image_generation_call.partial_image: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent'
+ response.in_progress: '#/components/schemas/OpenAI.ResponseInProgressEvent'
+ response.incomplete: '#/components/schemas/OpenAI.ResponseIncompleteEvent'
+ response.mcp_call_arguments.delta: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent'
+ response.mcp_call_arguments.done: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent'
+ response.mcp_call.completed: '#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent'
+ response.mcp_call.failed: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent'
+ response.mcp_call.in_progress: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent'
+ response.mcp_list_tools.completed: '#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent'
+ response.mcp_list_tools.failed: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent'
+ response.mcp_list_tools.in_progress: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent'
+ response.output_item.added: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent'
+ response.output_item.done: '#/components/schemas/OpenAI.ResponseOutputItemDoneEvent'
+ response.output_text.annotation.added: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent'
+ response.queued: '#/components/schemas/OpenAI.ResponseQueuedEvent'
+ response.reasoning_summary_part.added: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent'
+ response.reasoning_summary_part.done: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent'
+ response.reasoning_summary_text.delta: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent'
+ response.reasoning_summary_text.done: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent'
+ response.reasoning_text.delta: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent'
+ response.reasoning_text.done: '#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent'
+ response.refusal.delta: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent'
+ response.refusal.done: '#/components/schemas/OpenAI.ResponseRefusalDoneEvent'
+ response.output_text.delta: '#/components/schemas/OpenAI.ResponseTextDeltaEvent'
+ response.output_text.done: '#/components/schemas/OpenAI.ResponseTextDoneEvent'
+ response.web_search_call.completed: '#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent'
+ response.web_search_call.in_progress: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent'
+ response.web_search_call.searching: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent'
+ response.audio.delta: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent'
+ OpenAI.ResponseStreamEventType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - response.audio.delta
+ - response.audio.done
+ - response.audio.transcript.delta
+ - response.audio.transcript.done
+ - response.code_interpreter_call_code.delta
+ - response.code_interpreter_call_code.done
+ - response.code_interpreter_call.completed
+ - response.code_interpreter_call.in_progress
+ - response.code_interpreter_call.interpreting
+ - response.completed
+ - response.content_part.added
+ - response.content_part.done
+ - response.created
+ - error
+ - response.file_search_call.completed
+ - response.file_search_call.in_progress
+ - response.file_search_call.searching
+ - response.function_call_arguments.delta
+ - response.function_call_arguments.done
+ - response.in_progress
+ - response.failed
+ - response.incomplete
+ - response.output_item.added
+ - response.output_item.done
+ - response.reasoning_summary_part.added
+ - response.reasoning_summary_part.done
+ - response.reasoning_summary_text.delta
+ - response.reasoning_summary_text.done
+ - response.reasoning_text.delta
+ - response.reasoning_text.done
+ - response.refusal.delta
+ - response.refusal.done
+ - response.output_text.delta
+ - response.output_text.done
+ - response.web_search_call.completed
+ - response.web_search_call.in_progress
+ - response.web_search_call.searching
+ - response.image_generation_call.completed
+ - response.image_generation_call.generating
+ - response.image_generation_call.in_progress
+ - response.image_generation_call.partial_image
+ - response.mcp_call_arguments.delta
+ - response.mcp_call_arguments.done
+ - response.mcp_call.completed
+ - response.mcp_call.failed
+ - response.mcp_call.in_progress
+ - response.mcp_list_tools.completed
+ - response.mcp_list_tools.failed
+ - response.mcp_list_tools.in_progress
+ - response.output_text.annotation.added
+ - response.queued
+ - response.custom_tool_call_input.delta
+ - response.custom_tool_call_input.done
+ OpenAI.ResponseStreamOptions:
+ type: object
+ properties:
+ include_obfuscation:
+ type: boolean
+ description: |-
+ 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.
+ description: 'Options for streaming responses. Only set this when you set `stream: true`.'
+ OpenAI.ResponseTextDeltaEvent:
type: object
required:
- type
- item_id
- output_index
- content_index
- - part
+ - delta
- sequence_number
+ - logprobs
properties:
type:
type: string
enum:
- - response.content_part.added
- description: The type of the event. Always `response.content_part.added`.
+ - response.output_text.delta
+ description: The type of the event. Always `response.output_text.delta`.
x-stainless-const: true
item_id:
type: string
- description: The ID of the output item that the content part was added to.
+ description: The ID of the output item that the text delta was added to.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the content part was added to.
+ description: The index of the output item that the text delta was added to.
content_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that was added.
- part:
- $ref: '#/components/schemas/OpenAI.OutputContent'
- description: The content part that was added.
+ description: The index of the content part that the text delta was added to.
+ delta:
+ type: string
+ description: The text delta that was added.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: The sequence number for this event.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ResponseLogProb'
+ description: The log probabilities of the tokens in the delta.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a new content part is added.
+ description: Emitted when there is an additional text delta.
x-oaiMeta:
- name: response.content_part.added
+ name: response.output_text.delta
group: responses
example: |
{
- "type": "response.content_part.added",
+ "type": "response.output_text.delta",
"item_id": "msg_123",
"output_index": 0,
"content_index": 0,
- "part": {
- "type": "output_text",
- "text": "",
- "annotations": []
- },
+ "delta": "In",
"sequence_number": 1
}
- OpenAI.ResponseContentPartDoneEvent:
+ OpenAI.ResponseTextDoneEvent:
type: object
required:
- type
- item_id
- output_index
- content_index
+ - text
- sequence_number
- - part
+ - logprobs
properties:
type:
type: string
enum:
- - response.content_part.done
- description: The type of the event. Always `response.content_part.done`.
+ - response.output_text.done
+ description: The type of the event. Always `response.output_text.done`.
x-stainless-const: true
item_id:
type: string
- description: The ID of the output item that the content part was added to.
+ description: The ID of the output item that the text content is finalized.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the content part was added to.
+ description: The index of the output item that the text content is finalized.
content_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that is done.
+ description: The index of the content part that the text content is finalized.
+ text:
+ type: string
+ description: The text content that is finalized.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- part:
- $ref: '#/components/schemas/OpenAI.OutputContent'
- description: The content part that is done.
+ description: The sequence number for this event.
+ logprobs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.ResponseLogProb'
+ description: The log probabilities of the tokens in the delta.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a content part is done.
+ description: Emitted when text content is finalized.
x-oaiMeta:
- name: response.content_part.done
+ name: response.output_text.done
group: responses
example: |
{
- "type": "response.content_part.done",
+ "type": "response.output_text.done",
"item_id": "msg_123",
"output_index": 0,
"content_index": 0,
- "sequence_number": 1,
- "part": {
- "type": "output_text",
- "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
- "annotations": []
- }
+ "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
+ "sequence_number": 1
}
- OpenAI.ResponseCreatedEvent:
+ OpenAI.ResponseTextParam:
+ type: object
+ properties:
+ format:
+ $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
+ verbosity:
+ $ref: '#/components/schemas/OpenAI.Verbosity'
+ description: |-
+ Configuration options for a text response from the model. Can be plain
+ text or structured JSON data. Learn more:
+ - [Text inputs and outputs](/docs/guides/text)
+ - [Structured Outputs](/docs/guides/structured-outputs)
+ OpenAI.ResponseUsage:
+ type: object
+ required:
+ - input_tokens
+ - input_tokens_details
+ - output_tokens
+ - output_tokens_details
+ - total_tokens
+ properties:
+ input_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of input tokens.
+ input_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails'
+ description: A detailed breakdown of the input tokens.
+ output_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The number of output tokens.
+ output_tokens_details:
+ $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails'
+ description: A detailed breakdown of the output tokens.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total number of tokens used.
+ description: |-
+ Represents token usage details including input tokens, output tokens,
+ a breakdown of output tokens, and the total tokens used.
+ OpenAI.ResponseUsageInputTokensDetails:
+ type: object
+ required:
+ - cached_tokens
+ properties:
+ cached_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.ResponseUsageOutputTokensDetails:
+ type: object
+ required:
+ - reasoning_tokens
+ properties:
+ reasoning_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.ResponseWebSearchCallCompletedEvent:
type: object
required:
- type
- - response
+ - output_index
+ - item_id
- sequence_number
properties:
type:
type: string
enum:
- - response.created
- description: The type of the event. Always `response.created`.
+ - response.web_search_call.completed
+ description: The type of the event. Always `response.web_search_call.completed`.
x-stainless-const: true
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The response that was created.
+ output_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the output item that the web search call is associated with.
+ item_id:
+ type: string
+ description: Unique ID for the output item associated with the web search call.
sequence_number:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number for this event.
+ description: The sequence number of the web search call being processed.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: An event that is emitted when a response is created.
+ description: Emitted when a web search call is completed.
x-oaiMeta:
- name: response.created
+ name: response.web_search_call.completed
group: responses
example: |
{
- "type": "response.created",
- "response": {
- "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
- "object": "response",
- "created_at": 1741487325,
- "status": "in_progress",
- "completed_at": null,
- "error": null,
- "incomplete_details": null,
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-2024-08-06",
- "output": [],
- "parallel_tool_calls": true,
- "previous_response_id": null,
- "reasoning": {
- "effort": null,
- "summary": null
- },
- "store": true,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": null,
- "user": null,
- "metadata": {}
- },
- "sequence_number": 1
+ "type": "response.web_search_call.completed",
+ "output_index": 0,
+ "item_id": "ws_123",
+ "sequence_number": 0
}
- OpenAI.ResponseCustomToolCallInputDeltaEvent:
+ OpenAI.ResponseWebSearchCallInProgressEvent:
type: object
required:
- type
- - sequence_number
- output_index
- item_id
- - delta
+ - sequence_number
properties:
type:
type: string
enum:
- - response.custom_tool_call_input.delta
- description: The event type identifier.
+ - response.web_search_call.in_progress
+ description: The type of the event. Always `response.web_search_call.in_progress`.
x-stainless-const: true
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output this delta applies to.
+ description: The index of the output item that the web search call is associated with.
item_id:
type: string
- description: Unique identifier for the API item associated with this event.
- delta:
- type: string
- description: The incremental input data (delta) for the custom tool call.
+ description: Unique ID for the output item associated with the web search call.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the web search call being processed.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Event representing a delta (partial update) to the input of a custom tool call.
- title: ResponseCustomToolCallInputDelta
+ description: Emitted when a web search call is initiated.
x-oaiMeta:
- name: response.custom_tool_call_input.delta
+ name: response.web_search_call.in_progress
group: responses
example: |
{
- "type": "response.custom_tool_call_input.delta",
+ "type": "response.web_search_call.in_progress",
"output_index": 0,
- "item_id": "ctc_1234567890abcdef",
- "delta": "partial input text"
+ "item_id": "ws_123",
+ "sequence_number": 0
}
- OpenAI.ResponseCustomToolCallInputDoneEvent:
+ OpenAI.ResponseWebSearchCallSearchingEvent:
type: object
required:
- type
- - sequence_number
- output_index
- item_id
- - input
+ - sequence_number
properties:
type:
type: string
enum:
- - response.custom_tool_call_input.done
- description: The event type identifier.
+ - response.web_search_call.searching
+ description: The type of the event. Always `response.web_search_call.searching`.
x-stainless-const: true
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
output_index:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output this event applies to.
+ description: The index of the output item that the web search call is associated with.
item_id:
type: string
- description: Unique identifier for the API item associated with this event.
- input:
- type: string
- description: The complete input data for the custom tool call.
+ description: Unique ID for the output item associated with the web search call.
+ sequence_number:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The sequence number of the web search call being processed.
allOf:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Event indicating that input for a custom tool call is complete.
- title: ResponseCustomToolCallInputDone
+ description: Emitted when a web search call is executing.
x-oaiMeta:
- name: response.custom_tool_call_input.done
+ name: response.web_search_call.searching
group: responses
example: |
{
- "type": "response.custom_tool_call_input.done",
+ "type": "response.web_search_call.searching",
"output_index": 0,
- "item_id": "ctc_1234567890abcdef",
- "input": "final complete input text"
+ "item_id": "ws_123",
+ "sequence_number": 0
}
- OpenAI.ResponseError:
+ OpenAI.RunCompletionUsage:
type: object
required:
- - code
- - message
+ - completion_tokens
+ - prompt_tokens
+ - total_tokens
properties:
- code:
- $ref: '#/components/schemas/OpenAI.ResponseErrorCode'
- message:
+ completion_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of completion tokens used over the course of the run.
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of prompt tokens used over the course of the run.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Total number of tokens used (prompt + completion).
+ description: 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.).
+ OpenAI.RunGraderRequest:
+ type: object
+ required:
+ - grader
+ - model_sample
+ properties:
+ grader:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderMulti'
+ description: The grader used for the fine-tuning job.
+ item:
+ $ref: '#/components/schemas/OpenAI.RunGraderRequestItem'
+ description: |-
+ The dataset item provided to the grader. This will be used to populate
+ the `item` namespace. See [the guide](/docs/guides/graders) for more details.
+ model_sample:
type: string
- description: A human-readable description of the error.
- description: An error object returned when the model fails to generate a Response.
- OpenAI.ResponseErrorCode:
- type: string
- enum:
- - server_error
- - rate_limit_exceeded
- - invalid_prompt
- - vector_store_timeout
- - invalid_image
- - invalid_image_format
- - invalid_base64_image
- - invalid_image_url
- - image_too_large
- - image_too_small
- - image_parse_error
- - image_content_policy_violation
- - invalid_image_mode
- - image_file_too_large
- - unsupported_image_media_type
- - empty_image_file
- - failed_to_download_image
- - image_file_not_found
- description: The error code for the response.
- OpenAI.ResponseErrorEvent:
+ description: |-
+ The model sample to be evaluated. This value will be used to populate
+ the `sample` namespace. See [the guide](/docs/guides/graders) for more details.
+ The `output_json` variable will be populated if the model sample is a
+ valid JSON string.
+ title: RunGraderRequest
+ OpenAI.RunGraderRequestItem:
+ type: object
+ OpenAI.RunGraderResponse:
+ type: object
+ required:
+ - reward
+ - metadata
+ - sub_rewards
+ - model_grader_token_usage_per_model
+ properties:
+ reward:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ metadata:
+ $ref: '#/components/schemas/OpenAI.RunGraderResponseMetadata'
+ sub_rewards:
+ type: object
+ unevaluatedProperties: {}
+ model_grader_token_usage_per_model:
+ type: object
+ unevaluatedProperties: {}
+ OpenAI.RunGraderResponseMetadata:
type: object
required:
+ - name
- type
- - code
- - message
- - param
- - sequence_number
+ - errors
+ - execution_time
+ - scores
+ - token_usage
+ - sampled_model_name
properties:
+ name:
+ type: string
type:
type: string
+ errors:
+ $ref: '#/components/schemas/OpenAI.RunGraderResponseMetadataErrors'
+ execution_time:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ scores:
+ type: object
+ unevaluatedProperties: {}
+ token_usage:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ sampled_model_name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.RunGraderResponseMetadataErrors:
+ type: object
+ required:
+ - formula_parse_error
+ - sample_parse_error
+ - truncated_observation_error
+ - unresponsive_reward_error
+ - invalid_variable_error
+ - other_error
+ - python_grader_server_error
+ - python_grader_server_error_type
+ - python_grader_runtime_error
+ - python_grader_runtime_error_details
+ - model_grader_server_error
+ - model_grader_refusal_error
+ - model_grader_parse_error
+ - model_grader_server_error_details
+ properties:
+ formula_parse_error:
+ type: boolean
+ sample_parse_error:
+ type: boolean
+ truncated_observation_error:
+ type: boolean
+ unresponsive_reward_error:
+ type: boolean
+ invalid_variable_error:
+ type: boolean
+ other_error:
+ type: boolean
+ python_grader_server_error:
+ type: boolean
+ python_grader_server_error_type:
+ anyOf:
+ - type: string
+ - type: 'null'
+ python_grader_runtime_error:
+ type: boolean
+ python_grader_runtime_error_details:
+ anyOf:
+ - type: string
+ - type: 'null'
+ model_grader_server_error:
+ type: boolean
+ model_grader_refusal_error:
+ type: boolean
+ model_grader_parse_error:
+ type: boolean
+ model_grader_server_error_details:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.RunObject:
+ type: object
+ required:
+ - id
+ - object
+ - created_at
+ - thread_id
+ - assistant_id
+ - status
+ - required_action
+ - last_error
+ - expires_at
+ - started_at
+ - cancelled_at
+ - failed_at
+ - completed_at
+ - incomplete_details
+ - model
+ - instructions
+ - tools
+ - metadata
+ - usage
+ - max_prompt_tokens
+ - max_completion_tokens
+ - truncation_strategy
+ - tool_choice
+ - parallel_tool_calls
+ - response_format
+ properties:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
+ type: string
enum:
- - error
- description: The type of the event. Always `error`.
+ - thread.run
+ description: The object type, which is always `thread.run`.
x-stainless-const: true
- code:
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the run was created.
+ thread_id:
+ type: string
+ description: The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.
+ assistant_id:
+ type: string
+ description: The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.
+ status:
+ $ref: '#/components/schemas/OpenAI.RunStatus'
+ description: The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.
+ required_action:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunObjectRequiredAction'
+ - type: 'null'
+ description: Details on the action required to continue the run. Will be `null` if no action is required.
+ last_error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunObjectLastError'
+ - type: 'null'
+ description: The last error associated with this run. Will be `null` if there are no errors.
+ expires_at:
anyOf:
- type: string
+ format: date-time
- type: 'null'
- message:
- type: string
- description: The error message.
- param:
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run will expire.
+ started_at:
anyOf:
- type: string
+ format: date-time
- type: 'null'
- sequence_number:
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run was started.
+ cancelled_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run was cancelled.
+ failed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run failed.
+ completed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: The Unix timestamp (in seconds) for when the run was completed.
+ incomplete_details:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunObjectIncompleteDetails'
+ - type: 'null'
+ description: Details on why the run is incomplete. Will be `null` if the run is not incomplete.
+ model:
+ type: string
+ description: The model that the [assistant](/docs/api-reference/assistants) used for this run.
+ instructions:
+ type: string
+ description: The instructions that the [assistant](/docs/api-reference/assistants) used for this run.
+ tools:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.AssistantTool'
+ maxItems: 20
+ description: The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.
+ default: []
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ usage:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunCompletionUsage'
+ - type: 'null'
+ temperature:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ description: The sampling temperature used for this run. If not set, defaults to 1.
+ top_p:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: 'null'
+ description: The nucleus sampling value used for this run. If not set, defaults to 1.
+ max_prompt_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: The maximum number of prompt tokens specified to have been used over the course of the run.
+ max_completion_tokens:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.integer'
+ - type: 'null'
+ minimum: 256
+ description: The maximum number of completion tokens specified to have been used over the course of the run.
+ truncation_strategy:
+ $ref: '#/components/schemas/OpenAI.TruncationObject'
+ tool_choice:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption'
+ parallel_tool_calls:
+ type: boolean
+ description: Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
+ default: true
+ response_format:
+ $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption'
+ description: Represents an execution run on a [thread](/docs/api-reference/threads).
+ title: A run on a thread
+ x-oaiMeta:
+ name: The run object
+ beta: true
+ example: |
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1698107661,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699073476,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699073498,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [{"type": "file_search"}, {"type": "code_interpreter"}],
+ "metadata": {},
+ "incomplete_details": null,
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ OpenAI.RunObjectIncompleteDetails:
+ type: object
+ properties:
+ reason:
+ type: string
+ enum:
+ - max_completion_tokens
+ - max_prompt_tokens
+ OpenAI.RunObjectLastError:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: string
+ enum:
+ - server_error
+ - rate_limit_exceeded
+ - invalid_prompt
+ message:
+ type: string
+ OpenAI.RunObjectRequiredAction:
+ type: object
+ required:
+ - type
+ - submit_tool_outputs
+ properties:
+ type:
+ type: string
+ enum:
+ - submit_tool_outputs
+ x-stainless-const: true
+ submit_tool_outputs:
+ $ref: '#/components/schemas/OpenAI.RunObjectRequiredActionSubmitToolOutputs'
+ OpenAI.RunObjectRequiredActionSubmitToolOutputs:
+ type: object
+ required:
+ - tool_calls
+ properties:
+ tool_calls:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunToolCallObject'
+ OpenAI.RunStatus:
+ type: string
+ enum:
+ - queued
+ - in_progress
+ - requires_action
+ - cancelling
+ - cancelled
+ - failed
+ - completed
+ - incomplete
+ - expired
+ description: The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.
+ OpenAI.RunStepCompletionUsage:
+ type: object
+ required:
+ - completion_tokens
+ - prompt_tokens
+ - total_tokens
+ properties:
+ completion_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an error occurs.
- x-oaiMeta:
- name: error
- group: responses
- example: |
- {
- "type": "error",
- "code": "ERR_SOMETHING",
- "message": "Something went wrong",
- "param": null,
- "sequence_number": 1
- }
- OpenAI.ResponseFailedEvent:
+ description: Number of completion tokens used over the course of the run step.
+ prompt_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Number of prompt tokens used over the course of the run step.
+ total_tokens:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Total number of tokens used (prompt + completion).
+ description: Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.
+ OpenAI.RunStepDetailsMessageCreationObject:
type: object
required:
- type
- - sequence_number
- - response
+ - message_creation
properties:
type:
type: string
enum:
- - response.failed
- description: The type of the event. Always `response.failed`.
+ - message_creation
+ description: Always `message_creation`.
x-stainless-const: true
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The response that failed.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: An event that is emitted when a response fails.
- x-oaiMeta:
- name: response.failed
- group: responses
- example: |
- {
- "type": "response.failed",
- "response": {
- "id": "resp_123",
- "object": "response",
- "created_at": 1740855869,
- "status": "failed",
- "completed_at": null,
- "error": {
- "code": "server_error",
- "message": "The model failed to generate a response."
- },
- "incomplete_details": null,
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-mini-2024-07-18",
- "output": [],
- "previous_response_id": null,
- "reasoning_effort": null,
- "store": false,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": null,
- "user": null,
- "metadata": {}
- }
- }
- OpenAI.ResponseFileSearchCallCompletedEvent:
+ message_creation:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsMessageCreationObjectMessageCreation'
+ description: Details of the message creation by the run step.
+ title: Message creation
+ OpenAI.RunStepDetailsMessageCreationObjectMessageCreation:
+ type: object
+ required:
+ - message_id
+ properties:
+ message_id:
+ type: string
+ OpenAI.RunStepDetailsToolCall:
type: object
required:
- type
- - output_index
- - item_id
- - sequence_number
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallType'
+ discriminator:
+ propertyName: type
+ mapping:
+ code_interpreter: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObject'
+ file_search: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObject'
+ function: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObject'
+ OpenAI.RunStepDetailsToolCallType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - response.file_search_call.completed
- description: The type of the event. Always `response.file_search_call.completed`.
- x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the file search call is initiated.
- item_id:
- type: string
- description: The ID of the output item that the file search call is initiated.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a file search call is completed (results found).
- x-oaiMeta:
- name: response.file_search_call.completed
- group: responses
- example: |
- {
- "type": "response.file_search_call.completed",
- "output_index": 0,
- "item_id": "fs_123",
- "sequence_number": 1
- }
- OpenAI.ResponseFileSearchCallInProgressEvent:
+ - code_interpreter
+ - file_search
+ - function
+ OpenAI.RunStepDetailsToolCallsCodeObject:
type: object
required:
+ - id
- type
- - output_index
- - item_id
- - sequence_number
+ - code_interpreter
properties:
+ id:
+ type: string
+ description: The ID of the tool call.
type:
type: string
enum:
- - response.file_search_call.in_progress
- description: The type of the event. Always `response.file_search_call.in_progress`.
+ - code_interpreter
+ description: The type of tool call. This is always going to be `code_interpreter` for this type of tool call.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the file search call is initiated.
- item_id:
- type: string
- description: The ID of the output item that the file search call is initiated.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter'
+ description: The Code Interpreter tool call definition.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a file search call is initiated.
- x-oaiMeta:
- name: response.file_search_call.in_progress
- group: responses
- example: |
- {
- "type": "response.file_search_call.in_progress",
- "output_index": 0,
- "item_id": "fs_123",
- "sequence_number": 1
- }
- OpenAI.ResponseFileSearchCallSearchingEvent:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall'
+ description: Details of the Code Interpreter tool call the run step was involved in.
+ title: Code Interpreter tool call
+ OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter:
+ type: object
+ required:
+ - input
+ - outputs
+ properties:
+ input:
+ type: string
+ outputs:
+ type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject'
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObject'
+ OpenAI.RunStepDetailsToolCallsCodeOutputImageObject:
type: object
required:
- type
- - output_index
- - item_id
- - sequence_number
+ - image
properties:
type:
type: string
enum:
- - response.file_search_call.searching
- description: The type of the event. Always `response.file_search_call.searching`.
+ - image
+ description: Always `image`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the file search call is searching.
- item_id:
+ image:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage'
+ title: Code Interpreter image output
+ OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage:
+ type: object
+ required:
+ - file_id
+ properties:
+ file_id:
type: string
- description: The ID of the output item that the file search call is initiated.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a file search is currently searching.
- x-oaiMeta:
- name: response.file_search_call.searching
- group: responses
- example: |
- {
- "type": "response.file_search_call.searching",
- "output_index": 0,
- "item_id": "fs_123",
- "sequence_number": 1
- }
- OpenAI.ResponseFormatJsonObject:
+ OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject:
type: object
required:
- type
+ - logs
properties:
type:
type: string
enum:
- - json_object
- description: The type of response format being defined. Always `json_object`.
+ - logs
+ description: Always `logs`.
x-stainless-const: true
- description: |-
- JSON object response format. An older method of generating JSON responses.
- Using `json_schema` is recommended for models that support it. Note that the
- model will not generate JSON without a system or user message instructing it
- to do so.
- title: JSON object
- OpenAI.ResponseFormatJsonSchema:
+ logs:
+ type: string
+ description: The text output from the Code Interpreter tool call.
+ description: Text output from the Code Interpreter tool call as part of a run step.
+ title: Code Interpreter log output
+ OpenAI.RunStepDetailsToolCallsFileSearchObject:
type: object
required:
+ - id
- type
- - json_schema
+ - file_search
properties:
+ id:
+ type: string
+ description: The ID of the tool call object.
type:
type: string
enum:
- - json_schema
- description: The type of response format being defined. Always `json_schema`.
+ - file_search
+ description: The type of tool call. This is always going to be `file_search` for this type of tool call.
x-stainless-const: true
- json_schema:
- $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema'
- description: Structured Outputs configuration options, including a JSON Schema.
- title: JSON schema
+ file_search:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch'
+ description: For now, this is always going to be an empty object.
+ x-oaiTypeLabel: map
allOf:
- - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat'
- description: |-
- JSON Schema response format. Used to generate structured JSON responses.
- Learn more about [Structured Outputs](/docs/guides/structured-outputs).
- title: JSON schema
- OpenAI.ResponseFormatJsonSchemaJsonSchema:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall'
+ title: File search tool call
+ OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch:
+ type: object
+ properties:
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject'
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObject'
+ OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject:
type: object
required:
- - name
+ - ranker
+ - score_threshold
properties:
- description:
+ ranker:
+ $ref: '#/components/schemas/OpenAI.FileSearchRanker'
+ score_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ description: The score threshold for the file search. All values must be a floating point number between 0 and 1.
+ description: The ranking options for the file search.
+ title: File search tool call ranking options
+ OpenAI.RunStepDetailsToolCallsFileSearchResultObject:
+ type: object
+ required:
+ - file_id
+ - file_name
+ - score
+ properties:
+ file_id:
type: string
- name:
+ description: The ID of the file that result was found in.
+ file_name:
type: string
- schema:
- $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
- OpenAI.ResponseFormatJsonSchemaSchema:
- type: object
- unevaluatedProperties: {}
- description: |-
- The schema for the response format, described as a JSON Schema object.
- Learn how to build JSON schemas [here](https://json-schema.org/).
- title: JSON schema
- OpenAI.ResponseFormatText:
+ description: The name of the file that result was found in.
+ score:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ description: The score of the result. All values must be a floating point number between 0 and 1.
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent'
+ description: The content of the result that was found. The content is only included if requested via the include query parameter.
+ description: A result instance of the file search.
+ title: File search tool call result
+ x-oaiTypeLabel: map
+ OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent:
type: object
- required:
- - type
properties:
type:
type: string
enum:
- text
- description: The type of response format being defined. Always `text`.
x-stainless-const: true
- description: Default response format. Used to generate text responses.
- title: Text
- OpenAI.ResponseFunctionCallArgumentsDeltaEvent:
+ text:
+ type: string
+ OpenAI.RunStepDetailsToolCallsFunctionObject:
type: object
required:
+ - id
- type
- - item_id
- - output_index
- - sequence_number
- - delta
+ - function
properties:
+ id:
+ type: string
+ description: The ID of the tool call object.
type:
type: string
enum:
- - response.function_call_arguments.delta
- description: The type of the event. Always `response.function_call_arguments.delta`.
+ - function
+ description: The type of tool call. This is always going to be `function` for this type of tool call.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the output item that the function-call arguments delta is added to.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the function-call arguments delta is added to.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- delta:
- type: string
- description: The function-call arguments delta that is added.
+ function:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObjectFunction'
+ description: The definition of the function that was called.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a partial function-call arguments delta.
- x-oaiMeta:
- name: response.function_call_arguments.delta
- group: responses
- example: |
- {
- "type": "response.function_call_arguments.delta",
- "item_id": "item-abc",
- "output_index": 0,
- "delta": "{ "arg":"
- "sequence_number": 1
- }
- OpenAI.ResponseFunctionCallArgumentsDoneEvent:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall'
+ title: Function tool call
+ OpenAI.RunStepDetailsToolCallsFunctionObjectFunction:
type: object
required:
- - type
- - item_id
- name
- - output_index
- - sequence_number
- arguments
+ - output
properties:
- type:
- type: string
- enum:
- - response.function_call_arguments.done
- x-stainless-const: true
- item_id:
- type: string
- description: The ID of the item.
name:
type: string
- description: The name of the function that was called.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
arguments:
type: string
- description: The function-call arguments.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when function-call arguments are finalized.
- x-oaiMeta:
- name: response.function_call_arguments.done
- group: responses
- example: |
- {
- "type": "response.function_call_arguments.done",
- "item_id": "item-abc",
- "name": "get_weather",
- "output_index": 1,
- "arguments": "{ "arg": 123 }",
- "sequence_number": 1
- }
- OpenAI.ResponseImageGenCallCompletedEvent:
+ output:
+ anyOf:
+ - type: string
+ - type: 'null'
+ OpenAI.RunStepDetailsToolCallsObject:
type: object
required:
- type
- - output_index
- - sequence_number
- - item_id
+ - tool_calls
properties:
type:
type: string
enum:
- - response.image_generation_call.completed
- description: The type of the event. Always 'response.image_generation_call.completed'.
+ - tool_calls
+ description: Always `tool_calls`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- item_id:
- type: string
- description: The unique identifier of the image generation item being processed.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an image generation tool call has completed and the final image is available.
- title: ResponseImageGenCallCompletedEvent
- x-oaiMeta:
- name: response.image_generation_call.completed
- group: responses
- example: |
- {
- "type": "response.image_generation_call.completed",
- "output_index": 0,
- "item_id": "item-123",
- "sequence_number": 1
- }
- OpenAI.ResponseImageGenCallGeneratingEvent:
+ tool_calls:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall'
+ description: '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`.'
+ description: Details of the tool call.
+ title: Tool calls
+ OpenAI.RunStepObject:
type: object
required:
+ - id
+ - object
+ - created_at
+ - assistant_id
+ - thread_id
+ - run_id
- type
- - output_index
- - item_id
- - sequence_number
+ - status
+ - step_details
+ - last_error
+ - expired_at
+ - cancelled_at
+ - failed_at
+ - completed_at
+ - metadata
+ - usage
properties:
- type:
+ id:
+ type: string
+ description: The identifier of the run step, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - response.image_generation_call.generating
- description: The type of the event. Always 'response.image_generation_call.generating'.
+ - thread.run.step
+ description: The object type, which is always `thread.run.step`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the run step was created.
+ assistant_id:
type: string
- description: The unique identifier of the image generation item being processed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the image generation item being processed.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an image generation tool call is actively generating an image (intermediate state).
- title: ResponseImageGenCallGeneratingEvent
- x-oaiMeta:
- name: response.image_generation_call.generating
- group: responses
- example: |
- {
- "type": "response.image_generation_call.generating",
- "output_index": 0,
- "item_id": "item-123",
- "sequence_number": 0
- }
- OpenAI.ResponseImageGenCallInProgressEvent:
- type: object
- required:
- - type
- - output_index
- - item_id
- - sequence_number
- properties:
+ description: The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.
+ thread_id:
+ type: string
+ description: The ID of the [thread](/docs/api-reference/threads) that was run.
+ run_id:
+ type: string
+ description: The ID of the [run](/docs/api-reference/runs) that this run step is a part of.
type:
type: string
enum:
- - response.image_generation_call.in_progress
- description: The type of the event. Always 'response.image_generation_call.in_progress'.
- x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
+ - message_creation
+ - tool_calls
+ description: The type of run step, which can be either `message_creation` or `tool_calls`.
+ status:
type: string
- description: The unique identifier of the image generation item being processed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the image generation item being processed.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an image generation tool call is in progress.
- title: ResponseImageGenCallInProgressEvent
+ enum:
+ - in_progress
+ - cancelled
+ - failed
+ - completed
+ - expired
+ description: The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.
+ step_details:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsMessageCreationObject'
+ - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsObject'
+ description: The details of the run step.
+ last_error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.RunStepObjectLastError'
+ - type: 'null'
+ expired_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ cancelled_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ failed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ completed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ usage:
+ $ref: '#/components/schemas/OpenAI.RunStepCompletionUsage'
+ description: Represents a step in execution of a run.
+ title: Run steps
x-oaiMeta:
- name: response.image_generation_call.in_progress
- group: responses
+ name: The run step object
+ beta: true
example: |
{
- "type": "response.image_generation_call.in_progress",
- "output_index": 0,
- "item_id": "item-123",
- "sequence_number": 0
+ "id": "step_abc123",
+ "object": "thread.run.step",
+ "created_at": 1699063291,
+ "run_id": "run_abc123",
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "type": "message_creation",
+ "status": "completed",
+ "cancelled_at": null,
+ "completed_at": 1699063291,
+ "expired_at": null,
+ "failed_at": null,
+ "last_error": null,
+ "step_details": {
+ "type": "message_creation",
+ "message_creation": {
+ "message_id": "msg_abc123"
+ }
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ }
}
- OpenAI.ResponseImageGenCallPartialImageEvent:
+ OpenAI.RunStepObjectLastError:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: string
+ enum:
+ - server_error
+ - rate_limit_exceeded
+ message:
+ type: string
+ OpenAI.RunToolCallObject:
type: object
required:
+ - id
- type
- - output_index
- - item_id
- - sequence_number
- - partial_image_index
- - partial_image_b64
+ - function
properties:
+ id:
+ type: string
+ description: 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](/docs/api-reference/runs/submitToolOutputs) endpoint.
type:
type: string
enum:
- - response.image_generation_call.partial_image
- description: The type of the event. Always 'response.image_generation_call.partial_image'.
+ - function
+ description: The type of tool call the output is required for. For now, this is always `function`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
+ function:
+ $ref: '#/components/schemas/OpenAI.RunToolCallObjectFunction'
+ description: The function definition.
+ description: Tool call objects
+ OpenAI.RunToolCallObjectFunction:
+ type: object
+ required:
+ - name
+ - arguments
+ properties:
+ name:
type: string
- description: The unique identifier of the image generation item being processed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the image generation item being processed.
- partial_image_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: 0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
- partial_image_b64:
+ arguments:
type: string
- description: Base64-encoded partial image data, suitable for rendering as an image.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a partial image is available during image generation streaming.
- title: ResponseImageGenCallPartialImageEvent
- x-oaiMeta:
- name: response.image_generation_call.partial_image
- group: responses
- example: |
- {
- "type": "response.image_generation_call.partial_image",
- "output_index": 0,
- "item_id": "item-123",
- "sequence_number": 0,
- "partial_image_index": 0,
- "partial_image_b64": "..."
- }
- OpenAI.ResponseInProgressEvent:
+ OpenAI.ScreenshotParam:
type: object
required:
- type
- - response
- - sequence_number
properties:
type:
type: string
enum:
- - response.in_progress
- description: The type of the event. Always `response.in_progress`.
+ - screenshot
+ description: Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
x-stainless-const: true
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The response that is in progress.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the response is in progress.
- x-oaiMeta:
- name: response.in_progress
- group: responses
- example: |
- {
- "type": "response.in_progress",
- "response": {
- "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
- "object": "response",
- "created_at": 1741487325,
- "status": "in_progress",
- "completed_at": null,
- "error": null,
- "incomplete_details": null,
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-2024-08-06",
- "output": [],
- "parallel_tool_calls": true,
- "previous_response_id": null,
- "reasoning": {
- "effort": null,
- "summary": null
- },
- "store": true,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": null,
- "user": null,
- "metadata": {}
- },
- "sequence_number": 1
- }
- OpenAI.ResponseIncompleteDetails:
- type: object
- properties:
- reason:
- type: string
- enum:
- - max_output_tokens
- - content_filter
- OpenAI.ResponseIncompleteEvent:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A screenshot action.
+ title: Screenshot
+ OpenAI.ScrollParam:
type: object
required:
- type
- - response
- - sequence_number
+ - x
+ - 'y'
+ - scroll_x
+ - scroll_y
properties:
type:
type: string
enum:
- - response.incomplete
- description: The type of the event. Always `response.incomplete`.
+ - scroll
+ description: Specifies the event type. For a scroll action, this property is always set to `scroll`.
x-stainless-const: true
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The response that was incomplete.
- sequence_number:
+ x:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: The x-coordinate where the scroll occurred.
+ 'y':
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The y-coordinate where the scroll occurred.
+ scroll_x:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The horizontal scroll distance.
+ scroll_y:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The vertical scroll distance.
+ keys:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: An event that is emitted when a response finishes as incomplete.
- x-oaiMeta:
- name: response.incomplete
- group: responses
- example: |
- {
- "type": "response.incomplete",
- "response": {
- "id": "resp_123",
- "object": "response",
- "created_at": 1740855869,
- "status": "incomplete",
- "completed_at": null,
- "error": null,
- "incomplete_details": {
- "reason": "max_tokens"
- },
- "instructions": null,
- "max_output_tokens": null,
- "model": "gpt-4o-mini-2024-07-18",
- "output": [],
- "previous_response_id": null,
- "reasoning_effort": null,
- "store": false,
- "temperature": 1,
- "text": {
- "format": {
- "type": "text"
- }
- },
- "tool_choice": "auto",
- "tools": [],
- "top_p": 1,
- "truncation": "disabled",
- "usage": null,
- "user": null,
- "metadata": {}
- },
- "sequence_number": 1
- }
- OpenAI.ResponseLogProb:
- type: object
- required:
- - token
- - logprob
- properties:
- token:
- type: string
- description: A possible text token.
- logprob:
- $ref: '#/components/schemas/OpenAI.numeric'
- description: The log probability of this token.
- top_logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ResponseLogProbTopLogprobs'
- description: The log probabilities of up to 20 of the most likely tokens.
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: A scroll action.
+ title: Scroll
+ OpenAI.SearchContentType:
+ type: string
+ enum:
+ - text
+ - image
+ OpenAI.SearchContextSize:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ OpenAI.ServiceTier:
+ anyOf:
+ - type: string
+ enum:
+ - auto
+ - default
+ - flex
+ - scale
+ - priority
+ - type: 'null'
description: |-
- A logprob is the logarithmic probability that the model assigns to producing
- a particular token at a given position in the sequence. Less-negative (higher)
- logprob values indicate greater model confidence in that token choice.
- OpenAI.ResponseLogProbTopLogprobs:
- type: object
- properties:
- token:
- type: string
- logprob:
- $ref: '#/components/schemas/OpenAI.numeric'
- OpenAI.ResponseMCPCallArgumentsDeltaEvent:
+ Specifies the processing type used for serving the request.
+ - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
+ - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
+ - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.
+ - When not set, the default behavior is 'auto'.
+ 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.
+ OpenAI.ServiceTierEnum:
+ type: string
+ enum:
+ - auto
+ - default
+ - flex
+ - priority
+ OpenAI.SkillReferenceParam:
type: object
required:
- type
- - output_index
- - item_id
- - delta
- - sequence_number
+ - skill_id
properties:
type:
type: string
enum:
- - response.mcp_call_arguments.delta
- description: The type of the event. Always 'response.mcp_call_arguments.delta'.
+ - skill_reference
+ description: References a skill created with the /v1/skills endpoint.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
+ skill_id:
type: string
- description: The unique identifier of the MCP tool call item being processed.
- delta:
+ minLength: 1
+ maxLength: 64
+ description: The ID of the referenced skill.
+ version:
type: string
- description: A JSON string containing the partial update to the arguments for the MCP tool call.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: Optional skill version. Use a positive integer or 'latest'. Omit for default.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
- title: ResponseMCPCallArgumentsDeltaEvent
- x-oaiMeta:
- name: response.mcp_call_arguments.delta
- group: responses
- example: |
- {
- "type": "response.mcp_call_arguments.delta",
- "output_index": 0,
- "item_id": "item-abc",
- "delta": "{",
- "sequence_number": 1
- }
- OpenAI.ResponseMCPCallArgumentsDoneEvent:
+ - $ref: '#/components/schemas/OpenAI.ContainerSkill'
+ OpenAI.SpecificApplyPatchParam:
type: object
required:
- type
- - output_index
- - item_id
- - arguments
- - sequence_number
properties:
type:
type: string
enum:
- - response.mcp_call_arguments.done
- description: The type of the event. Always 'response.mcp_call_arguments.done'.
+ - apply_patch
+ description: The tool to call. Always `apply_patch`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
- type: string
- description: The unique identifier of the MCP tool call item being processed.
- arguments:
- type: string
- description: A JSON string containing the finalized arguments for the MCP tool call.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the arguments for an MCP tool call are finalized.
- title: ResponseMCPCallArgumentsDoneEvent
- x-oaiMeta:
- name: response.mcp_call_arguments.done
- group: responses
- example: |
- {
- "type": "response.mcp_call_arguments.done",
- "output_index": 0,
- "item_id": "item-abc",
- "arguments": "{"arg1": "value1", "arg2": "value2"}",
- "sequence_number": 1
- }
- OpenAI.ResponseMCPCallCompletedEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Forces the model to call the apply_patch tool when executing a tool call.
+ title: Specific apply patch tool choice
+ OpenAI.SpecificFunctionShellParam:
type: object
required:
- type
- - item_id
- - output_index
- - sequence_number
properties:
type:
type: string
enum:
- - response.mcp_call.completed
- description: The type of the event. Always 'response.mcp_call.completed'.
+ - shell
+ description: The tool to call. Always `shell`.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the MCP tool call item that completed.
- output_index:
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Forces the model to call the shell tool when a tool call is required.
+ title: Specific shell tool choice
+ OpenAI.StaticChunkingStrategy:
+ type: object
+ required:
+ - max_chunk_size_tokens
+ - chunk_overlap_tokens
+ properties:
+ max_chunk_size_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that completed.
- sequence_number:
+ minimum: 100
+ maximum: 4096
+ description: The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
+ chunk_overlap_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an MCP tool call has completed successfully.
- title: ResponseMCPCallCompletedEvent
- x-oaiMeta:
- name: response.mcp_call.completed
- group: responses
- example: |
- {
- "type": "response.mcp_call.completed",
- "sequence_number": 1,
- "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90",
- "output_index": 0
- }
- OpenAI.ResponseMCPCallFailedEvent:
+ description: |-
+ 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`.
+ OpenAI.StaticChunkingStrategyRequestParam:
type: object
required:
- type
- - item_id
- - output_index
- - sequence_number
+ - static
properties:
type:
type: string
enum:
- - response.mcp_call.failed
- description: The type of the event. Always 'response.mcp_call.failed'.
+ - static
+ description: Always `static`.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the MCP tool call item that failed.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that failed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ static:
+ $ref: '#/components/schemas/OpenAI.StaticChunkingStrategy'
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an MCP tool call has failed.
- title: ResponseMCPCallFailedEvent
- x-oaiMeta:
- name: response.mcp_call.failed
- group: responses
- example: |
- {
- "type": "response.mcp_call.failed",
- "sequence_number": 1,
- "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90",
- "output_index": 0
- }
- OpenAI.ResponseMCPCallInProgressEvent:
+ - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam'
+ description: Customize your own chunking strategy by setting chunk size and chunk overlap.
+ title: Static Chunking Strategy
+ OpenAI.StaticChunkingStrategyResponseParam:
type: object
required:
- type
- - sequence_number
- - output_index
- - item_id
+ - static
properties:
type:
type: string
enum:
- - response.mcp_call.in_progress
- description: The type of the event. Always 'response.mcp_call.in_progress'.
+ - static
+ description: Always `static`.
x-stainless-const: true
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- item_id:
- type: string
- description: The unique identifier of the MCP tool call item being processed.
+ static:
+ $ref: '#/components/schemas/OpenAI.StaticChunkingStrategy'
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an MCP tool call is in progress.
- title: ResponseMCPCallInProgressEvent
- x-oaiMeta:
- name: response.mcp_call.in_progress
- group: responses
- example: |
- {
- "type": "response.mcp_call.in_progress",
- "sequence_number": 1,
- "output_index": 0,
- "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90"
- }
- OpenAI.ResponseMCPListToolsCompletedEvent:
+ - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse'
+ title: Static Chunking Strategy
+ OpenAI.StopConfiguration:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ description: |-
+ Not supported with latest reasoning models `o3` and `o4-mini`.
+ Up to 4 sequences where the API will stop generating further tokens. The
+ returned text will not contain the stop sequence.
+ OpenAI.SubmitToolOutputsRunRequest:
+ type: object
+ required:
+ - tool_outputs
+ properties:
+ tool_outputs:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.SubmitToolOutputsRunRequestToolOutputs'
+ description: A list of tools for which the outputs are being submitted.
+ stream:
+ anyOf:
+ - type: boolean
+ - type: 'null'
+ OpenAI.SubmitToolOutputsRunRequestToolOutputs:
+ type: object
+ properties:
+ tool_call_id:
+ type: string
+ output:
+ type: string
+ OpenAI.SummaryTextContent:
type: object
required:
- type
- - item_id
- - output_index
- - sequence_number
+ - text
properties:
type:
type: string
enum:
- - response.mcp_list_tools.completed
- description: The type of the event. Always 'response.mcp_list_tools.completed'.
+ - summary_text
+ description: The type of the object. Always `summary_text`.
x-stainless-const: true
- item_id:
+ text:
type: string
- description: The ID of the MCP tool call item that produced this output.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that was processed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: A summary of the reasoning output from the model so far.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the list of available MCP tools has been successfully retrieved.
- title: ResponseMCPListToolsCompletedEvent
- x-oaiMeta:
- name: response.mcp_list_tools.completed
- group: responses
- example: |
- {
- "type": "response.mcp_list_tools.completed",
- "sequence_number": 1,
- "output_index": 0,
- "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
- }
- OpenAI.ResponseMCPListToolsFailedEvent:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A summary text from the model.
+ title: Summary text
+ OpenAI.TextAnnotation:
type: object
required:
- type
- - item_id
- - output_index
- - sequence_number
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.TextAnnotationType'
+ discriminator:
+ propertyName: type
+ mapping:
+ file_citation: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObject'
+ file_path: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObject'
+ OpenAI.TextAnnotationType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - file_citation
+ - file_path
+ OpenAI.TextContent:
+ type: object
+ required:
+ - type
+ - text
properties:
type:
type: string
enum:
- - response.mcp_list_tools.failed
- description: The type of the event. Always 'response.mcp_list_tools.failed'.
+ - text
x-stainless-const: true
- item_id:
+ text:
type: string
- description: The ID of the MCP tool call item that failed.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that failed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the attempt to list available MCP tools has failed.
- title: ResponseMCPListToolsFailedEvent
- x-oaiMeta:
- name: response.mcp_list_tools.failed
- group: responses
- example: |
- {
- "type": "response.mcp_list_tools.failed",
- "sequence_number": 1,
- "output_index": 0,
- "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
- }
- OpenAI.ResponseMCPListToolsInProgressEvent:
+ - $ref: '#/components/schemas/OpenAI.MessageContent'
+ description: A text content.
+ title: Text Content
+ OpenAI.TextResponseFormatConfiguration:
type: object
required:
- type
- - item_id
- - output_index
- - sequence_number
properties:
type:
- type: string
- enum:
- - response.mcp_list_tools.in_progress
- description: The type of the event. Always 'response.mcp_list_tools.in_progress'.
- x-stainless-const: true
- item_id:
- type: string
- description: The ID of the MCP tool call item that is being processed.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that is being processed.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when the system is in the process of retrieving the list of available MCP tools.
- title: ResponseMCPListToolsInProgressEvent
- x-oaiMeta:
- name: response.mcp_list_tools.in_progress
- group: responses
- example: |
- {
- "type": "response.mcp_list_tools.in_progress",
- "sequence_number": 1,
- "output_index": 0,
- "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90"
- }
- OpenAI.ResponseOutputItemAddedEvent:
+ $ref: '#/components/schemas/OpenAI.TextResponseFormatConfigurationType'
+ discriminator:
+ propertyName: type
+ mapping:
+ json_schema: '#/components/schemas/OpenAI.TextResponseFormatJsonSchema'
+ text: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText'
+ json_object: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject'
+ description: |-
+ An object specifying the format that the model must output.
+ Configuring `{ "type": "json_schema" }` enables Structured Outputs,
+ which ensures the model will match your supplied JSON schema. Learn more in the
+ [Structured Outputs guide](/docs/guides/structured-outputs).
+ The default format is `{ "type": "text" }` with no additional options.
+ *Not recommended for gpt-4o and newer models:**
+ 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.
+ OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject:
type: object
required:
- type
- - output_index
- - sequence_number
- - item
properties:
type:
type: string
enum:
- - response.output_item.added
- description: The type of the event. Always `response.output_item.added`.
+ - json_object
+ description: The type of response format being defined. Always `json_object`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that was added.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- item:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output item that was added.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a new output item is added.
- x-oaiMeta:
- name: response.output_item.added
- group: responses
- example: |
- {
- "type": "response.output_item.added",
- "output_index": 0,
- "item": {
- "id": "msg_123",
- "status": "in_progress",
- "type": "message",
- "role": "assistant",
- "content": []
- },
- "sequence_number": 1
- }
- OpenAI.ResponseOutputItemDoneEvent:
+ - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
+ description: |-
+ JSON object response format. An older method of generating JSON responses.
+ Using `json_schema` is recommended for models that support it. Note that the
+ model will not generate JSON without a system or user message instructing it
+ to do so.
+ title: JSON object
+ OpenAI.TextResponseFormatConfigurationResponseFormatText:
type: object
required:
- type
- - output_index
- - sequence_number
- - item
properties:
type:
type: string
enum:
- - response.output_item.done
- description: The type of the event. Always `response.output_item.done`.
+ - text
+ description: The type of response format being defined. Always `text`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that was marked done.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- item:
- $ref: '#/components/schemas/OpenAI.OutputItem'
- description: The output item that was marked done.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an output item is marked done.
- x-oaiMeta:
- name: response.output_item.done
- group: responses
- example: |
- {
- "type": "response.output_item.done",
- "output_index": 0,
- "item": {
- "id": "msg_123",
- "status": "completed",
- "type": "message",
- "role": "assistant",
- "content": [
- {
- "type": "output_text",
- "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
- "annotations": []
- }
- ]
- },
- "sequence_number": 1
- }
- OpenAI.ResponseOutputTextAnnotationAddedEvent:
+ - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
+ description: Default response format. Used to generate text responses.
+ title: Text
+ OpenAI.TextResponseFormatConfigurationType:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - text
+ - json_schema
+ - json_object
+ OpenAI.TextResponseFormatJsonSchema:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - annotation_index
- - sequence_number
- - annotation
+ - name
+ - schema
properties:
type:
type: string
enum:
- - response.output_text.annotation.added
- description: The type of the event. Always 'response.output_text.annotation.added'.
+ - json_schema
+ description: The type of response format being defined. Always `json_schema`.
x-stainless-const: true
- item_id:
+ description:
type: string
- description: The unique identifier of the item to which the annotation is being added.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item in the response's output array.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part within the output item.
- annotation_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the annotation within the content part.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- annotation:
- $ref: '#/components/schemas/OpenAI.Annotation'
- description: The annotation object being added. (See annotation schema for details.)
+ description: |-
+ A description of what the response format is for, used by the model to
+ determine how to respond in the format.
+ name:
+ type: string
+ description: |-
+ 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.
+ schema:
+ $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema'
+ strict:
+ anyOf:
+ - type: boolean
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when an annotation is added to output text content.
- title: ResponseOutputTextAnnotationAddedEvent
- x-oaiMeta:
- name: response.output_text.annotation.added
- group: responses
- example: |
- {
- "type": "response.output_text.annotation.added",
- "item_id": "item-abc",
- "output_index": 0,
- "content_index": 0,
- "annotation_index": 0,
- "annotation": {
- "type": "text_annotation",
- "text": "This is a test annotation",
- "start": 0,
- "end": 10
- },
- "sequence_number": 1
- }
- OpenAI.ResponsePromptVariables:
- type: object
- unevaluatedProperties:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.InputTextContent'
- - $ref: '#/components/schemas/OpenAI.InputImageContent'
- - $ref: '#/components/schemas/OpenAI.InputFileContent'
+ - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
description: |-
- Optional map of values to substitute in for variables in your
- prompt. The substitution values can either be strings, or other
- Response input types like images or files.
- title: Prompt Variables
- x-oaiExpandable: true
- x-oaiTypeLabel: map
- OpenAI.ResponseQueuedEvent:
+ JSON Schema response format. Used to generate structured JSON responses.
+ Learn more about [Structured Outputs](/docs/guides/structured-outputs).
+ title: JSON schema
+ OpenAI.ThreadObject:
type: object
required:
- - type
- - response
- - sequence_number
+ - id
+ - object
+ - created_at
+ - tool_resources
+ - metadata
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - response.queued
- description: The type of the event. Always 'response.queued'.
+ - thread
+ description: The object type, which is always `thread`.
x-stainless-const: true
- response:
- $ref: '#/components/schemas/OpenAI.Response'
- description: The full response object that is queued.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number for this event.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a response is queued and waiting to be processed.
- title: ResponseQueuedEvent
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the thread was created.
+ tool_resources:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.ThreadObjectToolResources'
+ - type: 'null'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: Represents a thread that contains [messages](/docs/api-reference/messages).
+ title: Thread
x-oaiMeta:
- name: response.queued
- group: responses
+ name: The thread object
+ beta: true
example: |
{
- "type": "response.queued",
- "response": {
- "id": "res_123",
- "status": "queued",
- "created_at": "2021-01-01T00:00:00Z",
- "updated_at": "2021-01-01T00:00:00Z"
- },
- "sequence_number": 1
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1698107661,
+ "metadata": {}
}
- OpenAI.ResponseReasoningSummaryPartAddedEvent:
+ OpenAI.ThreadObjectToolResources:
+ type: object
+ properties:
+ code_interpreter:
+ $ref: '#/components/schemas/OpenAI.ThreadObjectToolResourcesCodeInterpreter'
+ file_search:
+ $ref: '#/components/schemas/OpenAI.ThreadObjectToolResourcesFileSearch'
+ OpenAI.ThreadObjectToolResourcesCodeInterpreter:
+ type: object
+ properties:
+ file_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 20
+ OpenAI.ThreadObjectToolResourcesFileSearch:
+ type: object
+ properties:
+ vector_store_ids:
+ type: array
+ items:
+ type: string
+ maxItems: 1
+ OpenAI.TokenLimits:
+ type: object
+ properties:
+ post_instructions:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 0
+ OpenAI.Tool:
type: object
required:
- type
- - item_id
- - output_index
- - summary_index
- - sequence_number
- - part
+ properties:
+ type:
+ $ref: '#/components/schemas/OpenAI.ToolType'
+ discriminator:
+ propertyName: type
+ mapping:
+ bing_grounding: '#/components/schemas/BingGroundingTool'
+ fabric_dataagent_preview: '#/components/schemas/MicrosoftFabricPreviewTool'
+ sharepoint_grounding_preview: '#/components/schemas/SharepointPreviewTool'
+ azure_ai_search: '#/components/schemas/AzureAISearchTool'
+ openapi: '#/components/schemas/OpenApiTool'
+ bing_custom_search_preview: '#/components/schemas/BingCustomSearchPreviewTool'
+ browser_automation_preview: '#/components/schemas/BrowserAutomationPreviewTool'
+ azure_function: '#/components/schemas/AzureFunctionTool'
+ capture_structured_outputs: '#/components/schemas/CaptureStructuredOutputsTool'
+ a2a_preview: '#/components/schemas/A2APreviewTool'
+ work_iq_preview: '#/components/schemas/WorkIQPreviewTool'
+ fabric_iq_preview: '#/components/schemas/FabricIQPreviewTool'
+ web_iq_preview: '#/components/schemas/WebIQPreviewTool'
+ memory_search_preview: '#/components/schemas/MemorySearchPreviewTool'
+ memory_search: '#/components/schemas/MemorySearchTool'
+ code_interpreter: '#/components/schemas/OpenAI.CodeInterpreterTool'
+ function: '#/components/schemas/OpenAI.FunctionTool'
+ file_search: '#/components/schemas/OpenAI.FileSearchTool'
+ computer_use_preview: '#/components/schemas/OpenAI.ComputerUsePreviewTool'
+ web_search: '#/components/schemas/OpenAI.WebSearchTool'
+ mcp: '#/components/schemas/OpenAI.MCPTool'
+ image_generation: '#/components/schemas/OpenAI.ImageGenTool'
+ local_shell: '#/components/schemas/OpenAI.LocalShellToolParam'
+ shell: '#/components/schemas/OpenAI.FunctionShellToolParam'
+ custom: '#/components/schemas/OpenAI.CustomToolParam'
+ web_search_preview: '#/components/schemas/OpenAI.WebSearchPreviewTool'
+ apply_patch: '#/components/schemas/OpenAI.ApplyPatchToolParam'
+ computer: '#/components/schemas/OpenAI.ComputerTool'
+ namespace: '#/components/schemas/OpenAI.NamespaceToolParam'
+ tool_search: '#/components/schemas/OpenAI.ToolSearchToolParam'
+ description: A tool that can be used to generate a response.
+ OpenAI.ToolChoiceAllowed:
+ type: object
+ required:
+ - type
+ - mode
+ - tools
properties:
type:
type: string
enum:
- - response.reasoning_summary_part.added
- description: The type of the event. Always `response.reasoning_summary_part.added`.
+ - allowed_tools
+ description: Allowed tool configuration type. Always `allowed_tools`.
x-stainless-const: true
- item_id:
+ mode:
type: string
- description: The ID of the item this summary part is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this summary part is associated with.
- summary_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the summary part within the reasoning summary.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- part:
- $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart'
- description: The summary part that was added.
+ enum:
+ - auto
+ - required
+ description: |-
+ 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.
+ tools:
+ type: array
+ items:
+ type: object
+ unevaluatedProperties: {}
+ description: |-
+ 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" }
+ ]
+ ```
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a new reasoning summary part is added.
- x-oaiMeta:
- name: response.reasoning_summary_part.added
- group: responses
- example: |
- {
- "type": "response.reasoning_summary_part.added",
- "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
- "output_index": 0,
- "summary_index": 0,
- "part": {
- "type": "summary_text",
- "text": ""
- },
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningSummaryPartAddedEventPart:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Constrains the tools available to the model to a pre-defined set.
+ title: Allowed tools
+ OpenAI.ToolChoiceCodeInterpreter:
type: object
required:
- type
- - text
properties:
type:
type: string
enum:
- - summary_text
- x-stainless-const: true
- text:
- type: string
- OpenAI.ResponseReasoningSummaryPartDoneEvent:
+ - code_interpreter
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceComputer:
type: object
required:
- type
- - item_id
- - output_index
- - summary_index
- - sequence_number
- - part
properties:
type:
type: string
enum:
- - response.reasoning_summary_part.done
- description: The type of the event. Always `response.reasoning_summary_part.done`.
- x-stainless-const: true
- item_id:
+ - computer
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceComputerUse:
+ type: object
+ required:
+ - type
+ properties:
+ type:
type: string
- description: The ID of the item this summary part is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this summary part is associated with.
- summary_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the summary part within the reasoning summary.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
- part:
- $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEventPart'
- description: The completed summary part.
+ enum:
+ - computer_use
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a reasoning summary part is completed.
- x-oaiMeta:
- name: response.reasoning_summary_part.done
- group: responses
- example: |
- {
- "type": "response.reasoning_summary_part.done",
- "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
- "output_index": 0,
- "summary_index": 0,
- "part": {
- "type": "summary_text",
- "text": "**Responding to a greeting**
-
- The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!"
- },
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningSummaryPartDoneEventPart:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceComputerUsePreview:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - computer_use_preview
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceCustom:
type: object
required:
- type
- - text
+ - name
properties:
type:
type: string
enum:
- - summary_text
+ - custom
+ description: For custom tool calling, the type is always `custom`.
x-stainless-const: true
- text:
+ name:
type: string
- OpenAI.ResponseReasoningSummaryTextDeltaEvent:
+ description: The name of the custom tool to call.
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Use this option to force the model to call a specific custom tool.
+ title: Custom tool
+ OpenAI.ToolChoiceFileSearch:
type: object
required:
- type
- - item_id
- - output_index
- - summary_index
- - delta
- - sequence_number
properties:
type:
type: string
enum:
- - response.reasoning_summary_text.delta
- description: The type of the event. Always `response.reasoning_summary_text.delta`.
- x-stainless-const: true
- item_id:
- type: string
- description: The ID of the item this summary text delta is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this summary text delta is associated with.
- summary_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the summary part within the reasoning summary.
- delta:
- type: string
- description: The text delta that was added to the summary.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ - file_search
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a delta is added to a reasoning summary text.
- x-oaiMeta:
- name: response.reasoning_summary_text.delta
- group: responses
- example: |
- {
- "type": "response.reasoning_summary_text.delta",
- "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
- "output_index": 0,
- "summary_index": 0,
- "delta": "**Responding to a greeting**
-
- The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningSummaryTextDoneEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceFunction:
type: object
required:
- type
- - item_id
- - output_index
- - summary_index
- - text
- - sequence_number
+ - name
properties:
type:
type: string
enum:
- - response.reasoning_summary_text.done
- description: The type of the event. Always `response.reasoning_summary_text.done`.
+ - function
+ description: For function calling, the type is always `function`.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the item this summary text is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this summary text is associated with.
- summary_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the summary part within the reasoning summary.
- text:
+ name:
type: string
- description: The full text of the completed reasoning summary.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: The name of the function to call.
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a reasoning summary text is completed.
- x-oaiMeta:
- name: response.reasoning_summary_text.done
- group: responses
- example: |
- {
- "type": "response.reasoning_summary_text.done",
- "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
- "output_index": 0,
- "summary_index": 0,
- "text": "**Responding to a greeting**
-
- The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningTextDeltaEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Use this option to force the model to call a specific function.
+ title: Function tool
+ OpenAI.ToolChoiceImageGeneration:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - delta
- - sequence_number
properties:
type:
type: string
enum:
- - response.reasoning_text.delta
- description: The type of the event. Always `response.reasoning_text.delta`.
- x-stainless-const: true
- item_id:
- type: string
- description: The ID of the item this reasoning text delta is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this reasoning text delta is associated with.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the reasoning content part this delta is associated with.
- delta:
- type: string
- description: The text delta that was added to the reasoning content.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ - image_generation
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a delta is added to a reasoning text.
- x-oaiMeta:
- name: response.reasoning_text.delta
- group: responses
- example: |
- {
- "type": "response.reasoning_text.delta",
- "item_id": "rs_123",
- "output_index": 0,
- "content_index": 0,
- "delta": "The",
- "sequence_number": 1
- }
- OpenAI.ResponseReasoningTextDoneEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceMCP:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - text
- - sequence_number
+ - server_label
properties:
type:
type: string
enum:
- - response.reasoning_text.done
- description: The type of the event. Always `response.reasoning_text.done`.
+ - mcp
+ description: For MCP tools, the type is always `mcp`.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the item this reasoning text is associated with.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item this reasoning text is associated with.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the reasoning content part.
- text:
+ server_label:
type: string
- description: The full text of the completed reasoning content.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ description: The label of the MCP server to use.
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a reasoning text is completed.
- x-oaiMeta:
- name: response.reasoning_text.done
- group: responses
- example: |
- {
- "type": "response.reasoning_text.done",
- "item_id": "rs_123",
- "output_index": 0,
- "content_index": 0,
- "text": "The user is asking...",
- "sequence_number": 4
- }
- OpenAI.ResponseRefusalDeltaEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: Use this option to force the model to call a specific tool on a remote MCP server.
+ title: MCP tool
+ OpenAI.ToolChoiceOptions:
+ type: string
+ enum:
+ - none
+ - auto
+ - required
+ description: |-
+ Controls which (if any) tool is called by the model.
+ `none` means the model will not call any tool and instead generates a message.
+ `auto` means the model can pick between generating a message or calling one or
+ more tools.
+ `required` means the model must call one or more tools.
+ title: Tool choice mode
+ OpenAI.ToolChoiceParam:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - delta
- - sequence_number
properties:
type:
- type: string
+ $ref: '#/components/schemas/OpenAI.ToolChoiceParamType'
+ discriminator:
+ propertyName: type
+ mapping:
+ allowed_tools: '#/components/schemas/OpenAI.ToolChoiceAllowed'
+ function: '#/components/schemas/OpenAI.ToolChoiceFunction'
+ mcp: '#/components/schemas/OpenAI.ToolChoiceMCP'
+ custom: '#/components/schemas/OpenAI.ToolChoiceCustom'
+ apply_patch: '#/components/schemas/OpenAI.SpecificApplyPatchParam'
+ shell: '#/components/schemas/OpenAI.SpecificFunctionShellParam'
+ file_search: '#/components/schemas/OpenAI.ToolChoiceFileSearch'
+ web_search_preview: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview'
+ computer_use_preview: '#/components/schemas/OpenAI.ToolChoiceComputerUsePreview'
+ web_search_preview_2025_03_11: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311'
+ image_generation: '#/components/schemas/OpenAI.ToolChoiceImageGeneration'
+ code_interpreter: '#/components/schemas/OpenAI.ToolChoiceCodeInterpreter'
+ computer: '#/components/schemas/OpenAI.ToolChoiceComputer'
+ computer_use: '#/components/schemas/OpenAI.ToolChoiceComputerUse'
+ description: |-
+ 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.
+ OpenAI.ToolChoiceParamType:
+ anyOf:
+ - type: string
+ - type: string
enum:
- - response.refusal.delta
- description: The type of the event. Always `response.refusal.delta`.
- x-stainless-const: true
- item_id:
- type: string
- description: The ID of the output item that the refusal text is added to.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the refusal text is added to.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that the refusal text is added to.
- delta:
+ - allowed_tools
+ - function
+ - mcp
+ - custom
+ - apply_patch
+ - shell
+ - file_search
+ - web_search_preview
+ - computer_use_preview
+ - web_search_preview_2025_03_11
+ - image_generation
+ - code_interpreter
+ - computer
+ - computer_use
+ OpenAI.ToolChoiceWebSearchPreview:
+ type: object
+ required:
+ - type
+ properties:
+ type:
type: string
- description: The refusal text that is added.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ enum:
+ - web_search_preview
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is a partial refusal text.
- x-oaiMeta:
- name: response.refusal.delta
- group: responses
- example: |
- {
- "type": "response.refusal.delta",
- "item_id": "msg_123",
- "output_index": 0,
- "content_index": 0,
- "delta": "refusal text so far",
- "sequence_number": 1
- }
- OpenAI.ResponseRefusalDoneEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolChoiceWebSearchPreview20250311:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - refusal
- - sequence_number
properties:
type:
type: string
enum:
- - response.refusal.done
- description: The type of the event. Always `response.refusal.done`.
- x-stainless-const: true
- item_id:
- type: string
- description: The ID of the output item that the refusal text is finalized.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the refusal text is finalized.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that the refusal text is finalized.
- refusal:
- type: string
- description: The refusal text that is finalized.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of this event.
+ - web_search_preview_2025_03_11
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when refusal text is finalized.
- x-oaiMeta:
- name: response.refusal.done
- group: responses
- example: |
- {
- "type": "response.refusal.done",
- "item_id": "item-abc",
- "output_index": 1,
- "content_index": 2,
- "refusal": "final refusal text",
- "sequence_number": 1
- }
- OpenAI.ResponseStreamEvent:
+ - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ description: |-
+ Indicates that the model should use a built-in tool to generate a response.
+ [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
+ OpenAI.ToolSearchExecutionType:
+ type: string
+ enum:
+ - server
+ - client
+ OpenAI.ToolSearchToolParam:
type: object
required:
- type
properties:
type:
- $ref: '#/components/schemas/OpenAI.ResponseStreamEventType'
- discriminator:
- propertyName: type
- mapping:
- response.audio.transcript.delta: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent'
- response.code_interpreter_call_code.delta: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent'
- response.code_interpreter_call.in_progress: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent'
- response.code_interpreter_call.interpreting: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent'
- response.content_part.added: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent'
- response.created: '#/components/schemas/OpenAI.ResponseCreatedEvent'
- error: '#/components/schemas/OpenAI.ResponseErrorEvent'
- response.file_search_call.in_progress: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent'
- response.file_search_call.searching: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent'
- response.function_call_arguments.delta: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent'
- response.in_progress: '#/components/schemas/OpenAI.ResponseInProgressEvent'
- response.failed: '#/components/schemas/OpenAI.ResponseFailedEvent'
- response.incomplete: '#/components/schemas/OpenAI.ResponseIncompleteEvent'
- response.output_item.added: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent'
- response.reasoning_summary_part.added: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent'
- response.reasoning_summary_text.delta: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent'
- response.reasoning_text.delta: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent'
- response.refusal.delta: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent'
- response.output_text.delta: '#/components/schemas/OpenAI.ResponseTextDeltaEvent'
- response.web_search_call.in_progress: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent'
- response.web_search_call.searching: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent'
- response.image_generation_call.generating: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent'
- response.image_generation_call.in_progress: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent'
- response.image_generation_call.partial_image: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent'
- response.mcp_call_arguments.delta: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent'
- response.mcp_call.failed: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent'
- response.mcp_call.in_progress: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent'
- response.mcp_list_tools.failed: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent'
- response.mcp_list_tools.in_progress: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent'
- response.output_text.annotation.added: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent'
- response.queued: '#/components/schemas/OpenAI.ResponseQueuedEvent'
- response.custom_tool_call_input.delta: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent'
- response.audio.done: '#/components/schemas/OpenAI.ResponseAudioDoneEvent'
- response.audio.transcript.done: '#/components/schemas/OpenAI.ResponseAudioTranscriptDoneEvent'
- response.code_interpreter_call_code.done: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDoneEvent'
- response.code_interpreter_call.completed: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCompletedEvent'
- response.completed: '#/components/schemas/OpenAI.ResponseCompletedEvent'
- response.content_part.done: '#/components/schemas/OpenAI.ResponseContentPartDoneEvent'
- response.file_search_call.completed: '#/components/schemas/OpenAI.ResponseFileSearchCallCompletedEvent'
- response.function_call_arguments.done: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDoneEvent'
- response.output_item.done: '#/components/schemas/OpenAI.ResponseOutputItemDoneEvent'
- response.reasoning_summary_part.done: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartDoneEvent'
- response.reasoning_summary_text.done: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDoneEvent'
- response.reasoning_text.done: '#/components/schemas/OpenAI.ResponseReasoningTextDoneEvent'
- response.refusal.done: '#/components/schemas/OpenAI.ResponseRefusalDoneEvent'
- response.output_text.done: '#/components/schemas/OpenAI.ResponseTextDoneEvent'
- response.web_search_call.completed: '#/components/schemas/OpenAI.ResponseWebSearchCallCompletedEvent'
- response.image_generation_call.completed: '#/components/schemas/OpenAI.ResponseImageGenCallCompletedEvent'
- response.mcp_call_arguments.done: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDoneEvent'
- response.mcp_call.completed: '#/components/schemas/OpenAI.ResponseMCPCallCompletedEvent'
- response.mcp_list_tools.completed: '#/components/schemas/OpenAI.ResponseMCPListToolsCompletedEvent'
- response.custom_tool_call_input.done: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDoneEvent'
- response.audio.delta: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent'
- OpenAI.ResponseStreamEventType:
+ type: string
+ enum:
+ - tool_search
+ description: The type of the tool. Always `tool_search`.
+ x-stainless-const: true
+ execution:
+ $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
+ description: Whether tool search is executed by the server or by the client.
+ description:
+ anyOf:
+ - type: string
+ - type: 'null'
+ parameters:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.EmptyModelParam'
+ - type: 'null'
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: Hosted or BYOT tool search configuration for deferred tools.
+ title: Tool search tool
+ OpenAI.ToolType:
anyOf:
- type: string
- type: string
enum:
- - response.audio.delta
- - response.audio.done
- - response.audio.transcript.delta
- - response.audio.transcript.done
- - response.code_interpreter_call_code.delta
- - response.code_interpreter_call_code.done
- - response.code_interpreter_call.completed
- - response.code_interpreter_call.in_progress
- - response.code_interpreter_call.interpreting
- - response.completed
- - response.content_part.added
- - response.content_part.done
- - response.created
- - error
- - response.file_search_call.completed
- - response.file_search_call.in_progress
- - response.file_search_call.searching
- - response.function_call_arguments.delta
- - response.function_call_arguments.done
- - response.in_progress
- - response.failed
- - response.incomplete
- - response.output_item.added
- - response.output_item.done
- - response.reasoning_summary_part.added
- - response.reasoning_summary_part.done
- - response.reasoning_summary_text.delta
- - response.reasoning_summary_text.done
- - response.reasoning_text.delta
- - response.reasoning_text.done
- - response.refusal.delta
- - response.refusal.done
- - response.output_text.delta
- - response.output_text.done
- - response.web_search_call.completed
- - response.web_search_call.in_progress
- - response.web_search_call.searching
- - response.image_generation_call.completed
- - response.image_generation_call.generating
- - response.image_generation_call.in_progress
- - response.image_generation_call.partial_image
- - response.mcp_call_arguments.delta
- - response.mcp_call_arguments.done
- - response.mcp_call.completed
- - response.mcp_call.failed
- - response.mcp_call.in_progress
- - response.mcp_list_tools.completed
- - response.mcp_list_tools.failed
- - response.mcp_list_tools.in_progress
- - response.output_text.annotation.added
- - response.queued
- - response.custom_tool_call_input.delta
- - response.custom_tool_call_input.done
- OpenAI.ResponseStreamOptions:
- type: object
- properties:
- include_obfuscation:
- type: boolean
- description: |-
- 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.
- description: 'Options for streaming responses. Only set this when you set `stream: true`.'
- OpenAI.ResponseTextDeltaEvent:
+ - function
+ - file_search
+ - computer
+ - computer_use_preview
+ - web_search
+ - mcp
+ - code_interpreter
+ - image_generation
+ - local_shell
+ - shell
+ - custom
+ - namespace
+ - tool_search
+ - web_search_preview
+ - apply_patch
+ - a2a_preview
+ - bing_custom_search_preview
+ - browser_automation_preview
+ - fabric_dataagent_preview
+ - sharepoint_grounding_preview
+ - memory_search_preview
+ - work_iq_preview
+ - fabric_iq_preview
+ - web_iq_preview
+ - toolbox_search_preview
+ - azure_ai_search
+ - azure_function
+ - bing_grounding
+ - capture_structured_outputs
+ - openapi
+ - memory_search
+ OpenAI.ToolsArray:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.Tool'
+ description: |-
+ 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.
+ We support the following categories of tools:
+ - **Built-in tools**: Tools that are provided by OpenAI that extend the
+ model's capabilities, like [web search](/docs/guides/tools-web-search)
+ or [file search](/docs/guides/tools-file-search). Learn more about
+ [built-in tools](/docs/guides/tools).
+ - **MCP Tools**: Integrations with third-party systems via custom MCP servers
+ or predefined connectors such as Google Drive and SharePoint. Learn more about
+ [MCP Tools](/docs/guides/tools-connectors-mcp).
+ - **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](/docs/guides/function-calling). You can also use
+ custom tools to call your own code.
+ OpenAI.TopLogProb:
type: object
required:
- - type
- - item_id
- - output_index
- - content_index
- - delta
- - sequence_number
- - logprobs
+ - token
+ - logprob
+ - bytes
properties:
- type:
- type: string
- enum:
- - response.output_text.delta
- description: The type of the event. Always `response.output_text.delta`.
- x-stainless-const: true
- item_id:
- type: string
- description: The ID of the output item that the text delta was added to.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the text delta was added to.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that the text delta was added to.
- delta:
+ token:
type: string
- description: The text delta that was added.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number for this event.
- logprobs:
+ logprob:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ bytes:
type: array
items:
- $ref: '#/components/schemas/OpenAI.ResponseLogProb'
- description: The log probabilities of the tokens in the delta.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when there is an additional text delta.
- x-oaiMeta:
- name: response.output_text.delta
- group: responses
- example: |
- {
- "type": "response.output_text.delta",
- "item_id": "msg_123",
- "output_index": 0,
- "content_index": 0,
- "delta": "In",
- "sequence_number": 1
- }
- OpenAI.ResponseTextDoneEvent:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The top log probability of a token.
+ title: Top log probability
+ OpenAI.TranscriptTextUsageDuration:
type: object
required:
- type
- - item_id
- - output_index
- - content_index
- - text
- - sequence_number
- - logprobs
+ - seconds
properties:
type:
type: string
enum:
- - response.output_text.done
- description: The type of the event. Always `response.output_text.done`.
+ - duration
+ description: The type of the usage object. Always `duration` for this variant.
x-stainless-const: true
- item_id:
- type: string
- description: The ID of the output item that the text content is finalized.
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the text content is finalized.
- content_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the content part that the text content is finalized.
- text:
- type: string
- description: The text content that is finalized.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number for this event.
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.ResponseLogProb'
- description: The log probabilities of the tokens in the delta.
+ seconds:
+ type: integer
+ format: int64
+ description: Duration of the input audio in seconds.
+ x-ms-duration: seconds
allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when text content is finalized.
- x-oaiMeta:
- name: response.output_text.done
- group: responses
- example: |
- {
- "type": "response.output_text.done",
- "item_id": "msg_123",
- "output_index": 0,
- "content_index": 0,
- "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
- "sequence_number": 1
- }
- OpenAI.ResponseTextParam:
- type: object
- properties:
- format:
- $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- verbosity:
- $ref: '#/components/schemas/OpenAI.Verbosity'
- description: |-
- Configuration options for a text response from the model. Can be plain
- text or structured JSON data. Learn more:
- - [Text inputs and outputs](/docs/guides/text)
- - [Structured Outputs](/docs/guides/structured-outputs)
- OpenAI.ResponseUsage:
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage'
+ description: Usage statistics for models billed by audio input duration.
+ title: Duration Usage
+ OpenAI.TranscriptTextUsageTokens:
type: object
required:
+ - type
- input_tokens
- - input_tokens_details
- output_tokens
- - output_tokens_details
- total_tokens
properties:
+ type:
+ type: string
+ enum:
+ - tokens
+ description: The type of the usage object. Always `tokens` for this variant.
+ x-stainless-const: true
input_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The number of input tokens.
- input_tokens_details:
- $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails'
- description: A detailed breakdown of the input tokens.
+ description: Number of input tokens billed for this request.
+ input_token_details:
+ $ref: '#/components/schemas/OpenAI.TranscriptTextUsageTokensInputTokenDetails'
+ description: Details about the input tokens billed for this request.
output_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The number of output tokens.
- output_tokens_details:
- $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails'
- description: A detailed breakdown of the output tokens.
+ description: Number of output tokens generated.
total_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- description: The total number of tokens used.
- description: |-
- Represents token usage details including input tokens, output tokens,
- a breakdown of output tokens, and the total tokens used.
- OpenAI.ResponseUsageInputTokensDetails:
+ description: Total number of tokens used (input + output).
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.CreateTranscriptionResponseJsonUsage'
+ description: Usage statistics for models billed by token usage.
+ title: Token Usage
+ OpenAI.TranscriptTextUsageTokensInputTokenDetails:
type: object
- required:
- - cached_tokens
properties:
- cached_tokens:
+ text_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- OpenAI.ResponseUsageOutputTokensDetails:
- type: object
- required:
- - reasoning_tokens
- properties:
- reasoning_tokens:
+ audio_tokens:
$ref: '#/components/schemas/OpenAI.integer'
- OpenAI.ResponseWebSearchCallCompletedEvent:
+ OpenAI.TranscriptionDiarizedSegment:
type: object
required:
- type
- - output_index
- - item_id
- - sequence_number
+ - id
+ - start
+ - end
+ - text
+ - speaker
properties:
type:
type: string
enum:
- - response.web_search_call.completed
- description: The type of the event. Always `response.web_search_call.completed`.
+ - transcript.text.segment
+ description: The type of the segment. Always `transcript.text.segment`.
x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the web search call is associated with.
- item_id:
+ id:
type: string
- description: Unique ID for the output item associated with the web search call.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the web search call being processed.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a web search call is completed.
- x-oaiMeta:
- name: response.web_search_call.completed
- group: responses
- example: |
- {
- "type": "response.web_search_call.completed",
- "output_index": 0,
- "item_id": "ws_123",
- "sequence_number": 0
- }
- OpenAI.ResponseWebSearchCallInProgressEvent:
- type: object
- required:
- - type
- - output_index
- - item_id
- - sequence_number
- properties:
- type:
+ description: Unique identifier for the segment.
+ start:
+ type: integer
+ format: int64
+ description: Start timestamp of the segment in seconds.
+ x-ms-duration: seconds
+ end:
+ type: integer
+ format: int64
+ description: End timestamp of the segment in seconds.
+ x-ms-duration: seconds
+ text:
type: string
- enum:
- - response.web_search_call.in_progress
- description: The type of the event. Always `response.web_search_call.in_progress`.
- x-stainless-const: true
- output_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the web search call is associated with.
- item_id:
+ description: Transcript text for this segment.
+ speaker:
type: string
- description: Unique ID for the output item associated with the web search call.
- sequence_number:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the web search call being processed.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a web search call is initiated.
- x-oaiMeta:
- name: response.web_search_call.in_progress
- group: responses
- example: |
- {
- "type": "response.web_search_call.in_progress",
- "output_index": 0,
- "item_id": "ws_123",
- "sequence_number": 0
- }
- OpenAI.ResponseWebSearchCallSearchingEvent:
+ description: Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).
+ description: A segment of diarized transcript text with speaker metadata.
+ OpenAI.TranscriptionInclude:
+ type: string
+ enum:
+ - logprobs
+ OpenAI.TranscriptionSegment:
type: object
required:
- - type
- - output_index
- - item_id
- - sequence_number
+ - id
+ - seek
+ - start
+ - end
+ - text
+ - tokens
+ - temperature
+ - avg_logprob
+ - compression_ratio
+ - no_speech_prob
properties:
- type:
- type: string
- enum:
- - response.web_search_call.searching
- description: The type of the event. Always `response.web_search_call.searching`.
- x-stainless-const: true
- output_index:
+ id:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the output item that the web search call is associated with.
- item_id:
- type: string
- description: Unique ID for the output item associated with the web search call.
- sequence_number:
+ description: Unique identifier of the segment.
+ seek:
$ref: '#/components/schemas/OpenAI.integer'
- description: The sequence number of the web search call being processed.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ResponseStreamEvent'
- description: Emitted when a web search call is executing.
- x-oaiMeta:
- name: response.web_search_call.searching
- group: responses
- example: |
- {
- "type": "response.web_search_call.searching",
- "output_index": 0,
- "item_id": "ws_123",
- "sequence_number": 0
- }
- OpenAI.ScreenshotParam:
+ description: Seek offset of the segment.
+ start:
+ type: integer
+ format: int64
+ description: Start time of the segment in seconds.
+ x-ms-duration: seconds
+ end:
+ type: integer
+ format: int64
+ description: End time of the segment in seconds.
+ x-ms-duration: seconds
+ text:
+ type: string
+ description: Text content of the segment.
+ tokens:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: Array of token IDs for the text content.
+ temperature:
+ type: number
+ format: float
+ description: Temperature parameter used for generating the segment.
+ avg_logprob:
+ type: number
+ format: float
+ description: Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
+ compression_ratio:
+ type: number
+ format: float
+ description: Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
+ no_speech_prob:
+ type: number
+ format: float
+ description: 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.
+ OpenAI.TranscriptionWord:
type: object
required:
- - type
+ - word
+ - start
+ - end
properties:
- type:
+ word:
type: string
- enum:
- - screenshot
- description: Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
- x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A screenshot action.
- title: Screenshot
- OpenAI.ScrollParam:
+ description: The text content of the word.
+ start:
+ type: integer
+ format: int64
+ description: Start time of the word in seconds.
+ x-ms-duration: seconds
+ end:
+ type: integer
+ format: int64
+ description: End time of the word in seconds.
+ x-ms-duration: seconds
+ OpenAI.TruncationObject:
type: object
required:
- type
- - x
- - 'y'
- - scroll_x
- - scroll_y
properties:
type:
type: string
enum:
- - scroll
- description: Specifies the event type. For a scroll action, this property is always set to `scroll`.
- x-stainless-const: true
- x:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The x-coordinate where the scroll occurred.
- 'y':
- $ref: '#/components/schemas/OpenAI.integer'
- description: The y-coordinate where the scroll occurred.
- scroll_x:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The horizontal scroll distance.
- scroll_y:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The vertical scroll distance.
- keys:
+ - auto
+ - last_messages
+ description: 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`.
+ last_messages:
anyOf:
- - type: array
- items:
- type: string
+ - $ref: '#/components/schemas/OpenAI.integer'
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: A scroll action.
- title: Scroll
- OpenAI.SearchContentType:
- type: string
- enum:
- - text
- - image
- OpenAI.SearchContextSize:
- type: string
- enum:
- - low
- - medium
- - high
- OpenAI.ServiceTier:
- anyOf:
- - type: string
- enum:
- - auto
- - default
- - flex
- - scale
- - priority
- - type: 'null'
- description: |-
- Specifies the processing type used for serving the request.
- - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
- - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
- - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.
- - When not set, the default behavior is 'auto'.
- 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.
- OpenAI.ServiceTierEnum:
- type: string
- enum:
- - auto
- - default
- - flex
- - priority
- OpenAI.SkillReferenceParam:
+ description: Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.
+ title: Thread Truncation Controls
+ OpenAI.TypeParam:
type: object
required:
- type
- - skill_id
+ - text
properties:
type:
type: string
enum:
- - skill_reference
- description: References a skill created with the /v1/skills endpoint.
+ - type
+ description: Specifies the event type. For a type action, this property is always set to `type`.
x-stainless-const: true
- skill_id:
- type: string
- minLength: 1
- maxLength: 64
- description: The ID of the referenced skill.
- version:
+ text:
type: string
- description: Optional skill version. Use a positive integer or 'latest'. Omit for default.
+ description: The text to type.
allOf:
- - $ref: '#/components/schemas/OpenAI.ContainerSkill'
- OpenAI.SpecificApplyPatchParam:
+ - $ref: '#/components/schemas/OpenAI.ComputerAction'
+ description: An action to type in text.
+ title: Type
+ OpenAI.UpdateChatCompletionParametersBody:
type: object
required:
- - type
+ - metadata
properties:
- type:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.UpdateConversationBody:
+ type: object
+ required:
+ - metadata
+ properties:
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
+ Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
+ OpenAI.UpdateVectorStoreFileAttributesRequest:
+ type: object
+ required:
+ - attributes
+ properties:
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ x-oaiMeta:
+ name: Update vector store file attributes request
+ OpenAI.UpdateVectorStoreRequest:
+ type: object
+ properties:
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: The name of the vector store.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter'
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ OpenAI.Upload:
+ type: object
+ required:
+ - id
+ - created_at
+ - filename
+ - bytes
+ - purpose
+ - status
+ - expires_at
+ properties:
+ id:
+ type: string
+ description: The Upload unique identifier, which can be referenced in API endpoints.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the Upload was created.
+ filename:
+ type: string
+ description: The name of the file to be uploaded.
+ bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The intended number of bytes to be uploaded.
+ purpose:
+ type: string
+ description: The intended purpose of the file. [Please refer here](/docs/api-reference/files/object#files/object-purpose) for acceptable values.
+ status:
type: string
enum:
- - apply_patch
- description: The tool to call. Always `apply_patch`.
+ - pending
+ - completed
+ - cancelled
+ - expired
+ description: The status of the Upload.
+ expires_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the Upload will expire.
+ object:
+ type: string
+ enum:
+ - upload
+ description: The object type, which is always "upload".
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Forces the model to call the apply_patch tool when executing a tool call.
- title: Specific apply patch tool choice
- OpenAI.SpecificFunctionShellParam:
+ file:
+ $ref: '#/components/schemas/OpenAI.OpenAIFile'
+ description: The Upload object can accept byte chunks in the form of Parts.
+ title: Upload
+ x-oaiMeta:
+ name: The upload object
+ example: |
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "completed",
+ "expires_at": 1719127296,
+ "file": {
+ "id": "file-xyz321",
+ "object": "file",
+ "bytes": 2147483648,
+ "created_at": 1719186911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ }
+ }
+ OpenAI.UploadPart:
type: object
required:
- - type
+ - id
+ - created_at
+ - upload_id
+ - object
properties:
- type:
+ id:
+ type: string
+ description: The upload Part unique identifier, which can be referenced in API endpoints.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the Part was created.
+ upload_id:
+ type: string
+ description: The ID of the Upload object that this Part was added to.
+ object:
type: string
enum:
- - shell
- description: The tool to call. Always `shell`.
+ - upload.part
+ description: The object type, which is always `upload.part`.
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Forces the model to call the shell tool when a tool call is required.
- title: Specific shell tool choice
- OpenAI.SummaryTextContent:
+ description: The upload Part represents a chunk of bytes we can add to an Upload object.
+ title: UploadPart
+ x-oaiMeta:
+ name: The upload part object
+ example: |
+ {
+ "id": "part_def456",
+ "object": "upload.part",
+ "created_at": 1719186911,
+ "upload_id": "upload_abc123"
+ }
+ OpenAI.UrlCitationBody:
type: object
required:
- type
- - text
+ - url
+ - start_index
+ - end_index
+ - title
properties:
type:
type: string
enum:
- - summary_text
- description: The type of the object. Always `summary_text`.
+ - url_citation
+ description: The type of the URL citation. Always `url_citation`.
x-stainless-const: true
- text:
+ url:
type: string
- description: A summary of the reasoning output from the model so far.
+ format: uri
+ description: The URL of the web resource.
+ start_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the first character of the URL citation in the message.
+ end_index:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The index of the last character of the URL citation in the message.
+ title:
+ type: string
+ description: The title of the web resource.
allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A summary text from the model.
- title: Summary text
- OpenAI.TextContent:
+ - $ref: '#/components/schemas/OpenAI.Annotation'
+ description: A citation for a web resource used to generate a model response.
+ title: URL citation
+ OpenAI.VadConfig:
type: object
required:
- type
- - text
properties:
type:
type: string
enum:
- - text
- x-stainless-const: true
- text:
- type: string
- allOf:
- - $ref: '#/components/schemas/OpenAI.MessageContent'
- description: A text content.
- title: Text Content
- OpenAI.TextResponseFormatConfiguration:
+ - server_vad
+ description: Must be set to `server_vad` to enable manual chunking using server side VAD.
+ prefix_padding_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: |-
+ Amount of audio to include before the VAD detected speech (in
+ milliseconds).
+ default: 300
+ silence_duration_ms:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: |-
+ 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.
+ default: 200
+ threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ description: |-
+ 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.
+ default: 0.5
+ OpenAI.ValidateGraderRequest:
type: object
required:
- - type
+ - grader
properties:
- type:
- $ref: '#/components/schemas/OpenAI.TextResponseFormatConfigurationType'
- discriminator:
- propertyName: type
- mapping:
- json_schema: '#/components/schemas/OpenAI.TextResponseFormatJsonSchema'
- text: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText'
- json_object: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject'
- description: |-
- An object specifying the format that the model must output.
- Configuring `{ "type": "json_schema" }` enables Structured Outputs,
- which ensures the model will match your supplied JSON schema. Learn more in the
- [Structured Outputs guide](/docs/guides/structured-outputs).
- The default format is `{ "type": "text" }` with no additional options.
- *Not recommended for gpt-4o and newer models:**
- 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.
- OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject:
+ grader:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderMulti'
+ description: The grader used for the fine-tuning job.
+ title: ValidateGraderRequest
+ OpenAI.ValidateGraderResponse:
type: object
- required:
- - type
properties:
- type:
- type: string
- enum:
- - json_object
- description: The type of response format being defined. Always `json_object`.
- x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- description: |-
- JSON object response format. An older method of generating JSON responses.
- Using `json_schema` is recommended for models that support it. Note that the
- model will not generate JSON without a system or user message instructing it
- to do so.
- title: JSON object
- OpenAI.TextResponseFormatConfigurationResponseFormatText:
+ grader:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.GraderStringCheck'
+ - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity'
+ - $ref: '#/components/schemas/OpenAI.GraderPython'
+ - $ref: '#/components/schemas/OpenAI.GraderScoreModel'
+ - $ref: '#/components/schemas/OpenAI.GraderMulti'
+ description: The grader used for the fine-tuning job.
+ title: ValidateGraderResponse
+ OpenAI.VectorStoreExpirationAfter:
type: object
required:
- - type
+ - anchor
+ - days
properties:
- type:
+ anchor:
type: string
enum:
- - text
- description: The type of response format being defined. Always `text`.
+ - last_active_at
+ description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.'
x-stainless-const: true
- allOf:
- - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- description: Default response format. Used to generate text responses.
- title: Text
- OpenAI.TextResponseFormatConfigurationType:
- anyOf:
- - type: string
- - type: string
- enum:
- - text
- - json_schema
- - json_object
- OpenAI.TextResponseFormatJsonSchema:
+ days:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 1
+ maximum: 365
+ description: The number of days after the anchor time that the vector store will expire.
+ description: The expiration policy for a vector store.
+ title: Vector store expiration policy
+ OpenAI.VectorStoreFileAttributes:
+ type: object
+ unevaluatedProperties:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/OpenAI.numeric'
+ - type: boolean
+ description: |-
+ Set of 16 key-value pairs that can be attached to an object. This can be
+ useful for storing additional information about the object in a structured
+ format, and querying for objects via API or the dashboard. Keys are strings
+ with a maximum length of 64 characters. Values are strings with a maximum
+ length of 512 characters, booleans, or numbers.
+ x-oaiTypeLabel: map
+ OpenAI.VectorStoreFileBatchObject:
type: object
required:
- - type
- - name
- - schema
+ - id
+ - object
+ - created_at
+ - vector_store_id
+ - status
+ - file_counts
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - json_schema
- description: The type of response format being defined. Always `json_schema`.
+ - vector_store.files_batch
+ description: The object type, which is always `vector_store.file_batch`.
x-stainless-const: true
- description:
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the vector store files batch was created.
+ vector_store_id:
type: string
- description: |-
- A description of what the response format is for, used by the model to
- determine how to respond in the format.
- name:
+ description: The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) is attached to.
+ status:
type: string
- description: |-
- 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.
- schema:
- $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema'
- strict:
- anyOf:
- - type: boolean
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration'
- description: |-
- JSON Schema response format. Used to generate structured JSON responses.
- Learn more about [Structured Outputs](/docs/guides/structured-outputs).
- title: JSON schema
- OpenAI.Tool:
+ enum:
+ - in_progress
+ - completed
+ - cancelled
+ - failed
+ description: The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`.
+ file_counts:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObjectFileCounts'
+ description: A batch of files attached to a vector store.
+ title: Vector store file batch
+ x-oaiMeta:
+ name: The vector store files batch object
+ beta: true
+ example: |
+ {
+ "id": "vsfb_123",
+ "object": "vector_store.files_batch",
+ "created_at": 1698107661,
+ "vector_store_id": "vs_abc123",
+ "status": "completed",
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 100,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 100
+ }
+ }
+ OpenAI.VectorStoreFileBatchObjectFileCounts:
type: object
required:
- - type
+ - in_progress
+ - completed
+ - failed
+ - cancelled
+ - total
properties:
- type:
- $ref: '#/components/schemas/OpenAI.ToolType'
- discriminator:
- propertyName: type
- mapping:
- bing_grounding: '#/components/schemas/BingGroundingTool'
- fabric_dataagent_preview: '#/components/schemas/MicrosoftFabricPreviewTool'
- sharepoint_grounding_preview: '#/components/schemas/SharepointPreviewTool'
- azure_ai_search: '#/components/schemas/AzureAISearchTool'
- openapi: '#/components/schemas/OpenApiTool'
- bing_custom_search_preview: '#/components/schemas/BingCustomSearchPreviewTool'
- browser_automation_preview: '#/components/schemas/BrowserAutomationPreviewTool'
- azure_function: '#/components/schemas/AzureFunctionTool'
- capture_structured_outputs: '#/components/schemas/CaptureStructuredOutputsTool'
- a2a_preview: '#/components/schemas/A2APreviewTool'
- work_iq_preview: '#/components/schemas/WorkIQPreviewTool'
- fabric_iq_preview: '#/components/schemas/FabricIQPreviewTool'
- memory_search_preview: '#/components/schemas/MemorySearchPreviewTool'
- memory_search: '#/components/schemas/MemorySearchTool'
- code_interpreter: '#/components/schemas/OpenAI.CodeInterpreterTool'
- file_search: '#/components/schemas/OpenAI.FileSearchTool'
- web_search: '#/components/schemas/OpenAI.WebSearchTool'
- mcp: '#/components/schemas/OpenAI.MCPTool'
- function: '#/components/schemas/OpenAI.FunctionTool'
- computer_use_preview: '#/components/schemas/OpenAI.ComputerUsePreviewTool'
- image_generation: '#/components/schemas/OpenAI.ImageGenTool'
- local_shell: '#/components/schemas/OpenAI.LocalShellToolParam'
- shell: '#/components/schemas/OpenAI.FunctionShellToolParam'
- custom: '#/components/schemas/OpenAI.CustomToolParam'
- web_search_preview: '#/components/schemas/OpenAI.WebSearchPreviewTool'
- apply_patch: '#/components/schemas/OpenAI.ApplyPatchToolParam'
- computer: '#/components/schemas/OpenAI.ComputerTool'
- namespace: '#/components/schemas/OpenAI.NamespaceToolParam'
- tool_search: '#/components/schemas/OpenAI.ToolSearchToolParam'
- description: A tool that can be used to generate a response.
- OpenAI.ToolChoiceAllowed:
+ in_progress:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cancelled:
+ $ref: '#/components/schemas/OpenAI.integer'
+ total:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.VectorStoreFileContentResponse:
type: object
required:
- - type
- - mode
- - tools
+ - object
+ - data
+ - has_more
+ - next_page
properties:
- type:
+ object:
type: string
enum:
- - allowed_tools
- description: Allowed tool configuration type. Always `allowed_tools`.
+ - vector_store.file_content.page
+ description: The object type, which is always `vector_store.file_content.page`
x-stainless-const: true
- mode:
- type: string
- enum:
- - auto
- - required
- description: |-
- 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.
- tools:
+ data:
type: array
items:
- type: object
- unevaluatedProperties: {}
- description: |-
- 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" }
- ]
- ```
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Constrains the tools available to the model to a pre-defined set.
- title: Allowed tools
- OpenAI.ToolChoiceCodeInterpreter:
+ $ref: '#/components/schemas/OpenAI.VectorStoreFileContentResponseData'
+ description: Parsed content of the file.
+ has_more:
+ type: boolean
+ description: Indicates if there are more content pages to fetch.
+ next_page:
+ anyOf:
+ - type: string
+ - type: 'null'
+ description: Represents the parsed content of a vector store file.
+ OpenAI.VectorStoreFileContentResponseData:
type: object
- required:
- - type
properties:
type:
type: string
- enum:
- - code_interpreter
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceComputer:
+ text:
+ type: string
+ OpenAI.VectorStoreFileObject:
type: object
required:
- - type
+ - id
+ - object
+ - usage_bytes
+ - created_at
+ - vector_store_id
+ - status
+ - last_error
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - computer
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceComputerUse:
- type: object
- required:
- - type
- properties:
- type:
+ - vector_store.file
+ description: The object type, which is always `vector_store.file`.
+ x-stainless-const: true
+ usage_bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total vector store usage in bytes. Note that this may be different from the original file size.
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the vector store file was created.
+ vector_store_id:
+ type: string
+ description: The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) is attached to.
+ status:
type: string
enum:
- - computer_use
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceComputerUsePreview:
+ - in_progress
+ - completed
+ - cancelled
+ - failed
+ description: 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.
+ last_error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileObjectLastError'
+ - type: 'null'
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ chunking_strategy:
+ $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse'
+ description: A list of files attached to a vector store.
+ title: Vector store files
+ x-oaiMeta:
+ name: The vector store file object
+ beta: true
+ example: |
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "usage_bytes": 1234,
+ "created_at": 1698107661,
+ "vector_store_id": "vs_abc123",
+ "status": "completed",
+ "last_error": null,
+ "chunking_strategy": {
+ "type": "static",
+ "static": {
+ "max_chunk_size_tokens": 800,
+ "chunk_overlap_tokens": 400
+ }
+ }
+ }
+ OpenAI.VectorStoreFileObjectLastError:
type: object
required:
- - type
+ - code
+ - message
properties:
- type:
+ code:
type: string
enum:
- - computer_use_preview
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceCustom:
+ - server_error
+ - unsupported_file
+ - invalid_file
+ message:
+ type: string
+ OpenAI.VectorStoreObject:
type: object
required:
- - type
+ - id
+ - object
+ - created_at
- name
+ - usage_bytes
+ - file_counts
+ - status
+ - last_active_at
+ - metadata
properties:
- type:
+ id:
+ type: string
+ description: The identifier, which can be referenced in API endpoints.
+ object:
type: string
enum:
- - custom
- description: For custom tool calling, the type is always `custom`.
+ - vector_store
+ description: The object type, which is always `vector_store`.
x-stainless-const: true
+ created_at:
+ type: integer
+ format: unixtime
+ description: The Unix timestamp (in seconds) for when the vector store was created.
name:
type: string
- description: The name of the custom tool to call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Use this option to force the model to call a specific custom tool.
- title: Custom tool
- OpenAI.ToolChoiceFileSearch:
- type: object
- required:
- - type
- properties:
- type:
+ description: The name of the vector store.
+ usage_bytes:
+ $ref: '#/components/schemas/OpenAI.integer'
+ description: The total number of bytes used by the files in the vector store.
+ file_counts:
+ $ref: '#/components/schemas/OpenAI.VectorStoreObjectFileCounts'
+ status:
type: string
enum:
- - file_search
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceFunction:
+ - expired
+ - in_progress
+ - completed
+ description: 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.
+ expires_after:
+ $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter'
+ expires_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ last_active_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ metadata:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Metadata'
+ - type: 'null'
+ description: A vector store is a collection of processed files can be used by the `file_search` tool.
+ title: Vector store
+ x-oaiMeta:
+ name: The vector store object
+ example: |
+ {
+ "id": "vs_123",
+ "object": "vector_store",
+ "created_at": 1698107661,
+ "usage_bytes": 123456,
+ "last_active_at": 1698107661,
+ "name": "my_vector_store",
+ "status": "completed",
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 100,
+ "cancelled": 0,
+ "failed": 0,
+ "total": 100
+ },
+ "last_used_at": 1698107661
+ }
+ OpenAI.VectorStoreObjectFileCounts:
type: object
required:
- - type
- - name
+ - in_progress
+ - completed
+ - failed
+ - cancelled
+ - total
properties:
- type:
- type: string
- enum:
- - function
- description: For function calling, the type is always `function`.
- x-stainless-const: true
- name:
- type: string
- description: The name of the function to call.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Use this option to force the model to call a specific function.
- title: Function tool
- OpenAI.ToolChoiceImageGeneration:
+ in_progress:
+ $ref: '#/components/schemas/OpenAI.integer'
+ completed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ failed:
+ $ref: '#/components/schemas/OpenAI.integer'
+ cancelled:
+ $ref: '#/components/schemas/OpenAI.integer'
+ total:
+ $ref: '#/components/schemas/OpenAI.integer'
+ OpenAI.VectorStoreSearchRequest:
type: object
required:
- - type
+ - query
properties:
- type:
- type: string
- enum:
- - image_generation
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceMCP:
+ query:
+ oneOf:
+ - type: string
+ - type: array
+ items:
+ type: string
+ description: A query string for a search
+ rewrite_query:
+ type: boolean
+ description: Whether to rewrite the natural language query for vector search.
+ max_num_results:
+ $ref: '#/components/schemas/OpenAI.integer'
+ minimum: 1
+ maximum: 50
+ description: The maximum number of results to return. This number should be between 1 and 50 inclusive.
+ default: 10
+ filters:
+ oneOf:
+ - $ref: '#/components/schemas/OpenAI.ComparisonFilter'
+ - $ref: '#/components/schemas/OpenAI.CompoundFilter'
+ description: A filter to apply based on file attributes.
+ ranking_options:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchRequestRankingOptions'
+ description: Ranking options for search.
+ x-oaiMeta:
+ name: Vector store search request
+ OpenAI.VectorStoreSearchRequestRankingOptions:
type: object
- required:
- - type
- - server_label
properties:
- type:
+ ranker:
type: string
enum:
- - mcp
- description: For MCP tools, the type is always `mcp`.
- x-stainless-const: true
- server_label:
- type: string
- description: The label of the MCP server to use.
- name:
- anyOf:
- - type: string
- - type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: Use this option to force the model to call a specific tool on a remote MCP server.
- title: MCP tool
- OpenAI.ToolChoiceOptions:
- type: string
- enum:
- - none
- - auto
- - required
- description: |-
- Controls which (if any) tool is called by the model.
- `none` means the model will not call any tool and instead generates a message.
- `auto` means the model can pick between generating a message or calling one or
- more tools.
- `required` means the model must call one or more tools.
- title: Tool choice mode
- OpenAI.ToolChoiceParam:
+ - none
+ - auto
+ - default-2024-11-15
+ default: auto
+ score_threshold:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ OpenAI.VectorStoreSearchResultContentObject:
type: object
required:
- type
+ - text
properties:
type:
- $ref: '#/components/schemas/OpenAI.ToolChoiceParamType'
- discriminator:
- propertyName: type
- mapping:
- allowed_tools: '#/components/schemas/OpenAI.ToolChoiceAllowed'
- function: '#/components/schemas/OpenAI.ToolChoiceFunction'
- mcp: '#/components/schemas/OpenAI.ToolChoiceMCP'
- custom: '#/components/schemas/OpenAI.ToolChoiceCustom'
- apply_patch: '#/components/schemas/OpenAI.SpecificApplyPatchParam'
- shell: '#/components/schemas/OpenAI.SpecificFunctionShellParam'
- file_search: '#/components/schemas/OpenAI.ToolChoiceFileSearch'
- web_search_preview: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview'
- computer_use_preview: '#/components/schemas/OpenAI.ToolChoiceComputerUsePreview'
- web_search_preview_2025_03_11: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311'
- image_generation: '#/components/schemas/OpenAI.ToolChoiceImageGeneration'
- code_interpreter: '#/components/schemas/OpenAI.ToolChoiceCodeInterpreter'
- computer: '#/components/schemas/OpenAI.ToolChoiceComputer'
- computer_use: '#/components/schemas/OpenAI.ToolChoiceComputerUse'
- description: |-
- 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.
- OpenAI.ToolChoiceParamType:
- anyOf:
- - type: string
- - type: string
+ type: string
enum:
- - allowed_tools
- - function
- - mcp
- - custom
- - apply_patch
- - shell
- - file_search
- - web_search_preview
- - computer_use_preview
- - web_search_preview_2025_03_11
- - image_generation
- - code_interpreter
- - computer
- - computer_use
- OpenAI.ToolChoiceWebSearchPreview:
+ - text
+ description: The type of content.
+ text:
+ type: string
+ description: The text content returned from search.
+ x-oaiMeta:
+ name: Vector store search result content object
+ OpenAI.VectorStoreSearchResultItem:
type: object
required:
- - type
+ - file_id
+ - filename
+ - score
+ - attributes
+ - content
properties:
- type:
+ file_id:
type: string
- enum:
- - web_search_preview
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
- description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolChoiceWebSearchPreview20250311:
+ description: The ID of the vector store file.
+ filename:
+ type: string
+ description: The name of the vector store file.
+ score:
+ $ref: '#/components/schemas/OpenAI.numeric'
+ minimum: 0
+ maximum: 1
+ description: The similarity score for the result.
+ attributes:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes'
+ - type: 'null'
+ content:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultContentObject'
+ description: Content chunks from the file.
+ x-oaiMeta:
+ name: Vector store search result item
+ OpenAI.VectorStoreSearchResultsPage:
type: object
required:
- - type
+ - object
+ - search_query
+ - data
+ - has_more
+ - next_page
properties:
- type:
+ object:
type: string
enum:
- - web_search_preview_2025_03_11
- allOf:
- - $ref: '#/components/schemas/OpenAI.ToolChoiceParam'
+ - vector_store.search_results.page
+ description: The object type, which is always `vector_store.search_results.page`
+ x-stainless-const: true
+ search_query:
+ type: array
+ items:
+ type: string
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultItem'
+ description: The list of search result items.
+ has_more:
+ type: boolean
+ description: Indicates if there are more results to fetch.
+ next_page:
+ anyOf:
+ - type: string
+ - type: 'null'
+ x-oaiMeta:
+ name: Vector store search results page
+ OpenAI.Verbosity:
+ anyOf:
+ - type: string
+ enum:
+ - low
+ - medium
+ - high
+ - type: 'null'
description: |-
- Indicates that the model should use a built-in tool to generate a response.
- [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
- OpenAI.ToolSearchExecutionType:
+ Constrains the verbosity of the model's response. Lower values will result in
+ more concise responses, while higher values will result in more verbose responses.
+ Currently supported values are `low`, `medium`, and `high`.
+ OpenAI.VideoCharacterResource:
+ type: object
+ required:
+ - id
+ - name
+ - created_at
+ properties:
+ id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ name:
+ anyOf:
+ - type: string
+ - type: 'null'
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (in seconds) when the character was created.
+ OpenAI.VideoContentVariant:
type: string
enum:
- - server
- - client
- OpenAI.ToolSearchToolParam:
+ - video
+ - thumbnail
+ - spritesheet
+ OpenAI.VideoListResource:
type: object
required:
- - type
+ - object
+ - data
+ - first_id
+ - last_id
+ - has_more
properties:
- type:
+ object:
type: string
enum:
- - tool_search
- description: The type of the tool. Always `tool_search`.
+ - list
+ description: The type of object returned, must be `list`.
x-stainless-const: true
- execution:
- $ref: '#/components/schemas/OpenAI.ToolSearchExecutionType'
- description: Whether tool search is executed by the server or by the client.
- description:
+ default: list
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/OpenAI.VideoResource'
+ description: A list of items
+ x-ms-list-page-items: true
+ first_id:
anyOf:
- type: string
- type: 'null'
- parameters:
+ last_id:
anyOf:
- - $ref: '#/components/schemas/OpenAI.EmptyModelParam'
+ - type: string
- type: 'null'
- allOf:
- - $ref: '#/components/schemas/OpenAI.Tool'
- description: Hosted or BYOT tool search configuration for deferred tools.
- title: Tool search tool
- OpenAI.ToolType:
+ x-ms-list-continuation-token: true
+ has_more:
+ type: boolean
+ description: Whether there are more items available.
+ OpenAI.VideoModel:
anyOf:
- type: string
- type: string
enum:
- - function
- - file_search
- - computer
- - computer_use_preview
- - web_search
- - mcp
- - code_interpreter
- - image_generation
- - local_shell
- - shell
- - custom
- - namespace
- - tool_search
- - web_search_preview
- - apply_patch
- - a2a_preview
- - bing_custom_search_preview
- - browser_automation_preview
- - fabric_dataagent_preview
- - sharepoint_grounding_preview
- - memory_search_preview
- - work_iq_preview
- - fabric_iq_preview
- - toolbox_search_preview
- - azure_ai_search
- - azure_function
- - bing_grounding
- - capture_structured_outputs
- - openapi
- - memory_search
- OpenAI.ToolsArray:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.Tool'
- description: |-
- 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.
- We support the following categories of tools:
- - **Built-in tools**: Tools that are provided by OpenAI that extend the
- model's capabilities, like [web search](/docs/guides/tools-web-search)
- or [file search](/docs/guides/tools-file-search). Learn more about
- [built-in tools](/docs/guides/tools).
- - **MCP Tools**: Integrations with third-party systems via custom MCP servers
- or predefined connectors such as Google Drive and SharePoint. Learn more about
- [MCP Tools](/docs/guides/tools-connectors-mcp).
- - **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](/docs/guides/function-calling). You can also use
- custom tools to call your own code.
- OpenAI.TopLogProb:
+ - sora-2
+ - sora-2-pro
+ - sora-2-2025-10-06
+ - sora-2-pro-2025-10-06
+ - sora-2-2025-12-08
+ OpenAI.VideoPrompt:
+ type: string
+ minLength: 1
+ maxLength: 32000
+ OpenAI.VideoReferenceInputParam:
type: object
required:
- - token
- - logprob
- - bytes
+ - id
properties:
- token:
+ id:
type: string
- logprob:
- $ref: '#/components/schemas/OpenAI.numeric'
- bytes:
- type: array
- items:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The top log probability of a token.
- title: Top log probability
- OpenAI.TypeParam:
+ description: The identifier of the completed video.
+ description: Reference to the completed video.
+ OpenAI.VideoResource:
type: object
required:
- - type
- - text
+ - id
+ - object
+ - model
+ - status
+ - progress
+ - created_at
+ - completed_at
+ - expires_at
+ - prompt
+ - size
+ - seconds
+ - remixed_from_video_id
+ - error
properties:
- type:
- type: string
- enum:
- - type
- description: Specifies the event type. For a type action, this property is always set to `type`.
- x-stainless-const: true
- text:
+ id:
type: string
- description: The text to type.
- allOf:
- - $ref: '#/components/schemas/OpenAI.ComputerAction'
- description: An action to type in text.
- title: Type
- OpenAI.UpdateConversationBody:
- type: object
- required:
- - metadata
- properties:
- metadata:
- anyOf:
- - $ref: '#/components/schemas/OpenAI.Metadata'
- - type: 'null'
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
- Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- OpenAI.UrlCitationBody:
- type: object
- required:
- - type
- - url
- - start_index
- - end_index
- - title
- properties:
- type:
+ description: Unique identifier for the video job.
+ object:
type: string
enum:
- - url_citation
- description: The type of the URL citation. Always `url_citation`.
+ - video
+ description: The object type, which is always `video`.
x-stainless-const: true
- url:
- type: string
- format: uri
- description: The URL of the web resource.
- start_index:
- $ref: '#/components/schemas/OpenAI.integer'
- description: The index of the first character of the URL citation in the message.
- end_index:
+ default: video
+ model:
+ $ref: '#/components/schemas/OpenAI.VideoModel'
+ description: The video generation model that produced the job.
+ status:
+ $ref: '#/components/schemas/OpenAI.VideoStatus'
+ description: Current lifecycle status of the video job.
+ progress:
$ref: '#/components/schemas/OpenAI.integer'
- description: The index of the last character of the URL citation in the message.
- title:
+ description: Approximate completion percentage for the generation task.
+ created_at:
+ type: integer
+ format: unixtime
+ description: Unix timestamp (seconds) for when the job was created.
+ completed_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: Unix timestamp (seconds) for when the job completed, if finished.
+ expires_at:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ type: integer
+ format: unixTimestamp
+ description: Unix timestamp (seconds) for when the downloadable assets expire, if set.
+ prompt:
+ anyOf:
+ - type: string
+ - type: 'null'
+ size:
+ $ref: '#/components/schemas/OpenAI.VideoSize'
+ description: The resolution of the generated video.
+ seconds:
type: string
- description: The title of the web resource.
- allOf:
- - $ref: '#/components/schemas/OpenAI.Annotation'
- description: A citation for a web resource used to generate a model response.
- title: URL citation
- OpenAI.VectorStoreFileAttributes:
- type: object
- unevaluatedProperties:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/OpenAI.numeric'
- - type: boolean
- description: |-
- Set of 16 key-value pairs that can be attached to an object. This can be
- useful for storing additional information about the object in a structured
- format, and querying for objects via API or the dashboard. Keys are strings
- with a maximum length of 64 characters. Values are strings with a maximum
- length of 512 characters, booleans, or numbers.
- x-oaiTypeLabel: map
- OpenAI.Verbosity:
+ description: Duration of the generated clip in seconds. For extensions, this is the stitched total duration.
+ remixed_from_video_id:
+ anyOf:
+ - type: string
+ - type: 'null'
+ error:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.Error-2'
+ - type: 'null'
+ description: Structured information describing a generated video job.
+ title: Video job
+ OpenAI.VideoSeconds:
+ type: string
+ enum:
+ - '4'
+ - '8'
+ - '12'
+ OpenAI.VideoSize:
+ type: string
+ enum:
+ - 720x1280
+ - 1280x720
+ - 1024x1792
+ - 1792x1024
+ OpenAI.VideoStatus:
+ type: string
+ enum:
+ - queued
+ - in_progress
+ - completed
+ - failed
+ OpenAI.VoiceIdsOrCustomVoice:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.VoiceIdsShared'
+ - type: object
+ properties:
+ id:
+ type: string
+ required:
+ - id
+ description: A built-in voice name or a custom voice reference.
+ title: Voice
+ OpenAI.VoiceIdsShared:
anyOf:
+ - type: string
- type: string
enum:
- - low
- - medium
- - high
- - type: 'null'
- description: |-
- Constrains the verbosity of the model's response. Lower values will result in
- more concise responses, while higher values will result in more verbose responses.
- Currently supported values are `low`, `medium`, and `high`.
+ - alloy
+ - ash
+ - ballad
+ - coral
+ - echo
+ - sage
+ - shimmer
+ - verse
+ - marin
+ - cedar
OpenAI.WaitParam:
type: object
required:
@@ -37539,6 +74035,37 @@ components:
- type: 'null'
description: The approximate location of the user.
title: Web search approximate location
+ OpenAI.WebSearchContextSize:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ description: |-
+ 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.
+ OpenAI.WebSearchLocation:
+ type: object
+ properties:
+ country:
+ type: string
+ description: |-
+ The two-letter
+ [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,
+ e.g. `US`.
+ region:
+ type: string
+ description: Free text input for the region of the user, e.g. `California`.
+ city:
+ type: string
+ description: Free text input for the city of the user, e.g. `San Francisco`.
+ timezone:
+ type: string
+ description: |-
+ The [IANA timezone](https://timeapi.io/documentation/iana-timezones)
+ of the user, e.g. `America/Los_Angeles`.
+ description: Approximate location parameters for the search.
+ title: Web search location
OpenAI.WebSearchPreviewTool:
type: object
required:
@@ -38202,6 +74729,11 @@ components:
evaluation_level:
$ref: '#/components/schemas/EvaluationLevel'
description: Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for per-conversation multi-turn simulation scoring.
+ max_stalls:
+ type: integer
+ format: int32
+ minimum: 1
+ description: Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the score does not improve — so no full validation-set evaluation is triggered. The counter resets whenever a minibatch passes and its full-validation score beats the current best. Only a sustained plateau of `max_stalls` consecutive minibatch failures triggers the stop. When omitted, the optimizer uses its internal default. Must be >= 1 when set.
description: Tuning knobs and run-mode for an optimization job.
x-ms-foundry-meta:
conditional_previews:
@@ -39032,6 +75564,9 @@ components:
allOf:
- $ref: '#/components/schemas/ToolboxTool'
description: A reminder tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
ResponseRetrievalItemGenerationParams:
type: object
required:
@@ -39370,6 +75905,75 @@ components:
x-ms-foundry-meta:
required_previews:
- Evaluations=V1Preview
+ RubricGenerationInputQualityWarning:
+ type: object
+ required:
+ - code
+ - severity
+ - message
+ - source
+ properties:
+ code:
+ $ref: '#/components/schemas/RubricGenerationInputQualityWarningCode'
+ description: Stable searchable machine-readable warning code.
+ severity:
+ $ref: '#/components/schemas/RubricGenerationInputQualityWarningSeverity'
+ description: 'Advisory severity. Initial values: `warning`.'
+ message:
+ type: string
+ description: Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, instruction, dataset, or trace text.
+ source:
+ $ref: '#/components/schemas/RubricGenerationInputQualityWarningSource'
+ description: Which source category the warning applies to. `aggregate` is used only for cross-source warnings.
+ source_index:
+ type: integer
+ format: int32
+ minimum: 0
+ description: Zero-based index into `EvaluatorGenerationJob.inputs.sources` when the warning applies to a specific source. Omitted for aggregate warnings and for warnings not tied to one source.
+ description: A non-fatal advisory produced during rubric evaluator generation when resolved inputs are technically valid but likely too weak to produce a high-quality rubric. Read-only; service-generated. Persisted with the terminal EvaluatorGenerationJob.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ RubricGenerationInputQualityWarningCode:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - empty_prompt
+ - short_prompt
+ - empty_agent_instructions
+ - short_agent_instructions
+ - empty_dataset_content
+ - short_dataset_content
+ - low_trace_count
+ - insufficient_total_input
+ description: Stable searchable machine-readable warning code for a rubric-generation input-quality warning. Values are `snake_case`; clients must tolerate additional service-defined identifiers.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ RubricGenerationInputQualityWarningSeverity:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - warning
+ description: 'Advisory severity for a rubric-generation input-quality warning. Initial value set: `warning`.'
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
+ RubricGenerationInputQualityWarningSource:
+ anyOf:
+ - type: string
+ - type: string
+ enum:
+ - prompt
+ - agent
+ - dataset
+ - aggregate
+ description: Warning source attribution for a rubric-generation input-quality warning. Per-source values (`prompt`, `agent`, `dataset`) match the source category visible to the generation runtime. `aggregate` is a synthetic value used only for warnings computed across successfully resolved sources. `traces` is not exposed because trace sources resolve into dataset content upstream.
+ x-ms-foundry-meta:
+ required_previews:
+ - Evaluations=V1Preview
SASCredentials:
type: object
required:
@@ -39705,6 +76309,9 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAI.OutputItem'
description: A SharePoint grounding tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
SharepointGroundingToolCallOutput:
type: object
required:
@@ -39728,6 +76335,9 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAI.OutputItem'
description: The output of a SharePoint grounding tool call.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
SharepointGroundingToolParameters:
type: object
properties:
@@ -39740,6 +76350,9 @@ components:
The project connections attached to this tool. There can be a maximum of 1 connection
resource attached to the tool.
description: The sharepoint grounding tool parameters.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
SharepointPreviewTool:
type: object
required:
@@ -39757,6 +76370,9 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAI.Tool'
description: The input definition information for a sharepoint tool as used to configure an agent.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
SimpleQnADataGenerationJobOptions:
type: object
required:
@@ -40357,6 +76973,19 @@ components:
type: string
description: A project connection in a ToolProjectConnectionList attached to this tool.
description: A project connection resource.
+ ToolSearchToolboxTool:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ enum:
+ - toolbox_search
+ description: The type of the tool. Always `toolbox_search`.
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A toolbox search tool stored in a toolbox.
ToolUseFineTuningDataGenerationJobOptions:
type: object
required:
@@ -40411,6 +77040,9 @@ components:
allOf:
- $ref: '#/components/schemas/ToolboxTool'
description: A toolbox search tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
ToolboxSkill:
type: object
required:
@@ -40480,7 +77112,9 @@ components:
reminder_preview: '#/components/schemas/ReminderPreviewToolboxTool'
work_iq_preview: '#/components/schemas/WorkIQPreviewToolboxTool'
fabric_iq_preview: '#/components/schemas/FabricIQPreviewToolboxTool'
+ web_iq_preview: '#/components/schemas/WebIQPreviewToolboxTool'
toolbox_search_preview: '#/components/schemas/ToolboxSearchPreviewToolboxTool'
+ toolbox_search: '#/components/schemas/ToolSearchToolboxTool'
description: An abstract representation of a tool stored in a toolbox.
ToolboxToolType:
type: string
@@ -40496,6 +77130,8 @@ components:
- reminder_preview
- work_iq_preview
- fabric_iq_preview
+ - web_iq_preview
+ - toolbox_search
- toolbox_search_preview
description: Supported tool types for tools stored in a toolbox.
ToolboxVersionObject:
@@ -41023,6 +77659,73 @@ components:
type: array
items:
$ref: '#/components/schemas/VersionSelectionRule'
+ WebIQPreviewTool:
+ type: object
+ required:
+ - type
+ - project_connection_id
+ properties:
+ type:
+ type: string
+ enum:
+ - web_iq_preview
+ description: The object type, which is always 'web_iq_preview'.
+ project_connection_id:
+ type: string
+ description: The ID of the WebIQ project connection.
+ server_label:
+ type: string
+ description: The label of the WebIQ MCP server to connect to.
+ server_url:
+ type: string
+ format: uri
+ description: The URL of the WebIQ MCP server. If not provided, the URL from the project connection will be used.
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ - type: 'null'
+ description: Whether the agent requires approval before executing actions. Default is always.
+ default: always
+ allOf:
+ - $ref: '#/components/schemas/OpenAI.Tool'
+ description: A WebIQ server-side tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
+ WebIQPreviewToolboxTool:
+ type: object
+ required:
+ - type
+ - project_connection_id
+ properties:
+ type:
+ type: string
+ enum:
+ - web_iq_preview
+ project_connection_id:
+ type: string
+ description: The ID of the WebIQ project connection.
+ server_label:
+ type: string
+ description: The label of the WebIQ MCP server to connect to.
+ server_url:
+ type: string
+ format: uri
+ description: The URL of the WebIQ MCP server. If not provided, the URL from the project connection will be used.
+ require_approval:
+ anyOf:
+ - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval'
+ - type: string
+ - type: 'null'
+ description: Whether the agent requires approval before executing actions. Default is always.
+ default: always
+ allOf:
+ - $ref: '#/components/schemas/ToolboxTool'
+ description: A WebIQ tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
WebSearchConfiguration:
type: object
required:
@@ -41108,6 +77811,9 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAI.Tool'
description: A WorkIQ server-side tool.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
WorkIQPreviewToolboxTool:
type: object
required:
@@ -41124,6 +77830,9 @@ components:
allOf:
- $ref: '#/components/schemas/ToolboxTool'
description: A WorkIQ tool stored in a toolbox.
+ x-ms-foundry-meta:
+ required_previews:
+ - preview_tool
WorkflowActionOutputItem:
type: object
required:
diff --git a/specification/ai-foundry/data-plane/Foundry/src/agents-containers/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/agents-containers/routes.tsp
index 1b5b68ef3a9f..f1a672d9f2ae 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/agents-containers/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/agents-containers/routes.tsp
@@ -206,8 +206,13 @@ interface AgentContainers {
tail?: int32;
},
Stream<{
+ /** The content type of the request body. */
@header("content-type") contentType: "text/plain; charset=utf-8";
+
+ /** The transfer encoding response header. */
@header("transfer-encoding") transferEncoding: "chunked";
+
+ /** The streamed log response body. */
@body body: string;
}>
>;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/agents-invocations/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/agents-invocations/routes.tsp
index 4f41a02428f3..36734e8a5aa9 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/agents-invocations/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/agents-invocations/routes.tsp
@@ -21,12 +21,60 @@ interface AgentInvocations {
/** The name of the agent. */
@path agent_name: string;
},
+ {
+ /** The content type of the request body. */
+ @header contentType: "application/json";
+
+ /** The invocation specification request body. */
+ @body spec: Record;
+ }
+ >;
+
+ /**
+ * Retrieves the AsyncAPI (JSON) specification for an agent version's event-driven
+ * invocation contract (e.g. the `invocations_ws` WebSocket protocol). AsyncAPI is the
+ * companion to OpenAPI for streaming/bidirectional surfaces that OpenAPI cannot express.
+ * Returns 404 if the agent does not publish an AsyncAPI specification. Publishing is
+ * optional; when published, both JSON and YAML representations are available.
+ */
+ @get
+ @route("/agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.json")
+ getAgentInvocationAsyncApiSpecJson is FoundryDataPlaneOperation<
+ {
+ /** The name of the agent. */
+ @path agent_name: string;
+
+ /** The version of the agent. */
+ @path agent_version: string;
+ },
{
@header contentType: "application/json";
@body spec: Record;
}
>;
+ /**
+ * Retrieves the AsyncAPI (YAML) specification for an agent version's event-driven
+ * invocation contract. Companion to `getAgentInvocationAsyncApiSpecJson`; the path
+ * extension is authoritative for the returned content type (no `Accept` negotiation).
+ * Returns 404 if the agent does not publish an AsyncAPI specification.
+ */
+ @get
+ @route("/agents/{agent_name}/versions/{agent_version}/invocations/docs/asyncapi.yaml")
+ getAgentInvocationAsyncApiSpecYaml is FoundryDataPlaneOperation<
+ {
+ /** The name of the agent. */
+ @path agent_name: string;
+
+ /** The version of the agent. */
+ @path agent_version: string;
+ },
+ {
+ @header contentType: "application/yaml";
+ @body spec: string;
+ }
+ >;
+
/**
* Creates an invocation for the specified agent version.
*/
diff --git a/specification/ai-foundry/data-plane/Foundry/src/agents-optimization/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/agents-optimization/models.tsp
index 0d36fc23d91f..cd5a9ec7bf49 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/agents-optimization/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/agents-optimization/models.tsp
@@ -9,7 +9,7 @@
import "../common/models.tsp";
import "../common/servicepatterns.tsp";
-import "../openai-evaluations/models.tsp";
+import "../openai/evaluations/models.tsp";
using TypeSpec.Rest;
using TypeSpec.OpenAPI;
@@ -196,6 +196,10 @@ model OptimizationOptions {
@doc("Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for per-conversation multi-turn simulation scoring.")
evaluation_level?: EvaluationLevel;
+
+ @doc("Maximum number of consecutive reflective minibatch rejections before stopping early. A 'stall' occurs when the optimizer proposes a prompt change, evaluates it on a small subset, and the score does not improve — so no full validation-set evaluation is triggered. The counter resets whenever a minibatch passes and its full-validation score beats the current best. Only a sustained plateau of `max_stalls` consecutive minibatch failures triggers the stop. When omitted, the optimizer uses its internal default. Must be >= 1 when set.")
+ @minValue(1)
+ max_stalls?: int32;
}
@doc("Caller-supplied inputs for an optimization job.")
diff --git a/specification/ai-foundry/data-plane/Foundry/src/agents-optimization/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/agents-optimization/routes.tsp
index 2f467bf23715..1b972977946e 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/agents-optimization/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/agents-optimization/routes.tsp
@@ -6,7 +6,9 @@ import "./models.tsp";
using TypeSpec.Http;
using TypeSpec.OpenAPI;
+
using Azure.Core;
+
namespace Azure.AI.Projects;
// ---------------------------------------------------------------------------
@@ -17,8 +19,10 @@ namespace Azure.AI.Projects;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "OpenAI-based operations are definitionally non-standard"
@tag("AgentOptimizationJobs")
interface AgentOptimizationJobs {
- @summary("Creates an agent optimization job.")
- @doc("Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry.")
+ /**
+ * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry.
+ */
+ @summary("Create an agent optimization job")
@route("agent_optimization_jobs")
@extension("x-ms-foundry-meta", AgentOptimizationRequiredPreviews)
@pollingOperation(AgentOptimizationJobs.get)
@@ -27,8 +31,10 @@ interface AgentOptimizationJobs {
OptimizationJob
>;
- @summary("Get info about an agent optimization job.")
- @doc("Get an optimization job by id.")
+ /**
+ * Retrieves an optimization job by its identifier.
+ */
+ @summary("Get an agent optimization job")
@route("agent_optimization_jobs/{jobId}")
@extension("x-ms-foundry-meta", AgentOptimizationRequiredPreviews)
get is queryJobStatusPreview<
@@ -36,8 +42,10 @@ interface AgentOptimizationJobs {
OptimizationJob
>;
- @summary("Returns a list of agent optimization jobs.")
- @doc("List optimization jobs. Supports cursor pagination and optional status / agent_name filters.")
+ /**
+ * Lists optimization jobs with cursor pagination and optional status or agent name filters.
+ */
+ @summary("List agent optimization jobs")
@route("agent_optimization_jobs")
@extension("x-ms-foundry-meta", AgentOptimizationRequiredPreviews)
list is listJobsPreview<
@@ -54,8 +62,10 @@ interface AgentOptimizationJobs {
}
>;
- @summary("Cancels an agent optimization job.")
- @doc("Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state.")
+ /**
+ * Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state.
+ */
+ @summary("Cancel an agent optimization job")
@route("agent_optimization_jobs/{jobId}:cancel")
@extension("x-ms-foundry-meta", AgentOptimizationRequiredPreviews)
cancel is cancelJobPreview<
@@ -63,8 +73,10 @@ interface AgentOptimizationJobs {
OptimizationJob
>;
- @summary("Deletes an agent optimization job.")
- @doc("Delete the job and its candidate artifacts. Cancels first if non-terminal.")
+ /**
+ * Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal.
+ */
+ @summary("Delete an agent optimization job")
@route("agent_optimization_jobs/{jobId}")
@extension("x-ms-foundry-meta", AgentOptimizationRequiredPreviews)
delete is deleteJobPreview;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/agents/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/agents/models.tsp
index 043833f55772..23d499463779 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/agents/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/agents/models.tsp
@@ -1,4 +1,4 @@
-import "../openai-responses/models.tsp";
+import "../openai/responses/models.tsp";
import "../common/servicepatterns.tsp";
using TypeSpec.Http;
@@ -15,7 +15,6 @@ const AllConditionalAgentDefinitionPreviews = #{
],
};
-@extension("x-ms-foundry-meta", AllConditionalAgentDefinitionPreviews)
model CreateAgentVersionRequest {
...MetadataPropertyForRequest;
@@ -270,7 +269,6 @@ model RaiConfig {
}
@discriminator("kind")
-@extension("x-ms-foundry-meta", AllConditionalAgentDefinitionPreviews)
model AgentDefinition {
kind: AgentKind;
@@ -678,6 +676,20 @@ model AgentIdentity {
@doc("The client ID of the agent instance. Also referred to as the instance ID")
client_id: string;
+
+ @doc("The status of the agent identity. Present for both the agent instance identity and the agent blueprint.")
+ status?: AgentIdentityStatus;
+}
+
+@doc("The status of an agent identity, applicable to both the agent instance identity and the agent blueprint.")
+union AgentIdentityStatus {
+ string,
+
+ @doc("The agent identity is active and can be used to access resources.")
+ active: "active",
+
+ @doc("The agent identity is disabled and cannot be used to access resources.")
+ disabled: "disabled",
}
union AgentBlueprintReferenceType {
diff --git a/specification/ai-foundry/data-plane/Foundry/src/agents/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/agents/routes.tsp
index 42d292004a9d..37d964627667 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/agents/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/agents/routes.tsp
@@ -59,6 +59,7 @@ interface Agents {
@tag("Agents")
createAgentFromCode is FoundryDataPlaneOperation<
{
+ /** The content type of the request body. */
@header contentType: "multipart/form-data";
/** The unique name that identifies the agent. Max 63 chars, must start and end with alphanumeric, hyphens allowed in the middle. */
@@ -70,6 +71,7 @@ interface Agents {
@header("x-ms-code-zip-sha256")
codeZipSha256: string;
+ /** The content multipart request content. */
@multipartBody content: CreateAgentFromCodeContent;
},
AgentObject
@@ -124,12 +126,14 @@ interface Agents {
@path
agent_name: string;
+ /** The content type of the request body. */
@header contentType: "multipart/form-data";
/** SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. */
@header("x-ms-code-zip-sha256")
codeZipSha256: string;
+ /** The content multipart request content. */
@multipartBody content: CreateAgentVersionFromCodeContent;
},
AgentObject
@@ -348,7 +352,9 @@ interface Agents {
@path
agent_name: string;
+ /** The content type of the request body. */
@header("Content-Type") contentType: "application/merge-patch+json";
+
...PatchAgentRequest;
},
AgentObject
@@ -379,12 +385,14 @@ interface Agents {
@path
agent_name: string;
+ /** The content type of the request body. */
@header contentType: "multipart/form-data";
/** SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity verification. */
@header("x-ms-code-zip-sha256")
codeZipSha256: string;
+ /** The content multipart request content. */
@multipartBody content: CreateAgentVersionFromCodeContent;
},
AgentVersionObject
@@ -427,6 +435,7 @@ interface Agents {
@summary("Enable an agent")
@post
@route("/agents/{agent_name}:enable")
+ @tag("Agents")
enableAgent is FoundryDataPlaneOperation<
{
/** The name of the agent to enable. */
@@ -443,6 +452,7 @@ interface Agents {
@summary("Disable an agent")
@post
@route("/agents/{agent_name}:disable")
+ @tag("Agents")
disableAgent is FoundryDataPlaneOperation<
{
/** The name of the agent to disable. */
diff --git a/specification/ai-foundry/data-plane/Foundry/src/common/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/common/models.tsp
index 521ee3d20e04..a3e1de8f670a 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/common/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/common/models.tsp
@@ -47,6 +47,7 @@ alias UserDelegationHeader = {
#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "OpenAI-based operations are definitionally non-standard"
#suppress "@azure-tools/typespec-azure-core/response-schema-problem" "OpenAI Response schemas can be intentionally combined for documentation clarity"
+#suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
op OpenAIOperation<
Params extends Reflection.Model,
Response,
@@ -199,3 +200,20 @@ model DatasetJobSource {
@doc("The version of the dataset. If not specified, the latest version is used.")
version?: string;
}
+
+/**
+ * User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.
+ */
+model AzureUserSecurityContext {
+ /** The name of the application. Sensitive personal information should not be included in this field. */
+ application_name?: string;
+
+ /** This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field. */
+ end_user_id?: string;
+
+ /** The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant. */
+ end_user_tenant_id?: string;
+
+ /** Captures the original client's IP address. */
+ source_ip?: string;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/common/openai-templates.tsp b/specification/ai-foundry/data-plane/Foundry/src/common/openai-templates.tsp
new file mode 100644
index 000000000000..9cd9c254ef5c
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/common/openai-templates.tsp
@@ -0,0 +1,91 @@
+import "@typespec/http";
+import "./servicepatterns.tsp";
+import "./models.tsp";
+
+using TypeSpec.Http;
+
+namespace Azure.AI.Projects;
+
+alias AgentSessionIdResponseHeader = {
+ @doc("Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.")
+ @header("x-agent-session-id")
+ agentSessionId?: string;
+};
+
+#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "OpenAI-based operations are definitionally non-standard"
+#suppress "@azure-tools/typespec-azure-core/response-schema-problem" "OpenAI Response schemas can be intentionally combined for documentation clarity"
+@sharedRoute
+op OpenAISharedOperation<
+ Params extends Reflection.Model,
+ Response,
+ ErrorResponse = ApiErrorResponse
+> is OpenAIOperation;
+
+#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "OpenAI-based operations are definitionally non-standard"
+#suppress "@azure-tools/typespec-azure-core/response-schema-problem" "OpenAI Response schemas can be intentionally combined for documentation clarity"
+op OpenAIAgentOperation<
+ Params extends Reflection.Model,
+ Response,
+ ErrorResponse = ApiErrorResponse
+> is OpenAIOperation<
+ {
+ ...UserIsolationKeyHeader;
+ ...Params;
+ },
+ Response,
+ ErrorResponse
+>;
+
+#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "OpenAI-based operations are definitionally non-standard"
+#suppress "@azure-tools/typespec-azure-core/response-schema-problem" "OpenAI Response schemas can be intentionally combined for documentation clarity"
+@sharedRoute
+op OpenAIAgentSessionOperation<
+ Params extends Reflection.Model,
+ Response extends Reflection.Model,
+ ErrorResponse = ApiErrorResponse
+>(...UserIsolationKeyHeader, ...Params):
+ | (Response & AgentSessionIdResponseHeader)
+ | AzureRangeErrorResponse;
+
+#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "OpenAI-based operations are definitionally non-standard"
+#suppress "@azure-tools/typespec-azure-core/response-schema-problem" "OpenAI Response schemas can be intentionally combined for documentation clarity"
+@sharedRoute
+op OpenAIAgentStreamingOperation<
+ Params extends Reflection.Model,
+ Event,
+ ErrorResponse = ApiErrorResponse
+>(...UserIsolationKeyHeader, ...Params):
+ | SseResponseOf
+ | AzureRangeErrorResponse;
+
+#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "OpenAI-based operations are definitionally non-standard"
+#suppress "@azure-tools/typespec-azure-core/response-schema-problem" "OpenAI Response schemas can be intentionally combined for documentation clarity"
+op OpenAIAgentPagedOperation<
+ Params extends Reflection.Model,
+ Response,
+ ErrorResponse = ApiErrorResponse
+> is OpenAIOperation<
+ {
+ ...UserIsolationKeyHeader;
+ ...Params;
+ },
+ Response,
+ ErrorResponse
+>;
+
+#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "OpenAI-based operations are definitionally non-standard"
+#suppress "@azure-tools/typespec-azure-core/response-schema-problem" "OpenAI Response schemas can be intentionally combined for documentation clarity"
+@list
+op OpenAIAgentFilteredPagedOperation<
+ Params extends Reflection.Model,
+ Item extends Reflection.Model,
+ ErrorResponse = ApiErrorResponse
+>(...UserIsolationKeyHeader, ...CommonPageQueryParameters, ...Params):
+ | AgentsPagedResult-
+ | AzureRangeErrorResponse;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/datasets/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/datasets/routes.tsp
index 2b08a7c7d0eb..01f84038abc6 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/datasets/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/datasets/routes.tsp
@@ -38,10 +38,10 @@ interface Datasets
PendingUploadResponse
>;
+ /** Retrieves the SAS credential to access the storage account associated with a dataset version. */
#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version"
#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
@summary("Get dataset credentials")
- @doc("Gets the SAS credential to access the storage account associated with a Dataset version.")
@post
@Rest.action("credentials")
@Rest.actionSeparator("/")
diff --git a/specification/ai-foundry/data-plane/Foundry/src/deployments/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/deployments/routes.tsp
index 15844967b0b7..36c84b9ff257 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/deployments/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/deployments/routes.tsp
@@ -10,8 +10,8 @@ alias DeploymentOperations = FoundryAzureOperations<{}>;
@tag("Deployments")
interface Deployments {
+ /** Retrieves a deployed model. */
@summary("Get a deployment")
- @doc("Gets a deployed model.")
get is DeploymentOperations.ResourceRead;
/** Returns the deployed models available in the current project, optionally filtered by publisher, model name, or deployment type. */
diff --git a/specification/ai-foundry/data-plane/Foundry/src/evaluation-rules/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/evaluation-rules/models.tsp
index 6d800b697c62..897fdfa71a41 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/evaluation-rules/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/evaluation-rules/models.tsp
@@ -58,6 +58,7 @@ model HumanEvaluationRuleAction extends EvaluationRuleAction {
}
@doc("Evaluation rule action for human evaluation.")
+@extension("x-ms-foundry-meta", AllConditionalEvaluationRuleActionPreviews)
model HumanEvaluationPreviewRuleAction extends EvaluationRuleAction {
type: EvaluationRuleActionType.humanEvaluationPreview;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/evaluation-rules/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/evaluation-rules/routes.tsp
index a79cc82f28c3..ca0d0b513e48 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/evaluation-rules/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/evaluation-rules/routes.tsp
@@ -9,14 +9,17 @@ namespace Azure.AI.Projects;
alias EvaluationRulesPreviewHeader = WithConditionalFoundryPreviewHeader;
alias EvaluationRulesFilterQueryParams = {
+ /** The action type query parameter. */
@query("actionType")
@doc("Filter by the type of evaluation rule.")
actionType?: EvaluationRuleActionType;
+ /** The agent name query parameter. */
@query("agentName")
@doc("Filter by the agent name.")
agentName?: string;
+ /** The enabled query parameter. */
@query("enabled")
@doc("Filter by the enabled status.")
enabled?: boolean;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/evaluation-suites/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/evaluation-suites/models.tsp
index c17d4e825262..2c9581b6bfbc 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/evaluation-suites/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/evaluation-suites/models.tsp
@@ -2,7 +2,7 @@ import "@typespec/openapi";
import "../common/models.tsp";
import "../common/servicepatterns.tsp";
-import "../openai-evaluations/models.tsp";
+import "../openai/evaluations/models.tsp";
using TypeSpec.Rest;
using TypeSpec.OpenAPI;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/evaluation-suites/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/evaluation-suites/routes.tsp
index 91949ed1de76..8dba3fab94e0 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/evaluation-suites/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/evaluation-suites/routes.tsp
@@ -11,6 +11,7 @@ using Azure.Core;
alias ListEvaluationSuiteVersionsParameters = {};
alias EvaluationSuiteFilterQueryParams = {
+ /** The agent name query parameter. */
@query("agent_name")
@doc("Filter by associated Foundry agent name (from target).")
agent_name?: string;
@@ -32,10 +33,6 @@ interface EvaluationSuites
/** Creates a new evaluation suite version with an auto-incremented version identifier. */
#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
@summary("Create an evaluation suite version")
- @doc(
- "Create a new {name} with auto incremented version id",
- EvaluationSuiteVersion
- )
@post
@route("/evaluation_suites/{name}/versions")
@extension("x-ms-foundry-meta", EvaluationSuitesRequiredPreviews)
@@ -54,9 +51,9 @@ interface EvaluationSuites
>;
// POST /evaluation_suites/{name}:run
+ /** Runs an evaluation using the suite's testing criteria and dataset. */
#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
@summary("Run an evaluation suite")
- @doc("Runs an evaluation using the suite's testing criteria and dataset.")
@post
@route("/evaluation_suites/{name}:run")
@extension("x-ms-foundry-meta", EvaluationSuitesRequiredPreviews)
@@ -84,6 +81,7 @@ interface EvaluationSuites
@tag("EvaluationSuiteGenerationJobs")
@removed(Versions.v1)
interface EvaluationSuiteGenerationJobs {
+ /** Creates an evaluation suite generation job and returns the queued job. */
@summary("Create an evaluation suite generation job")
@route("evaluation_suite_generation_jobs")
@extension("x-ms-foundry-meta", EvaluationSuiteGenerationJobsRequiredPreviews)
@@ -93,6 +91,7 @@ interface EvaluationSuiteGenerationJobs {
EvaluationSuiteGenerationJob
>;
+ /** Retrieves an evaluation suite generation job by its identifier. */
@summary("Get an evaluation suite generation job")
@route("evaluation_suite_generation_jobs/{jobId}")
@extension("x-ms-foundry-meta", EvaluationSuiteGenerationJobsRequiredPreviews)
@@ -101,6 +100,7 @@ interface EvaluationSuiteGenerationJobs {
EvaluationSuiteGenerationJob
>;
+ /** Lists evaluation suite generation jobs for the project. */
@summary("List evaluation suite generation jobs")
@route("evaluation_suite_generation_jobs")
@extension("x-ms-foundry-meta", EvaluationSuiteGenerationJobsRequiredPreviews)
@@ -109,6 +109,7 @@ interface EvaluationSuiteGenerationJobs {
EvaluationSuiteGenerationJob
>;
+ /** Requests cancellation of a running or queued evaluation suite generation job. */
@summary("Cancel an evaluation suite generation job")
@route("evaluation_suite_generation_jobs/{jobId}:cancel")
@extension("x-ms-foundry-meta", EvaluationSuiteGenerationJobsRequiredPreviews)
@@ -117,6 +118,7 @@ interface EvaluationSuiteGenerationJobs {
EvaluationSuiteGenerationJob
>;
+ /** Deletes an evaluation suite generation job by its identifier. */
@summary("Delete an evaluation suite generation job")
@route("evaluation_suite_generation_jobs/{jobId}")
@extension("x-ms-foundry-meta", EvaluationSuiteGenerationJobsRequiredPreviews)
diff --git a/specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies/models.tsp
index 0a73bf358267..58b433e56264 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies/models.tsp
@@ -1,5 +1,5 @@
import "../common/models.tsp";
-import "../openai-evaluations/models.tsp";
+import "../openai/evaluations/models.tsp";
using TypeSpec.Rest;
using TypeSpec.OpenAPI;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies/routes.tsp
index 098fa9e5ae32..e320cb2c77e2 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies/routes.tsp
@@ -8,10 +8,12 @@ namespace Azure.AI.Projects;
alias EvaluationTaxonomiesPreviewHeader = WithRequiredFoundryPreviewHeader;
alias EvaluationTaxonomiesFilterQueryParamsTraits = {
+ /** The input name query parameter. */
@query("inputName")
@doc("Filter by the evaluation input name.")
inputName?: string;
+ /** The input type query parameter. */
@query("inputType")
@doc("Filter by taxonomy input type.")
inputType?: string;
@@ -73,7 +75,6 @@ interface EvaluationTaxonomies {
/** Modifies the specified evaluation taxonomy with the provided changes. */
#suppress "@typespec/http/deprecated-implicit-optionality" "Legacy implicit optionality - DO NOT COPY"
@summary("Update an evaluation taxonomy")
- @doc("Update an evaluation taxonomy.")
@patch(#{ implicitOptionality: true })
@route("/evaluationtaxonomies/{name}")
update is FoundryOperation<
diff --git a/specification/ai-foundry/data-plane/Foundry/src/evaluators/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/evaluators/models.tsp
index fbe1a5b9f360..f2aedf2b0c7c 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/evaluators/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/evaluators/models.tsp
@@ -294,6 +294,97 @@ model EvaluatorGenerationTokenUsage {
total_tokens: int64;
}
+// ============================================================================
+// Rubric Generation Input-Quality Warnings
+// Advisory read-only warnings surfaced on terminal EvaluatorGenerationJob.
+// ============================================================================
+
+@doc("Warning source attribution for a rubric-generation input-quality warning. Per-source values (`prompt`, `agent`, `dataset`) match the source category visible to the generation runtime. `aggregate` is a synthetic value used only for warnings computed across successfully resolved sources. `traces` is not exposed because trace sources resolve into dataset content upstream.")
+@extension("x-ms-foundry-meta", EvaluatorsRequiredPreviews)
+union RubricGenerationInputQualityWarningSource {
+ string,
+
+ @doc("The warning applies to an inline prompt source.")
+ prompt: "prompt",
+
+ @doc("The warning applies to an agent source.")
+ agent: "agent",
+
+ @doc("The warning applies to a dataset source (including trace-derived datasets).")
+ dataset: "dataset",
+
+ @doc("The warning is computed across all successfully resolved sources.")
+ aggregate: "aggregate",
+}
+
+@doc("Advisory severity for a rubric-generation input-quality warning. Initial value set: `warning`.")
+@extension("x-ms-foundry-meta", EvaluatorsRequiredPreviews)
+union RubricGenerationInputQualityWarningSeverity {
+ string,
+
+ @doc("Non-fatal advisory; generation succeeded but output quality may be lower.")
+ warning: "warning",
+}
+
+@doc("Stable searchable machine-readable warning code for a rubric-generation input-quality warning. Values are `snake_case`; clients must tolerate additional service-defined identifiers.")
+@extension("x-ms-foundry-meta", EvaluatorsRequiredPreviews)
+union RubricGenerationInputQualityWarningCode {
+ string,
+
+ @doc("A prompt source was empty or whitespace-only.")
+ empty_prompt: "empty_prompt",
+
+ @doc("A prompt source was non-empty but below the recommended minimum signal threshold.")
+ short_prompt: "short_prompt",
+
+ @doc("An agent source resolved successfully but had no usable instructions.")
+ empty_agent_instructions: "empty_agent_instructions",
+
+ @doc("An agent source had instructions below the recommended minimum signal threshold.")
+ short_agent_instructions: "short_agent_instructions",
+
+ @doc("A dataset source resolved but contained no usable content for rubric generation.")
+ empty_dataset_content: "empty_dataset_content",
+
+ @doc("Dataset content was below the recommended minimum signal threshold.")
+ short_dataset_content: "short_dataset_content",
+
+ @doc("A row-structured dataset had very few rows, so the generated rubric may not generalize.")
+ low_trace_count: "low_trace_count",
+
+ @doc("Combined resolved input across successfully resolved sources was below the recommended minimum signal threshold.")
+ insufficient_total_input: "insufficient_total_input",
+}
+
+@doc("A non-fatal advisory produced during rubric evaluator generation when resolved inputs are technically valid but likely too weak to produce a high-quality rubric. Read-only; service-generated. Persisted with the terminal EvaluatorGenerationJob.")
+@extension("x-ms-foundry-meta", EvaluatorsRequiredPreviews)
+model RubricGenerationInputQualityWarning {
+ @doc("Stable searchable machine-readable warning code.")
+ code: RubricGenerationInputQualityWarningCode;
+
+ @doc("Advisory severity. Initial values: `warning`.")
+ severity: RubricGenerationInputQualityWarningSeverity;
+
+ @doc("Human-readable message suitable for direct SDK/CLI/UI display. Must not include raw prompt, instruction, dataset, or trace text.")
+ message: string;
+
+ @doc("Which source category the warning applies to. `aggregate` is used only for cross-source warnings.")
+ source: RubricGenerationInputQualityWarningSource;
+
+ @doc("Zero-based index into `EvaluatorGenerationJob.inputs.sources` when the warning applies to a specific source. Omitted for aggregate warnings and for warnings not tied to one source.")
+ @minValue(0)
+ source_index?: int32;
+}
+
+@doc("Category of a warning surfaced on a generated evaluator version. Extensible so new warning categories (e.g., safety, output quality) can be introduced without a breaking change.")
+@extension("x-ms-foundry-meta", EvaluatorsRequiredPreviews)
+union GenerationWarningType {
+ string,
+
+ @doc("The paired EvaluatorGenerationJob emitted one or more input-quality advisories. Follow `generation_job_id` to fetch the detailed warning payloads.")
+ input_quality: "input_quality",
+}
+
@doc("Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source materials. On success, the result is the persisted EvaluatorVersion.")
@extension("x-ms-foundry-meta", EvaluatorsRequiredPreviews)
model EvaluatorGenerationJob is JobLike<
@@ -311,6 +402,10 @@ model EvaluatorGenerationJob is JobLike<
@doc("Token consumption summary. Populated when the job reaches a terminal state.")
@visibility(Lifecycle.Read)
usage?: EvaluatorGenerationTokenUsage;
+
+ @doc("Non-fatal input-quality advisories produced by the generation pipeline. Read-only; service-generated; populated only on terminal jobs when advisories fired. Omitted when generation was clean. Cleared when a subsequent `PATCH` to the paired `EvaluatorVersion.definition` invalidates the advisories.")
+ @visibility(Lifecycle.Read)
+ input_quality_warnings?: RubricGenerationInputQualityWarning[];
}
@doc("Evaluator Definition")
@@ -341,6 +436,14 @@ model EvaluatorVersion {
@visibility(Lifecycle.Read)
generation_artifacts?: EvaluatorGenerationArtifacts;
+ @doc("Read-only provenance link back to the EvaluatorGenerationJob that produced this version. Present only on evaluator versions created via the generation pipeline; absent for manually-created versions and unaffected by subsequent `PATCH` calls.")
+ @visibility(Lifecycle.Read)
+ generation_job_id?: string;
+
+ @doc("Categories of warnings surfaced on this generated evaluator version. Present only on versions created via an EvaluatorGenerationJob when the paired job produced non-empty warnings. Absent (treat as no warnings) when the version is not from generation, when the paired job was clean, or when a subsequent `PATCH` to `definition` cleared the paired job's advisories. Follow `generation_job_id` to fetch the detailed warning payloads.")
+ @visibility(Lifecycle.Read)
+ warnings?: GenerationWarningType[];
+
@visibility(Lifecycle.Read)
@doc("Creator of the evaluator")
created_by: string;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/evaluators/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/evaluators/routes.tsp
index 592ec680ca5c..28a2b0e5858d 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/evaluators/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/evaluators/routes.tsp
@@ -37,9 +37,9 @@ interface Evaluators {
>;
// GET /evaluators
+ /** Lists the latest version of each evaluator. */
#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
@summary("List latest evaluator versions")
- @doc("Lists the latest version of each evaluator")
@Rest.listsResource(EvaluatorVersion)
listLatestVersions is FoundryResourceList<
EvaluatorVersion,
@@ -137,6 +137,7 @@ interface Evaluators {
startPendingUpload is FoundryDataPlanePreviewOperation<
FoundryFeaturesOptInKeys.evaluations_v1_preview,
{
+ /** The name path parameter. */
@path
name: string;
@@ -165,6 +166,7 @@ interface Evaluators {
getCredentials is FoundryDataPlanePreviewOperation<
FoundryFeaturesOptInKeys.evaluations_v1_preview,
{
+ /** The name path parameter. */
@path
name: string;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/insights/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/insights/routes.tsp
index 630d5a567935..fb1153d49b91 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/insights/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/insights/routes.tsp
@@ -5,24 +5,29 @@ using TypeSpec.Http;
namespace Azure.AI.Projects;
alias IncludeCoordinatesTrait = {
+ /** The include coordinates query parameter. */
@query("includeCoordinates")
@doc("Whether to include coordinates for visualization in the response. Defaults to false.")
includeCoordinates?: boolean;
};
alias FilterQueryParamsTraits = {
+ /** The type query parameter. */
@query("type")
@doc("Filter by the type of analysis.")
type?: InsightType;
+ /** The eval id query parameter. */
@query("evalId")
@doc("Filter by the evaluation ID.")
evalId?: string;
+ /** The run id query parameter. */
@query("runId")
@doc("Filter by the evaluation run ID.")
runId?: string;
+ /** The agent name query parameter. */
@query("agentName")
@doc("Filter by the agent name.")
agentName?: string;
@@ -48,6 +53,7 @@ interface Insights {
generate is FoundryDataPlanePreviewOperation<
FoundryFeaturesOptInKeys.insights_v1_preview,
{
+ /** The repeatability request id request header. */
@header("Repeatability-Request-ID")
@doc("Unique, client-generated identifier for ensuring request idempotency. Use the same ID for retries to prevent duplicate evaluations.")
repeatabilityRequestId?: string;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/memory-stores/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/memory-stores/models.tsp
index 609a21722220..f3464ed5456a 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/memory-stores/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/memory-stores/models.tsp
@@ -1,5 +1,5 @@
import "../common/service.tsp";
-import "../openai-responses/models.tsp";
+import "../openai/responses/models.tsp";
using TypeSpec.Http;
using TypeSpec.OpenAPI;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/models/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/models/routes.tsp
index 50599c6ee4ff..e3d9807f334c 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/models/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/models/routes.tsp
@@ -42,7 +42,6 @@ interface Models
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Suppress `Operation should be defined using a signature from the Azure.Core namespace.`"
#suppress "@azure-tools/typespec-azure-core/no-response-body" "Delete returns 200 with no body by service design"
@summary("Delete a model version")
- @doc("Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist.")
@delete
@extension("x-ms-foundry-meta", ModelsRequiredPreviews)
deleteVersion is FoundryResourceOperation<
@@ -65,10 +64,6 @@ interface Models
/** Updates an existing model version identified by its version ID. */
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Suppress `Operation should be defined using a signature from the Azure.Core namespace.`"
@summary("Update a model version")
- @doc(
- "Update an existing ModelVersion with the given version id",
- ModelVersion
- )
@operationId("Models_updateVersion")
@patch
@extension("x-ms-foundry-meta", ModelsRequiredPreviews)
@@ -122,6 +117,7 @@ interface Models
@path
version: string;
+ /** The pending upload request request body. */
@bodyRoot
pending_upload_request: ModelPendingUploadRequest;
},
@@ -146,6 +142,7 @@ interface Models
@path
version: string;
+ /** The credential request request body. */
@bodyRoot
credential_request: ModelCredentialRequest;
},
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai-finetuning/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai-finetuning/routes.tsp
deleted file mode 100644
index e5025ed38413..000000000000
--- a/specification/ai-foundry/data-plane/Foundry/src/openai-finetuning/routes.tsp
+++ /dev/null
@@ -1,165 +0,0 @@
-import "../common/models.tsp";
-
-using TypeSpec.Http;
-using TypeSpec.OpenAPI;
-using TypeSpec.Versioning;
-
-namespace Azure.AI.Projects;
-
-@route("openai/v1/fine_tuning")
-@tag("Fine-Tuning")
-interface FineTuning {
- /**
- * 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/fine-tuning)
- */
- #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "not yet an Azure operation"
- #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
- @summary("Create a fine-tuning job")
- @route("jobs")
- @post
- @operationId("createFineTuningJob")
- createFineTuningJob is FoundryDataPlaneOperation<
- OpenAI.CreateFineTuningJobRequest,
- OpenAI.FineTuningJob
- >;
-
- /**
- * Returns the fine-tuning jobs for the current organization.
- */
- #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "not yet an Azure operation"
- #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
- @summary("List fine-tuning jobs")
- @route("jobs")
- @get
- @operationId("listPaginatedFineTuningJobs")
- listPaginatedFineTuningJobs is FoundryDataPlaneOperation<
- {
- /** Identifier for the last job from the previous pagination request. */
- @query after?: string;
-
- /** Number of fine-tuning jobs to retrieve. */
- @query limit?: int32 = 20;
- },
- OpenAI.ListPaginatedFineTuningJobsResponse
- >;
-
- /**
- * Gets info about a fine-tuning job.
- *
- * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
- */
- #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "not yet an Azure operation"
- #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
- @summary("Get a fine-tuning job")
- @route("jobs/{fine_tuning_job_id}")
- @get
- @operationId("retrieveFineTuningJob")
- retrieveFineTuningJob is FoundryDataPlaneOperation<
- {
- /** The ID of the fine-tuning job. */
- @path fine_tuning_job_id: string;
- },
- OpenAI.FineTuningJob
- >;
-
- /**
- * Immediately cancels the specified fine-tuning job.
- */
- #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "not yet an Azure operation"
- #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
- @summary("Cancel a fine-tuning job")
- @route("jobs/{fine_tuning_job_id}/cancel")
- @post
- @operationId("cancelFineTuningJob")
- cancelFineTuningJob is FoundryDataPlaneOperation<
- {
- /** The ID of the fine-tuning job to cancel. */
- @path fine_tuning_job_id: string;
- },
- OpenAI.FineTuningJob
- >;
-
- /**
- * Pauses the specified fine-tuning job while it is running.
- */
- #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "not yet an Azure operation"
- #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
- @summary("Pause a fine-tuning job")
- @route("jobs/{fine_tuning_job_id}/pause")
- @post
- @operationId("pauseFineTuningJob")
- pauseFineTuningJob is FoundryDataPlaneOperation<
- {
- /** The ID of the fine-tuning job to pause. */
- @path fine_tuning_job_id: string;
- },
- OpenAI.FineTuningJob
- >;
-
- /**
- * Resumes the specified fine-tuning job after it has been paused.
- */
- #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "not yet an Azure operation"
- #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
- @summary("Resume a fine-tuning job")
- @route("jobs/{fine_tuning_job_id}/resume")
- @post
- @operationId("resumeFineTuningJob")
- resumeFineTuningJob is FoundryDataPlaneOperation<
- {
- /** The ID of the fine-tuning job to resume. */
- @path fine_tuning_job_id: string;
- },
- OpenAI.FineTuningJob
- >;
-
- /**
- * Returns the checkpoints saved during the specified fine-tuning job.
- */
- #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "not yet an Azure operation"
- #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
- @summary("List fine-tuning job checkpoints")
- @route("jobs/{fine_tuning_job_id}/checkpoints")
- @get
- @operationId("listFineTuningJobCheckpoints")
- listFineTuningJobCheckpoints is FoundryDataPlaneOperation<
- {
- /** The ID of the fine-tuning job to get checkpoints for. */
- @path fine_tuning_job_id: string;
-
- /** Identifier for the last checkpoint ID from the previous pagination request. */
- @query after?: string;
-
- /** Number of checkpoints to retrieve. */
- @query limit?: int32 = 10;
- },
- OpenAI.ListFineTuningJobCheckpointsResponse
- >;
-
- /**
- * Returns the status events emitted during the specified fine-tuning job.
- */
- #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "not yet an Azure operation"
- #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
- @summary("List fine-tuning job events")
- @route("jobs/{fine_tuning_job_id}/events")
- @get
- @operationId("listFineTuningJobEvents")
- listFineTuningJobEvents is FoundryDataPlaneOperation<
- {
- /** The ID of the fine-tuning job to get events for. */
- @path fine_tuning_job_id: string;
-
- /** Identifier for the last event from the previous pagination request. */
- @query after?: string;
-
- /** Number of events to retrieve. */
- @query limit?: int32 = 20;
- },
- OpenAI.ListFineTuningJobEventsResponse
- >;
-}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/assistants/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/assistants/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/assistants/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/assistants/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/assistants/routes.generated.tsp
new file mode 100644
index 000000000000..dc55b235cca9
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/assistants/routes.generated.tsp
@@ -0,0 +1,148 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/common";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/assistants";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/assistants")
+@tag("Assistants")
+interface Assistants {
+ /**
+ * Lists assistants matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "deprecated" "Deprecated OpenAI operation shapes intentionally reference deprecated models."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #deprecated "deprecated"
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List assistants")
+ @list
+ @get
+ listAssistants is OpenAIOperation<
+ {
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ 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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ before?: string;
+ },
+ OpenAI.ListAssistantsResponse
+ >;
+
+ /**
+ * Creates an assistant from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "deprecated" "Deprecated OpenAI operation shapes intentionally reference deprecated models."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #deprecated "deprecated"
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create an assistant")
+ @post
+ createAssistant is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateAssistantRequest;
+ },
+ OpenAI.AssistantObject
+ >;
+
+ /**
+ * Deletes an assistant by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "deprecated" "Deprecated OpenAI operation shapes intentionally reference deprecated models."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #deprecated "deprecated"
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete an assistant")
+ @route("{assistant_id}")
+ @delete
+ deleteAssistant is OpenAIOperation<
+ {
+ /** The ID of the assistant to delete. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ assistant_id: string;
+ },
+ OpenAI.DeleteAssistantResponse
+ >;
+
+ /**
+ * Retrieves an assistant by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "deprecated" "Deprecated OpenAI operation shapes intentionally reference deprecated models."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #deprecated "deprecated"
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get an assistant")
+ @route("{assistant_id}")
+ @get
+ getAssistant is OpenAIOperation<
+ {
+ /** The ID of the assistant to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ assistant_id: string;
+ },
+ OpenAI.AssistantObject
+ >;
+
+ /**
+ * Updates an assistant with the supplied changes.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "deprecated" "Deprecated OpenAI operation shapes intentionally reference deprecated models."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #deprecated "deprecated"
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Update an assistant")
+ @route("{assistant_id}")
+ @post
+ modifyAssistant is OpenAIOperation<
+ {
+ /** The ID of the assistant to modify. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ assistant_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.ModifyAssistantRequest;
+ },
+ OpenAI.AssistantObject
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/assistants/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/assistants/routes.meta.tsp
new file mode 100644
index 000000000000..40b51fbce7f5
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/assistants/routes.meta.tsp
@@ -0,0 +1,872 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Assistants.listAssistants,
+ "x-oaiMeta",
+ #{
+ name: "List assistants",
+ group: "assistants",
+ examples: #{
+ request: #{
+ curl: """
+ curl "https://api.openai.com/v1/assistants?order=desc&limit=20" \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.assistants.list()
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistants = await openai.beta.assistants.list({
+ order: "desc",
+ limit: "20",
+ });
+
+ console.log(myAssistants.data);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const assistant of client.beta.assistants.list()) {
+ console.log(assistant.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Assistants.List(context.TODO(), openai.BetaAssistantListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.AssistantListPage;
+ import com.openai.models.beta.assistants.AssistantListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantListPage page = client.beta().assistants().list();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.assistants.list
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698982736,
+ "name": "Coding Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc456",
+ "object": "assistant",
+ "created_at": 1698982718,
+ "name": "My Assistant",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant designed to make me better at coding!",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ },
+ {
+ "id": "asst_abc789",
+ "object": "assistant",
+ "created_at": 1698982643,
+ "name": null,
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+ ],
+ "first_id": "asst_abc123",
+ "last_id": "asst_abc789",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Assistants.listAssistants, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Assistants.createAssistant,
+ "x-oaiMeta",
+ #{
+ name: "Create assistant",
+ group: "assistants",
+ examples: #[
+ #{
+ title: "Code Interpreter",
+ request: #{
+ curl: """
+ curl "https://api.openai.com/v1/assistants" \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ "name": "Math Tutor",
+ "tools": [{"type": "code_interpreter"}],
+ "model": "gpt-4o"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.create(
+ model="gpt-4o",
+ )
+ print(assistant.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistant = await openai.beta.assistants.create({
+ instructions:
+ "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ name: "Math Tutor",
+ tools: [{ type: "code_interpreter" }],
+ model: "gpt-4o",
+ });
+
+ console.log(myAssistant);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.create({ model: 'gpt-4o' });
+
+ console.log(assistant.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{
+ Model: shared.ChatModelGPT4o,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantCreateParams params = AssistantCreateParams.builder()
+ .model(ChatModel.GPT_4O)
+ .build();
+ Assistant assistant = client.beta().assistants().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.create(model: :"gpt-4o")
+
+ puts(assistant)
+ """,
+ },
+ response: """
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1698984975,
+ "name": "Math Tutor",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+
+ """,
+ },
+ #{
+ title: "Files",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/assistants \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ "tools": [{"type": "file_search"}],
+ "tool_resources": {"file_search": {"vector_store_ids": ["vs_123"]}},
+ "model": "gpt-4o"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.create(
+ model="gpt-4o",
+ )
+ print(assistant.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistant = await openai.beta.assistants.create({
+ instructions:
+ "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ name: "HR Helper",
+ tools: [{ type: "file_search" }],
+ tool_resources: {
+ file_search: {
+ vector_store_ids: ["vs_123"]
+ }
+ },
+ model: "gpt-4o"
+ });
+
+ console.log(myAssistant);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.create({ model: 'gpt-4o' });
+
+ console.log(assistant.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{
+ Model: shared.ChatModelGPT4o,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantCreateParams params = AssistantCreateParams.builder()
+ .model(ChatModel.GPT_4O)
+ .build();
+ Assistant assistant = client.beta().assistants().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.create(model: :"gpt-4o")
+
+ puts(assistant)
+ """,
+ },
+ response: """
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1699009403,
+ "name": "HR Helper",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "tool_resources": {
+ "file_search": {
+ "vector_store_ids": ["vs_123"]
+ }
+ },
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Assistants.deleteAssistant,
+ "x-oaiMeta",
+ #{
+ name: "Delete assistant",
+ group: "assistants",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/assistants/asst_abc123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -X DELETE
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant_deleted = client.beta.assistants.delete(
+ "assistant_id",
+ )
+ print(assistant_deleted.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const response = await openai.beta.assistants.delete("asst_abc123");
+
+ console.log(response);
+ }
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistantDeleted = await client.beta.assistants.delete('assistant_id');
+
+ console.log(assistantDeleted.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistantDeleted, err := client.Beta.Assistants.Delete(context.TODO(), "assistant_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistantDeleted.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.AssistantDeleteParams;
+ import com.openai.models.beta.assistants.AssistantDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ AssistantDeleted assistantDeleted = client.beta().assistants().delete("assistant_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant_deleted = openai.beta.assistants.delete("assistant_id")
+
+ puts(assistant_deleted)
+ """,
+ },
+ response: """
+ {
+ "id": "asst_abc123",
+ "object": "assistant.deleted",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Assistants.getAssistant,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve assistant",
+ group: "assistants",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/assistants/asst_abc123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.retrieve(
+ "assistant_id",
+ )
+ print(assistant.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myAssistant = await openai.beta.assistants.retrieve(
+ "asst_abc123"
+ );
+
+ console.log(myAssistant);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.retrieve('assistant_id');
+
+ console.log(assistant.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.Get(context.TODO(), "assistant_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Assistant assistant = client.beta().assistants().retrieve("assistant_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.retrieve("assistant_id")
+
+ puts(assistant)
+ """,
+ },
+ response: """
+ {
+ "id": "asst_abc123",
+ "object": "assistant",
+ "created_at": 1699009709,
+ "name": "HR Helper",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Assistants.modifyAssistant,
+ "x-oaiMeta",
+ #{
+ name: "Modify assistant",
+ group: "assistants",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/assistants/asst_abc123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
+ "tools": [{"type": "file_search"}],
+ "model": "gpt-4o"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ assistant = client.beta.assistants.update(
+ assistant_id="assistant_id",
+ )
+ print(assistant.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myUpdatedAssistant = await openai.beta.assistants.update(
+ "asst_abc123",
+ {
+ instructions:
+ "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
+ name: "HR Helper",
+ tools: [{ type: "file_search" }],
+ model: "gpt-4o"
+ }
+ );
+
+ console.log(myUpdatedAssistant);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const assistant = await client.beta.assistants.update('assistant_id');
+
+ console.log(assistant.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ assistant, err := client.Beta.Assistants.Update(
+ context.TODO(),
+ "assistant_id",
+ openai.BetaAssistantUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", assistant.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.assistants.Assistant;
+ import com.openai.models.beta.assistants.AssistantUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Assistant assistant = client.beta().assistants().update("assistant_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ assistant = openai.beta.assistants.update("assistant_id")
+
+ puts(assistant)
+ """,
+ },
+ response: """
+ {
+ "id": "asst_123",
+ "object": "assistant",
+ "created_at": 1699009709,
+ "name": "HR Helper",
+ "description": null,
+ "model": "gpt-4o",
+ "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "tool_resources": {
+ "file_search": {
+ "vector_store_ids": []
+ }
+ },
+ "metadata": {},
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "response_format": "auto"
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/audio/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/audio/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/audio/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/audio/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/audio/routes.generated.tsp
new file mode 100644
index 000000000000..3ab68848d643
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/audio/routes.generated.tsp
@@ -0,0 +1,105 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/audio";
+using TypeSpec.Http;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/audio")
+@tag("Audio")
+interface Audio {
+ /**
+ * Creates a speech from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/response-schema-problem" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a speech")
+ @route("speech")
+ @post
+ createSpeech is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateSpeechRequest;
+ },
+ {
+ /** The TransferEncoding header. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @header("Transfer-Encoding")
+ TransferEncoding?: string;
+
+ /** The content type of the request body. */
+ @header
+ contentType: "application/octet-stream";
+
+ /** The request body. */
+ @body
+ body: bytes;
+ }
+ >;
+
+ /**
+ * Creates a transcription from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/response-schema-problem" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-unnamed-union" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a transcription")
+ @route("transcriptions")
+ @post
+ createTranscription is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateTranscriptionRequest;
+ },
+ TypeSpec.Http.Body<
+ | OpenAI.CreateTranscriptionResponseJson
+ | OpenAI.CreateTranscriptionResponseDiarizedJson
+ | OpenAI.CreateTranscriptionResponseVerboseJson>
+ >;
+
+ /**
+ * Creates a translation from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-unnamed-union" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-autorest/union-unsupported" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a translation")
+ @route("translations")
+ @post
+ createTranslation is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateTranslationRequest;
+ },
+ TypeSpec.Http.Body<
+ | OpenAI.CreateTranslationResponseJson
+ | OpenAI.CreateTranslationResponseVerboseJson>
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/audio/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/audio/routes.meta.tsp
new file mode 100644
index 000000000000..f2c83b80fb6c
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/audio/routes.meta.tsp
@@ -0,0 +1,1492 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Audio.createSpeech,
+ "x-oaiMeta",
+ #{
+ name: "Create speech",
+ group: "audio",
+ examples: #[
+ #{
+ title: "Default",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/audio/speech \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{
+ "model": "gpt-4o-mini-tts",
+ "input": "The quick brown fox jumped over the lazy dog.",
+ "voice": "alloy"
+ }' \\
+ --output speech.mp3
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ speech = client.audio.speech.create(
+ input="input",
+ model="tts-1",
+ voice="alloy",
+ )
+ print(speech)
+ content = speech.read()
+ print(content)
+ """,
+ javascript: """
+ import fs from "fs";
+ import path from "path";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const speechFile = path.resolve("./speech.mp3");
+
+ async function main() {
+ const mp3 = await openai.audio.speech.create({
+ model: "gpt-4o-mini-tts",
+ voice: "alloy",
+ input: "Today is a wonderful day to build something people love!",
+ });
+ console.log(speechFile);
+ const buffer = Buffer.from(await mp3.arrayBuffer());
+ await fs.promises.writeFile(speechFile, buffer);
+ }
+ main();
+
+ """,
+ csharp: """
+ using System;
+ using System.IO;
+
+ using OpenAI.Audio;
+
+ AudioClient client = new(
+ model: "gpt-4o-mini-tts",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ BinaryData speech = client.GenerateSpeech(
+ text: "The quick brown fox jumped over the lazy dog.",
+ voice: GeneratedSpeechVoice.Alloy
+ );
+
+ using FileStream stream = File.OpenWrite("speech.mp3");
+ speech.ToStream().CopyTo(stream);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const speech = await client.audio.speech.create({
+ input: 'input',
+ model: 'tts-1',
+ voice: 'alloy',
+ });
+
+ console.log(speech);
+
+ const content = await speech.blob();
+ console.log(content);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ speech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{
+ Input: "input",
+ Model: openai.SpeechModelTTS1,
+ Voice: openai.AudioSpeechNewParamsVoiceUnion{
+ OfAudioSpeechNewsVoiceString2: openai.String("alloy"),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", speech)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.audio.speech.SpeechCreateParams;
+ import com.openai.models.audio.speech.SpeechModel;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ SpeechCreateParams params = SpeechCreateParams.builder()
+ .input("input")
+ .model(SpeechModel.TTS_1)
+ .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)
+ .build();
+ HttpResponse speech = client.audio().speech().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ speech = openai.audio.speech.create(input: "input", model: :"tts-1", voice: :alloy)
+
+ puts(speech)
+ """,
+ },
+ },
+ #{
+ title: "SSE Stream Format",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/audio/speech \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{
+ "model": "gpt-4o-mini-tts",
+ "input": "The quick brown fox jumped over the lazy dog.",
+ "voice": "alloy",
+ "stream_format": "sse"
+ }'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const speech = await client.audio.speech.create({
+ input: 'input',
+ model: 'tts-1',
+ voice: 'alloy',
+ });
+
+ console.log(speech);
+
+ const content = await speech.blob();
+ console.log(content);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ speech = client.audio.speech.create(
+ input="input",
+ model="tts-1",
+ voice="alloy",
+ )
+ print(speech)
+ content = speech.read()
+ print(content)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ speech, err := client.Audio.Speech.New(context.TODO(), openai.AudioSpeechNewParams{
+ Input: "input",
+ Model: openai.SpeechModelTTS1,
+ Voice: openai.AudioSpeechNewParamsVoiceUnion{
+ OfAudioSpeechNewsVoiceString2: openai.String("alloy"),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", speech)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.audio.speech.SpeechCreateParams;
+ import com.openai.models.audio.speech.SpeechModel;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ SpeechCreateParams params = SpeechCreateParams.builder()
+ .input("input")
+ .model(SpeechModel.TTS_1)
+ .voice(SpeechCreateParams.Voice.UnionMember1.ALLOY)
+ .build();
+ HttpResponse speech = client.audio().speech().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ speech = openai.audio.speech.create(input: "input", model: :"tts-1", voice: :alloy)
+
+ puts(speech)
+ """,
+ },
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Audio.createTranscription,
+ "x-oaiMeta",
+ #{
+ name: "Create transcription",
+ group: "audio",
+ examples: #[
+ #{
+ title: "Default",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/audio/transcriptions \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: multipart/form-data" \\
+ -F file="@/path/to/file/audio.mp3" \\
+ -F model="gpt-4o-transcribe"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "gpt-4o-transcribe",
+ });
+
+ console.log(transcription.text);
+ }
+ main();
+
+ """,
+ csharp: """
+ using System;
+
+ using OpenAI.Audio;
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "gpt-4o-transcribe",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath);
+
+ Console.WriteLine($"{transcription.Text}");
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ """,
+ },
+ response: """
+ {
+ "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.",
+ "usage": {
+ "type": "tokens",
+ "input_tokens": 14,
+ "input_token_details": {
+ "text_tokens": 0,
+ "audio_tokens": 14
+ },
+ "output_tokens": 45,
+ "total_tokens": 59
+ }
+ }
+
+ """,
+ },
+ #{
+ title: "Diarization",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/audio/transcriptions \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: multipart/form-data" \\
+ -F file="@/path/to/file/meeting.wav" \\
+ -F model="gpt-4o-transcribe-diarize" \\
+ -F response_format="diarized_json" \\
+ -F chunking_strategy=auto \\
+ -F 'known_speaker_names[]=agent' \\
+ -F 'known_speaker_references[]=data:audio/wav;base64,AAA...'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const speakerRef = fs.readFileSync("agent.wav").toString("base64");
+
+ const transcript = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("meeting.wav"),
+ model: "gpt-4o-transcribe-diarize",
+ response_format: "diarized_json",
+ chunking_strategy: "auto",
+ extra_body: {
+ known_speaker_names: ["agent"],
+ known_speaker_references: [`data:audio/wav;base64,\${speakerRef}`],
+ },
+ });
+
+ console.log(transcript.segments);
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ """,
+ },
+ response: """
+ {
+ "task": "transcribe",
+ "duration": 27.4,
+ "text": "Agent: Thanks for calling OpenAI support.
+ A: Hi, I'm trying to enable diarization.
+ Agent: Happy to walk you through the steps.",
+ "segments": [
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_001",
+ "start": 0.0,
+ "end": 4.7,
+ "text": "Thanks for calling OpenAI support.",
+ "speaker": "agent"
+ },
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_002",
+ "start": 4.7,
+ "end": 11.8,
+ "text": "Hi, I'm trying to enable diarization.",
+ "speaker": "A"
+ },
+ {
+ "type": "transcript.text.segment",
+ "id": "seg_003",
+ "start": 12.1,
+ "end": 18.5,
+ "text": "Happy to walk you through the steps.",
+ "speaker": "agent"
+ }
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 27
+ }
+ }
+
+ """,
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/audio/transcriptions \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: multipart/form-data" \\
+ -F file="@/path/to/file/audio.mp3" \\
+ -F model="gpt-4o-mini-transcribe" \\
+ -F stream=true
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const stream = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "gpt-4o-mini-transcribe",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ """,
+ },
+ response: """
+ data: {"type":"transcript.text.delta","delta":"I","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]}]}
+
+ data: {"type":"transcript.text.delta","delta":" see","logprobs":[{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" skies","logprobs":[{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]}]}
+
+ data: {"type":"transcript.text.delta","delta":" blue","logprobs":[{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" clouds","logprobs":[{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]}]}
+
+ data: {"type":"transcript.text.delta","delta":" white","logprobs":[{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0014890312,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" bright","logprobs":[{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]}]}
+
+ data: {"type":"transcript.text.delta","delta":" blessed","logprobs":[{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" days","logprobs":[{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.00001700133,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]}]}
+
+ data: {"type":"transcript.text.delta","delta":" dark","logprobs":[{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]}]}
+
+ data: {"type":"transcript.text.delta","delta":" sacred","logprobs":[{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" nights","logprobs":[{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0036910512,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":" I","logprobs":[{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]}]}
+
+ data: {"type":"transcript.text.delta","delta":" think","logprobs":[{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]}]}
+
+ data: {"type":"transcript.text.delta","delta":" to","logprobs":[{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]}]}
+
+ data: {"type":"transcript.text.delta","delta":" myself","logprobs":[{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]}]}
+
+ data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.29254505,"bytes":[44]}]}
+
+ data: {"type":"transcript.text.delta","delta":" what","logprobs":[{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]}]}
+
+ data: {"type":"transcript.text.delta","delta":" a","logprobs":[{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]}]}
+
+ data: {"type":"transcript.text.delta","delta":" wonderful","logprobs":[{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]}]}
+
+ data: {"type":"transcript.text.delta","delta":" world","logprobs":[{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]}]}
+
+ data: {"type":"transcript.text.delta","delta":".","logprobs":[{"token":".","logprob":-0.014231676,"bytes":[46]}]}
+
+ data: {"type":"transcript.text.done","text":"I see skies of blue and clouds of white, the bright blessed days, the dark sacred nights, and I think to myself, what a wonderful world.","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]},{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]},{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]},{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]},{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]},{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]},{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]},{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]},{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]},{"token":",","logprob":-0.0014890312,"bytes":[44]},{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]},{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]},{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]},{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]},{"token":",","logprob":-0.00001700133,"bytes":[44]},{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]},{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]},{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]},{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]},{"token":",","logprob":-0.0036910512,"bytes":[44]},{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]},{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]},{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]},{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]},{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]},{"token":",","logprob":-0.29254505,"bytes":[44]},{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]},{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]},{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]},{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]},{"token":".","logprob":-0.014231676,"bytes":[46]}],"usage":{"input_tokens":14,"input_token_details":{"text_tokens":0,"audio_tokens":14},"output_tokens":45,"total_tokens":59}}
+
+ """,
+ },
+ #{
+ title: "Logprobs",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/audio/transcriptions \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: multipart/form-data" \\
+ -F file="@/path/to/file/audio.mp3" \\
+ -F "include[]=logprobs" \\
+ -F model="gpt-4o-transcribe" \\
+ -F response_format="json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "gpt-4o-transcribe",
+ response_format: "json",
+ include: ["logprobs"]
+ });
+
+ console.log(transcription);
+ }
+ main();
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ """,
+ },
+ response: """
+ {
+ "text": "Hey, my knee is hurting and I want to see the doctor tomorrow ideally.",
+ "logprobs": [
+ { "token": "Hey", "logprob": -1.0415299, "bytes": [72, 101, 121] },
+ { "token": ",", "logprob": -9.805982e-5, "bytes": [44] },
+ { "token": " my", "logprob": -0.00229799, "bytes": [32, 109, 121] },
+ {
+ "token": " knee",
+ "logprob": -4.7159858e-5,
+ "bytes": [32, 107, 110, 101, 101]
+ },
+ { "token": " is", "logprob": -0.043909557, "bytes": [32, 105, 115] },
+ {
+ "token": " hurting",
+ "logprob": -1.1041146e-5,
+ "bytes": [32, 104, 117, 114, 116, 105, 110, 103]
+ },
+ { "token": " and", "logprob": -0.011076359, "bytes": [32, 97, 110, 100] },
+ { "token": " I", "logprob": -5.3193703e-6, "bytes": [32, 73] },
+ {
+ "token": " want",
+ "logprob": -0.0017156356,
+ "bytes": [32, 119, 97, 110, 116]
+ },
+ { "token": " to", "logprob": -7.89631e-7, "bytes": [32, 116, 111] },
+ { "token": " see", "logprob": -5.5122365e-7, "bytes": [32, 115, 101, 101] },
+ { "token": " the", "logprob": -0.0040786397, "bytes": [32, 116, 104, 101] },
+ {
+ "token": " doctor",
+ "logprob": -2.3392786e-6,
+ "bytes": [32, 100, 111, 99, 116, 111, 114]
+ },
+ {
+ "token": " tomorrow",
+ "logprob": -7.89631e-7,
+ "bytes": [32, 116, 111, 109, 111, 114, 114, 111, 119]
+ },
+ {
+ "token": " ideally",
+ "logprob": -0.5800861,
+ "bytes": [32, 105, 100, 101, 97, 108, 108, 121]
+ },
+ { "token": ".", "logprob": -0.00011093382, "bytes": [46] }
+ ],
+ "usage": {
+ "type": "tokens",
+ "input_tokens": 14,
+ "input_token_details": {
+ "text_tokens": 0,
+ "audio_tokens": 14
+ },
+ "output_tokens": 45,
+ "total_tokens": 59
+ }
+ }
+
+ """,
+ },
+ #{
+ title: "Word timestamps",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/audio/transcriptions \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: multipart/form-data" \\
+ -F file="@/path/to/file/audio.mp3" \\
+ -F "timestamp_granularities[]=word" \\
+ -F model="whisper-1" \\
+ -F response_format="verbose_json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "whisper-1",
+ response_format: "verbose_json",
+ timestamp_granularities: ["word"]
+ });
+
+ console.log(transcription.text);
+ }
+ main();
+
+ """,
+ csharp: """
+ using System;
+
+ using OpenAI.Audio;
+
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "whisper-1",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscriptionOptions options = new()
+ {
+ ResponseFormat = AudioTranscriptionFormat.Verbose,
+ TimestampGranularities = AudioTimestampGranularities.Word,
+ };
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);
+
+ Console.WriteLine($"{transcription.Text}");
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ """,
+ },
+ response: """
+ {
+ "task": "transcribe",
+ "language": "english",
+ "duration": 8.470000267028809,
+ "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
+ "words": [
+ {
+ "word": "The",
+ "start": 0.0,
+ "end": 0.23999999463558197
+ },
+ ...
+ {
+ "word": "volleyball",
+ "start": 7.400000095367432,
+ "end": 7.900000095367432
+ }
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 9
+ }
+ }
+
+ """,
+ },
+ #{
+ title: "Segment timestamps",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/audio/transcriptions \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: multipart/form-data" \\
+ -F file="@/path/to/file/audio.mp3" \\
+ -F "timestamp_granularities[]=segment" \\
+ -F model="whisper-1" \\
+ -F response_format="verbose_json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for transcription in client.audio.transcriptions.create(
+ file=b"Example data",
+ model="gpt-4o-transcribe",
+ ):
+ print(transcription)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const transcription = await openai.audio.transcriptions.create({
+ file: fs.createReadStream("audio.mp3"),
+ model: "whisper-1",
+ response_format: "verbose_json",
+ timestamp_granularities: ["segment"]
+ });
+
+ console.log(transcription.text);
+ }
+ main();
+
+ """,
+ csharp: """
+ using System;
+
+ using OpenAI.Audio;
+
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "whisper-1",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscriptionOptions options = new()
+ {
+ ResponseFormat = AudioTranscriptionFormat.Verbose,
+ TimestampGranularities = AudioTimestampGranularities.Segment,
+ };
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath, options);
+
+ Console.WriteLine($"{transcription.Text}");
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const transcription = await client.audio.transcriptions.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'gpt-4o-transcribe',
+ });
+
+ console.log(transcription);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelGPT4oTranscribe,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", transcription)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+ import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranscriptionCreateParams params = TranscriptionCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.GPT_4O_TRANSCRIBE)
+ .build();
+ TranscriptionCreateResponse transcription = client.audio().transcriptions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ transcription = openai.audio.transcriptions.create(file: StringIO.new("Example data"), model: :"gpt-4o-transcribe")
+
+ puts(transcription)
+ """,
+ },
+ response: """
+ {
+ "task": "transcribe",
+ "language": "english",
+ "duration": 8.470000267028809,
+ "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
+ "segments": [
+ {
+ "id": 0,
+ "seek": 0,
+ "start": 0.0,
+ "end": 3.319999933242798,
+ "text": " The beach was a popular spot on a hot summer day.",
+ "tokens": [
+ 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530
+ ],
+ "temperature": 0.0,
+ "avg_logprob": -0.2860786020755768,
+ "compression_ratio": 1.2363636493682861,
+ "no_speech_prob": 0.00985979475080967
+ },
+ ...
+ ],
+ "usage": {
+ "type": "duration",
+ "seconds": 9
+ }
+ }
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Audio.createTranslation,
+ "x-oaiMeta",
+ #{
+ name: "Create translation",
+ group: "audio",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/audio/translations \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: multipart/form-data" \\
+ -F file="@/path/to/file/german.m4a" \\
+ -F model="whisper-1"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ translation = client.audio.translations.create(
+ file=b"Example data",
+ model="whisper-1",
+ )
+ print(translation)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const translation = await openai.audio.translations.create({
+ file: fs.createReadStream("speech.mp3"),
+ model: "whisper-1",
+ });
+
+ console.log(translation.text);
+ }
+ main();
+
+ """,
+ csharp: """
+ using System;
+
+ using OpenAI.Audio;
+
+ string audioFilePath = "audio.mp3";
+
+ AudioClient client = new(
+ model: "whisper-1",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ AudioTranscription transcription = client.TranscribeAudio(audioFilePath);
+
+ Console.WriteLine($"{transcription.Text}");
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const translation = await client.audio.translations.create({
+ file: fs.createReadStream('speech.mp3'),
+ model: 'whisper-1',
+ });
+
+ console.log(translation);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ translation, err := client.Audio.Translations.New(context.TODO(), openai.AudioTranslationNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Model: openai.AudioModelWhisper1,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", translation)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.audio.AudioModel;
+ import com.openai.models.audio.translations.TranslationCreateParams;
+ import com.openai.models.audio.translations.TranslationCreateResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ TranslationCreateParams params = TranslationCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .model(AudioModel.WHISPER_1)
+ .build();
+ TranslationCreateResponse translation = client.audio().translations().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ translation = openai.audio.translations.create(file: StringIO.new("Example data"), model: :"whisper-1")
+
+ puts(translation)
+ """,
+ },
+ response: """
+ {
+ "text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?"
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/batch/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/batch/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/batch/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/batch/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/batch/routes.generated.tsp
new file mode 100644
index 000000000000..f7ae98f8208e
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/batch/routes.generated.tsp
@@ -0,0 +1,104 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/batch";
+using TypeSpec.Http;
+using TypeSpec.OpenAPI;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/batches")
+@tag("Batch")
+interface Batches {
+ /**
+ * Lists batches matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List batches")
+ @list
+ @get
+ listBatches is OpenAIOperation<
+ {
+ /** 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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+ },
+ OpenAI.ListBatchesResponse
+ >;
+
+ /**
+ * Creates a batch from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a batch")
+ @post
+ createBatch is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateBatchParametersBody;
+ },
+ OpenAI.Batch
+ >;
+
+ /**
+ * Retrieves a batch by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a batch")
+ @route("{batch_id}")
+ @get
+ retrieveBatch is OpenAIOperation<
+ {
+ /** The ID of the batch to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ batch_id: string;
+ },
+ OpenAI.Batch
+ >;
+
+ /**
+ * Cancels a batch by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Cancel a batch")
+ @route("{batch_id}/cancel")
+ @post
+ cancelBatch is OpenAIOperation<
+ {
+ /** The ID of the batch to cancel. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ batch_id: string;
+ },
+ OpenAI.Batch
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/batch/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/batch/routes.meta.tsp
new file mode 100644
index 000000000000..827af7826d79
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/batch/routes.meta.tsp
@@ -0,0 +1,607 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Batches.listBatches,
+ "x-oaiMeta",
+ #{
+ name: "List batches",
+ group: "batch",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/batches?limit=2 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.batches.list()
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.batches.list();
+
+ for await (const batch of list) {
+ console.log(batch);
+ }
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const batch of client.batches.list()) {
+ console.log(batch.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Batches.List(context.TODO(), openai.BatchListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.BatchListPage;
+ import com.openai.models.batches.BatchListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ BatchListPage page = client.batches().list();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.batches.list
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/chat/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "completed",
+ "output_file_id": "file-cvaTdG",
+ "error_file_id": "file-HOWS94",
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": 1711493133,
+ "completed_at": 1711493163,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 95,
+ "failed": 5
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly job",
+ }
+ },
+ { ... },
+ ],
+ "first_id": "batch_abc123",
+ "last_id": "batch_abc456",
+ "has_more": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Batches.listBatches, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Batches.createBatch,
+ "x-oaiMeta",
+ #{
+ name: "Create batch",
+ group: "batch",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/batches \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{
+ "input_file_id": "file-abc123",
+ "endpoint": "/v1/chat/completions",
+ "completion_window": "24h"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ batch = client.batches.create(
+ completion_window="24h",
+ endpoint="/v1/responses",
+ input_file_id="input_file_id",
+ )
+ print(batch.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const batch = await openai.batches.create({
+ input_file_id: "file-abc123",
+ endpoint: "/v1/chat/completions",
+ completion_window: "24h"
+ });
+
+ console.log(batch);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const batch = await client.batches.create({
+ completion_window: '24h',
+ endpoint: '/v1/responses',
+ input_file_id: 'input_file_id',
+ });
+
+ console.log(batch.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ batch, err := client.Batches.New(context.TODO(), openai.BatchNewParams{
+ CompletionWindow: openai.BatchNewParamsCompletionWindow24h,
+ Endpoint: openai.BatchNewParamsEndpointV1Responses,
+ InputFileID: "input_file_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", batch.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.Batch;
+ import com.openai.models.batches.BatchCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ BatchCreateParams params = BatchCreateParams.builder()
+ .completionWindow(BatchCreateParams.CompletionWindow._24H)
+ .endpoint(BatchCreateParams.Endpoint.V1_RESPONSES)
+ .inputFileId("input_file_id")
+ .build();
+ Batch batch = client.batches().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ batch = openai.batches.create(
+ completion_window: :"24h",
+ endpoint: :"/v1/responses",
+ input_file_id: "input_file_id"
+ )
+
+ puts(batch)
+ """,
+ },
+ response: """
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/chat/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "validating",
+ "output_file_id": null,
+ "error_file_id": null,
+ "created_at": 1711471533,
+ "in_progress_at": null,
+ "expires_at": null,
+ "finalizing_at": null,
+ "completed_at": null,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 0,
+ "completed": 0,
+ "failed": 0
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Batches.retrieveBatch,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve batch",
+ group: "batch",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/batches/batch_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ batch = client.batches.retrieve(
+ "batch_id",
+ )
+ print(batch.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const batch = await openai.batches.retrieve("batch_abc123");
+
+ console.log(batch);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const batch = await client.batches.retrieve('batch_id');
+
+ console.log(batch.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ batch, err := client.Batches.Get(context.TODO(), "batch_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", batch.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.Batch;
+ import com.openai.models.batches.BatchRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Batch batch = client.batches().retrieve("batch_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ batch = openai.batches.retrieve("batch_id")
+
+ puts(batch)
+ """,
+ },
+ response: """
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "completed",
+ "output_file_id": "file-cvaTdG",
+ "error_file_id": "file-HOWS94",
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": 1711493133,
+ "completed_at": 1711493163,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": null,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 95,
+ "failed": 5
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Batches.cancelBatch,
+ "x-oaiMeta",
+ #{
+ name: "Cancel batch",
+ group: "batch",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/batches/batch_abc123/cancel \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -X POST
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ batch = client.batches.cancel(
+ "batch_id",
+ )
+ print(batch.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const batch = await openai.batches.cancel("batch_abc123");
+
+ console.log(batch);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const batch = await client.batches.cancel('batch_id');
+
+ console.log(batch.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ batch, err := client.Batches.Cancel(context.TODO(), "batch_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", batch.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.batches.Batch;
+ import com.openai.models.batches.BatchCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Batch batch = client.batches().cancel("batch_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ batch = openai.batches.cancel("batch_id")
+
+ puts(batch)
+ """,
+ },
+ response: """
+ {
+ "id": "batch_abc123",
+ "object": "batch",
+ "endpoint": "/v1/chat/completions",
+ "errors": null,
+ "input_file_id": "file-abc123",
+ "completion_window": "24h",
+ "status": "cancelling",
+ "output_file_id": null,
+ "error_file_id": null,
+ "created_at": 1711471533,
+ "in_progress_at": 1711471538,
+ "expires_at": 1711557933,
+ "finalizing_at": null,
+ "completed_at": null,
+ "failed_at": null,
+ "expired_at": null,
+ "cancelling_at": 1711475133,
+ "cancelled_at": null,
+ "request_counts": {
+ "total": 100,
+ "completed": 23,
+ "failed": 1
+ },
+ "metadata": {
+ "customer_id": "user_123456789",
+ "batch_description": "Nightly eval job",
+ }
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/chat/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/chat/main.tsp
new file mode 100644
index 000000000000..9a63b0e42eba
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/chat/main.tsp
@@ -0,0 +1,3 @@
+import "./models.tsp";
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/chat/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/chat/models.tsp
new file mode 100644
index 000000000000..203e89e9c93d
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/chat/models.tsp
@@ -0,0 +1,30 @@
+import "../../common/models.tsp";
+
+using Azure.Core.Experimental;
+using TypeSpec.Http;
+using TypeSpec.Versioning;
+
+#suppress "@azure-tools/typespec-azure-core/experimental-feature" "Experimental features applied to augment inherited OpenAI models"
+namespace Azure.AI.Projects {
+ @@changePropertyType(OpenAI.CreateChatCompletionRequest.`model`, string);
+ @@changePropertyType(OpenAI.CreateChatCompletionResponse.`model`, string);
+ @@doc(
+ OpenAI.CreateChatCompletionRequest.`model`,
+ "The model deployment to use for this chat completion."
+ );
+ @@doc(
+ OpenAI.CreateChatCompletionResponse.`model`,
+ "The model deployment used for the creation of this chat completion."
+ );
+ @@changePropertyType(OpenAI.Response.`model`, string);
+
+ @@copyProperties(
+ OpenAI.CreateChatCompletionRequest,
+ {
+ /**
+ * User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.
+ */
+ user_security_context?: AzureUserSecurityContext,
+ }
+ );
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/chat/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/chat/routes.generated.tsp
new file mode 100644
index 000000000000..3057267c811e
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/chat/routes.generated.tsp
@@ -0,0 +1,188 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/common";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/chat";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/chat")
+@tag("Chat")
+interface Chat {
+ /**
+ * Lists chat completions matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List chat completions")
+ @list
+ @route("completions")
+ @get
+ listChatCompletions is OpenAIOperation<
+ {
+ /** The model used to generate the Chat Completions. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ `model`?: string;
+
+ /**A list of metadata keys to filter the Chat Completions by. Example:
+ `metadata[key1]=value1&metadata[key2]=value2`*/
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-nullable" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ metadata?: OpenAI.Metadata | null;
+
+ /** Identifier for the last chat completion from the previous pagination request. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+
+ /** Number of Chat Completions to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.asc;
+ },
+ OpenAI.ChatCompletionList
+ >;
+
+ /**
+ * Creates a chat completion from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/response-schema-problem" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a chat completion")
+ @route("completions")
+ @post
+ createChatCompletion is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateChatCompletionRequest;
+ },
+ OpenAI.CreateChatCompletionResponse
+ >;
+
+ /**
+ * Deletes a chat completion by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a chat completion")
+ @route("completions/{completion_id}")
+ @delete
+ deleteChatCompletion is OpenAIOperation<
+ {
+ /** The ID of the chat completion to delete. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ completion_id: string;
+ },
+ OpenAI.ChatCompletionDeleted
+ >;
+
+ /**
+ * Retrieves a chat completion by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a chat completion")
+ @route("completions/{completion_id}")
+ @get
+ getChatCompletion is OpenAIOperation<
+ {
+ /** The ID of the chat completion to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ completion_id: string;
+ },
+ OpenAI.CreateChatCompletionResponse
+ >;
+
+ /**
+ * Updates a chat completion with the supplied changes.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Update a chat completion")
+ @route("completions/{completion_id}")
+ @post
+ updateChatCompletion is OpenAIOperation<
+ {
+ /** The ID of the chat completion to update. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ completion_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.UpdateChatCompletionParametersBody;
+ },
+ OpenAI.CreateChatCompletionResponse
+ >;
+
+ /**
+ * Retrieves chat completion messages by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get chat completion messages")
+ @list
+ @route("completions/{completion_id}/messages")
+ @get
+ getChatCompletionMessages is OpenAIOperation<
+ {
+ /** The ID of the chat completion to retrieve messages from. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ completion_id: string;
+
+ /** Identifier for the last message from the previous pagination request. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+
+ /** Number of messages to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.asc;
+ },
+ OpenAI.ChatCompletionMessageList
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/chat/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/chat/routes.meta.tsp
new file mode 100644
index 000000000000..f360dc3f2652
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/chat/routes.meta.tsp
@@ -0,0 +1,1917 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Chat.listChatCompletions,
+ "x-oaiMeta",
+ #{
+ name: "List Chat Completions",
+ group: "chat",
+ path: "list",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/chat/completions \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.chat.completions.list()
+ page = page.data[0]
+ print(page.id)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const chatCompletion of client.chat.completions.list()) {
+ console.log(chatCompletion.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Chat.Completions.List(context.TODO(), openai.ChatCompletionListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.ChatCompletionListPage;
+ import com.openai.models.chat.completions.ChatCompletionListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionListPage page = client.chat().completions().list();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.chat.completions.list
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "model": "gpt-5.4",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {},
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Chat.listChatCompletions, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Chat.createChatCompletion,
+ "x-oaiMeta",
+ #{
+ name: "Create chat completion",
+ group: "chat",
+ path: "create",
+ examples: #[
+ #{
+ title: "Default",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/chat/completions \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "VAR_chat_model_id",
+ "messages": [
+ {
+ "role": "developer",
+ "content": "You are a helpful assistant."
+ },
+ {
+ "role": "user",
+ "content": "Hello!"
+ }
+ ]
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ messages: [{ role: "developer", content: "You are a helpful assistant." }],
+ model: "VAR_chat_model_id",
+ store: true,
+ });
+
+ console.log(completion.choices[0]);
+ }
+
+ main();
+
+ """,
+ csharp: """
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new SystemChatMessage("You are a helpful assistant."),
+ new UserChatMessage("Hello!")
+ ];
+
+ ChatCompletion completion = client.CompleteChat(messages);
+
+ Console.WriteLine(completion.Content[0].Text);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ """,
+ },
+ response: """
+ {
+ "id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT",
+ "object": "chat.completion",
+ "created": 1741569952,
+ "model": "gpt-5.4",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "Hello! How can I assist you today?",
+ "refusal": null,
+ "annotations": []
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 19,
+ "completion_tokens": 10,
+ "total_tokens": 29,
+ "prompt_tokens_details": {
+ "cached_tokens": 0,
+ "audio_tokens": 0
+ },
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "audio_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "service_tier": "default"
+ }
+
+ """,
+ },
+ #{
+ title: "Image input",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/chat/completions \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.4",
+ "messages": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": "What is in this image?"
+ },
+ {
+ "type": "image_url",
+ "image_url": {
+ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
+ }
+ }
+ ]
+ }
+ ],
+ "max_tokens": 300
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const response = await openai.chat.completions.create({
+ model: "gpt-5.4",
+ messages: [
+ {
+ role: "user",
+ content: [
+ { type: "text", text: "What's in this image?" },
+ {
+ type: "image_url",
+ image_url: {
+ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
+ },
+ }
+ ],
+ },
+ ],
+ });
+ console.log(response.choices[0]);
+ }
+ main();
+
+ """,
+ csharp: """
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new UserChatMessage(
+ [
+ ChatMessageContentPart.CreateTextPart("What's in this image?"),
+ ChatMessageContentPart.CreateImagePart(new Uri("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"))
+ ])
+ ];
+
+ ChatCompletion completion = client.CompleteChat(messages);
+
+ Console.WriteLine(completion.Content[0].Text);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ """,
+ },
+ response: """
+ {
+ "id": "chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG",
+ "object": "chat.completion",
+ "created": 1741570283,
+ "model": "gpt-5.4",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.",
+ "refusal": null,
+ "annotations": []
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 1117,
+ "completion_tokens": 46,
+ "total_tokens": 1163,
+ "prompt_tokens_details": {
+ "cached_tokens": 0,
+ "audio_tokens": 0
+ },
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "audio_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "service_tier": "default"
+ }
+
+ """,
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/chat/completions \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "VAR_chat_model_id",
+ "messages": [
+ {
+ "role": "developer",
+ "content": "You are a helpful assistant."
+ },
+ {
+ "role": "user",
+ "content": "Hello!"
+ }
+ ],
+ "stream": true
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ model: "VAR_chat_model_id",
+ messages: [
+ {"role": "developer", "content": "You are a helpful assistant."},
+ {"role": "user", "content": "Hello!"}
+ ],
+ stream: true,
+ });
+
+ for await (const chunk of completion) {
+ console.log(chunk.choices[0].delta.content);
+ }
+ }
+
+ main();
+
+ """,
+ csharp: """
+ using System;
+ using System.ClientModel;
+ using System.Collections.Generic;
+ using System.Threading.Tasks;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new SystemChatMessage("You are a helpful assistant."),
+ new UserChatMessage("Hello!")
+ ];
+
+ AsyncCollectionResult completionUpdates = client.CompleteChatStreamingAsync(messages);
+
+ await foreach (StreamingChatCompletionUpdate completionUpdate in completionUpdates)
+ {
+ if (completionUpdate.ContentUpdate.Count > 0)
+ {
+ Console.Write(completionUpdate.ContentUpdate[0].Text);
+ }
+ }
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ """,
+ },
+ response: """
+ {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
+
+ {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}]}
+
+ ....
+
+ {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
+
+ """,
+ },
+ #{
+ title: "Functions",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/chat/completions \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.4",
+ "messages": [
+ {
+ "role": "user",
+ "content": "What is the weather like in Boston today?"
+ }
+ ],
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "tool_choice": "auto"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ const response = await openai.chat.completions.create({
+ model: "gpt-5.4",
+ messages: messages,
+ tools: tools,
+ tool_choice: "auto",
+ });
+
+ console.log(response);
+ }
+
+ main();
+
+ """,
+ csharp: """
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ChatTool getCurrentWeatherTool = ChatTool.CreateFunctionTool(
+ functionName: "get_current_weather",
+ functionDescription: "Get the current weather in a given location",
+ functionParameters: BinaryData.FromString(\"""
+ {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": [ "celsius", "fahrenheit" ]
+ }
+ },
+ "required": [ "location" ]
+ }
+ \""")
+ );
+
+ List messages =
+ [
+ new UserChatMessage("What's the weather like in Boston today?"),
+ ];
+
+ ChatCompletionOptions options = new()
+ {
+ Tools =
+ {
+ getCurrentWeatherTool
+ },
+ ToolChoice = ChatToolChoice.CreateAutoChoice(),
+ };
+
+ ChatCompletion completion = client.CompleteChat(messages, options);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ """,
+ },
+ response: """
+ {
+ "id": "chatcmpl-abc123",
+ "object": "chat.completion",
+ "created": 1699896916,
+ "model": "gpt-4o-mini",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": null,
+ "tool_calls": [
+ {
+ "id": "call_abc123",
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "arguments": "{
+ "location": "Boston, MA"
+ }"
+ }
+ }
+ ]
+ },
+ "logprobs": null,
+ "finish_reason": "tool_calls"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 82,
+ "completion_tokens": 17,
+ "total_tokens": 99,
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ }
+ }
+
+ """,
+ },
+ #{
+ title: "Logprobs",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/chat/completions \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "VAR_chat_model_id",
+ "messages": [
+ {
+ "role": "user",
+ "content": "Hello!"
+ }
+ ],
+ "logprobs": true,
+ "top_logprobs": 2
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.chat.completions.create(
+ messages=[{
+ "content": "string",
+ "role": "developer",
+ }],
+ model="gpt-5.4",
+ ):
+ print(completion)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ messages: [{ role: "user", content: "Hello!" }],
+ model: "VAR_chat_model_id",
+ logprobs: true,
+ top_logprobs: 2,
+ });
+
+ console.log(completion.choices[0]);
+ }
+
+ main();
+
+ """,
+ csharp: """
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Chat;
+
+ ChatClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List messages =
+ [
+ new UserChatMessage("Hello!")
+ ];
+
+ ChatCompletionOptions options = new()
+ {
+ IncludeLogProbabilities = true,
+ TopLogProbabilityCount = 2
+ };
+
+ ChatCompletion completion = client.CompleteChat(messages, options);
+
+ Console.WriteLine(completion.Content[0].Text);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.create({
+ messages: [{ content: 'string', role: 'developer' }],
+ model: 'gpt-5.4',
+ });
+
+ console.log(chatCompletion);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
+ Messages: []openai.ChatCompletionMessageParamUnion{{
+ OfDeveloper: &openai.ChatCompletionDeveloperMessageParam{
+ Content: openai.ChatCompletionDeveloperMessageParamContentUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ }},
+ Model: shared.ChatModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.ChatModel;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ .addDeveloperMessage("string")
+ .model(ChatModel.GPT_5_4)
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-5.4")
+
+ puts(chat_completion)
+ """,
+ },
+ response: """
+ {
+ "id": "chatcmpl-123",
+ "object": "chat.completion",
+ "created": 1702685778,
+ "model": "gpt-4o-mini",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "Hello! How can I assist you today?"
+ },
+ "logprobs": {
+ "content": [
+ {
+ "token": "Hello",
+ "logprob": -0.31725305,
+ "bytes": [72, 101, 108, 108, 111],
+ "top_logprobs": [
+ {
+ "token": "Hello",
+ "logprob": -0.31725305,
+ "bytes": [72, 101, 108, 108, 111]
+ },
+ {
+ "token": "Hi",
+ "logprob": -1.3190403,
+ "bytes": [72, 105]
+ }
+ ]
+ },
+ {
+ "token": "!",
+ "logprob": -0.02380986,
+ "bytes": [
+ 33
+ ],
+ "top_logprobs": [
+ {
+ "token": "!",
+ "logprob": -0.02380986,
+ "bytes": [33]
+ },
+ {
+ "token": " there",
+ "logprob": -3.787621,
+ "bytes": [32, 116, 104, 101, 114, 101]
+ }
+ ]
+ },
+ {
+ "token": " How",
+ "logprob": -0.000054669687,
+ "bytes": [32, 72, 111, 119],
+ "top_logprobs": [
+ {
+ "token": " How",
+ "logprob": -0.000054669687,
+ "bytes": [32, 72, 111, 119]
+ },
+ {
+ "token": "<|end|>",
+ "logprob": -10.953937,
+ "bytes": null
+ }
+ ]
+ },
+ {
+ "token": " can",
+ "logprob": -0.015801601,
+ "bytes": [32, 99, 97, 110],
+ "top_logprobs": [
+ {
+ "token": " can",
+ "logprob": -0.015801601,
+ "bytes": [32, 99, 97, 110]
+ },
+ {
+ "token": " may",
+ "logprob": -4.161023,
+ "bytes": [32, 109, 97, 121]
+ }
+ ]
+ },
+ {
+ "token": " I",
+ "logprob": -3.7697225e-6,
+ "bytes": [
+ 32,
+ 73
+ ],
+ "top_logprobs": [
+ {
+ "token": " I",
+ "logprob": -3.7697225e-6,
+ "bytes": [32, 73]
+ },
+ {
+ "token": " assist",
+ "logprob": -13.596657,
+ "bytes": [32, 97, 115, 115, 105, 115, 116]
+ }
+ ]
+ },
+ {
+ "token": " assist",
+ "logprob": -0.04571125,
+ "bytes": [32, 97, 115, 115, 105, 115, 116],
+ "top_logprobs": [
+ {
+ "token": " assist",
+ "logprob": -0.04571125,
+ "bytes": [32, 97, 115, 115, 105, 115, 116]
+ },
+ {
+ "token": " help",
+ "logprob": -3.1089056,
+ "bytes": [32, 104, 101, 108, 112]
+ }
+ ]
+ },
+ {
+ "token": " you",
+ "logprob": -5.4385737e-6,
+ "bytes": [32, 121, 111, 117],
+ "top_logprobs": [
+ {
+ "token": " you",
+ "logprob": -5.4385737e-6,
+ "bytes": [32, 121, 111, 117]
+ },
+ {
+ "token": " today",
+ "logprob": -12.807695,
+ "bytes": [32, 116, 111, 100, 97, 121]
+ }
+ ]
+ },
+ {
+ "token": " today",
+ "logprob": -0.0040071653,
+ "bytes": [32, 116, 111, 100, 97, 121],
+ "top_logprobs": [
+ {
+ "token": " today",
+ "logprob": -0.0040071653,
+ "bytes": [32, 116, 111, 100, 97, 121]
+ },
+ {
+ "token": "?",
+ "logprob": -5.5247097,
+ "bytes": [63]
+ }
+ ]
+ },
+ {
+ "token": "?",
+ "logprob": -0.0008108172,
+ "bytes": [63],
+ "top_logprobs": [
+ {
+ "token": "?",
+ "logprob": -0.0008108172,
+ "bytes": [63]
+ },
+ {
+ "token": "?
+ ",
+ "logprob": -7.184561,
+ "bytes": [63, 10]
+ }
+ ]
+ }
+ ]
+ },
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 9,
+ "completion_tokens": 9,
+ "total_tokens": 18,
+ "completion_tokens_details": {
+ "reasoning_tokens": 0,
+ "accepted_prediction_tokens": 0,
+ "rejected_prediction_tokens": 0
+ }
+ },
+ "system_fingerprint": null
+ }
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Chat.deleteChatCompletion,
+ "x-oaiMeta",
+ #{
+ name: "Delete chat completion",
+ group: "chat",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X DELETE https://api.openai.com/v1/chat/completions/chat_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ chat_completion_deleted = client.chat.completions.delete(
+ "completion_id",
+ )
+ print(chat_completion_deleted.id)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletionDeleted = await client.chat.completions.delete('completion_id');
+
+ console.log(chatCompletionDeleted.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletionDeleted, err := client.Chat.Completions.Delete(context.TODO(), "completion_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletionDeleted.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.ChatCompletionDeleteParams;
+ import com.openai.models.chat.completions.ChatCompletionDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionDeleted chatCompletionDeleted = client.chat().completions().delete("completion_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion_deleted = openai.chat.completions.delete("completion_id")
+
+ puts(chat_completion_deleted)
+ """,
+ },
+ response: """
+ {
+ "object": "chat.completion.deleted",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Chat.getChatCompletion,
+ "x-oaiMeta",
+ #{
+ name: "Get chat completion",
+ group: "chat",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/chat/completions/chatcmpl-abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ chat_completion = client.chat.completions.retrieve(
+ "completion_id",
+ )
+ print(chat_completion.id)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.retrieve('completion_id');
+
+ console.log(chatCompletion.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.Get(context.TODO(), "completion_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletion chatCompletion = client.chat().completions().retrieve("completion_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.retrieve("completion_id")
+
+ puts(chat_completion)
+ """,
+ },
+ response: """
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-abc123",
+ "model": "gpt-4o-2024-08-06",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {},
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Chat.updateChatCompletion,
+ "x-oaiMeta",
+ #{
+ name: "Update chat completion",
+ group: "chat",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/chat/completions/chat_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{"metadata": {"foo": "bar"}}'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ chat_completion = client.chat.completions.update(
+ completion_id="completion_id",
+ metadata={
+ "foo": "string"
+ },
+ )
+ print(chat_completion.id)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const chatCompletion = await client.chat.completions.update('completion_id', {
+ metadata: { foo: 'string' },
+ });
+
+ console.log(chatCompletion.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ chatCompletion, err := client.Chat.Completions.Update(
+ context.TODO(),
+ "completion_id",
+ openai.ChatCompletionUpdateParams{
+ Metadata: shared.Metadata{
+ "foo": "string",
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", chatCompletion.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.chat.completions.ChatCompletion;
+ import com.openai.models.chat.completions.ChatCompletionUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ChatCompletionUpdateParams params = ChatCompletionUpdateParams.builder()
+ .completionId("completion_id")
+ .metadata(ChatCompletionUpdateParams.Metadata.builder()
+ .putAdditionalProperty("foo", JsonValue.from("string"))
+ .build())
+ .build();
+ ChatCompletion chatCompletion = client.chat().completions().update(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ chat_completion = openai.chat.completions.update("completion_id", metadata: {foo: "string"})
+
+ puts(chat_completion)
+ """,
+ },
+ response: """
+ {
+ "object": "chat.completion",
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
+ "model": "gpt-4o-2024-08-06",
+ "created": 1738960610,
+ "request_id": "req_ded8ab984ec4bf840f37566c1011c417",
+ "tool_choice": null,
+ "usage": {
+ "total_tokens": 31,
+ "completion_tokens": 18,
+ "prompt_tokens": 13
+ },
+ "seed": 4944116822809979520,
+ "top_p": 1.0,
+ "temperature": 1.0,
+ "presence_penalty": 0.0,
+ "frequency_penalty": 0.0,
+ "system_fingerprint": "fp_50cad350e4",
+ "input_user": null,
+ "service_tier": "default",
+ "tools": null,
+ "metadata": {
+ "foo": "bar"
+ },
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "content": "Mind of circuits hum,
+ Learning patterns in silence—
+ Future's quiet spark.",
+ "role": "assistant",
+ "tool_calls": null,
+ "function_call": null
+ },
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "response_format": null
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Chat.getChatCompletionMessages,
+ "x-oaiMeta",
+ #{
+ name: "Get chat messages",
+ group: "chat",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/chat/completions/chat_abc123/messages \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.chat.completions.messages.list(
+ completion_id="completion_id",
+ )
+ page = page.data[0]
+ print(page)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const chatCompletionStoreMessage of client.chat.completions.messages.list(
+ 'completion_id',
+ )) {
+ console.log(chatCompletionStoreMessage);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Chat.Completions.Messages.List(
+ context.TODO(),
+ "completion_id",
+ openai.ChatCompletionMessageListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.chat.completions.messages.MessageListPage;
+ import com.openai.models.chat.completions.messages.MessageListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageListPage page = client.chat().completions().messages().list("completion_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.chat.completions.messages.list("completion_id")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "role": "user",
+ "content": "write a haiku about ai",
+ "name": null,
+ "content_parts": null
+ }
+ ],
+ "first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2-0",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Chat.getChatCompletionMessages,
+ "x-ms-list",
+ true
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/completions/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/completions/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/completions/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/completions/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/completions/routes.generated.tsp
new file mode 100644
index 000000000000..cdbc5f5feac6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/completions/routes.generated.tsp
@@ -0,0 +1,33 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/completions";
+using TypeSpec.Http;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/completions")
+@tag("Completions")
+interface Completions {
+ /**
+ * Creates a completion from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a completion")
+ @post
+ createCompletion is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateCompletionRequest;
+ },
+ OpenAI.CreateCompletionResponse
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/completions/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/completions/routes.meta.tsp
new file mode 100644
index 000000000000..b6ee65d09676
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/completions/routes.meta.tsp
@@ -0,0 +1,308 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Completions.createCompletion,
+ "x-oaiMeta",
+ #{
+ name: "Create completion",
+ group: "completions",
+ legacy: true,
+ examples: #[
+ #{
+ title: "No streaming",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/completions \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "VAR_completion_model_id",
+ "prompt": "Say this is a test",
+ "max_tokens": 7,
+ "temperature": 0
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.completions.create(
+ model="gpt-3.5-turbo-instruct",
+ prompt="This is a test.",
+ ):
+ print(completion)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const completion = await openai.completions.create({
+ model: "VAR_completion_model_id",
+ prompt: "Say this is a test.",
+ max_tokens: 7,
+ temperature: 0,
+ });
+
+ console.log(completion);
+ }
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const completion = await client.completions.create({
+ model: 'gpt-3.5-turbo-instruct',
+ prompt: 'This is a test.',
+ });
+
+ console.log(completion);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ completion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{
+ Model: openai.CompletionNewParamsModelGPT3_5TurboInstruct,
+ Prompt: openai.CompletionNewParamsPromptUnion{
+ OfString: openai.String("This is a test."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", completion)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.completions.Completion;
+ import com.openai.models.completions.CompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ CompletionCreateParams params = CompletionCreateParams.builder()
+ .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)
+ .prompt("This is a test.")
+ .build();
+ Completion completion = client.completions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ completion = openai.completions.create(model: :"gpt-3.5-turbo-instruct", prompt: "This is a test.")
+
+ puts(completion)
+ """,
+ },
+ response: """
+ {
+ "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
+ "object": "text_completion",
+ "created": 1589478378,
+ "model": "VAR_completion_model_id",
+ "system_fingerprint": "fp_44709d6fcb",
+ "choices": [
+ {
+ "text": "
+
+ This is indeed a test",
+ "index": 0,
+ "logprobs": null,
+ "finish_reason": "length"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 5,
+ "completion_tokens": 7,
+ "total_tokens": 12
+ }
+ }
+
+ """,
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/completions \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "VAR_completion_model_id",
+ "prompt": "Say this is a test",
+ "max_tokens": 7,
+ "temperature": 0,
+ "stream": true
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for completion in client.completions.create(
+ model="gpt-3.5-turbo-instruct",
+ prompt="This is a test.",
+ ):
+ print(completion)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.completions.create({
+ model: "VAR_completion_model_id",
+ prompt: "Say this is a test.",
+ stream: true,
+ });
+
+ for await (const chunk of stream) {
+ console.log(chunk.choices[0].text)
+ }
+ }
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const completion = await client.completions.create({
+ model: 'gpt-3.5-turbo-instruct',
+ prompt: 'This is a test.',
+ });
+
+ console.log(completion);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ completion, err := client.Completions.New(context.TODO(), openai.CompletionNewParams{
+ Model: openai.CompletionNewParamsModelGPT3_5TurboInstruct,
+ Prompt: openai.CompletionNewParamsPromptUnion{
+ OfString: openai.String("This is a test."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", completion)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.completions.Completion;
+ import com.openai.models.completions.CompletionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ CompletionCreateParams params = CompletionCreateParams.builder()
+ .model(CompletionCreateParams.Model.GPT_3_5_TURBO_INSTRUCT)
+ .prompt("This is a test.")
+ .build();
+ Completion completion = client.completions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ completion = openai.completions.create(model: :"gpt-3.5-turbo-instruct", prompt: "This is a test.")
+
+ puts(completion)
+ """,
+ },
+ response: """
+ {
+ "id": "cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe",
+ "object": "text_completion",
+ "created": 1690759702,
+ "choices": [
+ {
+ "text": "This",
+ "index": 0,
+ "logprobs": null,
+ "finish_reason": null
+ }
+ ],
+ "model": "gpt-3.5-turbo-instruct"
+ "system_fingerprint": "fp_44709d6fcb",
+ }
+
+ """,
+ }
+ ],
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/containers/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/containers/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/containers/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/containers/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/containers/routes.generated.tsp
new file mode 100644
index 000000000000..fa30e8da61d6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/containers/routes.generated.tsp
@@ -0,0 +1,305 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/common";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/containers";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/containers")
+@tag("Containers")
+interface Containers {
+ /**
+ * Lists containers matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List containers")
+ @list
+ @get
+ listContainers is OpenAIOperation<
+ {
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+
+ /** Filter results by container name. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ name?: string;
+ },
+ OpenAI.ContainerListResource
+ >;
+
+ /**
+ * Creates a container from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a container")
+ @post
+ createContainer is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateContainerBody;
+ },
+ OpenAI.ContainerResource
+ >;
+
+ /**
+ * Deletes a container by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a container")
+ @route("{container_id}")
+ @delete
+ deleteContainer is OpenAIOperation<
+ {
+ /** The ID of the container to delete. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ container_id: string;
+ },
+ TypeSpec.Http.OkResponse
+ >;
+
+ /**
+ * Retrieves a container by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a container")
+ @route("{container_id}")
+ @get
+ retrieveContainer is OpenAIOperation<
+ {
+ /** The ID of the container. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ container_id: string;
+ },
+ OpenAI.ContainerResource
+ >;
+
+ /**
+ * Lists container files matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List container files")
+ @list
+ @route("{container_id}/files")
+ @get
+ listContainerFiles is OpenAIOperation<
+ {
+ /** The ID of the container. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ container_id: string;
+
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+ },
+ OpenAI.ContainerFileListResource
+ >;
+
+ /**
+ * Creates a container file multipart from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a container file multipart")
+ @sharedRoute
+ @route("{container_id}/files")
+ @post
+ @extension("x-ms-request-body-description-override", "The request body.")
+ createContainerFileMultipart is OpenAIOperation<
+ {
+ /** The ID of the container. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ container_id: string;
+
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateContainerFileBody;
+ },
+ OpenAI.ContainerFileResource
+ >;
+
+ /**
+ * Creates a container file json from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a container file json")
+ @sharedRoute
+ @route("{container_id}/files")
+ @post
+ @extension("x-ms-request-body-description-override", "The request body.")
+ createContainerFileJson is OpenAIOperation<
+ {
+ /** The ID of the container. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ container_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.CreateContainerFileBody;
+ },
+ OpenAI.ContainerFileResource
+ >;
+
+ /**
+ * Deletes a container file by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a container file")
+ @route("{container_id}/files/{file_id}")
+ @delete
+ deleteContainerFile is OpenAIOperation<
+ {
+ /** The ID of the container. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ container_id: string;
+
+ /** The ID of the file. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-description-override", "The ID of the file.")
+ @path
+ file_id: string;
+ },
+ TypeSpec.Http.OkResponse
+ >;
+
+ /**
+ * Retrieves a container file by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a container file")
+ @route("{container_id}/files/{file_id}")
+ @get
+ retrieveContainerFile is OpenAIOperation<
+ {
+ /** The ID of the container. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ container_id: string;
+
+ /** The ID of the file. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-description-override", "The ID of the file.")
+ @path
+ file_id: string;
+ },
+ OpenAI.ContainerFileResource
+ >;
+
+ /**
+ * Retrieves a container file content by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a container file content")
+ @route("{container_id}/files/{file_id}/content")
+ @get
+ retrieveContainerFileContent is OpenAIOperation<
+ {
+ /** The ID of the container. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ container_id: string;
+
+ /** The ID of the file. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-description-override", "The ID of the file.")
+ @path
+ file_id: string;
+ },
+ TypeSpec.Http.OkResponse
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/containers/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/containers/routes.meta.tsp
new file mode 100644
index 000000000000..d413ca9def89
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/containers/routes.meta.tsp
@@ -0,0 +1,1142 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Containers.listContainers,
+ "x-oaiMeta",
+ #{
+ name: "List containers",
+ group: "containers",
+ path: "get",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/containers \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const containerListResponse of client.containers.list()) {
+ console.log(containerListResponse.id);
+ }
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.containers.list()
+ page = page.data[0]
+ print(page.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Containers.List(context.TODO(), openai.ContainerListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerListPage;
+ import com.openai.models.containers.ContainerListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContainerListPage page = client.containers().list();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.containers.list
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container",
+ "created_at": 1747844794,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747844794,
+ "memory_limit": "4g",
+ "name": "My Container"
+ }
+ ],
+ "first_id": "container_123",
+ "last_id": "container_123",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Containers.listContainers, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Containers.createContainer,
+ "x-oaiMeta",
+ #{
+ name: "Create container",
+ group: "containers",
+ path: "post",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/containers \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{
+ "name": "My Container",
+ "memory_limit": "4g",
+ "skills": [
+ {
+ "type": "skill_reference",
+ "skill_id": "skill_4db6f1a2c9e73508b41f9da06e2c7b5f"
+ },
+ {
+ "type": "skill_reference",
+ "skill_id": "openai-spreadsheets",
+ "version": "latest"
+ }
+ ],
+ "network_policy": {
+ "type": "allowlist",
+ "allowed_domains": ["api.buildkite.com"]
+ }
+ }'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const container = await client.containers.create({ name: 'name' });
+
+ console.log(container.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ container = client.containers.create(
+ name="name",
+ )
+ print(container.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ container, err := client.Containers.New(context.TODO(), openai.ContainerNewParams{
+ Name: "name",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", container.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerCreateParams;
+ import com.openai.models.containers.ContainerCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContainerCreateParams params = ContainerCreateParams.builder()
+ .name("name")
+ .build();
+ ContainerCreateResponse container = client.containers().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ container = openai.containers.create(name: "name")
+
+ puts(container)
+ """,
+ },
+ response: """
+ {
+ "id": "cntr_682e30645a488191b6363a0cbefc0f0a025ec61b66250591",
+ "object": "container",
+ "created_at": 1747857508,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747857508,
+ "network_policy": {
+ "type": "allowlist",
+ "allowed_domains": ["api.buildkite.com"]
+ },
+ "memory_limit": "4g",
+ "name": "My Container"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Containers.deleteContainer,
+ "x-oaiMeta",
+ #{
+ name: "Delete a container",
+ group: "containers",
+ path: "delete",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ await client.containers.delete('container_id');
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ client.containers.delete(
+ "container_id",
+ )
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ err := client.Containers.Delete(context.TODO(), "container_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ client.containers().delete("container_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ result = openai.containers.delete("container_id")
+
+ puts(result)
+ """,
+ },
+ response: """
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container.deleted",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Containers.retrieveContainer,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve container",
+ group: "containers",
+ path: "get",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const container = await client.containers.retrieve('container_id');
+
+ console.log(container.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ container = client.containers.retrieve(
+ "container_id",
+ )
+ print(container.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ container, err := client.Containers.Get(context.TODO(), "container_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", container.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.ContainerRetrieveParams;
+ import com.openai.models.containers.ContainerRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContainerRetrieveResponse container = client.containers().retrieve("container_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ container = openai.containers.retrieve("container_id")
+
+ puts(container)
+ """,
+ },
+ response: """
+ {
+ "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863",
+ "object": "container",
+ "created_at": 1747844794,
+ "status": "running",
+ "expires_after": {
+ "anchor": "last_active_at",
+ "minutes": 20
+ },
+ "last_active_at": 1747844794,
+ "memory_limit": "4g",
+ "name": "My Container"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Containers.listContainerFiles,
+ "x-oaiMeta",
+ #{
+ name: "List container files",
+ group: "containers",
+ path: "get",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fileListResponse of client.containers.files.list('container_id')) {
+ console.log(fileListResponse.id);
+ }
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.containers.files.list(
+ container_id="container_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Containers.Files.List(
+ context.TODO(),
+ "container_id",
+ openai.ContainerFileListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileListPage;
+ import com.openai.models.containers.files.FileListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileListPage page = client.containers().files().list("container_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.containers.files.list("container_id")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+ ],
+ "first_id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "has_more": false,
+ "last_id": "cfile_682e0e8a43c88191a7978f477a09bdf5"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Containers.listContainerFiles, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Containers.createContainerFileMultipart,
+ "x-oaiMeta",
+ #{
+ name: "Create container file",
+ group: "containers",
+ path: "post",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F file="@example.txt"
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const file = await client.containers.files.create('container_id');
+
+ console.log(file.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file = client.containers.files.create(
+ container_id="container_id",
+ )
+ print(file.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ file, err := client.Containers.Files.New(
+ context.TODO(),
+ "container_id",
+ openai.ContainerFileNewParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", file.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileCreateParams;
+ import com.openai.models.containers.files.FileCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateResponse file = client.containers().files().create("container_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file = openai.containers.files.create("container_id")
+
+ puts(file)
+ """,
+ },
+ response: """
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Containers.createContainerFileJson,
+ "x-oaiMeta",
+ #{
+ name: "Create container file",
+ group: "containers",
+ path: "post",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/containers/cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04/files \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F file="@example.txt"
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const file = await client.containers.files.create('container_id');
+
+ console.log(file.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file = client.containers.files.create(
+ container_id="container_id",
+ )
+ print(file.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ file, err := client.Containers.Files.New(
+ context.TODO(),
+ "container_id",
+ openai.ContainerFileNewParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", file.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileCreateParams;
+ import com.openai.models.containers.files.FileCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateResponse file = client.containers().files().create("container_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file = openai.containers.files.create("container_id")
+
+ puts(file)
+ """,
+ },
+ response: """
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Containers.deleteContainerFile,
+ "x-oaiMeta",
+ #{
+ name: "Delete a container file",
+ group: "containers",
+ path: "delete",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X DELETE https://api.openai.com/v1/containers/cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863/files/cfile_682e0e8a43c88191a7978f477a09bdf5 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ await client.containers.files.delete('file_id', { container_id: 'container_id' });
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ client.containers.files.delete(
+ file_id="file_id",
+ container_id="container_id",
+ )
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ err := client.Containers.Files.Delete(
+ context.TODO(),
+ "container_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileDeleteParams params = FileDeleteParams.builder()
+ .containerId("container_id")
+ .fileId("file_id")
+ .build();
+ client.containers().files().delete(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ result = openai.containers.files.delete("file_id", container_id: "container_id")
+
+ puts(result)
+ """,
+ },
+ response: """
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file.deleted",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Containers.retrieveContainerFile,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve container file",
+ group: "containers",
+ path: "get",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/containers/container_123/files/file_456 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const file = await client.containers.files.retrieve('file_id', { container_id: 'container_id' });
+
+ console.log(file.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file = client.containers.files.retrieve(
+ file_id="file_id",
+ container_id="container_id",
+ )
+ print(file.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ file, err := client.Containers.Files.Get(
+ context.TODO(),
+ "container_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", file.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.containers.files.FileRetrieveParams;
+ import com.openai.models.containers.files.FileRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileRetrieveParams params = FileRetrieveParams.builder()
+ .containerId("container_id")
+ .fileId("file_id")
+ .build();
+ FileRetrieveResponse file = client.containers().files().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file = openai.containers.files.retrieve("file_id", container_id: "container_id")
+
+ puts(file)
+ """,
+ },
+ response: """
+ {
+ "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
+ "object": "container.file",
+ "created_at": 1747848842,
+ "bytes": 880,
+ "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04",
+ "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json",
+ "source": "user"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Containers.retrieveContainerFileContent,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve container file content",
+ group: "containers",
+ path: "get",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/containers/container_123/files/cfile_456/content \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const content = await client.containers.files.content.retrieve('file_id', {
+ container_id: 'container_id',
+ });
+
+ console.log(content);
+
+ const data = await content.blob();
+ console.log(data);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ content = client.containers.files.content.retrieve(
+ file_id="file_id",
+ container_id="container_id",
+ )
+ print(content)
+ data = content.read()
+ print(data)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ content, err := client.Containers.Files.Content.Get(
+ context.TODO(),
+ "container_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", content)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.containers.files.content.ContentRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ContentRetrieveParams params = ContentRetrieveParams.builder()
+ .containerId("container_id")
+ .fileId("file_id")
+ .build();
+ HttpResponse content = client.containers().files().content().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ content = openai.containers.files.content.retrieve("file_id", container_id: "container_id")
+
+ puts(content)
+ """,
+ },
+ response: """
+
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/main.tsp
new file mode 100644
index 000000000000..7137b739be19
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/main.tsp
@@ -0,0 +1,3 @@
+import "./models.tsp";
+import "./routes.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai-conversations/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/models.tsp
similarity index 84%
rename from specification/ai-foundry/data-plane/Foundry/src/openai-conversations/models.tsp
rename to specification/ai-foundry/data-plane/Foundry/src/openai/conversations/models.tsp
index 0990e4f39e5d..8110e8708a36 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/openai-conversations/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/models.tsp
@@ -1,4 +1,4 @@
-import "../openai-responses/models.tsp";
+import "../responses/models.tsp";
using TypeSpec.Http;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/routes.generated.tsp
new file mode 100644
index 000000000000..3eaeeccdff9e
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/routes.generated.tsp
@@ -0,0 +1,18 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/openai-templates.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/common";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/conversations";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/conversations")
+@tag("Conversations")
+interface ConversationsGenerated {}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/routes.meta.tsp
new file mode 100644
index 000000000000..eca662d6f8f2
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/routes.meta.tsp
@@ -0,0 +1,1237 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Conversations.listConversationItems,
+ "x-oaiMeta",
+ #{
+ name: "List items",
+ group: "conversations",
+ path: "list-items",
+ examples: #{
+ request: #{
+ curl: """
+ curl "https://api.openai.com/v1/conversations/conv_123/items?limit=10" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const items = await client.conversations.items.list("conv_123", { limit: 10 });
+ console.log(items.data);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.conversations.items.list(
+ conversation_id="conv_123",
+ )
+ page = page.data[0]
+ print(page)
+ """,
+ csharp: """
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ConversationItemList items = client.ConversationItems.List(
+ conversationId: "conv_123",
+ new ListConversationItemsOptions { Limit = 10 }
+ );
+ Console.WriteLine(items.Data.Count);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const conversationItem of client.conversations.items.list('conv_123')) {
+ console.log(conversationItem);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Conversations.Items.List(
+ context.TODO(),
+ "conv_123",
+ conversations.ItemListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.items.ItemListPage;
+ import com.openai.models.conversations.items.ItemListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemListPage page = client.conversations().items().list("conv_123");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.conversations.items.list("conv_123")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "type": "message",
+ "id": "msg_abc",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ }
+ ],
+ "first_id": "msg_abc",
+ "last_id": "msg_abc",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Conversations.listConversationItems,
+ "x-ms-list",
+ true
+);
+
+@@extension(
+ Azure.AI.Projects.Conversations.createConversationItems,
+ "x-oaiMeta",
+ #{
+ name: "Create items",
+ group: "conversations",
+ path: "create-item",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/conversations/conv_123/items \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "items": [
+ {
+ "type": "message",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "How are you?"}
+ ]
+ }
+ ]
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const items = await client.conversations.items.create(
+ "conv_123",
+ {
+ items: [
+ {
+ type: "message",
+ role: "user",
+ content: [{ type: "input_text", text: "Hello!" }],
+ },
+ {
+ type: "message",
+ role: "user",
+ content: [{ type: "input_text", text: "How are you?" }],
+ },
+ ],
+ }
+ );
+ console.log(items.data);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation_item_list = client.conversations.items.create(
+ conversation_id="conv_123",
+ items=[{
+ "content": "string",
+ "role": "user",
+ "type": "message",
+ }],
+ )
+ print(conversation_item_list.first_id)
+ """,
+ csharp: """
+ using System;
+ using System.Collections.Generic;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ConversationItemList created = client.ConversationItems.Create(
+ conversationId: "conv_123",
+ new CreateConversationItemsOptions
+ {
+ Items = new List
+ {
+ new ConversationMessage
+ {
+ Role = "user",
+ Content =
+ {
+ new ConversationInputText { Text = "Hello!" }
+ }
+ },
+ new ConversationMessage
+ {
+ Role = "user",
+ Content =
+ {
+ new ConversationInputText { Text = "How are you?" }
+ }
+ }
+ }
+ }
+ );
+ Console.WriteLine(created.Data.Count);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversationItemList = await client.conversations.items.create('conv_123', {
+ items: [
+ {
+ content: 'string',
+ role: 'user',
+ type: 'message',
+ },
+ ],
+ });
+
+ console.log(conversationItemList.first_id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversationItemList, err := client.Conversations.Items.New(
+ context.TODO(),
+ "conv_123",
+ conversations.ItemNewParams{
+ Items: []responses.ResponseInputItemUnionParam{{
+ OfMessage: &responses.EasyInputMessageParam{
+ Content: responses.EasyInputMessageContentUnionParam{
+ OfString: openai.String("string"),
+ },
+ Role: responses.EasyInputMessageRoleUser,
+ Type: responses.EasyInputMessageTypeMessage,
+ },
+ }},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversationItemList.FirstID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.items.ConversationItemList;
+ import com.openai.models.conversations.items.ItemCreateParams;
+ import com.openai.models.responses.EasyInputMessage;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemCreateParams params = ItemCreateParams.builder()
+ .conversationId("conv_123")
+ .addItem(EasyInputMessage.builder()
+ .content("string")
+ .role(EasyInputMessage.Role.USER)
+ .type(EasyInputMessage.Type.MESSAGE)
+ .build())
+ .build();
+ ConversationItemList conversationItemList = client.conversations().items().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation_item_list = openai.conversations.items.create("conv_123", items: [{content: "string", role: :user, type: :message}])
+
+ puts(conversation_item_list)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "type": "message",
+ "id": "msg_abc",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ },
+ {
+ "type": "message",
+ "id": "msg_def",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "How are you?"}
+ ]
+ }
+ ],
+ "first_id": "msg_abc",
+ "last_id": "msg_def",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Conversations.deleteConversationItem,
+ "x-oaiMeta",
+ #{
+ name: "Delete an item",
+ group: "conversations",
+ path: "delete-item",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X DELETE https://api.openai.com/v1/conversations/conv_123/items/msg_abc \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const conversation = await client.conversations.items.delete(
+ "conv_123",
+ "msg_abc"
+ );
+ console.log(conversation);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.items.delete(
+ item_id="msg_abc",
+ conversation_id="conv_123",
+ )
+ print(conversation.id)
+ """,
+ csharp: """
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation conversation = client.ConversationItems.Delete(
+ conversationId: "conv_123",
+ itemId: "msg_abc"
+ );
+ Console.WriteLine(conversation.Id);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.items.delete('msg_abc', {
+ conversation_id: 'conv_123',
+ });
+
+ console.log(conversation.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.Items.Delete(
+ context.TODO(),
+ "conv_123",
+ "msg_abc",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.items.ItemDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemDeleteParams params = ItemDeleteParams.builder()
+ .conversationId("conv_123")
+ .itemId("msg_abc")
+ .build();
+ Conversation conversation = client.conversations().items().delete(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.items.delete("msg_abc", conversation_id: "conv_123")
+
+ puts(conversation)
+ """,
+ },
+ response: """
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "demo"}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Conversations.getConversationItem,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve an item",
+ group: "conversations",
+ path: "get-item",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/conversations/conv_123/items/msg_abc \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const item = await client.conversations.items.retrieve(
+ "conv_123",
+ "msg_abc"
+ );
+ console.log(item);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation_item = client.conversations.items.retrieve(
+ item_id="msg_abc",
+ conversation_id="conv_123",
+ )
+ print(conversation_item)
+ """,
+ csharp: """
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ConversationItem item = client.ConversationItems.Get(
+ conversationId: "conv_123",
+ itemId: "msg_abc"
+ );
+ Console.WriteLine(item.Id);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversationItem = await client.conversations.items.retrieve('msg_abc', {
+ conversation_id: 'conv_123',
+ });
+
+ console.log(conversationItem);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversationItem, err := client.Conversations.Items.Get(
+ context.TODO(),
+ "conv_123",
+ "msg_abc",
+ conversations.ItemGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversationItem)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.items.ConversationItem;
+ import com.openai.models.conversations.items.ItemRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ItemRetrieveParams params = ItemRetrieveParams.builder()
+ .conversationId("conv_123")
+ .itemId("msg_abc")
+ .build();
+ ConversationItem conversationItem = client.conversations().items().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation_item = openai.conversations.items.retrieve("msg_abc", conversation_id: "conv_123")
+
+ puts(conversation_item)
+ """,
+ },
+ response: """
+ {
+ "type": "message",
+ "id": "msg_abc",
+ "status": "completed",
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "Hello!"}
+ ]
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Conversations.createConversation,
+ "x-oaiMeta",
+ #{
+ name: "Create a conversation",
+ group: "conversations",
+ path: "create",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/conversations \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "metadata": {"topic": "demo"},
+ "items": [
+ {
+ "type": "message",
+ "role": "user",
+ "content": "Hello!"
+ }
+ ]
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const conversation = await client.conversations.create({
+ metadata: { topic: "demo" },
+ items: [
+ { type: "message", role: "user", content: "Hello!" }
+ ],
+ });
+ console.log(conversation);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.create()
+ print(conversation.id)
+ """,
+ csharp: """
+ using System;
+ using System.Collections.Generic;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation conversation = client.CreateConversation(
+ new CreateConversationOptions
+ {
+ Metadata = new Dictionary
+ {
+ { "topic", "demo" }
+ },
+ Items =
+ {
+ new ConversationMessageInput
+ {
+ Role = "user",
+ Content = "Hello!",
+ }
+ }
+ }
+ );
+ Console.WriteLine(conversation.Id);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.create();
+
+ console.log(conversation.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.New(context.TODO(), conversations.ConversationNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.ConversationCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Conversation conversation = client.conversations().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.create
+
+ puts(conversation)
+ """,
+ },
+ response: """
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "demo"}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Conversations.deleteConversation,
+ "x-oaiMeta",
+ #{
+ name: "Delete a conversation",
+ group: "conversations",
+ path: "delete",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X DELETE https://api.openai.com/v1/conversations/conv_123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const deleted = await client.conversations.delete("conv_123");
+ console.log(deleted);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation_deleted_resource = client.conversations.delete(
+ "conv_123",
+ )
+ print(conversation_deleted_resource.id)
+ """,
+ csharp: """
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ DeletedConversation deleted = client.DeleteConversation("conv_123");
+ Console.WriteLine(deleted.Id);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversationDeletedResource = await client.conversations.delete('conv_123');
+
+ console.log(conversationDeletedResource.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversationDeletedResource, err := client.Conversations.Delete(context.TODO(), "conv_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversationDeletedResource.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.ConversationDeleteParams;
+ import com.openai.models.conversations.ConversationDeletedResource;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ConversationDeletedResource conversationDeletedResource = client.conversations().delete("conv_123");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation_deleted_resource = openai.conversations.delete("conv_123")
+
+ puts(conversation_deleted_resource)
+ """,
+ },
+ response: """
+ {
+ "id": "conv_123",
+ "object": "conversation.deleted",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Conversations.getConversation,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve a conversation",
+ group: "conversations",
+ path: "retrieve",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/conversations/conv_123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const conversation = await client.conversations.retrieve("conv_123");
+ console.log(conversation);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.retrieve(
+ "conv_123",
+ )
+ print(conversation.id)
+ """,
+ csharp: """
+ using System;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation conversation = client.GetConversation("conv_123");
+ Console.WriteLine(conversation.Id);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.retrieve('conv_123');
+
+ console.log(conversation.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.Get(context.TODO(), "conv_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.ConversationRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Conversation conversation = client.conversations().retrieve("conv_123");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.retrieve("conv_123")
+
+ puts(conversation)
+ """,
+ },
+ response: """
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "demo"}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Conversations.updateConversation,
+ "x-oaiMeta",
+ #{
+ name: "Update a conversation",
+ group: "conversations",
+ path: "update",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/conversations/conv_123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "metadata": {"topic": "project-x"}
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const updated = await client.conversations.update(
+ "conv_123",
+ { metadata: { topic: "project-x" } }
+ );
+ console.log(updated);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ conversation = client.conversations.update(
+ conversation_id="conv_123",
+ metadata={
+ "foo": "string"
+ },
+ )
+ print(conversation.id)
+ """,
+ csharp: """
+ using System;
+ using System.Collections.Generic;
+ using OpenAI.Conversations;
+
+ OpenAIConversationClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ Conversation updated = client.UpdateConversation(
+ conversationId: "conv_123",
+ new UpdateConversationOptions
+ {
+ Metadata = new Dictionary
+ {
+ { "topic", "project-x" }
+ }
+ }
+ );
+ Console.WriteLine(updated.Id);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const conversation = await client.conversations.update('conv_123', { metadata: { foo: 'string' } });
+
+ console.log(conversation.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/conversations"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/shared"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ conversation, err := client.Conversations.Update(
+ context.TODO(),
+ "conv_123",
+ conversations.ConversationUpdateParams{
+ Metadata: shared.Metadata{
+ "foo": "string",
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", conversation.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.conversations.Conversation;
+ import com.openai.models.conversations.ConversationUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ConversationUpdateParams params = ConversationUpdateParams.builder()
+ .conversationId("conv_123")
+ .metadata(ConversationUpdateParams.Metadata.builder()
+ .putAdditionalProperty("foo", JsonValue.from("string"))
+ .build())
+ .build();
+ Conversation conversation = client.conversations().update(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ conversation = openai.conversations.update("conv_123", metadata: {foo: "string"})
+
+ puts(conversation)
+ """,
+ },
+ response: """
+ {
+ "id": "conv_123",
+ "object": "conversation",
+ "created_at": 1741900000,
+ "metadata": {"topic": "project-x"}
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai-conversations/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/routes.tsp
similarity index 98%
rename from specification/ai-foundry/data-plane/Foundry/src/openai-conversations/routes.tsp
rename to specification/ai-foundry/data-plane/Foundry/src/openai/conversations/routes.tsp
index d7231b129d08..bfc67114fd13 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/openai-conversations/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/conversations/routes.tsp
@@ -1,6 +1,6 @@
import "./models.tsp";
-import "../common/models.tsp";
-import "../openai-responses/models.tsp";
+import "../../common/models.tsp";
+import "../responses/models.tsp";
using TypeSpec.Http;
using TypeSpec.OpenAPI;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/embeddings/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/embeddings/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/embeddings/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/embeddings/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/embeddings/routes.generated.tsp
new file mode 100644
index 000000000000..21aeae613eca
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/embeddings/routes.generated.tsp
@@ -0,0 +1,33 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/embeddings";
+using TypeSpec.Http;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/embeddings")
+@tag("Embeddings")
+interface Embeddings {
+ /**
+ * Creates an embedding from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create an embedding")
+ @post
+ createEmbedding is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateEmbeddingRequest;
+ },
+ OpenAI.CreateEmbeddingResponse
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/embeddings/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/embeddings/routes.meta.tsp
new file mode 100644
index 000000000000..624a9ba38b5c
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/embeddings/routes.meta.tsp
@@ -0,0 +1,184 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Embeddings.createEmbedding,
+ "x-oaiMeta",
+ #{
+ name: "Create embeddings",
+ group: "embeddings",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/embeddings \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{
+ "input": "The food was delicious and the waiter...",
+ "model": "text-embedding-ada-002",
+ "encoding_format": "float"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ create_embedding_response = client.embeddings.create(
+ input="The quick brown fox jumped over the lazy dog",
+ model="text-embedding-3-small",
+ )
+ print(create_embedding_response.data)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const embedding = await openai.embeddings.create({
+ model: "text-embedding-ada-002",
+ input: "The quick brown fox jumped over the lazy dog",
+ encoding_format: "float",
+ });
+
+ console.log(embedding);
+ }
+
+ main();
+
+ """,
+ csharp: """
+ using System;
+
+ using OpenAI.Embeddings;
+
+ EmbeddingClient client = new(
+ model: "text-embedding-3-small",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ OpenAIEmbedding embedding = client.GenerateEmbedding(input: "The quick brown fox jumped over the lazy dog");
+ ReadOnlyMemory vector = embedding.ToFloats();
+
+ for (int i = 0; i < vector.Length; i++)
+ {
+ Console.WriteLine($" [{i,4}] = {vector.Span[i]}");
+ }
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const createEmbeddingResponse = await client.embeddings.create({
+ input: 'The quick brown fox jumped over the lazy dog',
+ model: 'text-embedding-3-small',
+ });
+
+ console.log(createEmbeddingResponse.data);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ createEmbeddingResponse, err := client.Embeddings.New(context.TODO(), openai.EmbeddingNewParams{
+ Input: openai.EmbeddingNewParamsInputUnion{
+ OfString: openai.String("The quick brown fox jumped over the lazy dog"),
+ },
+ Model: openai.EmbeddingModelTextEmbedding3Small,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", createEmbeddingResponse.Data)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.embeddings.CreateEmbeddingResponse;
+ import com.openai.models.embeddings.EmbeddingCreateParams;
+ import com.openai.models.embeddings.EmbeddingModel;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EmbeddingCreateParams params = EmbeddingCreateParams.builder()
+ .input("The quick brown fox jumped over the lazy dog")
+ .model(EmbeddingModel.TEXT_EMBEDDING_3_SMALL)
+ .build();
+ CreateEmbeddingResponse createEmbeddingResponse = client.embeddings().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ create_embedding_response = openai.embeddings.create(
+ input: "The quick brown fox jumped over the lazy dog",
+ model: :"text-embedding-3-small"
+ )
+
+ puts(create_embedding_response)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "embedding",
+ "embedding": [
+ 0.0023064255,
+ -0.009327292,
+ .... (1536 floats total for ada-002)
+ -0.0028842222,
+ ],
+ "index": 0
+ }
+ ],
+ "model": "text-embedding-ada-002",
+ "usage": {
+ "prompt_tokens": 8,
+ "total_tokens": 8
+ }
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/main.tsp
new file mode 100644
index 000000000000..7137b739be19
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/main.tsp
@@ -0,0 +1,3 @@
+import "./models.tsp";
+import "./routes.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai-evaluations/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/models.tsp
similarity index 99%
rename from specification/ai-foundry/data-plane/Foundry/src/openai-evaluations/models.tsp
rename to specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/models.tsp
index 72e48e29417e..53fe59539f51 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/openai-evaluations/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/models.tsp
@@ -1,5 +1,5 @@
-import "../common/models.tsp";
-import "../red-teams/models.tsp";
+import "../../common/models.tsp";
+import "../../red-teams/models.tsp";
using Azure.Core.Experimental;
using TypeSpec.Versioning;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/routes.generated.tsp
new file mode 100644
index 000000000000..930f3549903e
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/routes.generated.tsp
@@ -0,0 +1,18 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/common";
+import "@azure-tools/openai-typespec/models/evals";
+using TypeSpec.Http;
+using TypeSpec.OpenAPI;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/evals")
+@tag("Evals")
+interface EvalsGenerated {}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/routes.meta.tsp
new file mode 100644
index 000000000000..1246fe107bef
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/routes.meta.tsp
@@ -0,0 +1,2119 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Evals.listEvals,
+ "x-oaiMeta",
+ #{
+ name: "List evals",
+ group: "evals",
+ path: "list",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals?limit=1 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.evals.list()
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const evals = await openai.evals.list({ limit: 1 });
+ console.log(evals);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const evalListResponse of client.evals.list()) {
+ console.log(evalListResponse.id);
+ }
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalListPage;
+ import com.openai.models.evals.EvalListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalListPage page = client.evals().list();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.evals.list
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "object": "eval",
+ "data_source_config": {
+ "type": "stored_completions",
+ "metadata": {
+ "usecase": "push_notifications_summarizer"
+ },
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object"
+ },
+ "sample": {
+ "type": "object"
+ }
+ },
+ "required": [
+ "item",
+ "sample"
+ ]
+ }
+ },
+ "testing_criteria": [
+ {
+ "name": "Push Notification Summary Grader",
+ "id": "Push Notification Summary Grader-9b876f24-4762-4be9-aff4-db7a9b31c673",
+ "type": "label_model",
+ "model": "o3-mini",
+ "input": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "
+ Label the following push notification summary as either correct or incorrect.
+ The push notification and the summary will be provided below.
+ A good push notificiation summary is concise and snappy.
+ If it is good, then label it as correct, if not, then incorrect.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "
+ Push notifications: {{item.input}}
+ Summary: {{sample.output_text}}
+ "
+ }
+ }
+ ],
+ "passing_labels": [
+ "correct"
+ ],
+ "labels": [
+ "correct",
+ "incorrect"
+ ],
+ "sampling_params": null
+ }
+ ],
+ "name": "Push Notification Summary Grader",
+ "created_at": 1739314509,
+ "metadata": {
+ "description": "A stored completions eval for push notification summaries"
+ }
+ }
+ ],
+ "first_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "last_id": "eval_67aa884cf6688190b58f657d4441c8b7",
+ "has_more": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Evals.listEvals, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Evals.createEval,
+ "x-oaiMeta",
+ #{
+ name: "Create eval",
+ group: "evals",
+ path: "post",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{
+ "name": "Sentiment",
+ "data_source_config": {
+ "type": "stored_completions",
+ "metadata": {
+ "usecase": "chatbot"
+ }
+ },
+ "testing_criteria": [
+ {
+ "type": "label_model",
+ "model": "o3-mini",
+ "input": [
+ {
+ "role": "developer",
+ "content": "Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'"
+ },
+ {
+ "role": "user",
+ "content": "Statement: {{item.input}}"
+ }
+ ],
+ "passing_labels": [
+ "positive"
+ ],
+ "labels": [
+ "positive",
+ "neutral",
+ "negative"
+ ],
+ "name": "Example label grader"
+ }
+ ]
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.create(
+ data_source_config={
+ "item_schema": {
+ "foo": "bar"
+ },
+ "type": "custom",
+ },
+ testing_criteria=[{
+ "input": [{
+ "content": "content",
+ "role": "role",
+ }],
+ "labels": ["string"],
+ "model": "model",
+ "name": "name",
+ "passing_labels": ["string"],
+ "type": "label_model",
+ }],
+ )
+ print(eval.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const evalObj = await openai.evals.create({
+ name: "Sentiment",
+ data_source_config: {
+ type: "stored_completions",
+ metadata: { usecase: "chatbot" }
+ },
+ testing_criteria: [
+ {
+ type: "label_model",
+ model: "o3-mini",
+ input: [
+ { role: "developer", content: "Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'" },
+ { role: "user", content: "Statement: {{item.input}}" }
+ ],
+ passing_labels: ["positive"],
+ labels: ["positive", "neutral", "negative"],
+ name: "Example label grader"
+ }
+ ]
+ });
+ console.log(evalObj);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.create({
+ data_source_config: {
+ item_schema: { foo: 'bar' },
+ type: 'custom',
+ },
+ testing_criteria: [
+ {
+ input: [{ content: 'content', role: 'role' }],
+ labels: ['string'],
+ model: 'model',
+ name: 'name',
+ passing_labels: ['string'],
+ type: 'label_model',
+ },
+ ],
+ });
+
+ console.log(_eval.id);
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.evals.EvalCreateParams;
+ import com.openai.models.evals.EvalCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalCreateParams params = EvalCreateParams.builder()
+ .customDataSourceConfig(EvalCreateParams.DataSourceConfig.Custom.ItemSchema.builder()
+ .putAdditionalProperty("foo", JsonValue.from("bar"))
+ .build())
+ .addTestingCriterion(EvalCreateParams.TestingCriterion.LabelModel.builder()
+ .addInput(EvalCreateParams.TestingCriterion.LabelModel.Input.SimpleInputMessage.builder()
+ .content("content")
+ .role("role")
+ .build())
+ .addLabel("string")
+ .model("model")
+ .name("name")
+ .addPassingLabel("string")
+ .build())
+ .build();
+ EvalCreateResponse eval = client.evals().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.create(
+ data_source_config: {item_schema: {foo: "bar"}, type: :custom},
+ testing_criteria: [
+ {
+ input: [{content: "content", role: "role"}],
+ labels: ["string"],
+ model: "model",
+ name: "name",
+ passing_labels: ["string"],
+ type: :label_model
+ }
+ ]
+ )
+
+ puts(eval_)
+ """,
+ },
+ response: """
+ {
+ "object": "eval",
+ "id": "eval_67b7fa9a81a88190ab4aa417e397ea21",
+ "data_source_config": {
+ "type": "stored_completions",
+ "metadata": {
+ "usecase": "chatbot"
+ },
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object"
+ },
+ "sample": {
+ "type": "object"
+ }
+ },
+ "required": [
+ "item",
+ "sample"
+ ]
+ },
+ "testing_criteria": [
+ {
+ "name": "Example label grader",
+ "type": "label_model",
+ "model": "o3-mini",
+ "input": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Classify the sentiment of the following statement as one of positive, neutral, or negative"
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "Statement: {{item.input}}"
+ }
+ }
+ ],
+ "passing_labels": [
+ "positive"
+ ],
+ "labels": [
+ "positive",
+ "neutral",
+ "negative"
+ ]
+ }
+ ],
+ "name": "Sentiment",
+ "created_at": 1740110490,
+ "metadata": {
+ "description": "An eval for sentiment analysis"
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Evals.deleteEval,
+ "x-oaiMeta",
+ #{
+ name: "Delete an eval",
+ group: "evals",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals/eval_abc123 \\
+ -X DELETE \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.delete(
+ "eval_id",
+ )
+ print(eval.eval_id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const deleted = await openai.evals.delete("eval_abc123");
+ console.log(deleted);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.delete('eval_id');
+
+ console.log(_eval.eval_id);
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalDeleteParams;
+ import com.openai.models.evals.EvalDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalDeleteResponse eval = client.evals().delete("eval_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.delete("eval_id")
+
+ puts(eval_)
+ """,
+ },
+ response: """
+ {
+ "object": "eval.deleted",
+ "deleted": true,
+ "eval_id": "eval_abc123"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Evals.getEval,
+ "x-oaiMeta",
+ #{
+ name: "Get an eval",
+ group: "evals",
+ path: "get",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.retrieve(
+ "eval_id",
+ )
+ print(eval.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const evalObj = await openai.evals.retrieve("eval_67abd54d9b0081909a86353f6fb9317a");
+ console.log(evalObj);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.retrieve('eval_id');
+
+ console.log(_eval.id);
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalRetrieveParams;
+ import com.openai.models.evals.EvalRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalRetrieveResponse eval = client.evals().retrieve("eval_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.retrieve("eval_id")
+
+ puts(eval_)
+ """,
+ },
+ response: """
+ {
+ "object": "eval",
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "data_source_config": {
+ "type": "custom",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "type": "string"
+ },
+ "ground_truth": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "input",
+ "ground_truth"
+ ]
+ }
+ },
+ "required": [
+ "item"
+ ]
+ }
+ },
+ "testing_criteria": [
+ {
+ "name": "String check",
+ "id": "String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2",
+ "type": "string_check",
+ "input": "{{item.input}}",
+ "reference": "{{item.ground_truth}}",
+ "operation": "eq"
+ }
+ ],
+ "name": "External Data Eval",
+ "created_at": 1739314509,
+ "metadata": {},
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Evals.updateEval,
+ "x-oaiMeta",
+ #{
+ name: "Update an eval",
+ group: "evals",
+ path: "update",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{"name": "Updated Eval", "metadata": {"description": "Updated description"}}'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ eval = client.evals.update(
+ eval_id="eval_id",
+ )
+ print(eval.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const updatedEval = await openai.evals.update(
+ "eval_67abd54d9b0081909a86353f6fb9317a",
+ {
+ name: "Updated Eval",
+ metadata: { description: "Updated description" }
+ }
+ );
+ console.log(updatedEval);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const _eval = await client.evals.update('eval_id');
+
+ console.log(_eval.id);
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.EvalUpdateParams;
+ import com.openai.models.evals.EvalUpdateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ EvalUpdateResponse eval = client.evals().update("eval_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ eval_ = openai.evals.update("eval_id")
+
+ puts(eval_)
+ """,
+ },
+ response: """
+ {
+ "object": "eval",
+ "id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "data_source_config": {
+ "type": "custom",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "type": "string"
+ },
+ "ground_truth": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "input",
+ "ground_truth"
+ ]
+ }
+ },
+ "required": [
+ "item"
+ ]
+ }
+ },
+ "testing_criteria": [
+ {
+ "name": "String check",
+ "id": "String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2",
+ "type": "string_check",
+ "input": "{{item.input}}",
+ "reference": "{{item.ground_truth}}",
+ "operation": "eq"
+ }
+ ],
+ "name": "Updated Eval",
+ "created_at": 1739314509,
+ "metadata": {"description": "Updated description"},
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Evals.createEvalRun,
+ "x-oaiMeta",
+ #{
+ name: "Create eval run",
+ group: "evals",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals/eval_67e579652b548190aaa83ada4b125f47/runs \\
+ -X POST \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{"name":"gpt-4o-mini","data_source":{"type":"completions","input_messages":{"type":"template","template":[{"role":"developer","content":"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "} , {"role":"user","content":"{{item.input}}"}]} ,"sampling_params":{"temperature":1,"max_completions_tokens":2048,"top_p":1,"seed":42},"model":"gpt-4o-mini","source":{"type":"file_content","content":[{"item":{"input":"Tech Company Launches Advanced Artificial Intelligence Platform","ground_truth":"Technology"}}]}}'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.evals.runs.create(
+ eval_id="eval_id",
+ data_source={
+ "source": {
+ "content": [{
+ "item": {
+ "foo": "bar"
+ }
+ }],
+ "type": "file_content",
+ },
+ "type": "jsonl",
+ },
+ )
+ print(run.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const run = await openai.evals.runs.create(
+ "eval_67e579652b548190aaa83ada4b125f47",
+ {
+ name: "gpt-4o-mini",
+ data_source: {
+ type: "completions",
+ input_messages: {
+ type: "template",
+ template: [
+ {
+ role: "developer",
+ content: "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ },
+ {
+ role: "user",
+ content: "{{item.input}}"
+ }
+ ]
+ },
+ sampling_params: {
+ temperature: 1,
+ max_completions_tokens: 2048,
+ top_p: 1,
+ seed: 42
+ },
+ model: "gpt-4o-mini",
+ source: {
+ type: "file_content",
+ content: [
+ {
+ item: {
+ input: "Tech Company Launches Advanced Artificial Intelligence Platform",
+ ground_truth: "Technology"
+ }
+ }
+ ]
+ }
+ }
+ }
+ );
+ console.log(run);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.evals.runs.create('eval_id', {
+ data_source: {
+ source: { content: [{ item: { foo: 'bar' } }], type: 'file_content' },
+ type: 'jsonl',
+ },
+ });
+
+ console.log(run.id);
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.evals.runs.CreateEvalJsonlRunDataSource;
+ import com.openai.models.evals.runs.RunCreateParams;
+ import com.openai.models.evals.runs.RunCreateResponse;
+ import java.util.List;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .evalId("eval_id")
+ .dataSource(CreateEvalJsonlRunDataSource.builder()
+ .fileContentSource(List.of(CreateEvalJsonlRunDataSource.Source.FileContent.Content.builder()
+ .item(CreateEvalJsonlRunDataSource.Source.FileContent.Content.Item.builder()
+ .putAdditionalProperty("foo", JsonValue.from("bar"))
+ .build())
+ .build()))
+ .build())
+ .build();
+ RunCreateResponse run = client.evals().runs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.evals.runs.create(
+ "eval_id",
+ data_source: {source: {content: [{item: {foo: "bar"}}], type: :file_content}, type: :jsonl}
+ )
+
+ puts(run)
+ """,
+ },
+ response: """
+ {
+ "object": "eval.run",
+ "id": "evalrun_67e57965b480819094274e3a32235e4c",
+ "eval_id": "eval_67e579652b548190aaa83ada4b125f47",
+ "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47&run_id=evalrun_67e57965b480819094274e3a32235e4c",
+ "status": "queued",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Evals.deleteEvalRun,
+ "x-oaiMeta",
+ #{
+ name: "Delete eval run",
+ group: "evals",
+ path: "delete",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals/eval_123abc/runs/evalrun_abc456 \\
+ -X DELETE \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.evals.runs.delete(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ print(run.run_id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const deleted = await openai.evals.runs.delete(
+ "eval_123abc",
+ "evalrun_abc456"
+ );
+ console.log(deleted);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.evals.runs.delete('run_id', { eval_id: 'eval_id' });
+
+ console.log(run.run_id);
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.RunDeleteParams;
+ import com.openai.models.evals.runs.RunDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunDeleteParams params = RunDeleteParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ RunDeleteResponse run = client.evals().runs().delete(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.evals.runs.delete("run_id", eval_id: "eval_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ {
+ "object": "eval.run.deleted",
+ "deleted": true,
+ "run_id": "evalrun_abc456"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Evals.getEvalRun,
+ "x-oaiMeta",
+ #{
+ name: "Get an eval run",
+ group: "evals",
+ path: "get",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.evals.runs.retrieve(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ print(run.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const run = await openai.evals.runs.retrieve(
+ "evalrun_67abd54d60ec8190832b46859da808f7",
+ { eval_id: "eval_67abd54d9b0081909a86353f6fb9317a" }
+ );
+ console.log(run);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.evals.runs.retrieve('run_id', { eval_id: 'eval_id' });
+
+ console.log(run.id);
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.RunRetrieveParams;
+ import com.openai.models.evals.runs.RunRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunRetrieveParams params = RunRetrieveParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ RunRetrieveResponse run = client.evals().runs().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.evals.runs.retrieve("run_id", eval_id: "eval_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ {
+ "object": "eval.run",
+ "id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "report_url": "https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7",
+ "status": "queued",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Summit Addresses Climate Change Strategies",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Major Retailer Reports Record-Breaking Holiday Sales",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "National Team Qualifies for World Championship Finals",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Manufacturer Announces Merger with Competitor",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Breakthrough in Renewable Energy Technology Unveiled",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "World Leaders Sign Historic Climate Agreement",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Professional Athlete Sets New Record in Championship Event",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Financial Institutions Adapt to New Regulatory Requirements",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Tech Conference Showcases Advances in Artificial Intelligence",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Markets Respond to Oil Price Fluctuations",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Cooperation Strengthened Through New Treaty",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Sports League Announces Revised Schedule for Upcoming Season",
+ "ground_truth": "Sports"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Evals.cancelEvalRun,
+ "x-oaiMeta",
+ #{
+ name: "Cancel eval run",
+ group: "evals",
+ path: "post",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/cancel \\
+ -X POST \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.evals.runs.cancel(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ print(response.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const canceledRun = await openai.evals.runs.cancel(
+ "evalrun_67abd54d60ec8190832b46859da808f7",
+ { eval_id: "eval_67abd54d9b0081909a86353f6fb9317a" }
+ );
+ console.log(canceledRun);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.evals.runs.cancel('run_id', { eval_id: 'eval_id' });
+
+ console.log(response.id);
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.RunCancelParams;
+ import com.openai.models.evals.runs.RunCancelResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCancelParams params = RunCancelParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ RunCancelResponse response = client.evals().runs().cancel(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.evals.runs.cancel("run_id", eval_id: "eval_id")
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "object": "eval.run",
+ "id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "report_url": "https://platform.openai.com/evaluations/eval_67abd54d9b0081909a86353f6fb9317a?run_id=evalrun_67abd54d60ec8190832b46859da808f7",
+ "status": "canceled",
+ "model": "gpt-4o-mini",
+ "name": "gpt-4o-mini",
+ "created_at": 1743092069,
+ "result_counts": {
+ "total": 0,
+ "errored": 0,
+ "failed": 0,
+ "passed": 0
+ },
+ "per_model_usage": null,
+ "per_testing_criteria_results": null,
+ "data_source": {
+ "type": "completions",
+ "source": {
+ "type": "file_content",
+ "content": [
+ {
+ "item": {
+ "input": "Tech Company Launches Advanced Artificial Intelligence Platform",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Central Bank Increases Interest Rates Amid Inflation Concerns",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Summit Addresses Climate Change Strategies",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Major Retailer Reports Record-Breaking Holiday Sales",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "National Team Qualifies for World Championship Finals",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Manufacturer Announces Merger with Competitor",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Breakthrough in Renewable Energy Technology Unveiled",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "World Leaders Sign Historic Climate Agreement",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Professional Athlete Sets New Record in Championship Event",
+ "ground_truth": "Sports"
+ }
+ },
+ {
+ "item": {
+ "input": "Financial Institutions Adapt to New Regulatory Requirements",
+ "ground_truth": "Business"
+ }
+ },
+ {
+ "item": {
+ "input": "Tech Conference Showcases Advances in Artificial Intelligence",
+ "ground_truth": "Technology"
+ }
+ },
+ {
+ "item": {
+ "input": "Global Markets Respond to Oil Price Fluctuations",
+ "ground_truth": "Markets"
+ }
+ },
+ {
+ "item": {
+ "input": "International Cooperation Strengthened Through New Treaty",
+ "ground_truth": "World"
+ }
+ },
+ {
+ "item": {
+ "input": "Sports League Announces Revised Schedule for Upcoming Season",
+ "ground_truth": "Sports"
+ }
+ }
+ ]
+ },
+ "input_messages": {
+ "type": "template",
+ "template": [
+ {
+ "type": "message",
+ "role": "developer",
+ "content": {
+ "type": "input_text",
+ "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ "
+ }
+ },
+ {
+ "type": "message",
+ "role": "user",
+ "content": {
+ "type": "input_text",
+ "text": "{{item.input}}"
+ }
+ }
+ ]
+ },
+ "model": "gpt-4o-mini",
+ "sampling_params": {
+ "seed": 42,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completions_tokens": 2048
+ }
+ },
+ "error": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Evals.getEvalRunOutputItems,
+ "x-oaiMeta",
+ #{
+ name: "Get eval run output items",
+ group: "evals",
+ path: "get",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals/egroup_67abd54d9b0081909a86353f6fb9317a/runs/erun_67abd54d60ec8190832b46859da808f7/output_items \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.evals.runs.output_items.list(
+ run_id="run_id",
+ eval_id="eval_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const outputItems = await openai.evals.runs.outputItems.list(
+ "egroup_67abd54d9b0081909a86353f6fb9317a",
+ "erun_67abd54d60ec8190832b46859da808f7"
+ );
+ console.log(outputItems);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const outputItemListResponse of client.evals.runs.outputItems.list('run_id', {
+ eval_id: 'eval_id',
+ })) {
+ console.log(outputItemListResponse.id);
+ }
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.outputitems.OutputItemListPage;
+ import com.openai.models.evals.runs.outputitems.OutputItemListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ OutputItemListParams params = OutputItemListParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .build();
+ OutputItemListPage page = client.evals().runs().outputItems().list(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.evals.runs.output_items.list("run_id", eval_id: "eval_id")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "eval.run.output_item",
+ "id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "created_at": 1743092076,
+ "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "status": "pass",
+ "datasource_item_id": 5,
+ "datasource_item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ },
+ "results": [
+ {
+ "name": "String check-a2486074-d803-4445-b431-ad2262e85d47",
+ "sample": null,
+ "passed": true,
+ "score": 1.0
+ }
+ ],
+ "sample": {
+ "input": [
+ {
+ "role": "developer",
+ "content": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ ",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ },
+ {
+ "role": "user",
+ "content": "Stock Markets Rally After Positive Economic Data Released",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "output": [
+ {
+ "role": "assistant",
+ "content": "Markets",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "finish_reason": "stop",
+ "model": "gpt-4o-mini-2024-07-18",
+ "usage": {
+ "total_tokens": 325,
+ "completion_tokens": 2,
+ "prompt_tokens": 323,
+ "cached_tokens": 0
+ },
+ "error": null,
+ "temperature": 1.0,
+ "max_completion_tokens": 2048,
+ "top_p": 1.0,
+ "seed": 42
+ }
+ }
+ ],
+ "first_id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "last_id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "has_more": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Evals.getEvalRunOutputItems, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Evals.getEvalRunOutputItem,
+ "x-oaiMeta",
+ #{
+ name: "Get an output item of an eval run",
+ group: "evals",
+ path: "get",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a/runs/evalrun_67abd54d60ec8190832b46859da808f7/output_items/outputitem_67abd55eb6548190bb580745d5644a33 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ output_item = client.evals.runs.output_items.retrieve(
+ output_item_id="output_item_id",
+ eval_id="eval_id",
+ run_id="run_id",
+ )
+ print(output_item.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const outputItem = await openai.evals.runs.outputItems.retrieve(
+ "outputitem_67abd55eb6548190bb580745d5644a33",
+ {
+ eval_id: "eval_67abd54d9b0081909a86353f6fb9317a",
+ run_id: "evalrun_67abd54d60ec8190832b46859da808f7",
+ }
+ );
+ console.log(outputItem);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const outputItem = await client.evals.runs.outputItems.retrieve('output_item_id', {
+ eval_id: 'eval_id',
+ run_id: 'run_id',
+ });
+
+ console.log(outputItem.id);
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.evals.runs.outputitems.OutputItemRetrieveParams;
+ import com.openai.models.evals.runs.outputitems.OutputItemRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ OutputItemRetrieveParams params = OutputItemRetrieveParams.builder()
+ .evalId("eval_id")
+ .runId("run_id")
+ .outputItemId("output_item_id")
+ .build();
+ OutputItemRetrieveResponse outputItem = client.evals().runs().outputItems().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ output_item = openai.evals.runs.output_items.retrieve("output_item_id", eval_id: "eval_id", run_id: "run_id")
+
+ puts(output_item)
+ """,
+ },
+ response: """
+ {
+ "object": "eval.run.output_item",
+ "id": "outputitem_67e5796c28e081909917bf79f6e6214d",
+ "created_at": 1743092076,
+ "run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
+ "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
+ "status": "pass",
+ "datasource_item_id": 5,
+ "datasource_item": {
+ "input": "Stock Markets Rally After Positive Economic Data Released",
+ "ground_truth": "Markets"
+ },
+ "results": [
+ {
+ "name": "String check-a2486074-d803-4445-b431-ad2262e85d47",
+ "sample": null,
+ "passed": true,
+ "score": 1.0
+ }
+ ],
+ "sample": {
+ "input": [
+ {
+ "role": "developer",
+ "content": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
+
+ # Steps
+
+ 1. Analyze the content of the news headline to understand its primary focus.
+ 2. Extract the subject matter, identifying any key indicators or keywords.
+ 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
+ 4. Ensure only one category is selected per headline.
+
+ # Output Format
+
+ Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
+
+ # Examples
+
+ **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
+ **Output**: "Technology"
+
+ **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
+ **Output**: "Markets"
+
+ **Input**: "War in Ukraine: Latest Updates on Negotiation Status"
+ **Output**: "World"
+
+ **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
+ **Output**: "Business"
+
+ **Input**: "Manchester United Secures Win in Premier League Football Match"
+ **Output**: "Sports"
+
+ # Notes
+
+ - If the headline appears to fit into more than one category, choose the most dominant theme.
+ - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
+ ",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ },
+ {
+ "role": "user",
+ "content": "Stock Markets Rally After Positive Economic Data Released",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "output": [
+ {
+ "role": "assistant",
+ "content": "Markets",
+ "tool_call_id": null,
+ "tool_calls": null,
+ "function_call": null
+ }
+ ],
+ "finish_reason": "stop",
+ "model": "gpt-4o-mini-2024-07-18",
+ "usage": {
+ "total_tokens": 325,
+ "completion_tokens": 2,
+ "prompt_tokens": 323,
+ "cached_tokens": 0
+ },
+ "error": null,
+ "temperature": 1.0,
+ "max_completion_tokens": 2048,
+ "top_p": 1.0,
+ "seed": 42
+ }
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai-evaluations/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/routes.tsp
similarity index 97%
rename from specification/ai-foundry/data-plane/Foundry/src/openai-evaluations/routes.tsp
rename to specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/routes.tsp
index fbcd929966a9..e25b59fe1138 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/openai-evaluations/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/routes.tsp
@@ -5,14 +5,17 @@ using TypeSpec.Http;
namespace Azure.AI.Projects;
alias EvalQueryParameters = {
+ /** The after query parameter. */
@query
@doc("Identifier for the last run from the previous pagination request.")
after?: string;
+ /** The limit query parameter. */
@query
@doc("Number of runs to retrieve.")
limit?: integer = 20;
+ /** The order query parameter. */
#suppress "@azure-tools/typespec-azure-core/no-unnamed-union" ""
@query
@doc("Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.")
@@ -22,6 +25,7 @@ alias EvalQueryParameters = {
alias RunListQueryParameters = {
...EvalQueryParameters;
+ /** The status query parameter. */
#suppress "@azure-tools/typespec-azure-core/no-unnamed-union" ""
@query
@doc("Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`.")
@@ -208,6 +212,7 @@ interface Evals {
@route("{eval_id}/runs/{run_id}/output_items")
getEvalRunOutputItems is OpenAIOperation<
{
+ /** The eval id path parameter. */
@path
eval_id: string;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/files/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/files/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/files/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/files/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/files/routes.generated.tsp
new file mode 100644
index 000000000000..9cb435d363fe
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/files/routes.generated.tsp
@@ -0,0 +1,141 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/common";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/files";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/files")
+@tag("Files")
+interface Files {
+ /**
+ * Lists files matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List files")
+ @list
+ @get
+ listFiles is OpenAIOperation<
+ {
+ /** Only return files with the given purpose. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ 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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 10000;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+ },
+ OpenAI.ListFilesResponse
+ >;
+
+ /**
+ * Creates a file from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a file")
+ @post
+ createFile is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateFileRequest;
+ },
+ OpenAI.OpenAIFile
+ >;
+
+ /**
+ * Deletes a file by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a file")
+ @route("{file_id}")
+ @delete
+ deleteFile is OpenAIOperation<
+ {
+ /** The ID of the file to use for this request. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ file_id: string;
+ },
+ OpenAI.DeleteFileResponse
+ >;
+
+ /**
+ * Retrieves a file by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a file")
+ @route("{file_id}")
+ @get
+ retrieveFile is OpenAIOperation<
+ {
+ /** The ID of the file to use for this request. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ file_id: string;
+ },
+ OpenAI.OpenAIFile
+ >;
+
+ /**
+ * Downloads a file.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Download a file")
+ @route("{file_id}/content")
+ @get
+ downloadFile is OpenAIOperation<
+ {
+ /** The ID of the file to use for this request. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ file_id: string;
+ },
+ TypeSpec.Http.Body
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/files/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/files/routes.meta.tsp
new file mode 100644
index 000000000000..f4bc6dbacca7
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/files/routes.meta.tsp
@@ -0,0 +1,639 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Files.listFiles,
+ "x-oaiMeta",
+ #{
+ name: "List files",
+ group: "files",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/files \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.files.list()
+ page = page.data[0]
+ print(page)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.files.list();
+
+ for await (const file of list) {
+ console.log(file);
+ }
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fileObject of client.files.list()) {
+ console.log(fileObject);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Files.List(context.TODO(), openai.FileListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileListPage;
+ import com.openai.models.files.FileListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileListPage page = client.files().list();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.files.list
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 175,
+ "created_at": 1613677385,
+ "expires_at": 1677614202,
+ "filename": "salesOverview.pdf",
+ "purpose": "assistants",
+ },
+ {
+ "id": "file-abc456",
+ "object": "file",
+ "bytes": 140,
+ "created_at": 1613779121,
+ "expires_at": 1677614202,
+ "filename": "puppy.jsonl",
+ "purpose": "fine-tune",
+ }
+ ],
+ "first_id": "file-abc123",
+ "last_id": "file-abc456",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Files.listFiles, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Files.createFile,
+ "x-oaiMeta",
+ #{
+ name: "Upload file",
+ group: "files",
+ description: """
+ Uploads a file for later use across OpenAI APIs. Uploads to this endpoint are rate-limited to 1,000 requests per minute per authenticated user. For Retrieval or `file_search` ingestion, upload files here first. If you need to attach multiple uploaded files to the same vector store, use vector store file batches instead of attaching them one by one.
+
+ """,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/files \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F purpose="fine-tune" \\
+ -F file="@mydata.jsonl"
+ -F expires_after[anchor]="created_at"
+ -F expires_after[seconds]=2592000
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file_object = client.files.create(
+ file=b"Example data",
+ purpose="assistants",
+ )
+ print(file_object.id)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.create({
+ file: fs.createReadStream("mydata.jsonl"),
+ purpose: "fine-tune",
+ expires_after: {
+ anchor: "created_at",
+ seconds: 2592000
+ }
+ });
+
+ console.log(file);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fileObject = await client.files.create({
+ file: fs.createReadStream('fine-tune.jsonl'),
+ purpose: 'assistants',
+ });
+
+ console.log(fileObject.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fileObject, err := client.Files.New(context.TODO(), openai.FileNewParams{
+ File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ Purpose: openai.FilePurposeAssistants,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fileObject.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileCreateParams;
+ import com.openai.models.files.FileObject;
+ import com.openai.models.files.FilePurpose;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateParams params = FileCreateParams.builder()
+ .file(new ByteArrayInputStream("Example data".getBytes()))
+ .purpose(FilePurpose.ASSISTANTS)
+ .build();
+ FileObject fileObject = client.files().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file_object = openai.files.create(file: StringIO.new("Example data"), purpose: :assistants)
+
+ puts(file_object)
+ """,
+ },
+ response: """
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 120000,
+ "created_at": 1677610602,
+ "expires_at": 1677614202,
+ "filename": "mydata.jsonl",
+ "purpose": "fine-tune",
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Files.deleteFile,
+ "x-oaiMeta",
+ #{
+ name: "Delete file",
+ group: "files",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/files/file-abc123 \\
+ -X DELETE \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file_deleted = client.files.delete(
+ "file_id",
+ )
+ print(file_deleted.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.delete("file-abc123");
+
+ console.log(file);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fileDeleted = await client.files.delete('file_id');
+
+ console.log(fileDeleted.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fileDeleted, err := client.Files.Delete(context.TODO(), "file_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fileDeleted.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileDeleteParams;
+ import com.openai.models.files.FileDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileDeleted fileDeleted = client.files().delete("file_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file_deleted = openai.files.delete("file_id")
+
+ puts(file_deleted)
+ """,
+ },
+ response: """
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Files.retrieveFile,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve file",
+ group: "files",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/files/file-abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ file_object = client.files.retrieve(
+ "file_id",
+ )
+ print(file_object.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.retrieve("file-abc123");
+
+ console.log(file);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fileObject = await client.files.retrieve('file_id');
+
+ console.log(fileObject.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fileObject, err := client.Files.Get(context.TODO(), "file_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fileObject.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FileObject;
+ import com.openai.models.files.FileRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileObject fileObject = client.files().retrieve("file_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ file_object = openai.files.retrieve("file_id")
+
+ puts(file_object)
+ """,
+ },
+ response: """
+ {
+ "id": "file-abc123",
+ "object": "file",
+ "bytes": 120000,
+ "created_at": 1677610602,
+ "expires_at": 1677614202,
+ "filename": "mydata.jsonl",
+ "purpose": "fine-tune",
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Files.downloadFile,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve file content",
+ group: "files",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/files/file-abc123/content \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" > file.jsonl
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.files.content(
+ "file_id",
+ )
+ print(response)
+ content = response.read()
+ print(content)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const file = await openai.files.content("file-abc123");
+
+ console.log(file);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.files.content('file_id');
+
+ console.log(response);
+
+ const content = await response.blob();
+ console.log(content);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Files.Content(context.TODO(), "file_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.files.FileContentParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ HttpResponse response = client.files().content("file_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.files.content("file_id")
+
+ puts(response)
+ """,
+ },
+ response: "",
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/finetuning/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/finetuning/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/finetuning/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/finetuning/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/finetuning/routes.generated.tsp
new file mode 100644
index 000000000000..16a6c28480a7
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/finetuning/routes.generated.tsp
@@ -0,0 +1,317 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/fine-tuning";
+using TypeSpec.Http;
+using TypeSpec.OpenAPI;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/fine_tuning")
+@tag("Fine-tuning")
+interface FineTuning {
+ /**
+ * Lists fine tuning checkpoint permissions matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List fine tuning checkpoint permissions")
+ @list
+ @route("checkpoints/{fine_tuned_model_checkpoint}/permissions")
+ @get
+ listFineTuningCheckpointPermissions is OpenAIOperation<
+ {
+ /** The ID of the fine-tuned model checkpoint to get permissions for. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ fine_tuned_model_checkpoint: string;
+
+ /** The ID of the project to get permissions for. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ project_id?: string;
+
+ /** Identifier for the last permission ID from the previous pagination request. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+
+ /** Number of permissions to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 10;
+
+ /** The order in which to retrieve permissions. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-closed-literal-union" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-unnamed-union" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: "ascending" | "descending" = "descending";
+ },
+ OpenAI.ListFineTuningCheckpointPermissionResponse
+ >;
+
+ /**
+ * Creates a fine tuning checkpoint permission from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a fine tuning checkpoint permission")
+ @route("checkpoints/{fine_tuned_model_checkpoint}/permissions")
+ @post
+ createFineTuningCheckpointPermission is OpenAIOperation<
+ {
+ /** The ID of the fine-tuned model checkpoint to create a permission for. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ fine_tuned_model_checkpoint: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.CreateFineTuningCheckpointPermissionRequest;
+ },
+ OpenAI.ListFineTuningCheckpointPermissionResponse
+ >;
+
+ /**
+ * Deletes a fine tuning checkpoint permission by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a fine tuning checkpoint permission")
+ @route("checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}")
+ @delete
+ deleteFineTuningCheckpointPermission is OpenAIOperation<
+ {
+ /** The ID of the fine-tuned model checkpoint to delete a permission for. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ fine_tuned_model_checkpoint: string;
+
+ /** The ID of the fine-tuned model checkpoint permission to delete. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ permission_id: string;
+ },
+ OpenAI.DeleteFineTuningCheckpointPermissionResponse
+ >;
+
+ /**
+ * Lists paginated fine tuning jobs matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List paginated fine tuning jobs")
+ @list
+ @route("jobs")
+ @get
+ listPaginatedFineTuningJobs is OpenAIOperation<
+ {
+ /** Identifier for the last job from the previous pagination request. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+
+ /** Number of fine-tuning jobs to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to indicate no metadata. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-nullable" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-autorest/unsupported-param-type" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ metadata?: Record | null;
+ },
+ OpenAI.ListPaginatedFineTuningJobsResponse
+ >;
+
+ /**
+ * Creates a fine tuning job from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a fine tuning job")
+ @route("jobs")
+ @post
+ createFineTuningJob is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateFineTuningJobRequest;
+ },
+ OpenAI.FineTuningJob
+ >;
+
+ /**
+ * Retrieves a fine tuning job by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a fine tuning job")
+ @route("jobs/{fine_tuning_job_id}")
+ @get
+ retrieveFineTuningJob is OpenAIOperation<
+ {
+ /** The ID of the fine-tuning job. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ fine_tuning_job_id: string;
+ },
+ OpenAI.FineTuningJob
+ >;
+
+ /**
+ * Cancels a fine tuning job by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Cancel a fine tuning job")
+ @route("jobs/{fine_tuning_job_id}/cancel")
+ @post
+ cancelFineTuningJob is OpenAIOperation<
+ {
+ /** The ID of the fine-tuning job to cancel. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ fine_tuning_job_id: string;
+ },
+ OpenAI.FineTuningJob
+ >;
+
+ /**
+ * Lists fine tuning job checkpoints matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List fine tuning job checkpoints")
+ @list
+ @route("jobs/{fine_tuning_job_id}/checkpoints")
+ @get
+ listFineTuningJobCheckpoints is OpenAIOperation<
+ {
+ /** The ID of the fine-tuning job to get checkpoints for. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ fine_tuning_job_id: string;
+
+ /** Identifier for the last checkpoint ID from the previous pagination request. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+
+ /** Number of checkpoints to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 10;
+ },
+ OpenAI.ListFineTuningJobCheckpointsResponse
+ >;
+
+ /**
+ * Lists fine tuning events matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List fine tuning events")
+ @list
+ @route("jobs/{fine_tuning_job_id}/events")
+ @get
+ listFineTuningEvents is OpenAIOperation<
+ {
+ /** The ID of the fine-tuning job to get events for. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ fine_tuning_job_id: string;
+
+ /** Identifier for the last event from the previous pagination request. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+
+ /** Number of events to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+ },
+ OpenAI.ListFineTuningJobEventsResponse
+ >;
+
+ /**
+ * Pauses a fine tuning job.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Pause a fine tuning job")
+ @route("jobs/{fine_tuning_job_id}/pause")
+ @post
+ pauseFineTuningJob is OpenAIOperation<
+ {
+ /** The ID of the fine-tuning job to pause. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ fine_tuning_job_id: string;
+ },
+ OpenAI.FineTuningJob
+ >;
+
+ /**
+ * Resumes a fine tuning job.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Resume a fine tuning job")
+ @route("jobs/{fine_tuning_job_id}/resume")
+ @post
+ resumeFineTuningJob is OpenAIOperation<
+ {
+ /** The ID of the fine-tuning job to resume. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ fine_tuning_job_id: string;
+ },
+ OpenAI.FineTuningJob
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/finetuning/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/finetuning/routes.meta.tsp
new file mode 100644
index 000000000000..e05e8fd00639
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/finetuning/routes.meta.tsp
@@ -0,0 +1,2244 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.FineTuning.listFineTuningCheckpointPermissions,
+ "x-oaiMeta",
+ #{
+ name: "List checkpoint permissions",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const permission = await client.fineTuning.checkpoints.permissions.retrieve(
+ 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
+ );
+
+ console.log(permission.first_id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ permission = client.fine_tuning.checkpoints.permissions.retrieve(
+ fine_tuned_model_checkpoint="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(permission.first_id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ permission, err := client.FineTuning.Checkpoints.Permissions.Get(
+ context.TODO(),
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ openai.FineTuningCheckpointPermissionGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", permission.FirstID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveParams;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PermissionRetrieveResponse permission = client.fineTuning().checkpoints().permissions().retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ permission = openai.fine_tuning.checkpoints.permissions.retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(permission)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1721764867,
+ "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"
+ },
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_enQCFmOTGj3syEpYVhBRLTSy",
+ "created_at": 1721764800,
+ "project_id": "proj_iqGMw1llN8IrBb6SvvY5A1oF"
+ },
+ ],
+ "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "last_id": "cp_enQCFmOTGj3syEpYVhBRLTSy",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.listFineTuningCheckpointPermissions,
+ "x-ms-list",
+ true
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.createFineTuningCheckpointPermission,
+ "x-oaiMeta",
+ #{
+ name: "Create checkpoint permissions",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+ -d '{"project_ids": ["proj_abGMw1llN8IrBb6SvvY5A1iH"]}'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const permissionCreateResponse of client.fineTuning.checkpoints.permissions.create(
+ 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd',
+ { project_ids: ['string'] },
+ )) {
+ console.log(permissionCreateResponse.id);
+ }
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.checkpoints.permissions.create(
+ fine_tuned_model_checkpoint="ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ project_ids=["string"],
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Checkpoints.Permissions.New(
+ context.TODO(),
+ "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ openai.FineTuningCheckpointPermissionNewParams{
+ ProjectIDs: []string{"string"},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionCreatePage;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PermissionCreateParams params = PermissionCreateParams.builder()
+ .fineTunedModelCheckpoint("ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd")
+ .addProjectId("string")
+ .build();
+ PermissionCreatePage page = client.fineTuning().checkpoints().permissions().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.checkpoints.permissions.create(
+ "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ project_ids: ["string"]
+ )
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1721764867,
+ "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"
+ }
+ ],
+ "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "last_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.deleteFineTuningCheckpointPermission,
+ "x-oaiMeta",
+ #{
+ name: "Delete checkpoint permission",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions/cp_zc4Q7MP6XxulcVzj4MZdwsAB \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const permission = await client.fineTuning.checkpoints.permissions.delete(
+ 'cp_zc4Q7MP6XxulcVzj4MZdwsAB',
+ { fine_tuned_model_checkpoint: 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd' },
+ );
+
+ console.log(permission.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ permission = client.fine_tuning.checkpoints.permissions.delete(
+ permission_id="cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ fine_tuned_model_checkpoint="ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ )
+ print(permission.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ permission, err := client.FineTuning.Checkpoints.Permissions.Delete(
+ context.TODO(),
+ "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd",
+ "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", permission.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteParams;
+ import com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PermissionDeleteParams params = PermissionDeleteParams.builder()
+ .fineTunedModelCheckpoint("ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd")
+ .permissionId("cp_zc4Q7MP6XxulcVzj4MZdwsAB")
+ .build();
+ PermissionDeleteResponse permission = client.fineTuning().checkpoints().permissions().delete(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ permission = openai.fine_tuning.checkpoints.permissions.delete(
+ "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ fine_tuned_model_checkpoint: "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd"
+ )
+
+ puts(permission)
+ """,
+ },
+ response: """
+ {
+ "object": "checkpoint.permission",
+ "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.listPaginatedFineTuningJobs,
+ "x-oaiMeta",
+ #{
+ name: "List fine-tuning jobs",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs?limit=2&metadata[key]=value \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.jobs.list()
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.fineTuning.jobs.list();
+
+ for await (const fineTune of list) {
+ console.log(fineTune);
+ }
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fineTuningJob of client.fineTuning.jobs.list()) {
+ console.log(fineTuningJob.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Jobs.List(context.TODO(), openai.FineTuningJobListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.JobListPage;
+ import com.openai.models.finetuning.jobs.JobListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobListPage page = client.fineTuning().jobs().list();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.jobs.list
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "metadata": {
+ "key": "value"
+ }
+ },
+ { ... },
+ { ... }
+ ], "has_more": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.listPaginatedFineTuningJobs,
+ "x-ms-list",
+ true
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.createFineTuningJob,
+ "x-oaiMeta",
+ #{
+ name: "Create fine-tuning job",
+ group: "fine-tuning",
+ examples: #[
+ #{
+ title: "Default",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "training_file": "file-BK7bzQj3FfZFXr7DbL6xJwfo",
+ "model": "gpt-4o-mini"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123"
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ }
+ }
+ },
+ "metadata": null
+ }
+
+ """,
+ },
+ #{
+ title: "Epochs",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "training_file": "file-abc123",
+ "model": "gpt-4o-mini",
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "n_epochs": 2
+ }
+ }
+ }
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ import { SupervisedMethod, SupervisedHyperparameters } from "openai/resources/fine-tuning/methods";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123",
+ model: "gpt-4o-mini",
+ method: {
+ type: "supervised",
+ supervised: {
+ hyperparameters: {
+ n_epochs: 2
+ }
+ }
+ }
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": 2
+ },
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": 2
+ }
+ }
+ },
+ "metadata": null,
+ "error": {
+ "code": null,
+ "message": null,
+ "param": null
+ },
+ "finished_at": null,
+ "seed": 683058546,
+ "trained_tokens": null,
+ "estimated_finish": null,
+ "integrations": [],
+ "user_provided_suffix": null,
+ "usage_metrics": null,
+ "shared_with_openai": false
+ }
+
+ """,
+ },
+ #{
+ title: "DPO",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "training_file": "file-abc123",
+ "validation_file": "file-abc123",
+ "model": "gpt-4o-mini",
+ "method": {
+ "type": "dpo",
+ "dpo": {
+ "hyperparameters": {
+ "beta": 0.1
+ }
+ }
+ }
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc",
+ "model": "gpt-4o-mini",
+ "created_at": 1746130590,
+ "fine_tuned_model": null,
+ "organization_id": "org-abc",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-123",
+ "training_file": "file-abc",
+ "method": {
+ "type": "dpo",
+ "dpo": {
+ "hyperparameters": {
+ "beta": 0.1,
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto"
+ }
+ }
+ },
+ "metadata": null,
+ "error": {
+ "code": null,
+ "message": null,
+ "param": null
+ },
+ "finished_at": null,
+ "hyperparameters": null,
+ "seed": 1036326793,
+ "estimated_finish": null,
+ "integrations": [],
+ "user_provided_suffix": null,
+ "usage_metrics": null,
+ "shared_with_openai": false
+ }
+
+ """,
+ },
+ #{
+ title: "Reinforcement",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "training_file": "file-abc",
+ "validation_file": "file-123",
+ "model": "o4-mini",
+ "method": {
+ "type": "reinforcement",
+ "reinforcement": {
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ },
+ "hyperparameters": {
+ "reasoning_effort": "medium"
+ }
+ }
+ }
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "o4-mini",
+ "created_at": 1721764800,
+ "finished_at": null,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "validating_files",
+ "validation_file": "file-123",
+ "training_file": "file-abc",
+ "trained_tokens": null,
+ "error": {},
+ "user_provided_suffix": null,
+ "seed": 950189191,
+ "estimated_finish": null,
+ "integrations": [],
+ "method": {
+ "type": "reinforcement",
+ "reinforcement": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ "eval_interval": "auto",
+ "eval_samples": "auto",
+ "compute_multiplier": "auto",
+ "reasoning_effort": "medium"
+ },
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ },
+ "response_format": null
+ }
+ },
+ "metadata": null,
+ "usage_metrics": null,
+ "shared_with_openai": false
+ }
+
+
+ """,
+ },
+ #{
+ title: "Validation file",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "training_file": "file-abc123",
+ "validation_file": "file-abc123",
+ "model": "gpt-4o-mini"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123",
+ validation_file: "file-abc123"
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123",
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ }
+ }
+ },
+ "metadata": null
+ }
+
+ """,
+ },
+ #{
+ title: "W&B Integration",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "training_file": "file-abc123",
+ "validation_file": "file-abc123",
+ "model": "gpt-4o-mini",
+ "integrations": [
+ {
+ "type": "wandb",
+ "wandb": {
+ "project": "my-wandb-project",
+ "name": "ft-run-display-name"
+ "tags": [
+ "first-experiment", "v2"
+ ]
+ }
+ }
+ ]
+ }'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.create({
+ model: 'gpt-4o-mini',
+ training_file: 'file-abc123',
+ });
+
+ console.log(fineTuningJob.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.create(
+ model="gpt-4o-mini",
+ training_file="file-abc123",
+ )
+ print(fine_tuning_job.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.New(context.TODO(), openai.FineTuningJobNewParams{
+ Model: openai.FineTuningJobNewParamsModelGPT4oMini,
+ TrainingFile: "file-abc123",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobCreateParams params = JobCreateParams.builder()
+ .model(JobCreateParams.Model.GPT_4O_MINI)
+ .trainingFile("file-abc123")
+ .build();
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.create(model: :"gpt-4o-mini", training_file: "file-abc123")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123",
+ "integrations": [
+ {
+ "type": "wandb",
+ "wandb": {
+ "project": "my-wandb-project",
+ "entity": None,
+ "run_id": "ftjob-abc123"
+ }
+ }
+ ],
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "batch_size": "auto",
+ "learning_rate_multiplier": "auto",
+ "n_epochs": "auto",
+ }
+ }
+ },
+ "metadata": null
+ }
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.retrieveFineTuningJob,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve fine-tuning job",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.retrieve(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.retrieve("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.retrieve('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Get(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "davinci-002",
+ "created_at": 1692661014,
+ "finished_at": 1692661190,
+ "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
+ "organization_id": "org-123",
+ "result_files": [
+ "file-abc123"
+ ],
+ "status": "succeeded",
+ "validation_file": null,
+ "training_file": "file-abc123",
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ },
+ "trained_tokens": 5768,
+ "integrations": [],
+ "seed": 0,
+ "estimated_finish": 0,
+ "method": {
+ "type": "supervised",
+ "supervised": {
+ "hyperparameters": {
+ "n_epochs": 4,
+ "batch_size": 1,
+ "learning_rate_multiplier": 1.0
+ }
+ }
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.cancelFineTuningJob,
+ "x-oaiMeta",
+ #{
+ name: "Cancel fine-tuning",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/cancel \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.cancel(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.cancel("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.cancel('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Cancel(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().cancel("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.cancel("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "cancelled",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.listFineTuningJobCheckpoints,
+ "x-oaiMeta",
+ #{
+ name: "List fine-tuning checkpoints",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/checkpoints \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list(
+ 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
+ )) {
+ console.log(fineTuningJobCheckpoint.id);
+ }
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.jobs.checkpoints.list(
+ fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Jobs.Checkpoints.List(
+ context.TODO(),
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ openai.FineTuningJobCheckpointListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.checkpoints.CheckpointListPage;
+ import com.openai.models.finetuning.jobs.checkpoints.CheckpointListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ CheckpointListPage page = client.fineTuning().jobs().checkpoints().list("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.jobs.checkpoints.list("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "fine_tuning.job.checkpoint",
+ "id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "created_at": 1721764867,
+ "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000",
+ "metrics": {
+ "full_valid_loss": 0.134,
+ "full_valid_mean_token_accuracy": 0.874
+ },
+ "fine_tuning_job_id": "ftjob-abc123",
+ "step_number": 2000
+ },
+ {
+ "object": "fine_tuning.job.checkpoint",
+ "id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",
+ "created_at": 1721764800,
+ "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000",
+ "metrics": {
+ "full_valid_loss": 0.167,
+ "full_valid_mean_token_accuracy": 0.781
+ },
+ "fine_tuning_job_id": "ftjob-abc123",
+ "step_number": 1000
+ }
+ ],
+ "first_id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",
+ "last_id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",
+ "has_more": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.listFineTuningJobCheckpoints,
+ "x-ms-list",
+ true
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.listFineTuningEvents,
+ "x-oaiMeta",
+ #{
+ name: "List fine-tuning events",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/events \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.fine_tuning.jobs.list_events(
+ fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.fineTuning.list_events(id="ftjob-abc123", limit=2);
+
+ for await (const fineTune of list) {
+ console.log(fineTune);
+ }
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fineTuningJobEvent of client.fineTuning.jobs.listEvents(
+ 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
+ )) {
+ console.log(fineTuningJobEvent.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.FineTuning.Jobs.ListEvents(
+ context.TODO(),
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ openai.FineTuningJobListEventsParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.JobListEventsPage;
+ import com.openai.models.finetuning.jobs.JobListEventsParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ JobListEventsPage page = client.fineTuning().jobs().listEvents("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.fine_tuning.jobs.list_events("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "object": "fine_tuning.job.event",
+ "id": "ft-event-ddTJfwuMVpfLXseO0Am0Gqjm",
+ "created_at": 1721764800,
+ "level": "info",
+ "message": "Fine tuning job successfully completed",
+ "data": null,
+ "type": "message"
+ },
+ {
+ "object": "fine_tuning.job.event",
+ "id": "ft-event-tyiGuB72evQncpH87xe505Sv",
+ "created_at": 1721764800,
+ "level": "info",
+ "message": "New fine-tuned model created: ft:gpt-4o-mini:openai::7p4lURel",
+ "data": null,
+ "type": "message"
+ }
+ ],
+ "has_more": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.listFineTuningEvents,
+ "x-ms-list",
+ true
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.pauseFineTuningJob,
+ "x-oaiMeta",
+ #{
+ name: "Pause fine-tuning",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/pause \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.pause(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.pause("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.pause('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Pause(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobPauseParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().pause("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.pause("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "paused",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.FineTuning.resumeFineTuningJob,
+ "x-oaiMeta",
+ #{
+ name: "Resume fine-tuning",
+ group: "fine-tuning",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/resume \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ fine_tuning_job = client.fine_tuning.jobs.resume(
+ "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
+ )
+ print(fine_tuning_job.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.resume("ftjob-abc123");
+
+ console.log(fineTune);
+ }
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const fineTuningJob = await client.fineTuning.jobs.resume('ft-AF1WoRqd3aJAHsqc9NY7iL8F');
+
+ console.log(fineTuningJob.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ fineTuningJob, err := client.FineTuning.Jobs.Resume(context.TODO(), "ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", fineTuningJob.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.jobs.FineTuningJob;
+ import com.openai.models.finetuning.jobs.JobResumeParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FineTuningJob fineTuningJob = client.fineTuning().jobs().resume("ft-AF1WoRqd3aJAHsqc9NY7iL8F");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ fine_tuning_job = openai.fine_tuning.jobs.resume("ft-AF1WoRqd3aJAHsqc9NY7iL8F")
+
+ puts(fine_tuning_job)
+ """,
+ },
+ response: """
+ {
+ "object": "fine_tuning.job",
+ "id": "ftjob-abc123",
+ "model": "gpt-4o-mini-2024-07-18",
+ "created_at": 1721764800,
+ "fine_tuned_model": null,
+ "organization_id": "org-123",
+ "result_files": [],
+ "status": "queued",
+ "validation_file": "file-abc123",
+ "training_file": "file-abc123"
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/graders/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/graders/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/graders/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/graders/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/graders/routes.generated.tsp
new file mode 100644
index 000000000000..50a22408cf53
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/graders/routes.generated.tsp
@@ -0,0 +1,53 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/graders";
+using TypeSpec.Http;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/fine_tuning/alpha/graders")
+@tag("Fine-tuning")
+interface Graders {
+ /**
+ * Runs a grader.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Run a grader")
+ @route("run")
+ @post
+ runGrader is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.RunGraderRequest;
+ },
+ OpenAI.RunGraderResponse
+ >;
+
+ /**
+ * Validates a grader.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Validate a grader")
+ @route("validate")
+ @post
+ validateGrader is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.ValidateGraderRequest;
+ },
+ OpenAI.ValidateGraderResponse
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/graders/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/graders/routes.meta.tsp
new file mode 100644
index 000000000000..0b8c5d38a9bc
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/graders/routes.meta.tsp
@@ -0,0 +1,718 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Graders.runGrader,
+ "x-oaiMeta",
+ #{
+ name: "Run grader",
+ beta: true,
+ group: "graders",
+ examples: #[
+ #{
+ title: "Score text alignment",
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "grader": {
+ "type": "score_model",
+ "name": "Example score model grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.
+
+ Reference answer: {{item.reference_answer}}
+
+ Model answer: {{sample.output_text}}"
+ }
+ ]
+ }
+ ],
+ "model": "gpt-5-mini",
+ "sampling_params": {
+ "temperature": 1,
+ "top_p": 1,
+ "seed": 42
+ }
+ },
+ "item": {
+ "reference_answer": "fuzzy wuzzy was a bear"
+ },
+ "model_sample": "fuzzy wuzzy was a bear"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.run(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ model_sample="model_sample",
+ )
+ print(response.metadata)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const result = await openai.fineTuning.alpha.graders.run({
+ grader: {
+ type: "score_model",
+ name: "Example score model grader",
+ input: [
+ {
+ role: "user",
+ content: [
+ {
+ type: "input_text",
+ text: "Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.
+
+ Reference answer: {{item.reference_answer}}
+
+ Model answer: {{sample.output_text}}",
+ },
+ ],
+ },
+ ],
+ model: "gpt-5-mini",
+ sampling_params: { temperature: 1, top_p: 1, seed: 42 },
+ },
+ item: { reference_answer: "fuzzy wuzzy was a bear" },
+ model_sample: "fuzzy wuzzy was a bear",
+ });
+ console.log(result);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.run({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ model_sample: 'model_sample',
+ });
+
+ console.log(response.metadata);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{
+ Grader: openai.FineTuningAlphaGraderRunParamsGraderUnion{
+ OfStringCheck: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ ModelSample: "model_sample",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Metadata)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderRunParams;
+ import com.openai.models.finetuning.alpha.graders.GraderRunResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderRunParams params = GraderRunParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .modelSample("model_sample")
+ .build();
+ GraderRunResponse response = client.fineTuning().alpha().graders().run(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.run(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check},
+ model_sample: "model_sample"
+ )
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "reward": 1.0,
+ "metadata": {
+ "name": "Example score model grader",
+ "type": "score_model",
+ "errors": {
+ "formula_parse_error": false,
+ "sample_parse_error": false,
+ "truncated_observation_error": false,
+ "unresponsive_reward_error": false,
+ "invalid_variable_error": false,
+ "other_error": false,
+ "python_grader_server_error": false,
+ "python_grader_server_error_type": null,
+ "python_grader_runtime_error": false,
+ "python_grader_runtime_error_details": null,
+ "model_grader_server_error": false,
+ "model_grader_refusal_error": false,
+ "model_grader_parse_error": false,
+ "model_grader_server_error_details": null
+ },
+ "execution_time": 4.365238428115845,
+ "scores": {},
+ "token_usage": {
+ "prompt_tokens": 190,
+ "total_tokens": 324,
+ "completion_tokens": 134,
+ "cached_tokens": 0
+ },
+ "sampled_model_name": "gpt-4o-2024-08-06"
+ },
+ "sub_rewards": {},
+ "model_grader_token_usage_per_model": {
+ "gpt-4o-2024-08-06": {
+ "prompt_tokens": 190,
+ "total_tokens": 324,
+ "completion_tokens": 134,
+ "cached_tokens": 0
+ }
+ }
+ }
+
+ """,
+ },
+ #{
+ title: "Score an image caption",
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "grader": {
+ "type": "score_model",
+ "name": "Image caption grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Score how well the provided caption matches the image on a 0-1 scale. Only return the score.
+
+ Caption: {{sample.output_text}}"
+ },
+ {
+ "type": "input_image",
+ "image_url": "https://example.com/dog-catching-ball.png",
+ "file_id": null,
+ "detail": "high"
+ }
+ ]
+ }
+ ],
+ "model": "gpt-5-mini",
+ "sampling_params": {
+ "temperature": 0.2
+ }
+ },
+ "item": {
+ "expected_caption": "A golden retriever jumps to catch a tennis ball"
+ },
+ "model_sample": "A dog leaps to grab a tennis ball mid-air"
+ }'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.run({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ model_sample: 'model_sample',
+ });
+
+ console.log(response.metadata);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.run(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ model_sample="model_sample",
+ )
+ print(response.metadata)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{
+ Grader: openai.FineTuningAlphaGraderRunParamsGraderUnion{
+ OfStringCheck: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ ModelSample: "model_sample",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Metadata)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderRunParams;
+ import com.openai.models.finetuning.alpha.graders.GraderRunResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderRunParams params = GraderRunParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .modelSample("model_sample")
+ .build();
+ GraderRunResponse response = client.fineTuning().alpha().graders().run(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.run(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check},
+ model_sample: "model_sample"
+ )
+
+ puts(response)
+ """,
+ },
+ },
+ #{
+ title: "Score an audio response",
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "grader": {
+ "type": "score_model",
+ "name": "Audio clarity grader",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Listen to the clip and return a confidence score from 0 to 1 that the speaker said: {{item.target_phrase}}"
+ },
+ {
+ "type": "input_audio",
+ "input_audio": {
+ "data": "{{item.audio_clip_b64}}",
+ "format": "mp3"
+ }
+ }
+ ]
+ }
+ ],
+ "model": "gpt-audio",
+ "sampling_params": {
+ "temperature": 0.2,
+ "top_p": 1,
+ "seed": 123
+ }
+ },
+ "item": {
+ "target_phrase": "Please deliver the package on Tuesday",
+ "audio_clip_b64": ""
+ },
+ "model_sample": "Please deliver the package on Tuesday"
+ }'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.run({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ model_sample: 'model_sample',
+ });
+
+ console.log(response.metadata);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.run(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ model_sample="model_sample",
+ )
+ print(response.metadata)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{
+ Grader: openai.FineTuningAlphaGraderRunParamsGraderUnion{
+ OfStringCheck: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ ModelSample: "model_sample",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Metadata)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderRunParams;
+ import com.openai.models.finetuning.alpha.graders.GraderRunResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderRunParams params = GraderRunParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .modelSample("model_sample")
+ .build();
+ GraderRunResponse response = client.fineTuning().alpha().graders().run(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.run(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check},
+ model_sample: "model_sample"
+ )
+
+ puts(response)
+ """,
+ },
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Graders.validateGrader,
+ "x-oaiMeta",
+ #{
+ name: "Validate grader",
+ beta: true,
+ group: "graders",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/fine_tuning/alpha/graders/validate \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ }
+ }'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.fineTuning.alpha.graders.validate({
+ grader: {
+ input: 'input',
+ name: 'name',
+ operation: 'eq',
+ reference: 'reference',
+ type: 'string_check',
+ },
+ });
+
+ console.log(response.grader);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.fine_tuning.alpha.graders.validate(
+ grader={
+ "input": "input",
+ "name": "name",
+ "operation": "eq",
+ "reference": "reference",
+ "type": "string_check",
+ },
+ )
+ print(response.grader)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.FineTuning.Alpha.Graders.Validate(context.TODO(), openai.FineTuningAlphaGraderValidateParams{
+ Grader: openai.FineTuningAlphaGraderValidateParamsGraderUnion{
+ OfStringCheckGrader: &openai.StringCheckGraderParam{
+ Input: "input",
+ Name: "name",
+ Operation: openai.StringCheckGraderOperationEq,
+ Reference: "reference",
+ },
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.Grader)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.finetuning.alpha.graders.GraderValidateParams;
+ import com.openai.models.finetuning.alpha.graders.GraderValidateResponse;
+ import com.openai.models.graders.gradermodels.StringCheckGrader;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ GraderValidateParams params = GraderValidateParams.builder()
+ .grader(StringCheckGrader.builder()
+ .input("input")
+ .name("name")
+ .operation(StringCheckGrader.Operation.EQ)
+ .reference("reference")
+ .build())
+ .build();
+ GraderValidateResponse response = client.fineTuning().alpha().graders().validate(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.fine_tuning.alpha.graders.validate(
+ grader: {input: "input", name: "name", operation: :eq, reference: "reference", type: :string_check}
+ )
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "grader": {
+ "type": "string_check",
+ "name": "Example string check grader",
+ "input": "{{sample.output_text}}",
+ "reference": "{{item.label}}",
+ "operation": "eq"
+ }
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/images/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/images/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/images/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/images/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/images/routes.generated.tsp
new file mode 100644
index 000000000000..b1810f5eda82
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/images/routes.generated.tsp
@@ -0,0 +1,110 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/images";
+import "@typespec/openapi";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/images")
+@tag("Images")
+interface Images {
+ /**
+ * Creates an image edit multipart from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/response-schema-problem" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create an image edit multipart")
+ @sharedRoute
+ @route("edits")
+ @post
+ @extension("x-ms-request-body-description-override", "The request body.")
+ createImageEditMultipart is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateImageEditRequest;
+ },
+ OpenAI.ImagesResponse
+ >;
+
+ /**
+ * Creates an image edit json from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/response-schema-problem" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create an image edit json")
+ @sharedRoute
+ @route("edits")
+ @post
+ @extension("x-ms-request-body-description-override", "The request body.")
+ createImageEditJson is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.EditImageBodyJsonParam;
+ },
+ OpenAI.ImagesResponse
+ >;
+
+ /**
+ * Creates an image from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/response-schema-problem" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create an image")
+ @route("generations")
+ @post
+ createImage is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateImageRequest;
+ },
+ OpenAI.ImagesResponse
+ >;
+
+ /**
+ * Creates an image variation from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create an image variation")
+ @route("variations")
+ @post
+ createImageVariation is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateImageVariationRequest;
+ },
+ OpenAI.ImagesResponse
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/images/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/images/routes.meta.tsp
new file mode 100644
index 000000000000..5ccf840ca14f
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/images/routes.meta.tsp
@@ -0,0 +1,1035 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Images.createImageEditMultipart,
+ "x-oaiMeta",
+ #{
+ name: "Create image edit",
+ group: "images",
+ examples: #[
+ #{
+ title: "Edit image",
+ request: #{
+ curl: """
+ curl -s -D >(grep -i x-request-id >&2) \\
+ -o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) \\
+ -X POST "https://api.openai.com/v1/images/edits" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F "model=gpt-image-1.5" \\
+ -F "image[]=@body-lotion.png" \\
+ -F "image[]=@bath-bomb.png" \\
+ -F "image[]=@incense-kit.png" \\
+ -F "image[]=@soap.png" \\
+ -F 'prompt=Create a lovely gift basket with these four items in it'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.edit(
+ image=b"Example data",
+ prompt="A cute baby sea otter wearing a beret",
+ ):
+ print(image)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI, { toFile } from "openai";
+
+ const client = new OpenAI();
+
+ const imageFiles = [
+ "bath-bomb.png",
+ "body-lotion.png",
+ "incense-kit.png",
+ "soap.png",
+ ];
+
+ const images = await Promise.all(
+ imageFiles.map(async (file) =>
+ await toFile(fs.createReadStream(file), null, {
+ type: "image/png",
+ })
+ ),
+ );
+
+ const rsp = await client.images.edit({
+ model: "gpt-image-1.5",
+ image: images,
+ prompt: "Create a lovely gift basket with these four items in it",
+ });
+
+ // Save the image to a file
+ const image_base64 = rsp.data[0].b64_json;
+ const image_bytes = Buffer.from(image_base64, "base64");
+ fs.writeFileSync("basket.png", image_bytes);
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.edit({
+ image: fs.createReadStream('path/to/file'),
+ prompt: 'A cute baby sea otter wearing a beret',
+ });
+
+ console.log(imagesResponse);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{
+ Image: openai.ImageEditParamsImageUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ Prompt: "A cute baby sea otter wearing a beret",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageEditParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageEditParams params = ImageEditParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .prompt("A cute baby sea otter wearing a beret")
+ .build();
+ ImagesResponse imagesResponse = client.images().edit(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.edit(image: StringIO.new("Example data"), prompt: "A cute baby sea otter wearing a beret")
+
+ puts(images_response)
+ """,
+ },
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl -s -N -X POST "https://api.openai.com/v1/images/edits" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F "model=gpt-image-1.5" \\
+ -F "image[]=@body-lotion.png" \\
+ -F "image[]=@bath-bomb.png" \\
+ -F "image[]=@incense-kit.png" \\
+ -F "image[]=@soap.png" \\
+ -F 'prompt=Create a lovely gift basket with these four items in it' \\
+ -F "stream=true"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.edit(
+ image=b"Example data",
+ prompt="A cute baby sea otter wearing a beret",
+ ):
+ print(image)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI, { toFile } from "openai";
+
+ const client = new OpenAI();
+
+ const imageFiles = [
+ "bath-bomb.png",
+ "body-lotion.png",
+ "incense-kit.png",
+ "soap.png",
+ ];
+
+ const images = await Promise.all(
+ imageFiles.map(async (file) =>
+ await toFile(fs.createReadStream(file), null, {
+ type: "image/png",
+ })
+ ),
+ );
+
+ const stream = await client.images.edit({
+ model: "gpt-image-1.5",
+ image: images,
+ prompt: "Create a lovely gift basket with these four items in it",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.edit({
+ image: fs.createReadStream('path/to/file'),
+ prompt: 'A cute baby sea otter wearing a beret',
+ });
+
+ console.log(imagesResponse);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{
+ Image: openai.ImageEditParamsImageUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ Prompt: "A cute baby sea otter wearing a beret",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageEditParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageEditParams params = ImageEditParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .prompt("A cute baby sea otter wearing a beret")
+ .build();
+ ImagesResponse imagesResponse = client.images().edit(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.edit(image: StringIO.new("Example data"), prompt: "A cute baby sea otter wearing a beret")
+
+ puts(images_response)
+ """,
+ },
+ response: """
+ event: image_edit.partial_image
+ data: {"type":"image_edit.partial_image","b64_json":"...","partial_image_index":0}
+
+ event: image_edit.completed
+ data: {"type":"image_edit.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}}
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Images.createImageEditJson,
+ "x-oaiMeta",
+ #{
+ name: "Create image edit",
+ group: "images",
+ examples: #[
+ #{
+ title: "Edit image",
+ request: #{
+ curl: """
+ curl -s -D >(grep -i x-request-id >&2) \\
+ -o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) \\
+ -X POST "https://api.openai.com/v1/images/edits" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F "model=gpt-image-1.5" \\
+ -F "image[]=@body-lotion.png" \\
+ -F "image[]=@bath-bomb.png" \\
+ -F "image[]=@incense-kit.png" \\
+ -F "image[]=@soap.png" \\
+ -F 'prompt=Create a lovely gift basket with these four items in it'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.edit(
+ image=b"Example data",
+ prompt="A cute baby sea otter wearing a beret",
+ ):
+ print(image)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI, { toFile } from "openai";
+
+ const client = new OpenAI();
+
+ const imageFiles = [
+ "bath-bomb.png",
+ "body-lotion.png",
+ "incense-kit.png",
+ "soap.png",
+ ];
+
+ const images = await Promise.all(
+ imageFiles.map(async (file) =>
+ await toFile(fs.createReadStream(file), null, {
+ type: "image/png",
+ })
+ ),
+ );
+
+ const rsp = await client.images.edit({
+ model: "gpt-image-1.5",
+ image: images,
+ prompt: "Create a lovely gift basket with these four items in it",
+ });
+
+ // Save the image to a file
+ const image_base64 = rsp.data[0].b64_json;
+ const image_bytes = Buffer.from(image_base64, "base64");
+ fs.writeFileSync("basket.png", image_bytes);
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.edit({
+ image: fs.createReadStream('path/to/file'),
+ prompt: 'A cute baby sea otter wearing a beret',
+ });
+
+ console.log(imagesResponse);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{
+ Image: openai.ImageEditParamsImageUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ Prompt: "A cute baby sea otter wearing a beret",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageEditParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageEditParams params = ImageEditParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .prompt("A cute baby sea otter wearing a beret")
+ .build();
+ ImagesResponse imagesResponse = client.images().edit(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.edit(image: StringIO.new("Example data"), prompt: "A cute baby sea otter wearing a beret")
+
+ puts(images_response)
+ """,
+ },
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl -s -N -X POST "https://api.openai.com/v1/images/edits" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F "model=gpt-image-1.5" \\
+ -F "image[]=@body-lotion.png" \\
+ -F "image[]=@bath-bomb.png" \\
+ -F "image[]=@incense-kit.png" \\
+ -F "image[]=@soap.png" \\
+ -F 'prompt=Create a lovely gift basket with these four items in it' \\
+ -F "stream=true"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.edit(
+ image=b"Example data",
+ prompt="A cute baby sea otter wearing a beret",
+ ):
+ print(image)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI, { toFile } from "openai";
+
+ const client = new OpenAI();
+
+ const imageFiles = [
+ "bath-bomb.png",
+ "body-lotion.png",
+ "incense-kit.png",
+ "soap.png",
+ ];
+
+ const images = await Promise.all(
+ imageFiles.map(async (file) =>
+ await toFile(fs.createReadStream(file), null, {
+ type: "image/png",
+ })
+ ),
+ );
+
+ const stream = await client.images.edit({
+ model: "gpt-image-1.5",
+ image: images,
+ prompt: "Create a lovely gift basket with these four items in it",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.edit({
+ image: fs.createReadStream('path/to/file'),
+ prompt: 'A cute baby sea otter wearing a beret',
+ });
+
+ console.log(imagesResponse);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Edit(context.TODO(), openai.ImageEditParams{
+ Image: openai.ImageEditParamsImageUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ Prompt: "A cute baby sea otter wearing a beret",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageEditParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageEditParams params = ImageEditParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .prompt("A cute baby sea otter wearing a beret")
+ .build();
+ ImagesResponse imagesResponse = client.images().edit(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.edit(image: StringIO.new("Example data"), prompt: "A cute baby sea otter wearing a beret")
+
+ puts(images_response)
+ """,
+ },
+ response: """
+ event: image_edit.partial_image
+ data: {"type":"image_edit.partial_image","b64_json":"...","partial_image_index":0}
+
+ event: image_edit.completed
+ data: {"type":"image_edit.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}}
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Images.createImage,
+ "x-oaiMeta",
+ #{
+ name: "Create image",
+ group: "images",
+ examples: #[
+ #{
+ title: "Generate image",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/images/generations \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-image-1.5",
+ "prompt": "A cute baby sea otter",
+ "n": 1,
+ "size": "1024x1024"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.generate(
+ prompt="A cute baby sea otter",
+ ):
+ print(image)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ import { writeFile } from "fs/promises";
+
+ const client = new OpenAI();
+
+ const img = await client.images.generate({
+ model: "gpt-image-1.5",
+ prompt: "A cute baby sea otter",
+ n: 1,
+ size: "1024x1024"
+ });
+
+ const imageBuffer = Buffer.from(img.data[0].b64_json, "base64");
+ await writeFile("output.png", imageBuffer);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });
+
+ console.log(imagesResponse);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{
+ Prompt: "A cute baby sea otter",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageGenerateParams;
+ import com.openai.models.images.ImagesResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageGenerateParams params = ImageGenerateParams.builder()
+ .prompt("A cute baby sea otter")
+ .build();
+ ImagesResponse imagesResponse = client.images().generate(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.generate(prompt: "A cute baby sea otter")
+
+ puts(images_response)
+ """,
+ },
+ response: """
+ {
+ "created": 1713833628,
+ "data": [
+ {
+ "b64_json": "..."
+ }
+ ],
+ "usage": {
+ "total_tokens": 100,
+ "input_tokens": 50,
+ "output_tokens": 50,
+ "input_tokens_details": {
+ "text_tokens": 10,
+ "image_tokens": 40
+ }
+ }
+ }
+
+ """,
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/images/generations \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-image-1.5",
+ "prompt": "A cute baby sea otter",
+ "n": 1,
+ "size": "1024x1024",
+ "stream": true
+ }' \\
+ --no-buffer
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for image in client.images.generate(
+ prompt="A cute baby sea otter",
+ ):
+ print(image)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const client = new OpenAI();
+
+ const stream = await client.images.generate({
+ model: "gpt-image-1.5",
+ prompt: "A cute baby sea otter",
+ n: 1,
+ size: "1024x1024",
+ stream: true,
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.generate({ prompt: 'A cute baby sea otter' });
+
+ console.log(imagesResponse);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{
+ Prompt: "A cute baby sea otter",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageGenerateParams;
+ import com.openai.models.images.ImagesResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageGenerateParams params = ImageGenerateParams.builder()
+ .prompt("A cute baby sea otter")
+ .build();
+ ImagesResponse imagesResponse = client.images().generate(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.generate(prompt: "A cute baby sea otter")
+
+ puts(images_response)
+ """,
+ },
+ response: """
+ event: image_generation.partial_image
+ data: {"type":"image_generation.partial_image","b64_json":"...","partial_image_index":0}
+
+ event: image_generation.completed
+ data: {"type":"image_generation.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}}
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Images.createImageVariation,
+ "x-oaiMeta",
+ #{
+ name: "Create image variation",
+ group: "images",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/images/variations \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F image="@otter.png" \\
+ -F n=2 \\
+ -F size="1024x1024"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ images_response = client.images.create_variation(
+ image=b"Example data",
+ )
+ print(images_response.created)
+ """,
+ javascript: """
+ import fs from "fs";
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const image = await openai.images.createVariation({
+ image: fs.createReadStream("otter.png"),
+ });
+
+ console.log(image.data);
+ }
+ main();
+ """,
+ csharp: """
+ using System;
+
+ using OpenAI.Images;
+
+ ImageClient client = new(
+ model: "dall-e-2",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ GeneratedImage image = client.GenerateImageVariation(imageFilePath: "otter.png");
+
+ Console.WriteLine(image.ImageUri);
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const imagesResponse = await client.images.createVariation({
+ image: fs.createReadStream('otter.png'),
+ });
+
+ console.log(imagesResponse.created);
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ imagesResponse, err := client.Images.NewVariation(context.TODO(), openai.ImageNewVariationParams{
+ Image: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", imagesResponse.Created)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.images.ImageCreateVariationParams;
+ import com.openai.models.images.ImagesResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ImageCreateVariationParams params = ImageCreateVariationParams.builder()
+ .image(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ ImagesResponse imagesResponse = client.images().createVariation(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ images_response = openai.images.create_variation(image: StringIO.new("Example data"))
+
+ puts(images_response)
+ """,
+ },
+ response: """
+ {
+ "created": 1589478378,
+ "data": [
+ {
+ "url": "https://..."
+ },
+ {
+ "url": "https://..."
+ }
+ ]
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/models/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/models/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/models/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/models/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/models/routes.generated.tsp
new file mode 100644
index 000000000000..9729c85cd341
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/models/routes.generated.tsp
@@ -0,0 +1,66 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/models";
+using TypeSpec.Http;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/models")
+@tag("Models")
+interface OpenAIModels {
+ /**
+ * Lists models matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List models")
+ @list
+ @get
+ listModels is OpenAIOperation<{}, OpenAI.ListModelsResponse>;
+
+ /**
+ * Deletes a model by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a model")
+ @route("{model}")
+ @delete
+ deleteModel is OpenAIOperation<
+ {
+ /** The model to delete */
+ @path
+ `model`: string;
+ },
+ OpenAI.DeleteModelResponse
+ >;
+
+ /**
+ * Retrieves a model by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a model")
+ @route("{model}")
+ @get
+ retrieveModel is OpenAIOperation<
+ {
+ /** The ID of the model to use for this request */
+ @path
+ `model`: string;
+ },
+ OpenAI.Model
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/models/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/models/routes.meta.tsp
new file mode 100644
index 000000000000..ef84097fb677
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/models/routes.meta.tsp
@@ -0,0 +1,413 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.OpenAIModels.listModels,
+ "x-oaiMeta",
+ #{
+ name: "List models",
+ group: "models",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/models \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.models.list()
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const list = await openai.models.list();
+
+ for await (const model of list) {
+ console.log(model);
+ }
+ }
+ main();
+ """,
+ csharp: """
+ using System;
+
+ using OpenAI.Models;
+
+ OpenAIModelClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ foreach (var model in client.GetModels().Value)
+ {
+ Console.WriteLine(model.Id);
+ }
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const model of client.models.list()) {
+ console.log(model.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Models.List(context.TODO())
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.models.ModelListPage;
+ import com.openai.models.models.ModelListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModelListPage page = client.models().list();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.models.list
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "model-id-0",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "organization-owner"
+ },
+ {
+ "id": "model-id-1",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "organization-owner",
+ },
+ {
+ "id": "model-id-2",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "openai"
+ },
+ ]
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.OpenAIModels.listModels, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.OpenAIModels.deleteModel,
+ "x-oaiMeta",
+ #{
+ name: "Delete a fine-tuned model",
+ group: "models",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/models/ft:gpt-4o-mini:acemeco:suffix:abc123 \\
+ -X DELETE \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ model_deleted = client.models.delete(
+ "ft:gpt-4o-mini:acemeco:suffix:abc123",
+ )
+ print(model_deleted.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const model = await openai.models.delete("ft:gpt-4o-mini:acemeco:suffix:abc123");
+
+ console.log(model);
+ }
+ main();
+ """,
+ csharp: """
+ using System;
+ using System.ClientModel;
+
+ using OpenAI.Models;
+
+ OpenAIModelClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ClientResult success = client.DeleteModel("ft:gpt-4o-mini:acemeco:suffix:abc123");
+ Console.WriteLine(success);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const modelDeleted = await client.models.delete('ft:gpt-4o-mini:acemeco:suffix:abc123');
+
+ console.log(modelDeleted.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ modelDeleted, err := client.Models.Delete(context.TODO(), "ft:gpt-4o-mini:acemeco:suffix:abc123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", modelDeleted.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.models.ModelDeleteParams;
+ import com.openai.models.models.ModelDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModelDeleted modelDeleted = client.models().delete("ft:gpt-4o-mini:acemeco:suffix:abc123");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ model_deleted = openai.models.delete("ft:gpt-4o-mini:acemeco:suffix:abc123")
+
+ puts(model_deleted)
+ """,
+ },
+ response: """
+ {
+ "id": "ft:gpt-4o-mini:acemeco:suffix:abc123",
+ "object": "model",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.OpenAIModels.retrieveModel,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve model",
+ group: "models",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/models/VAR_chat_model_id \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ model = client.models.retrieve(
+ "gpt-4o-mini",
+ )
+ print(model.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const model = await openai.models.retrieve("VAR_chat_model_id");
+
+ console.log(model);
+ }
+
+ main();
+ """,
+ csharp: """
+ using System;
+ using System.ClientModel;
+
+ using OpenAI.Models;
+
+ OpenAIModelClient client = new(
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ClientResult model = client.GetModel("babbage-002");
+ Console.WriteLine(model.Value.Id);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const model = await client.models.retrieve('gpt-4o-mini');
+
+ console.log(model.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ model, err := client.Models.Get(context.TODO(), "gpt-4o-mini")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", model.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.models.Model;
+ import com.openai.models.models.ModelRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Model model = client.models().retrieve("gpt-4o-mini");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ model = openai.models.retrieve("gpt-4o-mini")
+
+ puts(model)
+ """,
+ },
+ response: """
+ {
+ "id": "VAR_chat_model_id",
+ "object": "model",
+ "created": 1686935002,
+ "owned_by": "openai"
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/moderations/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/moderations/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/moderations/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/moderations/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/moderations/routes.generated.tsp
new file mode 100644
index 000000000000..7487f193661e
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/moderations/routes.generated.tsp
@@ -0,0 +1,33 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/moderations";
+using TypeSpec.Http;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/moderations")
+@tag("Moderations")
+interface Moderations {
+ /**
+ * Creates a moderation from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a moderation")
+ @post
+ createModeration is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateModerationRequest;
+ },
+ OpenAI.CreateModerationResponse
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/moderations/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/moderations/routes.meta.tsp
new file mode 100644
index 000000000000..2cebb732c277
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/moderations/routes.meta.tsp
@@ -0,0 +1,396 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Moderations.createModeration,
+ "x-oaiMeta",
+ #{
+ name: "Create moderation",
+ group: "moderations",
+ examples: #[
+ #{
+ title: "Single string",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/moderations \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "input": "I want to kill them."
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ moderation = client.moderations.create(
+ input="I want to kill them.",
+ )
+ print(moderation.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const moderation = await openai.moderations.create({ input: "I want to kill them." });
+
+ console.log(moderation);
+ }
+ main();
+
+ """,
+ csharp: """
+ using System;
+ using System.ClientModel;
+
+ using OpenAI.Moderations;
+
+ ModerationClient client = new(
+ model: "omni-moderation-latest",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ClientResult moderation = client.ClassifyText("I want to kill them.");
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const moderation = await client.moderations.create({ input: 'I want to kill them.' });
+
+ console.log(moderation.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ moderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{
+ Input: openai.ModerationNewParamsInputUnion{
+ OfString: openai.String("I want to kill them."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", moderation.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.moderations.ModerationCreateParams;
+ import com.openai.models.moderations.ModerationCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModerationCreateParams params = ModerationCreateParams.builder()
+ .input("I want to kill them.")
+ .build();
+ ModerationCreateResponse moderation = client.moderations().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ moderation = openai.moderations.create(input: "I want to kill them.")
+
+ puts(moderation)
+ """,
+ },
+ response: """
+ {
+ "id": "modr-AB8CjOTu2jiq12hp1AQPfeqFWaORR",
+ "model": "text-moderation-007",
+ "results": [
+ {
+ "flagged": true,
+ "categories": {
+ "sexual": false,
+ "hate": false,
+ "harassment": true,
+ "self-harm": false,
+ "sexual/minors": false,
+ "hate/threatening": false,
+ "violence/graphic": false,
+ "self-harm/intent": false,
+ "self-harm/instructions": false,
+ "harassment/threatening": true,
+ "violence": true
+ },
+ "category_scores": {
+ "sexual": 0.000011726012417057063,
+ "hate": 0.22706663608551025,
+ "harassment": 0.5215635299682617,
+ "self-harm": 2.227119921371923e-6,
+ "sexual/minors": 7.107352217872176e-8,
+ "hate/threatening": 0.023547329008579254,
+ "violence/graphic": 0.00003391829886822961,
+ "self-harm/intent": 1.646940972932498e-6,
+ "self-harm/instructions": 1.1198755256458526e-9,
+ "harassment/threatening": 0.5694745779037476,
+ "violence": 0.9971134662628174
+ }
+ }
+ ]
+ }
+
+ """,
+ },
+ #{
+ title: "Image and text",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/moderations \\
+ -X POST \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "omni-moderation-latest",
+ "input": [
+ { "type": "text", "text": "...text to classify goes here..." },
+ {
+ "type": "image_url",
+ "image_url": {
+ "url": "https://example.com/image.png"
+ }
+ }
+ ]
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ moderation = client.moderations.create(
+ input="I want to kill them.",
+ )
+ print(moderation.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ const moderation = await openai.moderations.create({
+ model: "omni-moderation-latest",
+ input: [
+ { type: "text", text: "...text to classify goes here..." },
+ {
+ type: "image_url",
+ image_url: {
+ url: "https://example.com/image.png"
+ // can also use base64 encoded image URLs
+ // url: "data:image/jpeg;base64,abcdefg..."
+ }
+ }
+ ],
+ });
+
+ console.log(moderation);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const moderation = await client.moderations.create({ input: 'I want to kill them.' });
+
+ console.log(moderation.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ moderation, err := client.Moderations.New(context.TODO(), openai.ModerationNewParams{
+ Input: openai.ModerationNewParamsInputUnion{
+ OfString: openai.String("I want to kill them."),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", moderation.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.moderations.ModerationCreateParams;
+ import com.openai.models.moderations.ModerationCreateResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ModerationCreateParams params = ModerationCreateParams.builder()
+ .input("I want to kill them.")
+ .build();
+ ModerationCreateResponse moderation = client.moderations().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ moderation = openai.moderations.create(input: "I want to kill them.")
+
+ puts(moderation)
+ """,
+ },
+ response: """
+ {
+ "id": "modr-0d9740456c391e43c445bf0f010940c7",
+ "model": "omni-moderation-latest",
+ "results": [
+ {
+ "flagged": true,
+ "categories": {
+ "harassment": true,
+ "harassment/threatening": true,
+ "sexual": false,
+ "hate": false,
+ "hate/threatening": false,
+ "illicit": false,
+ "illicit/violent": false,
+ "self-harm/intent": false,
+ "self-harm/instructions": false,
+ "self-harm": false,
+ "sexual/minors": false,
+ "violence": true,
+ "violence/graphic": true
+ },
+ "category_scores": {
+ "harassment": 0.8189693396524255,
+ "harassment/threatening": 0.804985420696006,
+ "sexual": 1.573112165348997e-6,
+ "hate": 0.007562942636942845,
+ "hate/threatening": 0.004208854591835476,
+ "illicit": 0.030535955153511665,
+ "illicit/violent": 0.008925306722380033,
+ "self-harm/intent": 0.00023023930975076432,
+ "self-harm/instructions": 0.0002293869201073356,
+ "self-harm": 0.012598046106750154,
+ "sexual/minors": 2.212566909570261e-8,
+ "violence": 0.9999992735124786,
+ "violence/graphic": 0.843064871157054
+ },
+ "category_applied_input_types": {
+ "harassment": [
+ "text"
+ ],
+ "harassment/threatening": [
+ "text"
+ ],
+ "sexual": [
+ "text",
+ "image"
+ ],
+ "hate": [
+ "text"
+ ],
+ "hate/threatening": [
+ "text"
+ ],
+ "illicit": [
+ "text"
+ ],
+ "illicit/violent": [
+ "text"
+ ],
+ "self-harm/intent": [
+ "text",
+ "image"
+ ],
+ "self-harm/instructions": [
+ "text",
+ "image"
+ ],
+ "self-harm": [
+ "text",
+ "image"
+ ],
+ "sexual/minors": [
+ "text"
+ ],
+ "violence": [
+ "text",
+ "image"
+ ],
+ "violence/graphic": [
+ "text",
+ "image"
+ ]
+ }
+ }
+ ]
+ }
+
+ """,
+ }
+ ],
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/realtime/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/realtime/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/realtime/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/realtime/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/realtime/routes.generated.tsp
new file mode 100644
index 000000000000..ea9bd742a7d1
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/realtime/routes.generated.tsp
@@ -0,0 +1,243 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/realtime";
+using TypeSpec.Http;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/realtime")
+@tag("Realtime")
+interface Realtime {
+ /**
+ * Creates a Realtime API call over WebRTC and returns the SDP answer needed to complete the peer connection.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @route("calls")
+ @post
+ @summary("Create a Realtime call")
+ `create-realtime-call` is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The request body. */
+ @multipartBody
+ body: OpenAI.RealtimeCallCreateRequest;
+ },
+ {
+ @statusCode
+ statusCode: 201;
+
+ /** The location request header. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @header
+ Location?: string;
+
+ /** The content type of the request body. */
+ @header
+ contentType: "application/sdp";
+
+ /** The request body. */
+ @body
+ body: string;
+ }
+ >;
+
+ /**
+ * Accepts an incoming SIP call and configures the realtime session that handles it.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @route("calls/{call_id}/accept")
+ @post
+ @summary("Accept a Realtime call")
+ `accept-realtime-call` is OpenAIOperation<
+ {
+ /**The identifier for the call provided in the
+ [`realtime.call.incoming`](/docs/api-reference/webhook-events/realtime/call/incoming)
+ webhook.*/
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ call_id: string;
+
+ /** Session configuration to apply before the caller is bridged to the model. */
+ @body
+ body: OpenAI.RealtimeSessionCreateRequestGA;
+ },
+ TypeSpec.Http.OkResponse
+ >;
+
+ /**
+ * Ends an active Realtime API call initiated over SIP or WebRTC.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @route("calls/{call_id}/hangup")
+ @post
+ @summary("End a Realtime call")
+ `hangup-realtime-call` is OpenAIOperation<
+ {
+ /**The identifier for the call. For SIP calls, use the value provided in the
+ [`realtime.call.incoming`](/docs/api-reference/webhook-events/realtime/call/incoming)
+ webhook. For WebRTC sessions, reuse the call ID returned in the `Location`
+ header when creating the call with
+ [`POST /v1/realtime/calls`](/docs/api-reference/realtime/create-call).*/
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ call_id: string;
+ },
+ TypeSpec.Http.OkResponse
+ >;
+
+ /**
+ * Transfers an active SIP call to a new destination using the SIP REFER verb.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @route("calls/{call_id}/refer")
+ @post
+ @summary("Transfer a SIP call")
+ `refer-realtime-call` is OpenAIOperation<
+ {
+ /**The identifier for the call provided in the
+ [`realtime.call.incoming`](/docs/api-reference/webhook-events/realtime/call/incoming)
+ webhook.*/
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ call_id: string;
+
+ /** Destination URI for the REFER request. */
+ @body
+ body: OpenAI.RealtimeCallReferRequest;
+ },
+ TypeSpec.Http.OkResponse
+ >;
+
+ /**
+ * Declines an incoming SIP call by returning a SIP status code to the caller.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @route("calls/{call_id}/reject")
+ @post
+ @summary("Decline a SIP call")
+ `reject-realtime-call` is OpenAIOperation<
+ {
+ /**The identifier for the call provided in the
+ [`realtime.call.incoming`](/docs/api-reference/webhook-events/realtime/call/incoming)
+ webhook.*/
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ call_id: string;
+
+ /**Provide an optional SIP status code. When omitted the API responds with
+ `603 Decline`.*/
+ @body
+ body: OpenAI.RealtimeCallRejectRequest;
+ },
+ TypeSpec.Http.OkResponse
+ >;
+
+ /**
+ * Creates a short-lived Realtime client secret that can include session configuration and be used by client applications without exposing the main API key.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @route("client_secrets")
+ @post
+ @summary("Create a Realtime client secret")
+ `create-realtime-client-secret` is OpenAIOperation<
+ {
+ /** Create a client secret with the given session configuration. */
+ @body
+ body: OpenAI.RealtimeCreateClientSecretRequest;
+ },
+ OpenAI.RealtimeCreateClientSecretResponse
+ >;
+
+ /**
+ * Creates an ephemeral API token and Realtime session for use in client-side applications.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @route("sessions")
+ @post
+ @summary("Create a Realtime session")
+ `create-realtime-session` is OpenAIOperation<
+ {
+ /** Create an ephemeral API key with the given session configuration. */
+ @body
+ body: OpenAI.RealtimeSessionCreateRequest;
+ },
+ OpenAI.RealtimeSessionCreateResponse
+ >;
+
+ /**
+ * Creates an ephemeral API token and Realtime transcription session for use in client-side applications.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @route("transcription_sessions")
+ @post
+ @summary("Create a transcription session")
+ `create-realtime-transcription-session` is OpenAIOperation<
+ {
+ /** Create an ephemeral API key with the given session configuration. */
+ @body
+ body: OpenAI.RealtimeTranscriptionSessionCreateRequest;
+ },
+ OpenAI.RealtimeTranscriptionSessionCreateResponse
+ >;
+
+ /**
+ * Creates a short-lived Realtime translation client secret with an associated translation session configuration.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @route("translations/client_secrets")
+ @post
+ @summary("Create a translation client secret")
+ `create-realtime-translation-client-secret` is OpenAIOperation<
+ {
+ /** Create a client secret with the given translation session configuration. */
+ @body
+ body: OpenAI.RealtimeTranslationClientSecretCreateRequest;
+ },
+ OpenAI.RealtimeTranslationClientSecretCreateResponse
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/realtime/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/realtime/routes.meta.tsp
new file mode 100644
index 000000000000..7911692387ad
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/realtime/routes.meta.tsp
@@ -0,0 +1,760 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Realtime.`create-realtime-call`,
+ "x-oaiMeta",
+ #{
+ name: "Create call",
+ group: "realtime",
+ returns: """
+ Returns `201 Created` with the SDP answer in the response body. The
+ `Location` response header includes the call ID for follow-up requests,
+ e.g., establishing a monitoring WebSocket or hanging up the call.
+ """,
+ examples: #{
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/realtime/calls \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F "sdp=);
@@ -21,6 +23,10 @@ namespace Azure.AI.Projects {
OpenAI.Response.`model`,
"The model deployment to use for the creation of this response."
);
+ @@doc(
+ OpenAI.CompactResponseMethodPublicBody.`model`,
+ "The model deployment to use for the compaction of this response."
+ );
@@copyProperties(
OpenAI.CreateResponse,
@@ -52,6 +58,11 @@ namespace Azure.AI.Projects {
/** The structured inputs to the response that can participate in prompt template substitution or tool argument bindings. */
structured_inputs?: Record;
+
+ /**
+ * User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.
+ */
+ user_security_context?: AzureUserSecurityContext;
}
@@copyProperties(
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/responses/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/responses/routes.generated.tsp
new file mode 100644
index 000000000000..34c711550bbf
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/responses/routes.generated.tsp
@@ -0,0 +1,18 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/openai-templates.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/responses";
+import "@azure-tools/openai-typespec/models/common";
+import "@typespec/openapi";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/responses")
+@tag("Responses")
+interface ResponsesGenerated {}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/responses/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/responses/routes.meta.tsp
new file mode 100644
index 000000000000..5b2428019b51
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/responses/routes.meta.tsp
@@ -0,0 +1,2494 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Responses.createResponse,
+ "x-oaiMeta",
+ #{
+ name: "Create a model response",
+ group: "responses",
+ path: "create",
+ examples: #[
+ #{
+ title: "Text input",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.4",
+ "input": "Tell me a three sentence bedtime story about a unicorn."
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ input: "Tell me a three sentence bedtime story about a unicorn."
+ });
+
+ console.log(response);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ """,
+ csharp: """
+ using System;
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ OpenAIResponse response = client.CreateResponse("Tell me a three sentence bedtime story about a unicorn.");
+
+ Console.WriteLine(response.GetOutputText());
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
+ "object": "response",
+ "created_at": 1741476542,
+ "status": "completed",
+ "completed_at": 1741476543,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 36,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 87,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 123
+ },
+ "user": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ #{
+ title: "Image input",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.4",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "what is in this image?"},
+ {
+ "type": "input_image",
+ "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
+ }
+ ]
+ }
+ ]
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ input: [
+ {
+ role: "user",
+ content: [
+ { type: "input_text", text: "what is in this image?" },
+ {
+ type: "input_image",
+ image_url:
+ "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
+ },
+ ],
+ },
+ ],
+ });
+
+ console.log(response);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ """,
+ csharp: """
+ using System;
+ using System.Collections.Generic;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ List inputItems =
+ [
+ ResponseItem.CreateUserMessageItem(
+ [
+ ResponseContentPart.CreateInputTextPart("What is in this image?"),
+ ResponseContentPart.CreateInputImagePart(new Uri("https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"))
+ ]
+ )
+ ];
+
+ OpenAIResponse response = client.CreateResponse(inputItems);
+
+ Console.WriteLine(response.GetOutputText());
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
+ "object": "response",
+ "created_at": 1741476777,
+ "status": "completed",
+ "completed_at": 1741476778,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 328,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 52,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 380
+ },
+ "user": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ #{
+ title: "File input",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.4",
+ "input": [
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": "what is in this file?"},
+ {
+ "type": "input_file",
+ "file_url": "https://www.berkshirehathaway.com/letters/2024ltr.pdf"
+ }
+ ]
+ }
+ ]
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ input: [
+ {
+ role: "user",
+ content: [
+ { type: "input_text", text: "what is in this file?" },
+ {
+ type: "input_file",
+ file_url: "https://www.berkshirehathaway.com/letters/2024ltr.pdf",
+ },
+ ],
+ },
+ ],
+ });
+
+ console.log(response);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86",
+ "object": "response",
+ "created_at": 1752100704,
+ "status": "completed",
+ "completed_at": 1752100705,
+ "background": false,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "max_tool_calls": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "id": "msg_686eef60d3e081a29283bdcbc4322fd90e34c516d176ff86",
+ "type": "message",
+ "status": "completed",
+ "content": [
+ {
+ "type": "output_text",
+ "annotations": [],
+ "logprobs": [],
+ "text": "The file seems to contain excerpts from a letter to the shareholders of Berkshire Hathaway Inc., likely written by Warren Buffett. It covers several topics:
+
+ 1. **Communication Philosophy**: Buffett emphasizes the importance of transparency and candidness in reporting mistakes and successes to shareholders.
+
+ 2. **Mistakes and Learnings**: The letter acknowledges past mistakes in business assessments and management hires, highlighting the importance of correcting errors promptly.
+
+ 3. **CEO Succession**: Mention of Greg Abel stepping in as the new CEO and continuing the tradition of honest communication.
+
+ 4. **Pete Liegl Story**: A detailed account of acquiring Forest River and the relationship with its founder, highlighting trust and effective business decisions.
+
+ 5. **2024 Performance**: Overview of business performance, particularly in insurance and investment activities, with a focus on GEICO's improvement.
+
+ 6. **Tax Contributions**: Discussion of significant tax payments to the U.S. Treasury, credited to shareholders' reinvestments.
+
+ 7. **Investment Strategy**: A breakdown of Berkshire\\u2019s investments in both controlled subsidiaries and marketable equities, along with a focus on long-term holding strategies.
+
+ 8. **American Capitalism**: Reflections on America\\u2019s economic development and Berkshire\\u2019s role within it.
+
+ 9. **Property-Casualty Insurance**: Insights into the P/C insurance business model and its challenges and benefits.
+
+ 10. **Japanese Investments**: Information about Berkshire\\u2019s investments in Japanese companies and future plans.
+
+ 11. **Annual Meeting**: Details about the upcoming annual gathering in Omaha, including schedule changes and new book releases.
+
+ 12. **Personal Anecdotes**: Light-hearted stories about family and interactions, conveying Buffett's personable approach.
+
+ 13. **Financial Performance Data**: Tables comparing Berkshire\\u2019s annual performance to the S&P 500, showing impressive long-term gains.
+
+ Overall, the letter reinforces Berkshire Hathaway's commitment to transparency, investment in both its businesses and the wider economy, and emphasizes strong leadership and prudent financial management."
+ }
+ ],
+ "role": "assistant"
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "service_tier": "default",
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_logprobs": 0,
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 8438,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 398,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 8836
+ },
+ "user": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ #{
+ title: "Web search",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.4",
+ "tools": [{ "type": "web_search_preview" }],
+ "input": "What was a positive news story from today?"
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ tools: [{ type: "web_search_preview" }],
+ input: "What was a positive news story from today?",
+ });
+
+ console.log(response);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ """,
+ csharp: """
+ using System;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "What was a positive news story from today?";
+
+ ResponseCreationOptions options = new()
+ {
+ Tools =
+ {
+ ResponseTool.CreateWebSearchTool()
+ },
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ Console.WriteLine(response.GetOutputText());
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c",
+ "object": "response",
+ "created_at": 1741484430,
+ "status": "completed",
+ "completed_at": 1741484431,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "web_search_call",
+ "id": "ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c",
+ "status": "completed"
+ },
+ {
+ "type": "message",
+ "id": "msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "As of today, March 9, 2025, one notable positive news story...",
+ "annotations": [
+ {
+ "type": "url_citation",
+ "start_index": 442,
+ "end_index": 557,
+ "url": "https://.../?utm_source=chatgpt.com",
+ "title": "..."
+ },
+ {
+ "type": "url_citation",
+ "start_index": 962,
+ "end_index": 1077,
+ "url": "https://.../?utm_source=chatgpt.com",
+ "title": "..."
+ },
+ {
+ "type": "url_citation",
+ "start_index": 1336,
+ "end_index": 1451,
+ "url": "https://.../?utm_source=chatgpt.com",
+ "title": "..."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [
+ {
+ "type": "web_search_preview",
+ "domains": [],
+ "search_context_size": "medium",
+ "user_location": {
+ "type": "approximate",
+ "city": null,
+ "country": "US",
+ "region": null,
+ "timezone": null
+ }
+ }
+ ],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 328,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 356,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 684
+ },
+ "user": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ #{
+ title: "File search",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.4",
+ "tools": [{
+ "type": "file_search",
+ "vector_store_ids": ["vs_1234567890"],
+ "max_num_results": 20
+ }],
+ "input": "What are the attributes of an ancient brown dragon?"
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ tools: [{
+ type: "file_search",
+ vector_store_ids: ["vs_1234567890"],
+ max_num_results: 20
+ }],
+ input: "What are the attributes of an ancient brown dragon?",
+ });
+
+ console.log(response);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ """,
+ csharp: """
+ using System;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "What are the attributes of an ancient brown dragon?";
+
+ ResponseCreationOptions options = new()
+ {
+ Tools =
+ {
+ ResponseTool.CreateFileSearchTool(
+ vectorStoreIds: ["vs_1234567890"],
+ maxResultCount: 20
+ )
+ },
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ Console.WriteLine(response.GetOutputText());
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7",
+ "object": "response",
+ "created_at": 1741485253,
+ "status": "completed",
+ "completed_at": 1741485254,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "file_search_call",
+ "id": "fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7",
+ "status": "completed",
+ "queries": [
+ "attributes of an ancient brown dragon"
+ ],
+ "results": null
+ },
+ {
+ "type": "message",
+ "id": "msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "The attributes of an ancient brown dragon include...",
+ "annotations": [
+ {
+ "type": "file_citation",
+ "index": 320,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 576,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 815,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 815,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1030,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1030,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1156,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ },
+ {
+ "type": "file_citation",
+ "index": 1225,
+ "file_id": "file-4wDz5b167pAf72nx1h9eiN",
+ "filename": "dragons.pdf"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [
+ {
+ "type": "file_search",
+ "filters": null,
+ "max_num_results": 20,
+ "ranking_options": {
+ "ranker": "auto",
+ "score_threshold": 0.0
+ },
+ "vector_store_ids": [
+ "vs_1234567890"
+ ]
+ }
+ ],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 18307,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 348,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 18655
+ },
+ "user": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.4",
+ "instructions": "You are a helpful assistant.",
+ "input": "Hello!",
+ "stream": true
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ instructions: "You are a helpful assistant.",
+ input: "Hello!",
+ stream: true,
+ });
+
+ for await (const event of response) {
+ console.log(event);
+ }
+
+ """,
+ csharp: """
+ using System;
+ using System.ClientModel;
+ using System.Threading.Tasks;
+
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "Hello!";
+
+ ResponseCreationOptions options = new()
+ {
+ Instructions = "You are a helpful assistant.",
+ };
+
+ AsyncCollectionResult responseUpdates = client.CreateResponseStreamingAsync(userInputText, options);
+
+ await foreach (StreamingResponseUpdate responseUpdate in responseUpdates)
+ {
+ if (responseUpdate is StreamingResponseOutputTextDeltaUpdate outputTextDeltaUpdate)
+ {
+ Console.Write(outputTextDeltaUpdate.Delta);
+ }
+ }
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ """,
+ },
+ response: """
+ event: response.created
+ data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
+
+ event: response.in_progress
+ data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
+
+ event: response.output_item.added
+ data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}}
+
+ event: response.content_part.added
+ data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}
+
+ event: response.output_text.delta
+ data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"Hi"}
+
+ ...
+
+ event: response.output_text.done
+ data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"Hi there! How can I assist you today?"}
+
+ event: response.content_part.done
+ data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}}
+
+ event: response.output_item.done
+ data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}}
+
+ event: response.completed
+ data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}}
+
+ """,
+ },
+ #{
+ title: "Functions",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.4",
+ "input": "What is the weather like in Boston today?",
+ "tools": [
+ {
+ "type": "function",
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location", "unit"]
+ }
+ }
+ ],
+ "tool_choice": "auto"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const tools = [
+ {
+ type: "function",
+ name: "get_current_weather",
+ description: "Get the current weather in a given location",
+ parameters: {
+ type: "object",
+ properties: {
+ location: {
+ type: "string",
+ description: "The city and state, e.g. San Francisco, CA",
+ },
+ unit: { type: "string", enum: ["celsius", "fahrenheit"] },
+ },
+ required: ["location", "unit"],
+ },
+ },
+ ];
+
+ const response = await openai.responses.create({
+ model: "gpt-5.4",
+ tools: tools,
+ input: "What is the weather like in Boston today?",
+ tool_choice: "auto",
+ });
+
+ console.log(response);
+
+ """,
+ csharp: """
+ using System;
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "gpt-5.4",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ ResponseTool getCurrentWeatherFunctionTool = ResponseTool.CreateFunctionTool(
+ functionName: "get_current_weather",
+ functionDescription: "Get the current weather in a given location",
+ functionParameters: BinaryData.FromString(\"""
+ {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
+ },
+ "required": ["location", "unit"]
+ }
+ \"""
+ )
+ );
+
+ string userInputText = "What is the weather like in Boston today?";
+
+ ResponseCreationOptions options = new()
+ {
+ Tools =
+ {
+ getCurrentWeatherFunctionTool
+ },
+ ToolChoice = ResponseToolChoice.CreateAutoChoice(),
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0",
+ "object": "response",
+ "created_at": 1741294021,
+ "status": "completed",
+ "completed_at": 1741294022,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-5.4",
+ "output": [
+ {
+ "type": "function_call",
+ "id": "fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0",
+ "call_id": "call_unLAR8MvFNptuiZK6K6HCy5k",
+ "name": "get_current_weather",
+ "arguments": "{"location":"Boston, MA","unit":"celsius"}",
+ "status": "completed"
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [
+ {
+ "type": "function",
+ "description": "Get the current weather in a given location",
+ "name": "get_current_weather",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": [
+ "celsius",
+ "fahrenheit"
+ ]
+ }
+ },
+ "required": [
+ "location",
+ "unit"
+ ]
+ },
+ "strict": true
+ }
+ ],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 291,
+ "output_tokens": 23,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 314
+ },
+ "user": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ #{
+ title: "Reasoning",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "o3-mini",
+ "input": "How much wood would a woodchuck chuck?",
+ "reasoning": {
+ "effort": "high"
+ }
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ const response = await openai.responses.create({
+ model: "o3-mini",
+ input: "How much wood would a woodchuck chuck?",
+ reasoning: {
+ effort: "high"
+ }
+ });
+
+ console.log(response);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.create():
+ print(response)
+ """,
+ csharp: """
+ using System;
+ using OpenAI.Responses;
+
+ OpenAIResponseClient client = new(
+ model: "o3-mini",
+ apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
+ );
+
+ string userInputText = "How much wood would a woodchuck chuck?";
+
+ ResponseCreationOptions options = new()
+ {
+ ReasoningOptions = new()
+ {
+ ReasoningEffortLevel = ResponseReasoningEffortLevel.High,
+ },
+ };
+
+ OpenAIResponse response = client.CreateResponse(userInputText, options);
+
+ Console.WriteLine(response.GetOutputText());
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.create();
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.create
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808",
+ "object": "response",
+ "created_at": 1741477868,
+ "status": "completed",
+ "completed_at": 1741477869,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "o1-2024-12-17",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "The classic tongue twister...",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": "high",
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 81,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 1035,
+ "output_tokens_details": {
+ "reasoning_tokens": 832
+ },
+ "total_tokens": 1116
+ },
+ "user": null,
+ "metadata": {}
+ }
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Responses.deleteResponse,
+ "x-oaiMeta",
+ #{
+ name: "Delete a model response",
+ group: "responses",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X DELETE https://api.openai.com/v1/responses/resp_123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.delete("resp_123");
+ console.log(response);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ client.responses.delete(
+ "resp_677efb5139a88190b512bc3fef8e535d",
+ )
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ await client.responses.delete('resp_677efb5139a88190b512bc3fef8e535d');
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ err := client.Responses.Delete(context.TODO(), "resp_677efb5139a88190b512bc3fef8e535d")
+ if err != nil {
+ panic(err.Error())
+ }
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.ResponseDeleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ client.responses().delete("resp_677efb5139a88190b512bc3fef8e535d");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ result = openai.responses.delete("resp_677efb5139a88190b512bc3fef8e535d")
+
+ puts(result)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_6786a1bec27481909a17d673315b29f6",
+ "object": "response",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Responses.getResponse,
+ "x-oaiMeta",
+ #{
+ name: "Get a model response",
+ group: "responses",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses/resp_123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.retrieve("resp_123");
+ console.log(response);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for response in client.responses.retrieve(
+ response_id="resp_677efb5139a88190b512bc3fef8e535d",
+ ):
+ print(response)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.retrieve('resp_677efb5139a88190b512bc3fef8e535d');
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.Get(
+ context.TODO(),
+ "resp_677efb5139a88190b512bc3fef8e535d",
+ responses.ResponseGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().retrieve("resp_677efb5139a88190b512bc3fef8e535d");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.retrieve("resp_677efb5139a88190b512bc3fef8e535d")
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44",
+ "object": "response",
+ "created_at": 1741386163,
+ "status": "completed",
+ "completed_at": 1741386164,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44",
+ "status": "completed",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "Silent circuits hum,
+ Thoughts emerge in data streams—
+ Digital dawn breaks.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": {
+ "input_tokens": 32,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 18,
+ "output_tokens_details": {
+ "reasoning_tokens": 0
+ },
+ "total_tokens": 50
+ },
+ "user": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Responses.cancelResponse,
+ "x-oaiMeta",
+ #{
+ name: "Cancel a response",
+ group: "responses",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/responses/resp_123/cancel \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.cancel("resp_123");
+ console.log(response);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.responses.cancel(
+ "resp_677efb5139a88190b512bc3fef8e535d",
+ )
+ print(response.id)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.responses.cancel('resp_677efb5139a88190b512bc3fef8e535d');
+
+ console.log(response.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Responses.Cancel(context.TODO(), "resp_677efb5139a88190b512bc3fef8e535d")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.Response;
+ import com.openai.models.responses.ResponseCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Response response = client.responses().cancel("resp_677efb5139a88190b512bc3fef8e535d");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.responses.cancel("resp_677efb5139a88190b512bc3fef8e535d")
+
+ puts(response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44",
+ "object": "response",
+ "created_at": 1741386163,
+ "status": "cancelled",
+ "background": true,
+ "completed_at": null,
+ "error": null,
+ "incomplete_details": null,
+ "instructions": null,
+ "max_output_tokens": null,
+ "model": "gpt-4o-2024-08-06",
+ "output": [
+ {
+ "type": "message",
+ "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44",
+ "status": "in_progress",
+ "role": "assistant",
+ "content": [
+ {
+ "type": "output_text",
+ "text": "Silent circuits hum,
+ Thoughts emerge in data streams—
+ Digital dawn breaks.",
+ "annotations": []
+ }
+ ]
+ }
+ ],
+ "parallel_tool_calls": true,
+ "previous_response_id": null,
+ "reasoning": {
+ "effort": null,
+ "summary": null
+ },
+ "store": true,
+ "temperature": 1.0,
+ "text": {
+ "format": {
+ "type": "text"
+ }
+ },
+ "tool_choice": "auto",
+ "tools": [],
+ "top_p": 1.0,
+ "truncation": "disabled",
+ "usage": null,
+ "user": null,
+ "metadata": {}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Responses.listInputItems,
+ "x-oaiMeta",
+ #{
+ name: "List input items",
+ group: "responses",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/responses/resp_abc123/input_items \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const client = new OpenAI();
+
+ const response = await client.responses.inputItems.list("resp_123");
+ console.log(response.data);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.responses.input_items.list(
+ response_id="response_id",
+ )
+ page = page.data[0]
+ print(page)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const responseItem of client.responses.inputItems.list('response_id')) {
+ console.log(responseItem);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Responses.InputItems.List(
+ context.TODO(),
+ "response_id",
+ responses.InputItemListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.inputitems.InputItemListPage;
+ import com.openai.models.responses.inputitems.InputItemListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ InputItemListPage page = client.responses().inputItems().list("response_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.responses.input_items.list("response_id")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "msg_abc123",
+ "type": "message",
+ "role": "user",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Tell me a three sentence bedtime story about a unicorn."
+ }
+ ]
+ }
+ ],
+ "first_id": "msg_abc123",
+ "last_id": "msg_abc123",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Responses.listInputItems, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Responses.Compactconversation,
+ "x-oaiMeta",
+ #{
+ name: "Compact a response",
+ group: "responses",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/responses/compact \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "model": "gpt-5.1-codex-max",
+ "input": [
+ {
+ "role": "user",
+ "content": "Create a simple landing page for a dog petting café."
+ },
+ {
+ "id": "msg_001",
+ "type": "message",
+ "status": "completed",
+ "content": [
+ {
+ "type": "output_text",
+ "annotations": [],
+ "logprobs": [],
+ "text": "Below is a single file, ready-to-use landing page for a dog petting café:..."
+ }
+ ],
+ "role": "assistant"
+ }
+ ]
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ // Compact the previous response if you are running out of tokens
+ const compactedResponse = await openai.responses.compact({
+ model: "gpt-5.1-codex-max",
+ input: [
+ {
+ role: "user",
+ content: "Create a simple landing page for a dog petting café.",
+ },
+ // All items returned from previous requests are included here, like reasoning, message, function call, etc.
+ {
+ id: "msg_030d085c0b53e67e0069332e3a72d4819c96c6f2c4adc15d33",
+ type: "message",
+ status: "completed",
+ content: [
+ {
+ type: "output_text",
+ annotations: [],
+ logprobs: [],
+ text: "Below is a single file, ready-to-use landing page for a dog petting café:...",
+ },
+ ],
+ role: "assistant",
+ },
+ ],
+ });
+
+ // Pass the compactedResponse.output as input to the next request
+ console.log(compactedResponse);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ compacted_response = client.responses.compact(
+ model="gpt-5.4",
+ )
+ print(compacted_response.id)
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const compactedResponse = await client.responses.compact({ model: 'gpt-5.4' });
+
+ console.log(compactedResponse.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ "github.com/openai/openai-go/responses"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ compactedResponse, err := client.Responses.Compact(context.TODO(), responses.ResponseCompactParams{
+ Model: responses.ResponseCompactParamsModelGPT5_4,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", compactedResponse.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.responses.CompactedResponse;
+ import com.openai.models.responses.ResponseCompactParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ResponseCompactParams params = ResponseCompactParams.builder()
+ .model(ResponseCompactParams.Model.GPT_5_4)
+ .build();
+ CompactedResponse compactedResponse = client.responses().compact(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ compacted_response = openai.responses.compact(model: :"gpt-5.4")
+
+ puts(compacted_response)
+ """,
+ },
+ response: """
+ {
+ "id": "resp_001",
+ "object": "response.compaction",
+ "created_at": 1764967971,
+ "output": [
+ {
+ "id": "msg_000",
+ "type": "message",
+ "status": "completed",
+ "content": [
+ {
+ "type": "input_text",
+ "text": "Create a simple landing page for a dog petting cafe."
+ }
+ ],
+ "role": "user"
+ },
+ {
+ "id": "cmp_001",
+ "type": "compaction",
+ "encrypted_content": "gAAAAABpM0Yj-...="
+ }
+ ],
+ "usage": {
+ "input_tokens": 139,
+ "input_tokens_details": {
+ "cached_tokens": 0
+ },
+ "output_tokens": 438,
+ "output_tokens_details": {
+ "reasoning_tokens": 64
+ },
+ "total_tokens": 577
+ }
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai-responses/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/responses/routes.tsp
similarity index 84%
rename from specification/ai-foundry/data-plane/Foundry/src/openai-responses/routes.tsp
rename to specification/ai-foundry/data-plane/Foundry/src/openai/responses/routes.tsp
index d6515ca2b9b1..cecc6641f79a 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/openai-responses/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/responses/routes.tsp
@@ -1,5 +1,5 @@
import "./models.tsp";
-import "../common/models.tsp";
+import "../../common/models.tsp";
using TypeSpec.Http;
using TypeSpec.OpenAPI;
@@ -26,9 +26,10 @@ interface Responses {
@post
createResponse is OpenAIOperation<
OpenAI.CreateResponse & UserDelegationHeader,
- | (AgentSessionIdResponseHeader & OpenAI.Response)
- | (AgentSessionIdResponseHeader &
- SseResponseOf)
+
+ | (AgentSessionIdResponseHeader & OpenAI.Response)
+ | (AgentSessionIdResponseHeader &
+ SseResponseOf)
>;
/**
@@ -46,22 +47,30 @@ interface Responses {
@route("{response_id}")
getResponse is OpenAIOperation<
{
+ /** The response id path parameter. */
@path
@example("resp_677efb5139a88190b512bc3fef8e535d")
response_id: string;
+ /** The includables query parameter. */
@query(#{ name: "include[]", explode: true })
includables?: OpenAI.IncludeEnum[] = #[];
+ /** The stream query parameter. */
@query stream?: boolean = false;
+
+ /** The sequence number of the event after which to start streaming. */
@query starting_after?: int32;
+
...UserDelegationHeader;
},
- | (AgentSessionIdResponseHeader & {
- @body body: OpenAI.Response;
- })
- | (AgentSessionIdResponseHeader &
- SseResponseOf)
+
+ | (AgentSessionIdResponseHeader & {
+ /** The request body. */
+ @body body: OpenAI.Response;
+ })
+ | (AgentSessionIdResponseHeader &
+ SseResponseOf)
>;
/**
@@ -83,6 +92,7 @@ interface Responses {
...UserDelegationHeader;
},
AgentSessionIdResponseHeader & {
+ /** The request body. */
@body body: DeleteResponseResult;
}
>;
@@ -106,6 +116,7 @@ interface Responses {
...UserDelegationHeader;
},
AgentSessionIdResponseHeader & {
+ /** The request body. */
@body body: OpenAI.Response;
}
>;
@@ -120,6 +131,7 @@ interface Responses {
@list
listInputItems is OpenAIOperation<
{
+ /** The response id path parameter. */
@path
@example("resp_677efb5139a88190b512bc3fef8e535d")
response_id: string;
@@ -128,6 +140,7 @@ interface Responses {
...UserDelegationHeader;
},
AgentSessionIdResponseHeader & {
+ /** The request body. */
@body body: AgentsPagedResult;
}
>;
@@ -155,9 +168,9 @@ interface Responses {
*/
@summary("Compact a conversation")
@post
- @operationId("compactResponseConversation")
+ @operationId("Compactconversation")
@route("compact")
- compactResponseConversation is OpenAIOperation<
+ Compactconversation is OpenAIOperation<
OpenAI.CompactResponseMethodPublicBody,
OpenAI.CompactResource
>;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/threads/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/threads/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/threads/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/threads/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/threads/routes.generated.tsp
new file mode 100644
index 000000000000..3b087610c20a
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/threads/routes.generated.tsp
@@ -0,0 +1,568 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/threads";
+import "@azure-tools/openai-typespec/models/runs";
+import "@azure-tools/openai-typespec/models/common";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/messages";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/threads")
+@tag("Threads")
+interface Threads {
+ /**
+ * Creates a thread from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a thread")
+ @tag("Assistants")
+ @post
+ createThread is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateThreadRequest;
+ },
+ OpenAI.ThreadObject
+ >;
+
+ /**
+ * Creates a thread and run from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a thread and run")
+ @tag("Assistants")
+ @route("runs")
+ @post
+ createThreadAndRun is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateThreadAndRunRequest;
+ },
+ OpenAI.RunObject
+ >;
+
+ /**
+ * Deletes a thread by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a thread")
+ @tag("Assistants")
+ @route("{thread_id}")
+ @delete
+ deleteThread is OpenAIOperation<
+ {
+ /** The ID of the thread to delete. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+ },
+ OpenAI.DeleteThreadResponse
+ >;
+
+ /**
+ * Retrieves a thread by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a thread")
+ @tag("Assistants")
+ @route("{thread_id}")
+ @get
+ getThread is OpenAIOperation<
+ {
+ /** The ID of the thread to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+ },
+ OpenAI.ThreadObject
+ >;
+
+ /**
+ * Updates a thread with the supplied changes.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Update a thread")
+ @tag("Assistants")
+ @route("{thread_id}")
+ @post
+ modifyThread is OpenAIOperation<
+ {
+ /** The ID of the thread to modify. Only the `metadata` can be modified. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.ModifyThreadRequest;
+ },
+ OpenAI.ThreadObject
+ >;
+
+ /**
+ * Lists messages matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List messages")
+ @tag("Assistants")
+ @list
+ @route("{thread_id}/messages")
+ @get
+ listMessages is OpenAIOperation<
+ {
+ /** The ID of the [thread](/docs/api-reference/threads) the messages belong to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ 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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ before?: string;
+
+ /** Filter messages by the run ID that generated them. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ run_id?: string;
+ },
+ OpenAI.ListMessagesResponse
+ >;
+
+ /**
+ * Creates a message from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a message")
+ @tag("Assistants")
+ @route("{thread_id}/messages")
+ @post
+ createMessage is OpenAIOperation<
+ {
+ /** The ID of the [thread](/docs/api-reference/threads) to create a message for. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.CreateMessageRequest;
+ },
+ OpenAI.MessageObject
+ >;
+
+ /**
+ * Deletes a message by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a message")
+ @tag("Assistants")
+ @route("{thread_id}/messages/{message_id}")
+ @delete
+ deleteMessage is OpenAIOperation<
+ {
+ /** The ID of the thread to which this message belongs. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The ID of the message to delete. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ message_id: string;
+ },
+ OpenAI.DeleteMessageResponse
+ >;
+
+ /**
+ * Retrieves a message by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a message")
+ @tag("Assistants")
+ @route("{thread_id}/messages/{message_id}")
+ @get
+ getMessage is OpenAIOperation<
+ {
+ /** The ID of the [thread](/docs/api-reference/threads) to which this message belongs. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The ID of the message to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ message_id: string;
+ },
+ OpenAI.MessageObject
+ >;
+
+ /**
+ * Updates a message with the supplied changes.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Update a message")
+ @tag("Assistants")
+ @route("{thread_id}/messages/{message_id}")
+ @post
+ modifyMessage is OpenAIOperation<
+ {
+ /** The ID of the thread to which this message belongs. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The ID of the message to modify. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ message_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.ModifyMessageRequest;
+ },
+ OpenAI.MessageObject
+ >;
+
+ /**
+ * Lists runs matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List runs")
+ @tag("Assistants")
+ @list
+ @route("{thread_id}/runs")
+ @get
+ listRuns is OpenAIOperation<
+ {
+ /** The ID of the thread the run belongs to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ 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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ before?: string;
+ },
+ OpenAI.ListRunsResponse
+ >;
+
+ /**
+ * Creates a run from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a run")
+ @tag("Assistants")
+ @route("{thread_id}/runs")
+ @post
+ createRun is OpenAIOperation<
+ {
+ /** The ID of the thread to run. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.*/
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ `include[]`?: "step_details.tool_calls[*].file_search.results[*].content"[];
+
+ /** The request body. */
+ @body
+ body: OpenAI.CreateRunRequest;
+ },
+ OpenAI.RunObject
+ >;
+
+ /**
+ * Retrieves a run by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a run")
+ @tag("Assistants")
+ @route("{thread_id}/runs/{run_id}")
+ @get
+ getRun is OpenAIOperation<
+ {
+ /** The ID of the [thread](/docs/api-reference/threads) that was run. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The ID of the run to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ run_id: string;
+ },
+ OpenAI.RunObject
+ >;
+
+ /**
+ * Updates a run with the supplied changes.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Update a run")
+ @tag("Assistants")
+ @route("{thread_id}/runs/{run_id}")
+ @post
+ modifyRun is OpenAIOperation<
+ {
+ /** The ID of the [thread](/docs/api-reference/threads) that was run. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The ID of the run to modify. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ run_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.ModifyRunRequest;
+ },
+ OpenAI.RunObject
+ >;
+
+ /**
+ * Cancels a run by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Cancel a run")
+ @tag("Assistants")
+ @route("{thread_id}/runs/{run_id}/cancel")
+ @post
+ cancelRun is OpenAIOperation<
+ {
+ /** The ID of the thread to which this run belongs. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The ID of the run to cancel. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ run_id: string;
+ },
+ OpenAI.RunObject
+ >;
+
+ /**
+ * Lists run steps matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List run steps")
+ @tag("Assistants")
+ @list
+ @route("{thread_id}/runs/{run_id}/steps")
+ @get
+ listRunSteps is OpenAIOperation<
+ {
+ /** The ID of the thread the run and run steps belong to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The ID of the run the run steps belong to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ run_id: string;
+
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ 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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.*/
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ `include[]`?: "step_details.tool_calls[*].file_search.results[*].content"[];
+ },
+ OpenAI.ListRunStepsResponse
+ >;
+
+ /**
+ * Retrieves a run step by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a run step")
+ @tag("Assistants")
+ @route("{thread_id}/runs/{run_id}/steps/{step_id}")
+ @get
+ getRunStep is OpenAIOperation<
+ {
+ /** The ID of the thread to which the run and run step belongs. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The ID of the run to which the run step belongs. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ run_id: string;
+
+ /** The ID of the run step to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ step_id: 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](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.*/
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ `include[]`?: "step_details.tool_calls[*].file_search.results[*].content"[];
+ },
+ OpenAI.RunStepObject
+ >;
+
+ /**
+ * Creates a tool ouputs to run from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a tool ouputs to run")
+ @tag("Assistants")
+ @route("{thread_id}/runs/{run_id}/submit_tool_outputs")
+ @post
+ submitToolOuputsToRun is OpenAIOperation<
+ {
+ /** The ID of the [thread](/docs/api-reference/threads) to which this run belongs. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ thread_id: string;
+
+ /** The ID of the run that requires the tool output submission. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ run_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.SubmitToolOutputsRunRequest;
+ },
+ OpenAI.RunObject
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/threads/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/threads/routes.meta.tsp
new file mode 100644
index 000000000000..5ef764625218
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/threads/routes.meta.tsp
@@ -0,0 +1,3924 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Threads.createThread,
+ "x-oaiMeta",
+ #{
+ name: "Create thread",
+ group: "threads",
+ beta: true,
+ examples: #[
+ #{
+ title: "Empty",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d ''
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.create()
+ print(thread.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const emptyThread = await openai.beta.threads.create();
+
+ console.log(emptyThread);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.create();
+
+ console.log(thread.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.create
+
+ puts(thread)
+ """,
+ },
+ response: """
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699012949,
+ "metadata": {},
+ "tool_resources": {}
+ }
+
+ """,
+ },
+ #{
+ title: "Messages",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "messages": [{
+ "role": "user",
+ "content": "Hello, what is AI?"
+ }, {
+ "role": "user",
+ "content": "How does AI work? Explain it in simple terms."
+ }]
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.create()
+ print(thread.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const messageThread = await openai.beta.threads.create({
+ messages: [
+ {
+ role: "user",
+ content: "Hello, what is AI?"
+ },
+ {
+ role: "user",
+ content: "How does AI work? Explain it in simple terms.",
+ },
+ ],
+ });
+
+ console.log(messageThread);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.create();
+
+ console.log(thread.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.create
+
+ puts(thread)
+ """,
+ },
+ response: """
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699014083,
+ "metadata": {},
+ "tool_resources": {}
+ }
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.createThreadAndRun,
+ "x-oaiMeta",
+ #{
+ name: "Create thread and run",
+ group: "threads",
+ beta: true,
+ examples: #[
+ #{
+ title: "Default",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/runs \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "assistant_id": "asst_abc123",
+ "thread": {
+ "messages": [
+ {"role": "user", "content": "Explain deep learning to a 5 year old."}
+ ]
+ }
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for thread in client.beta.threads.create_and_run(
+ assistant_id="assistant_id",
+ ):
+ print(thread)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.createAndRun({
+ assistant_id: "asst_abc123",
+ thread: {
+ messages: [
+ { role: "user", content: "Explain deep learning to a 5 year old." },
+ ],
+ },
+ });
+
+ console.log(run);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{
+ AssistantID: "assistant_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadCreateAndRunParams;
+ import com.openai.models.beta.threads.runs.Run;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().createAndRun(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.create_and_run(assistant_id: "assistant_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699076792,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "queued",
+ "started_at": null,
+ "expires_at": 1699077392,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": null,
+ "required_action": null,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": "You are a helpful assistant.",
+ "tools": [],
+ "tool_resources": {},
+ "metadata": {},
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_completion_tokens": null,
+ "max_prompt_tokens": null,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "incomplete_details": null,
+ "usage": null,
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+
+ """,
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/runs \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "assistant_id": "asst_123",
+ "thread": {
+ "messages": [
+ {"role": "user", "content": "Hello"}
+ ]
+ },
+ "stream": true
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for thread in client.beta.threads.create_and_run(
+ assistant_id="assistant_id",
+ ):
+ print(thread)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.beta.threads.createAndRun({
+ assistant_id: "asst_123",
+ thread: {
+ messages: [
+ { role: "user", content: "Hello" },
+ ],
+ },
+ stream: true
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{
+ AssistantID: "assistant_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadCreateAndRunParams;
+ import com.openai.models.beta.threads.runs.Run;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().createAndRun(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.create_and_run(assistant_id: "assistant_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ event: thread.created
+ data: {"id":"thread_123","object":"thread","created_at":1710348075,"metadata":{}}
+
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[], "metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[], "metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}], "metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}}
+
+ event: thread.run.completed
+ {"id":"run_123","object":"thread.run","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1713226836,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1713226837,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":345,"completion_tokens":11,"total_tokens":356},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}
+
+ event: done
+ data: [DONE]
+
+ """,
+ },
+ #{
+ title: "Streaming with Functions",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/runs \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "assistant_id": "asst_abc123",
+ "thread": {
+ "messages": [
+ {"role": "user", "content": "What is the weather like in San Francisco?"}
+ ]
+ },
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "stream": true
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for thread in client.beta.threads.create_and_run(
+ assistant_id="assistant_id",
+ ):
+ print(thread)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ async function main() {
+ const stream = await openai.beta.threads.createAndRun({
+ assistant_id: "asst_123",
+ thread: {
+ messages: [
+ { role: "user", content: "What is the weather like in San Francisco?" },
+ ],
+ },
+ tools: tools,
+ stream: true
+ });
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.createAndRun({ assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{
+ AssistantID: "assistant_id",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadCreateAndRunParams;
+ import com.openai.models.beta.threads.runs.Run;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadCreateAndRunParams params = ThreadCreateAndRunParams.builder()
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().createAndRun(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.create_and_run(assistant_id: "assistant_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ event: thread.created
+ data: {"id":"thread_123","object":"thread","created_at":1710351818,"metadata":{}}
+
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710351818,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710351819,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710352418,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710351819,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710352418,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"id":"call_XXNp8YGaFrjrSjgqxtC8JJ1B","type":"function","function":{"name":"get_current_weather","arguments":"","output":null}}]}}}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"{""}}]}}}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"location"}}]}}}
+
+ ...
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"ahrenheit"}}]}}}
+
+ event: thread.run.step.delta
+ data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":""}"}}]}}}
+
+ event: thread.run.requires_action
+ data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"requires_action","started_at":1710351818,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":{"type":"submit_tool_outputs","submit_tool_outputs":{"tool_calls":[{"id":"call_XXNp8YGaFrjrSjgqxtC8JJ1B","type":"function","function":{"name":"get_current_weather","arguments":"{"location":"San Francisco, CA","unit":"fahrenheit"}"}}]}},"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":345,"completion_tokens":11,"total_tokens":356},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.deleteThread,
+ "x-oaiMeta",
+ #{
+ name: "Delete thread",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -X DELETE
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread_deleted = client.beta.threads.delete(
+ "thread_id",
+ )
+ print(thread_deleted.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const response = await openai.beta.threads.delete("thread_abc123");
+
+ console.log(response);
+ }
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const threadDeleted = await client.beta.threads.delete('thread_id');
+
+ console.log(threadDeleted.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ threadDeleted, err := client.Beta.Threads.Delete(context.TODO(), "thread_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", threadDeleted.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.ThreadDeleteParams;
+ import com.openai.models.beta.threads.ThreadDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ ThreadDeleted threadDeleted = client.beta().threads().delete("thread_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread_deleted = openai.beta.threads.delete("thread_id")
+
+ puts(thread_deleted)
+ """,
+ },
+ response: """
+ {
+ "id": "thread_abc123",
+ "object": "thread.deleted",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.getThread,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve thread",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.retrieve(
+ "thread_id",
+ )
+ print(thread.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const myThread = await openai.beta.threads.retrieve(
+ "thread_abc123"
+ );
+
+ console.log(myThread);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.retrieve('thread_id');
+
+ console.log(thread.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.Get(context.TODO(), "thread_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().retrieve("thread_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.retrieve("thread_id")
+
+ puts(thread)
+ """,
+ },
+ response: """
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699014083,
+ "metadata": {},
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": []
+ }
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.modifyThread,
+ "x-oaiMeta",
+ #{
+ name: "Modify thread",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ }
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ thread = client.beta.threads.update(
+ thread_id="thread_id",
+ )
+ print(thread.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const updatedThread = await openai.beta.threads.update(
+ "thread_abc123",
+ {
+ metadata: { modified: "true", user: "abc123" },
+ }
+ );
+
+ console.log(updatedThread);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const thread = await client.beta.threads.update('thread_id');
+
+ console.log(thread.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ thread, err := client.Beta.Threads.Update(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", thread.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.Thread;
+ import com.openai.models.beta.threads.ThreadUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Thread thread = client.beta().threads().update("thread_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ thread = openai.beta.threads.update("thread_id")
+
+ puts(thread)
+ """,
+ },
+ response: """
+ {
+ "id": "thread_abc123",
+ "object": "thread",
+ "created_at": 1699014083,
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ },
+ "tool_resources": {}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.listMessages,
+ "x-oaiMeta",
+ #{
+ name: "List messages",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/messages \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.threads.messages.list(
+ thread_id="thread_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const threadMessages = await openai.beta.threads.messages.list(
+ "thread_abc123"
+ );
+
+ console.log(threadMessages.data);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const message of client.beta.threads.messages.list('thread_id')) {
+ console.log(message.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Threads.Messages.List(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadMessageListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.MessageListPage;
+ import com.openai.models.beta.threads.messages.MessageListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageListPage page = client.beta().threads().messages().list("thread_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.threads.messages.list("thread_id")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1699016383,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ },
+ {
+ "id": "msg_abc456",
+ "object": "thread.message",
+ "created_at": 1699016383,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "Hello, what is AI?",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ }
+ ],
+ "first_id": "msg_abc123",
+ "last_id": "msg_abc456",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Threads.listMessages, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Threads.createMessage,
+ "x-oaiMeta",
+ #{
+ name: "Create message",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/messages \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "role": "user",
+ "content": "How does AI work? Explain it in simple terms."
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message = client.beta.threads.messages.create(
+ thread_id="thread_id",
+ content="string",
+ role="user",
+ )
+ print(message.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const threadMessages = await openai.beta.threads.messages.create(
+ "thread_abc123",
+ { role: "user", content: "How does AI work? Explain it in simple terms." }
+ );
+
+ console.log(threadMessages);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const message = await client.beta.threads.messages.create('thread_id', {
+ content: 'string',
+ role: 'user',
+ });
+
+ console.log(message.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ message, err := client.Beta.Threads.Messages.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadMessageNewParams{
+ Content: openai.BetaThreadMessageNewParamsContentUnion{
+ OfString: openai.String("string"),
+ },
+ Role: openai.BetaThreadMessageNewParamsRoleUser,
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", message.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.Message;
+ import com.openai.models.beta.threads.messages.MessageCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageCreateParams params = MessageCreateParams.builder()
+ .threadId("thread_id")
+ .content("string")
+ .role(MessageCreateParams.Role.USER)
+ .build();
+ Message message = client.beta().threads().messages().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message = openai.beta.threads.messages.create("thread_id", content: "string", role: :user)
+
+ puts(message)
+ """,
+ },
+ response: """
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1713226573,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.deleteMessage,
+ "x-oaiMeta",
+ #{
+ name: "Delete message",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message_deleted = client.beta.threads.messages.delete(
+ message_id="message_id",
+ thread_id="thread_id",
+ )
+ print(message_deleted.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedMessage = await openai.beta.threads.messages.delete(
+ "msg_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(deletedMessage);
+ }
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const messageDeleted = await client.beta.threads.messages.delete('message_id', {
+ thread_id: 'thread_id',
+ });
+
+ console.log(messageDeleted.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ messageDeleted, err := client.Beta.Threads.Messages.Delete(
+ context.TODO(),
+ "thread_id",
+ "message_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", messageDeleted.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.MessageDeleteParams;
+ import com.openai.models.beta.threads.messages.MessageDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageDeleteParams params = MessageDeleteParams.builder()
+ .threadId("thread_id")
+ .messageId("message_id")
+ .build();
+ MessageDeleted messageDeleted = client.beta().threads().messages().delete(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message_deleted = openai.beta.threads.messages.delete("message_id", thread_id: "thread_id")
+
+ puts(message_deleted)
+ """,
+ },
+ response: """
+ {
+ "id": "msg_abc123",
+ "object": "thread.message.deleted",
+ "deleted": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.getMessage,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve message",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message = client.beta.threads.messages.retrieve(
+ message_id="message_id",
+ thread_id="thread_id",
+ )
+ print(message.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const message = await openai.beta.threads.messages.retrieve(
+ "msg_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(message);
+ }
+
+ main();
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const message = await client.beta.threads.messages.retrieve('message_id', {
+ thread_id: 'thread_id',
+ });
+
+ console.log(message.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ message, err := client.Beta.Threads.Messages.Get(
+ context.TODO(),
+ "thread_id",
+ "message_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", message.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.Message;
+ import com.openai.models.beta.threads.messages.MessageRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageRetrieveParams params = MessageRetrieveParams.builder()
+ .threadId("thread_id")
+ .messageId("message_id")
+ .build();
+ Message message = client.beta().threads().messages().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message = openai.beta.threads.messages.retrieve("message_id", thread_id: "thread_id")
+
+ puts(message)
+ """,
+ },
+ response: """
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1699017614,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "attachments": [],
+ "metadata": {}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.modifyMessage,
+ "x-oaiMeta",
+ #{
+ name: "Modify message",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \\
+ -H "Content-Type: application/json" \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ }
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ message = client.beta.threads.messages.update(
+ message_id="message_id",
+ thread_id="thread_id",
+ )
+ print(message.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const message = await openai.beta.threads.messages.update(
+ "thread_abc123",
+ "msg_abc123",
+ {
+ metadata: {
+ modified: "true",
+ user: "abc123",
+ },
+ }
+ }'
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const message = await client.beta.threads.messages.update('message_id', { thread_id: 'thread_id' });
+
+ console.log(message.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ message, err := client.Beta.Threads.Messages.Update(
+ context.TODO(),
+ "thread_id",
+ "message_id",
+ openai.BetaThreadMessageUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", message.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.messages.Message;
+ import com.openai.models.beta.threads.messages.MessageUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ MessageUpdateParams params = MessageUpdateParams.builder()
+ .threadId("thread_id")
+ .messageId("message_id")
+ .build();
+ Message message = client.beta().threads().messages().update(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ message = openai.beta.threads.messages.update("message_id", thread_id: "thread_id")
+
+ puts(message)
+ """,
+ },
+ response: """
+ {
+ "id": "msg_abc123",
+ "object": "thread.message",
+ "created_at": 1699017614,
+ "assistant_id": null,
+ "thread_id": "thread_abc123",
+ "run_id": null,
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": {
+ "value": "How does AI work? Explain it in simple terms.",
+ "annotations": []
+ }
+ }
+ ],
+ "file_ids": [],
+ "metadata": {
+ "modified": "true",
+ "user": "abc123"
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.listRuns,
+ "x-oaiMeta",
+ #{
+ name: "List runs",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/runs \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.threads.runs.list(
+ thread_id="thread_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const runs = await openai.beta.threads.runs.list(
+ "thread_abc123"
+ );
+
+ console.log(runs);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const run of client.beta.threads.runs.list('thread_id')) {
+ console.log(run.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Threads.Runs.List(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.RunListPage;
+ import com.openai.models.beta.threads.runs.RunListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunListPage page = client.beta().threads().runs().list("thread_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.threads.runs.list("thread_id")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699075072,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699075072,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699075073,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": [
+ "file-abc123",
+ "file-abc456"
+ ]
+ }
+ },
+ "metadata": {},
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ },
+ {
+ "id": "run_abc456",
+ "object": "thread.run",
+ "created_at": 1699063290,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699063290,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699063291,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": [
+ "file-abc123",
+ "file-abc456"
+ ]
+ }
+ },
+ "metadata": {},
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+ ],
+ "first_id": "run_abc123",
+ "last_id": "run_abc456",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Threads.listRuns, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Threads.createRun,
+ "x-oaiMeta",
+ #{
+ name: "Create run",
+ group: "threads",
+ beta: true,
+ examples: #[
+ #{
+ title: "Default",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/runs \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "assistant_id": "asst_abc123"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.create(
+ thread_id="thread_id",
+ assistant_id="assistant_id",
+ ):
+ print(run)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.create(
+ "thread_abc123",
+ { assistant_id: "asst_abc123" }
+ );
+
+ console.log(run);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunNewParams{
+ AssistantID: "assistant_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .threadId("thread_id")
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().runs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.create("thread_id", assistant_id: "assistant_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699063290,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "queued",
+ "started_at": 1699063290,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699063291,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "usage": null,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+
+ """,
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_123/runs \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "assistant_id": "asst_123",
+ "stream": true
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.create(
+ thread_id="thread_id",
+ assistant_id="assistant_id",
+ ):
+ print(run)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.beta.threads.runs.create(
+ "thread_123",
+ { assistant_id: "asst_123", stream: true }
+ );
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunNewParams{
+ AssistantID: "assistant_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .threadId("thread_id")
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().runs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.create("thread_id", assistant_id: "assistant_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710330641,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710330642,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710330642,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}}
+
+ event: thread.run.completed
+ data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710330641,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710330642,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+
+ """,
+ },
+ #{
+ title: "Streaming with Functions",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/runs \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "assistant_id": "asst_abc123",
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "stream": true
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.create(
+ thread_id="thread_id",
+ assistant_id="assistant_id",
+ ):
+ print(run)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ async function main() {
+ const stream = await openai.beta.threads.runs.create(
+ "thread_abc123",
+ {
+ assistant_id: "asst_abc123",
+ tools: tools,
+ stream: true
+ }
+ );
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.create('thread_id', { assistant_id: 'assistant_id' });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.New(
+ context.TODO(),
+ "thread_id",
+ openai.BetaThreadRunNewParams{
+ AssistantID: "assistant_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCreateParams params = RunCreateParams.builder()
+ .threadId("thread_id")
+ .assistantId("assistant_id")
+ .build();
+ Run run = client.beta().threads().runs().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.create("thread_id", assistant_id: "assistant_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ event: thread.run.created
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710348075,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}}
+
+ event: thread.run.completed
+ data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710348075,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710348077,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+
+ """,
+ }
+ ],
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.getRun,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve run",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.beta.threads.runs.retrieve(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ print(run.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.retrieve(
+ "run_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(run);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.retrieve('run_id', { thread_id: 'thread_id' });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.Get(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunRetrieveParams params = RunRetrieveParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ Run run = client.beta().threads().runs().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.retrieve("run_id", thread_id: "thread_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699075072,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699075072,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699075073,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "metadata": {},
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.modifyRun,
+ "x-oaiMeta",
+ #{
+ name: "Modify run",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "metadata": {
+ "user_id": "user_abc123"
+ }
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.beta.threads.runs.update(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ print(run.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.update(
+ "run_abc123",
+ {
+ thread_id: "thread_abc123",
+ metadata: {
+ user_id: "user_abc123",
+ },
+ }
+ );
+
+ console.log(run);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.update('run_id', { thread_id: 'thread_id' });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.Update(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunUpdateParams params = RunUpdateParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ Run run = client.beta().threads().runs().update(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.update("run_id", thread_id: "thread_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699075072,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "completed",
+ "started_at": 1699075072,
+ "expires_at": null,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": 1699075073,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "incomplete_details": null,
+ "tools": [
+ {
+ "type": "code_interpreter"
+ }
+ ],
+ "tool_resources": {
+ "code_interpreter": {
+ "file_ids": [
+ "file-abc123",
+ "file-abc456"
+ ]
+ }
+ },
+ "metadata": {
+ "user_id": "user_abc123"
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ },
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.cancelRun,
+ "x-oaiMeta",
+ #{
+ name: "Cancel a run",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -X POST
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run = client.beta.threads.runs.cancel(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ print(run.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.cancel(
+ "run_abc123",
+ { thread_id: "thread_abc123" }
+ );
+
+ console.log(run);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.cancel('run_id', { thread_id: 'thread_id' });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.Cancel(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunCancelParams params = RunCancelParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ Run run = client.beta().threads().runs().cancel(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.cancel("run_id", thread_id: "thread_id")
+
+ puts(run)
+ """,
+ },
+ response: """
+ {
+ "id": "run_abc123",
+ "object": "thread.run",
+ "created_at": 1699076126,
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "status": "cancelling",
+ "started_at": 1699076126,
+ "expires_at": 1699076726,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": null,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": "You summarize books.",
+ "tools": [
+ {
+ "type": "file_search"
+ }
+ ],
+ "tool_resources": {
+ "file_search": {
+ "vector_store_ids": ["vs_123"]
+ }
+ },
+ "metadata": {},
+ "usage": null,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.listRunSteps,
+ "x-oaiMeta",
+ #{
+ name: "List run steps",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.beta.threads.runs.steps.list(
+ run_id="run_id",
+ thread_id="thread_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const runStep = await openai.beta.threads.runs.steps.list(
+ "run_abc123",
+ { thread_id: "thread_abc123" }
+ );
+ console.log(runStep);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const runStep of client.beta.threads.runs.steps.list('run_id', {
+ thread_id: 'thread_id',
+ })) {
+ console.log(runStep.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Beta.Threads.Runs.Steps.List(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunStepListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.steps.StepListPage;
+ import com.openai.models.beta.threads.runs.steps.StepListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ StepListParams params = StepListParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .build();
+ StepListPage page = client.beta().threads().runs().steps().list(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.beta.threads.runs.steps.list("run_id", thread_id: "thread_id")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "step_abc123",
+ "object": "thread.run.step",
+ "created_at": 1699063291,
+ "run_id": "run_abc123",
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "type": "message_creation",
+ "status": "completed",
+ "cancelled_at": null,
+ "completed_at": 1699063291,
+ "expired_at": null,
+ "failed_at": null,
+ "last_error": null,
+ "step_details": {
+ "type": "message_creation",
+ "message_creation": {
+ "message_id": "msg_abc123"
+ }
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ }
+ }
+ ],
+ "first_id": "step_abc123",
+ "last_id": "step_abc456",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.Threads.listRunSteps, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.Threads.getRunStep,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve run step",
+ group: "threads",
+ beta: true,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ run_step = client.beta.threads.runs.steps.retrieve(
+ step_id="step_id",
+ thread_id="thread_id",
+ run_id="run_id",
+ )
+ print(run_step.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const runStep = await openai.beta.threads.runs.steps.retrieve(
+ "step_abc123",
+ { thread_id: "thread_abc123", run_id: "run_abc123" }
+ );
+ console.log(runStep);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const runStep = await client.beta.threads.runs.steps.retrieve('step_id', {
+ thread_id: 'thread_id',
+ run_id: 'run_id',
+ });
+
+ console.log(runStep.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ runStep, err := client.Beta.Threads.Runs.Steps.Get(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ "step_id",
+ openai.BetaThreadRunStepGetParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", runStep.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.steps.RunStep;
+ import com.openai.models.beta.threads.runs.steps.StepRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ StepRetrieveParams params = StepRetrieveParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .stepId("step_id")
+ .build();
+ RunStep runStep = client.beta().threads().runs().steps().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run_step = openai.beta.threads.runs.steps.retrieve("step_id", thread_id: "thread_id", run_id: "run_id")
+
+ puts(run_step)
+ """,
+ },
+ response: """
+ {
+ "id": "step_abc123",
+ "object": "thread.run.step",
+ "created_at": 1699063291,
+ "run_id": "run_abc123",
+ "assistant_id": "asst_abc123",
+ "thread_id": "thread_abc123",
+ "type": "message_creation",
+ "status": "completed",
+ "cancelled_at": null,
+ "completed_at": 1699063291,
+ "expired_at": null,
+ "failed_at": null,
+ "last_error": null,
+ "step_details": {
+ "type": "message_creation",
+ "message_creation": {
+ "message_id": "msg_abc123"
+ }
+ },
+ "usage": {
+ "prompt_tokens": 123,
+ "completion_tokens": 456,
+ "total_tokens": 579
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Threads.submitToolOuputsToRun,
+ "x-oaiMeta",
+ #{
+ name: "Submit tool outputs to run",
+ group: "threads",
+ beta: true,
+ examples: #[
+ #{
+ title: "Default",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "tool_outputs": [
+ {
+ "tool_call_id": "call_001",
+ "output": "70 degrees and sunny."
+ }
+ ]
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.submit_tool_outputs(
+ run_id="run_id",
+ thread_id="thread_id",
+ tool_outputs=[{}],
+ ):
+ print(run)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const run = await openai.beta.threads.runs.submitToolOutputs(
+ "run_123",
+ {
+ thread_id: "thread_123",
+ tool_outputs: [
+ {
+ tool_call_id: "call_001",
+ output: "70 degrees and sunny.",
+ },
+ ],
+ }
+ );
+
+ console.log(run);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.submitToolOutputs('run_id', {
+ thread_id: 'thread_id',
+ tool_outputs: [{}],
+ });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.SubmitToolOutputs(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunSubmitToolOutputsParams{
+ ToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())
+ .build();
+ Run run = client.beta().threads().runs().submitToolOutputs(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.submit_tool_outputs("run_id", thread_id: "thread_id", tool_outputs: [{}])
+
+ puts(run)
+ """,
+ },
+ response: """
+ {
+ "id": "run_123",
+ "object": "thread.run",
+ "created_at": 1699075592,
+ "assistant_id": "asst_123",
+ "thread_id": "thread_123",
+ "status": "queued",
+ "started_at": 1699075592,
+ "expires_at": 1699076192,
+ "cancelled_at": null,
+ "failed_at": null,
+ "completed_at": null,
+ "last_error": null,
+ "model": "gpt-4o",
+ "instructions": null,
+ "tools": [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ },
+ "unit": {
+ "type": "string",
+ "enum": ["celsius", "fahrenheit"]
+ }
+ },
+ "required": ["location"]
+ }
+ }
+ }
+ ],
+ "metadata": {},
+ "usage": null,
+ "temperature": 1.0,
+ "top_p": 1.0,
+ "max_prompt_tokens": 1000,
+ "max_completion_tokens": 1000,
+ "truncation_strategy": {
+ "type": "auto",
+ "last_messages": null
+ },
+ "response_format": "auto",
+ "tool_choice": "auto",
+ "parallel_tool_calls": true
+ }
+
+ """,
+ },
+ #{
+ title: "Streaming",
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "tool_outputs": [
+ {
+ "tool_call_id": "call_001",
+ "output": "70 degrees and sunny."
+ }
+ ],
+ "stream": true
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ for run in client.beta.threads.runs.submit_tool_outputs(
+ run_id="run_id",
+ thread_id="thread_id",
+ tool_outputs=[{}],
+ ):
+ print(run)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+
+ const openai = new OpenAI();
+
+ async function main() {
+ const stream = await openai.beta.threads.runs.submitToolOutputs(
+ "run_123",
+ {
+ thread_id: "thread_123",
+ tool_outputs: [
+ {
+ tool_call_id: "call_001",
+ output: "70 degrees and sunny.",
+ },
+ ],
+ }
+ );
+
+ for await (const event of stream) {
+ console.log(event);
+ }
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const run = await client.beta.threads.runs.submitToolOutputs('run_id', {
+ thread_id: 'thread_id',
+ tool_outputs: [{}],
+ });
+
+ console.log(run.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ run, err := client.Beta.Threads.Runs.SubmitToolOutputs(
+ context.TODO(),
+ "thread_id",
+ "run_id",
+ openai.BetaThreadRunSubmitToolOutputsParams{
+ ToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{{}},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", run.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.beta.threads.runs.Run;
+ import com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ RunSubmitToolOutputsParams params = RunSubmitToolOutputsParams.builder()
+ .threadId("thread_id")
+ .runId("run_id")
+ .addToolOutput(RunSubmitToolOutputsParams.ToolOutput.builder().build())
+ .build();
+ Run run = client.beta().threads().runs().submitToolOutputs(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ run = openai.beta.threads.runs.submit_tool_outputs("run_id", thread_id: "thread_id", tool_outputs: [{}])
+
+ puts(run)
+ """,
+ },
+ response: """
+ event: thread.run.step.completed
+ data: {"id":"step_001","object":"thread.run.step","created_at":1710352449,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"completed","cancelled_at":null,"completed_at":1710352475,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[{"id":"call_iWr0kQ2EaYMaxNdl0v3KYkx7","type":"function","function":{"name":"get_current_weather","arguments":"{"location":"San Francisco, CA","unit":"fahrenheit"}","output":"70 degrees and sunny."}}]},"usage":{"prompt_tokens":291,"completion_tokens":24,"total_tokens":315}}
+
+ event: thread.run.queued
+ data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":1710352448,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.in_progress
+ data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710352475,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: thread.run.step.created
+ data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null}
+
+ event: thread.run.step.in_progress
+ data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null}
+
+ event: thread.message.created
+ data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.in_progress
+ data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"The","annotations":[]}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" current"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" weather"}}]}}
+
+ ...
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" sunny"}}]}}
+
+ event: thread.message.delta
+ data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"."}}]}}
+
+ event: thread.message.completed
+ data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710352477,"role":"assistant","content":[{"type":"text","text":{"value":"The current weather in San Francisco, CA is 70 degrees Fahrenheit and sunny.","annotations":[]}}],"metadata":{}}
+
+ event: thread.run.step.completed
+ data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710352477,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":{"prompt_tokens":329,"completion_tokens":18,"total_tokens":347}}
+
+ event: thread.run.completed
+ data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710352475,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710352477,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}}
+
+ event: done
+ data: [DONE]
+
+ """,
+ }
+ ],
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/uploads/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/uploads/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/uploads/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/uploads/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/uploads/routes.generated.tsp
new file mode 100644
index 000000000000..5f4ab4ed04f5
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/uploads/routes.generated.tsp
@@ -0,0 +1,106 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/uploads";
+using TypeSpec.Http;
+using OpenAI;
+namespace Azure.AI.Projects;
+@route("openai/v1/uploads")
+@tag("Uploads")
+interface Uploads {
+ /**
+ * Creates an upload from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create an upload")
+ @post
+ createUpload is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateUploadRequest;
+ },
+ OpenAI.Upload
+ >;
+
+ /**
+ * Cancels an upload by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Cancel an upload")
+ @route("{upload_id}/cancel")
+ @post
+ cancelUpload is OpenAIOperation<
+ {
+ /** The ID of the Upload. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ upload_id: string;
+ },
+ OpenAI.Upload
+ >;
+
+ /**
+ * Creates an upload from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create an upload")
+ @route("{upload_id}/complete")
+ @post
+ completeUpload is OpenAIOperation<
+ {
+ /** The ID of the Upload. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ upload_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.CompleteUploadRequest;
+ },
+ OpenAI.Upload
+ >;
+
+ /**
+ * Adds an upload part to the parent resource.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Add an upload part")
+ @route("{upload_id}/parts")
+ @post
+ addUploadPart is OpenAIOperation<
+ {
+ /** The ID of the Upload. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ upload_id: string;
+
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.AddUploadPartRequest;
+ },
+ OpenAI.UploadPart
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/uploads/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/uploads/routes.meta.tsp
new file mode 100644
index 000000000000..979d9bdb7623
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/uploads/routes.meta.tsp
@@ -0,0 +1,493 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.Uploads.createUpload,
+ "x-oaiMeta",
+ #{
+ name: "Create upload",
+ group: "uploads",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/uploads \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -d '{
+ "purpose": "fine-tune",
+ "filename": "training_examples.jsonl",
+ "bytes": 2147483648,
+ "mime_type": "text/jsonl",
+ "expires_after": {
+ "anchor": "created_at",
+ "seconds": 3600
+ }
+ }'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const upload = await client.uploads.create({
+ bytes: 0,
+ filename: 'filename',
+ mime_type: 'mime_type',
+ purpose: 'assistants',
+ });
+
+ console.log(upload.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload = client.uploads.create(
+ bytes=0,
+ filename="filename",
+ mime_type="mime_type",
+ purpose="assistants",
+ )
+ print(upload.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ upload, err := client.Uploads.New(context.TODO(), openai.UploadNewParams{
+ Bytes: 0,
+ Filename: "filename",
+ MimeType: "mime_type",
+ Purpose: openai.FilePurposeAssistants,
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", upload.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.files.FilePurpose;
+ import com.openai.models.uploads.Upload;
+ import com.openai.models.uploads.UploadCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ UploadCreateParams params = UploadCreateParams.builder()
+ .bytes(0L)
+ .filename("filename")
+ .mimeType("mime_type")
+ .purpose(FilePurpose.ASSISTANTS)
+ .build();
+ Upload upload = client.uploads().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload = openai.uploads.create(bytes: 0, filename: "filename", mime_type: "mime_type", purpose: :assistants)
+
+ puts(upload)
+ """,
+ },
+ response: """
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "pending",
+ "expires_at": 1719127296
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Uploads.cancelUpload,
+ "x-oaiMeta",
+ #{
+ name: "Cancel upload",
+ group: "uploads",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/uploads/upload_abc123/cancel
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const upload = await client.uploads.cancel('upload_abc123');
+
+ console.log(upload.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload = client.uploads.cancel(
+ "upload_abc123",
+ )
+ print(upload.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ upload, err := client.Uploads.Cancel(context.TODO(), "upload_abc123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", upload.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.uploads.Upload;
+ import com.openai.models.uploads.UploadCancelParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Upload upload = client.uploads().cancel("upload_abc123");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload = openai.uploads.cancel("upload_abc123")
+
+ puts(upload)
+ """,
+ },
+ response: """
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "cancelled",
+ "expires_at": 1719127296
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Uploads.completeUpload,
+ "x-oaiMeta",
+ #{
+ name: "Complete upload",
+ group: "uploads",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/uploads/upload_abc123/complete
+ -d '{
+ "part_ids": ["part_def456", "part_ghi789"]
+ }'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const upload = await client.uploads.complete('upload_abc123', { part_ids: ['string'] });
+
+ console.log(upload.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload = client.uploads.complete(
+ upload_id="upload_abc123",
+ part_ids=["string"],
+ )
+ print(upload.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ upload, err := client.Uploads.Complete(
+ context.TODO(),
+ "upload_abc123",
+ openai.UploadCompleteParams{
+ PartIDs: []string{"string"},
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", upload.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.uploads.Upload;
+ import com.openai.models.uploads.UploadCompleteParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ UploadCompleteParams params = UploadCompleteParams.builder()
+ .uploadId("upload_abc123")
+ .addPartId("string")
+ .build();
+ Upload upload = client.uploads().complete(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload = openai.uploads.complete("upload_abc123", part_ids: ["string"])
+
+ puts(upload)
+ """,
+ },
+ response: """
+ {
+ "id": "upload_abc123",
+ "object": "upload",
+ "bytes": 2147483648,
+ "created_at": 1719184911,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ "status": "completed",
+ "expires_at": 1719127296,
+ "file": {
+ "id": "file-xyz321",
+ "object": "file",
+ "bytes": 2147483648,
+ "created_at": 1719186911,
+ "expires_at": 1719127296,
+ "filename": "training_examples.jsonl",
+ "purpose": "fine-tune",
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.Uploads.addUploadPart,
+ "x-oaiMeta",
+ #{
+ name: "Add upload part",
+ group: "uploads",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/uploads/upload_abc123/parts
+ -F data="aHR0cHM6Ly9hcGkub3BlbmFpLmNvbS92MS91cGxvYWRz..."
+
+ """,
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const uploadPart = await client.uploads.parts.create('upload_abc123', {
+ data: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(uploadPart.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ upload_part = client.uploads.parts.create(
+ upload_id="upload_abc123",
+ data=b"Example data",
+ )
+ print(upload_part.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ uploadPart, err := client.Uploads.Parts.New(
+ context.TODO(),
+ "upload_abc123",
+ openai.UploadPartNewParams{
+ Data: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", uploadPart.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.uploads.parts.PartCreateParams;
+ import com.openai.models.uploads.parts.UploadPart;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ PartCreateParams params = PartCreateParams.builder()
+ .uploadId("upload_abc123")
+ .data(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ UploadPart uploadPart = client.uploads().parts().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ upload_part = openai.uploads.parts.create("upload_abc123", data: StringIO.new("Example data"))
+
+ puts(upload_part)
+ """,
+ },
+ response: """
+ {
+ "id": "part_def456",
+ "object": "upload.part",
+ "created_at": 1719185911,
+ "upload_id": "upload_abc123"
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/vectorstores/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/vectorstores/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/vectorstores/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/vectorstores/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/vectorstores/routes.generated.tsp
new file mode 100644
index 000000000000..9e7574477c1c
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/vectorstores/routes.generated.tsp
@@ -0,0 +1,468 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/common";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/vector-stores";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/vector_stores")
+@tag("Vector stores")
+interface VectorStores {
+ /**
+ * Lists vector stores matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List vector stores")
+ @list
+ @get
+ listVectorStores is OpenAIOperation<
+ {
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ 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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ before?: string;
+ },
+ OpenAI.ListVectorStoresResponse
+ >;
+
+ /**
+ * Creates a vector store from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a vector store")
+ @post
+ createVectorStore is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateVectorStoreRequest;
+ },
+ OpenAI.VectorStoreObject
+ >;
+
+ /**
+ * Deletes a vector store by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a vector store")
+ @route("{vector_store_id}")
+ @delete
+ deleteVectorStore is OpenAIOperation<
+ {
+ /** The ID of the vector store to delete. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+ },
+ OpenAI.DeleteVectorStoreResponse
+ >;
+
+ /**
+ * Retrieves a vector store by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a vector store")
+ @route("{vector_store_id}")
+ @get
+ getVectorStore is OpenAIOperation<
+ {
+ /** The ID of the vector store to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+ },
+ OpenAI.VectorStoreObject
+ >;
+
+ /**
+ * Updates a vector store with the supplied changes.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Update a vector store")
+ @route("{vector_store_id}")
+ @post
+ modifyVectorStore is OpenAIOperation<
+ {
+ /** The ID of the vector store to modify. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.UpdateVectorStoreRequest;
+ },
+ OpenAI.VectorStoreObject
+ >;
+
+ /**
+ * Creates a vector store file batch from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a vector store file batch")
+ @route("{vector_store_id}/file_batches")
+ @post
+ createVectorStoreFileBatch is OpenAIOperation<
+ {
+ /** The ID of the vector store for which to create a File Batch. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.CreateVectorStoreFileBatchRequest;
+ },
+ OpenAI.VectorStoreFileBatchObject
+ >;
+
+ /**
+ * Retrieves a vector store file batch by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a vector store file batch")
+ @route("{vector_store_id}/file_batches/{batch_id}")
+ @get
+ getVectorStoreFileBatch is OpenAIOperation<
+ {
+ /** The ID of the vector store that the file batch belongs to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The ID of the file batch being retrieved. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ batch_id: string;
+ },
+ OpenAI.VectorStoreFileBatchObject
+ >;
+
+ /**
+ * Cancels a vector store file batch by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Cancel a vector store file batch")
+ @route("{vector_store_id}/file_batches/{batch_id}/cancel")
+ @post
+ cancelVectorStoreFileBatch is OpenAIOperation<
+ {
+ /** The ID of the vector store that the file batch belongs to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The ID of the file batch to cancel. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ batch_id: string;
+ },
+ OpenAI.VectorStoreFileBatchObject
+ >;
+
+ /**
+ * Lists files in vector store batch matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List files in vector store batch")
+ @list
+ @route("{vector_store_id}/file_batches/{batch_id}/files")
+ @get
+ listFilesInVectorStoreBatch is OpenAIOperation<
+ {
+ /** The ID of the vector store that the files belong to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The ID of the file batch that the files belong to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ batch_id: string;
+
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ 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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ before?: string;
+
+ /** Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ filter?: OpenAI.ListVectorStoreFilesFilter;
+ },
+ OpenAI.ListVectorStoreFilesResponse
+ >;
+
+ /**
+ * Lists vector store files matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List vector store files")
+ @list
+ @route("{vector_store_id}/files")
+ @get
+ listVectorStoreFiles is OpenAIOperation<
+ {
+ /** The ID of the vector store that the files belong to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ limit?: integer = 20;
+
+ /** Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum = OrderEnum.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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ 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. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ before?: string;
+
+ /** Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ filter?: OpenAI.ListVectorStoreFilesFilter;
+ },
+ OpenAI.ListVectorStoreFilesResponse
+ >;
+
+ /**
+ * Creates a vector store file from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a vector store file")
+ @route("{vector_store_id}/files")
+ @post
+ createVectorStoreFile is OpenAIOperation<
+ {
+ /** The ID of the vector store for which to create a File. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.CreateVectorStoreFileRequest;
+ },
+ OpenAI.VectorStoreFileObject
+ >;
+
+ /**
+ * Deletes a vector store file by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a vector store file")
+ @route("{vector_store_id}/files/{file_id}")
+ @delete
+ deleteVectorStoreFile is OpenAIOperation<
+ {
+ /** The ID of the vector store that the file belongs to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The ID of the file to delete. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ file_id: string;
+ },
+ OpenAI.DeleteVectorStoreFileResponse
+ >;
+
+ /**
+ * Retrieves a vector store file by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a vector store file")
+ @route("{vector_store_id}/files/{file_id}")
+ @get
+ getVectorStoreFile is OpenAIOperation<
+ {
+ /** The ID of the vector store that the file belongs to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The ID of the file being retrieved. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ file_id: string;
+ },
+ OpenAI.VectorStoreFileObject
+ >;
+
+ /**
+ * Updates vector store file attributes with the supplied changes.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Update vector store file attributes")
+ @route("{vector_store_id}/files/{file_id}")
+ @post
+ updateVectorStoreFileAttributes is OpenAIOperation<
+ {
+ /** The ID of the vector store the file belongs to. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The ID of the file to update attributes. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ file_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.UpdateVectorStoreFileAttributesRequest;
+ },
+ OpenAI.VectorStoreFileObject
+ >;
+
+ /**
+ * Retrieves a vector store file content by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a vector store file content")
+ @route("{vector_store_id}/files/{file_id}/content")
+ @get
+ retrieveVectorStoreFileContent is OpenAIOperation<
+ {
+ /** The ID of the vector store. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The ID of the file within the vector store. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ file_id: string;
+ },
+ OpenAI.VectorStoreFileContentResponse
+ >;
+
+ /**
+ * Searchs a vector store.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Search a vector store")
+ @route("{vector_store_id}/search")
+ @post
+ searchVectorStore is OpenAIOperation<
+ {
+ /** The ID of the vector store to search. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ vector_store_id: string;
+
+ /** The request body. */
+ @body
+ body: OpenAI.VectorStoreSearchRequest;
+ },
+ OpenAI.VectorStoreSearchResultsPage
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/vectorstores/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/vectorstores/routes.meta.tsp
new file mode 100644
index 000000000000..9c40d790b112
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/vectorstores/routes.meta.tsp
@@ -0,0 +1,2199 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.VectorStores.listVectorStores,
+ "x-oaiMeta",
+ #{
+ name: "List vector stores",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.list()
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStores = await openai.vectorStores.list();
+ console.log(vectorStores);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStore of client.vectorStores.list()) {
+ console.log(vectorStore.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.List(context.TODO(), openai.VectorStoreListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStoreListPage;
+ import com.openai.models.vectorstores.VectorStoreListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreListPage page = client.vectorStores().list();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.list
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ",
+ "description": "Contains commonly asked questions and answers, organized by topic.",
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ },
+ {
+ "id": "vs_abc456",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ v2",
+ "description": null,
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ }
+ ],
+ "first_id": "vs_abc123",
+ "last_id": "vs_abc456",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.VectorStores.listVectorStores, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.createVectorStore,
+ "x-oaiMeta",
+ #{
+ name: "Create vector store",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "name": "Support FAQ"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store = client.vector_stores.create()
+ print(vector_store.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStore = await openai.vectorStores.create({
+ name: "Support FAQ"
+ });
+ console.log(vectorStore);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStore = await client.vectorStores.create();
+
+ console.log(vectorStore.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStore, err := client.VectorStores.New(context.TODO(), openai.VectorStoreNewParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStore.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStore;
+ import com.openai.models.vectorstores.VectorStoreCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStore vectorStore = client.vectorStores().create();
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store = openai.vector_stores.create
+
+ puts(vector_store)
+ """,
+ },
+ response: """
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ",
+ "description": "Contains commonly asked questions and answers, organized by topic.",
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.deleteVectorStore,
+ "x-oaiMeta",
+ #{
+ name: "Delete vector store",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -X DELETE
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_deleted = client.vector_stores.delete(
+ "vector_store_id",
+ )
+ print(vector_store_deleted.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedVectorStore = await openai.vectorStores.delete(
+ "vs_abc123"
+ );
+ console.log(deletedVectorStore);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreDeleted = await client.vectorStores.delete('vector_store_id');
+
+ console.log(vectorStoreDeleted.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreDeleted, err := client.VectorStores.Delete(context.TODO(), "vector_store_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreDeleted.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStoreDeleteParams;
+ import com.openai.models.vectorstores.VectorStoreDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreDeleted vectorStoreDeleted = client.vectorStores().delete("vector_store_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_deleted = openai.vector_stores.delete("vector_store_id")
+
+ puts(vector_store_deleted)
+ """,
+ },
+ response: """
+ {
+ id: "vs_abc123",
+ object: "vector_store.deleted",
+ deleted: true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.getVectorStore,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve vector store",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store = client.vector_stores.retrieve(
+ "vector_store_id",
+ )
+ print(vector_store.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStore = await openai.vectorStores.retrieve(
+ "vs_abc123"
+ );
+ console.log(vectorStore);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStore = await client.vectorStores.retrieve('vector_store_id');
+
+ console.log(vectorStore.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStore, err := client.VectorStores.Get(context.TODO(), "vector_store_id")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStore.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStore;
+ import com.openai.models.vectorstores.VectorStoreRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStore vectorStore = client.vectorStores().retrieve("vector_store_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store = openai.vector_stores.retrieve("vector_store_id")
+
+ puts(vector_store)
+ """,
+ },
+ response: """
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.modifyVectorStore,
+ "x-oaiMeta",
+ #{
+ name: "Modify vector store",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+ -d '{
+ "name": "Support FAQ"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store = client.vector_stores.update(
+ vector_store_id="vector_store_id",
+ )
+ print(vector_store.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStore = await openai.vectorStores.update(
+ "vs_abc123",
+ {
+ name: "Support FAQ"
+ }
+ );
+ console.log(vectorStore);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStore = await client.vectorStores.update('vector_store_id');
+
+ console.log(vectorStore.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStore, err := client.VectorStores.Update(
+ context.TODO(),
+ "vector_store_id",
+ openai.VectorStoreUpdateParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStore.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStore;
+ import com.openai.models.vectorstores.VectorStoreUpdateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStore vectorStore = client.vectorStores().update("vector_store_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store = openai.vector_stores.update("vector_store_id")
+
+ puts(vector_store)
+ """,
+ },
+ response: """
+ {
+ "id": "vs_abc123",
+ "object": "vector_store",
+ "created_at": 1699061776,
+ "name": "Support FAQ",
+ "description": "Contains commonly asked questions and answers, organized by topic.",
+ "bytes": 139920,
+ "file_counts": {
+ "in_progress": 0,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 3
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.createVectorStoreFileBatch,
+ "x-oaiMeta",
+ #{
+ name: "Create vector store file batch",
+ group: "vector_stores",
+ description: """
+ Attaches multiple files to a vector store in one request. This is the recommended approach for multi-file ingestion, especially because per-vector-store file attach writes are rate-limited (300 requests/minute shared with `/vector_stores/{vector_store_id}/files`).
+
+ """,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "files": [
+ {
+ "file_id": "file-abc123",
+ "attributes": {"category": "finance"}
+ },
+ {
+ "file_id": "file-abc456",
+ "chunking_strategy": {
+ "type": "static",
+ "max_chunk_size_tokens": 1200,
+ "chunk_overlap_tokens": 200
+ }
+ }
+ ]
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_batch = client.vector_stores.file_batches.create(
+ vector_store_id="vs_abc123",
+ )
+ print(vector_store_file_batch.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const myVectorStoreFileBatch = await openai.vectorStores.fileBatches.create(
+ "vs_abc123",
+ {
+ files: [
+ {
+ file_id: "file-abc123",
+ attributes: { category: "finance" },
+ },
+ {
+ file_id: "file-abc456",
+ chunking_strategy: {
+ type: "static",
+ max_chunk_size_tokens: 1200,
+ chunk_overlap_tokens: 200,
+ },
+ },
+ ]
+ }
+ );
+ console.log(myVectorStoreFileBatch);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileBatch = await client.vectorStores.fileBatches.create('vs_abc123');
+
+ console.log(vectorStoreFileBatch.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileBatch, err := client.VectorStores.FileBatches.New(
+ context.TODO(),
+ "vs_abc123",
+ openai.VectorStoreFileBatchNewParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileBatch.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchCreateParams;
+ import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().create("vs_abc123");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_batch = openai.vector_stores.file_batches.create("vs_abc123")
+
+ puts(vector_store_file_batch)
+ """,
+ },
+ response: """
+ {
+ "id": "vsfb_abc123",
+ "object": "vector_store.file_batch",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123",
+ "status": "in_progress",
+ "file_counts": {
+ "in_progress": 1,
+ "completed": 1,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 0,
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.getVectorStoreFileBatch,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve vector store file batch",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches/vsfb_abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_batch = client.vector_stores.file_batches.retrieve(
+ batch_id="vsfb_abc123",
+ vector_store_id="vs_abc123",
+ )
+ print(vector_store_file_batch.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFileBatch = await openai.vectorStores.fileBatches.retrieve(
+ "vsfb_abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(vectorStoreFileBatch);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileBatch = await client.vectorStores.fileBatches.retrieve('vsfb_abc123', {
+ vector_store_id: 'vs_abc123',
+ });
+
+ console.log(vectorStoreFileBatch.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileBatch, err := client.VectorStores.FileBatches.Get(
+ context.TODO(),
+ "vs_abc123",
+ "vsfb_abc123",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileBatch.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchRetrieveParams;
+ import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileBatchRetrieveParams params = FileBatchRetrieveParams.builder()
+ .vectorStoreId("vs_abc123")
+ .batchId("vsfb_abc123")
+ .build();
+ VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_batch = openai.vector_stores.file_batches.retrieve("vsfb_abc123", vector_store_id: "vs_abc123")
+
+ puts(vector_store_file_batch)
+ """,
+ },
+ response: """
+ {
+ "id": "vsfb_abc123",
+ "object": "vector_store.file_batch",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123",
+ "status": "in_progress",
+ "file_counts": {
+ "in_progress": 1,
+ "completed": 1,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 0,
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.cancelVectorStoreFileBatch,
+ "x-oaiMeta",
+ #{
+ name: "Cancel vector store file batch",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/cancel \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -X POST
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_batch = client.vector_stores.file_batches.cancel(
+ batch_id="batch_id",
+ vector_store_id="vector_store_id",
+ )
+ print(vector_store_file_batch.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedVectorStoreFileBatch = await openai.vectorStores.fileBatches.cancel(
+ "vsfb_abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(deletedVectorStoreFileBatch);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileBatch = await client.vectorStores.fileBatches.cancel('batch_id', {
+ vector_store_id: 'vector_store_id',
+ });
+
+ console.log(vectorStoreFileBatch.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileBatch, err := client.VectorStores.FileBatches.Cancel(
+ context.TODO(),
+ "vector_store_id",
+ "batch_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileBatch.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchCancelParams;
+ import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileBatchCancelParams params = FileBatchCancelParams.builder()
+ .vectorStoreId("vector_store_id")
+ .batchId("batch_id")
+ .build();
+ VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().cancel(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_batch = openai.vector_stores.file_batches.cancel("batch_id", vector_store_id: "vector_store_id")
+
+ puts(vector_store_file_batch)
+ """,
+ },
+ response: """
+ {
+ "id": "vsfb_abc123",
+ "object": "vector_store.file_batch",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123",
+ "status": "in_progress",
+ "file_counts": {
+ "in_progress": 12,
+ "completed": 3,
+ "failed": 0,
+ "cancelled": 0,
+ "total": 15,
+ }
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.listFilesInVectorStoreBatch,
+ "x-oaiMeta",
+ #{
+ name: "List vector store files in a batch",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/files \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.file_batches.list_files(
+ batch_id="batch_id",
+ vector_store_id="vector_store_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFiles = await openai.vectorStores.fileBatches.listFiles(
+ "vsfb_abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(vectorStoreFiles);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStoreFile of client.vectorStores.fileBatches.listFiles('batch_id', {
+ vector_store_id: 'vector_store_id',
+ })) {
+ console.log(vectorStoreFile.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.FileBatches.ListFiles(
+ context.TODO(),
+ "vector_store_id",
+ "batch_id",
+ openai.VectorStoreFileBatchListFilesParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.filebatches.FileBatchListFilesPage;
+ import com.openai.models.vectorstores.filebatches.FileBatchListFilesParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileBatchListFilesParams params = FileBatchListFilesParams.builder()
+ .vectorStoreId("vector_store_id")
+ .batchId("batch_id")
+ .build();
+ FileBatchListFilesPage page = client.vectorStores().fileBatches().listFiles(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.file_batches.list_files("batch_id", vector_store_id: "vector_store_id")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ },
+ {
+ "id": "file-abc456",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ }
+ ],
+ "first_id": "file-abc123",
+ "last_id": "file-abc456",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.listFilesInVectorStoreBatch,
+ "x-ms-list",
+ true
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.listVectorStoreFiles,
+ "x-oaiMeta",
+ #{
+ name: "List vector store files",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.files.list(
+ vector_store_id="vector_store_id",
+ )
+ page = page.data[0]
+ print(page.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFiles = await openai.vectorStores.files.list(
+ "vs_abc123"
+ );
+ console.log(vectorStoreFiles);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStoreFile of client.vectorStores.files.list('vector_store_id')) {
+ console.log(vectorStoreFile.id);
+ }
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.Files.List(
+ context.TODO(),
+ "vector_store_id",
+ openai.VectorStoreFileListParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileListPage;
+ import com.openai.models.vectorstores.files.FileListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileListPage page = client.vectorStores().files().list("vector_store_id");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.files.list("vector_store_id")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ },
+ {
+ "id": "file-abc456",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abc123"
+ }
+ ],
+ "first_id": "file-abc123",
+ "last_id": "file-abc456",
+ "has_more": false
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.listVectorStoreFiles,
+ "x-ms-list",
+ true
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.createVectorStoreFile,
+ "x-oaiMeta",
+ #{
+ name: "Create vector store file",
+ group: "vector_stores",
+ description: """
+ Attaches one file to a vector store. File attach writes are rate-limited per vector store (300 requests/minute shared with `/vector_stores/{vector_store_id}/file_batches`), so use file batches when uploading multiple files.
+
+ """,
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -d '{
+ "file_id": "file-abc123"
+ }'
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file = client.vector_stores.files.create(
+ vector_store_id="vs_abc123",
+ file_id="file_id",
+ )
+ print(vector_store_file.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const myVectorStoreFile = await openai.vectorStores.files.create(
+ "vs_abc123",
+ {
+ file_id: "file-abc123"
+ }
+ );
+ console.log(myVectorStoreFile);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFile = await client.vectorStores.files.create('vs_abc123', { file_id: 'file_id' });
+
+ console.log(vectorStoreFile.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFile, err := client.VectorStores.Files.New(
+ context.TODO(),
+ "vs_abc123",
+ openai.VectorStoreFileNewParams{
+ FileID: "file_id",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFile.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileCreateParams;
+ import com.openai.models.vectorstores.files.VectorStoreFile;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileCreateParams params = FileCreateParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file_id")
+ .build();
+ VectorStoreFile vectorStoreFile = client.vectorStores().files().create(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file = openai.vector_stores.files.create("vs_abc123", file_id: "file_id")
+
+ puts(vector_store_file)
+ """,
+ },
+ response: """
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "usage_bytes": 1234,
+ "vector_store_id": "vs_abcd",
+ "status": "completed",
+ "last_error": null
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.deleteVectorStoreFile,
+ "x-oaiMeta",
+ #{
+ name: "Delete vector store file",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2" \\
+ -X DELETE
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file_deleted = client.vector_stores.files.delete(
+ file_id="file_id",
+ vector_store_id="vector_store_id",
+ )
+ print(vector_store_file_deleted.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const deletedVectorStoreFile = await openai.vectorStores.files.delete(
+ "file-abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(deletedVectorStoreFile);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFileDeleted = await client.vectorStores.files.delete('file_id', {
+ vector_store_id: 'vector_store_id',
+ });
+
+ console.log(vectorStoreFileDeleted.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFileDeleted, err := client.VectorStores.Files.Delete(
+ context.TODO(),
+ "vector_store_id",
+ "file_id",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFileDeleted.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileDeleteParams;
+ import com.openai.models.vectorstores.files.VectorStoreFileDeleted;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileDeleteParams params = FileDeleteParams.builder()
+ .vectorStoreId("vector_store_id")
+ .fileId("file_id")
+ .build();
+ VectorStoreFileDeleted vectorStoreFileDeleted = client.vectorStores().files().delete(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file_deleted = openai.vector_stores.files.delete("file_id", vector_store_id: "vector_store_id")
+
+ puts(vector_store_file_deleted)
+ """,
+ },
+ response: """
+ {
+ id: "file-abc123",
+ object: "vector_store.file.deleted",
+ deleted: true
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.getVectorStoreFile,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve vector store file",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -H "OpenAI-Beta: assistants=v2"
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file = client.vector_stores.files.retrieve(
+ file_id="file-abc123",
+ vector_store_id="vs_abc123",
+ )
+ print(vector_store_file.id)
+ """,
+ javascript: """
+ import OpenAI from "openai";
+ const openai = new OpenAI();
+
+ async function main() {
+ const vectorStoreFile = await openai.vectorStores.files.retrieve(
+ "file-abc123",
+ { vector_store_id: "vs_abc123" }
+ );
+ console.log(vectorStoreFile);
+ }
+
+ main();
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFile = await client.vectorStores.files.retrieve('file-abc123', {
+ vector_store_id: 'vs_abc123',
+ });
+
+ console.log(vectorStoreFile.id);
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFile, err := client.VectorStores.Files.Get(
+ context.TODO(),
+ "vs_abc123",
+ "file-abc123",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFile.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileRetrieveParams;
+ import com.openai.models.vectorstores.files.VectorStoreFile;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileRetrieveParams params = FileRetrieveParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file-abc123")
+ .build();
+ VectorStoreFile vectorStoreFile = client.vectorStores().files().retrieve(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file = openai.vector_stores.files.retrieve("file-abc123", vector_store_id: "vs_abc123")
+
+ puts(vector_store_file)
+ """,
+ },
+ response: """
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abcd",
+ "status": "completed",
+ "last_error": null
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.updateVectorStoreFileAttributes,
+ "x-oaiMeta",
+ #{
+ name: "Update vector store file attributes",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id} \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{"attributes": {"key1": "value1", "key2": 2}}'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const vectorStoreFile = await client.vectorStores.files.update('file-abc123', {
+ vector_store_id: 'vs_abc123',
+ attributes: { foo: 'string' },
+ });
+
+ console.log(vectorStoreFile.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ vector_store_file = client.vector_stores.files.update(
+ file_id="file-abc123",
+ vector_store_id="vs_abc123",
+ attributes={
+ "foo": "string"
+ },
+ )
+ print(vector_store_file.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ vectorStoreFile, err := client.VectorStores.Files.Update(
+ context.TODO(),
+ "vs_abc123",
+ "file-abc123",
+ openai.VectorStoreFileUpdateParams{
+ Attributes: map[string]openai.VectorStoreFileUpdateParamsAttributeUnion{
+ "foo": {
+ OfString: openai.String("string"),
+ },
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", vectorStoreFile.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.JsonValue;
+ import com.openai.models.vectorstores.files.FileUpdateParams;
+ import com.openai.models.vectorstores.files.VectorStoreFile;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileUpdateParams params = FileUpdateParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file-abc123")
+ .attributes(FileUpdateParams.Attributes.builder()
+ .putAdditionalProperty("foo", JsonValue.from("string"))
+ .build())
+ .build();
+ VectorStoreFile vectorStoreFile = client.vectorStores().files().update(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ vector_store_file = openai.vector_stores.files.update(
+ "file-abc123",
+ vector_store_id: "vs_abc123",
+ attributes: {foo: "string"}
+ )
+
+ puts(vector_store_file)
+ """,
+ },
+ response: """
+ {
+ "id": "file-abc123",
+ "object": "vector_store.file",
+ "usage_bytes": 1234,
+ "created_at": 1699061776,
+ "vector_store_id": "vs_abcd",
+ "status": "completed",
+ "last_error": null,
+ "chunking_strategy": {...},
+ "attributes": {"key1": "value1", "key2": 2}
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.retrieveVectorStoreFileContent,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve vector store file content",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl \\
+ https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123/content \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const fileContentResponse of client.vectorStores.files.content('file-abc123', {
+ vector_store_id: 'vs_abc123',
+ })) {
+ console.log(fileContentResponse.text);
+ }
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.files.content(
+ file_id="file-abc123",
+ vector_store_id="vs_abc123",
+ )
+ page = page.data[0]
+ print(page.text)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.Files.Content(
+ context.TODO(),
+ "vs_abc123",
+ "file-abc123",
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.files.FileContentPage;
+ import com.openai.models.vectorstores.files.FileContentParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ FileContentParams params = FileContentParams.builder()
+ .vectorStoreId("vs_abc123")
+ .fileId("file-abc123")
+ .build();
+ FileContentPage page = client.vectorStores().files().content(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.files.content("file-abc123", vector_store_id: "vs_abc123")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "file_id": "file-abc123",
+ "filename": "example.txt",
+ "attributes": {"key": "value"},
+ "content": [
+ {"type": "text", "text": "..."},
+ ...
+ ]
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VectorStores.searchVectorStore,
+ "x-oaiMeta",
+ #{
+ name: "Search vector store",
+ group: "vector_stores",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X POST \\
+ https://api.openai.com/v1/vector_stores/vs_abc123/search \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{"query": "What is the return policy?", "filters": {...}}'
+
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const vectorStoreSearchResponse of client.vectorStores.search('vs_abc123', {
+ query: 'string',
+ })) {
+ console.log(vectorStoreSearchResponse.file_id);
+ }
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.vector_stores.search(
+ vector_store_id="vs_abc123",
+ query="string",
+ )
+ page = page.data[0]
+ print(page.file_id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.VectorStores.Search(
+ context.TODO(),
+ "vs_abc123",
+ openai.VectorStoreSearchParams{
+ Query: openai.VectorStoreSearchParamsQueryUnion{
+ OfString: openai.String("string"),
+ },
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.vectorstores.VectorStoreSearchPage;
+ import com.openai.models.vectorstores.VectorStoreSearchParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VectorStoreSearchParams params = VectorStoreSearchParams.builder()
+ .vectorStoreId("vs_abc123")
+ .query("string")
+ .build();
+ VectorStoreSearchPage page = client.vectorStores().search(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.vector_stores.search("vs_abc123", query: "string")
+
+ puts(page)
+ """,
+ },
+ response: """
+ {
+ "object": "vector_store.search_results.page",
+ "search_query": "What is the return policy?",
+ "data": [
+ {
+ "file_id": "file_123",
+ "filename": "document.pdf",
+ "score": 0.95,
+ "attributes": {
+ "author": "John Doe",
+ "date": "2023-01-01"
+ },
+ "content": [
+ {
+ "type": "text",
+ "text": "Relevant chunk"
+ }
+ ]
+ },
+ {
+ "file_id": "file_456",
+ "filename": "notes.txt",
+ "score": 0.89,
+ "attributes": {
+ "author": "Jane Smith",
+ "date": "2023-01-02"
+ },
+ "content": [
+ {
+ "type": "text",
+ "text": "Sample text content from the vector store."
+ }
+ ]
+ }
+ ],
+ "has_more": false,
+ "next_page": null
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/video/main.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/video/main.tsp
new file mode 100644
index 000000000000..b00b5ded2ab6
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/video/main.tsp
@@ -0,0 +1,2 @@
+import "./routes.generated.tsp";
+import "./routes.meta.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/video/routes.generated.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/video/routes.generated.tsp
new file mode 100644
index 000000000000..244dcbb00be3
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/video/routes.generated.tsp
@@ -0,0 +1,352 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "../../common/models.tsp";
+import "@typespec/http";
+import "@azure-tools/openai-typespec/models/common";
+import "@typespec/openapi";
+import "@azure-tools/openai-typespec/models/video";
+using TypeSpec.Http;
+using OpenAI;
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@route("openai/v1/videos")
+@tag("Videos")
+interface VideoGeneration {
+ /**
+ * Lists videos matching the request filters.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("List videos")
+ @list
+ @get
+ listVideos is OpenAIOperation<
+ {
+ /** Number of items to retrieve */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @minValue(0)
+ @maxValue(100)
+ @query(#{ explode: true })
+ limit?: integer;
+
+ /** Sort order of results by timestamp. Use `asc` for ascending order or `desc` for descending order. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ order?: OpenAI.OrderEnum;
+
+ /** Identifier for the last item from the previous pagination request */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @extension("x-ms-list-continuation-token", true)
+ @continuationToken
+ @query(#{ explode: true })
+ after?: string;
+ },
+ OpenAI.VideoListResource
+ >;
+
+ /**
+ * Creates a video from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a video")
+ @post
+ createVideo is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateVideoMultipartBody;
+ },
+ OpenAI.VideoResource
+ >;
+
+ /**
+ * Creates a video character from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a video character")
+ @route("characters")
+ @post
+ createVideoCharacter is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateVideoCharacterBody;
+ },
+ OpenAI.VideoCharacterResource
+ >;
+
+ /**
+ * Retrieves a video character by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a video character")
+ @route("characters/{character_id}")
+ @get
+ getVideoCharacter is OpenAIOperation<
+ {
+ /** The identifier of the character to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ character_id: string;
+ },
+ OpenAI.VideoCharacterResource
+ >;
+
+ /**
+ * Creates a video edit from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a video edit")
+ @sharedRoute
+ @route("edits")
+ @post
+ @extension("x-ms-summary-override", "Create a video edit")
+ @extension(
+ "x-ms-description-override",
+ "Creates a video edit from the supplied request."
+ )
+ @extension("x-ms-request-body-description-override", "The request body.")
+ createVideoEditMultipart is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateVideoEditMultipartBody;
+ },
+ OpenAI.VideoResource
+ >;
+
+ /**
+ * Creates a video edit from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a video edit")
+ @sharedRoute
+ @route("edits")
+ @post
+ @extension("x-ms-summary-override", "Create a video edit")
+ @extension(
+ "x-ms-description-override",
+ "Creates a video edit from the supplied request."
+ )
+ @extension("x-ms-request-body-description-override", "The request body.")
+ createVideoEditJson is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateVideoEditJsonBody;
+ },
+ OpenAI.VideoResource
+ >;
+
+ /**
+ * Extends a video from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Extend a video")
+ @sharedRoute
+ @route("extensions")
+ @post
+ @extension("x-ms-summary-override", "Extend a video")
+ @extension(
+ "x-ms-description-override",
+ "Extends a video from the supplied request."
+ )
+ @extension("x-ms-request-body-description-override", "The request body.")
+ createVideoExtendMultipart is OpenAIOperation<
+ {
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateVideoExtendMultipartBody;
+ },
+ OpenAI.VideoResource
+ >;
+
+ /**
+ * Extends a video from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Extend a video")
+ @sharedRoute
+ @route("extensions")
+ @post
+ @extension("x-ms-summary-override", "Extend a video")
+ @extension(
+ "x-ms-description-override",
+ "Extends a video from the supplied request."
+ )
+ @extension("x-ms-request-body-description-override", "The request body.")
+ createVideoExtendJson is OpenAIOperation<
+ {
+ /** The request body. */
+ @body
+ body: OpenAI.CreateVideoExtendJsonBody;
+ },
+ OpenAI.VideoResource
+ >;
+
+ /**
+ * Deletes a video by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Delete a video")
+ @route("{video_id}")
+ @delete
+ deleteVideo is OpenAIOperation<
+ {
+ /** The identifier of the video to delete. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ video_id: string;
+ },
+ OpenAI.DeletedVideoResource
+ >;
+
+ /**
+ * Retrieves a video by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a video")
+ @route("{video_id}")
+ @get
+ getVideo is OpenAIOperation<
+ {
+ /** The identifier of the video to retrieve. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ video_id: string;
+ },
+ OpenAI.VideoResource
+ >;
+
+ /**
+ * Retrieves a video content by its identifier.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/response-schema-problem" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Get a video content")
+ @route("{video_id}/content")
+ @get
+ retrieveVideoContent is OpenAIOperation<
+ {
+ /** The identifier of the video whose media to download. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ video_id: string;
+
+ /** Which downloadable asset to return. Defaults to the MP4 video. */
+ #suppress "@azure-tools/typespec-azure-core/no-query-explode" "Auto-suppressed warnings non-applicable rules during import."
+ @query(#{ explode: true })
+ variant?: OpenAI.VideoContentVariant;
+ },
+ {
+ @header
+ contentType: "video/mp4";
+
+ /** The request body. */
+ @body
+ body: bytes;
+ }
+ >;
+
+ /**
+ * Creates a video remix from the supplied request.
+ */
+ #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "OpenAI-based operations are not conventionally versioned"
+ #suppress "@azure-tools/typespec-azure-core/no-response-body" "OpenAI response templates may intentionally model empty success responses."
+ #suppress "@azure-tools/typespec-azure-core/byos" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Auto-suppressed warnings non-applicable rules during import."
+ #suppress "@azure-tools/typespec-azure-core/no-openapi" "Auto-suppressed warnings non-applicable rules during import."
+ @summary("Create a video remix")
+ @route("{video_id}/remix")
+ @post
+ createVideoRemix is OpenAIOperation<
+ {
+ /** The identifier of the completed video to remix. */
+ #suppress "@azure-tools/typespec-azure-core/casing-style" "Auto-suppressed warnings non-applicable rules during import."
+ @path
+ video_id: string;
+
+ /** The content type of the request body. */
+ @header
+ contentType: "multipart/form-data";
+
+ /** The multipart request body. */
+ @multipartBody
+ body: OpenAI.CreateVideoRemixBody;
+ },
+ OpenAI.VideoResource
+ >;
+}
diff --git a/specification/ai-foundry/data-plane/Foundry/src/openai/video/routes.meta.tsp b/specification/ai-foundry/data-plane/Foundry/src/openai/video/routes.meta.tsp
new file mode 100644
index 000000000000..b2c000f4324b
--- /dev/null
+++ b/specification/ai-foundry/data-plane/Foundry/src/openai/video/routes.meta.tsp
@@ -0,0 +1,1297 @@
+// -----------------------------------------------------------------------------
+//
+// This file has been automatically generated. Do not manually edit this file.
+//
+// -----------------------------------------------------------------------------
+
+import "./routes.generated.tsp";
+import "@typespec/openapi";
+using TypeSpec.OpenAPI;
+namespace Azure.AI.Projects;
+@@extension(
+ Azure.AI.Projects.VideoGeneration.listVideos,
+ "x-oaiMeta",
+ #{
+ name: "List videos",
+ group: "videos",
+ path: "list for the organization.",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/videos \\
+ -H "Authorization: Bearer $OPENAI_API_KEY"
+
+ """,
+ javascript: """
+ import OpenAI from 'openai';
+
+ const openai = new OpenAI();
+
+ // Automatically fetches more pages as needed.
+ for await (const video of openai.videos.list()) {
+ console.log(video.id);
+ }
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ page = client.videos.list()
+ page = page.data[0]
+ print(page.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ page, err := client.Videos.List(context.TODO(), openai.VideoListParams{})
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", page)
+ }
+
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ page = openai.videos.list
+
+ puts(page)
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoListPage;
+ import com.openai.models.videos.VideoListParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoListPage page = client.videos().list();
+ }
+ }
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ // Automatically fetches more pages as needed.
+ for await (const video of client.videos.list()) {
+ console.log(video.id);
+ }
+ """,
+ },
+ response: """
+ {
+ "data": [
+ {
+ "id": "video_123",
+ "object": "video",
+ "model": "sora-2",
+ "status": "completed"
+ }
+ ],
+ "object": "list"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(Azure.AI.Projects.VideoGeneration.listVideos, "x-ms-list", true);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.createVideo,
+ "x-oaiMeta",
+ #{
+ name: "Create video",
+ group: "videos",
+ path: "create",
+ examples: #{
+ request: #{
+ curl: """
+ curl https://api.openai.com/v1/videos \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -F "model=sora-2" \\
+ -F "prompt=A calico cat playing a piano on stage"
+
+ """,
+ javascript: """
+ import OpenAI from 'openai';
+
+ const openai = new OpenAI();
+
+ const video = await openai.videos.create({ prompt: 'A calico cat playing a piano on stage' });
+
+ console.log(video.id);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.create(
+ prompt="x",
+ )
+ print(video.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.New(context.TODO(), openai.VideoNewParams{
+ Prompt: "x",
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.create(prompt: "x")
+
+ puts(video)
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoCreateParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoCreateParams params = VideoCreateParams.builder()
+ .prompt("x")
+ .build();
+ Video video = client.videos().create(params);
+ }
+ }
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.create({ prompt: 'x' });
+
+ console.log(video.id);
+ """,
+ },
+ response: """
+ {
+ "id": "video_123",
+ "object": "video",
+ "model": "sora-2",
+ "status": "queued",
+ "progress": 0,
+ "created_at": 1712697600,
+ "size": "1024x1792",
+ "seconds": "8",
+ "quality": "standard"
+ }
+
+ """,
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.createVideoCharacter,
+ "x-oaiMeta",
+ #{
+ examples: #{
+ response: "",
+ request: #{
+ `node.js`: """
+ import fs from 'fs';
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.videos.createCharacter({
+ name: 'x',
+ video: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(response.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.videos.create_character(
+ name="x",
+ video=b"Example data",
+ )
+ print(response.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Videos.NewCharacter(context.TODO(), openai.VideoNewCharacterParams{
+ Name: "x",
+ Video: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoCreateCharacterParams;
+ import com.openai.models.videos.VideoCreateCharacterResponse;
+ import java.io.ByteArrayInputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoCreateCharacterParams params = VideoCreateCharacterParams.builder()
+ .name("x")
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ VideoCreateCharacterResponse response = client.videos().createCharacter(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.videos.create_character(name: "x", video: StringIO.new("Example data"))
+
+ puts(response)
+ """,
+ },
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.getVideoCharacter,
+ "x-oaiMeta",
+ #{
+ examples: #{
+ response: "",
+ request: #{
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.videos.getCharacter('char_123');
+
+ console.log(response.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.videos.get_character(
+ "char_123",
+ )
+ print(response.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Videos.GetCharacter(context.TODO(), "char_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoGetCharacterParams;
+ import com.openai.models.videos.VideoGetCharacterResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoGetCharacterResponse response = client.videos().getCharacter("char_123");
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.videos.get_character("char_123")
+
+ puts(response)
+ """,
+ },
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.createVideoEditMultipart,
+ "x-oaiMeta",
+ #{
+ examples: #{
+ response: "",
+ request: #{
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.edit({ prompt: 'x', video: fs.createReadStream('path/to/file') });
+
+ console.log(video.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.edit(
+ prompt="x",
+ video=b"Example data",
+ )
+ print(video.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Edit(context.TODO(), openai.VideoEditParams{
+ Prompt: "x",
+ Video: openai.VideoEditParamsVideoUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoEditParams;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoEditParams params = VideoEditParams.builder()
+ .prompt("x")
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ Video video = client.videos().edit(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.edit(prompt: "x", video: StringIO.new("Example data"))
+
+ puts(video)
+ """,
+ },
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.createVideoEditJson,
+ "x-oaiMeta",
+ #{
+ examples: #{
+ response: "",
+ request: #{
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.edit({ prompt: 'x', video: fs.createReadStream('path/to/file') });
+
+ console.log(video.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.edit(
+ prompt="x",
+ video=b"Example data",
+ )
+ print(video.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Edit(context.TODO(), openai.VideoEditParams{
+ Prompt: "x",
+ Video: openai.VideoEditParamsVideoUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoEditParams;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoEditParams params = VideoEditParams.builder()
+ .prompt("x")
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ Video video = client.videos().edit(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.edit(prompt: "x", video: StringIO.new("Example data"))
+
+ puts(video)
+ """,
+ },
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.createVideoExtendMultipart,
+ "x-oaiMeta",
+ #{
+ examples: #{
+ response: "",
+ request: #{
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.extend({
+ prompt: 'x',
+ seconds: '4',
+ video: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(video.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.extend(
+ prompt="x",
+ seconds="4",
+ video=b"Example data",
+ )
+ print(video.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Extend(context.TODO(), openai.VideoExtendParams{
+ Prompt: "x",
+ Seconds: openai.VideoSeconds4,
+ Video: openai.VideoExtendParamsVideoUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoExtendParams;
+ import com.openai.models.videos.VideoSeconds;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoExtendParams params = VideoExtendParams.builder()
+ .prompt("x")
+ .seconds(VideoSeconds._4)
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ Video video = client.videos().extend(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.extend_(prompt: "x", seconds: :"4", video: StringIO.new("Example data"))
+
+ puts(video)
+ """,
+ },
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.createVideoExtendJson,
+ "x-oaiMeta",
+ #{
+ examples: #{
+ response: "",
+ request: #{
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.extend({
+ prompt: 'x',
+ seconds: '4',
+ video: fs.createReadStream('path/to/file'),
+ });
+
+ console.log(video.id);
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.extend(
+ prompt="x",
+ seconds="4",
+ video=b"Example data",
+ )
+ print(video.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Extend(context.TODO(), openai.VideoExtendParams{
+ Prompt: "x",
+ Seconds: openai.VideoSeconds4,
+ Video: openai.VideoExtendParamsVideoUnion{
+ OfFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),
+ },
+ })
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoExtendParams;
+ import com.openai.models.videos.VideoSeconds;
+ import java.io.ByteArrayInputStream;
+ import java.io.InputStream;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoExtendParams params = VideoExtendParams.builder()
+ .prompt("x")
+ .seconds(VideoSeconds._4)
+ .video(new ByteArrayInputStream("Example data".getBytes()))
+ .build();
+ Video video = client.videos().extend(params);
+ }
+ }
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.extend_(prompt: "x", seconds: :"4", video: StringIO.new("Example data"))
+
+ puts(video)
+ """,
+ },
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.deleteVideo,
+ "x-oaiMeta",
+ #{
+ name: "Delete video",
+ group: "videos",
+ path: "delete",
+ examples: #{
+ response: "",
+ request: #{
+ javascript: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const video = await client.videos.delete('video_123');
+
+ console.log(video.id);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.delete(
+ "video_123",
+ )
+ print(video.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Delete(context.TODO(), "video_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.delete("video_123")
+
+ puts(video)
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.VideoDeleteParams;
+ import com.openai.models.videos.VideoDeleteResponse;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoDeleteResponse video = client.videos().delete("video_123");
+ }
+ }
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.delete('video_123');
+
+ console.log(video.id);
+ """,
+ },
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.getVideo,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve video",
+ group: "videos",
+ path: "retrieve matching the provided identifier.",
+ examples: #{
+ response: "",
+ request: #{
+ javascript: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const video = await client.videos.retrieve('video_123');
+
+ console.log(video.id);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.retrieve(
+ "video_123",
+ )
+ print(video.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Get(context.TODO(), "video_123")
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.retrieve("video_123")
+
+ puts(video)
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoRetrieveParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ Video video = client.videos().retrieve("video_123");
+ }
+ }
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.retrieve('video_123');
+
+ console.log(video.id);
+ """,
+ },
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.retrieveVideoContent,
+ "x-oaiMeta",
+ #{
+ name: "Retrieve video content",
+ group: "videos",
+ path: "content",
+ examples: #{
+ response: "",
+ request: #{
+ javascript: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const response = await client.videos.downloadContent('video_123');
+
+ console.log(response);
+
+ const content = await response.blob();
+ console.log(content);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ response = client.videos.download_content(
+ video_id="video_123",
+ )
+ print(response)
+ content = response.read()
+ print(content)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ response, err := client.Videos.DownloadContent(
+ context.TODO(),
+ "video_123",
+ openai.VideoDownloadContentParams{},
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", response)
+ }
+
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ response = openai.videos.download_content("video_123")
+
+ puts(response)
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.core.http.HttpResponse;
+ import com.openai.models.videos.VideoDownloadContentParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ HttpResponse response = client.videos().downloadContent("video_123");
+ }
+ }
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const response = await client.videos.downloadContent('video_123');
+
+ console.log(response);
+
+ const content = await response.blob();
+ console.log(content);
+ """,
+ },
+ },
+ }
+);
+
+@@extension(
+ Azure.AI.Projects.VideoGeneration.createVideoRemix,
+ "x-oaiMeta",
+ #{
+ name: "Remix video",
+ group: "videos",
+ path: "remix using the provided prompt.",
+ examples: #{
+ request: #{
+ curl: """
+ curl -X POST https://api.openai.com/v1/videos/video_123/remix \\
+ -H "Authorization: Bearer $OPENAI_API_KEY" \\
+ -H "Content-Type: application/json" \\
+ -d '{
+ "prompt": "Extend the scene with the cat taking a bow to the cheering audience"
+ }'
+
+ """,
+ javascript: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI();
+
+ const video = await client.videos.remix('video_123', { prompt: 'Extend the scene with the cat taking a bow to the cheering audience' });
+
+ console.log(video.id);
+
+ """,
+ python: """
+ import os
+ from openai import OpenAI
+
+ client = OpenAI(
+ api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
+ )
+ video = client.videos.remix(
+ video_id="video_123",
+ prompt="x",
+ )
+ print(video.id)
+ """,
+ go: """
+ package main
+
+ import (
+ "context"
+ "fmt"
+
+ "github.com/openai/openai-go"
+ "github.com/openai/openai-go/option"
+ )
+
+ func main() {
+ client := openai.NewClient(
+ option.WithAPIKey("My API Key"),
+ )
+ video, err := client.Videos.Remix(
+ context.TODO(),
+ "video_123",
+ openai.VideoRemixParams{
+ Prompt: "x",
+ },
+ )
+ if err != nil {
+ panic(err.Error())
+ }
+ fmt.Printf("%+v
+ ", video.ID)
+ }
+
+ """,
+ ruby: """
+ require "openai"
+
+ openai = OpenAI::Client.new(api_key: "My API Key")
+
+ video = openai.videos.remix("video_123", prompt: "x")
+
+ puts(video)
+ """,
+ java: """
+ package com.openai.example;
+
+ import com.openai.client.OpenAIClient;
+ import com.openai.client.okhttp.OpenAIOkHttpClient;
+ import com.openai.models.videos.Video;
+ import com.openai.models.videos.VideoRemixParams;
+
+ public final class Main {
+ private Main() {}
+
+ public static void main(String[] args) {
+ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
+
+ VideoRemixParams params = VideoRemixParams.builder()
+ .videoId("video_123")
+ .prompt("x")
+ .build();
+ Video video = client.videos().remix(params);
+ }
+ }
+ """,
+ `node.js`: """
+ import OpenAI from 'openai';
+
+ const client = new OpenAI({
+ apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
+ });
+
+ const video = await client.videos.remix('video_123', { prompt: 'x' });
+
+ console.log(video.id);
+ """,
+ },
+ response: """
+ {
+ "id": "video_456",
+ "object": "video",
+ "model": "sora-2",
+ "status": "queued",
+ "progress": 0,
+ "created_at": 1712698600,
+ "size": "720x1280",
+ "seconds": "8",
+ "remixed_from_video_id": "video_123"
+ }
+
+ """,
+ },
+ }
+);
diff --git a/specification/ai-foundry/data-plane/Foundry/src/schedules/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/schedules/routes.tsp
index edff2f5d25de..cc88560142bc 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/schedules/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/schedules/routes.tsp
@@ -7,10 +7,12 @@ namespace Azure.AI.Projects;
alias SchedulesPreviewHeader = WithRequiredFoundryPreviewHeader;
alias SchedulesFilterQueryParams = {
+ /** The type query parameter. */
@query("type")
@doc("Filter by the type of schedule.")
type?: ScheduleTaskType;
+ /** The enabled query parameter. */
@query("enabled")
@doc("Filter by the enabled status.")
enabled?: boolean;
@@ -77,10 +79,12 @@ interface Schedules {
@get
getRun is FoundryDataPlaneOperation<
{
+ /** The schedule id path parameter. */
@path
@doc("The unique identifier of the schedule.")
schedule_id: string;
+ /** The run id path parameter. */
@path
@doc("The unique identifier of the schedule run.")
run_id: string;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-agent-contracts/client.tsp b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-agent-contracts/client.tsp
index 91d09ddd686d..e5d7d2538f39 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-agent-contracts/client.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-agent-contracts/client.tsp
@@ -7,8 +7,8 @@ import "../agents-containers/routes.tsp";
import "../agents-invocations_ws/routes.tsp";
import "../memory-stores/routes.tsp";
import "../skills/routes.tsp";
-import "../openai-conversations/routes.tsp";
-import "../openai-responses/routes.tsp";
+import "../openai/conversations/routes.tsp";
+import "../openai/responses/routes.tsp";
import "../toolboxes/routes.tsp";
using Azure.ClientGenerator.Core;
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-agent-contracts/tspconfig.yaml b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-agent-contracts/tspconfig.yaml
index 69484d353601..f95b96dd7334 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-agent-contracts/tspconfig.yaml
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-agent-contracts/tspconfig.yaml
@@ -12,8 +12,8 @@ options:
- specification/ai-foundry/data-plane/Foundry/src/common
- specification/ai-foundry/data-plane/Foundry/src/memory-stores
- specification/ai-foundry/data-plane/Foundry/src/skills
- - specification/ai-foundry/data-plane/Foundry/src/openai-conversations
- - specification/ai-foundry/data-plane/Foundry/src/openai-responses
+ - specification/ai-foundry/data-plane/Foundry/src/openai/conversations
+ - specification/ai-foundry/data-plane/Foundry/src/openai/responses
- specification/ai-foundry/data-plane/Foundry/src/toolboxes
imports:
- "@azure-tools/typespec-azure-core"
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-extensions-openai/client.tsp b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-extensions-openai/client.tsp
index 2f9342743ce5..bd87ba9e39b0 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-extensions-openai/client.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-extensions-openai/client.tsp
@@ -1,7 +1,7 @@
import "../sdk-common/error.default.tsp";
import "../common/servicepatterns.tsp";
-import "../openai-conversations/routes.tsp";
-import "../openai-responses/routes.tsp";
+import "../openai/conversations/routes.tsp";
+import "../openai/responses/routes.tsp";
import "../toolboxes/models.tsp";
import "../agents/models.tsp";
import "../skills/models.tsp";
@@ -413,6 +413,7 @@ namespace Azure.AI.Projects {
);
@@clientName(A2APreviewTool.base_url, "BaseUri");
@@clientName(FabricIQPreviewTool.server_url, "ServerUri");
+ @@clientName(WebIQPreviewTool.server_url, "ServerUri");
@@clientName(
CaptureStructuredOutputsTool.outputs,
"OutputDefinition",
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-extensions-openai/tspconfig.yaml b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-extensions-openai/tspconfig.yaml
index bdb2f531a446..c8908d4fa696 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-extensions-openai/tspconfig.yaml
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-extensions-openai/tspconfig.yaml
@@ -8,24 +8,29 @@ options:
emitter-output-dir: "{output-dir}/{service-dir}/{package-name}"
package-name: Azure.AI.Extensions.OpenAI
api-version: "v1"
- # plugins:
- # - "../codegen"
+ plugins:
+ - "../codegen"
"@azure-tools/typespec-client-generator-cli":
additionalDirectories:
- specification/ai-foundry/data-plane/Foundry/src/agents
- specification/ai-foundry/data-plane/Foundry/src/common
- specification/ai-foundry/data-plane/Foundry/src/memory-stores
- - specification/ai-foundry/data-plane/Foundry/src/openai-conversations
- - specification/ai-foundry/data-plane/Foundry/src/openai-responses
+ - specification/ai-foundry/data-plane/Foundry/src/openai/conversations
+ - specification/ai-foundry/data-plane/Foundry/src/openai/responses
- specification/ai-foundry/data-plane/Foundry/src/tools
- specification/ai-foundry/data-plane/Foundry/src/toolboxes
- specification/ai-foundry/data-plane/Foundry/src/skills
- specification/ai-foundry/data-plane/Foundry/src/agents
+ "typespec-extension-exporter":
+ keys: x-ms-foundry-meta
+ language: csharp
+ output-shape: list
+ output-file: Azure.AI.Extensions.OpenAI_experimental.csv
+ emitter-output-dir: "{cwd}/../../codegen/src/" # run npx tsp compile from within `TempTypeSpecFiles` folder
+ namespace: Azure.AI.Extensions.OpenAI
imports:
- "@azure-tools/typespec-azure-core"
- "@azure-tools/typespec-azure-core/experimental"
- - "@azure-tools/typespec-client-generator-core"
- # Note: Imports for OpenAI types may use alternate views per tspconfig.yaml
- "@azure-tools/openai-typespec/models/responses"
linter:
extends:
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects-agents/client.tsp b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects-agents/client.tsp
index 1c31d3fc6713..994be4187b43 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects-agents/client.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects-agents/client.tsp
@@ -117,6 +117,8 @@ namespace Azure.AI.Projects {
@@clientName(ToolArgumentBinding, "StructuredInputToolArgumentBinding");
@@clientName(FabricIQPreviewTool.server_url, "ServerUri");
@@clientName(FabricIQPreviewToolboxTool.server_url, "ServerUri");
+ @@clientName(WebIQPreviewTool.server_url, "ServerUri");
+ @@clientName(WebIQPreviewToolboxTool.server_url, "ServerUri");
// --------------------------------------------------------------------------------
// Renames and visibility changes for targeted suppressions
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects-agents/tspconfig.yaml b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects-agents/tspconfig.yaml
index fc1c18a976fe..ac33078ddc8b 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects-agents/tspconfig.yaml
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects-agents/tspconfig.yaml
@@ -6,16 +6,24 @@ options:
emitter-output-dir: "{output-dir}/{service-dir}/{package-name}"
package-name: Azure.AI.Projects.Agents
api-version: "v1"
- # plugins:
- # - "../codegen"
+ plugins:
+ - "../codegen"
+ "typespec-extension-exporter":
+ keys: x-ms-foundry-meta
+ language: csharp
+ output-shape: list
+ output-format: csv
+ output-file: Azure.AI.Projects_experimental.csv
+ emitter-output-dir: "{cwd}/../../codegen/src/" # run npx tsp compile from within `TempTypeSpecFiles` folder
+ namespace: Azure.AI.Projects
"@azure-tools/typespec-client-generator-cli":
additionalDirectories:
- specification/ai-foundry/data-plane/Foundry/src/agents
- specification/ai-foundry/data-plane/Foundry/src/common
- specification/ai-foundry/data-plane/Foundry/src/memory-stores
- - specification/ai-foundry/data-plane/Foundry/src/openai-conversations
- - specification/ai-foundry/data-plane/Foundry/src/openai-evaluations
- - specification/ai-foundry/data-plane/Foundry/src/openai-responses
+ - specification/ai-foundry/data-plane/Foundry/src/openai/conversations
+ - specification/ai-foundry/data-plane/Foundry/src/openai/evaluations
+ - specification/ai-foundry/data-plane/Foundry/src/openai/responses
- specification/ai-foundry/data-plane/Foundry/src/red-teams
- specification/ai-foundry/data-plane/Foundry/src/tools
- specification/ai-foundry/data-plane/Foundry/src/toolboxes
@@ -29,6 +37,7 @@ imports:
- "@azure-tools/typespec-client-generator-core"
# Note: Imports for OpenAI types may use alternate views per tspconfig.yaml
- "@azure-tools/openai-typespec/models/evals"
+ - "@azure-tools/openai-typespec/models/fine-tuning"
- "@azure-tools/openai-typespec/models/responses"
linter:
extends:
@@ -38,7 +47,6 @@ linter:
"@azure-tools/typespec-azure-core/no-string-discriminator": "Use an extensible union instead of a plain string"
"@azure-tools/typespec-azure-core/bad-record-type": "We do want to use Record, and not Record. But this needs further investigation"
"@azure-tools/typespec-azure-core/use-standard-names": "PUT operations that return 200 should start with 'replace' or 'createOrReplace'"
- # The set of rules, disabled because of .external-readonly contains non compliant code.
"@azure-tools/typespec-azure-core/documentation-required": "Some OpenAI models do not contain docstrings."
"@azure-tools/typespec-azure-core/no-nullable": "Some OpenAI models still contain <> | null notation."
"@azure-tools/typespec-azure-core/no-closed-literal-union": "OpenAI incompliance"
@@ -47,3 +55,4 @@ linter:
"@azure-tools/typespec-azure-core/no-unknown": "unknowns are used in OpenAI package."
"@azure-tools/typespec-azure-core/no-query-explode": "Explode is used in OpenAI package."
"@azure-tools/typespec-client-generator-core/property-name-conflict": "OpenAI package has conflict."
+ "@azure-tools/typespec-azure-core/no-enum": "OpenAI uses enums."
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects/client.tsp b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects/client.tsp
index e8b6678fc5bd..8c0563d67825 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects/client.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects/client.tsp
@@ -177,6 +177,7 @@ namespace Azure.AI.Projects;
// Insights stores sub‐client
// --------------------------------------------------------------------------------
@@clientName(InsightSummary.method, "MethodName", "csharp");
+@@clientName(Insight, "ProjectsInsight");
// --------------------------------------------------------------------------------
// Memory stores sub‐client
@@ -207,6 +208,7 @@ namespace Azure.AI.Projects;
// --------------------------------------------------------------------------------
@@clientName(Azure.Core.Foundations.ResourceBody.resource, "schedule");
+@@clientName(Schedule, "ProjectsSchedule");
@@alternateType(RecurrenceTrigger.startTime, utcDateTime, "csharp");
@@alternateType(RecurrenceTrigger.endTime, utcDateTime, "csharp");
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects/tspconfig.yaml b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects/tspconfig.yaml
index d73f1fed52dc..bc9e1fabb986 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects/tspconfig.yaml
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-csharp-azure-ai-projects/tspconfig.yaml
@@ -6,8 +6,31 @@ options:
emitter-output-dir: "{output-dir}/{service-dir}/{package-name}"
package-name: Azure.AI.Projects
api-version: "v1"
- # plugins:
- # - "../codegen"
+ plugins:
+ - "../codegen"
+ "typespec-extension-exporter":
+ keys: x-ms-foundry-meta
+ language: csharp
+ output-shape: list
+ output-format: csv
+ output-file: Azure.AI.Projects_experimental.csv
+ emitter-output-dir: "{cwd}/../../codegen/src/" # run npx tsp compile from within `TempTypeSpecFiles` folder
+ namespace: Azure.AI.Projects
+ "@azure-tools/typespec-client-generator-cli":
+ additionalDirectories:
+ - specification/ai-foundry/data-plane/Foundry/src/agents
+ - specification/ai-foundry/data-plane/Foundry/src/common
+ - specification/ai-foundry/data-plane/Foundry/src/memory-stores
+ - specification/ai-foundry/data-plane/Foundry/src/openai-conversations
+ - specification/ai-foundry/data-plane/Foundry/src/openai-evaluations
+ - specification/ai-foundry/data-plane/Foundry/src/openai-responses
+ - specification/ai-foundry/data-plane/Foundry/src/red-teams
+ - specification/ai-foundry/data-plane/Foundry/src/tools
+ - specification/ai-foundry/data-plane/Foundry/src/toolboxes
+ - specification/ai-foundry/data-plane/Foundry/src/skills
+ - specification/ai-foundry/data-plane/Foundry/src/agents-session-files
+ - specification/ai-foundry/data-plane/Foundry/src/managed-blueprints
+ - specification/ai-foundry/data-plane/Foundry/src/agents-optimization
imports:
- "@azure-tools/typespec-azure-core"
- "@azure-tools/typespec-azure-core/experimental"
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-agents/client.tsp b/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-agents/client.tsp
index f2c7360eb610..8b1fe50c5a98 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-agents/client.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-agents/client.tsp
@@ -10,8 +10,8 @@ import "../agents-session-files/routes.tsp";
import "../agents-optimization/routes.tsp";
// We don't need the operations for these subclients, just the models
// so we can customize visibility where necessary.
-import "../openai-responses/models.tsp";
-import "../openai-conversations/routes.tsp";
+import "../openai/responses/models.tsp";
+import "../openai/conversations/routes.tsp";
using Azure.ClientGenerator.Core;
using Azure.Core.Experimental;
@@ -197,8 +197,10 @@ using Azure.AI.Projects;
@@clientName(WorkIQPreviewTool, "WorkIqPreviewTool", "java");
@@clientName(FabricIQPreviewTool, "FabricIqPreviewTool", "java");
+@@clientName(WebIQPreviewTool, "WebIqPreviewTool", "java");
@@clientName(WorkIQPreviewToolboxTool, "WorkIqPreviewToolboxTool", "java");
@@clientName(FabricIQPreviewToolboxTool, "FabricIqPreviewToolboxTool", "java");
+@@clientName(WebIQPreviewToolboxTool, "WebIqPreviewToolboxTool", "java");
@@clientName(AgentOptimizationJobs.create, "createOptimizationJob", "java");
@@clientName(AgentOptimizationJobs.get, "getOptimizationJob", "java");
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-agents/tspconfig.yaml b/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-agents/tspconfig.yaml
index fc5728c7f371..fb28981480b1 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-agents/tspconfig.yaml
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-agents/tspconfig.yaml
@@ -25,19 +25,24 @@ options:
flavor: azure
"@azure-tools/typespec-client-generator-cli":
additionalDirectories:
- - "specification/ai-foundry/data-plane/Foundry/src/agents"
- - "specification/ai-foundry/data-plane/Foundry/src/agents-session-files"
- - "specification/ai-foundry/data-plane/Foundry/src/agents-optimization"
- - "specification/ai-foundry/data-plane/Foundry/src/common"
- - "specification/ai-foundry/data-plane/Foundry/src/memory-stores"
- - "specification/ai-foundry/data-plane/Foundry/src/openai-conversations"
- - "specification/ai-foundry/data-plane/Foundry/src/openai-responses"
- - "specification/ai-foundry/data-plane/Foundry/src/openai-evaluations"
- - "specification/ai-foundry/data-plane/Foundry/src/red-teams"
- - "specification/ai-foundry/data-plane/Foundry/src/sdk-common"
- - "specification/ai-foundry/data-plane/Foundry/src/skills"
- - "specification/ai-foundry/data-plane/Foundry/src/toolboxes"
- - "specification/ai-foundry/data-plane/Foundry/src/tools"
+ - "specification/ai-foundry/data-plane/Foundry/src/.external-readonly/"
+ - "specification/ai-foundry/data-plane/Foundry/src/agents/"
+ - "specification/ai-foundry/data-plane/Foundry/src/common/"
+ - "specification/ai-foundry/data-plane/Foundry/src/connections/"
+ - "specification/ai-foundry/data-plane/Foundry/src/datasets/"
+ - "specification/ai-foundry/data-plane/Foundry/src/indexes/"
+ - "specification/ai-foundry/data-plane/Foundry/src/deployments/"
+ - "specification/ai-foundry/data-plane/Foundry/src/red-teams/"
+ - "specification/ai-foundry/data-plane/Foundry/src/evaluation-rules/"
+ - "specification/ai-foundry/data-plane/Foundry/src/openai/evaluations/"
+ - "specification/ai-foundry/data-plane/Foundry/src/evaluation-taxonomies/"
+ - "specification/ai-foundry/data-plane/Foundry/src/evaluators/"
+ - "specification/ai-foundry/data-plane/Foundry/src/insights/"
+ - "specification/ai-foundry/data-plane/Foundry/src/schedules/"
+ - "specification/ai-foundry/data-plane/Foundry/src/memory-stores/"
+ - "specification/ai-foundry/data-plane/Foundry/src/conversations/"
+ - "specification/ai-foundry/data-plane/Foundry/src/responses/"
+ - "specification/ai-foundry/data-plane/Foundry/src/tools/"
# Exports the @extension("x-ms-foundry-meta", ...) beta entities for the Java emitter consumption
# - run `tsp-client sync` from package folder
# - run `cd TempTypeSpecFiles && npm install --no-save typespec-extension-exporter`
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-projects/client.tsp b/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-projects/client.tsp
index a17a9ae96c9b..4f45b3ca5825 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-projects/client.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-java-azure-ai-projects/client.tsp
@@ -8,7 +8,7 @@ import "../models/routes.tsp";
import "../deployments/routes.tsp";
import "../red-teams/routes.tsp";
import "../evaluation-rules/routes.tsp";
-import "../openai-evaluations/models.tsp";
+import "../openai/evaluations/models.tsp";
import "../evaluation-taxonomies/routes.tsp";
import "../evaluators/routes.tsp";
import "../insights/routes.tsp";
diff --git a/specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects/tspconfig.yaml b/specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects/tspconfig.yaml
index 91ed60a6a0a4..4a9dbce59f0e 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects/tspconfig.yaml
+++ b/specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects/tspconfig.yaml
@@ -40,9 +40,9 @@ options:
- specification/ai-foundry/data-plane/Foundry/src/insights
- specification/ai-foundry/data-plane/Foundry/src/memory-stores
- specification/ai-foundry/data-plane/Foundry/src/models
- - specification/ai-foundry/data-plane/Foundry/src/openai-conversations
- - specification/ai-foundry/data-plane/Foundry/src/openai-evaluations
- - specification/ai-foundry/data-plane/Foundry/src/openai-responses
+ - specification/ai-foundry/data-plane/Foundry/src/openai/conversations
+ - specification/ai-foundry/data-plane/Foundry/src/openai/evaluations
+ - specification/ai-foundry/data-plane/Foundry/src/openai/responses
- specification/ai-foundry/data-plane/Foundry/src/red-teams
- specification/ai-foundry/data-plane/Foundry/src/routines
- specification/ai-foundry/data-plane/Foundry/src/schedules
diff --git a/specification/ai-foundry/data-plane/Foundry/src/skills/routes.tsp b/specification/ai-foundry/data-plane/Foundry/src/skills/routes.tsp
index 3a8fd61c21e7..fb3547c030f3 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/skills/routes.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/skills/routes.tsp
@@ -102,7 +102,10 @@ interface Skills {
@path
name: SkillName;
+ /** The content type of the request body. */
@header contentType: "multipart/form-data";
+
+ /** The multipart request content. */
@multipartBody content: CreateSkillVersionFromFilesBody;
} & SkillsPreviewHeader,
SkillVersion
diff --git a/specification/ai-foundry/data-plane/Foundry/src/toolboxes/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/toolboxes/models.tsp
index de4b3c3ed57c..7c9b977ac5d3 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/toolboxes/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/toolboxes/models.tsp
@@ -4,6 +4,7 @@ import "../agents/models.tsp";
import "../skills/models.tsp";
using TypeSpec.Http;
+using TypeSpec.OpenAPI;
namespace Azure.AI.Projects;
@@ -78,6 +79,8 @@ alias ToolboxBrowserAutomationPreviewToolType = "browser_automation_preview";
alias ToolboxReminderPreviewToolType = "reminder_preview";
alias ToolboxWorkIQPreviewToolType = "work_iq_preview";
alias ToolboxFabricIQPreviewToolType = "fabric_iq_preview";
+alias ToolboxWebIQPreviewToolType = "web_iq_preview";
+alias ToolboxSearchToolType = "toolbox_search";
alias ToolboxSearchPreviewToolType = "toolbox_search_preview";
/**
@@ -95,6 +98,8 @@ union ToolboxToolType {
reminder_preview: ToolboxReminderPreviewToolType,
work_iq_preview: ToolboxWorkIQPreviewToolType,
fabric_iq_preview: ToolboxFabricIQPreviewToolType,
+ web_iq_preview: ToolboxWebIQPreviewToolType,
+ toolbox_search: ToolboxSearchToolType,
toolbox_search_preview: ToolboxSearchPreviewToolType,
}
@@ -163,6 +168,7 @@ model OpenApiToolboxTool extends ToolboxTool {
/**
* An A2A tool stored in a toolbox.
*/
+@extension("x-ms-foundry-meta", PreviewTool)
model A2APreviewToolboxTool extends ToolboxTool {
type: ToolboxA2APreviewToolType;
...ToolFields;
@@ -171,6 +177,7 @@ model A2APreviewToolboxTool extends ToolboxTool {
/**
* A browser automation tool stored in a toolbox.
*/
+@extension("x-ms-foundry-meta", PreviewTool)
model BrowserAutomationPreviewToolboxTool extends ToolboxTool {
type: ToolboxBrowserAutomationPreviewToolType;
...ToolFields;
@@ -179,6 +186,7 @@ model BrowserAutomationPreviewToolboxTool extends ToolboxTool {
/**
* A reminder tool stored in a toolbox.
*/
+@extension("x-ms-foundry-meta", PreviewTool)
model ReminderPreviewToolboxTool extends ToolboxTool {
type: ToolboxReminderPreviewToolType;
}
@@ -186,6 +194,7 @@ model ReminderPreviewToolboxTool extends ToolboxTool {
/**
* A WorkIQ tool stored in a toolbox.
*/
+@extension("x-ms-foundry-meta", PreviewTool)
model WorkIQPreviewToolboxTool extends ToolboxTool {
type: ToolboxWorkIQPreviewToolType;
...ToolFields;
@@ -194,20 +203,41 @@ model WorkIQPreviewToolboxTool extends ToolboxTool {
/**
* A FabricIQ tool stored in a toolbox.
*/
+@extension("x-ms-foundry-meta", PreviewTool)
model FabricIQPreviewToolboxTool extends ToolboxTool {
type: ToolboxFabricIQPreviewToolType;
...ToolFields;
}
+/**
+ * A WebIQ tool stored in a toolbox.
+ */
+@extension("x-ms-foundry-meta", PreviewTool)
+model WebIQPreviewToolboxTool extends ToolboxTool {
+ type: ToolboxWebIQPreviewToolType;
+ ...ToolFields;
+}
+
/**
* A toolbox search tool stored in a toolbox.
*/
+@extension("x-ms-foundry-meta", PreviewTool)
model ToolboxSearchPreviewToolboxTool extends ToolboxTool {
/**
* The type of the tool. Always `toolbox_search_preview`.
*/
type: ToolboxSearchPreviewToolType;
}
+
+/**
+ * A toolbox search tool stored in a toolbox.
+ */
+model ToolSearchToolboxTool extends ToolboxTool {
+ /**
+ * The type of the tool. Always `toolbox_search`.
+ */
+ type: ToolboxSearchToolType;
+}
@doc("Policy configuration for a toolbox, including content safety and other governance settings.")
model ToolboxPolicies {
@doc("Responsible AI content filtering configuration.")
diff --git a/specification/ai-foundry/data-plane/Foundry/src/tools/models.tsp b/specification/ai-foundry/data-plane/Foundry/src/tools/models.tsp
index bb41a073ac4f..ac1abb7c79c4 100644
--- a/specification/ai-foundry/data-plane/Foundry/src/tools/models.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/src/tools/models.tsp
@@ -2,6 +2,7 @@ import "../memory-stores/models.tsp";
using Azure.Core.Experimental;
using TypeSpec.Versioning;
+using TypeSpec.OpenAPI;
#suppress "@azure-tools/typespec-azure-core/experimental-feature" "Using experimental feature"
namespace Azure.AI.Projects {
@@ -19,6 +20,7 @@ namespace Azure.AI.Projects {
memory_search_preview: "memory_search_preview",
work_iq_preview: "work_iq_preview",
fabric_iq_preview: "fabric_iq_preview",
+ web_iq_preview: "web_iq_preview",
toolbox_search_preview: "toolbox_search_preview",
}
@@ -34,6 +36,8 @@ namespace Azure.AI.Projects {
memory_search: "memory_search",
}
+ const PreviewTool = #{ required_previews: #["preview_tool"] };
+
@@copyVariants(OpenAI.ToolType, Azure.AI.Projects._PreviewAgentToolType);
@@copyVariants(OpenAI.ToolType, Azure.AI.Projects._AgentToolType);
@@ -181,6 +185,7 @@ namespace Azure.AI.Projects {
/**
* The fabric data agent tool parameters.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model FabricDataAgentToolParameters {
/**
* The project connections attached to this tool. There can be a maximum of 1 connection
@@ -193,6 +198,7 @@ namespace Azure.AI.Projects {
/**
* The input definition information for a Microsoft Fabric tool as used to configure an agent.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model MicrosoftFabricPreviewTool extends OpenAI.Tool {
/**
* The object type, which is always 'fabric_dataagent_preview'.
@@ -208,6 +214,7 @@ namespace Azure.AI.Projects {
/**
* The sharepoint grounding tool parameters.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model SharepointGroundingToolParameters {
/**
* The project connections attached to this tool. There can be a maximum of 1 connection
@@ -220,6 +227,7 @@ namespace Azure.AI.Projects {
/**
* The input definition information for a sharepoint tool as used to configure an agent.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model SharepointPreviewTool extends OpenAI.Tool {
/**
* The object type, which is always 'sharepoint_grounding_preview'.
@@ -344,6 +352,7 @@ namespace Azure.AI.Projects {
/**
* The input definition information for a Bing custom search tool as used to configure an agent.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model BingCustomSearchPreviewTool extends OpenAI.Tool {
/**
* The object type, which is always 'bing_custom_search_preview'.
@@ -359,6 +368,7 @@ namespace Azure.AI.Projects {
/**
* The input definition information for a Browser Automation Tool, as used to configure an Agent.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model BrowserAutomationPreviewTool extends OpenAI.Tool {
/**
* The object type, which is always 'browser_automation_preview'.
@@ -374,6 +384,7 @@ namespace Azure.AI.Projects {
/**
* Definition of input parameters for the Browser Automation Tool.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model BrowserAutomationToolParameters {
/**
* The project connection parameters associated with the Browser Automation Tool.
@@ -384,6 +395,7 @@ namespace Azure.AI.Projects {
/**
* Definition of input parameters for the connection used by the Browser Automation Tool.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model BrowserAutomationToolConnectionParameters {
/**
* The ID of the project connection to your Azure Playwright resource.
@@ -647,6 +659,7 @@ namespace Azure.AI.Projects {
/**
* The bing custom search tool parameters.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model BingCustomSearchToolParameters {
/**
* The project connections attached to this tool. There can be a maximum of 1 connection
@@ -659,6 +672,7 @@ namespace Azure.AI.Projects {
/**
* A bing custom search configuration.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model BingCustomSearchConfiguration {
/**
* Project connection id for grounding with bing search
@@ -767,6 +781,7 @@ namespace Azure.AI.Projects {
/**
* An agent implementing the A2A protocol.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model A2APreviewTool extends OpenAI.Tool {
/**
* The type of the tool. Always `"a2a_preview`.
@@ -801,6 +816,7 @@ namespace Azure.AI.Projects {
/**
* A WorkIQ server-side tool.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model WorkIQPreviewTool extends OpenAI.Tool {
/**
* The object type, which is always 'work_iq_preview'.
@@ -816,6 +832,7 @@ namespace Azure.AI.Projects {
/**
* A FabricIQ server-side tool.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model FabricIQPreviewTool extends OpenAI.Tool {
/**
* The object type, which is always 'fabric_iq_preview'.
@@ -845,9 +862,43 @@ namespace Azure.AI.Projects {
require_approval?: OpenAI.MCPToolRequireApproval | string | null = "always";
}
+ /**
+ * A WebIQ server-side tool.
+ */
+ @extension("x-ms-foundry-meta", PreviewTool)
+ model WebIQPreviewTool extends OpenAI.Tool {
+ /**
+ * The object type, which is always 'web_iq_preview'.
+ */
+ type: "web_iq_preview";
+
+ /**
+ * The ID of the WebIQ project connection.
+ */
+ project_connection_id: string;
+
+ /**
+ * The label of the WebIQ MCP server to connect to.
+ */
+ server_label?: string;
+
+ /**
+ * The URL of the WebIQ MCP server. If not provided, the URL from the project connection will be used.
+ */
+ server_url?: url;
+
+ /**
+ * Whether the agent requires approval before executing actions. Default is always.
+ */
+ #suppress "@azure-tools/typespec-autorest/union-unsupported" "require_approval uses OpenAI union type."
+ #suppress "@azure-tools/typespec-azure-core/no-unnamed-union" "Matching OpenAI MCP tool pattern."
+ require_approval?: OpenAI.MCPToolRequireApproval | string | null = "always";
+ }
+
/**
* A tool for integrating memories into the agent.
*/
+ @extension("x-ms-foundry-meta", PreviewTool)
model MemorySearchPreviewTool extends OpenAI.Tool {
/**
* The type of the tool. Always `memory_search_preview`.
@@ -976,6 +1027,7 @@ namespace Azure.AI.Projects {
// ==============================================================================
@doc("A SharePoint grounding tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model SharepointGroundingToolCall extends OpenAI.OutputItem {
type: "sharepoint_grounding_preview_call";
@@ -990,6 +1042,7 @@ namespace Azure.AI.Projects {
}
@doc("The output of a SharePoint grounding tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model SharepointGroundingToolCallOutput extends OpenAI.OutputItem {
type: "sharepoint_grounding_preview_call_output";
@@ -1040,6 +1093,7 @@ namespace Azure.AI.Projects {
// ==============================================================================
@doc("A Bing custom search tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model BingCustomSearchToolCall extends OpenAI.OutputItem {
type: "bing_custom_search_preview_call";
@@ -1054,6 +1108,7 @@ namespace Azure.AI.Projects {
}
@doc("The output of a Bing custom search tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model BingCustomSearchToolCallOutput extends OpenAI.OutputItem {
type: "bing_custom_search_preview_call_output";
@@ -1110,6 +1165,7 @@ namespace Azure.AI.Projects {
// ==============================================================================
@doc("A browser automation tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model BrowserAutomationToolCall extends OpenAI.OutputItem {
type: "browser_automation_preview_call";
@@ -1124,6 +1180,7 @@ namespace Azure.AI.Projects {
}
@doc("The output of a browser automation tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model BrowserAutomationToolCallOutput extends OpenAI.OutputItem {
type: "browser_automation_preview_call_output";
@@ -1142,6 +1199,7 @@ namespace Azure.AI.Projects {
// ==============================================================================
@doc("A Fabric data agent tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model FabricDataAgentToolCall extends OpenAI.OutputItem {
type: "fabric_dataagent_preview_call";
@@ -1156,6 +1214,7 @@ namespace Azure.AI.Projects {
}
@doc("The output of a Fabric data agent tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model FabricDataAgentToolCallOutput extends OpenAI.OutputItem {
type: "fabric_dataagent_preview_call_output";
@@ -1174,6 +1233,7 @@ namespace Azure.AI.Projects {
// ==============================================================================
@doc("An Azure Function tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model AzureFunctionToolCall extends OpenAI.OutputItem {
type: "azure_function_call";
@@ -1212,6 +1272,7 @@ namespace Azure.AI.Projects {
// ==============================================================================
@doc("An A2A (Agent-to-Agent) tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model A2AToolCall extends OpenAI.OutputItem {
type: "a2a_preview_call";
@@ -1229,6 +1290,7 @@ namespace Azure.AI.Projects {
}
@doc("The output of an A2A (Agent-to-Agent) tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model A2AToolCallOutput extends OpenAI.OutputItem {
type: "a2a_preview_call_output";
@@ -1250,6 +1312,7 @@ namespace Azure.AI.Projects {
// ==============================================================================
@doc("A memory search tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model MemorySearchToolCall extends OpenAI.OutputItem {
type: "memory_search_call";
@@ -1261,6 +1324,7 @@ namespace Azure.AI.Projects {
}
@doc("A memory command tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model MemoryCommandToolCall extends OpenAI.OutputItem {
type: "memory_command_preview_call";
@@ -1275,6 +1339,7 @@ namespace Azure.AI.Projects {
}
@doc("The output of a memory command tool call.")
+ @extension("x-ms-foundry-meta", PreviewTool)
model MemoryCommandToolCallOutput extends OpenAI.OutputItem {
type: "memory_command_preview_call_output";
diff --git a/specification/ai-foundry/data-plane/Foundry/tag-definitions.tsp b/specification/ai-foundry/data-plane/Foundry/tag-definitions.tsp
index 14ddb3bac865..de5d8c735434 100644
--- a/specification/ai-foundry/data-plane/Foundry/tag-definitions.tsp
+++ b/specification/ai-foundry/data-plane/Foundry/tag-definitions.tsp
@@ -68,7 +68,7 @@ using OpenAPI;
},
#{
name: "EvaluatorGenerationJobs",
- parent: "Platform APIs",
+ parent: "Evaluations",
summary: "Evaluator generation jobs",
},
#{ name: "Evaluations" },